@syntrologie/runtime-sdk 2.4.1 → 2.6.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CAPABILITIES.md +66 -1
- package/dist/SmartCanvasApp.d.ts +5 -3
- package/dist/actions/executors/index.d.ts +1 -2
- package/dist/actions/index.d.ts +2 -2
- package/dist/actions/schema.d.ts +19111 -20709
- package/dist/actions/schema.js +5 -2
- package/dist/actions/types.d.ts +45 -48
- package/dist/anchor/AnchorResolver.d.ts +18 -0
- package/dist/anchor/index.d.ts +2 -0
- package/dist/api.d.ts +3 -8
- package/dist/apps/examples/gamification-app.example.d.ts +8 -8
- package/dist/{chunk-4NYS7GAW.js → chunk-BU4Z6PD7.js} +45 -7
- package/dist/chunk-BU4Z6PD7.js.map +7 -0
- package/dist/{chunk-QGWATS3Z.js → chunk-Q4WGXNKC.js} +2775 -1052
- package/dist/chunk-Q4WGXNKC.js.map +7 -0
- package/dist/{chunk-OGTCFYR3.js → chunk-R5DNAIRI.js} +45 -34
- package/dist/chunk-R5DNAIRI.js.map +7 -0
- package/dist/chunk-XDYJ64IN.js +178 -0
- package/dist/chunk-XDYJ64IN.js.map +7 -0
- package/dist/components/ShadowCanvasOverlay.d.ts +2 -20
- package/dist/components/TileIcon.d.ts +14 -0
- package/dist/config/schema.d.ts +5529 -3620
- package/dist/config/schema.js +21 -61
- package/dist/config/schema.js.map +3 -3
- package/dist/context/schema.d.ts +16 -16
- package/dist/decisions/schema.d.ts +357 -2789
- package/dist/decisions/schema.js +7 -1
- package/dist/decisions/types.d.ts +24 -2
- package/dist/events/registerConfigPredicates.d.ts +7 -10
- package/dist/events/schema.d.ts +12 -12
- package/dist/experiments/adapters/growthbook.d.ts +2 -0
- package/dist/experiments/types.d.ts +7 -0
- package/dist/hooks/useShadowCanvasConfig.d.ts +6 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +154 -186
- package/dist/index.js.map +3 -3
- package/dist/overlays/schema.d.ts +70 -70
- package/dist/react.js +4 -3
- package/dist/react.js.map +1 -1
- package/dist/runtime.d.ts +3 -0
- package/dist/smart-canvas.esm.js +123 -84
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +3271 -1210
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +123 -84
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/surfaces/types.d.ts +2 -1
- package/dist/theme/ThemeProvider.d.ts +11 -16
- package/dist/theme/defaultTheme.d.ts +6 -1
- package/dist/theme/index.d.ts +3 -4
- package/dist/theme/types.d.ts +11 -0
- package/dist/version.d.ts +1 -1
- package/dist/widgets/WidgetRegistry.d.ts +1 -0
- package/package.json +9 -8
- package/schema/canvas-config.schema.json +10583 -1049
- package/scripts/validate-config.mjs +180 -0
- package/dist/actions/executors/tour.d.ts +0 -18
- package/dist/chunk-4NYS7GAW.js.map +0 -7
- package/dist/chunk-OGTCFYR3.js.map +0 -7
- package/dist/chunk-QGWATS3Z.js.map +0 -7
- package/dist/hooks/useHostPatches.d.ts +0 -9
- package/dist/theme/extractHostTheme.d.ts +0 -14
package/dist/smart-canvas.min.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var SyntrologieSDK=(()=>{var Jk=Object.create;var Us=Object.defineProperty;var eR=Object.getOwnPropertyDescriptor;var tR=Object.getOwnPropertyNames;var nR=Object.getPrototypeOf,iR=Object.prototype.hasOwnProperty;var T_=t=>{throw TypeError(t)};var rR=(t,e,n)=>e in t?Us(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Yn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),k_=(t,e)=>{for(var n in e)Us(t,n,{get:e[n],enumerable:!0})},R_=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of tR(e))!iR.call(t,r)&&r!==n&&Us(t,r,{get:()=>e[r],enumerable:!(i=eR(e,r))||i.enumerable});return t};var ee=(t,e,n)=>(n=t!=null?Jk(nR(t)):{},R_(e||!t||!t.__esModule?Us(n,"default",{value:t,enumerable:!0}):n,t)),aR=t=>R_(Us({},"__esModule",{value:!0}),t);var V=(t,e,n)=>rR(t,typeof e!="symbol"?e+"":e,n),O_=(t,e,n)=>e.has(t)||T_("Cannot "+n);var ge=(t,e,n)=>(O_(t,e,"read from private field"),n?n.call(t):e.get(t)),ir=(t,e,n)=>e.has(t)?T_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Wn=(t,e,n,i)=>(O_(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n);var U_=Yn(te=>{"use strict";var th=Symbol.for("react.transitional.element"),oR=Symbol.for("react.portal"),sR=Symbol.for("react.fragment"),lR=Symbol.for("react.strict_mode"),cR=Symbol.for("react.profiler"),uR=Symbol.for("react.consumer"),dR=Symbol.for("react.context"),fR=Symbol.for("react.forward_ref"),pR=Symbol.for("react.suspense"),hR=Symbol.for("react.memo"),H_=Symbol.for("react.lazy"),gR=Symbol.for("react.activity"),M_=Symbol.iterator;function mR(t){return t===null||typeof t!="object"?null:(t=M_&&t[M_]||t["@@iterator"],typeof t=="function"?t:null)}var I_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z_=Object.assign,B_={};function ro(t,e,n){this.props=t,this.context=e,this.refs=B_,this.updater=n||I_}ro.prototype.isReactComponent={};ro.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};ro.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function $_(){}$_.prototype=ro.prototype;function nh(t,e,n){this.props=t,this.context=e,this.refs=B_,this.updater=n||I_}var ih=nh.prototype=new $_;ih.constructor=nh;z_(ih,ro.prototype);ih.isPureReactComponent=!0;var N_=Array.isArray;function eh(){}var Me={H:null,A:null,T:null,S:null},F_=Object.prototype.hasOwnProperty;function rh(t,e,n){var i=n.ref;return{$$typeof:th,type:t,key:e,ref:i!==void 0?i:null,props:n}}function vR(t,e){return rh(t.type,e,t.props)}function ah(t){return typeof t=="object"&&t!==null&&t.$$typeof===th}function yR(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var D_=/\/+/g;function Jp(t,e){return typeof t=="object"&&t!==null&&t.key!=null?yR(""+t.key):e.toString(36)}function bR(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(eh,eh):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function io(t,e,n,i,r){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(a){case"bigint":case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case th:case oR:o=!0;break;case H_:return o=t._init,io(o(t._payload),e,n,i,r)}}if(o)return r=r(t),o=i===""?"."+Jp(t,0):i,N_(r)?(n="",o!=null&&(n=o.replace(D_,"$&/")+"/"),io(r,e,n,"",function(c){return c})):r!=null&&(ah(r)&&(r=vR(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(D_,"$&/")+"/")+o)),e.push(r)),1;o=0;var s=i===""?".":i+":";if(N_(t))for(var l=0;l<t.length;l++)i=t[l],a=s+Jp(i,l),o+=io(i,e,n,a,r);else if(l=mR(t),typeof l=="function")for(t=l.call(t),l=0;!(i=t.next()).done;)i=i.value,a=s+Jp(i,l++),o+=io(i,e,n,a,r);else if(a==="object"){if(typeof t.then=="function")return io(bR(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return o}function tu(t,e,n){if(t==null)return t;var i=[],r=0;return io(t,i,"","",function(a){return e.call(n,a,r++)}),i}function _R(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var L_=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},SR={map:tu,forEach:function(t,e,n){tu(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return tu(t,function(){e++}),e},toArray:function(t){return tu(t,function(e){return e})||[]},only:function(t){if(!ah(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};te.Activity=gR;te.Children=SR;te.Component=ro;te.Fragment=sR;te.Profiler=cR;te.PureComponent=nh;te.StrictMode=lR;te.Suspense=pR;te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Me;te.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Me.H.useMemoCache(t)}};te.cache=function(t){return function(){return t.apply(null,arguments)}};te.cacheSignal=function(){return null};te.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=z_({},t.props),r=t.key;if(e!=null)for(a in e.key!==void 0&&(r=""+e.key),e)!F_.call(e,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&e.ref===void 0||(i[a]=e[a]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];i.children=o}return rh(t.type,r,i)};te.createContext=function(t){return t={$$typeof:dR,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:uR,_context:t},t};te.createElement=function(t,e,n){var i,r={},a=null;if(e!=null)for(i in e.key!==void 0&&(a=""+e.key),e)F_.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];r.children=s}if(t&&t.defaultProps)for(i in o=t.defaultProps,o)r[i]===void 0&&(r[i]=o[i]);return rh(t,a,r)};te.createRef=function(){return{current:null}};te.forwardRef=function(t){return{$$typeof:fR,render:t}};te.isValidElement=ah;te.lazy=function(t){return{$$typeof:H_,_payload:{_status:-1,_result:t},_init:_R}};te.memo=function(t,e){return{$$typeof:hR,type:t,compare:e===void 0?null:e}};te.startTransition=function(t){var e=Me.T,n={};Me.T=n;try{var i=t(),r=Me.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(eh,L_)}catch(a){L_(a)}finally{e!==null&&n.types!==null&&(e.types=n.types),Me.T=e}};te.unstable_useCacheRefresh=function(){return Me.H.useCacheRefresh()};te.use=function(t){return Me.H.use(t)};te.useActionState=function(t,e,n){return Me.H.useActionState(t,e,n)};te.useCallback=function(t,e){return Me.H.useCallback(t,e)};te.useContext=function(t){return Me.H.useContext(t)};te.useDebugValue=function(){};te.useDeferredValue=function(t,e){return Me.H.useDeferredValue(t,e)};te.useEffect=function(t,e){return Me.H.useEffect(t,e)};te.useEffectEvent=function(t){return Me.H.useEffectEvent(t)};te.useId=function(){return Me.H.useId()};te.useImperativeHandle=function(t,e,n){return Me.H.useImperativeHandle(t,e,n)};te.useInsertionEffect=function(t,e){return Me.H.useInsertionEffect(t,e)};te.useLayoutEffect=function(t,e){return Me.H.useLayoutEffect(t,e)};te.useMemo=function(t,e){return Me.H.useMemo(t,e)};te.useOptimistic=function(t,e){return Me.H.useOptimistic(t,e)};te.useReducer=function(t,e,n){return Me.H.useReducer(t,e,n)};te.useRef=function(t){return Me.H.useRef(t)};te.useState=function(t){return Me.H.useState(t)};te.useSyncExternalStore=function(t,e,n){return Me.H.useSyncExternalStore(t,e,n)};te.useTransition=function(){return Me.H.useTransition()};te.version="19.2.4"});var nt=Yn((B5,V_)=>{"use strict";V_.exports=U_()});var q_=Yn(kt=>{"use strict";var xR=nt();function j_(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function rr(){}var Tt={d:{f:rr,r:function(){throw Error(j_(522))},D:rr,C:rr,L:rr,m:rr,X:rr,S:rr,M:rr},p:0,findDOMNode:null},wR=Symbol.for("react.portal");function ER(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wR,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Vs=xR.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function nu(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Tt;kt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(j_(299));return ER(t,e,null,n)};kt.flushSync=function(t){var e=Vs.T,n=Tt.p;try{if(Vs.T=null,Tt.p=2,t)return t()}finally{Vs.T=e,Tt.p=n,Tt.d.f()}};kt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Tt.d.C(t,e))};kt.prefetchDNS=function(t){typeof t=="string"&&Tt.d.D(t)};kt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=nu(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Tt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:a}):n==="script"&&Tt.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};kt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=nu(e.as,e.crossOrigin);Tt.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Tt.d.M(t)};kt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=nu(n,e.crossOrigin);Tt.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};kt.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=nu(e.as,e.crossOrigin);Tt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Tt.d.m(t)};kt.requestFormReset=function(t){Tt.d.r(t)};kt.unstable_batchedUpdates=function(t,e){return t(e)};kt.useFormState=function(t,e,n){return Vs.H.useFormState(t,e,n)};kt.useFormStatus=function(){return Vs.H.useHostTransitionStatus()};kt.version="19.2.4"});var js=Yn((F5,G_)=>{"use strict";function P_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(P_)}catch(t){console.error(t)}}P_(),G_.exports=q_()});var n0=Yn(Ie=>{"use strict";function ch(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<iu(r,e))t[i]=e,t[n]=r,n=i;else break e}}function Kn(t){return t.length===0?null:t[0]}function au(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,a=r>>>1;i<a;){var o=2*(i+1)-1,s=t[o],l=o+1,c=t[l];if(0>iu(s,n))l<r&&0>iu(c,s)?(t[i]=c,t[l]=n,i=l):(t[i]=s,t[o]=n,i=o);else if(l<r&&0>iu(c,n))t[i]=c,t[l]=n,i=l;else break e}}return e}function iu(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}Ie.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Z_=performance,Ie.unstable_now=function(){return Z_.now()}):(oh=Date,Y_=oh.now(),Ie.unstable_now=function(){return oh.now()-Y_});var Z_,oh,Y_,hi=[],ar=[],CR=1,hn=null,wt=3,uh=!1,qs=!1,Ps=!1,dh=!1,X_=typeof setTimeout=="function"?setTimeout:null,Q_=typeof clearTimeout=="function"?clearTimeout:null,W_=typeof setImmediate<"u"?setImmediate:null;function ru(t){for(var e=Kn(ar);e!==null;){if(e.callback===null)au(ar);else if(e.startTime<=t)au(ar),e.sortIndex=e.expirationTime,ch(hi,e);else break;e=Kn(ar)}}function fh(t){if(Ps=!1,ru(t),!qs)if(Kn(hi)!==null)qs=!0,oo||(oo=!0,ao());else{var e=Kn(ar);e!==null&&ph(fh,e.startTime-t)}}var oo=!1,Gs=-1,J_=5,e0=-1;function t0(){return dh?!0:!(Ie.unstable_now()-e0<J_)}function sh(){if(dh=!1,oo){var t=Ie.unstable_now();e0=t;var e=!0;try{e:{qs=!1,Ps&&(Ps=!1,Q_(Gs),Gs=-1),uh=!0;var n=wt;try{t:{for(ru(t),hn=Kn(hi);hn!==null&&!(hn.expirationTime>t&&t0());){var i=hn.callback;if(typeof i=="function"){hn.callback=null,wt=hn.priorityLevel;var r=i(hn.expirationTime<=t);if(t=Ie.unstable_now(),typeof r=="function"){hn.callback=r,ru(t),e=!0;break t}hn===Kn(hi)&&au(hi),ru(t)}else au(hi);hn=Kn(hi)}if(hn!==null)e=!0;else{var a=Kn(ar);a!==null&&ph(fh,a.startTime-t),e=!1}}break e}finally{hn=null,wt=n,uh=!1}e=void 0}}finally{e?ao():oo=!1}}}var ao;typeof W_=="function"?ao=function(){W_(sh)}:typeof MessageChannel<"u"?(lh=new MessageChannel,K_=lh.port2,lh.port1.onmessage=sh,ao=function(){K_.postMessage(null)}):ao=function(){X_(sh,0)};var lh,K_;function ph(t,e){Gs=X_(function(){t(Ie.unstable_now())},e)}Ie.unstable_IdlePriority=5;Ie.unstable_ImmediatePriority=1;Ie.unstable_LowPriority=4;Ie.unstable_NormalPriority=3;Ie.unstable_Profiling=null;Ie.unstable_UserBlockingPriority=2;Ie.unstable_cancelCallback=function(t){t.callback=null};Ie.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J_=0<t?Math.floor(1e3/t):5};Ie.unstable_getCurrentPriorityLevel=function(){return wt};Ie.unstable_next=function(t){switch(wt){case 1:case 2:case 3:var e=3;break;default:e=wt}var n=wt;wt=e;try{return t()}finally{wt=n}};Ie.unstable_requestPaint=function(){dh=!0};Ie.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=wt;wt=t;try{return e()}finally{wt=n}};Ie.unstable_scheduleCallback=function(t,e,n){var i=Ie.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,t={id:CR++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,ch(ar,t),Kn(hi)===null&&t===Kn(ar)&&(Ps?(Q_(Gs),Gs=-1):Ps=!0,ph(fh,n-i))):(t.sortIndex=r,ch(hi,t),qs||uh||(qs=!0,oo||(oo=!0,ao()))),t};Ie.unstable_shouldYield=t0;Ie.unstable_wrapCallback=function(t){var e=wt;return function(){var n=wt;wt=e;try{return t.apply(this,arguments)}finally{wt=n}}}});var r0=Yn((V5,i0)=>{"use strict";i0.exports=n0()});var mw=Yn(Od=>{"use strict";var rt=r0(),OS=nt(),AR=js();function O(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function MS(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Nl(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function NS(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function DS(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function a0(t){if(Nl(t)!==t)throw Error(O(188))}function TR(t){var e=t.alternate;if(!e){if(e=Nl(t),e===null)throw Error(O(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return a0(r),t;if(a===i)return a0(r),e;a=a.sibling}throw Error(O(188))}if(n.return!==i.return)n=r,i=a;else{for(var o=!1,s=r.child;s;){if(s===n){o=!0,n=r,i=a;break}if(s===i){o=!0,i=r,n=a;break}s=s.sibling}if(!o){for(s=a.child;s;){if(s===n){o=!0,n=a,i=r;break}if(s===i){o=!0,i=a,n=r;break}s=s.sibling}if(!o)throw Error(O(189))}}if(n.alternate!==i)throw Error(O(190))}if(n.tag!==3)throw Error(O(188));return n.stateNode.current===n?t:e}function LS(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=LS(t),e!==null)return e;t=t.sibling}return null}var Le=Object.assign,kR=Symbol.for("react.element"),ou=Symbol.for("react.transitional.element"),el=Symbol.for("react.portal"),po=Symbol.for("react.fragment"),HS=Symbol.for("react.strict_mode"),Zh=Symbol.for("react.profiler"),IS=Symbol.for("react.consumer"),xi=Symbol.for("react.context"),Vg=Symbol.for("react.forward_ref"),Yh=Symbol.for("react.suspense"),Wh=Symbol.for("react.suspense_list"),jg=Symbol.for("react.memo"),or=Symbol.for("react.lazy"),Kh=Symbol.for("react.activity"),RR=Symbol.for("react.memo_cache_sentinel"),o0=Symbol.iterator;function Zs(t){return t===null||typeof t!="object"?null:(t=o0&&t[o0]||t["@@iterator"],typeof t=="function"?t:null)}var OR=Symbol.for("react.client.reference");function Xh(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===OR?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case po:return"Fragment";case Zh:return"Profiler";case HS:return"StrictMode";case Yh:return"Suspense";case Wh:return"SuspenseList";case Kh:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case el:return"Portal";case xi:return t.displayName||"Context";case IS:return(t._context.displayName||"Context")+".Consumer";case Vg:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case jg:return e=t.displayName||null,e!==null?e:Xh(t.type)||"Memo";case or:e=t._payload,t=t._init;try{return Xh(t(e))}catch{}}return null}var tl=Array.isArray,Q=OS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve=AR.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,la={pending:!1,data:null,method:null,action:null},Qh=[],ho=-1;function ti(t){return{current:t}}function ut(t){0>ho||(t.current=Qh[ho],Qh[ho]=null,ho--)}function Te(t,e){ho++,Qh[ho]=t.current,t.current=e}var ei=ti(null),yl=ti(null),vr=ti(null),$u=ti(null);function Fu(t,e){switch(Te(vr,e),Te(yl,t),Te(ei,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?pS(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=pS(e),t=nw(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ut(ei),Te(ei,t)}function No(){ut(ei),ut(yl),ut(vr)}function Jh(t){t.memoizedState!==null&&Te($u,t);var e=ei.current,n=nw(e,t.type);e!==n&&(Te(yl,t),Te(ei,n))}function Uu(t){yl.current===t&&(ut(ei),ut(yl)),$u.current===t&&(ut($u),Rl._currentValue=la)}var hh,s0;function ra(t){if(hh===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);hh=e&&e[1]||"",s0=-1<n.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<
|
|
3
|
-
`+
|
|
4
|
-
`),
|
|
5
|
-
`);for(r=
|
|
6
|
-
`+l[
|
|
7
|
-
Error generating stack: `+
|
|
8
|
-
`+i.stack}}var eg=Object.prototype.hasOwnProperty,qg=rt.unstable_scheduleCallback,vh=rt.unstable_cancelCallback,NR=rt.unstable_shouldYield,DR=rt.unstable_requestPaint,en=rt.unstable_now,LR=rt.unstable_getCurrentPriorityLevel,zS=rt.unstable_ImmediatePriority,BS=rt.unstable_UserBlockingPriority,Vu=rt.unstable_NormalPriority,HR=rt.unstable_LowPriority,$S=rt.unstable_IdlePriority,IR=rt.log,zR=rt.unstable_setDisableYieldValue,Dl=null,tn=null;function fr(t){if(typeof IR=="function"&&zR(t),tn&&typeof tn.setStrictMode=="function")try{tn.setStrictMode(Dl,t)}catch{}}var nn=Math.clz32?Math.clz32:FR,BR=Math.log,$R=Math.LN2;function FR(t){return t>>>=0,t===0?32:31-(BR(t)/$R|0)|0}var su=256,lu=262144,cu=4194304;function aa(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function hd(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,a=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var s=i&134217727;return s!==0?(i=s&~a,i!==0?r=aa(i):(o&=s,o!==0?r=aa(o):n||(n=s&~t,n!==0&&(r=aa(n))))):(s=i&~a,s!==0?r=aa(s):o!==0?r=aa(o):n||(n=i&~t,n!==0&&(r=aa(n)))),r===0?0:e!==0&&e!==r&&(e&a)===0&&(a=r&-r,n=e&-e,a>=n||a===32&&(n&4194048)!==0)?e:r}function Ll(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function UR(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function FS(){var t=cu;return cu<<=1,(cu&62914560)===0&&(cu=4194304),t}function yh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Hl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function VR(t,e,n,i,r,a){var o=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(n=o&~n;0<n;){var u=31-nn(n),f=1<<u;s[u]=0,l[u]=-1;var h=c[u];if(h!==null)for(c[u]=null,u=0;u<h.length;u++){var g=h[u];g!==null&&(g.lane&=-536870913)}n&=~f}i!==0&&US(t,i,0),a!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=a&~(o&~e))}function US(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-nn(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&261930}function VS(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-nn(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function jS(t,e){var n=e&-e;return n=(n&42)!==0?1:Pg(n),(n&(t.suspendedLanes|e))!==0?0:n}function Pg(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Gg(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function qS(){var t=ve.p;return t!==0?t:(t=window.event,t===void 0?32:pw(t.type))}function c0(t,e){var n=ve.p;try{return ve.p=t,e()}finally{ve.p=n}}var Or=Math.random().toString(36).slice(2),gt="__reactFiber$"+Or,Ft="__reactProps$"+Or,jo="__reactContainer$"+Or,tg="__reactEvents$"+Or,jR="__reactListeners$"+Or,qR="__reactHandles$"+Or,u0="__reactResources$"+Or,Il="__reactMarker$"+Or;function Zg(t){delete t[gt],delete t[Ft],delete t[tg],delete t[jR],delete t[qR]}function go(t){var e=t[gt];if(e)return e;for(var n=t.parentNode;n;){if(e=n[jo]||n[gt]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=yS(t);t!==null;){if(n=t[gt])return n;t=yS(t)}return e}t=n,n=t.parentNode}return null}function qo(t){if(t=t[gt]||t[jo]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function nl(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(O(33))}function Co(t){var e=t[u0];return e||(e=t[u0]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function ct(t){t[Il]=!0}var PS=new Set,GS={};function ya(t,e){Do(t,e),Do(t+"Capture",e)}function Do(t,e){for(GS[t]=e,t=0;t<e.length;t++)PS.add(e[t])}var PR=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]*$"),d0={},f0={};function GR(t){return eg.call(f0,t)?!0:eg.call(d0,t)?!1:PR.test(t)?f0[t]=!0:(d0[t]=!0,!1)}function Eu(t,e,n){if(GR(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function uu(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function gi(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}function mn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ZS(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function ZR(t,e,n){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,a=i.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(t,e,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function ng(t){if(!t._valueTracker){var e=ZS(t)?"checked":"value";t._valueTracker=ZR(t,e,""+t[e])}}function YS(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=ZS(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function ju(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var YR=/[\n"\\]/g;function bn(t){return t.replace(YR,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function ig(t,e,n,i,r,a,o,s){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+mn(e)):t.value!==""+mn(e)&&(t.value=""+mn(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?rg(t,o,mn(e)):n!=null?rg(t,o,mn(n)):i!=null&&t.removeAttribute("value"),r==null&&a!=null&&(t.defaultChecked=!!a),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+mn(s):t.removeAttribute("name")}function WS(t,e,n,i,r,a,o,s){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.type=a),e!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||e!=null)){ng(t);return}n=n!=null?""+mn(n):"",e=e!=null?""+mn(e):n,s||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=s?t.checked:!!i,t.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o),ng(t)}function rg(t,e,n){e==="number"&&ju(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Ao(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+mn(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function KS(t,e,n){if(e!=null&&(e=""+mn(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+mn(n):""}function XS(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(O(92));if(tl(i)){if(1<i.length)throw Error(O(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=mn(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i),ng(t)}function Lo(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var WR=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 p0(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||WR.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function QS(t,e,n){if(e!=null&&typeof e!="object")throw Error(O(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&p0(t,r,i)}else for(var a in e)e.hasOwnProperty(a)&&p0(t,a,e[a])}function Yg(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var KR=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"]]),XR=/^[\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 Cu(t){return XR.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function wi(){}var ag=null;function Wg(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var mo=null,To=null;function h0(t){var e=qo(t);if(e&&(t=e.stateNode)){var n=t[Ft]||null;e:switch(t=e.stateNode,e.type){case"input":if(ig(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+bn(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[Ft]||null;if(!r)throw Error(O(90));ig(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&YS(i)}break e;case"textarea":KS(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&Ao(t,!!n.multiple,e,!1)}}}var bh=!1;function JS(t,e,n){if(bh)return t(e,n);bh=!0;try{var i=t(e);return i}finally{if(bh=!1,(mo!==null||To!==null)&&(Ad(),mo&&(e=mo,t=To,To=mo=null,h0(e),t)))for(e=0;e<t.length;e++)h0(t[e])}}function bl(t,e){var n=t.stateNode;if(n===null)return null;var i=n[Ft]||null;if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(O(231,e,typeof n));return n}var ki=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),og=!1;if(ki)try{so={},Object.defineProperty(so,"passive",{get:function(){og=!0}}),window.addEventListener("test",so,so),window.removeEventListener("test",so,so)}catch{og=!1}var so,pr=null,Kg=null,Au=null;function ex(){if(Au)return Au;var t,e=Kg,n=e.length,i,r="value"in pr?pr.value:pr.textContent,a=r.length;for(t=0;t<n&&e[t]===r[t];t++);var o=n-t;for(i=1;i<=o&&e[n-i]===r[a-i];i++);return Au=r.slice(t,1<i?1-i:void 0)}function Tu(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function du(){return!0}function g0(){return!1}function Ut(t){function e(n,i,r,a,o){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(n=t[s],this[s]=n?n(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?du:g0,this.isPropagationStopped=g0,this}return Le(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=du)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=du)},persist:function(){},isPersistent:du}),e}var ba={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gd=Ut(ba),zl=Le({},ba,{view:0,detail:0}),QR=Ut(zl),_h,Sh,Ys,md=Le({},zl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xg,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ys&&(Ys&&t.type==="mousemove"?(_h=t.screenX-Ys.screenX,Sh=t.screenY-Ys.screenY):Sh=_h=0,Ys=t),_h)},movementY:function(t){return"movementY"in t?t.movementY:Sh}}),m0=Ut(md),JR=Le({},md,{dataTransfer:0}),e2=Ut(JR),t2=Le({},zl,{relatedTarget:0}),xh=Ut(t2),n2=Le({},ba,{animationName:0,elapsedTime:0,pseudoElement:0}),i2=Ut(n2),r2=Le({},ba,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),a2=Ut(r2),o2=Le({},ba,{data:0}),v0=Ut(o2),s2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},l2={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"},c2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function u2(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=c2[t])?!!e[t]:!1}function Xg(){return u2}var d2=Le({},zl,{key:function(t){if(t.key){var e=s2[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Tu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?l2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xg,charCode:function(t){return t.type==="keypress"?Tu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Tu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),f2=Ut(d2),p2=Le({},md,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),y0=Ut(p2),h2=Le({},zl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xg}),g2=Ut(h2),m2=Le({},ba,{propertyName:0,elapsedTime:0,pseudoElement:0}),v2=Ut(m2),y2=Le({},md,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),b2=Ut(y2),_2=Le({},ba,{newState:0,oldState:0}),S2=Ut(_2),x2=[9,13,27,32],Qg=ki&&"CompositionEvent"in window,al=null;ki&&"documentMode"in document&&(al=document.documentMode);var w2=ki&&"TextEvent"in window&&!al,tx=ki&&(!Qg||al&&8<al&&11>=al),b0=" ",_0=!1;function nx(t,e){switch(t){case"keyup":return x2.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ix(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var vo=!1;function E2(t,e){switch(t){case"compositionend":return ix(e);case"keypress":return e.which!==32?null:(_0=!0,b0);case"textInput":return t=e.data,t===b0&&_0?null:t;default:return null}}function C2(t,e){if(vo)return t==="compositionend"||!Qg&&nx(t,e)?(t=ex(),Au=Kg=pr=null,vo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return tx&&e.locale!=="ko"?null:e.data;default:return null}}var A2={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 S0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!A2[t.type]:e==="textarea"}function rx(t,e,n,i){mo?To?To.push(i):To=[i]:mo=i,e=sd(e,"onChange"),0<e.length&&(n=new gd("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var ol=null,_l=null;function T2(t){J1(t,0)}function vd(t){var e=nl(t);if(YS(e))return t}function x0(t,e){if(t==="change")return e}var ax=!1;ki&&(ki?(pu="oninput"in document,pu||(wh=document.createElement("div"),wh.setAttribute("oninput","return;"),pu=typeof wh.oninput=="function"),fu=pu):fu=!1,ax=fu&&(!document.documentMode||9<document.documentMode));var fu,pu,wh;function w0(){ol&&(ol.detachEvent("onpropertychange",ox),_l=ol=null)}function ox(t){if(t.propertyName==="value"&&vd(_l)){var e=[];rx(e,_l,t,Wg(t)),JS(T2,e)}}function k2(t,e,n){t==="focusin"?(w0(),ol=e,_l=n,ol.attachEvent("onpropertychange",ox)):t==="focusout"&&w0()}function R2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return vd(_l)}function O2(t,e){if(t==="click")return vd(e)}function M2(t,e){if(t==="input"||t==="change")return vd(e)}function N2(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var an=typeof Object.is=="function"?Object.is:N2;function Sl(t,e){if(an(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!eg.call(e,r)||!an(t[r],e[r]))return!1}return!0}function E0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function C0(t,e){var n=E0(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=E0(n)}}function sx(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?sx(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function lx(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=ju(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=ju(t.document)}return e}function Jg(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var D2=ki&&"documentMode"in document&&11>=document.documentMode,yo=null,sg=null,sl=null,lg=!1;function A0(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;lg||yo==null||yo!==ju(i)||(i=yo,"selectionStart"in i&&Jg(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),sl&&Sl(sl,i)||(sl=i,i=sd(sg,"onSelect"),0<i.length&&(e=new gd("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=yo)))}function ia(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var bo={animationend:ia("Animation","AnimationEnd"),animationiteration:ia("Animation","AnimationIteration"),animationstart:ia("Animation","AnimationStart"),transitionrun:ia("Transition","TransitionRun"),transitionstart:ia("Transition","TransitionStart"),transitioncancel:ia("Transition","TransitionCancel"),transitionend:ia("Transition","TransitionEnd")},Eh={},cx={};ki&&(cx=document.createElement("div").style,"AnimationEvent"in window||(delete bo.animationend.animation,delete bo.animationiteration.animation,delete bo.animationstart.animation),"TransitionEvent"in window||delete bo.transitionend.transition);function _a(t){if(Eh[t])return Eh[t];if(!bo[t])return t;var e=bo[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in cx)return Eh[t]=e[n];return t}var ux=_a("animationend"),dx=_a("animationiteration"),fx=_a("animationstart"),L2=_a("transitionrun"),H2=_a("transitionstart"),I2=_a("transitioncancel"),px=_a("transitionend"),hx=new Map,cg="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(" ");cg.push("scrollEnd");function zn(t,e){hx.set(t,e),ya(e,[t])}var qu=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},gn=[],_o=0,em=0;function yd(){for(var t=_o,e=em=_o=0;e<t;){var n=gn[e];gn[e++]=null;var i=gn[e];gn[e++]=null;var r=gn[e];gn[e++]=null;var a=gn[e];if(gn[e++]=null,i!==null&&r!==null){var o=i.pending;o===null?r.next=r:(r.next=o.next,o.next=r),i.pending=r}a!==0&&gx(n,r,a)}}function bd(t,e,n,i){gn[_o++]=t,gn[_o++]=e,gn[_o++]=n,gn[_o++]=i,em|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function tm(t,e,n,i){return bd(t,e,n,i),Pu(t)}function Sa(t,e){return bd(t,null,null,e),Pu(t)}function gx(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,a=t.return;a!==null;)a.childLanes|=n,i=a.alternate,i!==null&&(i.childLanes|=n),a.tag===22&&(t=a.stateNode,t===null||t._visibility&1||(r=!0)),t=a,a=a.return;return t.tag===3?(a=t.stateNode,r&&e!==null&&(r=31-nn(n),t=a.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),a):null}function Pu(t){if(50<ml)throw ml=0,Og=null,Error(O(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var So={};function z2(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qt(t,e,n,i){return new z2(t,e,n,i)}function nm(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ci(t,e){var n=t.alternate;return n===null?(n=Qt(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function mx(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function ku(t,e,n,i,r,a){var o=0;if(i=t,typeof t=="function")nm(t)&&(o=1);else if(typeof t=="string")o=FO(t,n,ei.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Kh:return t=Qt(31,n,e,r),t.elementType=Kh,t.lanes=a,t;case po:return ca(n.children,r,a,e);case HS:o=8,r|=24;break;case Zh:return t=Qt(12,n,e,r|2),t.elementType=Zh,t.lanes=a,t;case Yh:return t=Qt(13,n,e,r),t.elementType=Yh,t.lanes=a,t;case Wh:return t=Qt(19,n,e,r),t.elementType=Wh,t.lanes=a,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case xi:o=10;break e;case IS:o=9;break e;case Vg:o=11;break e;case jg:o=14;break e;case or:o=16,i=null;break e}o=29,n=Error(O(130,t===null?"null":typeof t,"")),i=null}return e=Qt(o,n,e,r),e.elementType=t,e.type=i,e.lanes=a,e}function ca(t,e,n,i){return t=Qt(7,t,i,e),t.lanes=n,t}function Ch(t,e,n){return t=Qt(6,t,null,e),t.lanes=n,t}function vx(t){var e=Qt(18,null,null,0);return e.stateNode=t,e}function Ah(t,e,n){return e=Qt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var T0=new WeakMap;function _n(t,e){if(typeof t=="object"&&t!==null){var n=T0.get(t);return n!==void 0?n:(e={value:t,source:e,stack:l0(e)},T0.set(t,e),e)}return{value:t,source:e,stack:l0(e)}}var xo=[],wo=0,Gu=null,xl=0,vn=[],yn=0,Ar=null,Xn=1,Qn="";function _i(t,e){xo[wo++]=xl,xo[wo++]=Gu,Gu=t,xl=e}function yx(t,e,n){vn[yn++]=Xn,vn[yn++]=Qn,vn[yn++]=Ar,Ar=t;var i=Xn;t=Qn;var r=32-nn(i)-1;i&=~(1<<r),n+=1;var a=32-nn(e)+r;if(30<a){var o=r-r%5;a=(i&(1<<o)-1).toString(32),i>>=o,r-=o,Xn=1<<32-nn(e)+r|n<<r|i,Qn=a+t}else Xn=1<<a|n<<r|i,Qn=t}function im(t){t.return!==null&&(_i(t,1),yx(t,1,0))}function rm(t){for(;t===Gu;)Gu=xo[--wo],xo[wo]=null,xl=xo[--wo],xo[wo]=null;for(;t===Ar;)Ar=vn[--yn],vn[yn]=null,Qn=vn[--yn],vn[yn]=null,Xn=vn[--yn],vn[yn]=null}function bx(t,e){vn[yn++]=Xn,vn[yn++]=Qn,vn[yn++]=Ar,Xn=e.id,Qn=e.overflow,Ar=t}var mt=null,De=null,he=!1,yr=null,Sn=!1,ug=Error(O(519));function Tr(t){var e=Error(O(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wl(_n(e,t)),ug}function k0(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[gt]=t,e[Ft]=i,n){case"dialog":se("cancel",e),se("close",e);break;case"iframe":case"object":case"embed":se("load",e);break;case"video":case"audio":for(n=0;n<Tl.length;n++)se(Tl[n],e);break;case"source":se("error",e);break;case"img":case"image":case"link":se("error",e),se("load",e);break;case"details":se("toggle",e);break;case"input":se("invalid",e),WS(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":se("invalid",e);break;case"textarea":se("invalid",e),XS(e,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||tw(e.textContent,n)?(i.popover!=null&&(se("beforetoggle",e),se("toggle",e)),i.onScroll!=null&&se("scroll",e),i.onScrollEnd!=null&&se("scrollend",e),i.onClick!=null&&(e.onclick=wi),e=!0):e=!1,e||Tr(t,!0)}function R0(t){for(mt=t.return;mt;)switch(mt.tag){case 5:case 31:case 13:Sn=!1;return;case 27:case 3:Sn=!0;return;default:mt=mt.return}}function lo(t){if(t!==mt)return!1;if(!he)return R0(t),he=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Hg(t.type,t.memoizedProps)),n=!n),n&&De&&Tr(t),R0(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(317));De=vS(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(317));De=vS(t)}else e===27?(e=De,Mr(t.type)?(t=$g,$g=null,De=t):De=e):De=mt?wn(t.stateNode.nextSibling):null;return!0}function pa(){De=mt=null,he=!1}function Th(){var t=yr;return t!==null&&(Bt===null?Bt=t:Bt.push.apply(Bt,t),yr=null),t}function wl(t){yr===null?yr=[t]:yr.push(t)}var dg=ti(null),xa=null,Ei=null;function lr(t,e,n){Te(dg,e._currentValue),e._currentValue=n}function Ai(t){t._currentValue=dg.current,ut(dg)}function fg(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function pg(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var a=r.dependencies;if(a!==null){var o=r.child;a=a.firstContext;e:for(;a!==null;){var s=a;a=r;for(var l=0;l<e.length;l++)if(s.context===e[l]){a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),fg(a.return,n,t),i||(o=null);break e}a=s.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(O(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),fg(o,n,t),o=null}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===t){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function Po(t,e,n,i){t=null;for(var r=e,a=!1;r!==null;){if(!a){if((r.flags&524288)!==0)a=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(O(387));if(o=o.memoizedProps,o!==null){var s=r.type;an(r.pendingProps.value,o.value)||(t!==null?t.push(s):t=[s])}}else if(r===$u.current){if(o=r.alternate,o===null)throw Error(O(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(Rl):t=[Rl])}r=r.return}t!==null&&pg(e,t,n,i),e.flags|=262144}function Zu(t){for(t=t.firstContext;t!==null;){if(!an(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ha(t){xa=t,Ei=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function vt(t){return _x(xa,t)}function hu(t,e){return xa===null&&ha(t),_x(t,e)}function _x(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},Ei===null){if(t===null)throw Error(O(308));Ei=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Ei=Ei.next=e;return n}var B2=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},$2=rt.unstable_scheduleCallback,F2=rt.unstable_NormalPriority,Qe={$$typeof:xi,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function am(){return{controller:new B2,data:new Map,refCount:0}}function Bl(t){t.refCount--,t.refCount===0&&$2(F2,function(){t.controller.abort()})}var ll=null,hg=0,Ho=0,ko=null;function U2(t,e){if(ll===null){var n=ll=[];hg=0,Ho=Om(),ko={status:"pending",value:void 0,then:function(i){n.push(i)}}}return hg++,e.then(O0,O0),e}function O0(){if(--hg===0&&ll!==null){ko!==null&&(ko.status="fulfilled");var t=ll;ll=null,Ho=0,ko=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function V2(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var M0=Q.S;Q.S=function(t,e){L1=en(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&U2(t,e),M0!==null&&M0(t,e)};var ua=ti(null);function om(){var t=ua.current;return t!==null?t:Ce.pooledCache}function Ru(t,e){e===null?Te(ua,ua.current):Te(ua,e.pool)}function Sx(){var t=om();return t===null?null:{parent:Qe._currentValue,pool:t}}var Go=Error(O(460)),sm=Error(O(474)),_d=Error(O(542)),Yu={then:function(){}};function N0(t){return t=t.status,t==="fulfilled"||t==="rejected"}function xx(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(wi,wi),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,L0(t),t;default:if(typeof e.status=="string")e.then(wi,wi);else{if(t=Ce,t!==null&&100<t.shellSuspendCounter)throw Error(O(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,L0(t),t}throw da=e,Go}}function oa(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(da=n,Go):n}}var da=null;function D0(){if(da===null)throw Error(O(459));var t=da;return da=null,t}function L0(t){if(t===Go||t===_d)throw Error(O(483))}var Ro=null,El=0;function gu(t){var e=El;return El+=1,Ro===null&&(Ro=[]),xx(Ro,t,e)}function Ws(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function mu(t,e){throw e.$$typeof===kR?Error(O(525)):(t=Object.prototype.toString.call(e),Error(O(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function wx(t){function e(d,p){if(t){var m=d.deletions;m===null?(d.deletions=[p],d.flags|=16):m.push(p)}}function n(d,p){if(!t)return null;for(;p!==null;)e(d,p),p=p.sibling;return null}function i(d){for(var p=new Map;d!==null;)d.key!==null?p.set(d.key,d):p.set(d.index,d),d=d.sibling;return p}function r(d,p){return d=Ci(d,p),d.index=0,d.sibling=null,d}function a(d,p,m){return d.index=m,t?(m=d.alternate,m!==null?(m=m.index,m<p?(d.flags|=67108866,p):m):(d.flags|=67108866,p)):(d.flags|=1048576,p)}function o(d){return t&&d.alternate===null&&(d.flags|=67108866),d}function s(d,p,m,v){return p===null||p.tag!==6?(p=Ch(m,d.mode,v),p.return=d,p):(p=r(p,m),p.return=d,p)}function l(d,p,m,v){var S=m.type;return S===po?u(d,p,m.props.children,v,m.key):p!==null&&(p.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===or&&oa(S)===p.type)?(p=r(p,m.props),Ws(p,m),p.return=d,p):(p=ku(m.type,m.key,m.props,null,d.mode,v),Ws(p,m),p.return=d,p)}function c(d,p,m,v){return p===null||p.tag!==4||p.stateNode.containerInfo!==m.containerInfo||p.stateNode.implementation!==m.implementation?(p=Ah(m,d.mode,v),p.return=d,p):(p=r(p,m.children||[]),p.return=d,p)}function u(d,p,m,v,S){return p===null||p.tag!==7?(p=ca(m,d.mode,v,S),p.return=d,p):(p=r(p,m),p.return=d,p)}function f(d,p,m){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=Ch(""+p,d.mode,m),p.return=d,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case ou:return m=ku(p.type,p.key,p.props,null,d.mode,m),Ws(m,p),m.return=d,m;case el:return p=Ah(p,d.mode,m),p.return=d,p;case or:return p=oa(p),f(d,p,m)}if(tl(p)||Zs(p))return p=ca(p,d.mode,m,null),p.return=d,p;if(typeof p.then=="function")return f(d,gu(p),m);if(p.$$typeof===xi)return f(d,hu(d,p),m);mu(d,p)}return null}function h(d,p,m,v){var S=p!==null?p.key:null;if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return S!==null?null:s(d,p,""+m,v);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ou:return m.key===S?l(d,p,m,v):null;case el:return m.key===S?c(d,p,m,v):null;case or:return m=oa(m),h(d,p,m,v)}if(tl(m)||Zs(m))return S!==null?null:u(d,p,m,v,null);if(typeof m.then=="function")return h(d,p,gu(m),v);if(m.$$typeof===xi)return h(d,p,hu(d,m),v);mu(d,m)}return null}function g(d,p,m,v,S){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return d=d.get(m)||null,s(p,d,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ou:return d=d.get(v.key===null?m:v.key)||null,l(p,d,v,S);case el:return d=d.get(v.key===null?m:v.key)||null,c(p,d,v,S);case or:return v=oa(v),g(d,p,m,v,S)}if(tl(v)||Zs(v))return d=d.get(m)||null,u(p,d,v,S,null);if(typeof v.then=="function")return g(d,p,m,gu(v),S);if(v.$$typeof===xi)return g(d,p,m,hu(p,v),S);mu(p,v)}return null}function _(d,p,m,v){for(var S=null,T=null,A=p,k=p=0,C=null;A!==null&&k<m.length;k++){A.index>k?(C=A,A=null):C=A.sibling;var x=h(d,A,m[k],v);if(x===null){A===null&&(A=C);break}t&&A&&x.alternate===null&&e(d,A),p=a(x,p,k),T===null?S=x:T.sibling=x,T=x,A=C}if(k===m.length)return n(d,A),he&&_i(d,k),S;if(A===null){for(;k<m.length;k++)A=f(d,m[k],v),A!==null&&(p=a(A,p,k),T===null?S=A:T.sibling=A,T=A);return he&&_i(d,k),S}for(A=i(A);k<m.length;k++)C=g(A,d,k,m[k],v),C!==null&&(t&&C.alternate!==null&&A.delete(C.key===null?k:C.key),p=a(C,p,k),T===null?S=C:T.sibling=C,T=C);return t&&A.forEach(function(M){return e(d,M)}),he&&_i(d,k),S}function b(d,p,m,v){if(m==null)throw Error(O(151));for(var S=null,T=null,A=p,k=p=0,C=null,x=m.next();A!==null&&!x.done;k++,x=m.next()){A.index>k?(C=A,A=null):C=A.sibling;var M=h(d,A,x.value,v);if(M===null){A===null&&(A=C);break}t&&A&&M.alternate===null&&e(d,A),p=a(M,p,k),T===null?S=M:T.sibling=M,T=M,A=C}if(x.done)return n(d,A),he&&_i(d,k),S;if(A===null){for(;!x.done;k++,x=m.next())x=f(d,x.value,v),x!==null&&(p=a(x,p,k),T===null?S=x:T.sibling=x,T=x);return he&&_i(d,k),S}for(A=i(A);!x.done;k++,x=m.next())x=g(A,d,k,x.value,v),x!==null&&(t&&x.alternate!==null&&A.delete(x.key===null?k:x.key),p=a(x,p,k),T===null?S=x:T.sibling=x,T=x);return t&&A.forEach(function(z){return e(d,z)}),he&&_i(d,k),S}function w(d,p,m,v){if(typeof m=="object"&&m!==null&&m.type===po&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case ou:e:{for(var S=m.key;p!==null;){if(p.key===S){if(S=m.type,S===po){if(p.tag===7){n(d,p.sibling),v=r(p,m.props.children),v.return=d,d=v;break e}}else if(p.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===or&&oa(S)===p.type){n(d,p.sibling),v=r(p,m.props),Ws(v,m),v.return=d,d=v;break e}n(d,p);break}else e(d,p);p=p.sibling}m.type===po?(v=ca(m.props.children,d.mode,v,m.key),v.return=d,d=v):(v=ku(m.type,m.key,m.props,null,d.mode,v),Ws(v,m),v.return=d,d=v)}return o(d);case el:e:{for(S=m.key;p!==null;){if(p.key===S)if(p.tag===4&&p.stateNode.containerInfo===m.containerInfo&&p.stateNode.implementation===m.implementation){n(d,p.sibling),v=r(p,m.children||[]),v.return=d,d=v;break e}else{n(d,p);break}else e(d,p);p=p.sibling}v=Ah(m,d.mode,v),v.return=d,d=v}return o(d);case or:return m=oa(m),w(d,p,m,v)}if(tl(m))return _(d,p,m,v);if(Zs(m)){if(S=Zs(m),typeof S!="function")throw Error(O(150));return m=S.call(m),b(d,p,m,v)}if(typeof m.then=="function")return w(d,p,gu(m),v);if(m.$$typeof===xi)return w(d,p,hu(d,m),v);mu(d,m)}return typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint"?(m=""+m,p!==null&&p.tag===6?(n(d,p.sibling),v=r(p,m),v.return=d,d=v):(n(d,p),v=Ch(m,d.mode,v),v.return=d,d=v),o(d)):n(d,p)}return function(d,p,m,v){try{El=0;var S=w(d,p,m,v);return Ro=null,S}catch(A){if(A===Go||A===_d)throw A;var T=Qt(29,A,null,d.mode);return T.lanes=v,T.return=d,T}}}var ga=wx(!0),Ex=wx(!1),sr=!1;function lm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gg(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function br(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function _r(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(me&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=Pu(t),gx(t,null,n),e}return bd(t,i,e,n),Pu(t)}function cl(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,VS(t,n)}}function kh(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?r=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?r=a=e:a=a.next=e}else r=a=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var mg=!1;function ul(){if(mg){var t=ko;if(t!==null)throw t}}function dl(t,e,n,i){mg=!1;var r=t.updateQueue;sr=!1;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,s=r.shared.pending;if(s!==null){r.shared.pending=null;var l=s,c=l.next;l.next=null,o===null?a=c:o.next=c,o=l;var u=t.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(a!==null){var f=r.baseState;o=0,u=c=l=null,s=a;do{var h=s.lane&-536870913,g=h!==s.lane;if(g?(fe&h)===h:(i&h)===h){h!==0&&h===Ho&&(mg=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var _=t,b=s;h=e;var w=n;switch(b.tag){case 1:if(_=b.payload,typeof _=="function"){f=_.call(w,f,h);break e}f=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=b.payload,h=typeof _=="function"?_.call(w,f,h):_,h==null)break e;f=Le({},f,h);break e;case 2:sr=!0}}h=s.callback,h!==null&&(t.flags|=64,g&&(t.flags|=8192),g=r.callbacks,g===null?r.callbacks=[h]:g.push(h))}else g={lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=g,l=f):u=u.next=g,o|=h;if(s=s.next,s===null){if(s=r.shared.pending,s===null)break;g=s,s=g.next,g.next=null,r.lastBaseUpdate=g,r.shared.pending=null}}while(!0);u===null&&(l=f),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,a===null&&(r.shared.lanes=0),Rr|=o,t.lanes=o,t.memoizedState=f}}function Cx(t,e){if(typeof t!="function")throw Error(O(191,t));t.call(e)}function Ax(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)Cx(n[t],e)}var Io=ti(null),Wu=ti(0);function H0(t,e){t=Ni,Te(Wu,t),Te(Io,e),Ni=t|e.baseLanes}function vg(){Te(Wu,Ni),Te(Io,Io.current)}function cm(){Ni=Wu.current,ut(Io),ut(Wu)}var on=ti(null),xn=null;function cr(t){var e=t.alternate;Te(Pe,Pe.current&1),Te(on,t),xn===null&&(e===null||Io.current!==null||e.memoizedState!==null)&&(xn=t)}function yg(t){Te(Pe,Pe.current),Te(on,t),xn===null&&(xn=t)}function Tx(t){t.tag===22?(Te(Pe,Pe.current),Te(on,t),xn===null&&(xn=t)):ur(t)}function ur(){Te(Pe,Pe.current),Te(on,on.current)}function Xt(t){ut(on),xn===t&&(xn=null),ut(Pe)}var Pe=ti(0);function Ku(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||zg(n)||Bg(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Ri=0,ie=null,we=null,Ke=null,Xu=!1,Oo=!1,ma=!1,Qu=0,Cl=0,Mo=null,j2=0;function Ve(){throw Error(O(321))}function um(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!an(t[n],e[n]))return!1;return!0}function dm(t,e,n,i,r,a){return Ri=a,ie=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Q.H=t===null||t.memoizedState===null?r1:xm,ma=!1,a=n(i,r),ma=!1,Oo&&(a=Rx(e,n,i,r)),kx(t),a}function kx(t){Q.H=Al;var e=we!==null&&we.next!==null;if(Ri=0,Ke=we=ie=null,Xu=!1,Cl=0,Mo=null,e)throw Error(O(300));t===null||Je||(t=t.dependencies,t!==null&&Zu(t)&&(Je=!0))}function Rx(t,e,n,i){ie=t;var r=0;do{if(Oo&&(Mo=null),Cl=0,Oo=!1,25<=r)throw Error(O(301));if(r+=1,Ke=we=null,t.updateQueue!=null){var a=t.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}Q.H=a1,a=e(n,i)}while(Oo);return a}function q2(){var t=Q.H,e=t.useState()[0];return e=typeof e.then=="function"?$l(e):e,t=t.useState()[0],(we!==null?we.memoizedState:null)!==t&&(ie.flags|=1024),e}function fm(){var t=Qu!==0;return Qu=0,t}function pm(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function hm(t){if(Xu){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}Xu=!1}Ri=0,Ke=we=ie=null,Oo=!1,Cl=Qu=0,Mo=null}function Rt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?ie.memoizedState=Ke=t:Ke=Ke.next=t,Ke}function Ge(){if(we===null){var t=ie.alternate;t=t!==null?t.memoizedState:null}else t=we.next;var e=Ke===null?ie.memoizedState:Ke.next;if(e!==null)Ke=e,we=t;else{if(t===null)throw ie.alternate===null?Error(O(467)):Error(O(310));we=t,t={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},Ke===null?ie.memoizedState=Ke=t:Ke=Ke.next=t}return Ke}function Sd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $l(t){var e=Cl;return Cl+=1,Mo===null&&(Mo=[]),t=xx(Mo,t,e),e=ie,(Ke===null?e.memoizedState:Ke.next)===null&&(e=e.alternate,Q.H=e===null||e.memoizedState===null?r1:xm),t}function xd(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return $l(t);if(t.$$typeof===xi)return vt(t)}throw Error(O(438,String(t)))}function gm(t){var e=null,n=ie.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=ie.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=Sd(),ie.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=RR;return e.index++,n}function Oi(t,e){return typeof e=="function"?e(t):e}function Ou(t){var e=Ge();return mm(e,we,t)}function mm(t,e,n){var i=t.queue;if(i===null)throw Error(O(311));i.lastRenderedReducer=n;var r=t.baseQueue,a=i.pending;if(a!==null){if(r!==null){var o=r.next;r.next=a.next,a.next=o}e.baseQueue=r=a,i.pending=null}if(a=t.baseState,r===null)t.memoizedState=a;else{e=r.next;var s=o=null,l=null,c=e,u=!1;do{var f=c.lane&-536870913;if(f!==c.lane?(fe&f)===f:(Ri&f)===f){var h=c.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),f===Ho&&(u=!0);else if((Ri&h)===h){c=c.next,h===Ho&&(u=!0);continue}else f={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=f,o=a):l=l.next=f,ie.lanes|=h,Rr|=h;f=c.action,ma&&n(a,f),a=c.hasEagerState?c.eagerState:n(a,f)}else h={lane:f,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=h,o=a):l=l.next=h,ie.lanes|=f,Rr|=f;c=c.next}while(c!==null&&c!==e);if(l===null?o=a:l.next=s,!an(a,t.memoizedState)&&(Je=!0,u&&(n=ko,n!==null)))throw n;t.memoizedState=a,t.baseState=o,t.baseQueue=l,i.lastRenderedState=a}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Rh(t){var e=Ge(),n=e.queue;if(n===null)throw Error(O(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,a=e.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do a=t(a,o.action),o=o.next;while(o!==r);an(a,e.memoizedState)||(Je=!0),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),n.lastRenderedState=a}return[a,i]}function Ox(t,e,n){var i=ie,r=Ge(),a=he;if(a){if(n===void 0)throw Error(O(407));n=n()}else n=e();var o=!an((we||r).memoizedState,n);if(o&&(r.memoizedState=n,Je=!0),r=r.queue,vm(Dx.bind(null,i,r,t),[t]),r.getSnapshot!==e||o||Ke!==null&&Ke.memoizedState.tag&1){if(i.flags|=2048,zo(9,{destroy:void 0},Nx.bind(null,i,r,n,e),null),Ce===null)throw Error(O(349));a||(Ri&127)!==0||Mx(i,e,n)}return n}function Mx(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=ie.updateQueue,e===null?(e=Sd(),ie.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function Nx(t,e,n,i){e.value=n,e.getSnapshot=i,Lx(e)&&Hx(t)}function Dx(t,e,n){return n(function(){Lx(e)&&Hx(t)})}function Lx(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!an(t,n)}catch{return!0}}function Hx(t){var e=Sa(t,2);e!==null&&$t(e,t,2)}function bg(t){var e=Rt();if(typeof t=="function"){var n=t;if(t=n(),ma){fr(!0);try{n()}finally{fr(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:t},e}function Ix(t,e,n,i){return t.baseState=n,mm(t,we,typeof i=="function"?i:Oi)}function P2(t,e,n,i,r){if(Ed(t))throw Error(O(485));if(t=e.action,t!==null){var a={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){a.listeners.push(o)}};Q.T!==null?n(!0):a.isTransition=!1,i(a),n=e.pending,n===null?(a.next=e.pending=a,zx(e,a)):(a.next=n.next,e.pending=n.next=a)}}function zx(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var a=Q.T,o={};Q.T=o;try{var s=n(r,i),l=Q.S;l!==null&&l(o,s),I0(t,e,s)}catch(c){_g(t,e,c)}finally{a!==null&&o.types!==null&&(a.types=o.types),Q.T=a}}else try{a=n(r,i),I0(t,e,a)}catch(c){_g(t,e,c)}}function I0(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){z0(t,e,i)},function(i){return _g(t,e,i)}):z0(t,e,n)}function z0(t,e,n){e.status="fulfilled",e.value=n,Bx(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,zx(t,n)))}function _g(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,Bx(e),e=e.next;while(e!==i)}t.action=null}function Bx(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function $x(t,e){return e}function B0(t,e){if(he){var n=Ce.formState;if(n!==null){e:{var i=ie;if(he){if(De){t:{for(var r=De,a=Sn;r.nodeType!==8;){if(!a){r=null;break t}if(r=wn(r.nextSibling),r===null){r=null;break t}}a=r.data,r=a==="F!"||a==="F"?r:null}if(r){De=wn(r.nextSibling),i=r.data==="F!";break e}}Tr(i)}i=!1}i&&(e=n[0])}}return n=Rt(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$x,lastRenderedState:e},n.queue=i,n=t1.bind(null,ie,i),i.dispatch=n,i=bg(!1),a=Sm.bind(null,ie,!1,i.queue),i=Rt(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=P2.bind(null,ie,r,a,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function $0(t){var e=Ge();return Fx(e,we,t)}function Fx(t,e,n){if(e=mm(t,e,$x)[0],t=Ou(Oi)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=$l(e)}catch(o){throw o===Go?_d:o}else i=e;e=Ge();var r=e.queue,a=r.dispatch;return n!==e.memoizedState&&(ie.flags|=2048,zo(9,{destroy:void 0},G2.bind(null,r,n),null)),[i,a,t]}function G2(t,e){t.action=e}function F0(t){var e=Ge(),n=we;if(n!==null)return Fx(e,n,t);Ge(),e=e.memoizedState,n=Ge();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function zo(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=ie.updateQueue,e===null&&(e=Sd(),ie.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function Ux(){return Ge().memoizedState}function Mu(t,e,n,i){var r=Rt();ie.flags|=t,r.memoizedState=zo(1|e,{destroy:void 0},n,i===void 0?null:i)}function wd(t,e,n,i){var r=Ge();i=i===void 0?null:i;var a=r.memoizedState.inst;we!==null&&i!==null&&um(i,we.memoizedState.deps)?r.memoizedState=zo(e,a,n,i):(ie.flags|=t,r.memoizedState=zo(1|e,a,n,i))}function U0(t,e){Mu(8390656,8,t,e)}function vm(t,e){wd(2048,8,t,e)}function Z2(t){ie.flags|=4;var e=ie.updateQueue;if(e===null)e=Sd(),ie.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function Vx(t){var e=Ge().memoizedState;return Z2({ref:e,nextImpl:t}),function(){if((me&2)!==0)throw Error(O(440));return e.impl.apply(void 0,arguments)}}function jx(t,e){return wd(4,2,t,e)}function qx(t,e){return wd(4,4,t,e)}function Px(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function Gx(t,e,n){n=n!=null?n.concat([t]):null,wd(4,4,Px.bind(null,e,t),n)}function ym(){}function Zx(t,e){var n=Ge();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&um(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function Yx(t,e){var n=Ge();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&um(e,i[1]))return i[0];if(i=t(),ma){fr(!0);try{t()}finally{fr(!1)}}return n.memoizedState=[i,e],i}function bm(t,e,n){return n===void 0||(Ri&1073741824)!==0&&(fe&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=I1(),ie.lanes|=t,Rr|=t,n)}function Wx(t,e,n,i){return an(n,e)?n:Io.current!==null?(t=bm(t,n,i),an(t,e)||(Je=!0),t):(Ri&42)===0||(Ri&1073741824)!==0&&(fe&261930)===0?(Je=!0,t.memoizedState=n):(t=I1(),ie.lanes|=t,Rr|=t,e)}function Kx(t,e,n,i,r){var a=ve.p;ve.p=a!==0&&8>a?a:8;var o=Q.T,s={};Q.T=s,Sm(t,!1,e,n);try{var l=r(),c=Q.S;if(c!==null&&c(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=V2(l,i);fl(t,e,u,rn(t))}else fl(t,e,i,rn(t))}catch(f){fl(t,e,{then:function(){},status:"rejected",reason:f},rn())}finally{ve.p=a,o!==null&&s.types!==null&&(o.types=s.types),Q.T=o}}function Y2(){}function Sg(t,e,n,i){if(t.tag!==5)throw Error(O(476));var r=Xx(t).queue;Kx(t,r,e,la,n===null?Y2:function(){return Qx(t),n(i)})}function Xx(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:la,baseState:la,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:la},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Qx(t){var e=Xx(t);e.next===null&&(e=t.alternate.memoizedState),fl(t,e.next.queue,{},rn())}function _m(){return vt(Rl)}function Jx(){return Ge().memoizedState}function e1(){return Ge().memoizedState}function W2(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=rn();t=br(n);var i=_r(e,t,n);i!==null&&($t(i,e,n),cl(i,e,n)),e={cache:am()},t.payload=e;return}e=e.return}}function K2(t,e,n){var i=rn();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ed(t)?n1(e,n):(n=tm(t,e,n,i),n!==null&&($t(n,t,i),i1(n,e,i)))}function t1(t,e,n){var i=rn();fl(t,e,n,i)}function fl(t,e,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ed(t))n1(e,r);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,s=a(o,n);if(r.hasEagerState=!0,r.eagerState=s,an(s,o))return bd(t,e,r,0),Ce===null&&yd(),!1}catch{}if(n=tm(t,e,r,i),n!==null)return $t(n,t,i),i1(n,e,i),!0}return!1}function Sm(t,e,n,i){if(i={lane:2,revertLane:Om(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ed(t)){if(e)throw Error(O(479))}else e=tm(t,n,i,2),e!==null&&$t(e,t,2)}function Ed(t){var e=t.alternate;return t===ie||e!==null&&e===ie}function n1(t,e){Oo=Xu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function i1(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,VS(t,n)}}var Al={readContext:vt,use:xd,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useLayoutEffect:Ve,useInsertionEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useSyncExternalStore:Ve,useId:Ve,useHostTransitionStatus:Ve,useFormState:Ve,useActionState:Ve,useOptimistic:Ve,useMemoCache:Ve,useCacheRefresh:Ve};Al.useEffectEvent=Ve;var r1={readContext:vt,use:xd,useCallback:function(t,e){return Rt().memoizedState=[t,e===void 0?null:e],t},useContext:vt,useEffect:U0,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Mu(4194308,4,Px.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Mu(4194308,4,t,e)},useInsertionEffect:function(t,e){Mu(4,2,t,e)},useMemo:function(t,e){var n=Rt();e=e===void 0?null:e;var i=t();if(ma){fr(!0);try{t()}finally{fr(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Rt();if(n!==void 0){var r=n(e);if(ma){fr(!0);try{n(e)}finally{fr(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=K2.bind(null,ie,t),[i.memoizedState,t]},useRef:function(t){var e=Rt();return t={current:t},e.memoizedState=t},useState:function(t){t=bg(t);var e=t.queue,n=t1.bind(null,ie,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:ym,useDeferredValue:function(t,e){var n=Rt();return bm(n,t,e)},useTransition:function(){var t=bg(!1);return t=Kx.bind(null,ie,t.queue,!0,!1),Rt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=ie,r=Rt();if(he){if(n===void 0)throw Error(O(407));n=n()}else{if(n=e(),Ce===null)throw Error(O(349));(fe&127)!==0||Mx(i,e,n)}r.memoizedState=n;var a={value:n,getSnapshot:e};return r.queue=a,U0(Dx.bind(null,i,a,t),[t]),i.flags|=2048,zo(9,{destroy:void 0},Nx.bind(null,i,a,n,e),null),n},useId:function(){var t=Rt(),e=Ce.identifierPrefix;if(he){var n=Qn,i=Xn;n=(i&~(1<<32-nn(i)-1)).toString(32)+n,e="_"+e+"R_"+n,n=Qu++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=j2++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:_m,useFormState:B0,useActionState:B0,useOptimistic:function(t){var e=Rt();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=Sm.bind(null,ie,!0,n),n.dispatch=e,[t,e]},useMemoCache:gm,useCacheRefresh:function(){return Rt().memoizedState=W2.bind(null,ie)},useEffectEvent:function(t){var e=Rt(),n={impl:t};return e.memoizedState=n,function(){if((me&2)!==0)throw Error(O(440));return n.impl.apply(void 0,arguments)}}},xm={readContext:vt,use:xd,useCallback:Zx,useContext:vt,useEffect:vm,useImperativeHandle:Gx,useInsertionEffect:jx,useLayoutEffect:qx,useMemo:Yx,useReducer:Ou,useRef:Ux,useState:function(){return Ou(Oi)},useDebugValue:ym,useDeferredValue:function(t,e){var n=Ge();return Wx(n,we.memoizedState,t,e)},useTransition:function(){var t=Ou(Oi)[0],e=Ge().memoizedState;return[typeof t=="boolean"?t:$l(t),e]},useSyncExternalStore:Ox,useId:Jx,useHostTransitionStatus:_m,useFormState:$0,useActionState:$0,useOptimistic:function(t,e){var n=Ge();return Ix(n,we,t,e)},useMemoCache:gm,useCacheRefresh:e1};xm.useEffectEvent=Vx;var a1={readContext:vt,use:xd,useCallback:Zx,useContext:vt,useEffect:vm,useImperativeHandle:Gx,useInsertionEffect:jx,useLayoutEffect:qx,useMemo:Yx,useReducer:Rh,useRef:Ux,useState:function(){return Rh(Oi)},useDebugValue:ym,useDeferredValue:function(t,e){var n=Ge();return we===null?bm(n,t,e):Wx(n,we.memoizedState,t,e)},useTransition:function(){var t=Rh(Oi)[0],e=Ge().memoizedState;return[typeof t=="boolean"?t:$l(t),e]},useSyncExternalStore:Ox,useId:Jx,useHostTransitionStatus:_m,useFormState:F0,useActionState:F0,useOptimistic:function(t,e){var n=Ge();return we!==null?Ix(n,we,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:gm,useCacheRefresh:e1};a1.useEffectEvent=Vx;function Oh(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:Le({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var xg={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=rn(),r=br(i);r.payload=e,n!=null&&(r.callback=n),e=_r(t,r,i),e!==null&&($t(e,t,i),cl(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=rn(),r=br(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=_r(t,r,i),e!==null&&($t(e,t,i),cl(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=rn(),i=br(n);i.tag=2,e!=null&&(i.callback=e),e=_r(t,i,n),e!==null&&($t(e,t,n),cl(e,t,n))}};function V0(t,e,n,i,r,a,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,a,o):e.prototype&&e.prototype.isPureReactComponent?!Sl(n,i)||!Sl(r,a):!0}function j0(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&xg.enqueueReplaceState(e,e.state,null)}function va(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=Le({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}function o1(t){qu(t)}function s1(t){console.error(t)}function l1(t){qu(t)}function Ju(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function q0(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function wg(t,e,n){return n=br(n),n.tag=3,n.payload={element:null},n.callback=function(){Ju(t,e)},n}function c1(t){return t=br(t),t.tag=3,t}function u1(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var a=i.value;t.payload=function(){return r(a)},t.callback=function(){q0(e,n,i)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){q0(e,n,i),typeof r!="function"&&(Sr===null?Sr=new Set([this]):Sr.add(this));var s=i.stack;this.componentDidCatch(i.value,{componentStack:s!==null?s:""})})}function X2(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Po(e,n,r,!0),n=on.current,n!==null){switch(n.tag){case 31:case 13:return xn===null?rd():n.alternate===null&&je===0&&(je=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===Yu?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),Uh(t,i,r)),!1;case 22:return n.flags|=65536,i===Yu?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),Uh(t,i,r)),!1}throw Error(O(435,n.tag))}return Uh(t,i,r),rd(),!1}if(he)return e=on.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==ug&&(t=Error(O(422),{cause:i}),wl(_n(t,n)))):(i!==ug&&(e=Error(O(423),{cause:i}),wl(_n(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=_n(i,n),r=wg(t.stateNode,i,r),kh(t,r),je!==4&&(je=2)),!1;var a=Error(O(520),{cause:i});if(a=_n(a,n),gl===null?gl=[a]:gl.push(a),je!==4&&(je=2),e===null)return!0;i=_n(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=wg(n.stateNode,i,t),kh(n,t),!1;case 1:if(e=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(Sr===null||!Sr.has(a))))return n.flags|=65536,r&=-r,n.lanes|=r,r=c1(r),u1(r,t,n,i),kh(n,r),!1}n=n.return}while(n!==null);return!1}var wm=Error(O(461)),Je=!1;function ht(t,e,n,i){e.child=t===null?Ex(e,null,n,i):ga(e,t.child,n,i)}function P0(t,e,n,i,r){n=n.render;var a=e.ref;if("ref"in i){var o={};for(var s in i)s!=="ref"&&(o[s]=i[s])}else o=i;return ha(e),i=dm(t,e,n,o,a,r),s=fm(),t!==null&&!Je?(pm(t,e,r),Mi(t,e,r)):(he&&s&&im(e),e.flags|=1,ht(t,e,i,r),e.child)}function G0(t,e,n,i,r){if(t===null){var a=n.type;return typeof a=="function"&&!nm(a)&&a.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=a,d1(t,e,a,i,r)):(t=ku(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!Em(t,r)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:Sl,n(o,i)&&t.ref===e.ref)return Mi(t,e,r)}return e.flags|=1,t=Ci(a,i),t.ref=e.ref,t.return=e,e.child=t}function d1(t,e,n,i,r){if(t!==null){var a=t.memoizedProps;if(Sl(a,i)&&t.ref===e.ref)if(Je=!1,e.pendingProps=i=a,Em(t,r))(t.flags&131072)!==0&&(Je=!0);else return e.lanes=t.lanes,Mi(t,e,r)}return Eg(t,e,n,i,r)}function f1(t,e,n,i){var r=i.children,a=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(a=a!==null?a.baseLanes|n:n,t!==null){for(i=e.child=t.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~a}else i=0,e.child=null;return Z0(t,e,a,n,i)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ru(e,a!==null?a.cachePool:null),a!==null?H0(e,a):vg(),Tx(e);else return i=e.lanes=536870912,Z0(t,e,a!==null?a.baseLanes|n:n,n,i)}else a!==null?(Ru(e,a.cachePool),H0(e,a),ur(e),e.memoizedState=null):(t!==null&&Ru(e,null),vg(),ur(e));return ht(t,e,r,n),e.child}function il(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function Z0(t,e,n,i,r){var a=om();return a=a===null?null:{parent:Qe._currentValue,pool:a},e.memoizedState={baseLanes:n,cachePool:a},t!==null&&Ru(e,null),vg(),Tx(e),t!==null&&Po(t,e,i,!0),e.childLanes=r,null}function Nu(t,e){return e=ed({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function Y0(t,e,n){return ga(e,t.child,null,n),t=Nu(e,e.pendingProps),t.flags|=2,Xt(e),e.memoizedState=null,t}function Q2(t,e,n){var i=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(he){if(i.mode==="hidden")return t=Nu(e,i),e.lanes=536870912,il(null,t);if(yg(e),(t=De)?(t=rw(t,Sn),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Ar!==null?{id:Xn,overflow:Qn}:null,retryLane:536870912,hydrationErrors:null},n=vx(t),n.return=e,e.child=n,mt=e,De=null)):t=null,t===null)throw Tr(e);return e.lanes=536870912,null}return Nu(e,i)}var a=t.memoizedState;if(a!==null){var o=a.dehydrated;if(yg(e),r)if(e.flags&256)e.flags&=-257,e=Y0(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(O(558));else if(Je||Po(t,e,n,!1),r=(n&t.childLanes)!==0,Je||r){if(i=Ce,i!==null&&(o=jS(i,n),o!==0&&o!==a.retryLane))throw a.retryLane=o,Sa(t,o),$t(i,t,o),wm;rd(),e=Y0(t,e,n)}else t=a.treeContext,De=wn(o.nextSibling),mt=e,he=!0,yr=null,Sn=!1,t!==null&&bx(e,t),e=Nu(e,i),e.flags|=4096;return e}return t=Ci(t.child,{mode:i.mode,children:i.children}),t.ref=e.ref,e.child=t,t.return=e,t}function Du(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(O(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function Eg(t,e,n,i,r){return ha(e),n=dm(t,e,n,i,void 0,r),i=fm(),t!==null&&!Je?(pm(t,e,r),Mi(t,e,r)):(he&&i&&im(e),e.flags|=1,ht(t,e,n,r),e.child)}function W0(t,e,n,i,r,a){return ha(e),e.updateQueue=null,n=Rx(e,i,n,r),kx(t),i=fm(),t!==null&&!Je?(pm(t,e,a),Mi(t,e,a)):(he&&i&&im(e),e.flags|=1,ht(t,e,n,a),e.child)}function K0(t,e,n,i,r){if(ha(e),e.stateNode===null){var a=So,o=n.contextType;typeof o=="object"&&o!==null&&(a=vt(o)),a=new n(i,a),e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=xg,e.stateNode=a,a._reactInternals=e,a=e.stateNode,a.props=i,a.state=e.memoizedState,a.refs={},lm(e),o=n.contextType,a.context=typeof o=="object"&&o!==null?vt(o):So,a.state=e.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(Oh(e,n,o,i),a.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(o=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),o!==a.state&&xg.enqueueReplaceState(a,a.state,null),dl(e,i,a,r),ul(),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){a=e.stateNode;var s=e.memoizedProps,l=va(n,s);a.props=l;var c=a.context,u=n.contextType;o=So,typeof u=="object"&&u!==null&&(o=vt(u));var f=n.getDerivedStateFromProps;u=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s||c!==o)&&j0(e,a,i,o),sr=!1;var h=e.memoizedState;a.state=h,dl(e,i,a,r),ul(),c=e.memoizedState,s||h!==c||sr?(typeof f=="function"&&(Oh(e,n,f,i),c=e.memoizedState),(l=sr||V0(e,n,l,i,h,c,o))?(u||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),a.props=i,a.state=c,a.context=o,i=l):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{a=e.stateNode,gg(t,e),o=e.memoizedProps,u=va(n,o),a.props=u,f=e.pendingProps,h=a.context,c=n.contextType,l=So,typeof c=="object"&&c!==null&&(l=vt(c)),s=n.getDerivedStateFromProps,(c=typeof s=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||h!==l)&&j0(e,a,i,l),sr=!1,h=e.memoizedState,a.state=h,dl(e,i,a,r),ul();var g=e.memoizedState;o!==f||h!==g||sr||t!==null&&t.dependencies!==null&&Zu(t.dependencies)?(typeof s=="function"&&(Oh(e,n,s,i),g=e.memoizedState),(u=sr||V0(e,n,u,i,h,g,l)||t!==null&&t.dependencies!==null&&Zu(t.dependencies))?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(i,g,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(i,g,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=g),a.props=i,a.state=g,a.context=l,i=u):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return a=i,Du(t,e),i=(e.flags&128)!==0,a||i?(a=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:a.render(),e.flags|=1,t!==null&&i?(e.child=ga(e,t.child,null,r),e.child=ga(e,null,n,r)):ht(t,e,n,r),e.memoizedState=a.state,t=e.child):t=Mi(t,e,r),t}function X0(t,e,n,i){return pa(),e.flags|=256,ht(t,e,n,i),e.child}var Mh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nh(t){return{baseLanes:t,cachePool:Sx()}}function Dh(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Jt),t}function p1(t,e,n){var i=e.pendingProps,r=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=t!==null&&t.memoizedState===null?!1:(Pe.current&2)!==0),o&&(r=!0,e.flags&=-129),o=(e.flags&32)!==0,e.flags&=-33,t===null){if(he){if(r?cr(e):ur(e),(t=De)?(t=rw(t,Sn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Ar!==null?{id:Xn,overflow:Qn}:null,retryLane:536870912,hydrationErrors:null},n=vx(t),n.return=e,e.child=n,mt=e,De=null)):t=null,t===null)throw Tr(e);return Bg(t)?e.lanes=32:e.lanes=536870912,null}var s=i.children;return i=i.fallback,r?(ur(e),r=e.mode,s=ed({mode:"hidden",children:s},r),i=ca(i,r,n,null),s.return=e,i.return=e,s.sibling=i,e.child=s,i=e.child,i.memoizedState=Nh(n),i.childLanes=Dh(t,o,n),e.memoizedState=Mh,il(null,i)):(cr(e),Cg(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(a)e.flags&256?(cr(e),e.flags&=-257,e=Lh(t,e,n)):e.memoizedState!==null?(ur(e),e.child=t.child,e.flags|=128,e=null):(ur(e),s=i.fallback,r=e.mode,i=ed({mode:"visible",children:i.children},r),s=ca(s,r,n,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,ga(e,t.child,null,n),i=e.child,i.memoizedState=Nh(n),i.childLanes=Dh(t,o,n),e.memoizedState=Mh,e=il(null,i));else if(cr(e),Bg(s)){if(o=s.nextSibling&&s.nextSibling.dataset,o)var c=o.dgst;o=c,i=Error(O(419)),i.stack="",i.digest=o,wl({value:i,source:null,stack:null}),e=Lh(t,e,n)}else if(Je||Po(t,e,n,!1),o=(n&t.childLanes)!==0,Je||o){if(o=Ce,o!==null&&(i=jS(o,n),i!==0&&i!==l.retryLane))throw l.retryLane=i,Sa(t,i),$t(o,t,i),wm;zg(s)||rd(),e=Lh(t,e,n)}else zg(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,De=wn(s.nextSibling),mt=e,he=!0,yr=null,Sn=!1,t!==null&&bx(e,t),e=Cg(e,i.children),e.flags|=4096);return e}return r?(ur(e),s=i.fallback,r=e.mode,l=t.child,c=l.sibling,i=Ci(l,{mode:"hidden",children:i.children}),i.subtreeFlags=l.subtreeFlags&65011712,c!==null?s=Ci(c,s):(s=ca(s,r,n,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,il(null,i),i=e.child,s=t.child.memoizedState,s===null?s=Nh(n):(r=s.cachePool,r!==null?(l=Qe._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=Sx(),s={baseLanes:s.baseLanes|n,cachePool:r}),i.memoizedState=s,i.childLanes=Dh(t,o,n),e.memoizedState=Mh,il(t.child,i)):(cr(e),n=t.child,t=n.sibling,n=Ci(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(o=e.deletions,o===null?(e.deletions=[t],e.flags|=16):o.push(t)),e.child=n,e.memoizedState=null,n)}function Cg(t,e){return e=ed({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function ed(t,e){return t=Qt(22,t,null,e),t.lanes=0,t}function Lh(t,e,n){return ga(e,t.child,null,n),t=Cg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Q0(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),fg(t.return,e,n)}function Hh(t,e,n,i,r,a){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:a}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=i,o.tail=n,o.tailMode=r,o.treeForkCount=a)}function h1(t,e,n){var i=e.pendingProps,r=i.revealOrder,a=i.tail;i=i.children;var o=Pe.current,s=(o&2)!==0;if(s?(o=o&1|2,e.flags|=128):o&=1,Te(Pe,o),ht(t,e,i,n),i=he?xl:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Q0(t,n,e);else if(t.tag===19)Q0(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&Ku(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Hh(e,!1,r,n,a,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&Ku(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Hh(e,!0,n,null,a,i);break;case"together":Hh(e,!1,null,null,void 0,i);break;default:e.memoizedState=null}return e.child}function Mi(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Rr|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Po(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(O(153));if(e.child!==null){for(t=e.child,n=Ci(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Ci(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Em(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&Zu(t)))}function J2(t,e,n){switch(e.tag){case 3:Fu(e,e.stateNode.containerInfo),lr(e,Qe,t.memoizedState.cache),pa();break;case 27:case 5:Jh(e);break;case 4:Fu(e,e.stateNode.containerInfo);break;case 10:lr(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,yg(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(cr(e),e.flags|=128,null):(n&e.child.childLanes)!==0?p1(t,e,n):(cr(e),t=Mi(t,e,n),t!==null?t.sibling:null);cr(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(Po(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return h1(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Te(Pe,Pe.current),i)break;return null;case 22:return e.lanes=0,f1(t,e,n,e.pendingProps);case 24:lr(e,Qe,t.memoizedState.cache)}return Mi(t,e,n)}function g1(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)Je=!0;else{if(!Em(t,n)&&(e.flags&128)===0)return Je=!1,J2(t,e,n);Je=(t.flags&131072)!==0}else Je=!1,he&&(e.flags&1048576)!==0&&yx(e,xl,e.index);switch(e.lanes=0,e.tag){case 16:e:{var i=e.pendingProps;if(t=oa(e.elementType),e.type=t,typeof t=="function")nm(t)?(i=va(t,i),e.tag=1,e=K0(null,e,t,i,n)):(e.tag=0,e=Eg(null,e,t,i,n));else{if(t!=null){var r=t.$$typeof;if(r===Vg){e.tag=11,e=P0(null,e,t,i,n);break e}else if(r===jg){e.tag=14,e=G0(null,e,t,i,n);break e}}throw e=Xh(t)||t,Error(O(306,e,""))}}return e;case 0:return Eg(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=va(i,e.pendingProps),K0(t,e,i,r,n);case 3:e:{if(Fu(e,e.stateNode.containerInfo),t===null)throw Error(O(387));i=e.pendingProps;var a=e.memoizedState;r=a.element,gg(t,e),dl(e,i,null,n);var o=e.memoizedState;if(i=o.cache,lr(e,Qe,i),i!==a.cache&&pg(e,[Qe],n,!0),ul(),i=o.element,a.isDehydrated)if(a={element:i,isDehydrated:!1,cache:o.cache},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){e=X0(t,e,i,n);break e}else if(i!==r){r=_n(Error(O(424)),e),wl(r),e=X0(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,De=wn(t.firstChild),mt=e,he=!0,yr=null,Sn=!0,n=Ex(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(pa(),i===r){e=Mi(t,e,n);break e}ht(t,e,i,n)}e=e.child}return e;case 26:return Du(t,e),t===null?(n=_S(e.type,null,e.pendingProps,null))?e.memoizedState=n:he||(n=e.type,t=e.pendingProps,i=ld(vr.current).createElement(n),i[gt]=e,i[Ft]=t,yt(i,n,t),ct(i),e.stateNode=i):e.memoizedState=_S(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Jh(e),t===null&&he&&(i=e.stateNode=aw(e.type,e.pendingProps,vr.current),mt=e,Sn=!0,r=De,Mr(e.type)?($g=r,De=wn(i.firstChild)):De=r),ht(t,e,e.pendingProps.children,n),Du(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&he&&((r=i=De)&&(i=TO(i,e.type,e.pendingProps,Sn),i!==null?(e.stateNode=i,mt=e,De=wn(i.firstChild),Sn=!1,r=!0):r=!1),r||Tr(e)),Jh(e),r=e.type,a=e.pendingProps,o=t!==null?t.memoizedProps:null,i=a.children,Hg(r,a)?i=null:o!==null&&Hg(r,o)&&(e.flags|=32),e.memoizedState!==null&&(r=dm(t,e,q2,null,null,n),Rl._currentValue=r),Du(t,e),ht(t,e,i,n),e.child;case 6:return t===null&&he&&((t=n=De)&&(n=kO(n,e.pendingProps,Sn),n!==null?(e.stateNode=n,mt=e,De=null,t=!0):t=!1),t||Tr(e)),null;case 13:return p1(t,e,n);case 4:return Fu(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=ga(e,null,i,n):ht(t,e,i,n),e.child;case 11:return P0(t,e,e.type,e.pendingProps,n);case 7:return ht(t,e,e.pendingProps,n),e.child;case 8:return ht(t,e,e.pendingProps.children,n),e.child;case 12:return ht(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,lr(e,e.type,i.value),ht(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,ha(e),r=vt(r),i=i(r),e.flags|=1,ht(t,e,i,n),e.child;case 14:return G0(t,e,e.type,e.pendingProps,n);case 15:return d1(t,e,e.type,e.pendingProps,n);case 19:return h1(t,e,n);case 31:return Q2(t,e,n);case 22:return f1(t,e,n,e.pendingProps);case 24:return ha(e),i=vt(Qe),t===null?(r=om(),r===null&&(r=Ce,a=am(),r.pooledCache=a,a.refCount++,a!==null&&(r.pooledCacheLanes|=n),r=a),e.memoizedState={parent:i,cache:r},lm(e),lr(e,Qe,r)):((t.lanes&n)!==0&&(gg(t,e),dl(e,null,null,n),ul()),r=t.memoizedState,a=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),lr(e,Qe,i)):(i=a.cache,lr(e,Qe,i),i!==r.cache&&pg(e,[Qe],n,!0))),ht(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(O(156,e.tag))}function mi(t){t.flags|=4}function Ih(t,e,n,i,r){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(r&335544128)===r)if(t.stateNode.complete)t.flags|=8192;else if($1())t.flags|=8192;else throw da=Yu,sm}else t.flags&=-16777217}function J0(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!lw(e))if($1())t.flags|=8192;else throw da=Yu,sm}function vu(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?FS():536870912,t.lanes|=e,Bo|=e)}function Ks(t,e){if(!he)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Ne(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function eO(t,e,n){var i=e.pendingProps;switch(rm(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ne(e),null;case 1:return Ne(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),Ai(Qe),No(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(lo(e)?mi(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Th())),Ne(e),null;case 26:var r=e.type,a=e.memoizedState;return t===null?(mi(e),a!==null?(Ne(e),J0(e,a)):(Ne(e),Ih(e,r,null,i,n))):a?a!==t.memoizedState?(mi(e),Ne(e),J0(e,a)):(Ne(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&mi(e),Ne(e),Ih(e,r,t,i,n)),null;case 27:if(Uu(e),n=vr.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&mi(e);else{if(!i){if(e.stateNode===null)throw Error(O(166));return Ne(e),null}t=ei.current,lo(e)?k0(e,t):(t=aw(r,i,n),e.stateNode=t,mi(e))}return Ne(e),null;case 5:if(Uu(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&mi(e);else{if(!i){if(e.stateNode===null)throw Error(O(166));return Ne(e),null}if(a=ei.current,lo(e))k0(e,a);else{var o=ld(vr.current);switch(a){case 1:a=o.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:a=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":a=o.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":a=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":a=o.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof i.is=="string"?o.createElement("select",{is:i.is}):o.createElement("select"),i.multiple?a.multiple=!0:i.size&&(a.size=i.size);break;default:a=typeof i.is=="string"?o.createElement(r,{is:i.is}):o.createElement(r)}}a[gt]=e,a[Ft]=i;e:for(o=e.child;o!==null;){if(o.tag===5||o.tag===6)a.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===e)break e;for(;o.sibling===null;){if(o.return===null||o.return===e)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}e.stateNode=a;e:switch(yt(a,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&mi(e)}}return Ne(e),Ih(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&mi(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(O(166));if(t=vr.current,lo(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=mt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[gt]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||tw(t.nodeValue,n)),t||Tr(e,!0)}else t=ld(t).createTextNode(i),t[gt]=e,e.stateNode=t}return Ne(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(i=lo(e),n!==null){if(t===null){if(!i)throw Error(O(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(557));t[gt]=e}else pa(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ne(e),t=!1}else n=Th(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(Xt(e),e):(Xt(e),null);if((e.flags&128)!==0)throw Error(O(558))}return Ne(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=lo(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(O(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(O(317));r[gt]=e}else pa(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ne(e),r=!1}else r=Th(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(Xt(e),e):(Xt(e),null)}return Xt(e),(e.flags&128)!==0?(e.lanes=n,e):(n=i!==null,t=t!==null&&t.memoizedState!==null,n&&(i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==r&&(i.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),vu(e,e.updateQueue),Ne(e),null);case 4:return No(),t===null&&Mm(e.stateNode.containerInfo),Ne(e),null;case 10:return Ai(e.type),Ne(e),null;case 19:if(ut(Pe),i=e.memoizedState,i===null)return Ne(e),null;if(r=(e.flags&128)!==0,a=i.rendering,a===null)if(r)Ks(i,!1);else{if(je!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(a=Ku(t),a!==null){for(e.flags|=128,Ks(i,!1),t=a.updateQueue,e.updateQueue=t,vu(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)mx(n,t),n=n.sibling;return Te(Pe,Pe.current&1|2),he&&_i(e,i.treeForkCount),e.child}t=t.sibling}i.tail!==null&&en()>nd&&(e.flags|=128,r=!0,Ks(i,!1),e.lanes=4194304)}else{if(!r)if(t=Ku(a),t!==null){if(e.flags|=128,r=!0,t=t.updateQueue,e.updateQueue=t,vu(e,t),Ks(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!he)return Ne(e),null}else 2*en()-i.renderingStartTime>nd&&n!==536870912&&(e.flags|=128,r=!0,Ks(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(t=i.last,t!==null?t.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=en(),t.sibling=null,n=Pe.current,Te(Pe,r?n&1|2:n&1),he&&_i(e,i.treeForkCount),t):(Ne(e),null);case 22:case 23:return Xt(e),cm(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(Ne(e),e.subtreeFlags&6&&(e.flags|=8192)):Ne(e),n=e.updateQueue,n!==null&&vu(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&ut(ua),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Ai(Qe),Ne(e),null;case 25:return null;case 30:return null}throw Error(O(156,e.tag))}function tO(t,e){switch(rm(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ai(Qe),No(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Uu(e),null;case 31:if(e.memoizedState!==null){if(Xt(e),e.alternate===null)throw Error(O(340));pa()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Xt(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(O(340));pa()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ut(Pe),null;case 4:return No(),null;case 10:return Ai(e.type),null;case 22:case 23:return Xt(e),cm(),t!==null&&ut(ua),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Ai(Qe),null;case 25:return null;default:return null}}function m1(t,e){switch(rm(e),e.tag){case 3:Ai(Qe),No();break;case 26:case 27:case 5:Uu(e);break;case 4:No();break;case 31:e.memoizedState!==null&&Xt(e);break;case 13:Xt(e);break;case 19:ut(Pe);break;case 10:Ai(e.type);break;case 22:case 23:Xt(e),cm(),t!==null&&ut(ua);break;case 24:Ai(Qe)}}function Fl(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var a=n.create,o=n.inst;i=a(),o.destroy=i}n=n.next}while(n!==r)}}catch(s){_e(e,e.return,s)}}function kr(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var a=r.next;i=a;do{if((i.tag&t)===t){var o=i.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,r=e;var l=n,c=s;try{c()}catch(u){_e(r,l,u)}}}i=i.next}while(i!==a)}}catch(u){_e(e,e.return,u)}}function v1(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{Ax(e,n)}catch(i){_e(t,t.return,i)}}}function y1(t,e,n){n.props=va(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){_e(t,e,i)}}function pl(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){_e(t,e,r)}}function Jn(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){_e(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){_e(t,e,r)}else n.current=null}function b1(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){_e(t,t.return,r)}}function zh(t,e,n){try{var i=t.stateNode;SO(i,t.type,n,e),i[Ft]=e}catch(r){_e(t,t.return,r)}}function _1(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Mr(t.type)||t.tag===4}function Bh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||_1(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Mr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ag(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=wi));else if(i!==4&&(i===27&&Mr(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Ag(t,e,n),t=t.sibling;t!==null;)Ag(t,e,n),t=t.sibling}function td(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&Mr(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(td(t,e,n),t=t.sibling;t!==null;)td(t,e,n),t=t.sibling}function S1(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);yt(e,i,n),e[gt]=t,e[Ft]=n}catch(a){_e(t,t.return,a)}}var Si=!1,Xe=!1,$h=!1,eS=typeof WeakSet=="function"?WeakSet:Set,lt=null;function nO(t,e){if(t=t.containerInfo,Dg=fd,t=lx(t),Jg(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,s=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var g;f!==n||r!==0&&f.nodeType!==3||(s=o+r),f!==a||i!==0&&f.nodeType!==3||(l=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===t)break t;if(h===n&&++c===r&&(s=o),h===a&&++u===i&&(l=o),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Lg={focusedElem:t,selectionRange:n},fd=!1,lt=e;lt!==null;)if(e=lt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,lt=t;else for(;lt!==null;){switch(e=lt,a=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)r=t[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&a!==null){t=void 0,n=e,r=a.memoizedProps,a=a.memoizedState,i=n.stateNode;try{var _=va(n.type,r);t=i.getSnapshotBeforeUpdate(_,a),i.__reactInternalSnapshotBeforeUpdate=t}catch(b){_e(n,n.return,b)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Ig(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ig(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(O(163))}if(t=e.sibling,t!==null){t.return=e.return,lt=t;break}lt=e.return}}function x1(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:yi(t,n),i&4&&Fl(5,n);break;case 1:if(yi(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(o){_e(n,n.return,o)}else{var r=va(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(o){_e(n,n.return,o)}}i&64&&v1(n),i&512&&pl(n,n.return);break;case 3:if(yi(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{Ax(t,e)}catch(o){_e(n,n.return,o)}}break;case 27:e===null&&i&4&&S1(n);case 26:case 5:yi(t,n),e===null&&i&4&&b1(n),i&512&&pl(n,n.return);break;case 12:yi(t,n);break;case 31:yi(t,n),i&4&&C1(t,n);break;case 13:yi(t,n),i&4&&A1(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=dO.bind(null,n),RO(t,n))));break;case 22:if(i=n.memoizedState!==null||Si,!i){e=e!==null&&e.memoizedState!==null||Xe,r=Si;var a=Xe;Si=i,(Xe=e)&&!a?bi(t,n,(n.subtreeFlags&8772)!==0):yi(t,n),Si=r,Xe=a}break;case 30:break;default:yi(t,n)}}function w1(t){var e=t.alternate;e!==null&&(t.alternate=null,w1(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Zg(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ze=null,zt=!1;function vi(t,e,n){for(n=n.child;n!==null;)E1(t,e,n),n=n.sibling}function E1(t,e,n){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(Dl,n)}catch{}switch(n.tag){case 26:Xe||Jn(n,e),vi(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xe||Jn(n,e);var i=ze,r=zt;Mr(n.type)&&(ze=n.stateNode,zt=!1),vi(t,e,n),vl(n.stateNode),ze=i,zt=r;break;case 5:Xe||Jn(n,e);case 6:if(i=ze,r=zt,ze=null,vi(t,e,n),ze=i,zt=r,ze!==null)if(zt)try{(ze.nodeType===9?ze.body:ze.nodeName==="HTML"?ze.ownerDocument.body:ze).removeChild(n.stateNode)}catch(a){_e(n,e,a)}else try{ze.removeChild(n.stateNode)}catch(a){_e(n,e,a)}break;case 18:ze!==null&&(zt?(t=ze,gS(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Vo(t)):gS(ze,n.stateNode));break;case 4:i=ze,r=zt,ze=n.stateNode.containerInfo,zt=!0,vi(t,e,n),ze=i,zt=r;break;case 0:case 11:case 14:case 15:kr(2,n,e),Xe||kr(4,n,e),vi(t,e,n);break;case 1:Xe||(Jn(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&y1(n,e,i)),vi(t,e,n);break;case 21:vi(t,e,n);break;case 22:Xe=(i=Xe)||n.memoizedState!==null,vi(t,e,n),Xe=i;break;default:vi(t,e,n)}}function C1(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Vo(t)}catch(n){_e(e,e.return,n)}}}function A1(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Vo(t)}catch(n){_e(e,e.return,n)}}function iO(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new eS),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new eS),e;default:throw Error(O(435,t.tag))}}function yu(t,e){var n=iO(t);e.forEach(function(i){if(!n.has(i)){n.add(i);var r=fO.bind(null,t,i);i.then(r,r)}})}function Ht(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],a=t,o=e,s=o;e:for(;s!==null;){switch(s.tag){case 27:if(Mr(s.type)){ze=s.stateNode,zt=!1;break e}break;case 5:ze=s.stateNode,zt=!1;break e;case 3:case 4:ze=s.stateNode.containerInfo,zt=!0;break e}s=s.return}if(ze===null)throw Error(O(160));E1(a,o,r),ze=null,zt=!1,a=r.alternate,a!==null&&(a.return=null),r.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)T1(e,t),e=e.sibling}var In=null;function T1(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Ht(e,t),It(t),i&4&&(kr(3,t,t.return),Fl(3,t),kr(5,t,t.return));break;case 1:Ht(e,t),It(t),i&512&&(Xe||n===null||Jn(n,n.return)),i&64&&Si&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=In;if(Ht(e,t),It(t),i&512&&(Xe||n===null||Jn(n,n.return)),i&4){var a=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":a=r.getElementsByTagName("title")[0],(!a||a[Il]||a[gt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(i),r.head.insertBefore(a,r.querySelector("head > title"))),yt(a,i,n),a[gt]=t,ct(a),i=a;break e;case"link":var o=xS("link","href",r).get(i+(n.href||""));if(o){for(var s=0;s<o.length;s++)if(a=o[s],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break t}}a=r.createElement(i),yt(a,i,n),r.head.appendChild(a);break;case"meta":if(o=xS("meta","content",r).get(i+(n.content||""))){for(s=0;s<o.length;s++)if(a=o[s],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(s,1);break t}}a=r.createElement(i),yt(a,i,n),r.head.appendChild(a);break;default:throw Error(O(468,i))}a[gt]=t,ct(a),i=a}t.stateNode=i}else wS(r,t.type,t.stateNode);else t.stateNode=SS(r,i,t.memoizedProps);else a!==i?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,i===null?wS(r,t.type,t.stateNode):SS(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&zh(t,t.memoizedProps,n.memoizedProps)}break;case 27:Ht(e,t),It(t),i&512&&(Xe||n===null||Jn(n,n.return)),n!==null&&i&4&&zh(t,t.memoizedProps,n.memoizedProps);break;case 5:if(Ht(e,t),It(t),i&512&&(Xe||n===null||Jn(n,n.return)),t.flags&32){r=t.stateNode;try{Lo(r,"")}catch(_){_e(t,t.return,_)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,zh(t,r,n!==null?n.memoizedProps:r)),i&1024&&($h=!0);break;case 6:if(Ht(e,t),It(t),i&4){if(t.stateNode===null)throw Error(O(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(_){_e(t,t.return,_)}}break;case 3:if(Iu=null,r=In,In=cd(e.containerInfo),Ht(e,t),In=r,It(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Vo(e.containerInfo)}catch(_){_e(t,t.return,_)}$h&&($h=!1,k1(t));break;case 4:i=In,In=cd(t.stateNode.containerInfo),Ht(e,t),It(t),In=i;break;case 12:Ht(e,t),It(t);break;case 31:Ht(e,t),It(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,yu(t,i)));break;case 13:Ht(e,t),It(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Cd=en()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,yu(t,i)));break;case 22:r=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=Si,u=Xe;if(Si=c||r,Xe=u||l,Ht(e,t),Xe=u,Si=c,It(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||l||Si||Xe||sa(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(a=l.stateNode,r)o=a.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{s=l.stateNode;var f=l.memoizedProps.style,h=f!=null&&f.hasOwnProperty("display")?f.display:null;s.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(_){_e(l,l.return,_)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(_){_e(l,l.return,_)}}}else if(e.tag===18){if(n===null){l=e;try{var g=l.stateNode;r?mS(g,!0):mS(l.stateNode,!1)}catch(_){_e(l,l.return,_)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,yu(t,n))));break;case 19:Ht(e,t),It(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,yu(t,i)));break;case 30:break;case 21:break;default:Ht(e,t),It(t)}}function It(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(_1(i)){n=i;break}i=i.return}if(n==null)throw Error(O(160));switch(n.tag){case 27:var r=n.stateNode,a=Bh(t);td(t,a,r);break;case 5:var o=n.stateNode;n.flags&32&&(Lo(o,""),n.flags&=-33);var s=Bh(t);td(t,s,o);break;case 3:case 4:var l=n.stateNode.containerInfo,c=Bh(t);Ag(t,c,l);break;default:throw Error(O(161))}}catch(u){_e(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function k1(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;k1(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function yi(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)x1(t,e.alternate,e),e=e.sibling}function sa(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:kr(4,e,e.return),sa(e);break;case 1:Jn(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&y1(e,e.return,n),sa(e);break;case 27:vl(e.stateNode);case 26:case 5:Jn(e,e.return),sa(e);break;case 22:e.memoizedState===null&&sa(e);break;case 30:sa(e);break;default:sa(e)}t=t.sibling}}function bi(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,a=e,o=a.flags;switch(a.tag){case 0:case 11:case 15:bi(r,a,n),Fl(4,a);break;case 1:if(bi(r,a,n),i=a,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){_e(i,i.return,c)}if(i=a,r=i.updateQueue,r!==null){var s=i.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)Cx(l[r],s)}catch(c){_e(i,i.return,c)}}n&&o&64&&v1(a),pl(a,a.return);break;case 27:S1(a);case 26:case 5:bi(r,a,n),n&&i===null&&o&4&&b1(a),pl(a,a.return);break;case 12:bi(r,a,n);break;case 31:bi(r,a,n),n&&o&4&&C1(r,a);break;case 13:bi(r,a,n),n&&o&4&&A1(r,a);break;case 22:a.memoizedState===null&&bi(r,a,n),pl(a,a.return);break;case 30:break;default:bi(r,a,n)}e=e.sibling}}function Cm(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Bl(n))}function Am(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Bl(t))}function Hn(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)R1(t,e,n,i),e=e.sibling}function R1(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:Hn(t,e,n,i),r&2048&&Fl(9,e);break;case 1:Hn(t,e,n,i);break;case 3:Hn(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Bl(t)));break;case 12:if(r&2048){Hn(t,e,n,i),t=e.stateNode;try{var a=e.memoizedProps,o=a.id,s=a.onPostCommit;typeof s=="function"&&s(o,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){_e(e,e.return,l)}}else Hn(t,e,n,i);break;case 31:Hn(t,e,n,i);break;case 13:Hn(t,e,n,i);break;case 23:break;case 22:a=e.stateNode,o=e.alternate,e.memoizedState!==null?a._visibility&2?Hn(t,e,n,i):hl(t,e):a._visibility&2?Hn(t,e,n,i):(a._visibility|=2,uo(t,e,n,i,(e.subtreeFlags&10256)!==0||!1)),r&2048&&Cm(o,e);break;case 24:Hn(t,e,n,i),r&2048&&Am(e.alternate,e);break;default:Hn(t,e,n,i)}}function uo(t,e,n,i,r){for(r=r&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var a=t,o=e,s=n,l=i,c=o.flags;switch(o.tag){case 0:case 11:case 15:uo(a,o,s,l,r),Fl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState!==null?u._visibility&2?uo(a,o,s,l,r):hl(a,o):(u._visibility|=2,uo(a,o,s,l,r)),r&&c&2048&&Cm(o.alternate,o);break;case 24:uo(a,o,s,l,r),r&&c&2048&&Am(o.alternate,o);break;default:uo(a,o,s,l,r)}e=e.sibling}}function hl(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:hl(n,i),r&2048&&Cm(i.alternate,i);break;case 24:hl(n,i),r&2048&&Am(i.alternate,i);break;default:hl(n,i)}e=e.sibling}}var rl=8192;function co(t,e,n){if(t.subtreeFlags&rl)for(t=t.child;t!==null;)O1(t,e,n),t=t.sibling}function O1(t,e,n){switch(t.tag){case 26:co(t,e,n),t.flags&rl&&t.memoizedState!==null&&UO(n,In,t.memoizedState,t.memoizedProps);break;case 5:co(t,e,n);break;case 3:case 4:var i=In;In=cd(t.stateNode.containerInfo),co(t,e,n),In=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=rl,rl=16777216,co(t,e,n),rl=i):co(t,e,n));break;default:co(t,e,n)}}function M1(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Xs(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];lt=i,D1(i,t)}M1(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)N1(t),t=t.sibling}function N1(t){switch(t.tag){case 0:case 11:case 15:Xs(t),t.flags&2048&&kr(9,t,t.return);break;case 3:Xs(t);break;case 12:Xs(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Lu(t)):Xs(t);break;default:Xs(t)}}function Lu(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];lt=i,D1(i,t)}M1(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:kr(8,e,e.return),Lu(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Lu(e));break;default:Lu(e)}t=t.sibling}}function D1(t,e){for(;lt!==null;){var n=lt;switch(n.tag){case 0:case 11:case 15:kr(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Bl(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,lt=i;else e:for(n=t;lt!==null;){i=lt;var r=i.sibling,a=i.return;if(w1(i),i===n){lt=null;break e}if(r!==null){r.return=a,lt=r;break e}lt=a}}}var rO={getCacheForType:function(t){var e=vt(Qe),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return vt(Qe).controller.signal}},aO=typeof WeakMap=="function"?WeakMap:Map,me=0,Ce=null,le=null,fe=0,be=0,Kt=null,hr=!1,Zo=!1,Tm=!1,Ni=0,je=0,Rr=0,fa=0,km=0,Jt=0,Bo=0,gl=null,Bt=null,Tg=!1,Cd=0,L1=0,nd=1/0,id=null,Sr=null,it=0,xr=null,$o=null,Ti=0,kg=0,Rg=null,H1=null,ml=0,Og=null;function rn(){return(me&2)!==0&&fe!==0?fe&-fe:Q.T!==null?Om():qS()}function I1(){if(Jt===0)if((fe&536870912)===0||he){var t=lu;lu<<=1,(lu&3932160)===0&&(lu=262144),Jt=t}else Jt=536870912;return t=on.current,t!==null&&(t.flags|=32),Jt}function $t(t,e,n){(t===Ce&&(be===2||be===9)||t.cancelPendingCommit!==null)&&(Fo(t,0),gr(t,fe,Jt,!1)),Hl(t,n),((me&2)===0||t!==Ce)&&(t===Ce&&((me&2)===0&&(fa|=n),je===4&&gr(t,fe,Jt,!1)),ni(t))}function z1(t,e,n){if((me&6)!==0)throw Error(O(327));var i=!n&&(e&127)===0&&(e&t.expiredLanes)===0||Ll(t,e),r=i?lO(t,e):Fh(t,e,!0),a=i;do{if(r===0){Zo&&!i&&gr(t,e,0,!1);break}else{if(n=t.current.alternate,a&&!oO(n)){r=Fh(t,e,!1),a=!1;continue}if(r===2){if(a=e,t.errorRecoveryDisabledLanes&a)var o=0;else o=t.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){e=o;e:{var s=t;r=gl;var l=s.current.memoizedState.isDehydrated;if(l&&(Fo(s,o).flags|=256),o=Fh(s,o,!1),o!==2){if(Tm&&!l){s.errorRecoveryDisabledLanes|=a,fa|=a,r=4;break e}a=Bt,Bt=r,a!==null&&(Bt===null?Bt=a:Bt.push.apply(Bt,a))}r=o}if(a=!1,r!==2)continue}}if(r===1){Fo(t,0),gr(t,e,0,!0);break}e:{switch(i=t,a=r,a){case 0:case 1:throw Error(O(345));case 4:if((e&4194048)!==e)break;case 6:gr(i,e,Jt,!hr);break e;case 2:Bt=null;break;case 3:case 5:break;default:throw Error(O(329))}if((e&62914560)===e&&(r=Cd+300-en(),10<r)){if(gr(i,e,Jt,!hr),hd(i,0,!0)!==0)break e;Ti=e,i.timeoutHandle=iw(tS.bind(null,i,n,Bt,id,Tg,e,Jt,fa,Bo,hr,a,"Throttled",-0,0),r);break e}tS(i,n,Bt,id,Tg,e,Jt,fa,Bo,hr,a,null,-0,0)}}break}while(!0);ni(t)}function tS(t,e,n,i,r,a,o,s,l,c,u,f,h,g){if(t.timeoutHandle=-1,f=e.subtreeFlags,f&8192||(f&16785408)===16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wi},O1(e,a,f);var _=(a&62914560)===a?Cd-en():(a&4194048)===a?L1-en():0;if(_=VO(f,_),_!==null){Ti=a,t.cancelPendingCommit=_(iS.bind(null,t,e,a,n,i,r,o,s,l,u,f,null,h,g)),gr(t,a,o,!c);return}}iS(t,e,a,n,i,r,o,s,l)}function oO(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],a=r.getSnapshot;r=r.value;try{if(!an(a(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function gr(t,e,n,i){e&=~km,e&=~fa,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var a=31-nn(r),o=1<<a;i[a]=-1,r&=~o}n!==0&&US(t,n,e)}function Ad(){return(me&6)===0?(Ul(0,!1),!1):!0}function Rm(){if(le!==null){if(be===0)var t=le.return;else t=le,Ei=xa=null,hm(t),Ro=null,El=0,t=le;for(;t!==null;)m1(t.alternate,t),t=t.return;le=null}}function Fo(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,EO(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),Ti=0,Rm(),Ce=t,le=n=Ci(t.current,null),fe=e,be=0,Kt=null,hr=!1,Zo=Ll(t,e),Tm=!1,Bo=Jt=km=fa=Rr=je=0,Bt=gl=null,Tg=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-nn(i),a=1<<r;e|=t[r],i&=~a}return Ni=e,yd(),n}function B1(t,e){ie=null,Q.H=Al,e===Go||e===_d?(e=D0(),be=3):e===sm?(e=D0(),be=4):be=e===wm?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Kt=e,le===null&&(je=1,Ju(t,_n(e,t.current)))}function $1(){var t=on.current;return t===null?!0:(fe&4194048)===fe?xn===null:(fe&62914560)===fe||(fe&536870912)!==0?t===xn:!1}function F1(){var t=Q.H;return Q.H=Al,t===null?Al:t}function U1(){var t=Q.A;return Q.A=rO,t}function rd(){je=4,hr||(fe&4194048)!==fe&&on.current!==null||(Zo=!0),(Rr&134217727)===0&&(fa&134217727)===0||Ce===null||gr(Ce,fe,Jt,!1)}function Fh(t,e,n){var i=me;me|=2;var r=F1(),a=U1();(Ce!==t||fe!==e)&&(id=null,Fo(t,e)),e=!1;var o=je;e:do try{if(be!==0&&le!==null){var s=le,l=Kt;switch(be){case 8:Rm(),o=6;break e;case 3:case 2:case 9:case 6:on.current===null&&(e=!0);var c=be;if(be=0,Kt=null,Eo(t,s,l,c),n&&Zo){o=0;break e}break;default:c=be,be=0,Kt=null,Eo(t,s,l,c)}}sO(),o=je;break}catch(u){B1(t,u)}while(!0);return e&&t.shellSuspendCounter++,Ei=xa=null,me=i,Q.H=r,Q.A=a,le===null&&(Ce=null,fe=0,yd()),o}function sO(){for(;le!==null;)V1(le)}function lO(t,e){var n=me;me|=2;var i=F1(),r=U1();Ce!==t||fe!==e?(id=null,nd=en()+500,Fo(t,e)):Zo=Ll(t,e);e:do try{if(be!==0&&le!==null){e=le;var a=Kt;t:switch(be){case 1:be=0,Kt=null,Eo(t,e,a,1);break;case 2:case 9:if(N0(a)){be=0,Kt=null,nS(e);break}e=function(){be!==2&&be!==9||Ce!==t||(be=7),ni(t)},a.then(e,e);break e;case 3:be=7;break e;case 4:be=5;break e;case 7:N0(a)?(be=0,Kt=null,nS(e)):(be=0,Kt=null,Eo(t,e,a,7));break;case 5:var o=null;switch(le.tag){case 26:o=le.memoizedState;case 5:case 27:var s=le;if(o?lw(o):s.stateNode.complete){be=0,Kt=null;var l=s.sibling;if(l!==null)le=l;else{var c=s.return;c!==null?(le=c,Td(c)):le=null}break t}}be=0,Kt=null,Eo(t,e,a,5);break;case 6:be=0,Kt=null,Eo(t,e,a,6);break;case 8:Rm(),je=6;break e;default:throw Error(O(462))}}cO();break}catch(u){B1(t,u)}while(!0);return Ei=xa=null,Q.H=i,Q.A=r,me=n,le!==null?0:(Ce=null,fe=0,yd(),je)}function cO(){for(;le!==null&&!NR();)V1(le)}function V1(t){var e=g1(t.alternate,t,Ni);t.memoizedProps=t.pendingProps,e===null?Td(t):le=e}function nS(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=W0(n,e,e.pendingProps,e.type,void 0,fe);break;case 11:e=W0(n,e,e.pendingProps,e.type.render,e.ref,fe);break;case 5:hm(e);default:m1(n,e),e=le=mx(e,Ni),e=g1(n,e,Ni)}t.memoizedProps=t.pendingProps,e===null?Td(t):le=e}function Eo(t,e,n,i){Ei=xa=null,hm(e),Ro=null,El=0;var r=e.return;try{if(X2(t,r,e,n,fe)){je=1,Ju(t,_n(n,t.current)),le=null;return}}catch(a){if(r!==null)throw le=r,a;je=1,Ju(t,_n(n,t.current)),le=null;return}e.flags&32768?(he||i===1?t=!0:Zo||(fe&536870912)!==0?t=!1:(hr=t=!0,(i===2||i===9||i===3||i===6)&&(i=on.current,i!==null&&i.tag===13&&(i.flags|=16384))),j1(e,t)):Td(e)}function Td(t){var e=t;do{if((e.flags&32768)!==0){j1(e,hr);return}t=e.return;var n=eO(e.alternate,e,Ni);if(n!==null){le=n;return}if(e=e.sibling,e!==null){le=e;return}le=e=t}while(e!==null);je===0&&(je=5)}function j1(t,e){do{var n=tO(t.alternate,t);if(n!==null){n.flags&=32767,le=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){le=t;return}le=t=n}while(t!==null);je=6,le=null}function iS(t,e,n,i,r,a,o,s,l){t.cancelPendingCommit=null;do kd();while(it!==0);if((me&6)!==0)throw Error(O(327));if(e!==null){if(e===t.current)throw Error(O(177));if(a=e.lanes|e.childLanes,a|=em,VR(t,n,a,o,s,l),t===Ce&&(le=Ce=null,fe=0),$o=e,xr=t,Ti=n,kg=a,Rg=r,H1=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,pO(Vu,function(){return Y1(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=Q.T,Q.T=null,r=ve.p,ve.p=2,o=me,me|=4;try{nO(t,e,n)}finally{me=o,ve.p=r,Q.T=i}}it=1,q1(),P1(),G1()}}function q1(){if(it===1){it=0;var t=xr,e=$o,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=Q.T,Q.T=null;var i=ve.p;ve.p=2;var r=me;me|=4;try{T1(e,t);var a=Lg,o=lx(t.containerInfo),s=a.focusedElem,l=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&sx(s.ownerDocument.documentElement,s)){if(l!==null&&Jg(s)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(u,s.value.length);else{var f=s.ownerDocument||document,h=f&&f.defaultView||window;if(h.getSelection){var g=h.getSelection(),_=s.textContent.length,b=Math.min(l.start,_),w=l.end===void 0?b:Math.min(l.end,_);!g.extend&&b>w&&(o=w,w=b,b=o);var d=C0(s,b),p=C0(s,w);if(d&&p&&(g.rangeCount!==1||g.anchorNode!==d.node||g.anchorOffset!==d.offset||g.focusNode!==p.node||g.focusOffset!==p.offset)){var m=f.createRange();m.setStart(d.node,d.offset),g.removeAllRanges(),b>w?(g.addRange(m),g.extend(p.node,p.offset)):(m.setEnd(p.node,p.offset),g.addRange(m))}}}}for(f=[],g=s;g=g.parentNode;)g.nodeType===1&&f.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<f.length;s++){var v=f[s];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}fd=!!Dg,Lg=Dg=null}finally{me=r,ve.p=i,Q.T=n}}t.current=e,it=2}}function P1(){if(it===2){it=0;var t=xr,e=$o,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=Q.T,Q.T=null;var i=ve.p;ve.p=2;var r=me;me|=4;try{x1(t,e.alternate,e)}finally{me=r,ve.p=i,Q.T=n}}it=3}}function G1(){if(it===4||it===3){it=0,DR();var t=xr,e=$o,n=Ti,i=H1;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?it=5:(it=0,$o=xr=null,Z1(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Sr=null),Gg(n),e=e.stateNode,tn&&typeof tn.onCommitFiberRoot=="function")try{tn.onCommitFiberRoot(Dl,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Q.T,r=ve.p,ve.p=2,Q.T=null;try{for(var a=t.onRecoverableError,o=0;o<i.length;o++){var s=i[o];a(s.value,{componentStack:s.stack})}}finally{Q.T=e,ve.p=r}}(Ti&3)!==0&&kd(),ni(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===Og?ml++:(ml=0,Og=t):ml=0,Ul(0,!1)}}function Z1(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Bl(e)))}function kd(){return q1(),P1(),G1(),Y1()}function Y1(){if(it!==5)return!1;var t=xr,e=kg;kg=0;var n=Gg(Ti),i=Q.T,r=ve.p;try{ve.p=32>n?32:n,Q.T=null,n=Rg,Rg=null;var a=xr,o=Ti;if(it=0,$o=xr=null,Ti=0,(me&6)!==0)throw Error(O(331));var s=me;if(me|=4,N1(a.current),R1(a,a.current,o,n),me=s,Ul(0,!1),tn&&typeof tn.onPostCommitFiberRoot=="function")try{tn.onPostCommitFiberRoot(Dl,a)}catch{}return!0}finally{ve.p=r,Q.T=i,Z1(t,e)}}function rS(t,e,n){e=_n(n,e),e=wg(t.stateNode,e,2),t=_r(t,e,2),t!==null&&(Hl(t,2),ni(t))}function _e(t,e,n){if(t.tag===3)rS(t,t,n);else for(;e!==null;){if(e.tag===3){rS(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Sr===null||!Sr.has(i))){t=_n(n,t),n=c1(2),i=_r(e,n,2),i!==null&&(u1(n,i,e,t),Hl(i,2),ni(i));break}}e=e.return}}function Uh(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new aO;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(Tm=!0,r.add(n),t=uO.bind(null,t,e,n),e.then(t,t))}function uO(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ce===t&&(fe&n)===n&&(je===4||je===3&&(fe&62914560)===fe&&300>en()-Cd?(me&2)===0&&Fo(t,0):km|=n,Bo===fe&&(Bo=0)),ni(t)}function W1(t,e){e===0&&(e=FS()),t=Sa(t,e),t!==null&&(Hl(t,e),ni(t))}function dO(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),W1(t,n)}function fO(t,e){var n=0;switch(t.tag){case 31:case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(O(314))}i!==null&&i.delete(e),W1(t,n)}function pO(t,e){return qg(t,e)}var ad=null,fo=null,Mg=!1,od=!1,Vh=!1,mr=0;function ni(t){t!==fo&&t.next===null&&(fo===null?ad=fo=t:fo=fo.next=t),od=!0,Mg||(Mg=!0,gO())}function Ul(t,e){if(!Vh&&od){Vh=!0;do for(var n=!1,i=ad;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var a=0;else{var o=i.suspendedLanes,s=i.pingedLanes;a=(1<<31-nn(42|t)+1)-1,a&=r&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,aS(i,a))}else a=fe,a=hd(i,i===Ce?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(a&3)===0||Ll(i,a)||(n=!0,aS(i,a));i=i.next}while(n);Vh=!1}}function hO(){K1()}function K1(){od=Mg=!1;var t=0;mr!==0&&wO()&&(t=mr);for(var e=en(),n=null,i=ad;i!==null;){var r=i.next,a=X1(i,e);a===0?(i.next=null,n===null?ad=r:n.next=r,r===null&&(fo=n)):(n=i,(t!==0||(a&3)!==0)&&(od=!0)),i=r}it!==0&&it!==5||Ul(t,!1),mr!==0&&(mr=0)}function X1(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,a=t.pendingLanes&-62914561;0<a;){var o=31-nn(a),s=1<<o,l=r[o];l===-1?((s&n)===0||(s&i)!==0)&&(r[o]=UR(s,e)):l<=e&&(t.expiredLanes|=s),a&=~s}if(e=Ce,n=fe,n=hd(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(be===2||be===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&vh(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Ll(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&vh(i),Gg(n)){case 2:case 8:n=BS;break;case 32:n=Vu;break;case 268435456:n=$S;break;default:n=Vu}return i=Q1.bind(null,t),n=qg(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&vh(i),t.callbackPriority=2,t.callbackNode=null,2}function Q1(t,e){if(it!==0&&it!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(kd()&&t.callbackNode!==n)return null;var i=fe;return i=hd(t,t===Ce?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(z1(t,i,e),X1(t,en()),t.callbackNode!=null&&t.callbackNode===n?Q1.bind(null,t):null)}function aS(t,e){if(kd())return null;z1(t,e,!0)}function gO(){CO(function(){(me&6)!==0?qg(zS,hO):K1()})}function Om(){if(mr===0){var t=Ho;t===0&&(t=su,su<<=1,(su&261888)===0&&(su=256)),mr=t}return mr}function oS(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Cu(""+t)}function sS(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function mO(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var a=oS((r[Ft]||null).action),o=i.submitter;o&&(e=(e=o[Ft]||null)?oS(e.formAction):o.getAttribute("formAction"),e!==null&&(a=e,o=null));var s=new gd("action","action",null,i,r);t.push({event:s,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(mr!==0){var l=o?sS(r,o):new FormData(r);Sg(n,{pending:!0,data:l,method:r.method,action:a},null,l)}}else typeof a=="function"&&(s.preventDefault(),l=o?sS(r,o):new FormData(r),Sg(n,{pending:!0,data:l,method:r.method,action:a},a,l))},currentTarget:r}]})}}for(bu=0;bu<cg.length;bu++)_u=cg[bu],lS=_u.toLowerCase(),cS=_u[0].toUpperCase()+_u.slice(1),zn(lS,"on"+cS);var _u,lS,cS,bu;zn(ux,"onAnimationEnd");zn(dx,"onAnimationIteration");zn(fx,"onAnimationStart");zn("dblclick","onDoubleClick");zn("focusin","onFocus");zn("focusout","onBlur");zn(L2,"onTransitionRun");zn(H2,"onTransitionStart");zn(I2,"onTransitionCancel");zn(px,"onTransitionEnd");Do("onMouseEnter",["mouseout","mouseover"]);Do("onMouseLeave",["mouseout","mouseover"]);Do("onPointerEnter",["pointerout","pointerover"]);Do("onPointerLeave",["pointerout","pointerover"]);ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ya("onBeforeInput",["compositionend","keypress","textInput","paste"]);ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tl="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(" "),vO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Tl));function J1(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var a=void 0;if(e)for(var o=i.length-1;0<=o;o--){var s=i[o],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==a&&r.isPropagationStopped())break e;a=s,r.currentTarget=c;try{a(r)}catch(u){qu(u)}r.currentTarget=null,a=l}else for(o=0;o<i.length;o++){if(s=i[o],l=s.instance,c=s.currentTarget,s=s.listener,l!==a&&r.isPropagationStopped())break e;a=s,r.currentTarget=c;try{a(r)}catch(u){qu(u)}r.currentTarget=null,a=l}}}}function se(t,e){var n=e[tg];n===void 0&&(n=e[tg]=new Set);var i=t+"__bubble";n.has(i)||(ew(e,t,2,!1),n.add(i))}function jh(t,e,n){var i=0;e&&(i|=4),ew(n,t,i,e)}var Su="_reactListening"+Math.random().toString(36).slice(2);function Mm(t){if(!t[Su]){t[Su]=!0,PS.forEach(function(n){n!=="selectionchange"&&(vO.has(n)||jh(n,!1,t),jh(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Su]||(e[Su]=!0,jh("selectionchange",!1,e))}}function ew(t,e,n,i){switch(pw(e)){case 2:var r=PO;break;case 8:r=GO;break;default:r=Hm}n=r.bind(null,e,n,t),r=void 0,!og||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function qh(t,e,n,i,r){var a=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var s=i.stateNode.containerInfo;if(s===r)break;if(o===4)for(o=i.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;s!==null;){if(o=go(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){i=a=o;continue e}s=s.parentNode}}i=i.return}JS(function(){var c=a,u=Wg(n),f=[];e:{var h=hx.get(t);if(h!==void 0){var g=gd,_=t;switch(t){case"keypress":if(Tu(n)===0)break e;case"keydown":case"keyup":g=f2;break;case"focusin":_="focus",g=xh;break;case"focusout":_="blur",g=xh;break;case"beforeblur":case"afterblur":g=xh;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":g=m0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=e2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=g2;break;case ux:case dx:case fx:g=i2;break;case px:g=v2;break;case"scroll":case"scrollend":g=QR;break;case"wheel":g=b2;break;case"copy":case"cut":case"paste":g=a2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=y0;break;case"toggle":case"beforetoggle":g=S2}var b=(e&4)!==0,w=!b&&(t==="scroll"||t==="scrollend"),d=b?h!==null?h+"Capture":null:h;b=[];for(var p=c,m;p!==null;){var v=p;if(m=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||m===null||d===null||(v=bl(p,d),v!=null&&b.push(kl(p,v,m))),w)break;p=p.return}0<b.length&&(h=new g(h,_,null,n,u),f.push({event:h,listeners:b}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",g=t==="mouseout"||t==="pointerout",h&&n!==ag&&(_=n.relatedTarget||n.fromElement)&&(go(_)||_[jo]))break e;if((g||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,g?(_=n.relatedTarget||n.toElement,g=c,_=_?go(_):null,_!==null&&(w=Nl(_),b=_.tag,_!==w||b!==5&&b!==27&&b!==6)&&(_=null)):(g=null,_=c),g!==_)){if(b=m0,v="onMouseLeave",d="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(b=y0,v="onPointerLeave",d="onPointerEnter",p="pointer"),w=g==null?h:nl(g),m=_==null?h:nl(_),h=new b(v,p+"leave",g,n,u),h.target=w,h.relatedTarget=m,v=null,go(u)===c&&(b=new b(d,p+"enter",_,n,u),b.target=m,b.relatedTarget=w,v=b),w=v,g&&_)t:{for(b=yO,d=g,p=_,m=0,v=d;v;v=b(v))m++;v=0;for(var S=p;S;S=b(S))v++;for(;0<m-v;)d=b(d),m--;for(;0<v-m;)p=b(p),v--;for(;m--;){if(d===p||p!==null&&d===p.alternate){b=d;break t}d=b(d),p=b(p)}b=null}else b=null;g!==null&&uS(f,h,g,b,!1),_!==null&&w!==null&&uS(f,w,_,b,!0)}}e:{if(h=c?nl(c):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var T=x0;else if(S0(h))if(ax)T=M2;else{T=R2;var A=k2}else g=h.nodeName,!g||g.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&Yg(c.elementType)&&(T=x0):T=O2;if(T&&(T=T(t,c))){rx(f,T,n,u);break e}A&&A(t,h,c),t==="focusout"&&c&&h.type==="number"&&c.memoizedProps.value!=null&&rg(h,"number",h.value)}switch(A=c?nl(c):window,t){case"focusin":(S0(A)||A.contentEditable==="true")&&(yo=A,sg=c,sl=null);break;case"focusout":sl=sg=yo=null;break;case"mousedown":lg=!0;break;case"contextmenu":case"mouseup":case"dragend":lg=!1,A0(f,n,u);break;case"selectionchange":if(D2)break;case"keydown":case"keyup":A0(f,n,u)}var k;if(Qg)e:{switch(t){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else vo?nx(t,n)&&(C="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(tx&&n.locale!=="ko"&&(vo||C!=="onCompositionStart"?C==="onCompositionEnd"&&vo&&(k=ex()):(pr=u,Kg="value"in pr?pr.value:pr.textContent,vo=!0)),A=sd(c,C),0<A.length&&(C=new v0(C,t,null,n,u),f.push({event:C,listeners:A}),k?C.data=k:(k=ix(n),k!==null&&(C.data=k)))),(k=w2?E2(t,n):C2(t,n))&&(C=sd(c,"onBeforeInput"),0<C.length&&(A=new v0("onBeforeInput","beforeinput",null,n,u),f.push({event:A,listeners:C}),A.data=k)),mO(f,t,c,n,u)}J1(f,e)})}function kl(t,e,n){return{instance:t,listener:e,currentTarget:n}}function sd(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,a=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||a===null||(r=bl(t,n),r!=null&&i.unshift(kl(t,r,a)),r=bl(t,e),r!=null&&i.push(kl(t,r,a))),t.tag===3)return i;t=t.return}return[]}function yO(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function uS(t,e,n,i,r){for(var a=e._reactName,o=[];n!==null&&n!==i;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,l!==null&&l===i)break;s!==5&&s!==26&&s!==27||c===null||(l=c,r?(c=bl(n,a),c!=null&&o.unshift(kl(n,c,l))):r||(c=bl(n,a),c!=null&&o.push(kl(n,c,l)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var bO=/\r\n?/g,_O=/\u0000|\uFFFD/g;function dS(t){return(typeof t=="string"?t:""+t).replace(bO,`
|
|
9
|
-
`).replace(_O,"")}function tw(t,e){return e=dS(e),dS(t)===e}function xe(t,e,n,i,r,a){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||Lo(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&Lo(t,""+i);break;case"className":uu(t,"class",i);break;case"tabIndex":uu(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":uu(t,n,i);break;case"style":QS(t,i,a);break;case"data":if(e!=="object"){uu(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Cu(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(e!=="input"&&xe(t,e,"name",r.name,r,null),xe(t,e,"formEncType",r.formEncType,r,null),xe(t,e,"formMethod",r.formMethod,r,null),xe(t,e,"formTarget",r.formTarget,r,null)):(xe(t,e,"encType",r.encType,r,null),xe(t,e,"method",r.method,r,null),xe(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Cu(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=wi);break;case"onScroll":i!=null&&se("scroll",t);break;case"onScrollEnd":i!=null&&se("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(O(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(O(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=Cu(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":se("beforetoggle",t),se("toggle",t),Eu(t,"popover",i);break;case"xlinkActuate":gi(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":gi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":gi(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":gi(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":gi(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":gi(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":gi(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":gi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":gi(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Eu(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=KR.get(n)||n,Eu(t,n,i))}}function Ng(t,e,n,i,r,a){switch(n){case"style":QS(t,i,a);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(O(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(O(60));t.innerHTML=n}}break;case"children":typeof i=="string"?Lo(t,i):(typeof i=="number"||typeof i=="bigint")&&Lo(t,""+i);break;case"onScroll":i!=null&&se("scroll",t);break;case"onScrollEnd":i!=null&&se("scrollend",t);break;case"onClick":i!=null&&(t.onclick=wi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!GS.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),a=t[Ft]||null,a=a!=null?a[n]:null,typeof a=="function"&&t.removeEventListener(e,a,r),typeof i=="function")){typeof a!="function"&&a!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):Eu(t,n,i)}}}function yt(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":se("error",t),se("load",t);var i=!1,r=!1,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(O(137,e));default:xe(t,e,a,o,n,null)}}r&&xe(t,e,"srcSet",n.srcSet,n,null),i&&xe(t,e,"src",n.src,n,null);return;case"input":se("invalid",t);var s=a=o=r=null,l=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":o=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":a=u;break;case"defaultValue":s=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(O(137,e));break;default:xe(t,e,i,u,n,null)}}WS(t,a,s,l,c,o,r,!1);return;case"select":se("invalid",t),i=o=a=null;for(r in n)if(n.hasOwnProperty(r)&&(s=n[r],s!=null))switch(r){case"value":a=s;break;case"defaultValue":o=s;break;case"multiple":i=s;default:xe(t,e,r,s,n,null)}e=a,n=o,t.multiple=!!i,e!=null?Ao(t,!!i,e,!1):n!=null&&Ao(t,!!i,n,!0);return;case"textarea":se("invalid",t),a=r=i=null;for(o in n)if(n.hasOwnProperty(o)&&(s=n[o],s!=null))switch(o){case"value":i=s;break;case"defaultValue":r=s;break;case"children":a=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(O(91));break;default:xe(t,e,o,s,n,null)}XS(t,i,r,a);return;case"option":for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null)&&(l==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":xe(t,e,l,i,n,null));return;case"dialog":se("beforetoggle",t),se("toggle",t),se("cancel",t),se("close",t);break;case"iframe":case"object":se("load",t);break;case"video":case"audio":for(i=0;i<Tl.length;i++)se(Tl[i],t);break;case"image":se("error",t),se("load",t);break;case"details":se("toggle",t);break;case"embed":case"source":case"link":se("error",t),se("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(O(137,e));default:xe(t,e,c,i,n,null)}return;default:if(Yg(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&Ng(t,e,u,i,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(i=n[s],i!=null&&xe(t,e,s,i,n,null))}function SO(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,a=null,o=null,s=null,l=null,c=null,u=null;for(g in n){var f=n[g];if(n.hasOwnProperty(g)&&f!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":l=f;default:i.hasOwnProperty(g)||xe(t,e,g,null,i,f)}}for(var h in i){var g=i[h];if(f=n[h],i.hasOwnProperty(h)&&(g!=null||f!=null))switch(h){case"type":a=g;break;case"name":r=g;break;case"checked":c=g;break;case"defaultChecked":u=g;break;case"value":o=g;break;case"defaultValue":s=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(O(137,e));break;default:g!==f&&xe(t,e,h,g,i,f)}}ig(t,o,s,l,c,u,a,r);return;case"select":g=o=s=h=null;for(a in n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case"value":break;case"multiple":g=l;default:i.hasOwnProperty(a)||xe(t,e,a,null,i,l)}for(r in i)if(a=i[r],l=n[r],i.hasOwnProperty(r)&&(a!=null||l!=null))switch(r){case"value":h=a;break;case"defaultValue":s=a;break;case"multiple":o=a;default:a!==l&&xe(t,e,r,a,i,l)}e=s,n=o,i=g,h!=null?Ao(t,!!n,h,!1):!!i!=!!n&&(e!=null?Ao(t,!!n,e,!0):Ao(t,!!n,n?[]:"",!1));return;case"textarea":g=h=null;for(s in n)if(r=n[s],n.hasOwnProperty(s)&&r!=null&&!i.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:xe(t,e,s,null,i,r)}for(o in i)if(r=i[o],a=n[o],i.hasOwnProperty(o)&&(r!=null||a!=null))switch(o){case"value":h=r;break;case"defaultValue":g=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(O(91));break;default:r!==a&&xe(t,e,o,r,i,a)}KS(t,h,g);return;case"option":for(var _ in n)h=n[_],n.hasOwnProperty(_)&&h!=null&&!i.hasOwnProperty(_)&&(_==="selected"?t.selected=!1:xe(t,e,_,null,i,h));for(l in i)h=i[l],g=n[l],i.hasOwnProperty(l)&&h!==g&&(h!=null||g!=null)&&(l==="selected"?t.selected=h&&typeof h!="function"&&typeof h!="symbol":xe(t,e,l,h,i,g));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 b in n)h=n[b],n.hasOwnProperty(b)&&h!=null&&!i.hasOwnProperty(b)&&xe(t,e,b,null,i,h);for(c in i)if(h=i[c],g=n[c],i.hasOwnProperty(c)&&h!==g&&(h!=null||g!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(O(137,e));break;default:xe(t,e,c,h,i,g)}return;default:if(Yg(e)){for(var w in n)h=n[w],n.hasOwnProperty(w)&&h!==void 0&&!i.hasOwnProperty(w)&&Ng(t,e,w,void 0,i,h);for(u in i)h=i[u],g=n[u],!i.hasOwnProperty(u)||h===g||h===void 0&&g===void 0||Ng(t,e,u,h,i,g);return}}for(var d in n)h=n[d],n.hasOwnProperty(d)&&h!=null&&!i.hasOwnProperty(d)&&xe(t,e,d,null,i,h);for(f in i)h=i[f],g=n[f],!i.hasOwnProperty(f)||h===g||h==null&&g==null||xe(t,e,f,h,i,g)}function fS(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function xO(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],a=r.transferSize,o=r.initiatorType,s=r.duration;if(a&&s&&fS(o)){for(o=0,s=r.responseEnd,i+=1;i<n.length;i++){var l=n[i],c=l.startTime;if(c>s)break;var u=l.transferSize,f=l.initiatorType;u&&fS(f)&&(l=l.responseEnd,o+=u*(l<s?1:(s-c)/(l-c)))}if(--i,e+=8*(a+o)/(r.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Dg=null,Lg=null;function ld(t){return t.nodeType===9?t:t.ownerDocument}function pS(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nw(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Hg(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Ph=null;function wO(){var t=window.event;return t&&t.type==="popstate"?t===Ph?!1:(Ph=t,!0):(Ph=null,!1)}var iw=typeof setTimeout=="function"?setTimeout:void 0,EO=typeof clearTimeout=="function"?clearTimeout:void 0,hS=typeof Promise=="function"?Promise:void 0,CO=typeof queueMicrotask=="function"?queueMicrotask:typeof hS<"u"?function(t){return hS.resolve(null).then(t).catch(AO)}:iw;function AO(t){setTimeout(function(){throw t})}function Mr(t){return t==="head"}function gS(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(i===0){t.removeChild(r),Vo(e);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")vl(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,vl(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Il]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=o}}else n==="body"&&vl(t.ownerDocument.body);n=r}while(n);Vo(e)}function mS(t,e){var n=t;t=0;do{var i=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(t===0)break;t--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=i}while(n)}function Ig(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Ig(n),Zg(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function TO(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Il])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(a=t.getAttribute("rel"),a==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(a!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(a=t.getAttribute("src"),(a!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&a&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var a=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===a)return t}else return t;if(t=wn(t.nextSibling),t===null)break}return null}function kO(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=wn(t.nextSibling),t===null))return null;return t}function rw(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=wn(t.nextSibling),t===null))return null;return t}function zg(t){return t.data==="$?"||t.data==="$~"}function Bg(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function RO(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function wn(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var $g=null;function vS(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return wn(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function yS(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--}else n!=="/$"&&n!=="/&"||e++}t=t.previousSibling}return null}function aw(t,e,n){switch(e=ld(n),t){case"html":if(t=e.documentElement,!t)throw Error(O(452));return t;case"head":if(t=e.head,!t)throw Error(O(453));return t;case"body":if(t=e.body,!t)throw Error(O(454));return t;default:throw Error(O(451))}}function vl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Zg(t)}var En=new Map,bS=new Set;function cd(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Di=ve.d;ve.d={f:OO,r:MO,D:NO,C:DO,L:LO,m:HO,X:zO,S:IO,M:BO};function OO(){var t=Di.f(),e=Ad();return t||e}function MO(t){var e=qo(t);e!==null&&e.tag===5&&e.type==="form"?Qx(e):Di.r(t)}var Yo=typeof document>"u"?null:document;function ow(t,e,n){var i=Yo;if(i&&typeof e=="string"&&e){var r=bn(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),bS.has(r)||(bS.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),yt(e,"link",t),ct(e),i.head.appendChild(e)))}}function NO(t){Di.D(t),ow("dns-prefetch",t,null)}function DO(t,e){Di.C(t,e),ow("preconnect",t,e)}function LO(t,e,n){Di.L(t,e,n);var i=Yo;if(i&&t&&e){var r='link[rel="preload"][as="'+bn(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+bn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+bn(n.imageSizes)+'"]')):r+='[href="'+bn(t)+'"]';var a=r;switch(e){case"style":a=Uo(t);break;case"script":a=Wo(t)}En.has(a)||(t=Le({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),En.set(a,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(Vl(a))||e==="script"&&i.querySelector(jl(a))||(e=i.createElement("link"),yt(e,"link",t),ct(e),i.head.appendChild(e)))}}function HO(t,e){Di.m(t,e);var n=Yo;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+bn(i)+'"][href="'+bn(t)+'"]',a=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Wo(t)}if(!En.has(a)&&(t=Le({rel:"modulepreload",href:t},e),En.set(a,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(jl(a)))return}i=n.createElement("link"),yt(i,"link",t),ct(i),n.head.appendChild(i)}}}function IO(t,e,n){Di.S(t,e,n);var i=Yo;if(i&&t){var r=Co(i).hoistableStyles,a=Uo(t);e=e||"default";var o=r.get(a);if(!o){var s={loading:0,preload:null};if(o=i.querySelector(Vl(a)))s.loading=5;else{t=Le({rel:"stylesheet",href:t,"data-precedence":e},n),(n=En.get(a))&&Nm(t,n);var l=o=i.createElement("link");ct(l),yt(l,"link",t),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Hu(o,e,i)}o={type:"stylesheet",instance:o,count:1,state:s},r.set(a,o)}}}function zO(t,e){Di.X(t,e);var n=Yo;if(n&&t){var i=Co(n).hoistableScripts,r=Wo(t),a=i.get(r);a||(a=n.querySelector(jl(r)),a||(t=Le({src:t,async:!0},e),(e=En.get(r))&&Dm(t,e),a=n.createElement("script"),ct(a),yt(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function BO(t,e){Di.M(t,e);var n=Yo;if(n&&t){var i=Co(n).hoistableScripts,r=Wo(t),a=i.get(r);a||(a=n.querySelector(jl(r)),a||(t=Le({src:t,async:!0,type:"module"},e),(e=En.get(r))&&Dm(t,e),a=n.createElement("script"),ct(a),yt(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function _S(t,e,n,i){var r=(r=vr.current)?cd(r):null;if(!r)throw Error(O(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Uo(n.href),n=Co(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Uo(n.href);var a=Co(r).hoistableStyles,o=a.get(t);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(t,o),(a=r.querySelector(Vl(t)))&&!a._p&&(o.instance=a,o.state.loading=5),En.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},En.set(t,n),a||$O(r,t,n,o.state))),e&&i===null)throw Error(O(528,""));return o}if(e&&i!==null)throw Error(O(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Wo(n),n=Co(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(O(444,t))}}function Uo(t){return'href="'+bn(t)+'"'}function Vl(t){return'link[rel="stylesheet"]['+t+"]"}function sw(t){return Le({},t,{"data-precedence":t.precedence,precedence:null})}function $O(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),yt(e,"link",n),ct(e),t.head.appendChild(e))}function Wo(t){return'[src="'+bn(t)+'"]'}function jl(t){return"script[async]"+t}function SS(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+bn(n.href)+'"]');if(i)return e.instance=i,ct(i),i;var r=Le({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),ct(i),yt(i,"style",r),Hu(i,n.precedence,t),e.instance=i;case"stylesheet":r=Uo(n.href);var a=t.querySelector(Vl(r));if(a)return e.state.loading|=4,e.instance=a,ct(a),a;i=sw(n),(r=En.get(r))&&Nm(i,r),a=(t.ownerDocument||t).createElement("link"),ct(a);var o=a;return o._p=new Promise(function(s,l){o.onload=s,o.onerror=l}),yt(a,"link",i),e.state.loading|=4,Hu(a,n.precedence,t),e.instance=a;case"script":return a=Wo(n.src),(r=t.querySelector(jl(a)))?(e.instance=r,ct(r),r):(i=n,(r=En.get(a))&&(i=Le({},n),Dm(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),ct(r),yt(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(O(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,Hu(i,n.precedence,t));return e.instance}function Hu(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,a=r,o=0;o<i.length;o++){var s=i[o];if(s.dataset.precedence===e)a=s;else if(a!==r)break}a?a.parentNode.insertBefore(t,a.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function Nm(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Dm(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Iu=null;function xS(t,e,n){if(Iu===null){var i=new Map,r=Iu=new Map;r.set(n,i)}else r=Iu,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var a=n[r];if(!(a[Il]||a[gt]||t==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var o=a.getAttribute(e)||"";o=t+o;var s=i.get(o);s?s.push(a):i.set(o,[a])}}return i}function wS(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function FO(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function lw(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function UO(t,e,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=Uo(i.href),a=e.querySelector(Vl(r));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=ud.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=a,ct(a);return}a=e.ownerDocument||e,i=sw(i),(r=En.get(r))&&Nm(i,r),a=a.createElement("link"),ct(a);var o=a;o._p=new Promise(function(s,l){o.onload=s,o.onerror=l}),yt(a,"link",i),n.instance=a}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=ud.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var Gh=0;function VO(t,e){return t.stylesheets&&t.count===0&&zu(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var i=setTimeout(function(){if(t.stylesheets&&zu(t,t.stylesheets),t.unsuspend){var a=t.unsuspend;t.unsuspend=null,a()}},6e4+e);0<t.imgBytes&&Gh===0&&(Gh=62500*xO());var r=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&zu(t,t.stylesheets),t.unsuspend)){var a=t.unsuspend;t.unsuspend=null,a()}},(t.imgBytes>Gh?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function ud(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var dd=null;function zu(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,dd=new Map,e.forEach(jO,t),dd=null,ud.call(t))}function jO(t,e){if(!(e.state.loading&4)){var n=dd.get(t);if(n)var i=n.get(null);else{n=new Map,dd.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var o=r[a];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),i=o)}i&&n.set(null,i)}r=e.instance,o=r.getAttribute("data-precedence"),a=n.get(o)||i,a===i&&n.set(null,r),n.set(o,r),this.count++,i=ud.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),a?a.parentNode.insertBefore(r,a.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var Rl={$$typeof:xi,Provider:null,Consumer:null,_currentValue:la,_currentValue2:la,_threadCount:0};function qO(t,e,n,i,r,a,o,s,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=yh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yh(0),this.hiddenUpdates=yh(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function cw(t,e,n,i,r,a,o,s,l,c,u,f){return t=new qO(t,e,n,o,l,c,u,f,s),e=1,a===!0&&(e|=24),a=Qt(3,null,null,e),t.current=a,a.stateNode=t,e=am(),e.refCount++,t.pooledCache=e,e.refCount++,a.memoizedState={element:i,isDehydrated:n,cache:e},lm(a),t}function uw(t){return t?(t=So,t):So}function dw(t,e,n,i,r,a){r=uw(r),i.context===null?i.context=r:i.pendingContext=r,i=br(e),i.payload={element:n},a=a===void 0?null:a,a!==null&&(i.callback=a),n=_r(t,i,e),n!==null&&($t(n,t,e),cl(n,t,e))}function ES(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Lm(t,e){ES(t,e),(t=t.alternate)&&ES(t,e)}function fw(t){if(t.tag===13||t.tag===31){var e=Sa(t,67108864);e!==null&&$t(e,t,67108864),Lm(t,67108864)}}function CS(t){if(t.tag===13||t.tag===31){var e=rn();e=Pg(e);var n=Sa(t,e);n!==null&&$t(n,t,e),Lm(t,e)}}var fd=!0;function PO(t,e,n,i){var r=Q.T;Q.T=null;var a=ve.p;try{ve.p=2,Hm(t,e,n,i)}finally{ve.p=a,Q.T=r}}function GO(t,e,n,i){var r=Q.T;Q.T=null;var a=ve.p;try{ve.p=8,Hm(t,e,n,i)}finally{ve.p=a,Q.T=r}}function Hm(t,e,n,i){if(fd){var r=Fg(i);if(r===null)qh(t,e,i,pd,n),AS(t,i);else if(YO(r,t,e,n,i))i.stopPropagation();else if(AS(t,i),e&4&&-1<ZO.indexOf(t)){for(;r!==null;){var a=qo(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=aa(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var l=1<<31-nn(o);s.entanglements[1]|=l,o&=~l}ni(a),(me&6)===0&&(nd=en()+500,Ul(0,!1))}}break;case 31:case 13:s=Sa(a,2),s!==null&&$t(s,a,2),Ad(),Lm(a,2)}if(a=Fg(i),a===null&&qh(t,e,i,pd,n),a===r)break;r=a}r!==null&&i.stopPropagation()}else qh(t,e,i,null,n)}}function Fg(t){return t=Wg(t),Im(t)}var pd=null;function Im(t){if(pd=null,t=go(t),t!==null){var e=Nl(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=NS(e),t!==null)return t;t=null}else if(n===31){if(t=DS(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return pd=t,null}function pw(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(LR()){case zS:return 2;case BS:return 8;case Vu:case HR:return 32;case $S:return 268435456;default:return 32}default:return 32}}var Ug=!1,wr=null,Er=null,Cr=null,Ol=new Map,Ml=new Map,dr=[],ZO="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 AS(t,e){switch(t){case"focusin":case"focusout":wr=null;break;case"dragenter":case"dragleave":Er=null;break;case"mouseover":case"mouseout":Cr=null;break;case"pointerover":case"pointerout":Ol.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ml.delete(e.pointerId)}}function Qs(t,e,n,i,r,a){return t===null||t.nativeEvent!==a?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:a,targetContainers:[r]},e!==null&&(e=qo(e),e!==null&&fw(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function YO(t,e,n,i,r){switch(e){case"focusin":return wr=Qs(wr,t,e,n,i,r),!0;case"dragenter":return Er=Qs(Er,t,e,n,i,r),!0;case"mouseover":return Cr=Qs(Cr,t,e,n,i,r),!0;case"pointerover":var a=r.pointerId;return Ol.set(a,Qs(Ol.get(a)||null,t,e,n,i,r)),!0;case"gotpointercapture":return a=r.pointerId,Ml.set(a,Qs(Ml.get(a)||null,t,e,n,i,r)),!0}return!1}function hw(t){var e=go(t.target);if(e!==null){var n=Nl(e);if(n!==null){if(e=n.tag,e===13){if(e=NS(n),e!==null){t.blockedOn=e,c0(t.priority,function(){CS(n)});return}}else if(e===31){if(e=DS(n),e!==null){t.blockedOn=e,c0(t.priority,function(){CS(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Bu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Fg(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);ag=i,n.target.dispatchEvent(i),ag=null}else return e=qo(n),e!==null&&fw(e),t.blockedOn=n,!1;e.shift()}return!0}function TS(t,e,n){Bu(t)&&n.delete(e)}function WO(){Ug=!1,wr!==null&&Bu(wr)&&(wr=null),Er!==null&&Bu(Er)&&(Er=null),Cr!==null&&Bu(Cr)&&(Cr=null),Ol.forEach(TS),Ml.forEach(TS)}function xu(t,e){t.blockedOn===e&&(t.blockedOn=null,Ug||(Ug=!0,rt.unstable_scheduleCallback(rt.unstable_NormalPriority,WO)))}var wu=null;function kS(t){wu!==t&&(wu=t,rt.unstable_scheduleCallback(rt.unstable_NormalPriority,function(){wu===t&&(wu=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(Im(i||n)===null)continue;break}var a=qo(n);a!==null&&(t.splice(e,3),e-=3,Sg(a,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Vo(t){function e(l){return xu(l,t)}wr!==null&&xu(wr,t),Er!==null&&xu(Er,t),Cr!==null&&xu(Cr,t),Ol.forEach(e),Ml.forEach(e);for(var n=0;n<dr.length;n++){var i=dr[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<dr.length&&(n=dr[0],n.blockedOn===null);)hw(n),n.blockedOn===null&&dr.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],a=n[i+1],o=r[Ft]||null;if(typeof a=="function")o||kS(n);else if(o){var s=null;if(a&&a.hasAttribute("formAction")){if(r=a,o=a[Ft]||null)s=o.formAction;else if(Im(r)!==null)continue}else s=o.action;typeof s=="function"?n[i+1]=s:(n.splice(i,3),i-=3),kS(n)}}}function gw(){function t(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(o){return r=o})},focusReset:"manual",scroll:"manual"})}function e(){r!==null&&(r(),r=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,r=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null)}}}function zm(t){this._internalRoot=t}Rd.prototype.render=zm.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(O(409));var n=e.current,i=rn();dw(n,i,t,e,null,null)};Rd.prototype.unmount=zm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;dw(t.current,2,null,t,null,null),Ad(),e[jo]=null}};function Rd(t){this._internalRoot=t}Rd.prototype.unstable_scheduleHydration=function(t){if(t){var e=qS();t={blockedOn:null,target:t,priority:e};for(var n=0;n<dr.length&&e!==0&&e<dr[n].priority;n++);dr.splice(n,0,t),n===0&&hw(t)}};var RS=OS.version;if(RS!=="19.2.4")throw Error(O(527,RS,"19.2.4"));ve.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(O(188)):(t=Object.keys(t).join(","),Error(O(268,t)));return t=TR(e),t=t!==null?LS(t):null,t=t===null?null:t.stateNode,t};var KO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Js=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Js.isDisabled&&Js.supportsFiber))try{Dl=Js.inject(KO),tn=Js}catch{}var Js;Od.createRoot=function(t,e){if(!MS(t))throw Error(O(299));var n=!1,i="",r=o1,a=s1,o=l1;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(a=e.onCaughtError),e.onRecoverableError!==void 0&&(o=e.onRecoverableError)),e=cw(t,1,!1,null,null,n,i,null,r,a,o,gw),t[jo]=e.current,Mm(t),new zm(e)};Od.hydrateRoot=function(t,e,n){if(!MS(t))throw Error(O(299));var i=!1,r="",a=o1,o=s1,s=l1,l=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),e=cw(t,1,!0,e,n??null,i,r,l,a,o,s,gw),e.context=uw(null),n=e.current,i=rn(),i=Pg(i),r=br(i),r.callback=null,_r(n,r,i),n=i,e.current.lanes=n,Hl(e,n),ni(e),t[jo]=e.current,Mm(t),new Rd(e)};Od.version="19.2.4"});var Ko=Yn((q5,yw)=>{"use strict";function vw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vw)}catch(t){console.error(t)}}vw(),yw.exports=mw()});var pE=Yn(Xd=>{"use strict";var LM=Symbol.for("react.transitional.element"),HM=Symbol.for("react.fragment");function fE(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:LM,type:t,key:i,ref:e!==void 0?e:null,props:n}}Xd.Fragment=HM;Xd.jsx=fE;Xd.jsxs=fE});var qe=Yn((fI,hE)=>{"use strict";hE.exports=pE()});var H5={};k_(H5,{ANIMATION_KEYFRAMES:()=>Fs,ActivationConfigZ:()=>Pc,AddClassZ:()=>Ub,AnchorStateZ:()=>Ek,AnchorVisibleConditionZ:()=>lk,AppRegistry:()=>Ql,AugmentationZ:()=>Ck,BadgePositionZ:()=>Ob,BadgeZ:()=>Zb,BoundingBoxZ:()=>wk,CanvasEvents:()=>os,CanvasRecipeZ:()=>jf,ConditionZ:()=>Mp,ContextManager:()=>Gc,CooldownActiveConditionZ:()=>hk,CtaButtonZ:()=>Dp,DEFAULT_COOLDOWN:()=>uf,DEFAULT_TTL:()=>cf,DecisionStrategyZ:()=>Tb,DismissedConditionZ:()=>pk,EVENT_SCHEMA_VERSION:()=>Na,EventBus:()=>Wc,EventCountConditionZ:()=>mk,EventFilterZ:()=>Ok,EventOccurredConditionZ:()=>ck,EventSourceZ:()=>d_,ExecutorRegistry:()=>qc,ExternalStrategyZ:()=>Ab,FrequencyEntryZ:()=>Bk,FrequencyLimitConditionZ:()=>gk,HighlightStepZ:()=>JC,HighlightStyleZ:()=>Rb,HighlightZ:()=>Pb,InsertHtmlZ:()=>qb,InsertPositionZ:()=>Lb,MAX_VISIBLE_TOASTS:()=>lf,ModalContentZ:()=>Db,ModalZ:()=>Wb,ModelStrategyZ:()=>Cb,MountWidgetZ:()=>Qb,NavigateZ:()=>Xb,NavigationMonitor:()=>Bs,NormalizedEventZ:()=>Rk,NotificationToastStack:()=>sf,PageContextZ:()=>bk,PageHistoryEntryZ:()=>_k,PageUrlConditionZ:()=>ok,ParallelZ:()=>t_,PlacementZ:()=>Mb,PulseZ:()=>Gb,RUNTIME_SDK_BUILD:()=>x_,RUNTIME_VERSION:()=>v_,RemoveClassZ:()=>Vb,RouteConditionZ:()=>sk,RouteFilterZ:()=>kb,RuleStrategyZ:()=>wb,RuleZ:()=>xb,RuntimeContextZ:()=>Ak,RuntimeProvider:()=>gf,SDK_SCHEMA_VERSION:()=>Bi,SDK_VERSION:()=>nf,STATIC_SLOT_STYLES:()=>m_,ScoreStrategyZ:()=>Eb,ScrollBehaviorZ:()=>Bb,ScrollLogicalPositionZ:()=>Np,ScrollToZ:()=>Kb,SelectorZ:()=>Nv,SequenceZ:()=>e_,SessionContextZ:()=>Sk,SessionMetricConditionZ:()=>fk,SessionMetricTracker:()=>dc,SetAttrZ:()=>Fb,SetStyleZ:()=>jb,SetTextZ:()=>$b,ShadowCanvasOverlay:()=>ov,ShadowRootProvider:()=>tv,SmartCanvasApp:()=>lv,SmartCanvasController:()=>af,SmartCanvasElement:()=>vf,SmartCanvasPortal:()=>lL,StandardEvents:()=>ye,StateEqualsConditionZ:()=>uk,StateStore:()=>Xc,StoredValueZ:()=>zk,Syntro:()=>S_,TileCard:()=>ls,TileWheel:()=>qN,TooltipContentZ:()=>Nb,TooltipStepZ:()=>QC,TooltipTriggerZ:()=>Hb,TooltipZ:()=>Yb,TourStepForSchemaZ:()=>zb,TourZ:()=>n_,ViewportConditionZ:()=>dk,ViewportContextZ:()=>xk,WaitZ:()=>Jb,WidgetConfigZ:()=>Ib,WidgetRegistry:()=>Jc,appRegistry:()=>ts,applyStaticSlotStyles:()=>$p,cleanupAppContext:()=>Yd,contentRuntime:()=>Md,coreActionStepSchemas:()=>vk,createActionEngine:()=>Op,createAppContext:()=>Zd,createAppLoader:()=>Kd,createCanvasConfigFetcher:()=>Oa,createContextManager:()=>Lp,createDecisionEngine:()=>Hp,createEventAccumulator:()=>Ip,createEventBus:()=>zs,createGrowthBookClient:()=>If,createNoopClient:()=>Pf,createOverlayRecipeFetcher:()=>sL,createPostHogClient:()=>Ap,createPostHogNormalizer:()=>zp,createSessionMetricTracker:()=>zf,createSmartCanvas:()=>yf,createSmartCanvasController:()=>ev,createSmartCanvasRuntime:()=>Yp,createStateStore:()=>Bp,createSurfaceContainer:()=>qp,createSurfaces:()=>Gp,decisionSchemas:()=>l5,decodeToken:()=>eu,encodeToken:()=>Wp,evaluate:()=>o_,evaluateCondition:()=>r_,evaluateRule:()=>a_,evaluateRuleStrategy:()=>Zc,evaluateScoreStrategy:()=>Yc,evaluateSync:()=>s_,executorRegistry:()=>pi,getAntiFlickerSnippet:()=>NE,getAppIdFromActionKind:()=>Zm,getAppIdFromWidgetId:()=>Wd,getExecutor:()=>ik,getSlotAnchorId:()=>Qc,getSlotType:()=>$s,getSlotZIndex:()=>Pp,hasExecutor:()=>kp,interpolateTemplate:()=>nc,isCoreActionKind:()=>Gm,matchEvent:()=>df,needsMigration:()=>YN,normalizePostHogEvent:()=>c_,overlaysRuntime:()=>Gd,parseVersion:()=>cs,playEnterAnimation:()=>Vp,playExitAnimation:()=>jp,registerConfigPredicates:()=>as,registerSmartCanvasElement:()=>uv,resolveConfigUri:()=>rf,setupAdjacentPositioning:()=>Fp,setupInlinePositioning:()=>Up,shouldNormalizeEvent:()=>u_,useDecision:()=>WE,useNotifications:()=>ff,useNotifyWatcher:()=>hf,usePageContext:()=>mf,useRuntime:()=>ri,useRuntimeContext:()=>ic,useRuntimeEvents:()=>ZE,useRuntimeState:()=>YE,useSessionContext:()=>PE,useShadowCanvasConfig:()=>sv,useShadowRoot:()=>tc,useViewportContext:()=>GE,validateAction:()=>Ji,validateActions:()=>Rp,validateActivationConfig:()=>s5,validateCondition:()=>a5,validateConfig:()=>PN,validateEventFilter:()=>h5,validateFrequencyEntry:()=>_5,validateNormalizedEvent:()=>p5,validateRecipe:()=>oL,validateRuntimeContext:()=>u5,validateStoredValue:()=>b5,validateStrategy:()=>o5,widgetRegistry:()=>Zp});var Yk=ee(nt(),1),Kp=ee(js(),1),L5=ee(Ko(),1);function bw(t,e,n,i){let r=i?.maxRetries??3,a=i?.debounceMs??50,o=t.parentElement??e.parentElement;if(!o)return()=>{};let s=0,l=null,c=!1,u=new MutationObserver(f=>{if(!c){for(let h of f)for(let g of h.removedNodes)if(g===t){if(s>=r){u.disconnect(),c=!0;return}l&&clearTimeout(l),l=setTimeout(()=>{if(!c){s++;try{n()}catch{u.disconnect(),c=!0}}},a);return}}});return u.observe(o,{childList:!0,subtree:!0}),()=>{c=!0,u.disconnect(),l&&clearTimeout(l)}}var XO=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function Bm(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),a=[];for(;r.nextNode();){let o=r.currentNode,s=o.tagName.toLowerCase();if(!XO.has(s)){a.push(o);continue}for(let l of Array.from(o.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),f=c.startsWith("on"),g=(c==="href"||c==="src"||c==="formaction")&&(u.startsWith("javascript:")||u.startsWith("vbscript:")||u.startsWith("data:text/html"));(f||g)&&o.removeAttribute(l.name)}}for(let o of a){for(;o.firstChild;)o.parentNode?.insertBefore(o.firstChild,o);o.remove()}return n.innerHTML}var _w=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=Bm(t.html),r=document.createElement("div");r.setAttribute("data-syntro-action-id",e.generateId()),r.innerHTML=i;let a=null;switch(t.position){case"before":n.insertAdjacentElement("beforebegin",r);break;case"after":n.insertAdjacentElement("afterend",r);break;case"prepend":n.insertBefore(r,n.firstChild);break;case"append":n.appendChild(r);break;case"replace":a=n.innerHTML,n.replaceWith(r);break}e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position});let s=bw(r,n,()=>{switch(t.position){case"before":n.insertAdjacentElement("beforebegin",r);break;case"after":n.insertAdjacentElement("afterend",r);break;case"prepend":n.insertBefore(r,n.firstChild);break;case"append":n.appendChild(r);break;case"replace":break}});return{cleanup:()=>{if(s(),t.position==="replace"&&a!==null){let l=document.createElement(n.tagName);l.innerHTML=a,Array.from(n.attributes).forEach(c=>{l.setAttribute(c.name,c.value)}),r.replaceWith(l)}else r.remove()},updateFn:l=>{"html"in l&&typeof l.html=="string"&&(r.innerHTML=Bm(l.html))}}},Sw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=n.textContent??"";return n.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{n.textContent=i},updateFn:r=>{"text"in r&&typeof r.text=="string"&&(n.textContent=r.text)}}},xw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=t.attr.toLowerCase();if(i.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);if(i==="href"||i==="src"||i==="formaction"){let s=t.value.trim().toLowerCase();if(s.startsWith("javascript:")||s.startsWith("vbscript:")||s.startsWith("data:text/html"))throw new Error(`Dangerous URL not allowed in ${t.attr}: ${t.value}`)}let a=n.getAttribute(t.attr),o=n.hasAttribute(t.attr);return n.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{o&&a!==null?n.setAttribute(t.attr,a):n.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&n.setAttribute(t.attr,s.value)}}},ww=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=n.classList.contains(t.className);return n.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i||n.classList.remove(t.className)}}},Ew=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=n.classList.contains(t.className);return n.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i&&n.classList.add(t.className)}}},Cw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=new Map;for(let r of Object.keys(t.styles)){let a=n.style.getPropertyValue(r);i.set(r,a)}for(let[r,a]of Object.entries(t.styles))n.style.setProperty(r,a);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[r,a]of i)a?n.style.setProperty(r,a):n.style.removeProperty(r)},updateFn:r=>{if("styles"in r&&typeof r.styles=="object"&&r.styles)for(let[a,o]of Object.entries(r.styles))n.style.setProperty(a,o)}}},$m=[{kind:"content:insertHtml",executor:_w},{kind:"content:setText",executor:Sw},{kind:"content:setAttr",executor:xw},{kind:"content:addClass",executor:ww},{kind:"content:removeClass",executor:Ew},{kind:"content:setStyle",executor:Cw}],Md={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:$m};var Ze={white:"#ffffff",black:"#000000"},ne={0:"#2c0b0a",1:"#5b1715",2:"#89221f",3:"#b72e2a",4:"#d44844",5:"#dd6d69",6:"#e5918f",7:"#eeb6b4",8:"#f6dada",9:"#faebea"},E={0:"#07080a",1:"#0f1318",2:"#0e1114",3:"#1c222a",4:"#2b333f",5:"#394454",6:"#475569",7:"#677384",8:"#87919f",9:"#a8afba",10:"#cbd0d7",11:"#e8eaee",12:"#f6f7f9"},He={0:"#07230a",1:"#0e4514",2:"#16681e",3:"#1d8a28",4:"#24ad32",5:"#4fbd5a",6:"#7acd82",7:"#a5deab",8:"#d0eed3",9:"#e5f6e7"},Ot={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},Be={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},sn={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},ql={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},at={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},Pl={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var dt={primary:E[10],secondary:E[9],tertiary:E[8]},K5={primary:E[2],secondary:E[0]},wa={primary:E[4],secondary:E[3]},Gl={primary:{text:Ze.white,icon:Ze.white,border:ne[3],backgroundDefault:ne[3],backgroundHover:ne[2]},neutral:{text:E[10],textHover:Ze.white,icon:E[10],iconHover:Ze.white,border:E[4],background:E[2]},link:{text:Ze.white,icon:Ze.white,hover:ne[5]},error:{text:Be[5],hover:Be[6]},success:{text:He[5],hover:He[6]}},X5={slateGrey:{content:E[10],pillOutline:E[10],borderPrimary:E[5],borderSecondary:E[5],background:E[3]},brand:{content:ne[9],pillOutline:ne[9],borderPrimary:ne[6],borderSecondary:ne[6],background:ne[0]},red:{content:Be[8],pillOutline:Be[4],borderPrimary:Be[2],borderSecondary:Be[2],background:Be[0]},yellow:{content:Ot[8],pillOutline:Ot[4],borderPrimary:Ot[2],borderSecondary:Ot[2],background:Ot[0]},green:{content:He[8],pillOutline:He[4],borderPrimary:He[2],borderSecondary:He[2],background:He[0]},purple:{content:at[8],pillOutline:at[4],borderPrimary:at[2],borderSecondary:at[2],background:at[0]},blue:{content:sn[8],pillOutline:sn[4],borderPrimary:sn[2],borderSecondary:sn[2],background:sn[0]},orange:{content:ql[8],pillOutline:ql[4],borderPrimary:ql[2],borderSecondary:ql[2],background:ql[0]},pink:{content:Pl[8],pillOutline:Pl[4],borderPrimary:Pl[2],borderSecondary:Pl[2],background:Pl[0]}},Q5={green:{content:He[8],border:He[2],background:He[0]},yellow:{content:Ot[8],border:Ot[2],background:Ot[0]},red:{content:Be[8],border:Be[2],background:Be[0]}},J5={green:{content:He[1],background:He[9]},yellow:{content:Ot[1],background:Ot[9]},red:{content:Be[1],background:Be[9]}},eH={content:E[10],border:E[4],background:"#1c2124"},tH={backgroundDefault:E[2],backgroundHover:E[1],selected:E[3]},nH={background:E[2],icon:E[10],borderDefault:E[4],borderSelected:ne[3],textLabel:E[9],textPlaceholder:E[8],textHint:E[8]},iH={backgroundDefault:E[2],backgroundDisabled:E[0],textLabel:E[9],textPlaceholder:E[8],textHint:E[8],textError:Be[5],iconDefault:E[9],iconPlaceholder:E[10],iconError:Be[5],borderDefault:E[4],borderSelected:ne[3],borderError:Be[5]},rH={handleDefault:Ze.white,handleDisabled:E[10],off:{backgroundDefault:E[4],backgroundHover:E[5],backgroundDisabled:E[4]},on:{backgroundDefault:He[3],backgroundHover:He[2],backgroundDisabled:E[4]}},aH={off:{backgroundDefault:"#00000000",backgroundHover:E[5],backgroundDisabled:E[2],border:E[6]},on:{backgroundDefault:He[0],backgroundHover:He[1],backgroundDisabled:E[2],border:He[3]}},oH={content:E[10],background:E[4]},sH={background:E[4],active:He[3]},lH={background:E[1],content:E[9],border:E[4]},cH={backgroundDefault:E[1],backgroundHover:E[3],backgroundActive:E[4],border:E[4],contentPrimary:E[10],contentSecondary:E[9],contentTertiary:E[8]},uH={background:E[1],content:E[9],border:E[4]},dH={activeBackground:E[3],activeContent:ne[5],inactiveContent:E[9],border:E[4]},fH={header:{textDefault:E[9],textHover:E[8],backgroundDefault:E[1]},border:E[4],cell:{textPrimary:E[10],textSecondary:E[9],backgroundDefault:E[2],backgroundHover:E[1]}},pH={textPrimaryDefault:E[10],textPrimaryHover:E[10],textSecondaryDefault:E[8],textSecondaryHover:E[9],iconPrimary:E[10],iconSecondary:E[8]},hH={background:He[1],active:He[5]},gH={textDefault:E[10],textSelected:Ze.white,textDisabled:E[7],backgroundDefault:E[2],backgroundMiddle:E[3],backgroundSelected:ne[3],border:E[4]},mH=E[9];var Aw=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function Tw(t,e,n){let i=n?.paddingPx??12,r=n?.radiusPx??12,a=Math.min(Math.max(n?.scrimOpacity??.55,0),1),o=n?.ringColor??`var(--syntro-ring, ${sn[5]})`,s=n?.blocking??!1,l=n?.onClickOutside??!0,c=n?.onEsc??!0,u=getComputedStyle(document.documentElement),f=u.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=u.getPropertyValue("--syntro-ring").trim(),g=document.createElement("div");g.className="syntro-spotlight-scrim";let _=s||l;Object.assign(g.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:_?"auto":"none",background:f||`rgba(2, 6, 23, ${a})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(g),requestAnimationFrame(()=>g.style.opacity="1");let b=document.createElement("div");b.className="syntro-spotlight-ring",Object.assign(b.style,{position:"fixed",pointerEvents:"none",borderRadius:`${r}px`,border:`2px solid ${o||h||sn[5]}`,boxShadow:"0 0 0 4px rgba(255,255,255,0.35)",zIndex:"2147483647",transition:"all 220ms cubic-bezier(0.16,1,0.3,1)"}),e.appendChild(b);let w=[];if(!Aw)for(let C=0;C<4;C++){let x=document.createElement("div");x.style.position="fixed",x.style.background="inherit",w.push(x),g.appendChild(x)}let d=C=>{g.style.clipPath=C,g.style.webkitClipPath=C},p=()=>{if(!t.isConnected){k.destroy();return}let C=t.getBoundingClientRect(),x=Math.max(0,C.left-i),M=Math.max(0,C.top-i),z=Math.min(window.innerWidth,C.width+i*2),U=Math.min(window.innerHeight,C.height+i*2);if(Object.assign(b.style,{left:`${x}px`,top:`${M}px`,width:`${z}px`,height:`${U}px`}),Aw){let P=window.innerWidth,Z=window.innerHeight,X=Math.min(r,z/2,U/2),W=`M 0 0 L ${P} 0 L ${P} ${Z} L 0 ${Z} Z`,D=`M ${x+X} ${M} A ${X} ${X} 0 0 0 ${x} ${M+X} L ${x} ${M+U-X} A ${X} ${X} 0 0 0 ${x+X} ${M+U} L ${x+z-X} ${M+U} A ${X} ${X} 0 0 0 ${x+z} ${M+U-X} L ${x+z} ${M+X} A ${X} ${X} 0 0 0 ${x+z-X} ${M} L ${x+X} ${M} Z`;d(`path('${W} ${D}')`)}else{let[P,Z,X,W]=w;Object.assign(P.style,{left:"0px",top:"0px",width:"100vw",height:`${M}px`}),Object.assign(X.style,{left:"0px",top:`${M+U}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(M+U))}px`}),Object.assign(W.style,{left:"0px",top:`${M}px`,width:`${x}px`,height:`${U}px`}),Object.assign(Z.style,{left:`${x+z}px`,top:`${M}px`,width:`${Math.max(0,window.innerWidth-(x+z))}px`,height:`${U}px`})}},m=new ResizeObserver(()=>requestAnimationFrame(p));m.observe(t);let v=()=>requestAnimationFrame(p),S=()=>requestAnimationFrame(p);window.addEventListener("scroll",v,!0),window.addEventListener("resize",S);let T=C=>{C.key==="Escape"&&c&&k.destroy()};c&&window.addEventListener("keydown",T);let A=C=>{s?(C.preventDefault(),C.stopPropagation()):l&&k.destroy()};g.addEventListener("click",A);let k={destroy(){m.disconnect(),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",S),c&&window.removeEventListener("keydown",T),g.removeEventListener("click",A),g.style.pointerEvents="none",g.style.opacity="0",setTimeout(()=>{g.remove(),b.remove()},220)}};return p(),k}var QO=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function ln(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),a=[];for(;r.nextNode();){let o=r.currentNode,s=o.tagName.toLowerCase();if(!QO.has(s)){a.push(o);continue}for(let l of Array.from(o.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),f=c.startsWith("on"),h=(c==="href"||c==="src")&&u.startsWith("javascript:");(f||h)&&o.removeAttribute(l.name)}}for(let o of a){for(;o.firstChild;)o.parentNode?.insertBefore(o.firstChild,o);o.remove()}return n.innerHTML}var Fm=async(t,e)=>{let{content:n,size:i="md",blocking:r=!1,scrim:a,dismiss:o,ctaButtons:s}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
|
|
1
|
+
var SyntrologieSDK=(()=>{var KE=Object.create;var ol=Object.defineProperty;var QE=Object.getOwnPropertyDescriptor;var JE=Object.getOwnPropertyNames;var eT=Object.getPrototypeOf,tT=Object.prototype.hasOwnProperty;var yS=t=>{throw TypeError(t)};var aT=(t,e,a)=>e in t?ol(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var tr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),xS=(t,e)=>{for(var a in e)ol(t,a,{get:e[a],enumerable:!0})},bS=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of JE(e))!tT.call(t,n)&&n!==a&&ol(t,n,{get:()=>e[n],enumerable:!(r=QE(e,n))||r.enumerable});return t};var K=(t,e,a)=>(a=t!=null?KE(eT(t)):{},bS(e||!t||!t.__esModule?ol(a,"default",{value:t,enumerable:!0}):a,t)),rT=t=>bS(ol({},"__esModule",{value:!0}),t);var $=(t,e,a)=>aT(t,typeof e!="symbol"?e+"":e,a),SS=(t,e,a)=>e.has(t)||yS("Cannot "+a);var me=(t,e,a)=>(SS(t,e,"read from private field"),a?a.call(t):e.get(t)),pn=(t,e,a)=>e.has(t)?yS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),ar=(t,e,a,r)=>(SS(t,e,"write to private field"),r?r.call(t,a):e.set(t,a),a);var MS=tr(oe=>{"use strict";var qh=Symbol.for("react.transitional.element"),nT=Symbol.for("react.portal"),oT=Symbol.for("react.fragment"),iT=Symbol.for("react.strict_mode"),sT=Symbol.for("react.profiler"),lT=Symbol.for("react.consumer"),uT=Symbol.for("react.context"),cT=Symbol.for("react.forward_ref"),dT=Symbol.for("react.suspense"),fT=Symbol.for("react.memo"),IS=Symbol.for("react.lazy"),pT=Symbol.for("react.activity"),CS=Symbol.iterator;function hT(t){return t===null||typeof t!="object"?null:(t=CS&&t[CS]||t["@@iterator"],typeof t=="function"?t:null)}var AS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},kS=Object.assign,ES={};function vi(t,e,a){this.props=t,this.context=e,this.refs=ES,this.updater=a||AS}vi.prototype.isReactComponent={};vi.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};vi.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function TS(){}TS.prototype=vi.prototype;function zh(t,e,a){this.props=t,this.context=e,this.refs=ES,this.updater=a||AS}var Vh=zh.prototype=new TS;Vh.constructor=zh;kS(Vh,vi.prototype);Vh.isPureReactComponent=!0;var _S=Array.isArray;function Uh(){}var Be={H:null,A:null,T:null,S:null},RS=Object.prototype.hasOwnProperty;function $h(t,e,a){var r=a.ref;return{$$typeof:qh,type:t,key:e,ref:r!==void 0?r:null,props:a}}function mT(t,e){return $h(t.type,e,t.props)}function jh(t){return typeof t=="object"&&t!==null&&t.$$typeof===qh}function gT(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(a){return e[a]})}var wS=/\/+/g;function Hh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?gT(""+t.key):e.toString(36)}function vT(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Uh,Uh):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function gi(t,e,a,r,n){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(o){case"bigint":case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case qh:case nT:i=!0;break;case IS:return i=t._init,gi(i(t._payload),e,a,r,n)}}if(i)return n=n(t),i=r===""?"."+Hh(t,0):r,_S(n)?(a="",i!=null&&(a=i.replace(wS,"$&/")+"/"),gi(n,e,a,"",function(u){return u})):n!=null&&(jh(n)&&(n=mT(n,a+(n.key==null||t&&t.key===n.key?"":(""+n.key).replace(wS,"$&/")+"/")+i)),e.push(n)),1;i=0;var s=r===""?".":r+":";if(_S(t))for(var l=0;l<t.length;l++)r=t[l],o=s+Hh(r,l),i+=gi(r,e,a,o,n);else if(l=hT(t),typeof l=="function")for(t=l.call(t),l=0;!(r=t.next()).done;)r=r.value,o=s+Hh(r,l++),i+=gi(r,e,a,o,n);else if(o==="object"){if(typeof t.then=="function")return gi(vT(t),e,a,r,n);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return i}function wc(t,e,a){if(t==null)return t;var r=[],n=0;return gi(t,r,"","",function(o){return e.call(a,o,n++)}),r}function yT(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(a){(t._status===0||t._status===-1)&&(t._status=1,t._result=a)},function(a){(t._status===0||t._status===-1)&&(t._status=2,t._result=a)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var LS=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},xT={map:wc,forEach:function(t,e,a){wc(t,function(){e.apply(this,arguments)},a)},count:function(t){var e=0;return wc(t,function(){e++}),e},toArray:function(t){return wc(t,function(e){return e})||[]},only:function(t){if(!jh(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};oe.Activity=pT;oe.Children=xT;oe.Component=vi;oe.Fragment=oT;oe.Profiler=sT;oe.PureComponent=zh;oe.StrictMode=iT;oe.Suspense=dT;oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Be;oe.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Be.H.useMemoCache(t)}};oe.cache=function(t){return function(){return t.apply(null,arguments)}};oe.cacheSignal=function(){return null};oe.cloneElement=function(t,e,a){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var r=kS({},t.props),n=t.key;if(e!=null)for(o in e.key!==void 0&&(n=""+e.key),e)!RS.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(r[o]=e[o]);var o=arguments.length-2;if(o===1)r.children=a;else if(1<o){for(var i=Array(o),s=0;s<o;s++)i[s]=arguments[s+2];r.children=i}return $h(t.type,n,r)};oe.createContext=function(t){return t={$$typeof:uT,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:lT,_context:t},t};oe.createElement=function(t,e,a){var r,n={},o=null;if(e!=null)for(r in e.key!==void 0&&(o=""+e.key),e)RS.call(e,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(n[r]=e[r]);var i=arguments.length-2;if(i===1)n.children=a;else if(1<i){for(var s=Array(i),l=0;l<i;l++)s[l]=arguments[l+2];n.children=s}if(t&&t.defaultProps)for(r in i=t.defaultProps,i)n[r]===void 0&&(n[r]=i[r]);return $h(t,o,n)};oe.createRef=function(){return{current:null}};oe.forwardRef=function(t){return{$$typeof:cT,render:t}};oe.isValidElement=jh;oe.lazy=function(t){return{$$typeof:IS,_payload:{_status:-1,_result:t},_init:yT}};oe.memo=function(t,e){return{$$typeof:fT,type:t,compare:e===void 0?null:e}};oe.startTransition=function(t){var e=Be.T,a={};Be.T=a;try{var r=t(),n=Be.S;n!==null&&n(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Uh,LS)}catch(o){LS(o)}finally{e!==null&&a.types!==null&&(e.types=a.types),Be.T=e}};oe.unstable_useCacheRefresh=function(){return Be.H.useCacheRefresh()};oe.use=function(t){return Be.H.use(t)};oe.useActionState=function(t,e,a){return Be.H.useActionState(t,e,a)};oe.useCallback=function(t,e){return Be.H.useCallback(t,e)};oe.useContext=function(t){return Be.H.useContext(t)};oe.useDebugValue=function(){};oe.useDeferredValue=function(t,e){return Be.H.useDeferredValue(t,e)};oe.useEffect=function(t,e){return Be.H.useEffect(t,e)};oe.useEffectEvent=function(t){return Be.H.useEffectEvent(t)};oe.useId=function(){return Be.H.useId()};oe.useImperativeHandle=function(t,e,a){return Be.H.useImperativeHandle(t,e,a)};oe.useInsertionEffect=function(t,e){return Be.H.useInsertionEffect(t,e)};oe.useLayoutEffect=function(t,e){return Be.H.useLayoutEffect(t,e)};oe.useMemo=function(t,e){return Be.H.useMemo(t,e)};oe.useOptimistic=function(t,e){return Be.H.useOptimistic(t,e)};oe.useReducer=function(t,e,a){return Be.H.useReducer(t,e,a)};oe.useRef=function(t){return Be.H.useRef(t)};oe.useState=function(t){return Be.H.useState(t)};oe.useSyncExternalStore=function(t,e,a){return Be.H.useSyncExternalStore(t,e,a)};oe.useTransition=function(){return Be.H.useTransition()};oe.version="19.2.4"});var We=tr((xH,DS)=>{"use strict";DS.exports=MS()});var BS=tr(Ot=>{"use strict";var bT=We();function OS(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function hn(){}var Dt={d:{f:hn,r:function(){throw Error(OS(522))},D:hn,C:hn,L:hn,m:hn,X:hn,S:hn,M:hn},p:0,findDOMNode:null},ST=Symbol.for("react.portal");function CT(t,e,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ST,key:r==null?null:""+r,children:t,containerInfo:e,implementation:a}}var il=bT.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Lc(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Dt;Ot.createPortal=function(t,e){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(OS(299));return CT(t,e,null,a)};Ot.flushSync=function(t){var e=il.T,a=Dt.p;try{if(il.T=null,Dt.p=2,t)return t()}finally{il.T=e,Dt.p=a,Dt.d.f()}};Ot.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Dt.d.C(t,e))};Ot.prefetchDNS=function(t){typeof t=="string"&&Dt.d.D(t)};Ot.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var a=e.as,r=Lc(a,e.crossOrigin),n=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?Dt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:r,integrity:n,fetchPriority:o}):a==="script"&&Dt.d.X(t,{crossOrigin:r,integrity:n,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Ot.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=Lc(e.as,e.crossOrigin);Dt.d.M(t,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Dt.d.M(t)};Ot.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,r=Lc(a,e.crossOrigin);Dt.d.L(t,a,{crossOrigin:r,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Ot.preloadModule=function(t,e){if(typeof t=="string")if(e){var a=Lc(e.as,e.crossOrigin);Dt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Dt.d.m(t)};Ot.requestFormReset=function(t){Dt.d.r(t)};Ot.unstable_batchedUpdates=function(t,e){return t(e)};Ot.useFormState=function(t,e,a){return il.H.useFormState(t,e,a)};Ot.useFormStatus=function(){return il.H.useHostTransitionStatus()};Ot.version="19.2.4"});var sl=tr((SH,NS)=>{"use strict";function FS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(FS)}catch(t){console.error(t)}}FS(),NS.exports=BS()});var WS=tr(Ue=>{"use strict";function Xh(t,e){var a=t.length;t.push(e);e:for(;0<a;){var r=a-1>>>1,n=t[r];if(0<Ic(n,e))t[r]=e,t[a]=n,a=r;else break e}}function rr(t){return t.length===0?null:t[0]}function kc(t){if(t.length===0)return null;var e=t[0],a=t.pop();if(a!==e){t[0]=a;e:for(var r=0,n=t.length,o=n>>>1;r<o;){var i=2*(r+1)-1,s=t[i],l=i+1,u=t[l];if(0>Ic(s,a))l<n&&0>Ic(u,s)?(t[r]=u,t[l]=a,r=l):(t[r]=s,t[i]=a,r=i);else if(l<n&&0>Ic(u,a))t[r]=u,t[l]=a,r=l;else break e}}return e}function Ic(t,e){var a=t.sortIndex-e.sortIndex;return a!==0?a:t.id-e.id}Ue.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(PS=performance,Ue.unstable_now=function(){return PS.now()}):(Gh=Date,HS=Gh.now(),Ue.unstable_now=function(){return Gh.now()-HS});var PS,Gh,HS,Sr=[],mn=[],_T=1,xa=null,kt=3,Yh=!1,ll=!1,ul=!1,Kh=!1,zS=typeof setTimeout=="function"?setTimeout:null,VS=typeof clearTimeout=="function"?clearTimeout:null,US=typeof setImmediate<"u"?setImmediate:null;function Ac(t){for(var e=rr(mn);e!==null;){if(e.callback===null)kc(mn);else if(e.startTime<=t)kc(mn),e.sortIndex=e.expirationTime,Xh(Sr,e);else break;e=rr(mn)}}function Qh(t){if(ul=!1,Ac(t),!ll)if(rr(Sr)!==null)ll=!0,xi||(xi=!0,yi());else{var e=rr(mn);e!==null&&Jh(Qh,e.startTime-t)}}var xi=!1,cl=-1,$S=5,jS=-1;function GS(){return Kh?!0:!(Ue.unstable_now()-jS<$S)}function Wh(){if(Kh=!1,xi){var t=Ue.unstable_now();jS=t;var e=!0;try{e:{ll=!1,ul&&(ul=!1,VS(cl),cl=-1),Yh=!0;var a=kt;try{t:{for(Ac(t),xa=rr(Sr);xa!==null&&!(xa.expirationTime>t&&GS());){var r=xa.callback;if(typeof r=="function"){xa.callback=null,kt=xa.priorityLevel;var n=r(xa.expirationTime<=t);if(t=Ue.unstable_now(),typeof n=="function"){xa.callback=n,Ac(t),e=!0;break t}xa===rr(Sr)&&kc(Sr),Ac(t)}else kc(Sr);xa=rr(Sr)}if(xa!==null)e=!0;else{var o=rr(mn);o!==null&&Jh(Qh,o.startTime-t),e=!1}}break e}finally{xa=null,kt=a,Yh=!1}e=void 0}}finally{e?yi():xi=!1}}}var yi;typeof US=="function"?yi=function(){US(Wh)}:typeof MessageChannel<"u"?(Zh=new MessageChannel,qS=Zh.port2,Zh.port1.onmessage=Wh,yi=function(){qS.postMessage(null)}):yi=function(){zS(Wh,0)};var Zh,qS;function Jh(t,e){cl=zS(function(){t(Ue.unstable_now())},e)}Ue.unstable_IdlePriority=5;Ue.unstable_ImmediatePriority=1;Ue.unstable_LowPriority=4;Ue.unstable_NormalPriority=3;Ue.unstable_Profiling=null;Ue.unstable_UserBlockingPriority=2;Ue.unstable_cancelCallback=function(t){t.callback=null};Ue.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$S=0<t?Math.floor(1e3/t):5};Ue.unstable_getCurrentPriorityLevel=function(){return kt};Ue.unstable_next=function(t){switch(kt){case 1:case 2:case 3:var e=3;break;default:e=kt}var a=kt;kt=e;try{return t()}finally{kt=a}};Ue.unstable_requestPaint=function(){Kh=!0};Ue.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var a=kt;kt=t;try{return e()}finally{kt=a}};Ue.unstable_scheduleCallback=function(t,e,a){var r=Ue.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,t){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,t={id:_T++,callback:e,priorityLevel:t,startTime:a,expirationTime:n,sortIndex:-1},a>r?(t.sortIndex=a,Xh(mn,t),rr(Sr)===null&&t===rr(mn)&&(ul?(VS(cl),cl=-1):ul=!0,Jh(Qh,a-r))):(t.sortIndex=n,Xh(Sr,t),ll||Yh||(ll=!0,xi||(xi=!0,yi()))),t};Ue.unstable_shouldYield=GS;Ue.unstable_wrapCallback=function(t){var e=kt;return function(){var a=kt;kt=e;try{return t.apply(this,arguments)}finally{kt=a}}}});var XS=tr((_H,ZS)=>{"use strict";ZS.exports=WS()});var sL=tr(Jd=>{"use strict";var it=XS(),SC=We(),wT=sl();function M(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function CC(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Yl(t){var e=t,a=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(a=e.return),t=e.return;while(t)}return e.tag===3?a:null}function _C(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function wC(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function YS(t){if(Yl(t)!==t)throw Error(M(188))}function LT(t){var e=t.alternate;if(!e){if(e=Yl(t),e===null)throw Error(M(188));return e!==t?null:t}for(var a=t,r=e;;){var n=a.return;if(n===null)break;var o=n.alternate;if(o===null){if(r=n.return,r!==null){a=r;continue}break}if(n.child===o.child){for(o=n.child;o;){if(o===a)return YS(n),t;if(o===r)return YS(n),e;o=o.sibling}throw Error(M(188))}if(a.return!==r.return)a=n,r=o;else{for(var i=!1,s=n.child;s;){if(s===a){i=!0,a=n,r=o;break}if(s===r){i=!0,r=n,a=o;break}s=s.sibling}if(!i){for(s=o.child;s;){if(s===a){i=!0,a=o,r=n;break}if(s===r){i=!0,r=o,a=n;break}s=s.sibling}if(!i)throw Error(M(189))}}if(a.alternate!==r)throw Error(M(190))}if(a.tag!==3)throw Error(M(188));return a.stateNode.current===a?t:e}function LC(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=LC(t),e!==null)return e;t=t.sibling}return null}var Pe=Object.assign,IT=Symbol.for("react.element"),Ec=Symbol.for("react.transitional.element"),yl=Symbol.for("react.portal"),Li=Symbol.for("react.fragment"),IC=Symbol.for("react.strict_mode"),Dm=Symbol.for("react.profiler"),AC=Symbol.for("react.consumer"),Er=Symbol.for("react.context"),kg=Symbol.for("react.forward_ref"),Om=Symbol.for("react.suspense"),Bm=Symbol.for("react.suspense_list"),Eg=Symbol.for("react.memo"),gn=Symbol.for("react.lazy"),Fm=Symbol.for("react.activity"),AT=Symbol.for("react.memo_cache_sentinel"),KS=Symbol.iterator;function dl(t){return t===null||typeof t!="object"?null:(t=KS&&t[KS]||t["@@iterator"],typeof t=="function"?t:null)}var kT=Symbol.for("react.client.reference");function Nm(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===kT?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Li:return"Fragment";case Dm:return"Profiler";case IC:return"StrictMode";case Om:return"Suspense";case Bm:return"SuspenseList";case Fm:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case yl:return"Portal";case Er:return t.displayName||"Context";case AC:return(t._context.displayName||"Context")+".Consumer";case kg:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Eg:return e=t.displayName||null,e!==null?e:Nm(t.type)||"Memo";case gn:e=t._payload,t=t._init;try{return Nm(t(e))}catch{}}return null}var xl=Array.isArray,ee=SC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe=wT.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,bo={pending:!1,data:null,method:null,action:null},Pm=[],Ii=-1;function lr(t){return{current:t}}function ht(t){0>Ii||(t.current=Pm[Ii],Pm[Ii]=null,Ii--)}function Re(t,e){Ii++,Pm[Ii]=t.current,t.current=e}var sr=lr(null),Fl=lr(null),An=lr(null),ld=lr(null);function ud(t,e){switch(Re(An,e),Re(Fl,t),Re(sr,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?nC(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=nC(e),t=Ww(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ht(sr),Re(sr,t)}function $i(){ht(sr),ht(Fl),ht(An)}function Hm(t){t.memoizedState!==null&&Re(ld,t);var e=sr.current,a=Ww(e,t.type);e!==a&&(Re(Fl,t),Re(sr,a))}function cd(t){Fl.current===t&&(ht(sr),ht(Fl)),ld.current===t&&(ht(ld),Wl._currentValue=bo)}var em,QS;function go(t){if(em===void 0)try{throw Error()}catch(a){var e=a.stack.trim().match(/\n( *(at )?)/);em=e&&e[1]||"",QS=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+em+t+QS}var tm=!1;function am(t,e){if(!t||tm)return"";tm=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(e){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(g){var p=g}Reflect.construct(t,[],d)}else{try{d.call()}catch(g){p=g}t.call(d.prototype)}}else{try{throw Error()}catch(g){p=g}(d=t())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(g){if(g&&p&&typeof g.stack=="string")return[g.stack,p.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=r.DetermineComponentFrameRoot(),i=o[0],s=o[1];if(i&&s){var l=i.split(`
|
|
4
|
+
`),u=s.split(`
|
|
5
|
+
`);for(n=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;n<u.length&&!u[n].includes("DetermineComponentFrameRoot");)n++;if(r===l.length||n===u.length)for(r=l.length-1,n=u.length-1;1<=r&&0<=n&&l[r]!==u[n];)n--;for(;1<=r&&0<=n;r--,n--)if(l[r]!==u[n]){if(r!==1||n!==1)do if(r--,n--,0>n||l[r]!==u[n]){var c=`
|
|
6
|
+
`+l[r].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=r&&0<=n);break}}}finally{tm=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?go(a):""}function ET(t,e){switch(t.tag){case 26:case 27:case 5:return go(t.type);case 16:return go("Lazy");case 13:return t.child!==e&&e!==null?go("Suspense Fallback"):go("Suspense");case 19:return go("SuspenseList");case 0:case 15:return am(t.type,!1);case 11:return am(t.type.render,!1);case 1:return am(t.type,!0);case 31:return go("Activity");default:return""}}function JS(t){try{var e="",a=null;do e+=ET(t,a),a=t,t=t.return;while(t);return e}catch(r){return`
|
|
7
|
+
Error generating stack: `+r.message+`
|
|
8
|
+
`+r.stack}}var Um=Object.prototype.hasOwnProperty,Tg=it.unstable_scheduleCallback,rm=it.unstable_cancelCallback,TT=it.unstable_shouldYield,RT=it.unstable_requestPaint,ia=it.unstable_now,MT=it.unstable_getCurrentPriorityLevel,kC=it.unstable_ImmediatePriority,EC=it.unstable_UserBlockingPriority,dd=it.unstable_NormalPriority,DT=it.unstable_LowPriority,TC=it.unstable_IdlePriority,OT=it.log,BT=it.unstable_setDisableYieldValue,Kl=null,sa=null;function Cn(t){if(typeof OT=="function"&&BT(t),sa&&typeof sa.setStrictMode=="function")try{sa.setStrictMode(Kl,t)}catch{}}var la=Math.clz32?Math.clz32:PT,FT=Math.log,NT=Math.LN2;function PT(t){return t>>>=0,t===0?32:31-(FT(t)/NT|0)|0}var Tc=256,Rc=262144,Mc=4194304;function vo(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Nd(t,e,a){var r=t.pendingLanes;if(r===0)return 0;var n=0,o=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var s=r&134217727;return s!==0?(r=s&~o,r!==0?n=vo(r):(i&=s,i!==0?n=vo(i):a||(a=s&~t,a!==0&&(n=vo(a))))):(s=r&~o,s!==0?n=vo(s):i!==0?n=vo(i):a||(a=r&~t,a!==0&&(n=vo(a)))),n===0?0:e!==0&&e!==n&&(e&o)===0&&(o=n&-n,a=e&-e,o>=a||o===32&&(a&4194048)!==0)?e:n}function Ql(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function HT(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function RC(){var t=Mc;return Mc<<=1,(Mc&62914560)===0&&(Mc=4194304),t}function nm(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function Jl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function UT(t,e,a,r,n,o){var i=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,u=t.hiddenUpdates;for(a=i&~a;0<a;){var c=31-la(a),d=1<<c;s[c]=0,l[c]=-1;var p=u[c];if(p!==null)for(u[c]=null,c=0;c<p.length;c++){var g=p[c];g!==null&&(g.lane&=-536870913)}a&=~d}r!==0&&MC(t,r,0),o!==0&&n===0&&t.tag!==0&&(t.suspendedLanes|=o&~(i&~e))}function MC(t,e,a){t.pendingLanes|=e,t.suspendedLanes&=~e;var r=31-la(e);t.entangledLanes|=e,t.entanglements[r]=t.entanglements[r]|1073741824|a&261930}function DC(t,e){var a=t.entangledLanes|=e;for(t=t.entanglements;a;){var r=31-la(a),n=1<<r;n&e|t[r]&e&&(t[r]|=e),a&=~n}}function OC(t,e){var a=e&-e;return a=(a&42)!==0?1:Rg(a),(a&(t.suspendedLanes|e))!==0?0:a}function Rg(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Mg(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function BC(){var t=xe.p;return t!==0?t:(t=window.event,t===void 0?32:nL(t.type))}function e0(t,e){var a=xe.p;try{return xe.p=t,e()}finally{xe.p=a}}var Un=Math.random().toString(36).slice(2),yt="__reactFiber$"+Un,Wt="__reactProps$"+Un,ts="__reactContainer$"+Un,qm="__reactEvents$"+Un,qT="__reactListeners$"+Un,zT="__reactHandles$"+Un,t0="__reactResources$"+Un,eu="__reactMarker$"+Un;function Dg(t){delete t[yt],delete t[Wt],delete t[qm],delete t[qT],delete t[zT]}function Ai(t){var e=t[yt];if(e)return e;for(var a=t.parentNode;a;){if(e=a[ts]||a[yt]){if(a=e.alternate,e.child!==null||a!==null&&a.child!==null)for(t=uC(t);t!==null;){if(a=t[yt])return a;t=uC(t)}return e}t=a,a=t.parentNode}return null}function as(t){if(t=t[yt]||t[ts]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function bl(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(M(33))}function Ni(t){var e=t[t0];return e||(e=t[t0]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function pt(t){t[eu]=!0}var FC=new Set,NC={};function To(t,e){ji(t,e),ji(t+"Capture",e)}function ji(t,e){for(NC[t]=e,t=0;t<e.length;t++)FC.add(e[t])}var VT=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]*$"),a0={},r0={};function $T(t){return Um.call(r0,t)?!0:Um.call(a0,t)?!1:VT.test(t)?r0[t]=!0:(a0[t]=!0,!1)}function Wc(t,e,a){if($T(e))if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var r=e.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+a)}}function Dc(t,e,a){if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+a)}}function Cr(t,e,a,r){if(r===null)t.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(e,a,""+r)}}function Sa(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function PC(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function jT(t,e,a){var r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,o=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return n.call(this)},set:function(i){a=""+i,o.call(this,i)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function zm(t){if(!t._valueTracker){var e=PC(t)?"checked":"value";t._valueTracker=jT(t,e,""+t[e])}}function HC(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),r="";return t&&(r=PC(t)?t.checked?"true":"false":t.value),t=r,t!==a?(e.setValue(t),!0):!1}function fd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var GT=/[\n"\\]/g;function wa(t){return t.replace(GT,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Vm(t,e,a,r,n,o,i,s){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),e!=null?i==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Sa(e)):t.value!==""+Sa(e)&&(t.value=""+Sa(e)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),e!=null?$m(t,i,Sa(e)):a!=null?$m(t,i,Sa(a)):r!=null&&t.removeAttribute("value"),n==null&&o!=null&&(t.defaultChecked=!!o),n!=null&&(t.checked=n&&typeof n!="function"&&typeof n!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+Sa(s):t.removeAttribute("name")}function UC(t,e,a,r,n,o,i,s){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.type=o),e!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||e!=null)){zm(t);return}a=a!=null?""+Sa(a):"",e=e!=null?""+Sa(e):a,s||e===t.value||(t.value=e),t.defaultValue=e}r=r??n,r=typeof r!="function"&&typeof r!="symbol"&&!!r,t.checked=s?t.checked:!!r,t.defaultChecked=!!r,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),zm(t)}function $m(t,e,a){e==="number"&&fd(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Pi(t,e,a,r){if(t=t.options,e){e={};for(var n=0;n<a.length;n++)e["$"+a[n]]=!0;for(a=0;a<t.length;a++)n=e.hasOwnProperty("$"+t[a].value),t[a].selected!==n&&(t[a].selected=n),n&&r&&(t[a].defaultSelected=!0)}else{for(a=""+Sa(a),e=null,n=0;n<t.length;n++){if(t[n].value===a){t[n].selected=!0,r&&(t[n].defaultSelected=!0);return}e!==null||t[n].disabled||(e=t[n])}e!==null&&(e.selected=!0)}}function qC(t,e,a){if(e!=null&&(e=""+Sa(e),e!==t.value&&(t.value=e),a==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=a!=null?""+Sa(a):""}function zC(t,e,a,r){if(e==null){if(r!=null){if(a!=null)throw Error(M(92));if(xl(r)){if(1<r.length)throw Error(M(93));r=r[0]}a=r}a==null&&(a=""),e=a}a=Sa(e),t.defaultValue=a,r=t.textContent,r===a&&r!==""&&r!==null&&(t.value=r),zm(t)}function Gi(t,e){if(e){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=e;return}}t.textContent=e}var WT=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 n0(t,e,a){var r=e.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":r?t.setProperty(e,a):typeof a!="number"||a===0||WT.has(e)?e==="float"?t.cssFloat=a:t[e]=(""+a).trim():t[e]=a+"px"}function VC(t,e,a){if(e!=null&&typeof e!="object")throw Error(M(62));if(t=t.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||e!=null&&e.hasOwnProperty(r)||(r.indexOf("--")===0?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="");for(var n in e)r=e[n],e.hasOwnProperty(n)&&a[n]!==r&&n0(t,n,r)}else for(var o in e)e.hasOwnProperty(o)&&n0(t,o,e[o])}function Og(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ZT=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),XT=/^[\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 Zc(t){return XT.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Tr(){}var jm=null;function Bg(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ki=null,Hi=null;function o0(t){var e=as(t);if(e&&(t=e.stateNode)){var a=t[Wt]||null;e:switch(t=e.stateNode,e.type){case"input":if(Vm(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),e=a.name,a.type==="radio"&&e!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+wa(""+e)+'"][type="radio"]'),e=0;e<a.length;e++){var r=a[e];if(r!==t&&r.form===t.form){var n=r[Wt]||null;if(!n)throw Error(M(90));Vm(r,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(e=0;e<a.length;e++)r=a[e],r.form===t.form&&HC(r)}break e;case"textarea":qC(t,a.value,a.defaultValue);break e;case"select":e=a.value,e!=null&&Pi(t,!!a.multiple,e,!1)}}}var om=!1;function $C(t,e,a){if(om)return t(e,a);om=!0;try{var r=t(e);return r}finally{if(om=!1,(ki!==null||Hi!==null)&&(Xd(),ki&&(e=ki,t=Hi,Hi=ki=null,o0(e),t)))for(e=0;e<t.length;e++)o0(t[e])}}function Nl(t,e){var a=t.stateNode;if(a===null)return null;var r=a[Wt]||null;if(r===null)return null;a=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(M(231,e,typeof a));return a}var Br=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gm=!1;if(Br)try{bi={},Object.defineProperty(bi,"passive",{get:function(){Gm=!0}}),window.addEventListener("test",bi,bi),window.removeEventListener("test",bi,bi)}catch{Gm=!1}var bi,_n=null,Fg=null,Xc=null;function jC(){if(Xc)return Xc;var t,e=Fg,a=e.length,r,n="value"in _n?_n.value:_n.textContent,o=n.length;for(t=0;t<a&&e[t]===n[t];t++);var i=a-t;for(r=1;r<=i&&e[a-r]===n[o-r];r++);return Xc=n.slice(t,1<r?1-r:void 0)}function Yc(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Oc(){return!0}function i0(){return!1}function Zt(t){function e(a,r,n,o,i){this._reactName=a,this._targetInst=n,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(a=t[s],this[s]=a?a(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Oc:i0,this.isPropagationStopped=i0,this}return Pe(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Oc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Oc)},persist:function(){},isPersistent:Oc}),e}var Ro={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pd=Zt(Ro),tu=Pe({},Ro,{view:0,detail:0}),YT=Zt(tu),im,sm,fl,Hd=Pe({},tu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ng,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==fl&&(fl&&t.type==="mousemove"?(im=t.screenX-fl.screenX,sm=t.screenY-fl.screenY):sm=im=0,fl=t),im)},movementY:function(t){return"movementY"in t?t.movementY:sm}}),s0=Zt(Hd),KT=Pe({},Hd,{dataTransfer:0}),QT=Zt(KT),JT=Pe({},tu,{relatedTarget:0}),lm=Zt(JT),eR=Pe({},Ro,{animationName:0,elapsedTime:0,pseudoElement:0}),tR=Zt(eR),aR=Pe({},Ro,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),rR=Zt(aR),nR=Pe({},Ro,{data:0}),l0=Zt(nR),oR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iR={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"},sR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lR(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=sR[t])?!!e[t]:!1}function Ng(){return lR}var uR=Pe({},tu,{key:function(t){if(t.key){var e=oR[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Yc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?iR[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ng,charCode:function(t){return t.type==="keypress"?Yc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Yc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),cR=Zt(uR),dR=Pe({},Hd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),u0=Zt(dR),fR=Pe({},tu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ng}),pR=Zt(fR),hR=Pe({},Ro,{propertyName:0,elapsedTime:0,pseudoElement:0}),mR=Zt(hR),gR=Pe({},Hd,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),vR=Zt(gR),yR=Pe({},Ro,{newState:0,oldState:0}),xR=Zt(yR),bR=[9,13,27,32],Pg=Br&&"CompositionEvent"in window,_l=null;Br&&"documentMode"in document&&(_l=document.documentMode);var SR=Br&&"TextEvent"in window&&!_l,GC=Br&&(!Pg||_l&&8<_l&&11>=_l),c0=" ",d0=!1;function WC(t,e){switch(t){case"keyup":return bR.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ZC(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ei=!1;function CR(t,e){switch(t){case"compositionend":return ZC(e);case"keypress":return e.which!==32?null:(d0=!0,c0);case"textInput":return t=e.data,t===c0&&d0?null:t;default:return null}}function _R(t,e){if(Ei)return t==="compositionend"||!Pg&&WC(t,e)?(t=jC(),Xc=Fg=_n=null,Ei=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return GC&&e.locale!=="ko"?null:e.data;default:return null}}var wR={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 f0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!wR[t.type]:e==="textarea"}function XC(t,e,a,r){ki?Hi?Hi.push(r):Hi=[r]:ki=r,e=Td(e,"onChange"),0<e.length&&(a=new Pd("onChange","change",null,a,r),t.push({event:a,listeners:e}))}var wl=null,Pl=null;function LR(t){$w(t,0)}function Ud(t){var e=bl(t);if(HC(e))return t}function p0(t,e){if(t==="change")return e}var YC=!1;Br&&(Br?(Fc="oninput"in document,Fc||(um=document.createElement("div"),um.setAttribute("oninput","return;"),Fc=typeof um.oninput=="function"),Bc=Fc):Bc=!1,YC=Bc&&(!document.documentMode||9<document.documentMode));var Bc,Fc,um;function h0(){wl&&(wl.detachEvent("onpropertychange",KC),Pl=wl=null)}function KC(t){if(t.propertyName==="value"&&Ud(Pl)){var e=[];XC(e,Pl,t,Bg(t)),$C(LR,e)}}function IR(t,e,a){t==="focusin"?(h0(),wl=e,Pl=a,wl.attachEvent("onpropertychange",KC)):t==="focusout"&&h0()}function AR(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ud(Pl)}function kR(t,e){if(t==="click")return Ud(e)}function ER(t,e){if(t==="input"||t==="change")return Ud(e)}function TR(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ca=typeof Object.is=="function"?Object.is:TR;function Hl(t,e){if(ca(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var a=Object.keys(t),r=Object.keys(e);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var n=a[r];if(!Um.call(e,n)||!ca(t[n],e[n]))return!1}return!0}function m0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function g0(t,e){var a=m0(t);t=0;for(var r;a;){if(a.nodeType===3){if(r=t+a.textContent.length,t<=e&&r>=e)return{node:a,offset:e-t};t=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=m0(a)}}function QC(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?QC(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function JC(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=fd(t.document);e instanceof t.HTMLIFrameElement;){try{var a=typeof e.contentWindow.location.href=="string"}catch{a=!1}if(a)t=e.contentWindow;else break;e=fd(t.document)}return e}function Hg(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var RR=Br&&"documentMode"in document&&11>=document.documentMode,Ti=null,Wm=null,Ll=null,Zm=!1;function v0(t,e,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Zm||Ti==null||Ti!==fd(r)||(r=Ti,"selectionStart"in r&&Hg(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}),Ll&&Hl(Ll,r)||(Ll=r,r=Td(Wm,"onSelect"),0<r.length&&(e=new Pd("onSelect","select",null,e,a),t.push({event:e,listeners:r}),e.target=Ti)))}function mo(t,e){var a={};return a[t.toLowerCase()]=e.toLowerCase(),a["Webkit"+t]="webkit"+e,a["Moz"+t]="moz"+e,a}var Ri={animationend:mo("Animation","AnimationEnd"),animationiteration:mo("Animation","AnimationIteration"),animationstart:mo("Animation","AnimationStart"),transitionrun:mo("Transition","TransitionRun"),transitionstart:mo("Transition","TransitionStart"),transitioncancel:mo("Transition","TransitionCancel"),transitionend:mo("Transition","TransitionEnd")},cm={},e_={};Br&&(e_=document.createElement("div").style,"AnimationEvent"in window||(delete Ri.animationend.animation,delete Ri.animationiteration.animation,delete Ri.animationstart.animation),"TransitionEvent"in window||delete Ri.transitionend.transition);function Mo(t){if(cm[t])return cm[t];if(!Ri[t])return t;var e=Ri[t],a;for(a in e)if(e.hasOwnProperty(a)&&a in e_)return cm[t]=e[a];return t}var t_=Mo("animationend"),a_=Mo("animationiteration"),r_=Mo("animationstart"),MR=Mo("transitionrun"),DR=Mo("transitionstart"),OR=Mo("transitioncancel"),n_=Mo("transitionend"),o_=new Map,Xm="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(" ");Xm.push("scrollEnd");function za(t,e){o_.set(t,e),To(e,[t])}var pd=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ba=[],Mi=0,Ug=0;function qd(){for(var t=Mi,e=Ug=Mi=0;e<t;){var a=ba[e];ba[e++]=null;var r=ba[e];ba[e++]=null;var n=ba[e];ba[e++]=null;var o=ba[e];if(ba[e++]=null,r!==null&&n!==null){var i=r.pending;i===null?n.next=n:(n.next=i.next,i.next=n),r.pending=n}o!==0&&i_(a,n,o)}}function zd(t,e,a,r){ba[Mi++]=t,ba[Mi++]=e,ba[Mi++]=a,ba[Mi++]=r,Ug|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function qg(t,e,a,r){return zd(t,e,a,r),hd(t)}function Do(t,e){return zd(t,null,null,e),hd(t)}function i_(t,e,a){t.lanes|=a;var r=t.alternate;r!==null&&(r.lanes|=a);for(var n=!1,o=t.return;o!==null;)o.childLanes|=a,r=o.alternate,r!==null&&(r.childLanes|=a),o.tag===22&&(t=o.stateNode,t===null||t._visibility&1||(n=!0)),t=o,o=o.return;return t.tag===3?(o=t.stateNode,n&&e!==null&&(n=31-la(a),t=o.hiddenUpdates,r=t[n],r===null?t[n]=[e]:r.push(e),e.lane=a|536870912),o):null}function hd(t){if(50<Ol)throw Ol=0,gg=null,Error(M(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Di={};function BR(t,e,a,r){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function na(t,e,a,r){return new BR(t,e,a,r)}function zg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Mr(t,e){var a=t.alternate;return a===null?(a=na(t.tag,e,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=e,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,e=t.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function s_(t,e){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,e=a.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Kc(t,e,a,r,n,o){var i=0;if(r=t,typeof t=="function")zg(t)&&(i=1);else if(typeof t=="string")i=PM(t,a,sr.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Fm:return t=na(31,a,e,n),t.elementType=Fm,t.lanes=o,t;case Li:return So(a.children,n,o,e);case IC:i=8,n|=24;break;case Dm:return t=na(12,a,e,n|2),t.elementType=Dm,t.lanes=o,t;case Om:return t=na(13,a,e,n),t.elementType=Om,t.lanes=o,t;case Bm:return t=na(19,a,e,n),t.elementType=Bm,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Er:i=10;break e;case AC:i=9;break e;case kg:i=11;break e;case Eg:i=14;break e;case gn:i=16,r=null;break e}i=29,a=Error(M(130,t===null?"null":typeof t,"")),r=null}return e=na(i,a,e,n),e.elementType=t,e.type=r,e.lanes=o,e}function So(t,e,a,r){return t=na(7,t,r,e),t.lanes=a,t}function dm(t,e,a){return t=na(6,t,null,e),t.lanes=a,t}function l_(t){var e=na(18,null,null,0);return e.stateNode=t,e}function fm(t,e,a){return e=na(4,t.children!==null?t.children:[],t.key,e),e.lanes=a,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var y0=new WeakMap;function La(t,e){if(typeof t=="object"&&t!==null){var a=y0.get(t);return a!==void 0?a:(e={value:t,source:e,stack:JS(e)},y0.set(t,e),e)}return{value:t,source:e,stack:JS(e)}}var Oi=[],Bi=0,md=null,Ul=0,Ca=[],_a=0,Fn=null,nr=1,or="";function Ar(t,e){Oi[Bi++]=Ul,Oi[Bi++]=md,md=t,Ul=e}function u_(t,e,a){Ca[_a++]=nr,Ca[_a++]=or,Ca[_a++]=Fn,Fn=t;var r=nr;t=or;var n=32-la(r)-1;r&=~(1<<n),a+=1;var o=32-la(e)+n;if(30<o){var i=n-n%5;o=(r&(1<<i)-1).toString(32),r>>=i,n-=i,nr=1<<32-la(e)+n|a<<n|r,or=o+t}else nr=1<<o|a<<n|r,or=t}function Vg(t){t.return!==null&&(Ar(t,1),u_(t,1,0))}function $g(t){for(;t===md;)md=Oi[--Bi],Oi[Bi]=null,Ul=Oi[--Bi],Oi[Bi]=null;for(;t===Fn;)Fn=Ca[--_a],Ca[_a]=null,or=Ca[--_a],Ca[_a]=null,nr=Ca[--_a],Ca[_a]=null}function c_(t,e){Ca[_a++]=nr,Ca[_a++]=or,Ca[_a++]=Fn,nr=e.id,or=e.overflow,Fn=t}var xt=null,Ne=null,he=!1,kn=null,Ia=!1,Ym=Error(M(519));function Nn(t){var e=Error(M(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ql(La(e,t)),Ym}function x0(t){var e=t.stateNode,a=t.type,r=t.memoizedProps;switch(e[yt]=t,e[Wt]=r,a){case"dialog":ue("cancel",e),ue("close",e);break;case"iframe":case"object":case"embed":ue("load",e);break;case"video":case"audio":for(a=0;a<jl.length;a++)ue(jl[a],e);break;case"source":ue("error",e);break;case"img":case"image":case"link":ue("error",e),ue("load",e);break;case"details":ue("toggle",e);break;case"input":ue("invalid",e),UC(e,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ue("invalid",e);break;case"textarea":ue("invalid",e),zC(e,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||e.textContent===""+a||r.suppressHydrationWarning===!0||Gw(e.textContent,a)?(r.popover!=null&&(ue("beforetoggle",e),ue("toggle",e)),r.onScroll!=null&&ue("scroll",e),r.onScrollEnd!=null&&ue("scrollend",e),r.onClick!=null&&(e.onclick=Tr),e=!0):e=!1,e||Nn(t,!0)}function b0(t){for(xt=t.return;xt;)switch(xt.tag){case 5:case 31:case 13:Ia=!1;return;case 27:case 3:Ia=!0;return;default:xt=xt.return}}function Si(t){if(t!==xt)return!1;if(!he)return b0(t),he=!0,!1;var e=t.tag,a;if((a=e!==3&&e!==27)&&((a=e===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Sg(t.type,t.memoizedProps)),a=!a),a&&Ne&&Nn(t),b0(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Ne=lC(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Ne=lC(t)}else e===27?(e=Ne,qn(t.type)?(t=Lg,Lg=null,Ne=t):Ne=e):Ne=xt?ka(t.stateNode.nextSibling):null;return!0}function Lo(){Ne=xt=null,he=!1}function pm(){var t=kn;return t!==null&&(jt===null?jt=t:jt.push.apply(jt,t),kn=null),t}function ql(t){kn===null?kn=[t]:kn.push(t)}var Km=lr(null),Oo=null,Rr=null;function yn(t,e,a){Re(Km,e._currentValue),e._currentValue=a}function Dr(t){t._currentValue=Km.current,ht(Km)}function Qm(t,e,a){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===a)break;t=t.return}}function Jm(t,e,a,r){var n=t.child;for(n!==null&&(n.return=t);n!==null;){var o=n.dependencies;if(o!==null){var i=n.child;o=o.firstContext;e:for(;o!==null;){var s=o;o=n;for(var l=0;l<e.length;l++)if(s.context===e[l]){o.lanes|=a,s=o.alternate,s!==null&&(s.lanes|=a),Qm(o.return,a,t),r||(i=null);break e}o=s.next}}else if(n.tag===18){if(i=n.return,i===null)throw Error(M(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),Qm(i,a,t),i=null}else i=n.child;if(i!==null)i.return=n;else for(i=n;i!==null;){if(i===t){i=null;break}if(n=i.sibling,n!==null){n.return=i.return,i=n;break}i=i.return}n=i}}function rs(t,e,a,r){t=null;for(var n=e,o=!1;n!==null;){if(!o){if((n.flags&524288)!==0)o=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var i=n.alternate;if(i===null)throw Error(M(387));if(i=i.memoizedProps,i!==null){var s=n.type;ca(n.pendingProps.value,i.value)||(t!==null?t.push(s):t=[s])}}else if(n===ld.current){if(i=n.alternate,i===null)throw Error(M(387));i.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(t!==null?t.push(Wl):t=[Wl])}n=n.return}t!==null&&Jm(e,t,a,r),e.flags|=262144}function gd(t){for(t=t.firstContext;t!==null;){if(!ca(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Io(t){Oo=t,Rr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function bt(t){return d_(Oo,t)}function Nc(t,e){return Oo===null&&Io(t),d_(t,e)}function d_(t,e){var a=e._currentValue;if(e={context:e,memoizedValue:a,next:null},Rr===null){if(t===null)throw Error(M(308));Rr=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Rr=Rr.next=e;return a}var FR=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(a,r){t.push(r)}};this.abort=function(){e.aborted=!0,t.forEach(function(a){return a()})}},NR=it.unstable_scheduleCallback,PR=it.unstable_NormalPriority,at={$$typeof:Er,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jg(){return{controller:new FR,data:new Map,refCount:0}}function au(t){t.refCount--,t.refCount===0&&NR(PR,function(){t.controller.abort()})}var Il=null,eg=0,Wi=0,Ui=null;function HR(t,e){if(Il===null){var a=Il=[];eg=0,Wi=gv(),Ui={status:"pending",value:void 0,then:function(r){a.push(r)}}}return eg++,e.then(S0,S0),e}function S0(){if(--eg===0&&Il!==null){Ui!==null&&(Ui.status="fulfilled");var t=Il;Il=null,Wi=0,Ui=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function UR(t,e){var a=[],r={status:"pending",value:null,reason:null,then:function(n){a.push(n)}};return t.then(function(){r.status="fulfilled",r.value=e;for(var n=0;n<a.length;n++)(0,a[n])(e)},function(n){for(r.status="rejected",r.reason=n,n=0;n<a.length;n++)(0,a[n])(void 0)}),r}var C0=ee.S;ee.S=function(t,e){Lw=ia(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&HR(t,e),C0!==null&&C0(t,e)};var Co=lr(null);function Gg(){var t=Co.current;return t!==null?t:Ae.pooledCache}function Qc(t,e){e===null?Re(Co,Co.current):Re(Co,e.pool)}function f_(){var t=Gg();return t===null?null:{parent:at._currentValue,pool:t}}var ns=Error(M(460)),Wg=Error(M(474)),Vd=Error(M(542)),vd={then:function(){}};function _0(t){return t=t.status,t==="fulfilled"||t==="rejected"}function p_(t,e,a){switch(a=t[a],a===void 0?t.push(e):a!==e&&(e.then(Tr,Tr),e=a),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,L0(t),t;default:if(typeof e.status=="string")e.then(Tr,Tr);else{if(t=Ae,t!==null&&100<t.shellSuspendCounter)throw Error(M(482));t=e,t.status="pending",t.then(function(r){if(e.status==="pending"){var n=e;n.status="fulfilled",n.value=r}},function(r){if(e.status==="pending"){var n=e;n.status="rejected",n.reason=r}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,L0(t),t}throw _o=e,ns}}function yo(t){try{var e=t._init;return e(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(_o=a,ns):a}}var _o=null;function w0(){if(_o===null)throw Error(M(459));var t=_o;return _o=null,t}function L0(t){if(t===ns||t===Vd)throw Error(M(483))}var qi=null,zl=0;function Pc(t){var e=zl;return zl+=1,qi===null&&(qi=[]),p_(qi,t,e)}function pl(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Hc(t,e){throw e.$$typeof===IT?Error(M(525)):(t=Object.prototype.toString.call(e),Error(M(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function h_(t){function e(f,m){if(t){var v=f.deletions;v===null?(f.deletions=[m],f.flags|=16):v.push(m)}}function a(f,m){if(!t)return null;for(;m!==null;)e(f,m),m=m.sibling;return null}function r(f){for(var m=new Map;f!==null;)f.key!==null?m.set(f.key,f):m.set(f.index,f),f=f.sibling;return m}function n(f,m){return f=Mr(f,m),f.index=0,f.sibling=null,f}function o(f,m,v){return f.index=v,t?(v=f.alternate,v!==null?(v=v.index,v<m?(f.flags|=67108866,m):v):(f.flags|=67108866,m)):(f.flags|=1048576,m)}function i(f){return t&&f.alternate===null&&(f.flags|=67108866),f}function s(f,m,v,y){return m===null||m.tag!==6?(m=dm(v,f.mode,y),m.return=f,m):(m=n(m,v),m.return=f,m)}function l(f,m,v,y){var _=v.type;return _===Li?c(f,m,v.props.children,y,v.key):m!==null&&(m.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===gn&&yo(_)===m.type)?(m=n(m,v.props),pl(m,v),m.return=f,m):(m=Kc(v.type,v.key,v.props,null,f.mode,y),pl(m,v),m.return=f,m)}function u(f,m,v,y){return m===null||m.tag!==4||m.stateNode.containerInfo!==v.containerInfo||m.stateNode.implementation!==v.implementation?(m=fm(v,f.mode,y),m.return=f,m):(m=n(m,v.children||[]),m.return=f,m)}function c(f,m,v,y,_){return m===null||m.tag!==7?(m=So(v,f.mode,y,_),m.return=f,m):(m=n(m,v),m.return=f,m)}function d(f,m,v){if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return m=dm(""+m,f.mode,v),m.return=f,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Ec:return v=Kc(m.type,m.key,m.props,null,f.mode,v),pl(v,m),v.return=f,v;case yl:return m=fm(m,f.mode,v),m.return=f,m;case gn:return m=yo(m),d(f,m,v)}if(xl(m)||dl(m))return m=So(m,f.mode,v,null),m.return=f,m;if(typeof m.then=="function")return d(f,Pc(m),v);if(m.$$typeof===Er)return d(f,Nc(f,m),v);Hc(f,m)}return null}function p(f,m,v,y){var _=m!==null?m.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return _!==null?null:s(f,m,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ec:return v.key===_?l(f,m,v,y):null;case yl:return v.key===_?u(f,m,v,y):null;case gn:return v=yo(v),p(f,m,v,y)}if(xl(v)||dl(v))return _!==null?null:c(f,m,v,y,null);if(typeof v.then=="function")return p(f,m,Pc(v),y);if(v.$$typeof===Er)return p(f,m,Nc(f,v),y);Hc(f,v)}return null}function g(f,m,v,y,_){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return f=f.get(v)||null,s(m,f,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ec:return f=f.get(y.key===null?v:y.key)||null,l(m,f,y,_);case yl:return f=f.get(y.key===null?v:y.key)||null,u(m,f,y,_);case gn:return y=yo(y),g(f,m,v,y,_)}if(xl(y)||dl(y))return f=f.get(v)||null,c(m,f,y,_,null);if(typeof y.then=="function")return g(f,m,v,Pc(y),_);if(y.$$typeof===Er)return g(f,m,v,Nc(m,y),_);Hc(m,y)}return null}function S(f,m,v,y){for(var _=null,w=null,C=m,A=m=0,E=null;C!==null&&A<v.length;A++){C.index>A?(E=C,C=null):E=C.sibling;var L=p(f,C,v[A],y);if(L===null){C===null&&(C=E);break}t&&C&&L.alternate===null&&e(f,C),m=o(L,m,A),w===null?_=L:w.sibling=L,w=L,C=E}if(A===v.length)return a(f,C),he&&Ar(f,A),_;if(C===null){for(;A<v.length;A++)C=d(f,v[A],y),C!==null&&(m=o(C,m,A),w===null?_=C:w.sibling=C,w=C);return he&&Ar(f,A),_}for(C=r(C);A<v.length;A++)E=g(C,f,A,v[A],y),E!==null&&(t&&E.alternate!==null&&C.delete(E.key===null?A:E.key),m=o(E,m,A),w===null?_=E:w.sibling=E,w=E);return t&&C.forEach(function(k){return e(f,k)}),he&&Ar(f,A),_}function b(f,m,v,y){if(v==null)throw Error(M(151));for(var _=null,w=null,C=m,A=m=0,E=null,L=v.next();C!==null&&!L.done;A++,L=v.next()){C.index>A?(E=C,C=null):E=C.sibling;var k=p(f,C,L.value,y);if(k===null){C===null&&(C=E);break}t&&C&&k.alternate===null&&e(f,C),m=o(k,m,A),w===null?_=k:w.sibling=k,w=k,C=E}if(L.done)return a(f,C),he&&Ar(f,A),_;if(C===null){for(;!L.done;A++,L=v.next())L=d(f,L.value,y),L!==null&&(m=o(L,m,A),w===null?_=L:w.sibling=L,w=L);return he&&Ar(f,A),_}for(C=r(C);!L.done;A++,L=v.next())L=g(C,f,A,L.value,y),L!==null&&(t&&L.alternate!==null&&C.delete(L.key===null?A:L.key),m=o(L,m,A),w===null?_=L:w.sibling=L,w=L);return t&&C.forEach(function(D){return e(f,D)}),he&&Ar(f,A),_}function x(f,m,v,y){if(typeof v=="object"&&v!==null&&v.type===Li&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Ec:e:{for(var _=v.key;m!==null;){if(m.key===_){if(_=v.type,_===Li){if(m.tag===7){a(f,m.sibling),y=n(m,v.props.children),y.return=f,f=y;break e}}else if(m.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===gn&&yo(_)===m.type){a(f,m.sibling),y=n(m,v.props),pl(y,v),y.return=f,f=y;break e}a(f,m);break}else e(f,m);m=m.sibling}v.type===Li?(y=So(v.props.children,f.mode,y,v.key),y.return=f,f=y):(y=Kc(v.type,v.key,v.props,null,f.mode,y),pl(y,v),y.return=f,f=y)}return i(f);case yl:e:{for(_=v.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===v.containerInfo&&m.stateNode.implementation===v.implementation){a(f,m.sibling),y=n(m,v.children||[]),y.return=f,f=y;break e}else{a(f,m);break}else e(f,m);m=m.sibling}y=fm(v,f.mode,y),y.return=f,f=y}return i(f);case gn:return v=yo(v),x(f,m,v,y)}if(xl(v))return S(f,m,v,y);if(dl(v)){if(_=dl(v),typeof _!="function")throw Error(M(150));return v=_.call(v),b(f,m,v,y)}if(typeof v.then=="function")return x(f,m,Pc(v),y);if(v.$$typeof===Er)return x(f,m,Nc(f,v),y);Hc(f,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,m!==null&&m.tag===6?(a(f,m.sibling),y=n(m,v),y.return=f,f=y):(a(f,m),y=dm(v,f.mode,y),y.return=f,f=y),i(f)):a(f,m)}return function(f,m,v,y){try{zl=0;var _=x(f,m,v,y);return qi=null,_}catch(C){if(C===ns||C===Vd)throw C;var w=na(29,C,null,f.mode);return w.lanes=y,w.return=f,w}}}var Ao=h_(!0),m_=h_(!1),vn=!1;function Zg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tg(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function En(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Tn(t,e,a){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(ye&2)!==0){var n=r.pending;return n===null?e.next=e:(e.next=n.next,n.next=e),r.pending=e,e=hd(t),i_(t,null,a),e}return zd(t,r,e,a),hd(t)}function Al(t,e,a){if(e=e.updateQueue,e!==null&&(e=e.shared,(a&4194048)!==0)){var r=e.lanes;r&=t.pendingLanes,a|=r,e.lanes=a,DC(t,a)}}function hm(t,e){var a=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var n=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var i={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?n=o=i:o=o.next=i,a=a.next}while(a!==null);o===null?n=o=e:o=o.next=e}else n=o=e;a={baseState:r.baseState,firstBaseUpdate:n,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=e:t.next=e,a.lastBaseUpdate=e}var ag=!1;function kl(){if(ag){var t=Ui;if(t!==null)throw t}}function El(t,e,a,r){ag=!1;var n=t.updateQueue;vn=!1;var o=n.firstBaseUpdate,i=n.lastBaseUpdate,s=n.shared.pending;if(s!==null){n.shared.pending=null;var l=s,u=l.next;l.next=null,i===null?o=u:i.next=u,i=l;var c=t.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==i&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=n.baseState;i=0,c=u=l=null,s=o;do{var p=s.lane&-536870913,g=p!==s.lane;if(g?(pe&p)===p:(r&p)===p){p!==0&&p===Wi&&(ag=!0),c!==null&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var S=t,b=s;p=e;var x=a;switch(b.tag){case 1:if(S=b.payload,typeof S=="function"){d=S.call(x,d,p);break e}d=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=b.payload,p=typeof S=="function"?S.call(x,d,p):S,p==null)break e;d=Pe({},d,p);break e;case 2:vn=!0}}p=s.callback,p!==null&&(t.flags|=64,g&&(t.flags|=8192),g=n.callbacks,g===null?n.callbacks=[p]:g.push(p))}else g={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=g,l=d):c=c.next=g,i|=p;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;g=s,s=g.next,g.next=null,n.lastBaseUpdate=g,n.shared.pending=null}}while(!0);c===null&&(l=d),n.baseState=l,n.firstBaseUpdate=u,n.lastBaseUpdate=c,o===null&&(n.shared.lanes=0),Hn|=i,t.lanes=i,t.memoizedState=d}}function g_(t,e){if(typeof t!="function")throw Error(M(191,t));t.call(e)}function v_(t,e){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)g_(a[t],e)}var Zi=lr(null),yd=lr(0);function I0(t,e){t=Hr,Re(yd,t),Re(Zi,e),Hr=t|e.baseLanes}function rg(){Re(yd,Hr),Re(Zi,Zi.current)}function Xg(){Hr=yd.current,ht(Zi),ht(yd)}var da=lr(null),Aa=null;function xn(t){var e=t.alternate;Re(Ke,Ke.current&1),Re(da,t),Aa===null&&(e===null||Zi.current!==null||e.memoizedState!==null)&&(Aa=t)}function ng(t){Re(Ke,Ke.current),Re(da,t),Aa===null&&(Aa=t)}function y_(t){t.tag===22?(Re(Ke,Ke.current),Re(da,t),Aa===null&&(Aa=t)):bn(t)}function bn(){Re(Ke,Ke.current),Re(da,da.current)}function ra(t){ht(da),Aa===t&&(Aa=null),ht(Ke)}var Ke=lr(0);function xd(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||_g(a)||wg(a)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Fr=0,ie=null,Le=null,et=null,bd=!1,zi=!1,ko=!1,Sd=0,Vl=0,Vi=null,qR=0;function Ze(){throw Error(M(321))}function Yg(t,e){if(e===null)return!1;for(var a=0;a<e.length&&a<t.length;a++)if(!ca(t[a],e[a]))return!1;return!0}function Kg(t,e,a,r,n,o){return Fr=o,ie=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ee.H=t===null||t.memoizedState===null?X_:lv,ko=!1,o=a(r,n),ko=!1,zi&&(o=b_(e,a,r,n)),x_(t),o}function x_(t){ee.H=$l;var e=Le!==null&&Le.next!==null;if(Fr=0,et=Le=ie=null,bd=!1,Vl=0,Vi=null,e)throw Error(M(300));t===null||rt||(t=t.dependencies,t!==null&&gd(t)&&(rt=!0))}function b_(t,e,a,r){ie=t;var n=0;do{if(zi&&(Vi=null),Vl=0,zi=!1,25<=n)throw Error(M(301));if(n+=1,et=Le=null,t.updateQueue!=null){var o=t.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ee.H=Y_,o=e(a,r)}while(zi);return o}function zR(){var t=ee.H,e=t.useState()[0];return e=typeof e.then=="function"?ru(e):e,t=t.useState()[0],(Le!==null?Le.memoizedState:null)!==t&&(ie.flags|=1024),e}function Qg(){var t=Sd!==0;return Sd=0,t}function Jg(t,e,a){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a}function ev(t){if(bd){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}bd=!1}Fr=0,et=Le=ie=null,zi=!1,Vl=Sd=0,Vi=null}function Bt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?ie.memoizedState=et=t:et=et.next=t,et}function Qe(){if(Le===null){var t=ie.alternate;t=t!==null?t.memoizedState:null}else t=Le.next;var e=et===null?ie.memoizedState:et.next;if(e!==null)et=e,Le=t;else{if(t===null)throw ie.alternate===null?Error(M(467)):Error(M(310));Le=t,t={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},et===null?ie.memoizedState=et=t:et=et.next=t}return et}function $d(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ru(t){var e=Vl;return Vl+=1,Vi===null&&(Vi=[]),t=p_(Vi,t,e),e=ie,(et===null?e.memoizedState:et.next)===null&&(e=e.alternate,ee.H=e===null||e.memoizedState===null?X_:lv),t}function jd(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ru(t);if(t.$$typeof===Er)return bt(t)}throw Error(M(438,String(t)))}function tv(t){var e=null,a=ie.updateQueue;if(a!==null&&(e=a.memoCache),e==null){var r=ie.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(e={data:r.data.map(function(n){return n.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),a===null&&(a=$d(),ie.updateQueue=a),a.memoCache=e,a=e.data[e.index],a===void 0)for(a=e.data[e.index]=Array(t),r=0;r<t;r++)a[r]=AT;return e.index++,a}function Nr(t,e){return typeof e=="function"?e(t):e}function Jc(t){var e=Qe();return av(e,Le,t)}function av(t,e,a){var r=t.queue;if(r===null)throw Error(M(311));r.lastRenderedReducer=a;var n=t.baseQueue,o=r.pending;if(o!==null){if(n!==null){var i=n.next;n.next=o.next,o.next=i}e.baseQueue=n=o,r.pending=null}if(o=t.baseState,n===null)t.memoizedState=o;else{e=n.next;var s=i=null,l=null,u=e,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(pe&d)===d:(Fr&d)===d){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===Wi&&(c=!0);else if((Fr&p)===p){u=u.next,p===Wi&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=d,i=o):l=l.next=d,ie.lanes|=p,Hn|=p;d=u.action,ko&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else p={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=p,i=o):l=l.next=p,ie.lanes|=d,Hn|=d;u=u.next}while(u!==null&&u!==e);if(l===null?i=o:l.next=s,!ca(o,t.memoizedState)&&(rt=!0,c&&(a=Ui,a!==null)))throw a;t.memoizedState=o,t.baseState=i,t.baseQueue=l,r.lastRenderedState=o}return n===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function mm(t){var e=Qe(),a=e.queue;if(a===null)throw Error(M(311));a.lastRenderedReducer=t;var r=a.dispatch,n=a.pending,o=e.memoizedState;if(n!==null){a.pending=null;var i=n=n.next;do o=t(o,i.action),i=i.next;while(i!==n);ca(o,e.memoizedState)||(rt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),a.lastRenderedState=o}return[o,r]}function S_(t,e,a){var r=ie,n=Qe(),o=he;if(o){if(a===void 0)throw Error(M(407));a=a()}else a=e();var i=!ca((Le||n).memoizedState,a);if(i&&(n.memoizedState=a,rt=!0),n=n.queue,rv(w_.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||et!==null&&et.memoizedState.tag&1){if(r.flags|=2048,Xi(9,{destroy:void 0},__.bind(null,r,n,a,e),null),Ae===null)throw Error(M(349));o||(Fr&127)!==0||C_(r,e,a)}return a}function C_(t,e,a){t.flags|=16384,t={getSnapshot:e,value:a},e=ie.updateQueue,e===null?(e=$d(),ie.updateQueue=e,e.stores=[t]):(a=e.stores,a===null?e.stores=[t]:a.push(t))}function __(t,e,a,r){e.value=a,e.getSnapshot=r,L_(e)&&I_(t)}function w_(t,e,a){return a(function(){L_(e)&&I_(t)})}function L_(t){var e=t.getSnapshot;t=t.value;try{var a=e();return!ca(t,a)}catch{return!0}}function I_(t){var e=Do(t,2);e!==null&&Gt(e,t,2)}function og(t){var e=Bt();if(typeof t=="function"){var a=t;if(t=a(),ko){Cn(!0);try{a()}finally{Cn(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:t},e}function A_(t,e,a,r){return t.baseState=a,av(t,Le,typeof r=="function"?r:Nr)}function VR(t,e,a,r,n){if(Wd(t))throw Error(M(485));if(t=e.action,t!==null){var o={payload:n,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){o.listeners.push(i)}};ee.T!==null?a(!0):o.isTransition=!1,r(o),a=e.pending,a===null?(o.next=e.pending=o,k_(e,o)):(o.next=a.next,e.pending=a.next=o)}}function k_(t,e){var a=e.action,r=e.payload,n=t.state;if(e.isTransition){var o=ee.T,i={};ee.T=i;try{var s=a(n,r),l=ee.S;l!==null&&l(i,s),A0(t,e,s)}catch(u){ig(t,e,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),ee.T=o}}else try{o=a(n,r),A0(t,e,o)}catch(u){ig(t,e,u)}}function A0(t,e,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){k0(t,e,r)},function(r){return ig(t,e,r)}):k0(t,e,a)}function k0(t,e,a){e.status="fulfilled",e.value=a,E_(e),t.state=a,e=t.pending,e!==null&&(a=e.next,a===e?t.pending=null:(a=a.next,e.next=a,k_(t,a)))}function ig(t,e,a){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do e.status="rejected",e.reason=a,E_(e),e=e.next;while(e!==r)}t.action=null}function E_(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function T_(t,e){return e}function E0(t,e){if(he){var a=Ae.formState;if(a!==null){e:{var r=ie;if(he){if(Ne){t:{for(var n=Ne,o=Ia;n.nodeType!==8;){if(!o){n=null;break t}if(n=ka(n.nextSibling),n===null){n=null;break t}}o=n.data,n=o==="F!"||o==="F"?n:null}if(n){Ne=ka(n.nextSibling),r=n.data==="F!";break e}}Nn(r)}r=!1}r&&(e=a[0])}}return a=Bt(),a.memoizedState=a.baseState=e,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:T_,lastRenderedState:e},a.queue=r,a=G_.bind(null,ie,r),r.dispatch=a,r=og(!1),o=sv.bind(null,ie,!1,r.queue),r=Bt(),n={state:e,dispatch:null,action:t,pending:null},r.queue=n,a=VR.bind(null,ie,n,o,a),n.dispatch=a,r.memoizedState=t,[e,a,!1]}function T0(t){var e=Qe();return R_(e,Le,t)}function R_(t,e,a){if(e=av(t,e,T_)[0],t=Jc(Nr)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var r=ru(e)}catch(i){throw i===ns?Vd:i}else r=e;e=Qe();var n=e.queue,o=n.dispatch;return a!==e.memoizedState&&(ie.flags|=2048,Xi(9,{destroy:void 0},$R.bind(null,n,a),null)),[r,o,t]}function $R(t,e){t.action=e}function R0(t){var e=Qe(),a=Le;if(a!==null)return R_(e,a,t);Qe(),e=e.memoizedState,a=Qe();var r=a.queue.dispatch;return a.memoizedState=t,[e,r,!1]}function Xi(t,e,a,r){return t={tag:t,create:a,deps:r,inst:e,next:null},e=ie.updateQueue,e===null&&(e=$d(),ie.updateQueue=e),a=e.lastEffect,a===null?e.lastEffect=t.next=t:(r=a.next,a.next=t,t.next=r,e.lastEffect=t),t}function M_(){return Qe().memoizedState}function ed(t,e,a,r){var n=Bt();ie.flags|=t,n.memoizedState=Xi(1|e,{destroy:void 0},a,r===void 0?null:r)}function Gd(t,e,a,r){var n=Qe();r=r===void 0?null:r;var o=n.memoizedState.inst;Le!==null&&r!==null&&Yg(r,Le.memoizedState.deps)?n.memoizedState=Xi(e,o,a,r):(ie.flags|=t,n.memoizedState=Xi(1|e,o,a,r))}function M0(t,e){ed(8390656,8,t,e)}function rv(t,e){Gd(2048,8,t,e)}function jR(t){ie.flags|=4;var e=ie.updateQueue;if(e===null)e=$d(),ie.updateQueue=e,e.events=[t];else{var a=e.events;a===null?e.events=[t]:a.push(t)}}function D_(t){var e=Qe().memoizedState;return jR({ref:e,nextImpl:t}),function(){if((ye&2)!==0)throw Error(M(440));return e.impl.apply(void 0,arguments)}}function O_(t,e){return Gd(4,2,t,e)}function B_(t,e){return Gd(4,4,t,e)}function F_(t,e){if(typeof e=="function"){t=t();var a=e(t);return function(){typeof a=="function"?a():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function N_(t,e,a){a=a!=null?a.concat([t]):null,Gd(4,4,F_.bind(null,e,t),a)}function nv(){}function P_(t,e){var a=Qe();e=e===void 0?null:e;var r=a.memoizedState;return e!==null&&Yg(e,r[1])?r[0]:(a.memoizedState=[t,e],t)}function H_(t,e){var a=Qe();e=e===void 0?null:e;var r=a.memoizedState;if(e!==null&&Yg(e,r[1]))return r[0];if(r=t(),ko){Cn(!0);try{t()}finally{Cn(!1)}}return a.memoizedState=[r,e],r}function ov(t,e,a){return a===void 0||(Fr&1073741824)!==0&&(pe&261930)===0?t.memoizedState=e:(t.memoizedState=a,t=Aw(),ie.lanes|=t,Hn|=t,a)}function U_(t,e,a,r){return ca(a,e)?a:Zi.current!==null?(t=ov(t,a,r),ca(t,e)||(rt=!0),t):(Fr&42)===0||(Fr&1073741824)!==0&&(pe&261930)===0?(rt=!0,t.memoizedState=a):(t=Aw(),ie.lanes|=t,Hn|=t,e)}function q_(t,e,a,r,n){var o=xe.p;xe.p=o!==0&&8>o?o:8;var i=ee.T,s={};ee.T=s,sv(t,!1,e,a);try{var l=n(),u=ee.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=UR(l,r);Tl(t,e,c,ua(t))}else Tl(t,e,r,ua(t))}catch(d){Tl(t,e,{then:function(){},status:"rejected",reason:d},ua())}finally{xe.p=o,i!==null&&s.types!==null&&(i.types=s.types),ee.T=i}}function GR(){}function sg(t,e,a,r){if(t.tag!==5)throw Error(M(476));var n=z_(t).queue;q_(t,n,e,bo,a===null?GR:function(){return V_(t),a(r)})}function z_(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:bo,baseState:bo,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:bo},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function V_(t){var e=z_(t);e.next===null&&(e=t.alternate.memoizedState),Tl(t,e.next.queue,{},ua())}function iv(){return bt(Wl)}function $_(){return Qe().memoizedState}function j_(){return Qe().memoizedState}function WR(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=ua();t=En(a);var r=Tn(e,t,a);r!==null&&(Gt(r,e,a),Al(r,e,a)),e={cache:jg()},t.payload=e;return}e=e.return}}function ZR(t,e,a){var r=ua();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Wd(t)?W_(e,a):(a=qg(t,e,a,r),a!==null&&(Gt(a,t,r),Z_(a,e,r)))}function G_(t,e,a){var r=ua();Tl(t,e,a,r)}function Tl(t,e,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Wd(t))W_(e,n);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var i=e.lastRenderedState,s=o(i,a);if(n.hasEagerState=!0,n.eagerState=s,ca(s,i))return zd(t,e,n,0),Ae===null&&qd(),!1}catch{}if(a=qg(t,e,n,r),a!==null)return Gt(a,t,r),Z_(a,e,r),!0}return!1}function sv(t,e,a,r){if(r={lane:2,revertLane:gv(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Wd(t)){if(e)throw Error(M(479))}else e=qg(t,a,r,2),e!==null&&Gt(e,t,2)}function Wd(t){var e=t.alternate;return t===ie||e!==null&&e===ie}function W_(t,e){zi=bd=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function Z_(t,e,a){if((a&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,a|=r,e.lanes=a,DC(t,a)}}var $l={readContext:bt,use:jd,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useLayoutEffect:Ze,useInsertionEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useSyncExternalStore:Ze,useId:Ze,useHostTransitionStatus:Ze,useFormState:Ze,useActionState:Ze,useOptimistic:Ze,useMemoCache:Ze,useCacheRefresh:Ze};$l.useEffectEvent=Ze;var X_={readContext:bt,use:jd,useCallback:function(t,e){return Bt().memoizedState=[t,e===void 0?null:e],t},useContext:bt,useEffect:M0,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,ed(4194308,4,F_.bind(null,e,t),a)},useLayoutEffect:function(t,e){return ed(4194308,4,t,e)},useInsertionEffect:function(t,e){ed(4,2,t,e)},useMemo:function(t,e){var a=Bt();e=e===void 0?null:e;var r=t();if(ko){Cn(!0);try{t()}finally{Cn(!1)}}return a.memoizedState=[r,e],r},useReducer:function(t,e,a){var r=Bt();if(a!==void 0){var n=a(e);if(ko){Cn(!0);try{a(e)}finally{Cn(!1)}}}else n=e;return r.memoizedState=r.baseState=n,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},r.queue=t,t=t.dispatch=ZR.bind(null,ie,t),[r.memoizedState,t]},useRef:function(t){var e=Bt();return t={current:t},e.memoizedState=t},useState:function(t){t=og(t);var e=t.queue,a=G_.bind(null,ie,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:nv,useDeferredValue:function(t,e){var a=Bt();return ov(a,t,e)},useTransition:function(){var t=og(!1);return t=q_.bind(null,ie,t.queue,!0,!1),Bt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var r=ie,n=Bt();if(he){if(a===void 0)throw Error(M(407));a=a()}else{if(a=e(),Ae===null)throw Error(M(349));(pe&127)!==0||C_(r,e,a)}n.memoizedState=a;var o={value:a,getSnapshot:e};return n.queue=o,M0(w_.bind(null,r,o,t),[t]),r.flags|=2048,Xi(9,{destroy:void 0},__.bind(null,r,o,a,e),null),a},useId:function(){var t=Bt(),e=Ae.identifierPrefix;if(he){var a=or,r=nr;a=(r&~(1<<32-la(r)-1)).toString(32)+a,e="_"+e+"R_"+a,a=Sd++,0<a&&(e+="H"+a.toString(32)),e+="_"}else a=qR++,e="_"+e+"r_"+a.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:iv,useFormState:E0,useActionState:E0,useOptimistic:function(t){var e=Bt();e.memoizedState=e.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=a,e=sv.bind(null,ie,!0,a),a.dispatch=e,[t,e]},useMemoCache:tv,useCacheRefresh:function(){return Bt().memoizedState=WR.bind(null,ie)},useEffectEvent:function(t){var e=Bt(),a={impl:t};return e.memoizedState=a,function(){if((ye&2)!==0)throw Error(M(440));return a.impl.apply(void 0,arguments)}}},lv={readContext:bt,use:jd,useCallback:P_,useContext:bt,useEffect:rv,useImperativeHandle:N_,useInsertionEffect:O_,useLayoutEffect:B_,useMemo:H_,useReducer:Jc,useRef:M_,useState:function(){return Jc(Nr)},useDebugValue:nv,useDeferredValue:function(t,e){var a=Qe();return U_(a,Le.memoizedState,t,e)},useTransition:function(){var t=Jc(Nr)[0],e=Qe().memoizedState;return[typeof t=="boolean"?t:ru(t),e]},useSyncExternalStore:S_,useId:$_,useHostTransitionStatus:iv,useFormState:T0,useActionState:T0,useOptimistic:function(t,e){var a=Qe();return A_(a,Le,t,e)},useMemoCache:tv,useCacheRefresh:j_};lv.useEffectEvent=D_;var Y_={readContext:bt,use:jd,useCallback:P_,useContext:bt,useEffect:rv,useImperativeHandle:N_,useInsertionEffect:O_,useLayoutEffect:B_,useMemo:H_,useReducer:mm,useRef:M_,useState:function(){return mm(Nr)},useDebugValue:nv,useDeferredValue:function(t,e){var a=Qe();return Le===null?ov(a,t,e):U_(a,Le.memoizedState,t,e)},useTransition:function(){var t=mm(Nr)[0],e=Qe().memoizedState;return[typeof t=="boolean"?t:ru(t),e]},useSyncExternalStore:S_,useId:$_,useHostTransitionStatus:iv,useFormState:R0,useActionState:R0,useOptimistic:function(t,e){var a=Qe();return Le!==null?A_(a,Le,t,e):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:tv,useCacheRefresh:j_};Y_.useEffectEvent=D_;function gm(t,e,a,r){e=t.memoizedState,a=a(r,e),a=a==null?e:Pe({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var lg={enqueueSetState:function(t,e,a){t=t._reactInternals;var r=ua(),n=En(r);n.payload=e,a!=null&&(n.callback=a),e=Tn(t,n,r),e!==null&&(Gt(e,t,r),Al(e,t,r))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var r=ua(),n=En(r);n.tag=1,n.payload=e,a!=null&&(n.callback=a),e=Tn(t,n,r),e!==null&&(Gt(e,t,r),Al(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=ua(),r=En(a);r.tag=2,e!=null&&(r.callback=e),e=Tn(t,r,a),e!==null&&(Gt(e,t,a),Al(e,t,a))}};function D0(t,e,a,r,n,o,i){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,i):e.prototype&&e.prototype.isPureReactComponent?!Hl(a,r)||!Hl(n,o):!0}function O0(t,e,a,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(a,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(a,r),e.state!==t&&lg.enqueueReplaceState(e,e.state,null)}function Eo(t,e){var a=e;if("ref"in e){a={};for(var r in e)r!=="ref"&&(a[r]=e[r])}if(t=t.defaultProps){a===e&&(a=Pe({},a));for(var n in t)a[n]===void 0&&(a[n]=t[n])}return a}function K_(t){pd(t)}function Q_(t){console.error(t)}function J_(t){pd(t)}function Cd(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function B0(t,e,a){try{var r=t.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function ug(t,e,a){return a=En(a),a.tag=3,a.payload={element:null},a.callback=function(){Cd(t,e)},a}function ew(t){return t=En(t),t.tag=3,t}function tw(t,e,a,r){var n=a.type.getDerivedStateFromError;if(typeof n=="function"){var o=r.value;t.payload=function(){return n(o)},t.callback=function(){B0(e,a,r)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(t.callback=function(){B0(e,a,r),typeof n!="function"&&(Rn===null?Rn=new Set([this]):Rn.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function XR(t,e,a,r,n){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(e=a.alternate,e!==null&&rs(e,a,n,!0),a=da.current,a!==null){switch(a.tag){case 31:case 13:return Aa===null?Ad():a.alternate===null&&Xe===0&&(Xe=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===vd?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([r]):e.add(r),Am(t,r,n)),!1;case 22:return a.flags|=65536,r===vd?a.flags|=16384:(e=a.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=e):(a=e.retryQueue,a===null?e.retryQueue=new Set([r]):a.add(r)),Am(t,r,n)),!1}throw Error(M(435,a.tag))}return Am(t,r,n),Ad(),!1}if(he)return e=da.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=n,r!==Ym&&(t=Error(M(422),{cause:r}),ql(La(t,a)))):(r!==Ym&&(e=Error(M(423),{cause:r}),ql(La(e,a))),t=t.current.alternate,t.flags|=65536,n&=-n,t.lanes|=n,r=La(r,a),n=ug(t.stateNode,r,n),hm(t,n),Xe!==4&&(Xe=2)),!1;var o=Error(M(520),{cause:r});if(o=La(o,a),Dl===null?Dl=[o]:Dl.push(o),Xe!==4&&(Xe=2),e===null)return!0;r=La(r,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=n&-n,a.lanes|=t,t=ug(a.stateNode,r,t),hm(a,t),!1;case 1:if(e=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Rn===null||!Rn.has(o))))return a.flags|=65536,n&=-n,a.lanes|=n,n=ew(n),tw(n,t,a,r),hm(a,n),!1}a=a.return}while(a!==null);return!1}var uv=Error(M(461)),rt=!1;function vt(t,e,a,r){e.child=t===null?m_(e,null,a,r):Ao(e,t.child,a,r)}function F0(t,e,a,r,n){a=a.render;var o=e.ref;if("ref"in r){var i={};for(var s in r)s!=="ref"&&(i[s]=r[s])}else i=r;return Io(e),r=Kg(t,e,a,i,o,n),s=Qg(),t!==null&&!rt?(Jg(t,e,n),Pr(t,e,n)):(he&&s&&Vg(e),e.flags|=1,vt(t,e,r,n),e.child)}function N0(t,e,a,r,n){if(t===null){var o=a.type;return typeof o=="function"&&!zg(o)&&o.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=o,aw(t,e,o,r,n)):(t=Kc(a.type,null,r,e,e.mode,n),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!cv(t,n)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:Hl,a(i,r)&&t.ref===e.ref)return Pr(t,e,n)}return e.flags|=1,t=Mr(o,r),t.ref=e.ref,t.return=e,e.child=t}function aw(t,e,a,r,n){if(t!==null){var o=t.memoizedProps;if(Hl(o,r)&&t.ref===e.ref)if(rt=!1,e.pendingProps=r=o,cv(t,n))(t.flags&131072)!==0&&(rt=!0);else return e.lanes=t.lanes,Pr(t,e,n)}return cg(t,e,a,r,n)}function rw(t,e,a,r){var n=r.children,o=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((e.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,t!==null){for(r=e.child=t.child,n=0;r!==null;)n=n|r.lanes|r.childLanes,r=r.sibling;r=n&~o}else r=0,e.child=null;return P0(t,e,o,a,r)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Qc(e,o!==null?o.cachePool:null),o!==null?I0(e,o):rg(),y_(e);else return r=e.lanes=536870912,P0(t,e,o!==null?o.baseLanes|a:a,a,r)}else o!==null?(Qc(e,o.cachePool),I0(e,o),bn(e),e.memoizedState=null):(t!==null&&Qc(e,null),rg(),bn(e));return vt(t,e,n,a),e.child}function Sl(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function P0(t,e,a,r,n){var o=Gg();return o=o===null?null:{parent:at._currentValue,pool:o},e.memoizedState={baseLanes:a,cachePool:o},t!==null&&Qc(e,null),rg(),y_(e),t!==null&&rs(t,e,r,!0),e.childLanes=n,null}function td(t,e){return e=_d({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function H0(t,e,a){return Ao(e,t.child,null,a),t=td(e,e.pendingProps),t.flags|=2,ra(e),e.memoizedState=null,t}function YR(t,e,a){var r=e.pendingProps,n=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(he){if(r.mode==="hidden")return t=td(e,r),e.lanes=536870912,Sl(null,t);if(ng(e),(t=Ne)?(t=Xw(t,Ia),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Fn!==null?{id:nr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},a=l_(t),a.return=e,e.child=a,xt=e,Ne=null)):t=null,t===null)throw Nn(e);return e.lanes=536870912,null}return td(e,r)}var o=t.memoizedState;if(o!==null){var i=o.dehydrated;if(ng(e),n)if(e.flags&256)e.flags&=-257,e=H0(t,e,a);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(M(558));else if(rt||rs(t,e,a,!1),n=(a&t.childLanes)!==0,rt||n){if(r=Ae,r!==null&&(i=OC(r,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,Do(t,i),Gt(r,t,i),uv;Ad(),e=H0(t,e,a)}else t=o.treeContext,Ne=ka(i.nextSibling),xt=e,he=!0,kn=null,Ia=!1,t!==null&&c_(e,t),e=td(e,r),e.flags|=4096;return e}return t=Mr(t.child,{mode:r.mode,children:r.children}),t.ref=e.ref,e.child=t,t.return=e,t}function ad(t,e){var a=e.ref;if(a===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(M(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function cg(t,e,a,r,n){return Io(e),a=Kg(t,e,a,r,void 0,n),r=Qg(),t!==null&&!rt?(Jg(t,e,n),Pr(t,e,n)):(he&&r&&Vg(e),e.flags|=1,vt(t,e,a,n),e.child)}function U0(t,e,a,r,n,o){return Io(e),e.updateQueue=null,a=b_(e,r,a,n),x_(t),r=Qg(),t!==null&&!rt?(Jg(t,e,o),Pr(t,e,o)):(he&&r&&Vg(e),e.flags|=1,vt(t,e,a,o),e.child)}function q0(t,e,a,r,n){if(Io(e),e.stateNode===null){var o=Di,i=a.contextType;typeof i=="object"&&i!==null&&(o=bt(i)),o=new a(r,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=lg,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=r,o.state=e.memoizedState,o.refs={},Zg(e),i=a.contextType,o.context=typeof i=="object"&&i!==null?bt(i):Di,o.state=e.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(gm(e,a,i,r),o.state=e.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(i=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),i!==o.state&&lg.enqueueReplaceState(o,o.state,null),El(e,r,o,n),kl(),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!0}else if(t===null){o=e.stateNode;var s=e.memoizedProps,l=Eo(a,s);o.props=l;var u=o.context,c=a.contextType;i=Di,typeof c=="object"&&c!==null&&(i=bt(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||u!==i)&&O0(e,o,r,i),vn=!1;var p=e.memoizedState;o.state=p,El(e,r,o,n),kl(),u=e.memoizedState,s||p!==u||vn?(typeof d=="function"&&(gm(e,a,d,r),u=e.memoizedState),(l=vn||D0(e,a,l,r,p,u,i))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=u),o.props=r,o.state=u,o.context=i,r=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,tg(t,e),i=e.memoizedProps,c=Eo(a,i),o.props=c,d=e.pendingProps,p=o.context,u=a.contextType,l=Di,typeof u=="object"&&u!==null&&(l=bt(u)),s=a.getDerivedStateFromProps,(u=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||p!==l)&&O0(e,o,r,l),vn=!1,p=e.memoizedState,o.state=p,El(e,r,o,n),kl();var g=e.memoizedState;i!==d||p!==g||vn||t!==null&&t.dependencies!==null&&gd(t.dependencies)?(typeof s=="function"&&(gm(e,a,s,r),g=e.memoizedState),(c=vn||D0(e,a,c,r,p,g,l)||t!==null&&t.dependencies!==null&&gd(t.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),o.props=r,o.state=g,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),r=!1)}return o=r,ad(t,e),r=(e.flags&128)!==0,o||r?(o=e.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:o.render(),e.flags|=1,t!==null&&r?(e.child=Ao(e,t.child,null,n),e.child=Ao(e,null,a,n)):vt(t,e,a,n),e.memoizedState=o.state,t=e.child):t=Pr(t,e,n),t}function z0(t,e,a,r){return Lo(),e.flags|=256,vt(t,e,a,r),e.child}var vm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ym(t){return{baseLanes:t,cachePool:f_()}}function xm(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=oa),t}function nw(t,e,a){var r=e.pendingProps,n=!1,o=(e.flags&128)!==0,i;if((i=o)||(i=t!==null&&t.memoizedState===null?!1:(Ke.current&2)!==0),i&&(n=!0,e.flags&=-129),i=(e.flags&32)!==0,e.flags&=-33,t===null){if(he){if(n?xn(e):bn(e),(t=Ne)?(t=Xw(t,Ia),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Fn!==null?{id:nr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},a=l_(t),a.return=e,e.child=a,xt=e,Ne=null)):t=null,t===null)throw Nn(e);return wg(t)?e.lanes=32:e.lanes=536870912,null}var s=r.children;return r=r.fallback,n?(bn(e),n=e.mode,s=_d({mode:"hidden",children:s},n),r=So(r,n,a,null),s.return=e,r.return=e,s.sibling=r,e.child=s,r=e.child,r.memoizedState=ym(a),r.childLanes=xm(t,i,a),e.memoizedState=vm,Sl(null,r)):(xn(e),dg(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(xn(e),e.flags&=-257,e=bm(t,e,a)):e.memoizedState!==null?(bn(e),e.child=t.child,e.flags|=128,e=null):(bn(e),s=r.fallback,n=e.mode,r=_d({mode:"visible",children:r.children},n),s=So(s,n,a,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,Ao(e,t.child,null,a),r=e.child,r.memoizedState=ym(a),r.childLanes=xm(t,i,a),e.memoizedState=vm,e=Sl(null,r));else if(xn(e),wg(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var u=i.dgst;i=u,r=Error(M(419)),r.stack="",r.digest=i,ql({value:r,source:null,stack:null}),e=bm(t,e,a)}else if(rt||rs(t,e,a,!1),i=(a&t.childLanes)!==0,rt||i){if(i=Ae,i!==null&&(r=OC(i,a),r!==0&&r!==l.retryLane))throw l.retryLane=r,Do(t,r),Gt(i,t,r),uv;_g(s)||Ad(),e=bm(t,e,a)}else _g(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Ne=ka(s.nextSibling),xt=e,he=!0,kn=null,Ia=!1,t!==null&&c_(e,t),e=dg(e,r.children),e.flags|=4096);return e}return n?(bn(e),s=r.fallback,n=e.mode,l=t.child,u=l.sibling,r=Mr(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u!==null?s=Mr(u,s):(s=So(s,n,a,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,Sl(null,r),r=e.child,s=t.child.memoizedState,s===null?s=ym(a):(n=s.cachePool,n!==null?(l=at._currentValue,n=n.parent!==l?{parent:l,pool:l}:n):n=f_(),s={baseLanes:s.baseLanes|a,cachePool:n}),r.memoizedState=s,r.childLanes=xm(t,i,a),e.memoizedState=vm,Sl(t.child,r)):(xn(e),a=t.child,t=a.sibling,a=Mr(a,{mode:"visible",children:r.children}),a.return=e,a.sibling=null,t!==null&&(i=e.deletions,i===null?(e.deletions=[t],e.flags|=16):i.push(t)),e.child=a,e.memoizedState=null,a)}function dg(t,e){return e=_d({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function _d(t,e){return t=na(22,t,null,e),t.lanes=0,t}function bm(t,e,a){return Ao(e,t.child,null,a),t=dg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function V0(t,e,a){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Qm(t.return,e,a)}function Sm(t,e,a,r,n,o){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:n,treeForkCount:o}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=a,i.tailMode=n,i.treeForkCount=o)}function ow(t,e,a){var r=e.pendingProps,n=r.revealOrder,o=r.tail;r=r.children;var i=Ke.current,s=(i&2)!==0;if(s?(i=i&1|2,e.flags|=128):i&=1,Re(Ke,i),vt(t,e,r,a),r=he?Ul:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&V0(t,a,e);else if(t.tag===19)V0(t,a,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(n){case"forwards":for(a=e.child,n=null;a!==null;)t=a.alternate,t!==null&&xd(t)===null&&(n=a),a=a.sibling;a=n,a===null?(n=e.child,e.child=null):(n=a.sibling,a.sibling=null),Sm(e,!1,n,a,o,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,n=e.child,e.child=null;n!==null;){if(t=n.alternate,t!==null&&xd(t)===null){e.child=n;break}t=n.sibling,n.sibling=a,a=n,n=t}Sm(e,!0,a,null,o,r);break;case"together":Sm(e,!1,null,null,void 0,r);break;default:e.memoizedState=null}return e.child}function Pr(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),Hn|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(rs(t,e,a,!1),(a&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(M(153));if(e.child!==null){for(t=e.child,a=Mr(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=Mr(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function cv(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&gd(t)))}function KR(t,e,a){switch(e.tag){case 3:ud(e,e.stateNode.containerInfo),yn(e,at,t.memoizedState.cache),Lo();break;case 27:case 5:Hm(e);break;case 4:ud(e,e.stateNode.containerInfo);break;case 10:yn(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,ng(e),null;break;case 13:var r=e.memoizedState;if(r!==null)return r.dehydrated!==null?(xn(e),e.flags|=128,null):(a&e.child.childLanes)!==0?nw(t,e,a):(xn(e),t=Pr(t,e,a),t!==null?t.sibling:null);xn(e);break;case 19:var n=(t.flags&128)!==0;if(r=(a&e.childLanes)!==0,r||(rs(t,e,a,!1),r=(a&e.childLanes)!==0),n){if(r)return ow(t,e,a);e.flags|=128}if(n=e.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Re(Ke,Ke.current),r)break;return null;case 22:return e.lanes=0,rw(t,e,a,e.pendingProps);case 24:yn(e,at,t.memoizedState.cache)}return Pr(t,e,a)}function iw(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)rt=!0;else{if(!cv(t,a)&&(e.flags&128)===0)return rt=!1,KR(t,e,a);rt=(t.flags&131072)!==0}else rt=!1,he&&(e.flags&1048576)!==0&&u_(e,Ul,e.index);switch(e.lanes=0,e.tag){case 16:e:{var r=e.pendingProps;if(t=yo(e.elementType),e.type=t,typeof t=="function")zg(t)?(r=Eo(t,r),e.tag=1,e=q0(null,e,t,r,a)):(e.tag=0,e=cg(null,e,t,r,a));else{if(t!=null){var n=t.$$typeof;if(n===kg){e.tag=11,e=F0(null,e,t,r,a);break e}else if(n===Eg){e.tag=14,e=N0(null,e,t,r,a);break e}}throw e=Nm(t)||t,Error(M(306,e,""))}}return e;case 0:return cg(t,e,e.type,e.pendingProps,a);case 1:return r=e.type,n=Eo(r,e.pendingProps),q0(t,e,r,n,a);case 3:e:{if(ud(e,e.stateNode.containerInfo),t===null)throw Error(M(387));r=e.pendingProps;var o=e.memoizedState;n=o.element,tg(t,e),El(e,r,null,a);var i=e.memoizedState;if(r=i.cache,yn(e,at,r),r!==o.cache&&Jm(e,[at],a,!0),kl(),r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){e=z0(t,e,r,a);break e}else if(r!==n){n=La(Error(M(424)),e),ql(n),e=z0(t,e,r,a);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Ne=ka(t.firstChild),xt=e,he=!0,kn=null,Ia=!0,a=m_(e,null,r,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Lo(),r===n){e=Pr(t,e,a);break e}vt(t,e,r,a)}e=e.child}return e;case 26:return ad(t,e),t===null?(a=dC(e.type,null,e.pendingProps,null))?e.memoizedState=a:he||(a=e.type,t=e.pendingProps,r=Rd(An.current).createElement(a),r[yt]=e,r[Wt]=t,St(r,a,t),pt(r),e.stateNode=r):e.memoizedState=dC(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Hm(e),t===null&&he&&(r=e.stateNode=Yw(e.type,e.pendingProps,An.current),xt=e,Ia=!0,n=Ne,qn(e.type)?(Lg=n,Ne=ka(r.firstChild)):Ne=n),vt(t,e,e.pendingProps.children,a),ad(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&he&&((n=r=Ne)&&(r=LM(r,e.type,e.pendingProps,Ia),r!==null?(e.stateNode=r,xt=e,Ne=ka(r.firstChild),Ia=!1,n=!0):n=!1),n||Nn(e)),Hm(e),n=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,r=o.children,Sg(n,o)?r=null:i!==null&&Sg(n,i)&&(e.flags|=32),e.memoizedState!==null&&(n=Kg(t,e,zR,null,null,a),Wl._currentValue=n),ad(t,e),vt(t,e,r,a),e.child;case 6:return t===null&&he&&((t=a=Ne)&&(a=IM(a,e.pendingProps,Ia),a!==null?(e.stateNode=a,xt=e,Ne=null,t=!0):t=!1),t||Nn(e)),null;case 13:return nw(t,e,a);case 4:return ud(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Ao(e,null,r,a):vt(t,e,r,a),e.child;case 11:return F0(t,e,e.type,e.pendingProps,a);case 7:return vt(t,e,e.pendingProps,a),e.child;case 8:return vt(t,e,e.pendingProps.children,a),e.child;case 12:return vt(t,e,e.pendingProps.children,a),e.child;case 10:return r=e.pendingProps,yn(e,e.type,r.value),vt(t,e,r.children,a),e.child;case 9:return n=e.type._context,r=e.pendingProps.children,Io(e),n=bt(n),r=r(n),e.flags|=1,vt(t,e,r,a),e.child;case 14:return N0(t,e,e.type,e.pendingProps,a);case 15:return aw(t,e,e.type,e.pendingProps,a);case 19:return ow(t,e,a);case 31:return YR(t,e,a);case 22:return rw(t,e,a,e.pendingProps);case 24:return Io(e),r=bt(at),t===null?(n=Gg(),n===null&&(n=Ae,o=jg(),n.pooledCache=o,o.refCount++,o!==null&&(n.pooledCacheLanes|=a),n=o),e.memoizedState={parent:r,cache:n},Zg(e),yn(e,at,n)):((t.lanes&a)!==0&&(tg(t,e),El(e,null,null,a),kl()),n=t.memoizedState,o=e.memoizedState,n.parent!==r?(n={parent:r,cache:r},e.memoizedState=n,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=n),yn(e,at,r)):(r=o.cache,yn(e,at,r),r!==n.cache&&Jm(e,[at],a,!0))),vt(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(M(156,e.tag))}function _r(t){t.flags|=4}function Cm(t,e,a,r,n){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(n&335544128)===n)if(t.stateNode.complete)t.flags|=8192;else if(Tw())t.flags|=8192;else throw _o=vd,Wg}else t.flags&=-16777217}function $0(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Jw(e))if(Tw())t.flags|=8192;else throw _o=vd,Wg}function Uc(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?RC():536870912,t.lanes|=e,Yi|=e)}function hl(t,e){if(!he)switch(t.tailMode){case"hidden":e=t.tail;for(var a=null;e!==null;)e.alternate!==null&&(a=e),e=e.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Fe(t){var e=t.alternate!==null&&t.alternate.child===t.child,a=0,r=0;if(e)for(var n=t.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags&65011712,r|=n.flags&65011712,n.return=t,n=n.sibling;else for(n=t.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags,r|=n.flags,n.return=t,n=n.sibling;return t.subtreeFlags|=r,t.childLanes=a,e}function QR(t,e,a){var r=e.pendingProps;switch($g(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(e),null;case 1:return Fe(e),null;case 3:return a=e.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),Dr(at),$i(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Si(e)?_r(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,pm())),Fe(e),null;case 26:var n=e.type,o=e.memoizedState;return t===null?(_r(e),o!==null?(Fe(e),$0(e,o)):(Fe(e),Cm(e,n,null,r,a))):o?o!==t.memoizedState?(_r(e),Fe(e),$0(e,o)):(Fe(e),e.flags&=-16777217):(t=t.memoizedProps,t!==r&&_r(e),Fe(e),Cm(e,n,t,r,a)),null;case 27:if(cd(e),a=An.current,n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&_r(e);else{if(!r){if(e.stateNode===null)throw Error(M(166));return Fe(e),null}t=sr.current,Si(e)?x0(e,t):(t=Yw(n,r,a),e.stateNode=t,_r(e))}return Fe(e),null;case 5:if(cd(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&_r(e);else{if(!r){if(e.stateNode===null)throw Error(M(166));return Fe(e),null}if(o=sr.current,Si(e))x0(e,o);else{var i=Rd(An.current);switch(o){case 1:o=i.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:o=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":o=i.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":o=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":o=i.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof r.is=="string"?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is=="string"?i.createElement(n,{is:r.is}):i.createElement(n)}}o[yt]=e,o[Wt]=r;e:for(i=e.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}e.stateNode=o;e:switch(St(o,n,r),n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&_r(e)}}return Fe(e),Cm(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,a),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==r&&_r(e);else{if(typeof r!="string"&&e.stateNode===null)throw Error(M(166));if(t=An.current,Si(e)){if(t=e.stateNode,a=e.memoizedProps,r=null,n=xt,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}t[yt]=e,t=!!(t.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Gw(t.nodeValue,a)),t||Nn(e,!0)}else t=Rd(t).createTextNode(r),t[yt]=e,e.stateNode=t}return Fe(e),null;case 31:if(a=e.memoizedState,t===null||t.memoizedState!==null){if(r=Si(e),a!==null){if(t===null){if(!r)throw Error(M(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(557));t[yt]=e}else Lo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Fe(e),t=!1}else a=pm(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return e.flags&256?(ra(e),e):(ra(e),null);if((e.flags&128)!==0)throw Error(M(558))}return Fe(e),null;case 13:if(r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=Si(e),r!==null&&r.dehydrated!==null){if(t===null){if(!n)throw Error(M(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(M(317));n[yt]=e}else Lo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Fe(e),n=!1}else n=pm(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),n=!0;if(!n)return e.flags&256?(ra(e),e):(ra(e),null)}return ra(e),(e.flags&128)!==0?(e.lanes=a,e):(a=r!==null,t=t!==null&&t.memoizedState!==null,a&&(r=e.child,n=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(n=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==n&&(r.flags|=2048)),a!==t&&a&&(e.child.flags|=8192),Uc(e,e.updateQueue),Fe(e),null);case 4:return $i(),t===null&&vv(e.stateNode.containerInfo),Fe(e),null;case 10:return Dr(e.type),Fe(e),null;case 19:if(ht(Ke),r=e.memoizedState,r===null)return Fe(e),null;if(n=(e.flags&128)!==0,o=r.rendering,o===null)if(n)hl(r,!1);else{if(Xe!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=xd(t),o!==null){for(e.flags|=128,hl(r,!1),t=o.updateQueue,e.updateQueue=t,Uc(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)s_(a,t),a=a.sibling;return Re(Ke,Ke.current&1|2),he&&Ar(e,r.treeForkCount),e.child}t=t.sibling}r.tail!==null&&ia()>Ld&&(e.flags|=128,n=!0,hl(r,!1),e.lanes=4194304)}else{if(!n)if(t=xd(o),t!==null){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,Uc(e,t),hl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!he)return Fe(e),null}else 2*ia()-r.renderingStartTime>Ld&&a!==536870912&&(e.flags|=128,n=!0,hl(r,!1),e.lanes=4194304);r.isBackwards?(o.sibling=e.child,e.child=o):(t=r.last,t!==null?t.sibling=o:e.child=o,r.last=o)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=ia(),t.sibling=null,a=Ke.current,Re(Ke,n?a&1|2:a&1),he&&Ar(e,r.treeForkCount),t):(Fe(e),null);case 22:case 23:return ra(e),Xg(),r=e.memoizedState!==null,t!==null?t.memoizedState!==null!==r&&(e.flags|=8192):r&&(e.flags|=8192),r?(a&536870912)!==0&&(e.flags&128)===0&&(Fe(e),e.subtreeFlags&6&&(e.flags|=8192)):Fe(e),a=e.updateQueue,a!==null&&Uc(e,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),r=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),r!==a&&(e.flags|=2048),t!==null&&ht(Co),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),Dr(at),Fe(e),null;case 25:return null;case 30:return null}throw Error(M(156,e.tag))}function JR(t,e){switch($g(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Dr(at),$i(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return cd(e),null;case 31:if(e.memoizedState!==null){if(ra(e),e.alternate===null)throw Error(M(340));Lo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(ra(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(M(340));Lo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ht(Ke),null;case 4:return $i(),null;case 10:return Dr(e.type),null;case 22:case 23:return ra(e),Xg(),t!==null&&ht(Co),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Dr(at),null;case 25:return null;default:return null}}function sw(t,e){switch($g(e),e.tag){case 3:Dr(at),$i();break;case 26:case 27:case 5:cd(e);break;case 4:$i();break;case 31:e.memoizedState!==null&&ra(e);break;case 13:ra(e);break;case 19:ht(Ke);break;case 10:Dr(e.type);break;case 22:case 23:ra(e),Xg(),t!==null&&ht(Co);break;case 24:Dr(at)}}function nu(t,e){try{var a=e.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var n=r.next;a=n;do{if((a.tag&t)===t){r=void 0;var o=a.create,i=a.inst;r=o(),i.destroy=r}a=a.next}while(a!==n)}}catch(s){Ce(e,e.return,s)}}function Pn(t,e,a){try{var r=e.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var o=n.next;r=o;do{if((r.tag&t)===t){var i=r.inst,s=i.destroy;if(s!==void 0){i.destroy=void 0,n=e;var l=a,u=s;try{u()}catch(c){Ce(n,l,c)}}}r=r.next}while(r!==o)}}catch(c){Ce(e,e.return,c)}}function lw(t){var e=t.updateQueue;if(e!==null){var a=t.stateNode;try{v_(e,a)}catch(r){Ce(t,t.return,r)}}}function uw(t,e,a){a.props=Eo(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(r){Ce(t,e,r)}}function Rl(t,e){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var r=t.stateNode;break;case 30:r=t.stateNode;break;default:r=t.stateNode}typeof a=="function"?t.refCleanup=a(r):a.current=r}}catch(n){Ce(t,e,n)}}function ir(t,e){var a=t.ref,r=t.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(n){Ce(t,e,n)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(n){Ce(t,e,n)}else a.current=null}function cw(t){var e=t.type,a=t.memoizedProps,r=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(n){Ce(t,t.return,n)}}function _m(t,e,a){try{var r=t.stateNode;xM(r,t.type,a,e),r[Wt]=e}catch(n){Ce(t,t.return,n)}}function dw(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&qn(t.type)||t.tag===4}function wm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||dw(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&qn(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function fg(t,e,a){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,e):(e=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,e.appendChild(t),a=a._reactRootContainer,a!=null||e.onclick!==null||(e.onclick=Tr));else if(r!==4&&(r===27&&qn(t.type)&&(a=t.stateNode,e=null),t=t.child,t!==null))for(fg(t,e,a),t=t.sibling;t!==null;)fg(t,e,a),t=t.sibling}function wd(t,e,a){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?a.insertBefore(t,e):a.appendChild(t);else if(r!==4&&(r===27&&qn(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(wd(t,e,a),t=t.sibling;t!==null;)wd(t,e,a),t=t.sibling}function fw(t){var e=t.stateNode,a=t.memoizedProps;try{for(var r=t.type,n=e.attributes;n.length;)e.removeAttributeNode(n[0]);St(e,r,a),e[yt]=t,e[Wt]=a}catch(o){Ce(t,t.return,o)}}var kr=!1,tt=!1,Lm=!1,j0=typeof WeakSet=="function"?WeakSet:Set,ft=null;function eM(t,e){if(t=t.containerInfo,xg=Bd,t=JC(t),Hg(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var n=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var i=0,s=-1,l=-1,u=0,c=0,d=t,p=null;t:for(;;){for(var g;d!==a||n!==0&&d.nodeType!==3||(s=i+n),d!==o||r!==0&&d.nodeType!==3||(l=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(g=d.firstChild)!==null;)p=d,d=g;for(;;){if(d===t)break t;if(p===a&&++u===n&&(s=i),p===o&&++c===r&&(l=i),(g=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=g}a=s===-1||l===-1?null:{start:s,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(bg={focusedElem:t,selectionRange:a},Bd=!1,ft=e;ft!==null;)if(e=ft,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ft=t;else for(;ft!==null;){switch(e=ft,o=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)n=t[a],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&o!==null){t=void 0,a=e,n=o.memoizedProps,o=o.memoizedState,r=a.stateNode;try{var S=Eo(a.type,n);t=r.getSnapshotBeforeUpdate(S,o),r.__reactInternalSnapshotBeforeUpdate=t}catch(b){Ce(a,a.return,b)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,a=t.nodeType,a===9)Cg(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Cg(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(M(163))}if(t=e.sibling,t!==null){t.return=e.return,ft=t;break}ft=e.return}}function pw(t,e,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Lr(t,a),r&4&&nu(5,a);break;case 1:if(Lr(t,a),r&4)if(t=a.stateNode,e===null)try{t.componentDidMount()}catch(i){Ce(a,a.return,i)}else{var n=Eo(a.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(n,e,t.__reactInternalSnapshotBeforeUpdate)}catch(i){Ce(a,a.return,i)}}r&64&&lw(a),r&512&&Rl(a,a.return);break;case 3:if(Lr(t,a),r&64&&(t=a.updateQueue,t!==null)){if(e=null,a.child!==null)switch(a.child.tag){case 27:case 5:e=a.child.stateNode;break;case 1:e=a.child.stateNode}try{v_(t,e)}catch(i){Ce(a,a.return,i)}}break;case 27:e===null&&r&4&&fw(a);case 26:case 5:Lr(t,a),e===null&&r&4&&cw(a),r&512&&Rl(a,a.return);break;case 12:Lr(t,a);break;case 31:Lr(t,a),r&4&&gw(t,a);break;case 13:Lr(t,a),r&4&&vw(t,a),r&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=uM.bind(null,a),AM(t,a))));break;case 22:if(r=a.memoizedState!==null||kr,!r){e=e!==null&&e.memoizedState!==null||tt,n=kr;var o=tt;kr=r,(tt=e)&&!o?Ir(t,a,(a.subtreeFlags&8772)!==0):Lr(t,a),kr=n,tt=o}break;case 30:break;default:Lr(t,a)}}function hw(t){var e=t.alternate;e!==null&&(t.alternate=null,hw(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Dg(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var qe=null,$t=!1;function wr(t,e,a){for(a=a.child;a!==null;)mw(t,e,a),a=a.sibling}function mw(t,e,a){if(sa&&typeof sa.onCommitFiberUnmount=="function")try{sa.onCommitFiberUnmount(Kl,a)}catch{}switch(a.tag){case 26:tt||ir(a,e),wr(t,e,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:tt||ir(a,e);var r=qe,n=$t;qn(a.type)&&(qe=a.stateNode,$t=!1),wr(t,e,a),Bl(a.stateNode),qe=r,$t=n;break;case 5:tt||ir(a,e);case 6:if(r=qe,n=$t,qe=null,wr(t,e,a),qe=r,$t=n,qe!==null)if($t)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(a.stateNode)}catch(o){Ce(a,e,o)}else try{qe.removeChild(a.stateNode)}catch(o){Ce(a,e,o)}break;case 18:qe!==null&&($t?(t=qe,iC(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),es(t)):iC(qe,a.stateNode));break;case 4:r=qe,n=$t,qe=a.stateNode.containerInfo,$t=!0,wr(t,e,a),qe=r,$t=n;break;case 0:case 11:case 14:case 15:Pn(2,a,e),tt||Pn(4,a,e),wr(t,e,a);break;case 1:tt||(ir(a,e),r=a.stateNode,typeof r.componentWillUnmount=="function"&&uw(a,e,r)),wr(t,e,a);break;case 21:wr(t,e,a);break;case 22:tt=(r=tt)||a.memoizedState!==null,wr(t,e,a),tt=r;break;default:wr(t,e,a)}}function gw(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{es(t)}catch(a){Ce(e,e.return,a)}}}function vw(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{es(t)}catch(a){Ce(e,e.return,a)}}function tM(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new j0),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new j0),e;default:throw Error(M(435,t.tag))}}function qc(t,e){var a=tM(t);e.forEach(function(r){if(!a.has(r)){a.add(r);var n=cM.bind(null,t,r);r.then(n,n)}})}function zt(t,e){var a=e.deletions;if(a!==null)for(var r=0;r<a.length;r++){var n=a[r],o=t,i=e,s=i;e:for(;s!==null;){switch(s.tag){case 27:if(qn(s.type)){qe=s.stateNode,$t=!1;break e}break;case 5:qe=s.stateNode,$t=!1;break e;case 3:case 4:qe=s.stateNode.containerInfo,$t=!0;break e}s=s.return}if(qe===null)throw Error(M(160));mw(o,i,n),qe=null,$t=!1,o=n.alternate,o!==null&&(o.return=null),n.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)yw(e,t),e=e.sibling}var qa=null;function yw(t,e){var a=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:zt(e,t),Vt(t),r&4&&(Pn(3,t,t.return),nu(3,t),Pn(5,t,t.return));break;case 1:zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),r&64&&kr&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var n=qa;if(zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),r&4){var o=a!==null?a.memoizedState:null;if(r=t.memoizedState,a===null)if(r===null)if(t.stateNode===null){e:{r=t.type,a=t.memoizedProps,n=n.ownerDocument||n;t:switch(r){case"title":o=n.getElementsByTagName("title")[0],(!o||o[eu]||o[yt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=n.createElement(r),n.head.insertBefore(o,n.querySelector("head > title"))),St(o,r,a),o[yt]=t,pt(o),r=o;break e;case"link":var i=pC("link","href",n).get(r+(a.href||""));if(i){for(var s=0;s<i.length;s++)if(o=i[s],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){i.splice(s,1);break t}}o=n.createElement(r),St(o,r,a),n.head.appendChild(o);break;case"meta":if(i=pC("meta","content",n).get(r+(a.content||""))){for(s=0;s<i.length;s++)if(o=i[s],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){i.splice(s,1);break t}}o=n.createElement(r),St(o,r,a),n.head.appendChild(o);break;default:throw Error(M(468,r))}o[yt]=t,pt(o),r=o}t.stateNode=r}else hC(n,t.type,t.stateNode);else t.stateNode=fC(n,r,t.memoizedProps);else o!==r?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,r===null?hC(n,t.type,t.stateNode):fC(n,r,t.memoizedProps)):r===null&&t.stateNode!==null&&_m(t,t.memoizedProps,a.memoizedProps)}break;case 27:zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),a!==null&&r&4&&_m(t,t.memoizedProps,a.memoizedProps);break;case 5:if(zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),t.flags&32){n=t.stateNode;try{Gi(n,"")}catch(S){Ce(t,t.return,S)}}r&4&&t.stateNode!=null&&(n=t.memoizedProps,_m(t,n,a!==null?a.memoizedProps:n)),r&1024&&(Lm=!0);break;case 6:if(zt(e,t),Vt(t),r&4){if(t.stateNode===null)throw Error(M(162));r=t.memoizedProps,a=t.stateNode;try{a.nodeValue=r}catch(S){Ce(t,t.return,S)}}break;case 3:if(od=null,n=qa,qa=Md(e.containerInfo),zt(e,t),qa=n,Vt(t),r&4&&a!==null&&a.memoizedState.isDehydrated)try{es(e.containerInfo)}catch(S){Ce(t,t.return,S)}Lm&&(Lm=!1,xw(t));break;case 4:r=qa,qa=Md(t.stateNode.containerInfo),zt(e,t),Vt(t),qa=r;break;case 12:zt(e,t),Vt(t);break;case 31:zt(e,t),Vt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,qc(t,r)));break;case 13:zt(e,t),Vt(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Zd=ia()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,qc(t,r)));break;case 22:n=t.memoizedState!==null;var l=a!==null&&a.memoizedState!==null,u=kr,c=tt;if(kr=u||n,tt=c||l,zt(e,t),tt=c,kr=u,Vt(t),r&8192)e:for(e=t.stateNode,e._visibility=n?e._visibility&-2:e._visibility|1,n&&(a===null||l||kr||tt||xo(t)),a=null,e=t;;){if(e.tag===5||e.tag===26){if(a===null){l=a=e;try{if(o=l.stateNode,n)i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{s=l.stateNode;var d=l.memoizedProps.style,p=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(S){Ce(l,l.return,S)}}}else if(e.tag===6){if(a===null){l=e;try{l.stateNode.nodeValue=n?"":l.memoizedProps}catch(S){Ce(l,l.return,S)}}}else if(e.tag===18){if(a===null){l=e;try{var g=l.stateNode;n?sC(g,!0):sC(l.stateNode,!1)}catch(S){Ce(l,l.return,S)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;a===e&&(a=null),e=e.return}a===e&&(a=null),e.sibling.return=e.return,e=e.sibling}r&4&&(r=t.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,qc(t,a))));break;case 19:zt(e,t),Vt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,qc(t,r)));break;case 30:break;case 21:break;default:zt(e,t),Vt(t)}}function Vt(t){var e=t.flags;if(e&2){try{for(var a,r=t.return;r!==null;){if(dw(r)){a=r;break}r=r.return}if(a==null)throw Error(M(160));switch(a.tag){case 27:var n=a.stateNode,o=wm(t);wd(t,o,n);break;case 5:var i=a.stateNode;a.flags&32&&(Gi(i,""),a.flags&=-33);var s=wm(t);wd(t,s,i);break;case 3:case 4:var l=a.stateNode.containerInfo,u=wm(t);fg(t,u,l);break;default:throw Error(M(161))}}catch(c){Ce(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function xw(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;xw(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Lr(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)pw(t,e.alternate,e),e=e.sibling}function xo(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Pn(4,e,e.return),xo(e);break;case 1:ir(e,e.return);var a=e.stateNode;typeof a.componentWillUnmount=="function"&&uw(e,e.return,a),xo(e);break;case 27:Bl(e.stateNode);case 26:case 5:ir(e,e.return),xo(e);break;case 22:e.memoizedState===null&&xo(e);break;case 30:xo(e);break;default:xo(e)}t=t.sibling}}function Ir(t,e,a){for(a=a&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var r=e.alternate,n=t,o=e,i=o.flags;switch(o.tag){case 0:case 11:case 15:Ir(n,o,a),nu(4,o);break;case 1:if(Ir(n,o,a),r=o,n=r.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(u){Ce(r,r.return,u)}if(r=o,n=r.updateQueue,n!==null){var s=r.stateNode;try{var l=n.shared.hiddenCallbacks;if(l!==null)for(n.shared.hiddenCallbacks=null,n=0;n<l.length;n++)g_(l[n],s)}catch(u){Ce(r,r.return,u)}}a&&i&64&&lw(o),Rl(o,o.return);break;case 27:fw(o);case 26:case 5:Ir(n,o,a),a&&r===null&&i&4&&cw(o),Rl(o,o.return);break;case 12:Ir(n,o,a);break;case 31:Ir(n,o,a),a&&i&4&&gw(n,o);break;case 13:Ir(n,o,a),a&&i&4&&vw(n,o);break;case 22:o.memoizedState===null&&Ir(n,o,a),Rl(o,o.return);break;case 30:break;default:Ir(n,o,a)}e=e.sibling}}function dv(t,e){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&au(a))}function fv(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&au(t))}function Ua(t,e,a,r){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)bw(t,e,a,r),e=e.sibling}function bw(t,e,a,r){var n=e.flags;switch(e.tag){case 0:case 11:case 15:Ua(t,e,a,r),n&2048&&nu(9,e);break;case 1:Ua(t,e,a,r);break;case 3:Ua(t,e,a,r),n&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&au(t)));break;case 12:if(n&2048){Ua(t,e,a,r),t=e.stateNode;try{var o=e.memoizedProps,i=o.id,s=o.onPostCommit;typeof s=="function"&&s(i,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){Ce(e,e.return,l)}}else Ua(t,e,a,r);break;case 31:Ua(t,e,a,r);break;case 13:Ua(t,e,a,r);break;case 23:break;case 22:o=e.stateNode,i=e.alternate,e.memoizedState!==null?o._visibility&2?Ua(t,e,a,r):Ml(t,e):o._visibility&2?Ua(t,e,a,r):(o._visibility|=2,_i(t,e,a,r,(e.subtreeFlags&10256)!==0||!1)),n&2048&&dv(i,e);break;case 24:Ua(t,e,a,r),n&2048&&fv(e.alternate,e);break;default:Ua(t,e,a,r)}}function _i(t,e,a,r,n){for(n=n&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var o=t,i=e,s=a,l=r,u=i.flags;switch(i.tag){case 0:case 11:case 15:_i(o,i,s,l,n),nu(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?_i(o,i,s,l,n):Ml(o,i):(c._visibility|=2,_i(o,i,s,l,n)),n&&u&2048&&dv(i.alternate,i);break;case 24:_i(o,i,s,l,n),n&&u&2048&&fv(i.alternate,i);break;default:_i(o,i,s,l,n)}e=e.sibling}}function Ml(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var a=t,r=e,n=r.flags;switch(r.tag){case 22:Ml(a,r),n&2048&&dv(r.alternate,r);break;case 24:Ml(a,r),n&2048&&fv(r.alternate,r);break;default:Ml(a,r)}e=e.sibling}}var Cl=8192;function Ci(t,e,a){if(t.subtreeFlags&Cl)for(t=t.child;t!==null;)Sw(t,e,a),t=t.sibling}function Sw(t,e,a){switch(t.tag){case 26:Ci(t,e,a),t.flags&Cl&&t.memoizedState!==null&&HM(a,qa,t.memoizedState,t.memoizedProps);break;case 5:Ci(t,e,a);break;case 3:case 4:var r=qa;qa=Md(t.stateNode.containerInfo),Ci(t,e,a),qa=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=Cl,Cl=16777216,Ci(t,e,a),Cl=r):Ci(t,e,a));break;default:Ci(t,e,a)}}function Cw(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function ml(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var r=e[a];ft=r,ww(r,t)}Cw(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)_w(t),t=t.sibling}function _w(t){switch(t.tag){case 0:case 11:case 15:ml(t),t.flags&2048&&Pn(9,t,t.return);break;case 3:ml(t);break;case 12:ml(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,rd(t)):ml(t);break;default:ml(t)}}function rd(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var r=e[a];ft=r,ww(r,t)}Cw(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Pn(8,e,e.return),rd(e);break;case 22:a=e.stateNode,a._visibility&2&&(a._visibility&=-3,rd(e));break;default:rd(e)}t=t.sibling}}function ww(t,e){for(;ft!==null;){var a=ft;switch(a.tag){case 0:case 11:case 15:Pn(8,a,e);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:au(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,ft=r;else e:for(a=t;ft!==null;){r=ft;var n=r.sibling,o=r.return;if(hw(r),r===a){ft=null;break e}if(n!==null){n.return=o,ft=n;break e}ft=o}}}var aM={getCacheForType:function(t){var e=bt(at),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a},cacheSignal:function(){return bt(at).controller.signal}},rM=typeof WeakMap=="function"?WeakMap:Map,ye=0,Ae=null,ce=null,pe=0,Se=0,aa=null,wn=!1,os=!1,pv=!1,Hr=0,Xe=0,Hn=0,wo=0,hv=0,oa=0,Yi=0,Dl=null,jt=null,pg=!1,Zd=0,Lw=0,Ld=1/0,Id=null,Rn=null,ot=0,Mn=null,Ki=null,Or=0,hg=0,mg=null,Iw=null,Ol=0,gg=null;function ua(){return(ye&2)!==0&&pe!==0?pe&-pe:ee.T!==null?gv():BC()}function Aw(){if(oa===0)if((pe&536870912)===0||he){var t=Rc;Rc<<=1,(Rc&3932160)===0&&(Rc=262144),oa=t}else oa=536870912;return t=da.current,t!==null&&(t.flags|=32),oa}function Gt(t,e,a){(t===Ae&&(Se===2||Se===9)||t.cancelPendingCommit!==null)&&(Qi(t,0),Ln(t,pe,oa,!1)),Jl(t,a),((ye&2)===0||t!==Ae)&&(t===Ae&&((ye&2)===0&&(wo|=a),Xe===4&&Ln(t,pe,oa,!1)),ur(t))}function kw(t,e,a){if((ye&6)!==0)throw Error(M(327));var r=!a&&(e&127)===0&&(e&t.expiredLanes)===0||Ql(t,e),n=r?iM(t,e):Im(t,e,!0),o=r;do{if(n===0){os&&!r&&Ln(t,e,0,!1);break}else{if(a=t.current.alternate,o&&!nM(a)){n=Im(t,e,!1),o=!1;continue}if(n===2){if(o=e,t.errorRecoveryDisabledLanes&o)var i=0;else i=t.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){e=i;e:{var s=t;n=Dl;var l=s.current.memoizedState.isDehydrated;if(l&&(Qi(s,i).flags|=256),i=Im(s,i,!1),i!==2){if(pv&&!l){s.errorRecoveryDisabledLanes|=o,wo|=o,n=4;break e}o=jt,jt=n,o!==null&&(jt===null?jt=o:jt.push.apply(jt,o))}n=i}if(o=!1,n!==2)continue}}if(n===1){Qi(t,0),Ln(t,e,0,!0);break}e:{switch(r=t,o=n,o){case 0:case 1:throw Error(M(345));case 4:if((e&4194048)!==e)break;case 6:Ln(r,e,oa,!wn);break e;case 2:jt=null;break;case 3:case 5:break;default:throw Error(M(329))}if((e&62914560)===e&&(n=Zd+300-ia(),10<n)){if(Ln(r,e,oa,!wn),Nd(r,0,!0)!==0)break e;Or=e,r.timeoutHandle=Zw(G0.bind(null,r,a,jt,Id,pg,e,oa,wo,Yi,wn,o,"Throttled",-0,0),n);break e}G0(r,a,jt,Id,pg,e,oa,wo,Yi,wn,o,null,-0,0)}}break}while(!0);ur(t)}function G0(t,e,a,r,n,o,i,s,l,u,c,d,p,g){if(t.timeoutHandle=-1,d=e.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Tr},Sw(e,o,d);var S=(o&62914560)===o?Zd-ia():(o&4194048)===o?Lw-ia():0;if(S=UM(d,S),S!==null){Or=o,t.cancelPendingCommit=S(Z0.bind(null,t,e,o,a,r,n,i,s,l,c,d,null,p,g)),Ln(t,o,i,!u);return}}Z0(t,e,o,a,r,n,i,s,l)}function nM(t){for(var e=t;;){var a=e.tag;if((a===0||a===11||a===15)&&e.flags&16384&&(a=e.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var n=a[r],o=n.getSnapshot;n=n.value;try{if(!ca(o(),n))return!1}catch{return!1}}if(a=e.child,e.subtreeFlags&16384&&a!==null)a.return=e,e=a;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Ln(t,e,a,r){e&=~hv,e&=~wo,t.suspendedLanes|=e,t.pingedLanes&=~e,r&&(t.warmLanes|=e),r=t.expirationTimes;for(var n=e;0<n;){var o=31-la(n),i=1<<o;r[o]=-1,n&=~i}a!==0&&MC(t,a,e)}function Xd(){return(ye&6)===0?(ou(0,!1),!1):!0}function mv(){if(ce!==null){if(Se===0)var t=ce.return;else t=ce,Rr=Oo=null,ev(t),qi=null,zl=0,t=ce;for(;t!==null;)sw(t.alternate,t),t=t.return;ce=null}}function Qi(t,e){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,CM(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Or=0,mv(),Ae=t,ce=a=Mr(t.current,null),pe=e,Se=0,aa=null,wn=!1,os=Ql(t,e),pv=!1,Yi=oa=hv=wo=Hn=Xe=0,jt=Dl=null,pg=!1,(e&8)!==0&&(e|=e&32);var r=t.entangledLanes;if(r!==0)for(t=t.entanglements,r&=e;0<r;){var n=31-la(r),o=1<<n;e|=t[n],r&=~o}return Hr=e,qd(),a}function Ew(t,e){ie=null,ee.H=$l,e===ns||e===Vd?(e=w0(),Se=3):e===Wg?(e=w0(),Se=4):Se=e===uv?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,aa=e,ce===null&&(Xe=1,Cd(t,La(e,t.current)))}function Tw(){var t=da.current;return t===null?!0:(pe&4194048)===pe?Aa===null:(pe&62914560)===pe||(pe&536870912)!==0?t===Aa:!1}function Rw(){var t=ee.H;return ee.H=$l,t===null?$l:t}function Mw(){var t=ee.A;return ee.A=aM,t}function Ad(){Xe=4,wn||(pe&4194048)!==pe&&da.current!==null||(os=!0),(Hn&134217727)===0&&(wo&134217727)===0||Ae===null||Ln(Ae,pe,oa,!1)}function Im(t,e,a){var r=ye;ye|=2;var n=Rw(),o=Mw();(Ae!==t||pe!==e)&&(Id=null,Qi(t,e)),e=!1;var i=Xe;e:do try{if(Se!==0&&ce!==null){var s=ce,l=aa;switch(Se){case 8:mv(),i=6;break e;case 3:case 2:case 9:case 6:da.current===null&&(e=!0);var u=Se;if(Se=0,aa=null,Fi(t,s,l,u),a&&os){i=0;break e}break;default:u=Se,Se=0,aa=null,Fi(t,s,l,u)}}oM(),i=Xe;break}catch(c){Ew(t,c)}while(!0);return e&&t.shellSuspendCounter++,Rr=Oo=null,ye=r,ee.H=n,ee.A=o,ce===null&&(Ae=null,pe=0,qd()),i}function oM(){for(;ce!==null;)Dw(ce)}function iM(t,e){var a=ye;ye|=2;var r=Rw(),n=Mw();Ae!==t||pe!==e?(Id=null,Ld=ia()+500,Qi(t,e)):os=Ql(t,e);e:do try{if(Se!==0&&ce!==null){e=ce;var o=aa;t:switch(Se){case 1:Se=0,aa=null,Fi(t,e,o,1);break;case 2:case 9:if(_0(o)){Se=0,aa=null,W0(e);break}e=function(){Se!==2&&Se!==9||Ae!==t||(Se=7),ur(t)},o.then(e,e);break e;case 3:Se=7;break e;case 4:Se=5;break e;case 7:_0(o)?(Se=0,aa=null,W0(e)):(Se=0,aa=null,Fi(t,e,o,7));break;case 5:var i=null;switch(ce.tag){case 26:i=ce.memoizedState;case 5:case 27:var s=ce;if(i?Jw(i):s.stateNode.complete){Se=0,aa=null;var l=s.sibling;if(l!==null)ce=l;else{var u=s.return;u!==null?(ce=u,Yd(u)):ce=null}break t}}Se=0,aa=null,Fi(t,e,o,5);break;case 6:Se=0,aa=null,Fi(t,e,o,6);break;case 8:mv(),Xe=6;break e;default:throw Error(M(462))}}sM();break}catch(c){Ew(t,c)}while(!0);return Rr=Oo=null,ee.H=r,ee.A=n,ye=a,ce!==null?0:(Ae=null,pe=0,qd(),Xe)}function sM(){for(;ce!==null&&!TT();)Dw(ce)}function Dw(t){var e=iw(t.alternate,t,Hr);t.memoizedProps=t.pendingProps,e===null?Yd(t):ce=e}function W0(t){var e=t,a=e.alternate;switch(e.tag){case 15:case 0:e=U0(a,e,e.pendingProps,e.type,void 0,pe);break;case 11:e=U0(a,e,e.pendingProps,e.type.render,e.ref,pe);break;case 5:ev(e);default:sw(a,e),e=ce=s_(e,Hr),e=iw(a,e,Hr)}t.memoizedProps=t.pendingProps,e===null?Yd(t):ce=e}function Fi(t,e,a,r){Rr=Oo=null,ev(e),qi=null,zl=0;var n=e.return;try{if(XR(t,n,e,a,pe)){Xe=1,Cd(t,La(a,t.current)),ce=null;return}}catch(o){if(n!==null)throw ce=n,o;Xe=1,Cd(t,La(a,t.current)),ce=null;return}e.flags&32768?(he||r===1?t=!0:os||(pe&536870912)!==0?t=!1:(wn=t=!0,(r===2||r===9||r===3||r===6)&&(r=da.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ow(e,t)):Yd(e)}function Yd(t){var e=t;do{if((e.flags&32768)!==0){Ow(e,wn);return}t=e.return;var a=QR(e.alternate,e,Hr);if(a!==null){ce=a;return}if(e=e.sibling,e!==null){ce=e;return}ce=e=t}while(e!==null);Xe===0&&(Xe=5)}function Ow(t,e){do{var a=JR(t.alternate,t);if(a!==null){a.flags&=32767,ce=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!e&&(t=t.sibling,t!==null)){ce=t;return}ce=t=a}while(t!==null);Xe=6,ce=null}function Z0(t,e,a,r,n,o,i,s,l){t.cancelPendingCommit=null;do Kd();while(ot!==0);if((ye&6)!==0)throw Error(M(327));if(e!==null){if(e===t.current)throw Error(M(177));if(o=e.lanes|e.childLanes,o|=Ug,UT(t,a,o,i,s,l),t===Ae&&(ce=Ae=null,pe=0),Ki=e,Mn=t,Or=a,hg=o,mg=n,Iw=r,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,dM(dd,function(){return Hw(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||r){r=ee.T,ee.T=null,n=xe.p,xe.p=2,i=ye,ye|=4;try{eM(t,e,a)}finally{ye=i,xe.p=n,ee.T=r}}ot=1,Bw(),Fw(),Nw()}}function Bw(){if(ot===1){ot=0;var t=Mn,e=Ki,a=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||a){a=ee.T,ee.T=null;var r=xe.p;xe.p=2;var n=ye;ye|=4;try{yw(e,t);var o=bg,i=JC(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(i!==s&&s&&s.ownerDocument&&QC(s.ownerDocument.documentElement,s)){if(l!==null&&Hg(s)){var u=l.start,c=l.end;if(c===void 0&&(c=u),"selectionStart"in s)s.selectionStart=u,s.selectionEnd=Math.min(c,s.value.length);else{var d=s.ownerDocument||document,p=d&&d.defaultView||window;if(p.getSelection){var g=p.getSelection(),S=s.textContent.length,b=Math.min(l.start,S),x=l.end===void 0?b:Math.min(l.end,S);!g.extend&&b>x&&(i=x,x=b,b=i);var f=g0(s,b),m=g0(s,x);if(f&&m&&(g.rangeCount!==1||g.anchorNode!==f.node||g.anchorOffset!==f.offset||g.focusNode!==m.node||g.focusOffset!==m.offset)){var v=d.createRange();v.setStart(f.node,f.offset),g.removeAllRanges(),b>x?(g.addRange(v),g.extend(m.node,m.offset)):(v.setEnd(m.node,m.offset),g.addRange(v))}}}}for(d=[],g=s;g=g.parentNode;)g.nodeType===1&&d.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<d.length;s++){var y=d[s];y.element.scrollLeft=y.left,y.element.scrollTop=y.top}}Bd=!!xg,bg=xg=null}finally{ye=n,xe.p=r,ee.T=a}}t.current=e,ot=2}}function Fw(){if(ot===2){ot=0;var t=Mn,e=Ki,a=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||a){a=ee.T,ee.T=null;var r=xe.p;xe.p=2;var n=ye;ye|=4;try{pw(t,e.alternate,e)}finally{ye=n,xe.p=r,ee.T=a}}ot=3}}function Nw(){if(ot===4||ot===3){ot=0,RT();var t=Mn,e=Ki,a=Or,r=Iw;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?ot=5:(ot=0,Ki=Mn=null,Pw(t,t.pendingLanes));var n=t.pendingLanes;if(n===0&&(Rn=null),Mg(a),e=e.stateNode,sa&&typeof sa.onCommitFiberRoot=="function")try{sa.onCommitFiberRoot(Kl,e,void 0,(e.current.flags&128)===128)}catch{}if(r!==null){e=ee.T,n=xe.p,xe.p=2,ee.T=null;try{for(var o=t.onRecoverableError,i=0;i<r.length;i++){var s=r[i];o(s.value,{componentStack:s.stack})}}finally{ee.T=e,xe.p=n}}(Or&3)!==0&&Kd(),ur(t),n=t.pendingLanes,(a&261930)!==0&&(n&42)!==0?t===gg?Ol++:(Ol=0,gg=t):Ol=0,ou(0,!1)}}function Pw(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,au(e)))}function Kd(){return Bw(),Fw(),Nw(),Hw()}function Hw(){if(ot!==5)return!1;var t=Mn,e=hg;hg=0;var a=Mg(Or),r=ee.T,n=xe.p;try{xe.p=32>a?32:a,ee.T=null,a=mg,mg=null;var o=Mn,i=Or;if(ot=0,Ki=Mn=null,Or=0,(ye&6)!==0)throw Error(M(331));var s=ye;if(ye|=4,_w(o.current),bw(o,o.current,i,a),ye=s,ou(0,!1),sa&&typeof sa.onPostCommitFiberRoot=="function")try{sa.onPostCommitFiberRoot(Kl,o)}catch{}return!0}finally{xe.p=n,ee.T=r,Pw(t,e)}}function X0(t,e,a){e=La(a,e),e=ug(t.stateNode,e,2),t=Tn(t,e,2),t!==null&&(Jl(t,2),ur(t))}function Ce(t,e,a){if(t.tag===3)X0(t,t,a);else for(;e!==null;){if(e.tag===3){X0(e,t,a);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Rn===null||!Rn.has(r))){t=La(a,t),a=ew(2),r=Tn(e,a,2),r!==null&&(tw(a,r,e,t),Jl(r,2),ur(r));break}}e=e.return}}function Am(t,e,a){var r=t.pingCache;if(r===null){r=t.pingCache=new rM;var n=new Set;r.set(e,n)}else n=r.get(e),n===void 0&&(n=new Set,r.set(e,n));n.has(a)||(pv=!0,n.add(a),t=lM.bind(null,t,e,a),e.then(t,t))}function lM(t,e,a){var r=t.pingCache;r!==null&&r.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Ae===t&&(pe&a)===a&&(Xe===4||Xe===3&&(pe&62914560)===pe&&300>ia()-Zd?(ye&2)===0&&Qi(t,0):hv|=a,Yi===pe&&(Yi=0)),ur(t)}function Uw(t,e){e===0&&(e=RC()),t=Do(t,e),t!==null&&(Jl(t,e),ur(t))}function uM(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),Uw(t,a)}function cM(t,e){var a=0;switch(t.tag){case 31:case 13:var r=t.stateNode,n=t.memoizedState;n!==null&&(a=n.retryLane);break;case 19:r=t.stateNode;break;case 22:r=t.stateNode._retryCache;break;default:throw Error(M(314))}r!==null&&r.delete(e),Uw(t,a)}function dM(t,e){return Tg(t,e)}var kd=null,wi=null,vg=!1,Ed=!1,km=!1,In=0;function ur(t){t!==wi&&t.next===null&&(wi===null?kd=wi=t:wi=wi.next=t),Ed=!0,vg||(vg=!0,pM())}function ou(t,e){if(!km&&Ed){km=!0;do for(var a=!1,r=kd;r!==null;){if(!e)if(t!==0){var n=r.pendingLanes;if(n===0)var o=0;else{var i=r.suspendedLanes,s=r.pingedLanes;o=(1<<31-la(42|t)+1)-1,o&=n&~(i&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,Y0(r,o))}else o=pe,o=Nd(r,r===Ae?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(o&3)===0||Ql(r,o)||(a=!0,Y0(r,o));r=r.next}while(a);km=!1}}function fM(){qw()}function qw(){Ed=vg=!1;var t=0;In!==0&&SM()&&(t=In);for(var e=ia(),a=null,r=kd;r!==null;){var n=r.next,o=zw(r,e);o===0?(r.next=null,a===null?kd=n:a.next=n,n===null&&(wi=a)):(a=r,(t!==0||(o&3)!==0)&&(Ed=!0)),r=n}ot!==0&&ot!==5||ou(t,!1),In!==0&&(In=0)}function zw(t,e){for(var a=t.suspendedLanes,r=t.pingedLanes,n=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var i=31-la(o),s=1<<i,l=n[i];l===-1?((s&a)===0||(s&r)!==0)&&(n[i]=HT(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Ae,a=pe,a=Nd(t,t===e?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,a===0||t===e&&(Se===2||Se===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&rm(r),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Ql(t,a)){if(e=a&-a,e===t.callbackPriority)return e;switch(r!==null&&rm(r),Mg(a)){case 2:case 8:a=EC;break;case 32:a=dd;break;case 268435456:a=TC;break;default:a=dd}return r=Vw.bind(null,t),a=Tg(a,r),t.callbackPriority=e,t.callbackNode=a,e}return r!==null&&r!==null&&rm(r),t.callbackPriority=2,t.callbackNode=null,2}function Vw(t,e){if(ot!==0&&ot!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Kd()&&t.callbackNode!==a)return null;var r=pe;return r=Nd(t,t===Ae?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(kw(t,r,e),zw(t,ia()),t.callbackNode!=null&&t.callbackNode===a?Vw.bind(null,t):null)}function Y0(t,e){if(Kd())return null;kw(t,e,!0)}function pM(){_M(function(){(ye&6)!==0?Tg(kC,fM):qw()})}function gv(){if(In===0){var t=Wi;t===0&&(t=Tc,Tc<<=1,(Tc&261888)===0&&(Tc=256)),In=t}return In}function K0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Zc(""+t)}function Q0(t,e){var a=e.ownerDocument.createElement("input");return a.name=e.name,a.value=e.value,t.id&&a.setAttribute("form",t.id),e.parentNode.insertBefore(a,e),t=new FormData(t),a.parentNode.removeChild(a),t}function hM(t,e,a,r,n){if(e==="submit"&&a&&a.stateNode===n){var o=K0((n[Wt]||null).action),i=r.submitter;i&&(e=(e=i[Wt]||null)?K0(e.formAction):i.getAttribute("formAction"),e!==null&&(o=e,i=null));var s=new Pd("action","action",null,r,n);t.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(In!==0){var l=i?Q0(n,i):new FormData(n);sg(a,{pending:!0,data:l,method:n.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=i?Q0(n,i):new FormData(n),sg(a,{pending:!0,data:l,method:n.method,action:o},o,l))},currentTarget:n}]})}}for(zc=0;zc<Xm.length;zc++)Vc=Xm[zc],J0=Vc.toLowerCase(),eC=Vc[0].toUpperCase()+Vc.slice(1),za(J0,"on"+eC);var Vc,J0,eC,zc;za(t_,"onAnimationEnd");za(a_,"onAnimationIteration");za(r_,"onAnimationStart");za("dblclick","onDoubleClick");za("focusin","onFocus");za("focusout","onBlur");za(MR,"onTransitionRun");za(DR,"onTransitionStart");za(OR,"onTransitionCancel");za(n_,"onTransitionEnd");ji("onMouseEnter",["mouseout","mouseover"]);ji("onMouseLeave",["mouseout","mouseover"]);ji("onPointerEnter",["pointerout","pointerover"]);ji("onPointerLeave",["pointerout","pointerover"]);To("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));To("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));To("onBeforeInput",["compositionend","keypress","textInput","paste"]);To("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));To("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));To("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jl="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(" "),mM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(jl));function $w(t,e){e=(e&4)!==0;for(var a=0;a<t.length;a++){var r=t[a],n=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var i=r.length-1;0<=i;i--){var s=r[i],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&n.isPropagationStopped())break e;o=s,n.currentTarget=u;try{o(n)}catch(c){pd(c)}n.currentTarget=null,o=l}else for(i=0;i<r.length;i++){if(s=r[i],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&n.isPropagationStopped())break e;o=s,n.currentTarget=u;try{o(n)}catch(c){pd(c)}n.currentTarget=null,o=l}}}}function ue(t,e){var a=e[qm];a===void 0&&(a=e[qm]=new Set);var r=t+"__bubble";a.has(r)||(jw(e,t,2,!1),a.add(r))}function Em(t,e,a){var r=0;e&&(r|=4),jw(a,t,r,e)}var $c="_reactListening"+Math.random().toString(36).slice(2);function vv(t){if(!t[$c]){t[$c]=!0,FC.forEach(function(a){a!=="selectionchange"&&(mM.has(a)||Em(a,!1,t),Em(a,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[$c]||(e[$c]=!0,Em("selectionchange",!1,e))}}function jw(t,e,a,r){switch(nL(e)){case 2:var n=VM;break;case 8:n=$M;break;default:n=Sv}a=n.bind(null,e,a,t),n=void 0,!Gm||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(n=!0),r?n!==void 0?t.addEventListener(e,a,{capture:!0,passive:n}):t.addEventListener(e,a,!0):n!==void 0?t.addEventListener(e,a,{passive:n}):t.addEventListener(e,a,!1)}function Tm(t,e,a,r,n){var o=r;if((e&1)===0&&(e&2)===0&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var s=r.stateNode.containerInfo;if(s===n)break;if(i===4)for(i=r.return;i!==null;){var l=i.tag;if((l===3||l===4)&&i.stateNode.containerInfo===n)return;i=i.return}for(;s!==null;){if(i=Ai(s),i===null)return;if(l=i.tag,l===5||l===6||l===26||l===27){r=o=i;continue e}s=s.parentNode}}r=r.return}$C(function(){var u=o,c=Bg(a),d=[];e:{var p=o_.get(t);if(p!==void 0){var g=Pd,S=t;switch(t){case"keypress":if(Yc(a)===0)break e;case"keydown":case"keyup":g=cR;break;case"focusin":S="focus",g=lm;break;case"focusout":S="blur",g=lm;break;case"beforeblur":case"afterblur":g=lm;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=s0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=QT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=pR;break;case t_:case a_:case r_:g=tR;break;case n_:g=mR;break;case"scroll":case"scrollend":g=YT;break;case"wheel":g=vR;break;case"copy":case"cut":case"paste":g=rR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=u0;break;case"toggle":case"beforetoggle":g=xR}var b=(e&4)!==0,x=!b&&(t==="scroll"||t==="scrollend"),f=b?p!==null?p+"Capture":null:p;b=[];for(var m=u,v;m!==null;){var y=m;if(v=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||v===null||f===null||(y=Nl(m,f),y!=null&&b.push(Gl(m,y,v))),x)break;m=m.return}0<b.length&&(p=new g(p,S,null,a,c),d.push({event:p,listeners:b}))}}if((e&7)===0){e:{if(p=t==="mouseover"||t==="pointerover",g=t==="mouseout"||t==="pointerout",p&&a!==jm&&(S=a.relatedTarget||a.fromElement)&&(Ai(S)||S[ts]))break e;if((g||p)&&(p=c.window===c?c:(p=c.ownerDocument)?p.defaultView||p.parentWindow:window,g?(S=a.relatedTarget||a.toElement,g=u,S=S?Ai(S):null,S!==null&&(x=Yl(S),b=S.tag,S!==x||b!==5&&b!==27&&b!==6)&&(S=null)):(g=null,S=u),g!==S)){if(b=s0,y="onMouseLeave",f="onMouseEnter",m="mouse",(t==="pointerout"||t==="pointerover")&&(b=u0,y="onPointerLeave",f="onPointerEnter",m="pointer"),x=g==null?p:bl(g),v=S==null?p:bl(S),p=new b(y,m+"leave",g,a,c),p.target=x,p.relatedTarget=v,y=null,Ai(c)===u&&(b=new b(f,m+"enter",S,a,c),b.target=v,b.relatedTarget=x,y=b),x=y,g&&S)t:{for(b=gM,f=g,m=S,v=0,y=f;y;y=b(y))v++;y=0;for(var _=m;_;_=b(_))y++;for(;0<v-y;)f=b(f),v--;for(;0<y-v;)m=b(m),y--;for(;v--;){if(f===m||m!==null&&f===m.alternate){b=f;break t}f=b(f),m=b(m)}b=null}else b=null;g!==null&&tC(d,p,g,b,!1),S!==null&&x!==null&&tC(d,x,S,b,!0)}}e:{if(p=u?bl(u):window,g=p.nodeName&&p.nodeName.toLowerCase(),g==="select"||g==="input"&&p.type==="file")var w=p0;else if(f0(p))if(YC)w=ER;else{w=AR;var C=IR}else g=p.nodeName,!g||g.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?u&&Og(u.elementType)&&(w=p0):w=kR;if(w&&(w=w(t,u))){XC(d,w,a,c);break e}C&&C(t,p,u),t==="focusout"&&u&&p.type==="number"&&u.memoizedProps.value!=null&&$m(p,"number",p.value)}switch(C=u?bl(u):window,t){case"focusin":(f0(C)||C.contentEditable==="true")&&(Ti=C,Wm=u,Ll=null);break;case"focusout":Ll=Wm=Ti=null;break;case"mousedown":Zm=!0;break;case"contextmenu":case"mouseup":case"dragend":Zm=!1,v0(d,a,c);break;case"selectionchange":if(RR)break;case"keydown":case"keyup":v0(d,a,c)}var A;if(Pg)e:{switch(t){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Ei?WC(t,a)&&(E="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(E="onCompositionStart");E&&(GC&&a.locale!=="ko"&&(Ei||E!=="onCompositionStart"?E==="onCompositionEnd"&&Ei&&(A=jC()):(_n=c,Fg="value"in _n?_n.value:_n.textContent,Ei=!0)),C=Td(u,E),0<C.length&&(E=new l0(E,t,null,a,c),d.push({event:E,listeners:C}),A?E.data=A:(A=ZC(a),A!==null&&(E.data=A)))),(A=SR?CR(t,a):_R(t,a))&&(E=Td(u,"onBeforeInput"),0<E.length&&(C=new l0("onBeforeInput","beforeinput",null,a,c),d.push({event:C,listeners:E}),C.data=A)),hM(d,t,u,a,c)}$w(d,e)})}function Gl(t,e,a){return{instance:t,listener:e,currentTarget:a}}function Td(t,e){for(var a=e+"Capture",r=[];t!==null;){var n=t,o=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||o===null||(n=Nl(t,a),n!=null&&r.unshift(Gl(t,n,o)),n=Nl(t,e),n!=null&&r.push(Gl(t,n,o))),t.tag===3)return r;t=t.return}return[]}function gM(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function tC(t,e,a,r,n){for(var o=e._reactName,i=[];a!==null&&a!==r;){var s=a,l=s.alternate,u=s.stateNode;if(s=s.tag,l!==null&&l===r)break;s!==5&&s!==26&&s!==27||u===null||(l=u,n?(u=Nl(a,o),u!=null&&i.unshift(Gl(a,u,l))):n||(u=Nl(a,o),u!=null&&i.push(Gl(a,u,l)))),a=a.return}i.length!==0&&t.push({event:e,listeners:i})}var vM=/\r\n?/g,yM=/\u0000|\uFFFD/g;function aC(t){return(typeof t=="string"?t:""+t).replace(vM,`
|
|
9
|
+
`).replace(yM,"")}function Gw(t,e){return e=aC(e),aC(t)===e}function we(t,e,a,r,n,o){switch(a){case"children":typeof r=="string"?e==="body"||e==="textarea"&&r===""||Gi(t,r):(typeof r=="number"||typeof r=="bigint")&&e!=="body"&&Gi(t,""+r);break;case"className":Dc(t,"class",r);break;case"tabIndex":Dc(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Dc(t,a,r);break;case"style":VC(t,r,o);break;case"data":if(e!=="object"){Dc(t,"data",r);break}case"src":case"href":if(r===""&&(e!=="a"||a!=="href")){t.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=Zc(""+r),t.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){t.setAttribute(a,"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 o=="function"&&(a==="formAction"?(e!=="input"&&we(t,e,"name",n.name,n,null),we(t,e,"formEncType",n.formEncType,n,null),we(t,e,"formMethod",n.formMethod,n,null),we(t,e,"formTarget",n.formTarget,n,null)):(we(t,e,"encType",n.encType,n,null),we(t,e,"method",n.method,n,null),we(t,e,"target",n.target,n,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=Zc(""+r),t.setAttribute(a,r);break;case"onClick":r!=null&&(t.onclick=Tr);break;case"onScroll":r!=null&&ue("scroll",t);break;case"onScrollEnd":r!=null&&ue("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(M(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(M(60));t.innerHTML=a}}break;case"multiple":t.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":t.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"){t.removeAttribute("xlink:href");break}a=Zc(""+r),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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"?t.setAttribute(a,""+r):t.removeAttribute(a);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"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":r===!0?t.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,r):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?t.setAttribute(a,r):t.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?t.removeAttribute(a):t.setAttribute(a,r);break;case"popover":ue("beforetoggle",t),ue("toggle",t),Wc(t,"popover",r);break;case"xlinkActuate":Cr(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Cr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Cr(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Cr(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Cr(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Cr(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Cr(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Cr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Cr(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Wc(t,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ZT.get(a)||a,Wc(t,a,r))}}function yg(t,e,a,r,n,o){switch(a){case"style":VC(t,r,o);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(M(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(M(60));t.innerHTML=a}}break;case"children":typeof r=="string"?Gi(t,r):(typeof r=="number"||typeof r=="bigint")&&Gi(t,""+r);break;case"onScroll":r!=null&&ue("scroll",t);break;case"onScrollEnd":r!=null&&ue("scrollend",t);break;case"onClick":r!=null&&(t.onclick=Tr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!NC.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(n=a.endsWith("Capture"),e=a.slice(2,n?a.length-7:void 0),o=t[Wt]||null,o=o!=null?o[a]:null,typeof o=="function"&&t.removeEventListener(e,o,n),typeof r=="function")){typeof o!="function"&&o!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(e,r,n);break e}a in t?t[a]=r:r===!0?t.setAttribute(a,""):Wc(t,a,r)}}}function St(t,e,a){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ue("error",t),ue("load",t);var r=!1,n=!1,o;for(o in a)if(a.hasOwnProperty(o)){var i=a[o];if(i!=null)switch(o){case"src":r=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(M(137,e));default:we(t,e,o,i,a,null)}}n&&we(t,e,"srcSet",a.srcSet,a,null),r&&we(t,e,"src",a.src,a,null);return;case"input":ue("invalid",t);var s=o=i=n=null,l=null,u=null;for(r in a)if(a.hasOwnProperty(r)){var c=a[r];if(c!=null)switch(r){case"name":n=c;break;case"type":i=c;break;case"checked":l=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":s=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(M(137,e));break;default:we(t,e,r,c,a,null)}}UC(t,o,s,l,u,i,n,!1);return;case"select":ue("invalid",t),r=i=o=null;for(n in a)if(a.hasOwnProperty(n)&&(s=a[n],s!=null))switch(n){case"value":o=s;break;case"defaultValue":i=s;break;case"multiple":r=s;default:we(t,e,n,s,a,null)}e=o,a=i,t.multiple=!!r,e!=null?Pi(t,!!r,e,!1):a!=null&&Pi(t,!!r,a,!0);return;case"textarea":ue("invalid",t),o=n=r=null;for(i in a)if(a.hasOwnProperty(i)&&(s=a[i],s!=null))switch(i){case"value":r=s;break;case"defaultValue":n=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(M(91));break;default:we(t,e,i,s,a,null)}zC(t,r,n,o);return;case"option":for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null)&&(l==="selected"?t.selected=r&&typeof r!="function"&&typeof r!="symbol":we(t,e,l,r,a,null));return;case"dialog":ue("beforetoggle",t),ue("toggle",t),ue("cancel",t),ue("close",t);break;case"iframe":case"object":ue("load",t);break;case"video":case"audio":for(r=0;r<jl.length;r++)ue(jl[r],t);break;case"image":ue("error",t),ue("load",t);break;case"details":ue("toggle",t);break;case"embed":case"source":case"link":ue("error",t),ue("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in a)if(a.hasOwnProperty(u)&&(r=a[u],r!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(M(137,e));default:we(t,e,u,r,a,null)}return;default:if(Og(e)){for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!==void 0&&yg(t,e,c,r,a,void 0));return}}for(s in a)a.hasOwnProperty(s)&&(r=a[s],r!=null&&we(t,e,s,r,a,null))}function xM(t,e,a,r){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,o=null,i=null,s=null,l=null,u=null,c=null;for(g in a){var d=a[g];if(a.hasOwnProperty(g)&&d!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":l=d;default:r.hasOwnProperty(g)||we(t,e,g,null,r,d)}}for(var p in r){var g=r[p];if(d=a[p],r.hasOwnProperty(p)&&(g!=null||d!=null))switch(p){case"type":o=g;break;case"name":n=g;break;case"checked":u=g;break;case"defaultChecked":c=g;break;case"value":i=g;break;case"defaultValue":s=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(M(137,e));break;default:g!==d&&we(t,e,p,g,r,d)}}Vm(t,i,s,l,u,c,o,n);return;case"select":g=i=s=p=null;for(o in a)if(l=a[o],a.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":g=l;default:r.hasOwnProperty(o)||we(t,e,o,null,r,l)}for(n in r)if(o=r[n],l=a[n],r.hasOwnProperty(n)&&(o!=null||l!=null))switch(n){case"value":p=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:o!==l&&we(t,e,n,o,r,l)}e=s,a=i,r=g,p!=null?Pi(t,!!a,p,!1):!!r!=!!a&&(e!=null?Pi(t,!!a,e,!0):Pi(t,!!a,a?[]:"",!1));return;case"textarea":g=p=null;for(s in a)if(n=a[s],a.hasOwnProperty(s)&&n!=null&&!r.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:we(t,e,s,null,r,n)}for(i in r)if(n=r[i],o=a[i],r.hasOwnProperty(i)&&(n!=null||o!=null))switch(i){case"value":p=n;break;case"defaultValue":g=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(M(91));break;default:n!==o&&we(t,e,i,n,r,o)}qC(t,p,g);return;case"option":for(var S in a)p=a[S],a.hasOwnProperty(S)&&p!=null&&!r.hasOwnProperty(S)&&(S==="selected"?t.selected=!1:we(t,e,S,null,r,p));for(l in r)p=r[l],g=a[l],r.hasOwnProperty(l)&&p!==g&&(p!=null||g!=null)&&(l==="selected"?t.selected=p&&typeof p!="function"&&typeof p!="symbol":we(t,e,l,p,r,g));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 b in a)p=a[b],a.hasOwnProperty(b)&&p!=null&&!r.hasOwnProperty(b)&&we(t,e,b,null,r,p);for(u in r)if(p=r[u],g=a[u],r.hasOwnProperty(u)&&p!==g&&(p!=null||g!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(M(137,e));break;default:we(t,e,u,p,r,g)}return;default:if(Og(e)){for(var x in a)p=a[x],a.hasOwnProperty(x)&&p!==void 0&&!r.hasOwnProperty(x)&&yg(t,e,x,void 0,r,p);for(c in r)p=r[c],g=a[c],!r.hasOwnProperty(c)||p===g||p===void 0&&g===void 0||yg(t,e,c,p,r,g);return}}for(var f in a)p=a[f],a.hasOwnProperty(f)&&p!=null&&!r.hasOwnProperty(f)&&we(t,e,f,null,r,p);for(d in r)p=r[d],g=a[d],!r.hasOwnProperty(d)||p===g||p==null&&g==null||we(t,e,d,p,r,g)}function rC(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function bM(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var n=a[r],o=n.transferSize,i=n.initiatorType,s=n.duration;if(o&&s&&rC(i)){for(i=0,s=n.responseEnd,r+=1;r<a.length;r++){var l=a[r],u=l.startTime;if(u>s)break;var c=l.transferSize,d=l.initiatorType;c&&rC(d)&&(l=l.responseEnd,i+=c*(l<s?1:(s-u)/(l-u)))}if(--r,e+=8*(o+i)/(n.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var xg=null,bg=null;function Rd(t){return t.nodeType===9?t:t.ownerDocument}function nC(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ww(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Sg(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Rm=null;function SM(){var t=window.event;return t&&t.type==="popstate"?t===Rm?!1:(Rm=t,!0):(Rm=null,!1)}var Zw=typeof setTimeout=="function"?setTimeout:void 0,CM=typeof clearTimeout=="function"?clearTimeout:void 0,oC=typeof Promise=="function"?Promise:void 0,_M=typeof queueMicrotask=="function"?queueMicrotask:typeof oC<"u"?function(t){return oC.resolve(null).then(t).catch(wM)}:Zw;function wM(t){setTimeout(function(){throw t})}function qn(t){return t==="head"}function iC(t,e){var a=e,r=0;do{var n=a.nextSibling;if(t.removeChild(a),n&&n.nodeType===8)if(a=n.data,a==="/$"||a==="/&"){if(r===0){t.removeChild(n),es(e);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")Bl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Bl(a);for(var o=a.firstChild;o;){var i=o.nextSibling,s=o.nodeName;o[eu]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&Bl(t.ownerDocument.body);a=n}while(a);es(e)}function sC(t,e){var a=t;t=0;do{var r=a.nextSibling;if(a.nodeType===1?e?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(e?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=r}while(a)}function Cg(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var a=e;switch(e=e.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Cg(a),Dg(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function LM(t,e,a,r){for(;t.nodeType===1;){var n=a;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!r&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(r){if(!t[eu])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(o=t.getAttribute("rel"),o==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(o!==n.rel||t.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||t.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||t.getAttribute("title")!==(n.title==null?null:n.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(o=t.getAttribute("src"),(o!==(n.src==null?null:n.src)||t.getAttribute("type")!==(n.type==null?null:n.type)||t.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&o&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var o=n.name==null?null:""+n.name;if(n.type==="hidden"&&t.getAttribute("name")===o)return t}else return t;if(t=ka(t.nextSibling),t===null)break}return null}function IM(t,e,a){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=ka(t.nextSibling),t===null))return null;return t}function Xw(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=ka(t.nextSibling),t===null))return null;return t}function _g(t){return t.data==="$?"||t.data==="$~"}function wg(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function AM(t,e){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||a.readyState!=="loading")e();else{var r=function(){e(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),t._reactRetry=r}}function ka(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var Lg=null;function lC(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(e===0)return ka(t.nextSibling);e--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||e++}t=t.nextSibling}return null}function uC(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(e===0)return t;e--}else a!=="/$"&&a!=="/&"||e++}t=t.previousSibling}return null}function Yw(t,e,a){switch(e=Rd(a),t){case"html":if(t=e.documentElement,!t)throw Error(M(452));return t;case"head":if(t=e.head,!t)throw Error(M(453));return t;case"body":if(t=e.body,!t)throw Error(M(454));return t;default:throw Error(M(451))}}function Bl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Dg(t)}var Ea=new Map,cC=new Set;function Md(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ur=xe.d;xe.d={f:kM,r:EM,D:TM,C:RM,L:MM,m:DM,X:BM,S:OM,M:FM};function kM(){var t=Ur.f(),e=Xd();return t||e}function EM(t){var e=as(t);e!==null&&e.tag===5&&e.type==="form"?V_(e):Ur.r(t)}var is=typeof document>"u"?null:document;function Kw(t,e,a){var r=is;if(r&&typeof e=="string"&&e){var n=wa(e);n='link[rel="'+t+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),cC.has(n)||(cC.add(n),t={rel:t,crossOrigin:a,href:e},r.querySelector(n)===null&&(e=r.createElement("link"),St(e,"link",t),pt(e),r.head.appendChild(e)))}}function TM(t){Ur.D(t),Kw("dns-prefetch",t,null)}function RM(t,e){Ur.C(t,e),Kw("preconnect",t,e)}function MM(t,e,a){Ur.L(t,e,a);var r=is;if(r&&t&&e){var n='link[rel="preload"][as="'+wa(e)+'"]';e==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+wa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+wa(a.imageSizes)+'"]')):n+='[href="'+wa(t)+'"]';var o=n;switch(e){case"style":o=Ji(t);break;case"script":o=ss(t)}Ea.has(o)||(t=Pe({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),Ea.set(o,t),r.querySelector(n)!==null||e==="style"&&r.querySelector(iu(o))||e==="script"&&r.querySelector(su(o))||(e=r.createElement("link"),St(e,"link",t),pt(e),r.head.appendChild(e)))}}function DM(t,e){Ur.m(t,e);var a=is;if(a&&t){var r=e&&typeof e.as=="string"?e.as:"script",n='link[rel="modulepreload"][as="'+wa(r)+'"][href="'+wa(t)+'"]',o=n;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ss(t)}if(!Ea.has(o)&&(t=Pe({rel:"modulepreload",href:t},e),Ea.set(o,t),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(su(o)))return}r=a.createElement("link"),St(r,"link",t),pt(r),a.head.appendChild(r)}}}function OM(t,e,a){Ur.S(t,e,a);var r=is;if(r&&t){var n=Ni(r).hoistableStyles,o=Ji(t);e=e||"default";var i=n.get(o);if(!i){var s={loading:0,preload:null};if(i=r.querySelector(iu(o)))s.loading=5;else{t=Pe({rel:"stylesheet",href:t,"data-precedence":e},a),(a=Ea.get(o))&&yv(t,a);var l=i=r.createElement("link");pt(l),St(l,"link",t),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,nd(i,e,r)}i={type:"stylesheet",instance:i,count:1,state:s},n.set(o,i)}}}function BM(t,e){Ur.X(t,e);var a=is;if(a&&t){var r=Ni(a).hoistableScripts,n=ss(t),o=r.get(n);o||(o=a.querySelector(su(n)),o||(t=Pe({src:t,async:!0},e),(e=Ea.get(n))&&xv(t,e),o=a.createElement("script"),pt(o),St(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function FM(t,e){Ur.M(t,e);var a=is;if(a&&t){var r=Ni(a).hoistableScripts,n=ss(t),o=r.get(n);o||(o=a.querySelector(su(n)),o||(t=Pe({src:t,async:!0,type:"module"},e),(e=Ea.get(n))&&xv(t,e),o=a.createElement("script"),pt(o),St(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function dC(t,e,a,r){var n=(n=An.current)?Md(n):null;if(!n)throw Error(M(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=Ji(a.href),a=Ni(n).hoistableStyles,r=a.get(e),r||(r={type:"style",instance:null,count:0,state:null},a.set(e,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Ji(a.href);var o=Ni(n).hoistableStyles,i=o.get(t);if(i||(n=n.ownerDocument||n,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(t,i),(o=n.querySelector(iu(t)))&&!o._p&&(i.instance=o,i.state.loading=5),Ea.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ea.set(t,a),o||NM(n,t,a,i.state))),e&&r===null)throw Error(M(528,""));return i}if(e&&r!==null)throw Error(M(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=ss(a),a=Ni(n).hoistableScripts,r=a.get(e),r||(r={type:"script",instance:null,count:0,state:null},a.set(e,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(M(444,t))}}function Ji(t){return'href="'+wa(t)+'"'}function iu(t){return'link[rel="stylesheet"]['+t+"]"}function Qw(t){return Pe({},t,{"data-precedence":t.precedence,precedence:null})}function NM(t,e,a,r){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?r.loading=1:(e=t.createElement("link"),r.preload=e,e.addEventListener("load",function(){return r.loading|=1}),e.addEventListener("error",function(){return r.loading|=2}),St(e,"link",a),pt(e),t.head.appendChild(e))}function ss(t){return'[src="'+wa(t)+'"]'}function su(t){return"script[async]"+t}function fC(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var r=t.querySelector('style[data-href~="'+wa(a.href)+'"]');if(r)return e.instance=r,pt(r),r;var n=Pe({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),pt(r),St(r,"style",n),nd(r,a.precedence,t),e.instance=r;case"stylesheet":n=Ji(a.href);var o=t.querySelector(iu(n));if(o)return e.state.loading|=4,e.instance=o,pt(o),o;r=Qw(a),(n=Ea.get(n))&&yv(r,n),o=(t.ownerDocument||t).createElement("link"),pt(o);var i=o;return i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),St(o,"link",r),e.state.loading|=4,nd(o,a.precedence,t),e.instance=o;case"script":return o=ss(a.src),(n=t.querySelector(su(o)))?(e.instance=n,pt(n),n):(r=a,(n=Ea.get(o))&&(r=Pe({},a),xv(r,n)),t=t.ownerDocument||t,n=t.createElement("script"),pt(n),St(n,"link",r),t.head.appendChild(n),e.instance=n);case"void":return null;default:throw Error(M(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(r=e.instance,e.state.loading|=4,nd(r,a.precedence,t));return e.instance}function nd(t,e,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=r.length?r[r.length-1]:null,o=n,i=0;i<r.length;i++){var s=r[i];if(s.dataset.precedence===e)o=s;else if(o!==n)break}o?o.parentNode.insertBefore(t,o.nextSibling):(e=a.nodeType===9?a.head:a,e.insertBefore(t,e.firstChild))}function yv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function xv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var od=null;function pC(t,e,a){if(od===null){var r=new Map,n=od=new Map;n.set(a,r)}else n=od,r=n.get(a),r||(r=new Map,n.set(a,r));if(r.has(t))return r;for(r.set(t,null),a=a.getElementsByTagName(t),n=0;n<a.length;n++){var o=a[n];if(!(o[eu]||o[yt]||t==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(e)||"";i=t+i;var s=r.get(i);s?s.push(o):r.set(i,[o])}}return r}function hC(t,e,a){t=t.ownerDocument||t,t.head.insertBefore(a,e==="title"?t.querySelector("head > title"):null)}function PM(t,e,a){if(a===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Jw(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function HM(t,e,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var n=Ji(r.href),o=e.querySelector(iu(n));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Dd.bind(t),e.then(t,t)),a.state.loading|=4,a.instance=o,pt(o);return}o=e.ownerDocument||e,r=Qw(r),(n=Ea.get(n))&&yv(r,n),o=o.createElement("link"),pt(o);var i=o;i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),St(o,"link",r),a.instance=o}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,e),(e=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=Dd.bind(t),e.addEventListener("load",a),e.addEventListener("error",a))}}var Mm=0;function UM(t,e){return t.stylesheets&&t.count===0&&id(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var r=setTimeout(function(){if(t.stylesheets&&id(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&Mm===0&&(Mm=62500*bM());var n=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&id(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>Mm?50:800)+e);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function Dd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)id(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Od=null;function id(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Od=new Map,e.forEach(qM,t),Od=null,Dd.call(t))}function qM(t,e){if(!(e.state.loading&4)){var a=Od.get(t);if(a)var r=a.get(null);else{a=new Map,Od.set(t,a);for(var n=t.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<n.length;o++){var i=n[o];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(a.set(i.dataset.precedence,i),r=i)}r&&a.set(null,r)}n=e.instance,i=n.getAttribute("data-precedence"),o=a.get(i)||r,o===r&&a.set(null,n),a.set(i,n),this.count++,r=Dd.bind(this),n.addEventListener("load",r),n.addEventListener("error",r),o?o.parentNode.insertBefore(n,o.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(n,t.firstChild)),e.state.loading|=4}}var Wl={$$typeof:Er,Provider:null,Consumer:null,_currentValue:bo,_currentValue2:bo,_threadCount:0};function zM(t,e,a,r,n,o,i,s,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nm(0),this.hiddenUpdates=nm(null),this.identifierPrefix=r,this.onUncaughtError=n,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function eL(t,e,a,r,n,o,i,s,l,u,c,d){return t=new zM(t,e,a,i,l,u,c,d,s),e=1,o===!0&&(e|=24),o=na(3,null,null,e),t.current=o,o.stateNode=t,e=jg(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:r,isDehydrated:a,cache:e},Zg(o),t}function tL(t){return t?(t=Di,t):Di}function aL(t,e,a,r,n,o){n=tL(n),r.context===null?r.context=n:r.pendingContext=n,r=En(e),r.payload={element:a},o=o===void 0?null:o,o!==null&&(r.callback=o),a=Tn(t,r,e),a!==null&&(Gt(a,t,e),Al(a,t,e))}function mC(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<e?a:e}}function bv(t,e){mC(t,e),(t=t.alternate)&&mC(t,e)}function rL(t){if(t.tag===13||t.tag===31){var e=Do(t,67108864);e!==null&&Gt(e,t,67108864),bv(t,67108864)}}function gC(t){if(t.tag===13||t.tag===31){var e=ua();e=Rg(e);var a=Do(t,e);a!==null&&Gt(a,t,e),bv(t,e)}}var Bd=!0;function VM(t,e,a,r){var n=ee.T;ee.T=null;var o=xe.p;try{xe.p=2,Sv(t,e,a,r)}finally{xe.p=o,ee.T=n}}function $M(t,e,a,r){var n=ee.T;ee.T=null;var o=xe.p;try{xe.p=8,Sv(t,e,a,r)}finally{xe.p=o,ee.T=n}}function Sv(t,e,a,r){if(Bd){var n=Ig(r);if(n===null)Tm(t,e,r,Fd,a),vC(t,r);else if(GM(n,t,e,a,r))r.stopPropagation();else if(vC(t,r),e&4&&-1<jM.indexOf(t)){for(;n!==null;){var o=as(n);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=vo(o.pendingLanes);if(i!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var l=1<<31-la(i);s.entanglements[1]|=l,i&=~l}ur(o),(ye&6)===0&&(Ld=ia()+500,ou(0,!1))}}break;case 31:case 13:s=Do(o,2),s!==null&&Gt(s,o,2),Xd(),bv(o,2)}if(o=Ig(r),o===null&&Tm(t,e,r,Fd,a),o===n)break;n=o}n!==null&&r.stopPropagation()}else Tm(t,e,r,null,a)}}function Ig(t){return t=Bg(t),Cv(t)}var Fd=null;function Cv(t){if(Fd=null,t=Ai(t),t!==null){var e=Yl(t);if(e===null)t=null;else{var a=e.tag;if(a===13){if(t=_C(e),t!==null)return t;t=null}else if(a===31){if(t=wC(e),t!==null)return t;t=null}else if(a===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Fd=t,null}function nL(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(MT()){case kC:return 2;case EC:return 8;case dd:case DT:return 32;case TC:return 268435456;default:return 32}default:return 32}}var Ag=!1,Dn=null,On=null,Bn=null,Zl=new Map,Xl=new Map,Sn=[],jM="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 vC(t,e){switch(t){case"focusin":case"focusout":Dn=null;break;case"dragenter":case"dragleave":On=null;break;case"mouseover":case"mouseout":Bn=null;break;case"pointerover":case"pointerout":Zl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xl.delete(e.pointerId)}}function gl(t,e,a,r,n,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:a,eventSystemFlags:r,nativeEvent:o,targetContainers:[n]},e!==null&&(e=as(e),e!==null&&rL(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,n!==null&&e.indexOf(n)===-1&&e.push(n),t)}function GM(t,e,a,r,n){switch(e){case"focusin":return Dn=gl(Dn,t,e,a,r,n),!0;case"dragenter":return On=gl(On,t,e,a,r,n),!0;case"mouseover":return Bn=gl(Bn,t,e,a,r,n),!0;case"pointerover":var o=n.pointerId;return Zl.set(o,gl(Zl.get(o)||null,t,e,a,r,n)),!0;case"gotpointercapture":return o=n.pointerId,Xl.set(o,gl(Xl.get(o)||null,t,e,a,r,n)),!0}return!1}function oL(t){var e=Ai(t.target);if(e!==null){var a=Yl(e);if(a!==null){if(e=a.tag,e===13){if(e=_C(a),e!==null){t.blockedOn=e,e0(t.priority,function(){gC(a)});return}}else if(e===31){if(e=wC(a),e!==null){t.blockedOn=e,e0(t.priority,function(){gC(a)});return}}else if(e===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function sd(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var a=Ig(t.nativeEvent);if(a===null){a=t.nativeEvent;var r=new a.constructor(a.type,a);jm=r,a.target.dispatchEvent(r),jm=null}else return e=as(a),e!==null&&rL(e),t.blockedOn=a,!1;e.shift()}return!0}function yC(t,e,a){sd(t)&&a.delete(e)}function WM(){Ag=!1,Dn!==null&&sd(Dn)&&(Dn=null),On!==null&&sd(On)&&(On=null),Bn!==null&&sd(Bn)&&(Bn=null),Zl.forEach(yC),Xl.forEach(yC)}function jc(t,e){t.blockedOn===e&&(t.blockedOn=null,Ag||(Ag=!0,it.unstable_scheduleCallback(it.unstable_NormalPriority,WM)))}var Gc=null;function xC(t){Gc!==t&&(Gc=t,it.unstable_scheduleCallback(it.unstable_NormalPriority,function(){Gc===t&&(Gc=null);for(var e=0;e<t.length;e+=3){var a=t[e],r=t[e+1],n=t[e+2];if(typeof r!="function"){if(Cv(r||a)===null)continue;break}var o=as(a);o!==null&&(t.splice(e,3),e-=3,sg(o,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function es(t){function e(l){return jc(l,t)}Dn!==null&&jc(Dn,t),On!==null&&jc(On,t),Bn!==null&&jc(Bn,t),Zl.forEach(e),Xl.forEach(e);for(var a=0;a<Sn.length;a++){var r=Sn[a];r.blockedOn===t&&(r.blockedOn=null)}for(;0<Sn.length&&(a=Sn[0],a.blockedOn===null);)oL(a),a.blockedOn===null&&Sn.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var n=a[r],o=a[r+1],i=n[Wt]||null;if(typeof o=="function")i||xC(a);else if(i){var s=null;if(o&&o.hasAttribute("formAction")){if(n=o,i=o[Wt]||null)s=i.formAction;else if(Cv(n)!==null)continue}else s=i.action;typeof s=="function"?a[r+1]=s:(a.splice(r,3),r-=3),xC(a)}}}function iL(){function t(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(i){return n=i})},focusReset:"manual",scroll:"manual"})}function e(){n!==null&&(n(),n=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,n=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),n!==null&&(n(),n=null)}}}function _v(t){this._internalRoot=t}Qd.prototype.render=_v.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(M(409));var a=e.current,r=ua();aL(a,r,t,e,null,null)};Qd.prototype.unmount=_v.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;aL(t.current,2,null,t,null,null),Xd(),e[ts]=null}};function Qd(t){this._internalRoot=t}Qd.prototype.unstable_scheduleHydration=function(t){if(t){var e=BC();t={blockedOn:null,target:t,priority:e};for(var a=0;a<Sn.length&&e!==0&&e<Sn[a].priority;a++);Sn.splice(a,0,t),a===0&&oL(t)}};var bC=SC.version;if(bC!=="19.2.4")throw Error(M(527,bC,"19.2.4"));xe.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(M(188)):(t=Object.keys(t).join(","),Error(M(268,t)));return t=LT(e),t=t!==null?LC(t):null,t=t===null?null:t.stateNode,t};var ZM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:ee,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(vl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!vl.isDisabled&&vl.supportsFiber))try{Kl=vl.inject(ZM),sa=vl}catch{}var vl;Jd.createRoot=function(t,e){if(!CC(t))throw Error(M(299));var a=!1,r="",n=K_,o=Q_,i=J_;return e!=null&&(e.unstable_strictMode===!0&&(a=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onUncaughtError!==void 0&&(n=e.onUncaughtError),e.onCaughtError!==void 0&&(o=e.onCaughtError),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=eL(t,1,!1,null,null,a,r,null,n,o,i,iL),t[ts]=e.current,vv(t),new _v(e)};Jd.hydrateRoot=function(t,e,a){if(!CC(t))throw Error(M(299));var r=!1,n="",o=K_,i=Q_,s=J_,l=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(i=a.onCaughtError),a.onRecoverableError!==void 0&&(s=a.onRecoverableError),a.formState!==void 0&&(l=a.formState)),e=eL(t,1,!0,e,a??null,r,n,l,o,i,s,iL),e.context=tL(null),a=e.current,r=ua(),r=Rg(r),n=En(r),n.callback=null,Tn(a,n,r),a=r,e.current.lanes=a,Jl(e,a),ur(e),t[ts]=e.current,vv(t),new Qd(e)};Jd.version="19.2.4"});var Bo=tr((LH,uL)=>{"use strict";function lL(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lL)}catch(t){console.error(t)}}lL(),uL.exports=sL()});var oI=tr(xf=>{"use strict";var V2=Symbol.for("react.transitional.element"),$2=Symbol.for("react.fragment");function nI(t,e,a){var r=null;if(a!==void 0&&(r=""+a),e.key!==void 0&&(r=""+e.key),"key"in e){a={};for(var n in e)n!=="key"&&(a[n]=e[n])}else a=e;return e=a.ref,{$$typeof:V2,type:t,key:r,ref:e!==void 0?e:null,props:a}}xf.Fragment=$2;xf.jsx=nI;xf.jsxs=nI});var Me=tr((z4,iI)=>{"use strict";iI.exports=oI()});var gH={};xS(gH,{ANIMATION_KEYFRAMES:()=>nl,ActivationConfigZ:()=>hc,AddClassZ:()=>Rb,AnchorIdZ:()=>ya,AnchorStateZ:()=>LE,AnchorVisibleConditionZ:()=>ih,AppRegistry:()=>gu,AugmentationZ:()=>IE,BadgePositionZ:()=>bb,BadgeZ:()=>Nb,BoundingBoxZ:()=>wE,CanvasEvents:()=>gs,CanvasRecipeZ:()=>vp,ConditionZ:()=>un,ContextManager:()=>mc,CooldownActiveConditionZ:()=>fh,CounterDefZ:()=>Zs,CtaButtonZ:()=>gh,DEFAULT_COOLDOWN:()=>Ff,DEFAULT_TTL:()=>Bf,DecisionStrategyZ:()=>el,DismissedConditionZ:()=>dh,EVENT_SCHEMA_VERSION:()=>Go,EventBus:()=>yc,EventCountConditionZ:()=>hh,EventFilterZ:()=>RE,EventOccurredConditionZ:()=>sh,EventSourceZ:()=>tS,ExecutorRegistry:()=>fc,ExternalStrategyZ:()=>Js,FrequencyEntryZ:()=>HE,FrequencyLimitConditionZ:()=>ph,HighlightStepZ:()=>dA,HighlightStyleZ:()=>xb,HighlightZ:()=>Bb,InsertHtmlZ:()=>Ob,InsertPositionZ:()=>wb,MAX_VISIBLE_TOASTS:()=>Of,MatchOpZ:()=>Ws,ModalContentZ:()=>_b,ModalZ:()=>Hb,ModelStrategyZ:()=>Qs,MountWidgetZ:()=>zb,NavigateZ:()=>qb,NavigationMonitor:()=>al,NormalizedEventZ:()=>TE,NotificationToastStack:()=>Df,PageContextZ:()=>bE,PageHistoryEntryZ:()=>SE,PageUrlConditionZ:()=>nh,ParallelZ:()=>jb,PlacementZ:()=>Sb,PulseZ:()=>Fb,RUNTIME_SDK_BUILD:()=>pS,RUNTIME_VERSION:()=>lS,RemoveClassZ:()=>Mb,RouteConditionZ:()=>oh,RouteFilterZ:()=>vb,RuleStrategyZ:()=>Ys,RuleZ:()=>Xs,RuntimeContextZ:()=>AE,RuntimeProvider:()=>qf,SDK_SCHEMA_VERSION:()=>jr,SDK_VERSION:()=>Ef,STATIC_SLOT_STYLES:()=>iS,ScoreStrategyZ:()=>Ks,ScrollBehaviorZ:()=>kb,ScrollLogicalPositionZ:()=>mh,ScrollToZ:()=>Ub,SelectorZ:()=>Ty,SequenceZ:()=>$b,SessionContextZ:()=>CE,SessionMetricConditionZ:()=>ch,SessionMetricTracker:()=>Ou,SetAttrZ:()=>Tb,SetStyleZ:()=>Db,SetTextZ:()=>Eb,ShadowCanvasOverlay:()=>ny,ShadowRootProvider:()=>Gv,SmartCanvasApp:()=>iy,SmartCanvasController:()=>Rf,SmartCanvasElement:()=>jf,SmartCanvasPortal:()=>OF,StandardEvents:()=>be,StateEqualsConditionZ:()=>lh,StateStore:()=>bc,StoredValueZ:()=>PE,Syntro:()=>fS,TileCard:()=>vs,TileWheel:()=>gO,TooltipContentZ:()=>Cb,TooltipStepZ:()=>cA,TooltipTriggerZ:()=>Lb,TooltipZ:()=>Pb,TourStepForSchemaZ:()=>Ab,TourZ:()=>Gb,TriggerWhenZ:()=>pc,ViewportConditionZ:()=>uh,ViewportContextZ:()=>_E,WaitZ:()=>Vb,WidgetConfigZ:()=>Ib,WidgetRegistry:()=>Cc,appRegistry:()=>fs,applyStaticSlotStyles:()=>_h,cleanupAppContext:()=>Cf,contentRuntime:()=>ef,coreActionStepSchemas:()=>yE,createActionEngine:()=>rh,createAnchorResolver:()=>vh,createAppContext:()=>Sf,createAppLoader:()=>wf,createCanvasConfigFetcher:()=>Vo,createContextManager:()=>yh,createDecisionEngine:()=>xh,createEventAccumulator:()=>bh,createEventBus:()=>tl,createGrowthBookClient:()=>cp,createNoopClient:()=>xp,createOverlayRecipeFetcher:()=>DF,createPostHogClient:()=>eh,createPostHogNormalizer:()=>Sh,createSessionMetricTracker:()=>dp,createSmartCanvas:()=>Gf,createSmartCanvasController:()=>jv,createSmartCanvasRuntime:()=>Mh,createStateStore:()=>Ch,createSurfaceContainer:()=>kh,createSurfaces:()=>Th,decisionSchemas:()=>OP,decodeToken:()=>_c,encodeToken:()=>Dh,evaluate:()=>Yb,evaluateCondition:()=>Zb,evaluateRule:()=>Xb,evaluateRuleStrategy:()=>gc,evaluateScoreStrategy:()=>vc,evaluateSync:()=>Kb,executorRegistry:()=>br,getAntiFlickerSnippet:()=>DI,getAppIdFromActionKind:()=>Pv,getAppIdFromWidgetId:()=>_f,getExecutor:()=>mE,getSlotAnchorId:()=>Sc,getSlotType:()=>rl,getSlotZIndex:()=>Eh,hasExecutor:()=>th,interpolateTemplate:()=>bu,isCoreActionKind:()=>Nv,matchEvent:()=>Nf,needsMigration:()=>bO,normalizePostHogEvent:()=>Jb,overlaysRuntime:()=>bf,parseVersion:()=>xs,playEnterAnimation:()=>Ih,playExitAnimation:()=>Ah,registerConfigPredicates:()=>xu,registerSmartCanvasElement:()=>ly,resolveConfigUri:()=>Tf,setupAdjacentPositioning:()=>wh,setupInlinePositioning:()=>Lh,shouldNormalizeEvent:()=>eS,useDecision:()=>QI,useNotifications:()=>Pf,useNotifyWatcher:()=>Uf,usePageContext:()=>zf,useRuntime:()=>dr,useRuntimeContext:()=>Su,useRuntimeEvents:()=>YI,useRuntimeState:()=>KI,useSessionContext:()=>ZI,useShadowCanvasConfig:()=>oy,useShadowRoot:()=>jo,useViewportContext:()=>XI,validateAction:()=>ln,validateActions:()=>ah,validateActivationConfig:()=>DP,validateCondition:()=>RP,validateConfig:()=>vO,validateEventFilter:()=>YP,validateFrequencyEntry:()=>tH,validateNormalizedEvent:()=>XP,validateRecipe:()=>MF,validateRuntimeContext:()=>GP,validateStoredValue:()=>eH,validateStrategy:()=>MP,widgetRegistry:()=>Rh});var XE=K(We(),1),Oh=K(sl(),1),mH=K(Bo(),1);function cL(t,e,a,r){let n=r?.maxRetries??3,o=r?.debounceMs??50,i=t.parentElement??e.parentElement;if(!i)return()=>{};let s=0,l=null,u=!1,c=new MutationObserver(d=>{if(!u){for(let p of d)for(let g of p.removedNodes)if(g===t){if(s>=n){c.disconnect(),u=!0;return}l&&clearTimeout(l),l=setTimeout(()=>{if(!u){s++;try{a()}catch{c.disconnect(),u=!0}}},o);return}}});return c.observe(i,{childList:!0,subtree:!0}),()=>{u=!0,c.disconnect(),l&&clearTimeout(l)}}var XM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function wv(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let a=document.createElement("template");a.innerHTML=t;let r=a.content,n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;n.nextNode();){let i=n.currentNode,s=i.tagName.toLowerCase();if(!XM.has(s)){o.push(i);continue}for(let l of Array.from(i.attributes)){let u=l.name.toLowerCase(),c=l.value.trim().toLowerCase(),d=u.startsWith("on"),g=(u==="href"||u==="src"||u==="formaction")&&(c.startsWith("javascript:")||c.startsWith("vbscript:")||c.startsWith("data:text/html"));(d||g)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var dL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=wv(t.html),n="data-syntro-insert-label",o=t.label;if(o){let d=CSS.escape(o),g=(a.parentElement??a).querySelector(`[${n}="${d}"]`);g&&g.remove()}let i=document.createElement("div");i.setAttribute("data-syntro-action-id",e.generateId()),o&&i.setAttribute(n,o),i.innerHTML=r;let s=null;switch(t.position){case"before":a.insertAdjacentElement("beforebegin",i);break;case"after":a.insertAdjacentElement("afterend",i);break;case"prepend":a.insertBefore(i,a.firstChild);break;case"append":a.appendChild(i);break;case"replace":s=a.innerHTML,a.replaceWith(i);break}let l=null;if(t.deepLink){let{tileId:d,itemId:p}=t.deepLink;l=()=>{let g=window.SynOS?.handle;g&&(g.open(),g.runtime?.events?.publish("notification.deep_link",{tileId:d,itemId:p}))},i.style.cursor="pointer",i.addEventListener("click",l)}e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position});let c=cL(i,a,()=>{switch(t.position){case"before":a.insertAdjacentElement("beforebegin",i);break;case"after":a.insertAdjacentElement("afterend",i);break;case"prepend":a.insertBefore(i,a.firstChild);break;case"append":a.appendChild(i);break;case"replace":break}});return{cleanup:()=>{if(l&&i.removeEventListener("click",l),c(),t.position==="replace"&&s!==null){let d=document.createElement(a.tagName);d.innerHTML=s,Array.from(a.attributes).forEach(p=>{d.setAttribute(p.name,p.value)}),i.replaceWith(d)}else i.remove()},updateFn:d=>{"html"in d&&typeof d.html=="string"&&(i.innerHTML=wv(d.html))}}},fL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.textContent??"";return a.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{a.textContent=r},updateFn:n=>{"text"in n&&typeof n.text=="string"&&(a.textContent=n.text)}}},pL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=t.attr.toLowerCase();if(r.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);if(r==="href"||r==="src"||r==="formaction"){let s=t.value.trim().toLowerCase();if(s.startsWith("javascript:")||s.startsWith("vbscript:")||s.startsWith("data:text/html"))throw new Error(`Dangerous URL not allowed in ${t.attr}: ${t.value}`)}let o=a.getAttribute(t.attr),i=a.hasAttribute(t.attr);return a.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{i&&o!==null?a.setAttribute(t.attr,o):a.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&a.setAttribute(t.attr,s.value)}}},hL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.classList.contains(t.className);return a.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r||a.classList.remove(t.className)}}},mL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.classList.contains(t.className);return a.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r&&a.classList.add(t.className)}}},gL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=new Map;for(let n of Object.keys(t.styles)){let o=a.style.getPropertyValue(n);r.set(n,o)}for(let[n,o]of Object.entries(t.styles))a.style.setProperty(n,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[n,o]of r)o?a.style.setProperty(n,o):a.style.removeProperty(n)},updateFn:n=>{if("styles"in n&&typeof n.styles=="object"&&n.styles)for(let[o,i]of Object.entries(n.styles))a.style.setProperty(o,i)}}},Lv=[{kind:"content:insertHtml",executor:dL},{kind:"content:setText",executor:fL},{kind:"content:setAttr",executor:pL},{kind:"content:addClass",executor:hL},{kind:"content:removeClass",executor:mL},{kind:"content:setStyle",executor:gL}],ef={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:Lv};var YM={light:50,medium:100,heavy:200},KM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],vL={init(t,e,a){let r=YM[a.intensity],n=a.colors.length>0?a.colors:KM,o=[];for(let i=0;i<r;i++)o.push({x:Math.random()*t,y:Math.random()*-e*.3,vx:(Math.random()-.5)*4,vy:Math.random()*2+1,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.2,size:Math.random()*6+4,color:n[Math.floor(Math.random()*n.length)],opacity:1,shape:Math.random()>.5?"rect":"circle"});return o},update(t,e,a){let r=!1;for(let n of t)n.vy+=.15,n.vx*=.99,n.x+=n.vx,n.y+=n.vy,n.rotation+=n.rotationSpeed,n.y>0&&n.opacity>0&&n.y>500&&(n.opacity-=.02,n.opacity<0&&(n.opacity=0)),n.opacity>.01&&(r=!0);return r},render(t,e){for(let a of e)a.opacity<.01||(t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.translate(a.x,a.y),t.rotate(a.rotation),a.shape==="circle"?(t.beginPath(),t.arc(0,0,a.size/2,0,Math.PI*2),t.fill()):t.fillRect(-a.size/2,-a.size/2,a.size,a.size*.6),t.restore())}};var QM={light:20,medium:40,heavy:80},JM="\u{1F389}",yL={init(t,e,a){let r=QM[a.intensity],n=typeof a.props?.emoji=="string"?a.props.emoji:JM,o=[];for(let i=0;i<r;i++)o.push({x:Math.random()*t,y:Math.random()*-200,vx:0,vy:Math.random()*1.5+1,rotation:0,rotationSpeed:0,size:Math.random()*12+16,color:"#000000",opacity:1,shape:"emoji",emoji:n,data:{wobblePhase:Math.random()*Math.PI*2,wobbleAmp:Math.random()*1.5+.5,originX:0}});for(let i of o)i.data&&(i.data.originX=i.x);return o},update(t,e,a){let r=!1;for(let n of t){n.y+=n.vy;let o=n.data?.wobblePhase??0,i=n.data?.wobbleAmp??1,s=n.data?.originX??n.x;n.x=s+Math.sin(a*.003+o)*i*20,n.y>600&&(n.opacity-=.02,n.opacity<0&&(n.opacity=0)),n.opacity>.01&&(r=!0)}return r},render(t,e){for(let a of e)a.opacity<.01||!a.emoji||(t.save(),t.globalAlpha=a.opacity,t.font=`${a.size}px serif`,t.textAlign="center",t.textBaseline="middle",t.fillText(a.emoji,a.x,a.y),t.restore())}};var e2={light:20,medium:40,heavy:80},t2={light:3,medium:4,heavy:5},xL={init(t,e,a){let r=e2[a.intensity],n=t2[a.intensity],o=a.colors.length>0?a.colors:["#ff4444","#44ff44","#4444ff"],i=[];for(let s=0;s<n;s++){let l=Math.random()*t*.8+t*.1,u=Math.random()*e*.6,c=o[Math.floor(Math.random()*o.length)];for(let d=0;d<r;d++){let p=Math.PI*2*d/r+(Math.random()-.5)*.3,g=Math.random()*3+2;i.push({x:l,y:u,vx:Math.cos(p)*g,vy:Math.sin(p)*g,rotation:0,rotationSpeed:0,size:Math.random()*3+2,color:c,opacity:1,shape:"circle",data:{centerX:l,centerY:u}})}}return i},update(t,e,a){let r=!1;for(let n of t)n.vx*=.97,n.vy*=.97,n.vy+=.03,n.x+=n.vx,n.y+=n.vy,n.opacity-=.008,n.opacity<0&&(n.opacity=0),n.opacity>.01&&(r=!0);return r},render(t,e){for(let a of e)a.opacity<.01||(t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.shadowBlur=12,t.shadowColor=a.color,t.beginPath(),t.arc(a.x,a.y,a.size,0,Math.PI*2),t.fill(),t.restore())}};var a2={light:30,medium:60,heavy:120},bL={init(t,e,a){let r=a2[a.intensity],n=a.colors.length>0?a.colors:["#ffd700","#ffffff","#fffacd"],o=[];for(let i=0;i<r;i++)o.push({x:Math.random()*t,y:Math.random()*e,vx:(Math.random()-.5)*.3,vy:-(Math.random()*.5+.2),rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.1,size:Math.random()*4+2,color:n[Math.floor(Math.random()*n.length)],opacity:Math.random()*.5+.5,shape:"circle",data:{phase:Math.random()*Math.PI*2,baseOpacity:Math.random()*.5+.5}});return o},update(t,e,a){let r=!1;for(let n of t){n.x+=n.vx,n.y+=n.vy,n.rotation+=n.rotationSpeed,n.data&&(n.data.baseOpacity=(n.data.baseOpacity??1)-.001,n.data.baseOpacity<0&&(n.data.baseOpacity=0));let o=n.data?.phase??0,i=n.data?.baseOpacity??1;if(i<=.01)n.opacity=0;else{let s=Math.sin(a*.005+o)*.4+.6;n.opacity=i*s}n.opacity>.01&&(r=!0)}return r},render(t,e){for(let a of e){if(a.opacity<.01)continue;t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.translate(a.x,a.y),t.rotate(a.rotation);let r=a.size;t.beginPath(),t.moveTo(0,-r),t.lineTo(r*.3,-r*.3),t.lineTo(r,0),t.lineTo(r*.3,r*.3),t.lineTo(0,r),t.lineTo(-r*.3,r*.3),t.lineTo(-r,0),t.lineTo(-r*.3,-r*.3),t.closePath(),t.fill(),t.restore()}}};var tf=class{constructor(){this.canvas=null,this.ctx=null,this.rafId=null,this.particles=[],this.startTime=0,this.lastFrame=0,this.duration=0,this.effect=null,this.container=null}start(e,a,r){this.container=e,this.effect=a,this.duration=r.duration;let n=document.createElement("canvas");n.setAttribute("data-syntro-celebrate",""),Object.assign(n.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let o=window.devicePixelRatio||1,i=window.innerWidth,s=window.innerHeight;n.width=i*o,n.height=s*o,n.style.width=`${i}px`,n.style.height=`${s}px`;let l=n.getContext("2d");l&&(l.scale(o,o),this.canvas=n,this.ctx=l,e.appendChild(n),this.particles=a.init(i,s,r),this.startTime=performance.now(),this.lastFrame=this.startTime,this.tick=this.tick.bind(this),this.rafId=requestAnimationFrame(this.tick))}stop(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.canvas&&this.container&&(this.canvas.remove(),this.canvas=null),this.ctx=null,this.effect=null,this.container=null,this.particles=[]}tick(e){if(!this.ctx||!this.canvas||!this.effect)return;let a=e-this.startTime,r=e-this.lastFrame;if(this.lastFrame=e,a>=this.duration){this.stop();return}let n=this.canvas.width/(window.devicePixelRatio||1),o=this.canvas.height/(window.devicePixelRatio||1);if(this.ctx.clearRect(0,0,n,o),!this.effect.update(this.particles,r,a)){this.stop();return}this.effect.render(this.ctx,this.particles),this.rafId=requestAnimationFrame(this.tick)}};var r2=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"];function n2(t,e){return[t,e,`${t}cc`,`${e}cc`,"#ffffff",`${t}80`]}function o2(t){try{let e=getComputedStyle(t),a=e.getPropertyValue("--sc-color-primary")?.trim(),r=e.getPropertyValue("--sc-color-primary-hover")?.trim();if(a?.startsWith("#")&&a.length>=7)return n2(a,r||a)}catch{}return null}var SL=new Map([["confetti",vL],["fireworks",xL],["sparkles",bL],["emoji-rain",yL]]),CL=async(t,e)=>{let a=SL.get(t.effect);if(!a)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...SL.keys()].join(", ")}`),{cleanup:()=>{}};let r=t.colors??o2(e.overlayRoot)??r2,n={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:r,props:t.props},o=new tf;return o.start(e.overlayRoot,a,n),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{o.stop()}}};var Av="syntro_active_tour",af=new Map;function i2(t){try{let e=localStorage.getItem(Av);if(!e)return null;let a=JSON.parse(e);return a.tourId!==t?null:a}catch{return null}}function Iv(t){try{localStorage.setItem(Av,JSON.stringify(t))}catch{}}function s2(){try{localStorage.removeItem(Av)}catch{}}function lu(){return window.location.pathname}function l2(t){if(!t.route)return!0;let e=lu();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var kv=async(t,e)=>{let{tourId:a,steps:r,startStep:n,autoStart:o=!0}=t;if(r.length===0)throw new Error(`Tour "${a}" has no steps`);if(af.has(a))return{cleanup:async()=>{let v=af.get(a);v&&await v.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let i=i2(a),s=!!i;if(!s&&!o)return{cleanup:()=>{}};i||(i={tourId:a,currentStepId:n||r[0].id,startedAt:Date.now()},Iv(i));let l=r.findIndex(v=>v.id===i.currentStepId);if(l===-1){let v=n||r[0].id;l=r.findIndex(y=>y.id===v),l===-1&&(l=0),i.currentStepId=r[l].id,Iv(i)}let u=r[l];if(!l2(u))return e.publishEvent("tour.waiting_for_route",{tourId:a,stepId:u.id,expectedRoute:u.route,currentRoute:lu()}),{cleanup:()=>{}};let c=!1,d=null,p=null,g=null,S=async()=>{p&&(p(),p=null),d?.isApplied()&&(await d.revert(),d=null)},b=async v=>{if(c)return;if(await S(),v==="end"){s2(),e.publishEvent("tour.completed",{tourId:a,totalSteps:r.length}),c=!0;return}let y=r.find(_=>_.id===v);if(!y){console.error(`[Tour] Step "${v}" not found`);return}if(i.currentStepId=v,Iv(i),e.publishEvent("tour.step_changed",{tourId:a,previousStepId:u.id,nextStepId:v}),y.route&&y.route!==lu()){e.publishEvent("tour.awaiting_navigation",{tourId:a,stepId:v,targetRoute:y.route});return}await x(y)},x=async v=>{if(!c){e.publishEvent("tour.step_started",{tourId:a,stepId:v.id,stepIndex:r.findIndex(y=>y.id===v.id),totalSteps:r.length});try{d=await e.applyAction(v.action)}catch(y){console.error(`[Tour] Failed to execute step "${v.id}":`,y),e.publishEvent("tour.step_failed",{tourId:a,stepId:v.id,error:String(y)});return}if(v.onAction&&e.subscribeEvent){p=e.subscribeEvent("action.modal_cta_clicked",w=>{let C=w?.actionId;if(C&&v.onAction){let A=v.onAction[C];A&&b(A)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",w=>{let C=w?.actionId;if(C&&v.onAction){let A=v.onAction[C];A&&b(A)}}),_=p;p=()=>{_(),y()}}}};g=(()=>{let v=lu(),y=()=>{let C=lu();C!==v&&(v=C,e.publishEvent("tour.route_changed",{tourId:a,newRoute:C}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>y());window.addEventListener("popstate",y);let _=history.pushState.bind(history),w=history.replaceState.bind(history);return history.pushState=(...C)=>{_(...C),queueMicrotask(y)},history.replaceState=(...C)=>{w(...C),queueMicrotask(y)},()=>{window.removeEventListener("popstate",y),history.pushState=_,history.replaceState=w}})(),s?e.publishEvent("tour.resumed",{tourId:a,stepId:i.currentStepId}):e.publishEvent("tour.started",{tourId:a,totalSteps:r.length,startStepId:i.currentStepId}),await x(u);let m=async()=>{c=!0,af.delete(a),await S(),g&&g(),e.publishEvent("tour.paused",{tourId:a,stepId:i.currentStepId})};return af.set(a,{cleanup:m}),{cleanup:m}};var Va={white:"#ffffff",black:"#000000"},ne={0:"#2c0b0a",1:"#5b1715",2:"#89221f",3:"#b72e2a",4:"#d44844",5:"#dd6d69",6:"#e5918f",7:"#eeb6b4",8:"#f6dada",9:"#faebea"},I={0:"#07080a",1:"#0f1318",2:"#0e1114",3:"#1c222a",4:"#2b333f",5:"#394454",6:"#475569",7:"#677384",8:"#87919f",9:"#a8afba",10:"#cbd0d7",11:"#e8eaee",12:"#f6f7f9"},ke={0:"#07230a",1:"#0e4514",2:"#16681e",3:"#1d8a28",4:"#24ad32",5:"#4fbd5a",6:"#7acd82",7:"#a5deab",8:"#d0eed3",9:"#e5f6e7"},Ct={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},ze={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},fa={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},uu={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},Ft={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},cu={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var pa={primary:I[10],secondary:I[9],tertiary:I[8]},VH={primary:I[2],secondary:I[0]},Ev={primary:I[4],secondary:I[3]},rf={primary:{text:Va.white,icon:Va.white,border:ne[3],backgroundDefault:ne[3],backgroundHover:ne[2]},neutral:{text:I[10],textHover:Va.white,icon:I[10],iconHover:Va.white,border:I[4],background:I[2]},link:{text:Va.white,icon:Va.white,hover:ne[5]},error:{text:ze[5],hover:ze[6]},success:{text:ke[5],hover:ke[6]}},$H={slateGrey:{content:I[10],pillOutline:I[10],borderPrimary:I[5],borderSecondary:I[5],background:I[3]},brand:{content:ne[9],pillOutline:ne[9],borderPrimary:ne[6],borderSecondary:ne[6],background:ne[0]},red:{content:ze[8],pillOutline:ze[4],borderPrimary:ze[2],borderSecondary:ze[2],background:ze[0]},yellow:{content:Ct[8],pillOutline:Ct[4],borderPrimary:Ct[2],borderSecondary:Ct[2],background:Ct[0]},green:{content:ke[8],pillOutline:ke[4],borderPrimary:ke[2],borderSecondary:ke[2],background:ke[0]},purple:{content:Ft[8],pillOutline:Ft[4],borderPrimary:Ft[2],borderSecondary:Ft[2],background:Ft[0]},blue:{content:fa[8],pillOutline:fa[4],borderPrimary:fa[2],borderSecondary:fa[2],background:fa[0]},orange:{content:uu[8],pillOutline:uu[4],borderPrimary:uu[2],borderSecondary:uu[2],background:uu[0]},pink:{content:cu[8],pillOutline:cu[4],borderPrimary:cu[2],borderSecondary:cu[2],background:cu[0]}},jH={green:{content:ke[8],border:ke[2],background:ke[0]},yellow:{content:Ct[8],border:Ct[2],background:Ct[0]},red:{content:ze[8],border:ze[2],background:ze[0]}},GH={green:{content:ke[1],background:ke[9]},yellow:{content:Ct[1],background:Ct[9]},red:{content:ze[1],background:ze[9]}},WH={content:I[10],border:I[4],background:"#1c2124"},ZH={backgroundDefault:I[2],backgroundHover:I[1],selected:I[3]},XH={background:I[2],icon:I[10],borderDefault:I[4],borderSelected:ne[3],textLabel:I[9],textPlaceholder:I[8],textHint:I[8]},YH={backgroundDefault:I[2],backgroundDisabled:I[0],textLabel:I[9],textPlaceholder:I[8],textHint:I[8],textError:ze[5],iconDefault:I[9],iconPlaceholder:I[10],iconError:ze[5],borderDefault:I[4],borderSelected:ne[3],borderError:ze[5]},KH={handleDefault:Va.white,handleDisabled:I[10],off:{backgroundDefault:I[4],backgroundHover:I[5],backgroundDisabled:I[4]},on:{backgroundDefault:ke[3],backgroundHover:ke[2],backgroundDisabled:I[4]}},QH={off:{backgroundDefault:"#00000000",backgroundHover:I[5],backgroundDisabled:I[2],border:I[6]},on:{backgroundDefault:ke[0],backgroundHover:ke[1],backgroundDisabled:I[2],border:ke[3]}},JH={content:I[10],background:I[4]},e4={background:I[4],active:ke[3]},t4={background:I[1],content:I[9],border:I[4]},a4={backgroundDefault:I[1],backgroundHover:I[3],backgroundActive:I[4],border:I[4],contentPrimary:I[10],contentSecondary:I[9],contentTertiary:I[8]},r4={background:I[1],content:I[9],border:I[4]},n4={activeBackground:I[3],activeContent:ne[5],inactiveContent:I[9],border:I[4]},o4={header:{textDefault:I[9],textHover:I[8],backgroundDefault:I[1]},border:I[4],cell:{textPrimary:I[10],textSecondary:I[9],backgroundDefault:I[2],backgroundHover:I[1]}},i4={textPrimaryDefault:I[10],textPrimaryHover:I[10],textSecondaryDefault:I[8],textSecondaryHover:I[9],iconPrimary:I[10],iconSecondary:I[8]},s4={background:ke[1],active:ke[5]},l4={textDefault:I[10],textSelected:Va.white,textDisabled:I[7],backgroundDefault:I[2],backgroundMiddle:I[3],backgroundSelected:ne[3],border:I[4]},u4=I[9];var _L=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function wL(t,e,a){let r=a?.paddingPx??12,n=a?.radiusPx??12,o=Math.min(Math.max(a?.scrimOpacity??.55,0),1),i=a?.ringColor??`var(--syntro-ring, ${fa[5]})`,s=a?.blocking??!1,l=a?.onClickOutside??!0,u=a?.onEsc??!0,c=getComputedStyle(document.documentElement),d=c.getPropertyValue("--syntro-spotlight-backdrop").trim(),p=c.getPropertyValue("--syntro-ring").trim(),g=document.createElement("div");g.className="syntro-spotlight-scrim";let S=s||l;Object.assign(g.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:S?"auto":"none",background:d||`rgba(2, 6, 23, ${o})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(g),requestAnimationFrame(()=>g.style.opacity="1");let b=document.createElement("div");b.className="syntro-spotlight-ring",Object.assign(b.style,{position:"fixed",pointerEvents:"none",borderRadius:`${n}px`,border:`2px solid ${i||p||fa[5]}`,boxShadow:"0 0 0 4px rgba(255,255,255,0.35)",zIndex:"2147483647",transition:"all 220ms cubic-bezier(0.16,1,0.3,1)"}),e.appendChild(b);let x=[];if(!_L)for(let E=0;E<4;E++){let L=document.createElement("div");L.style.position="fixed",L.style.background="inherit",x.push(L),g.appendChild(L)}let f=E=>{g.style.clipPath=E,g.style.webkitClipPath=E},m=()=>{if(!t.isConnected){A.destroy();return}let E=t.getBoundingClientRect(),L=Math.max(0,E.left-r),k=Math.max(0,E.top-r),D=Math.min(window.innerWidth,E.width+r*2),R=Math.min(window.innerHeight,E.height+r*2);if(Object.assign(b.style,{left:`${L}px`,top:`${k}px`,width:`${D}px`,height:`${R}px`}),_L){let F=window.innerWidth,N=window.innerHeight,U=Math.min(n,D/2,R/2),Y=`M 0 0 L ${F} 0 L ${F} ${N} L 0 ${N} Z`,B=`M ${L+U} ${k} A ${U} ${U} 0 0 0 ${L} ${k+U} L ${L} ${k+R-U} A ${U} ${U} 0 0 0 ${L+U} ${k+R} L ${L+D-U} ${k+R} A ${U} ${U} 0 0 0 ${L+D} ${k+R-U} L ${L+D} ${k+U} A ${U} ${U} 0 0 0 ${L+D-U} ${k} L ${L+U} ${k} Z`;f(`path('${Y} ${B}')`)}else{let[F,N,U,Y]=x;Object.assign(F.style,{left:"0px",top:"0px",width:"100vw",height:`${k}px`}),Object.assign(U.style,{left:"0px",top:`${k+R}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(k+R))}px`}),Object.assign(Y.style,{left:"0px",top:`${k}px`,width:`${L}px`,height:`${R}px`}),Object.assign(N.style,{left:`${L+D}px`,top:`${k}px`,width:`${Math.max(0,window.innerWidth-(L+D))}px`,height:`${R}px`})}},v=new ResizeObserver(()=>requestAnimationFrame(m));v.observe(t);let y=()=>requestAnimationFrame(m),_=()=>requestAnimationFrame(m);window.addEventListener("scroll",y,!0),window.addEventListener("resize",_);let w=E=>{E.key==="Escape"&&u&&A.destroy()};u&&window.addEventListener("keydown",w);let C=E=>{s?(E.preventDefault(),E.stopPropagation()):l&&A.destroy()};g.addEventListener("click",C);let A={destroy(){v.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",_),u&&window.removeEventListener("keydown",w),g.removeEventListener("click",C),g.style.pointerEvents="none",g.style.opacity="0",setTimeout(()=>{g.remove(),b.remove()},220)}};return m(),A}var u2=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function ha(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let a=document.createElement("template");a.innerHTML=t;let r=a.content,n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;n.nextNode();){let i=n.currentNode,s=i.tagName.toLowerCase();if(!u2.has(s)){o.push(i);continue}for(let l of Array.from(i.attributes)){let u=l.name.toLowerCase(),c=l.value.trim().toLowerCase(),d=u.startsWith("on"),p=(u==="href"||u==="src")&&c.startsWith("javascript:");(d||p)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var Fo={bg:"var(--sc-overlay-background, #ffffff)",title:"var(--sc-overlay-title-color, var(--sc-overlay-text-color, #111827))",text:"var(--sc-overlay-text-color, #4b5563)",accent:"var(--sc-color-primary, #4f46e5)",radius:"var(--sc-border-radius, 12px)"},Tv=async(t,e)=>{let{content:a,size:r="md",blocking:n=!1,scrim:o,dismiss:i,ctaButtons:s}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
|
|
10
10
|
position: fixed;
|
|
11
11
|
inset: 0;
|
|
12
|
-
background: rgba(0, 0, 0, ${
|
|
12
|
+
background: rgba(0, 0, 0, ${o?.opacity??.6});
|
|
13
13
|
z-index: 2147483645;
|
|
14
14
|
opacity: 0;
|
|
15
15
|
transition: opacity 200ms ease-out;
|
|
16
|
-
`,e.overlayRoot.appendChild(l);let
|
|
16
|
+
`,e.overlayRoot.appendChild(l);let u=document.createElement("div");u.className=`syntro-modal syntro-modal-${r}`,u.setAttribute("role","dialog"),u.setAttribute("aria-modal","true");let c={sm:"360px",md:"480px",lg:"640px"};u.style.cssText=`
|
|
17
17
|
position: fixed;
|
|
18
18
|
top: 50%;
|
|
19
19
|
left: 50%;
|
|
20
20
|
transform: translate(-50%, -50%) scale(0.95);
|
|
21
|
-
max-width: ${
|
|
21
|
+
max-width: ${c[r]};
|
|
22
22
|
width: 90%;
|
|
23
|
-
background: ${
|
|
24
|
-
border-radius:
|
|
23
|
+
background: ${Fo.bg};
|
|
24
|
+
border-radius: ${Fo.radius};
|
|
25
25
|
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
26
26
|
z-index: 2147483646;
|
|
27
27
|
opacity: 0;
|
|
28
28
|
transition: opacity 200ms ease-out, transform 200ms ease-out;
|
|
29
29
|
padding: 24px;
|
|
30
|
-
`;let
|
|
30
|
+
`;let d="";if(a.title&&(d+=`<h2 class="syntro-modal-title" style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: ${Fo.title};">${ha(a.title)}</h2>`),d+=`<div class="syntro-modal-body" style="color: ${Fo.text}; line-height: 1.5;">${ha(a.body)}</div>`,i?.closeButton!==!1&&(d+=`
|
|
31
31
|
<button class="syntro-modal-close" data-syntro-action="dismiss" style="
|
|
32
32
|
position: absolute;
|
|
33
33
|
top: 16px;
|
|
@@ -36,16 +36,17 @@ Error generating stack: `+i.message+`
|
|
|
36
36
|
border: none;
|
|
37
37
|
cursor: pointer;
|
|
38
38
|
padding: 4px;
|
|
39
|
-
color:
|
|
39
|
+
color: ${Fo.text};
|
|
40
|
+
opacity: 0.6;
|
|
40
41
|
" aria-label="Close">
|
|
41
42
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
|
|
42
43
|
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
|
|
43
44
|
</svg>
|
|
44
45
|
</button>
|
|
45
|
-
`),s&&s.length>0){
|
|
46
|
+
`),s&&s.length>0){d+='<div class="syntro-modal-actions" style="display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end;">';for(let _ of s){let w=_.primary??!1;d+=`
|
|
46
47
|
<button
|
|
47
|
-
class="syntro-modal-btn ${
|
|
48
|
-
data-syntro-action="${
|
|
48
|
+
class="syntro-modal-btn ${w?"syntro-modal-btn-primary":""}"
|
|
49
|
+
data-syntro-action="${ha(_.actionId)}"
|
|
49
50
|
style="
|
|
50
51
|
padding: 10px 20px;
|
|
51
52
|
border-radius: 8px;
|
|
@@ -53,79 +54,97 @@ Error generating stack: `+i.message+`
|
|
|
53
54
|
font-weight: 500;
|
|
54
55
|
cursor: pointer;
|
|
55
56
|
transition: background 150ms ease;
|
|
56
|
-
${
|
|
57
|
+
${w?`background: ${Fo.accent}; color: white; border: none;`:`background: transparent; color: ${Fo.accent}; border: 1px solid currentColor; opacity: 0.7;`}
|
|
57
58
|
"
|
|
58
59
|
>
|
|
59
|
-
${
|
|
60
|
+
${ha(_.label)}
|
|
60
61
|
</button>
|
|
61
|
-
`}f+="</div>"}c.innerHTML=f,e.overlayRoot.appendChild(c);let h=null,g=c.querySelectorAll("[data-syntro-action]"),_=S=>{let A=S.currentTarget.getAttribute("data-syntro-action");A&&(h=A,e.publishEvent("action.modal_cta_clicked",{actionId:A}),v.destroy())};g.forEach(S=>S.addEventListener("click",_));let b=S=>{S.key==="Escape"&&o?.onEsc!==!1&&v.destroy()};window.addEventListener("keydown",b);let w=()=>{r||v.destroy()};l.addEventListener("click",w);let d=[];r&&Array.from(document.body.children).forEach(S=>{S!==e.overlayRoot&&S.getAttribute("inert")===null&&!S.querySelector("[data-syntro-editor-panel]")&&!S.hasAttribute("data-syntro-editor-panel")&&(S.setAttribute("inert",""),d.push(S))});let p;o?.timeoutMs&&(p=setTimeout(()=>{v.destroy()},o.timeoutMs));let m=c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m.length>0&&requestAnimationFrame(()=>m[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",c.style.opacity="1",c.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:i,blocking:r});let v={destroy(){p&&clearTimeout(p),window.removeEventListener("keydown",b),l.removeEventListener("click",w),g.forEach(S=>S.removeEventListener("click",_)),d.forEach(S=>S.removeAttribute("inert")),c.style.pointerEvents="none",l.style.pointerEvents="none",c.style.opacity="0",c.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{c.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:h})}};return{cleanup:()=>{v.destroy()}}};var Ow=["top","right","bottom","left"];var Nr=Math.min,Li=Math.max,Yl=Math.round,Wl=Math.floor,Bn=t=>({x:t,y:t}),JO={left:"right",right:"left",bottom:"top",top:"bottom"},eM={start:"end",end:"start"};function Dd(t,e,n){return Li(t,Nr(e,n))}function Ea(t,e){return typeof t=="function"?t(e):t}function Dr(t){return t.split("-")[0]}function Xo(t){return t.split("-")[1]}function Um(t){return t==="x"?"y":"x"}function Ld(t){return t==="y"?"height":"width"}var tM=new Set(["top","bottom"]);function Hi(t){return tM.has(Dr(t))?"y":"x"}function Hd(t){return Um(Hi(t))}function Mw(t,e,n){n===void 0&&(n=!1);let i=Xo(t),r=Hd(t),a=Ld(r),o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(o=Zl(o)),[o,Zl(o)]}function Nw(t){let e=Zl(t);return[Nd(t),e,Nd(e)]}function Nd(t){return t.replace(/start|end/g,e=>eM[e])}var kw=["left","right"],Rw=["right","left"],nM=["top","bottom"],iM=["bottom","top"];function rM(t,e,n){switch(t){case"top":case"bottom":return n?e?Rw:kw:e?kw:Rw;case"left":case"right":return e?nM:iM;default:return[]}}function Dw(t,e,n,i){let r=Xo(t),a=rM(Dr(t),n==="start",i);return r&&(a=a.map(o=>o+"-"+r),e&&(a=a.concat(a.map(Nd)))),a}function Zl(t){return t.replace(/left|right|bottom|top/g,e=>JO[e])}function aM(t){return{top:0,right:0,bottom:0,left:0,...t}}function Vm(t){return typeof t!="number"?aM(t):{top:t,right:t,bottom:t,left:t}}function Ca(t){let{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function Lw(t,e,n){let{reference:i,floating:r}=t,a=Hi(e),o=Hd(e),s=Ld(o),l=Dr(e),c=a==="y",u=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[s]/2-r[s]/2,g;switch(l){case"top":g={x:u,y:i.y-r.height};break;case"bottom":g={x:u,y:i.y+i.height};break;case"right":g={x:i.x+i.width,y:f};break;case"left":g={x:i.x-r.width,y:f};break;default:g={x:i.x,y:i.y}}switch(Xo(e)){case"start":g[o]-=h*(n&&c?-1:1);break;case"end":g[o]+=h*(n&&c?-1:1);break}return g}async function zw(t,e){var n;e===void 0&&(e={});let{x:i,y:r,platform:a,rects:o,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:g=0}=Ea(e,t),_=Vm(g),w=s[h?f==="floating"?"reference":"floating":f],d=Ca(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(w)))==null||n?w:w.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),p=f==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,m=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),v=await(a.isElement==null?void 0:a.isElement(m))?await(a.getScale==null?void 0:a.getScale(m))||{x:1,y:1}:{x:1,y:1},S=Ca(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:p,offsetParent:m,strategy:l}):p);return{top:(d.top-S.top+_.top)/v.y,bottom:(S.bottom-d.bottom+_.bottom)/v.y,left:(d.left-S.left+_.left)/v.x,right:(S.right-d.right+_.right)/v.x}}var Bw=async(t,e,n)=>{let{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e)),c=await o.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:f}=Lw(c,i,l),h=i,g={},_=0;for(let w=0;w<s.length;w++){var b;let{name:d,fn:p}=s[w],{x:m,y:v,data:S,reset:T}=await p({x:u,y:f,initialPlacement:i,placement:h,strategy:r,middlewareData:g,rects:c,platform:{...o,detectOverflow:(b=o.detectOverflow)!=null?b:zw},elements:{reference:t,floating:e}});u=m??u,f=v??f,g={...g,[d]:{...g[d],...S}},T&&_<=50&&(_++,typeof T=="object"&&(T.placement&&(h=T.placement),T.rects&&(c=T.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:r}):T.rects),{x:u,y:f}=Lw(c,h,l)),w=-1)}return{x:u,y:f,placement:h,strategy:r,middlewareData:g}},$w=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:r,rects:a,platform:o,elements:s,middlewareData:l}=e,{element:c,padding:u=0}=Ea(t,e)||{};if(c==null)return{};let f=Vm(u),h={x:n,y:i},g=Hd(r),_=Ld(g),b=await o.getDimensions(c),w=g==="y",d=w?"top":"left",p=w?"bottom":"right",m=w?"clientHeight":"clientWidth",v=a.reference[_]+a.reference[g]-h[g]-a.floating[_],S=h[g]-a.reference[g],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c)),A=T?T[m]:0;(!A||!await(o.isElement==null?void 0:o.isElement(T)))&&(A=s.floating[m]||a.floating[_]);let k=v/2-S/2,C=A/2-b[_]/2-1,x=Nr(f[d],C),M=Nr(f[p],C),z=x,U=A-b[_]-M,P=A/2-b[_]/2+k,Z=Dd(z,P,U),X=!l.arrow&&Xo(r)!=null&&P!==Z&&a.reference[_]/2-(P<z?x:M)-b[_]/2<0,W=X?P<z?P-z:P-U:0;return{[g]:h[g]+W,data:{[g]:Z,centerOffset:P-Z-W,...X&&{alignmentOffset:W}},reset:X}}});var Fw=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:r,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:b=!0,...w}=Ea(t,e);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let d=Dr(r),p=Hi(s),m=Dr(s)===s,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=h||(m||!b?[Zl(s)]:Nw(s)),T=_!=="none";!h&&T&&S.push(...Dw(s,b,_,v));let A=[s,...S],k=await l.detectOverflow(e,w),C=[],x=((i=a.flip)==null?void 0:i.overflows)||[];if(u&&C.push(k[d]),f){let P=Mw(r,o,v);C.push(k[P[0]],k[P[1]])}if(x=[...x,{placement:r,overflows:C}],!C.every(P=>P<=0)){var M,z;let P=(((M=a.flip)==null?void 0:M.index)||0)+1,Z=A[P];if(Z&&(!(f==="alignment"?p!==Hi(Z):!1)||x.every(D=>Hi(D.placement)===p?D.overflows[0]>0:!0)))return{data:{index:P,overflows:x},reset:{placement:Z}};let X=(z=x.filter(W=>W.overflows[0]<=0).sort((W,D)=>W.overflows[1]-D.overflows[1])[0])==null?void 0:z.placement;if(!X)switch(g){case"bestFit":{var U;let W=(U=x.filter(D=>{if(T){let L=Hi(D.placement);return L===p||L==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(L=>L>0).reduce((L,de)=>L+de,0)]).sort((D,L)=>D[1]-L[1])[0])==null?void 0:U[0];W&&(X=W);break}case"initialPlacement":X=s;break}if(r!==X)return{reset:{placement:X}}}return{}}}};function Hw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Iw(t){return Ow.some(e=>t[e]>=0)}var Uw=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n,platform:i}=e,{strategy:r="referenceHidden",...a}=Ea(t,e);switch(r){case"referenceHidden":{let o=await i.detectOverflow(e,{...a,elementContext:"reference"}),s=Hw(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Iw(s)}}}case"escaped":{let o=await i.detectOverflow(e,{...a,altBoundary:!0}),s=Hw(o,n.floating);return{data:{escapedOffsets:s,escaped:Iw(s)}}}default:return{}}}}};var oM=new Set(["left","top"]);async function sM(t,e){let{placement:n,platform:i,elements:r}=t,a=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=Dr(n),s=Xo(n),l=Hi(n)==="y",c=oM.has(o)?-1:1,u=a&&l?-1:1,f=Ea(e,t),{mainAxis:h,crossAxis:g,alignmentAxis:_}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof _=="number"&&(g=s==="end"?_*-1:_),l?{x:g*u,y:h*c}:{x:h*c,y:g*u}}var Vw=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:r,y:a,placement:o,middlewareData:s}=e,l=await sM(e,t);return o===((n=s.offset)==null?void 0:n.placement)&&(i=s.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:o}}}}},jw=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:r,platform:a}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:d=>{let{x:p,y:m}=d;return{x:p,y:m}}},...c}=Ea(t,e),u={x:n,y:i},f=await a.detectOverflow(e,c),h=Hi(Dr(r)),g=Um(h),_=u[g],b=u[h];if(o){let d=g==="y"?"top":"left",p=g==="y"?"bottom":"right",m=_+f[d],v=_-f[p];_=Dd(m,_,v)}if(s){let d=h==="y"?"top":"left",p=h==="y"?"bottom":"right",m=b+f[d],v=b-f[p];b=Dd(m,b,v)}let w=l.fn({...e,[g]:_,[h]:b});return{...w,data:{x:w.x-n,y:w.y-i,enabled:{[g]:o,[h]:s}}}}}};function Id(){return typeof window<"u"}function Aa(t){return Pw(t)?(t.nodeName||"").toLowerCase():"#document"}function Vt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $n(t){var e;return(e=(Pw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Pw(t){return Id()?t instanceof Node||t instanceof Vt(t).Node:!1}function Cn(t){return Id()?t instanceof Element||t instanceof Vt(t).Element:!1}function Fn(t){return Id()?t instanceof HTMLElement||t instanceof Vt(t).HTMLElement:!1}function qw(t){return!Id()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Vt(t).ShadowRoot}var lM=new Set(["inline","contents"]);function Jo(t){let{overflow:e,overflowX:n,overflowY:i,display:r}=An(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!lM.has(r)}var cM=new Set(["table","td","th"]);function Gw(t){return cM.has(Aa(t))}var uM=[":popover-open",":modal"];function Kl(t){return uM.some(e=>{try{return t.matches(e)}catch{return!1}})}var dM=["transform","translate","scale","rotate","perspective"],fM=["transform","translate","scale","rotate","perspective","filter"],pM=["paint","layout","strict","content"];function zd(t){let e=Bd(),n=Cn(t)?An(t):t;return dM.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||fM.some(i=>(n.willChange||"").includes(i))||pM.some(i=>(n.contain||"").includes(i))}function Zw(t){let e=Ii(t);for(;Fn(e)&&!Ta(e);){if(zd(e))return e;if(Kl(e))return null;e=Ii(e)}return null}function Bd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var hM=new Set(["html","body","#document"]);function Ta(t){return hM.has(Aa(t))}function An(t){return Vt(t).getComputedStyle(t)}function Xl(t){return Cn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ii(t){if(Aa(t)==="html")return t;let e=t.assignedSlot||t.parentNode||qw(t)&&t.host||$n(t);return qw(e)?e.host:e}function Yw(t){let e=Ii(t);return Ta(e)?t.ownerDocument?t.ownerDocument.body:t.body:Fn(e)&&Jo(e)?e:Yw(e)}function Qo(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let r=Yw(t),a=r===((i=t.ownerDocument)==null?void 0:i.body),o=Vt(r);if(a){let s=$d(o);return e.concat(o,o.visualViewport||[],Jo(r)?r:[],s&&n?Qo(s):[])}return e.concat(r,Qo(r,[],n))}function $d(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qw(t){let e=An(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,r=Fn(t),a=r?t.offsetWidth:n,o=r?t.offsetHeight:i,s=Yl(n)!==a||Yl(i)!==o;return s&&(n=a,i=o),{width:n,height:i,$:s}}function qm(t){return Cn(t)?t:t.contextElement}function es(t){let e=qm(t);if(!Fn(e))return Bn(1);let n=e.getBoundingClientRect(),{width:i,height:r,$:a}=Qw(e),o=(a?Yl(n.width):n.width)/i,s=(a?Yl(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var gM=Bn(0);function Jw(t){let e=Vt(t);return!Bd()||!e.visualViewport?gM:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function mM(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Vt(t)?!1:e}function ka(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let r=t.getBoundingClientRect(),a=qm(t),o=Bn(1);e&&(i?Cn(i)&&(o=es(i)):o=es(t));let s=mM(a,n,i)?Jw(a):Bn(0),l=(r.left+s.x)/o.x,c=(r.top+s.y)/o.y,u=r.width/o.x,f=r.height/o.y;if(a){let h=Vt(a),g=i&&Cn(i)?Vt(i):i,_=h,b=$d(_);for(;b&&i&&g!==_;){let w=es(b),d=b.getBoundingClientRect(),p=An(b),m=d.left+(b.clientLeft+parseFloat(p.paddingLeft))*w.x,v=d.top+(b.clientTop+parseFloat(p.paddingTop))*w.y;l*=w.x,c*=w.y,u*=w.x,f*=w.y,l+=m,c+=v,_=Vt(b),b=$d(_)}}return Ca({width:u,height:f,x:l,y:c})}function Fd(t,e){let n=Xl(t).scrollLeft;return e?e.left+n:ka($n(t)).left+n}function eE(t,e){let n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Fd(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function vM(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t,a=r==="fixed",o=$n(i),s=e?Kl(e.floating):!1;if(i===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Bn(1),u=Bn(0),f=Fn(i);if((f||!f&&!a)&&((Aa(i)!=="body"||Jo(o))&&(l=Xl(i)),Fn(i))){let g=ka(i);c=es(i),u.x=g.x+i.clientLeft,u.y=g.y+i.clientTop}let h=o&&!f&&!a?eE(o,l):Bn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function yM(t){return Array.from(t.getClientRects())}function bM(t){let e=$n(t),n=Xl(t),i=t.ownerDocument.body,r=Li(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),a=Li(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),o=-n.scrollLeft+Fd(t),s=-n.scrollTop;return An(i).direction==="rtl"&&(o+=Li(e.clientWidth,i.clientWidth)-r),{width:r,height:a,x:o,y:s}}var Ww=25;function _M(t,e){let n=Vt(t),i=$n(t),r=n.visualViewport,a=i.clientWidth,o=i.clientHeight,s=0,l=0;if(r){a=r.width,o=r.height;let u=Bd();(!u||u&&e==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}let c=Fd(i);if(c<=0){let u=i.ownerDocument,f=u.body,h=getComputedStyle(f),g=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,_=Math.abs(i.clientWidth-f.clientWidth-g);_<=Ww&&(a-=_)}else c<=Ww&&(a+=c);return{width:a,height:o,x:s,y:l}}var SM=new Set(["absolute","fixed"]);function xM(t,e){let n=ka(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,a=Fn(t)?es(t):Bn(1),o=t.clientWidth*a.x,s=t.clientHeight*a.y,l=r*a.x,c=i*a.y;return{width:o,height:s,x:l,y:c}}function Kw(t,e,n){let i;if(e==="viewport")i=_M(t,n);else if(e==="document")i=bM($n(t));else if(Cn(e))i=xM(e,n);else{let r=Jw(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Ca(i)}function tE(t,e){let n=Ii(t);return n===e||!Cn(n)||Ta(n)?!1:An(n).position==="fixed"||tE(n,e)}function wM(t,e){let n=e.get(t);if(n)return n;let i=Qo(t,[],!1).filter(s=>Cn(s)&&Aa(s)!=="body"),r=null,a=An(t).position==="fixed",o=a?Ii(t):t;for(;Cn(o)&&!Ta(o);){let s=An(o),l=zd(o);!l&&s.position==="fixed"&&(r=null),(a?!l&&!r:!l&&s.position==="static"&&!!r&&SM.has(r.position)||Jo(o)&&!l&&tE(t,o))?i=i.filter(u=>u!==o):r=s,o=Ii(o)}return e.set(t,i),i}function EM(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t,o=[...n==="clippingAncestors"?Kl(e)?[]:wM(e,this._c):[].concat(n),i],s=o[0],l=o.reduce((c,u)=>{let f=Kw(e,u,r);return c.top=Li(f.top,c.top),c.right=Nr(f.right,c.right),c.bottom=Nr(f.bottom,c.bottom),c.left=Li(f.left,c.left),c},Kw(e,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function CM(t){let{width:e,height:n}=Qw(t);return{width:e,height:n}}function AM(t,e,n){let i=Fn(e),r=$n(e),a=n==="fixed",o=ka(t,!0,a,e),s={scrollLeft:0,scrollTop:0},l=Bn(0);function c(){l.x=Fd(r)}if(i||!i&&!a)if((Aa(e)!=="body"||Jo(r))&&(s=Xl(e)),i){let g=ka(e,!0,a,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else r&&c();a&&!i&&r&&c();let u=r&&!i&&!a?eE(r,s):Bn(0),f=o.left+s.scrollLeft-l.x-u.x,h=o.top+s.scrollTop-l.y-u.y;return{x:f,y:h,width:o.width,height:o.height}}function jm(t){return An(t).position==="static"}function Xw(t,e){if(!Fn(t)||An(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $n(t)===n&&(n=n.ownerDocument.body),n}function nE(t,e){let n=Vt(t);if(Kl(t))return n;if(!Fn(t)){let r=Ii(t);for(;r&&!Ta(r);){if(Cn(r)&&!jm(r))return r;r=Ii(r)}return n}let i=Xw(t,e);for(;i&&Gw(i)&&jm(i);)i=Xw(i,e);return i&&Ta(i)&&jm(i)&&!zd(i)?n:i||Zw(t)||n}var TM=async function(t){let e=this.getOffsetParent||nE,n=this.getDimensions,i=await n(t.floating);return{reference:AM(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function kM(t){return An(t).direction==="rtl"}var RM={convertOffsetParentRelativeRectToViewportRelativeRect:vM,getDocumentElement:$n,getClippingRect:EM,getOffsetParent:nE,getElementRects:TM,getClientRects:yM,getDimensions:CM,getScale:es,isElement:Cn,isRTL:kM};function iE(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function OM(t,e){let n=null,i,r=$n(t);function a(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();let c=t.getBoundingClientRect(),{left:u,top:f,width:h,height:g}=c;if(s||e(),!h||!g)return;let _=Wl(f),b=Wl(r.clientWidth-(u+h)),w=Wl(r.clientHeight-(f+g)),d=Wl(u),m={rootMargin:-_+"px "+-b+"px "+-w+"px "+-d+"px",threshold:Li(0,Nr(1,l))||1},v=!0;function S(T){let A=T[0].intersectionRatio;if(A!==l){if(!v)return o();A?o(!1,A):i=setTimeout(()=>{o(!1,1e-7)},1e3)}A===1&&!iE(c,t.getBoundingClientRect())&&o(),v=!1}try{n=new IntersectionObserver(S,{...m,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,m)}n.observe(t)}return o(!0),a}function Ud(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=qm(t),u=r||a?[...c?Qo(c):[],...Qo(e)]:[];u.forEach(d=>{r&&d.addEventListener("scroll",n,{passive:!0}),a&&d.addEventListener("resize",n)});let f=c&&s?OM(c,n):null,h=-1,g=null;o&&(g=new ResizeObserver(d=>{let[p]=d;p&&p.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var m;(m=g)==null||m.observe(e)})),n()}),c&&!l&&g.observe(c),g.observe(e));let _,b=l?ka(t):null;l&&w();function w(){let d=ka(t);b&&!iE(b,d)&&n(),b=d,_=requestAnimationFrame(w)}return n(),()=>{var d;u.forEach(p=>{r&&p.removeEventListener("scroll",n),a&&p.removeEventListener("resize",n)}),f?.(),(d=g)==null||d.disconnect(),g=null,l&&cancelAnimationFrame(_)}}var Vd=Vw;var jd=jw,qd=Fw;var rE=Uw,aE=$w;var Pd=(t,e,n)=>{let i=new Map,r={platform:RM,...n},a={...r.platform,_c:i};return Bw(t,e,{...r,platform:a})};function MM(t){let e=t.getBoundingClientRect(),n=window.innerWidth,i=window.innerHeight;if(!(e.width>n*.8||e.height>i*.8))return t;let a=Math.max(e.left,0),o=Math.max(e.top,0),s=Math.min(e.right,n),l=Math.min(e.bottom,i),c=(a+s)/2,u=(o+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:c,y:u,top:u,left:c,right:c,bottom:u}}}}function oE(t,e,n){let i=t.getBoundingClientRect();i.width>window.innerWidth*.8||i.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});let a=document.createElement("div");if(a.className="syntro-tooltip",a.setAttribute("role","tooltip"),a.innerHTML=ln(n.html),!n.trigger||n.trigger==="immediate"){let d=document.createElement("button");d.className="syntro-tooltip-close",d.setAttribute("aria-label","Close"),d.textContent="\xD7",Object.assign(d.style,{position:"absolute",top:"4px",right:"4px",background:"none",border:"none",color:"inherit",fontSize:"16px",lineHeight:"1",cursor:"pointer",opacity:"0.6",padding:"2px 4px"}),d.addEventListener("mouseenter",()=>{d.style.opacity="1"}),d.addEventListener("mouseleave",()=>{d.style.opacity="0.6"}),d.addEventListener("click",()=>w.destroy()),a.style.position="relative",a.appendChild(d)}let o=a.querySelectorAll("[data-syntro-action]"),s=d=>{let m=d.currentTarget.getAttribute("data-syntro-action");m&&n.onAction&&n.onAction(m)};o.forEach(d=>d.addEventListener("click",s));let l=document.createElement("div");l.className="syntro-tooltip-arrow",a.appendChild(l),e.appendChild(a);let c=[Vd(n.offsetPx??8),qd(),jd({padding:8}),rE(),aE({element:l})],u=n.placement&&n.placement!=="auto"?n.placement:"top",f=Ud(t,a,async()=>{if(!t.isConnected){w.destroy();return}let d=MM(t),p=await Pd(d,a,{placement:u,strategy:"fixed",middleware:c}),{x:m,y:v,strategy:S,middlewareData:T,placement:A}=p;if(Object.assign(a.style,{left:`${m}px`,top:`${v}px`,position:S}),T.arrow){let{x:k,y:C}=T.arrow,x=A.split("-")[0],M={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:k!=null?`${k}px`:"",top:C!=null?`${C}px`:"",right:"",bottom:"",[M[x]]:"-4px"});let z={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${z[x]||"0deg"})`}}),h=d=>{d.key==="Escape"&&w.destroy()};window.addEventListener("keydown",h);let g=[];if(n.blocking){Array.from(document.body.children).forEach(p=>{p!==e&&p.getAttribute("inert")===null&&(p.setAttribute("inert",""),g.push(p.id||p.tagName))});let d=Array.from(a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(d.length>0){let p=d[0],m=d[d.length-1],v=S=>{S.key==="Tab"&&(S.shiftKey?document.activeElement===p&&(m.focus(),S.preventDefault()):document.activeElement===m&&(p.focus(),S.preventDefault()))};a.addEventListener("keydown",v),requestAnimationFrame(()=>p.focus())}}let b=(()=>{if(n.trigger==="hover"){let d=()=>{a.style.visibility="visible",a.style.opacity="1"},p=()=>{a.style.visibility="hidden",a.style.opacity="0"};return a.style.visibility="hidden",a.style.opacity="0",a.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",d),t.addEventListener("mouseleave",p),t.addEventListener("focus",d),t.addEventListener("blur",p),()=>{t.removeEventListener("mouseenter",d),t.removeEventListener("mouseleave",p),t.removeEventListener("focus",d),t.removeEventListener("blur",p)}}if(n.trigger==="click"){let d=()=>{a.style.visibility==="visible"?w.destroy():(a.style.visibility="visible",a.style.opacity="1")};return a.style.visibility="hidden",a.style.opacity="0",a.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",d),()=>t.removeEventListener("click",d)}return a.style.opacity="0",a.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{a.style.opacity="1"}),()=>{}})(),w={el:a,destroy(){f(),b(),window.removeEventListener("keydown",h),o.forEach(d=>d.removeEventListener("click",s)),n.blocking&&Array.from(document.body.children).forEach(d=>{d!==e&&d.removeAttribute("inert")}),a.style.pointerEvents="none",a.style.opacity="0",setTimeout(()=>a.remove(),200)}};return w}var sE=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=Tw(n,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:t.style?.color,blocking:t.blocking??!1,onClickOutside:t.onClickOutside??!0,onEsc:t.onEsc??!0});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{i.destroy()}}},lE=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=t.duration??2e3;if(!document.querySelector("[data-syntro-pulse-styles]")){let o=document.createElement("style");o.setAttribute("data-syntro-pulse-styles",""),o.textContent=`
|
|
62
|
+
`}d+="</div>"}u.innerHTML=d,e.overlayRoot.appendChild(u);let p=null,g=u.querySelectorAll("[data-syntro-action]"),S=_=>{let C=_.currentTarget.getAttribute("data-syntro-action");C&&(p=C,e.publishEvent("action.modal_cta_clicked",{actionId:C}),y.destroy())};g.forEach(_=>_.addEventListener("click",S));let b=_=>{_.key==="Escape"&&i?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",b);let x=()=>{n||y.destroy()};l.addEventListener("click",x);let f=[];n&&Array.from(document.body.children).forEach(_=>{_!==e.overlayRoot&&_.getAttribute("inert")===null&&!_.querySelector("[data-syntro-editor-panel]")&&!_.hasAttribute("data-syntro-editor-panel")&&(_.setAttribute("inert",""),f.push(_))});let m;i?.timeoutMs&&(m=setTimeout(()=>{y.destroy()},i.timeoutMs));let v=u.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');v.length>0&&requestAnimationFrame(()=>v[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",u.style.opacity="1",u.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:r,blocking:n});let y={destroy(){m&&clearTimeout(m),window.removeEventListener("keydown",b),l.removeEventListener("click",x),g.forEach(_=>_.removeEventListener("click",S)),f.forEach(_=>_.removeAttribute("inert")),u.style.pointerEvents="none",l.style.pointerEvents="none",u.style.opacity="0",u.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{u.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:p})}};return{cleanup:()=>{y.destroy()}}};var AL=["top","right","bottom","left"];var zn=Math.min,qr=Math.max,fu=Math.round,pu=Math.floor,$a=t=>({x:t,y:t}),c2={left:"right",right:"left",bottom:"top",top:"bottom"},d2={start:"end",end:"start"};function of(t,e,a){return qr(t,zn(e,a))}function No(t,e){return typeof t=="function"?t(e):t}function Vn(t){return t.split("-")[0]}function ls(t){return t.split("-")[1]}function Rv(t){return t==="x"?"y":"x"}function sf(t){return t==="y"?"height":"width"}var f2=new Set(["top","bottom"]);function zr(t){return f2.has(Vn(t))?"y":"x"}function lf(t){return Rv(zr(t))}function kL(t,e,a){a===void 0&&(a=!1);let r=ls(t),n=lf(t),o=sf(n),i=n==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(i=du(i)),[i,du(i)]}function EL(t){let e=du(t);return[nf(t),e,nf(e)]}function nf(t){return t.replace(/start|end/g,e=>d2[e])}var LL=["left","right"],IL=["right","left"],p2=["top","bottom"],h2=["bottom","top"];function m2(t,e,a){switch(t){case"top":case"bottom":return a?e?IL:LL:e?LL:IL;case"left":case"right":return e?p2:h2;default:return[]}}function TL(t,e,a,r){let n=ls(t),o=m2(Vn(t),a==="start",r);return n&&(o=o.map(i=>i+"-"+n),e&&(o=o.concat(o.map(nf)))),o}function du(t){return t.replace(/left|right|bottom|top/g,e=>c2[e])}function g2(t){return{top:0,right:0,bottom:0,left:0,...t}}function Mv(t){return typeof t!="number"?g2(t):{top:t,right:t,bottom:t,left:t}}function Po(t){let{x:e,y:a,width:r,height:n}=t;return{width:r,height:n,top:a,left:e,right:e+r,bottom:a+n,x:e,y:a}}function RL(t,e,a){let{reference:r,floating:n}=t,o=zr(e),i=lf(e),s=sf(i),l=Vn(e),u=o==="y",c=r.x+r.width/2-n.width/2,d=r.y+r.height/2-n.height/2,p=r[s]/2-n[s]/2,g;switch(l){case"top":g={x:c,y:r.y-n.height};break;case"bottom":g={x:c,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-n.width,y:d};break;default:g={x:r.x,y:r.y}}switch(ls(e)){case"start":g[i]-=p*(a&&u?-1:1);break;case"end":g[i]+=p*(a&&u?-1:1);break}return g}async function OL(t,e){var a;e===void 0&&(e={});let{x:r,y:n,platform:o,rects:i,elements:s,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:g=0}=No(e,t),S=Mv(g),x=s[p?d==="floating"?"reference":"floating":d],f=Po(await o.getClippingRect({element:(a=await(o.isElement==null?void 0:o.isElement(x)))==null||a?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),m=d==="floating"?{x:r,y:n,width:i.floating.width,height:i.floating.height}:i.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),y=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},_=Po(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:m,offsetParent:v,strategy:l}):m);return{top:(f.top-_.top+S.top)/y.y,bottom:(_.bottom-f.bottom+S.bottom)/y.y,left:(f.left-_.left+S.left)/y.x,right:(_.right-f.right+S.right)/y.x}}var BL=async(t,e,a)=>{let{placement:r="bottom",strategy:n="absolute",middleware:o=[],platform:i}=a,s=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(e)),u=await i.getElementRects({reference:t,floating:e,strategy:n}),{x:c,y:d}=RL(u,r,l),p=r,g={},S=0;for(let x=0;x<s.length;x++){var b;let{name:f,fn:m}=s[x],{x:v,y,data:_,reset:w}=await m({x:c,y:d,initialPlacement:r,placement:p,strategy:n,middlewareData:g,rects:u,platform:{...i,detectOverflow:(b=i.detectOverflow)!=null?b:OL},elements:{reference:t,floating:e}});c=v??c,d=y??d,g={...g,[f]:{...g[f],..._}},w&&S<=50&&(S++,typeof w=="object"&&(w.placement&&(p=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:n}):w.rects),{x:c,y:d}=RL(u,p,l)),x=-1)}return{x:c,y:d,placement:p,strategy:n,middlewareData:g}},FL=t=>({name:"arrow",options:t,async fn(e){let{x:a,y:r,placement:n,rects:o,platform:i,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=No(t,e)||{};if(u==null)return{};let d=Mv(c),p={x:a,y:r},g=lf(n),S=sf(g),b=await i.getDimensions(u),x=g==="y",f=x?"top":"left",m=x?"bottom":"right",v=x?"clientHeight":"clientWidth",y=o.reference[S]+o.reference[g]-p[g]-o.floating[S],_=p[g]-o.reference[g],w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u)),C=w?w[v]:0;(!C||!await(i.isElement==null?void 0:i.isElement(w)))&&(C=s.floating[v]||o.floating[S]);let A=y/2-_/2,E=C/2-b[S]/2-1,L=zn(d[f],E),k=zn(d[m],E),D=L,R=C-b[S]-k,F=C/2-b[S]/2+A,N=of(D,F,R),U=!l.arrow&&ls(n)!=null&&F!==N&&o.reference[S]/2-(F<D?L:k)-b[S]/2<0,Y=U?F<D?F-D:F-R:0;return{[g]:p[g]+Y,data:{[g]:N,centerOffset:F-N-Y,...U&&{alignmentOffset:Y}},reset:U}}});var NL=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var a,r;let{placement:n,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:b=!0,...x}=No(t,e);if((a=o.arrow)!=null&&a.alignmentOffset)return{};let f=Vn(n),m=zr(s),v=Vn(s)===s,y=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=p||(v||!b?[du(s)]:EL(s)),w=S!=="none";!p&&w&&_.push(...TL(s,b,S,y));let C=[s,..._],A=await l.detectOverflow(e,x),E=[],L=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&E.push(A[f]),d){let F=kL(n,i,y);E.push(A[F[0]],A[F[1]])}if(L=[...L,{placement:n,overflows:E}],!E.every(F=>F<=0)){var k,D;let F=(((k=o.flip)==null?void 0:k.index)||0)+1,N=C[F];if(N&&(!(d==="alignment"?m!==zr(N):!1)||L.every(B=>zr(B.placement)===m?B.overflows[0]>0:!0)))return{data:{index:F,overflows:L},reset:{placement:N}};let U=(D=L.filter(Y=>Y.overflows[0]<=0).sort((Y,B)=>Y.overflows[1]-B.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(g){case"bestFit":{var R;let Y=(R=L.filter(B=>{if(w){let W=zr(B.placement);return W===m||W==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(W=>W>0).reduce((W,ve)=>W+ve,0)]).sort((B,W)=>B[1]-W[1])[0])==null?void 0:R[0];Y&&(U=Y);break}case"initialPlacement":U=s;break}if(n!==U)return{reset:{placement:U}}}return{}}}};function ML(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function DL(t){return AL.some(e=>t[e]>=0)}var PL=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:a,platform:r}=e,{strategy:n="referenceHidden",...o}=No(t,e);switch(n){case"referenceHidden":{let i=await r.detectOverflow(e,{...o,elementContext:"reference"}),s=ML(i,a.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:DL(s)}}}case"escaped":{let i=await r.detectOverflow(e,{...o,altBoundary:!0}),s=ML(i,a.floating);return{data:{escapedOffsets:s,escaped:DL(s)}}}default:return{}}}}};var v2=new Set(["left","top"]);async function y2(t,e){let{placement:a,platform:r,elements:n}=t,o=await(r.isRTL==null?void 0:r.isRTL(n.floating)),i=Vn(a),s=ls(a),l=zr(a)==="y",u=v2.has(i)?-1:1,c=o&&l?-1:1,d=No(e,t),{mainAxis:p,crossAxis:g,alignmentAxis:S}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof S=="number"&&(g=s==="end"?S*-1:S),l?{x:g*c,y:p*u}:{x:p*u,y:g*c}}var HL=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var a,r;let{x:n,y:o,placement:i,middlewareData:s}=e,l=await y2(e,t);return i===((a=s.offset)==null?void 0:a.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:n+l.x,y:o+l.y,data:{...l,placement:i}}}}},UL=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:a,y:r,placement:n,platform:o}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:f=>{let{x:m,y:v}=f;return{x:m,y:v}}},...u}=No(t,e),c={x:a,y:r},d=await o.detectOverflow(e,u),p=zr(Vn(n)),g=Rv(p),S=c[g],b=c[p];if(i){let f=g==="y"?"top":"left",m=g==="y"?"bottom":"right",v=S+d[f],y=S-d[m];S=of(v,S,y)}if(s){let f=p==="y"?"top":"left",m=p==="y"?"bottom":"right",v=b+d[f],y=b-d[m];b=of(v,b,y)}let x=l.fn({...e,[g]:S,[p]:b});return{...x,data:{x:x.x-a,y:x.y-r,enabled:{[g]:i,[p]:s}}}}}};function uf(){return typeof window<"u"}function Ho(t){return zL(t)?(t.nodeName||"").toLowerCase():"#document"}function Xt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ja(t){var e;return(e=(zL(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function zL(t){return uf()?t instanceof Node||t instanceof Xt(t).Node:!1}function Ta(t){return uf()?t instanceof Element||t instanceof Xt(t).Element:!1}function Ga(t){return uf()?t instanceof HTMLElement||t instanceof Xt(t).HTMLElement:!1}function qL(t){return!uf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xt(t).ShadowRoot}var x2=new Set(["inline","contents"]);function cs(t){let{overflow:e,overflowX:a,overflowY:r,display:n}=Ra(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+a)&&!x2.has(n)}var b2=new Set(["table","td","th"]);function VL(t){return b2.has(Ho(t))}var S2=[":popover-open",":modal"];function hu(t){return S2.some(e=>{try{return t.matches(e)}catch{return!1}})}var C2=["transform","translate","scale","rotate","perspective"],_2=["transform","translate","scale","rotate","perspective","filter"],w2=["paint","layout","strict","content"];function cf(t){let e=df(),a=Ta(t)?Ra(t):t;return C2.some(r=>a[r]?a[r]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!e&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!e&&(a.filter?a.filter!=="none":!1)||_2.some(r=>(a.willChange||"").includes(r))||w2.some(r=>(a.contain||"").includes(r))}function $L(t){let e=Vr(t);for(;Ga(e)&&!Uo(e);){if(cf(e))return e;if(hu(e))return null;e=Vr(e)}return null}function df(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var L2=new Set(["html","body","#document"]);function Uo(t){return L2.has(Ho(t))}function Ra(t){return Xt(t).getComputedStyle(t)}function mu(t){return Ta(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Vr(t){if(Ho(t)==="html")return t;let e=t.assignedSlot||t.parentNode||qL(t)&&t.host||ja(t);return qL(e)?e.host:e}function jL(t){let e=Vr(t);return Uo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ga(e)&&cs(e)?e:jL(e)}function us(t,e,a){var r;e===void 0&&(e=[]),a===void 0&&(a=!0);let n=jL(t),o=n===((r=t.ownerDocument)==null?void 0:r.body),i=Xt(n);if(o){let s=ff(i);return e.concat(i,i.visualViewport||[],cs(n)?n:[],s&&a?us(s):[])}return e.concat(n,us(n,[],a))}function ff(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function XL(t){let e=Ra(t),a=parseFloat(e.width)||0,r=parseFloat(e.height)||0,n=Ga(t),o=n?t.offsetWidth:a,i=n?t.offsetHeight:r,s=fu(a)!==o||fu(r)!==i;return s&&(a=o,r=i),{width:a,height:r,$:s}}function Ov(t){return Ta(t)?t:t.contextElement}function ds(t){let e=Ov(t);if(!Ga(e))return $a(1);let a=e.getBoundingClientRect(),{width:r,height:n,$:o}=XL(e),i=(o?fu(a.width):a.width)/r,s=(o?fu(a.height):a.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var I2=$a(0);function YL(t){let e=Xt(t);return!df()||!e.visualViewport?I2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function A2(t,e,a){return e===void 0&&(e=!1),!a||e&&a!==Xt(t)?!1:e}function qo(t,e,a,r){e===void 0&&(e=!1),a===void 0&&(a=!1);let n=t.getBoundingClientRect(),o=Ov(t),i=$a(1);e&&(r?Ta(r)&&(i=ds(r)):i=ds(t));let s=A2(o,a,r)?YL(o):$a(0),l=(n.left+s.x)/i.x,u=(n.top+s.y)/i.y,c=n.width/i.x,d=n.height/i.y;if(o){let p=Xt(o),g=r&&Ta(r)?Xt(r):r,S=p,b=ff(S);for(;b&&r&&g!==S;){let x=ds(b),f=b.getBoundingClientRect(),m=Ra(b),v=f.left+(b.clientLeft+parseFloat(m.paddingLeft))*x.x,y=f.top+(b.clientTop+parseFloat(m.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=v,u+=y,S=Xt(b),b=ff(S)}}return Po({width:c,height:d,x:l,y:u})}function pf(t,e){let a=mu(t).scrollLeft;return e?e.left+a:qo(ja(t)).left+a}function KL(t,e){let a=t.getBoundingClientRect(),r=a.left+e.scrollLeft-pf(t,a),n=a.top+e.scrollTop;return{x:r,y:n}}function k2(t){let{elements:e,rect:a,offsetParent:r,strategy:n}=t,o=n==="fixed",i=ja(r),s=e?hu(e.floating):!1;if(r===i||s&&o)return a;let l={scrollLeft:0,scrollTop:0},u=$a(1),c=$a(0),d=Ga(r);if((d||!d&&!o)&&((Ho(r)!=="body"||cs(i))&&(l=mu(r)),Ga(r))){let g=qo(r);u=ds(r),c.x=g.x+r.clientLeft,c.y=g.y+r.clientTop}let p=i&&!d&&!o?KL(i,l):$a(0);return{width:a.width*u.x,height:a.height*u.y,x:a.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:a.y*u.y-l.scrollTop*u.y+c.y+p.y}}function E2(t){return Array.from(t.getClientRects())}function T2(t){let e=ja(t),a=mu(t),r=t.ownerDocument.body,n=qr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=qr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),i=-a.scrollLeft+pf(t),s=-a.scrollTop;return Ra(r).direction==="rtl"&&(i+=qr(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:i,y:s}}var GL=25;function R2(t,e){let a=Xt(t),r=ja(t),n=a.visualViewport,o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(n){o=n.width,i=n.height;let c=df();(!c||c&&e==="fixed")&&(s=n.offsetLeft,l=n.offsetTop)}let u=pf(r);if(u<=0){let c=r.ownerDocument,d=c.body,p=getComputedStyle(d),g=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,S=Math.abs(r.clientWidth-d.clientWidth-g);S<=GL&&(o-=S)}else u<=GL&&(o+=u);return{width:o,height:i,x:s,y:l}}var M2=new Set(["absolute","fixed"]);function D2(t,e){let a=qo(t,!0,e==="fixed"),r=a.top+t.clientTop,n=a.left+t.clientLeft,o=Ga(t)?ds(t):$a(1),i=t.clientWidth*o.x,s=t.clientHeight*o.y,l=n*o.x,u=r*o.y;return{width:i,height:s,x:l,y:u}}function WL(t,e,a){let r;if(e==="viewport")r=R2(t,a);else if(e==="document")r=T2(ja(t));else if(Ta(e))r=D2(e,a);else{let n=YL(t);r={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return Po(r)}function QL(t,e){let a=Vr(t);return a===e||!Ta(a)||Uo(a)?!1:Ra(a).position==="fixed"||QL(a,e)}function O2(t,e){let a=e.get(t);if(a)return a;let r=us(t,[],!1).filter(s=>Ta(s)&&Ho(s)!=="body"),n=null,o=Ra(t).position==="fixed",i=o?Vr(t):t;for(;Ta(i)&&!Uo(i);){let s=Ra(i),l=cf(i);!l&&s.position==="fixed"&&(n=null),(o?!l&&!n:!l&&s.position==="static"&&!!n&&M2.has(n.position)||cs(i)&&!l&&QL(t,i))?r=r.filter(c=>c!==i):n=s,i=Vr(i)}return e.set(t,r),r}function B2(t){let{element:e,boundary:a,rootBoundary:r,strategy:n}=t,i=[...a==="clippingAncestors"?hu(e)?[]:O2(e,this._c):[].concat(a),r],s=i[0],l=i.reduce((u,c)=>{let d=WL(e,c,n);return u.top=qr(d.top,u.top),u.right=zn(d.right,u.right),u.bottom=zn(d.bottom,u.bottom),u.left=qr(d.left,u.left),u},WL(e,s,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function F2(t){let{width:e,height:a}=XL(t);return{width:e,height:a}}function N2(t,e,a){let r=Ga(e),n=ja(e),o=a==="fixed",i=qo(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=$a(0);function u(){l.x=pf(n)}if(r||!r&&!o)if((Ho(e)!=="body"||cs(n))&&(s=mu(e)),r){let g=qo(e,!0,o,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else n&&u();o&&!r&&n&&u();let c=n&&!r&&!o?KL(n,s):$a(0),d=i.left+s.scrollLeft-l.x-c.x,p=i.top+s.scrollTop-l.y-c.y;return{x:d,y:p,width:i.width,height:i.height}}function Dv(t){return Ra(t).position==="static"}function ZL(t,e){if(!Ga(t)||Ra(t).position==="fixed")return null;if(e)return e(t);let a=t.offsetParent;return ja(t)===a&&(a=a.ownerDocument.body),a}function JL(t,e){let a=Xt(t);if(hu(t))return a;if(!Ga(t)){let n=Vr(t);for(;n&&!Uo(n);){if(Ta(n)&&!Dv(n))return n;n=Vr(n)}return a}let r=ZL(t,e);for(;r&&VL(r)&&Dv(r);)r=ZL(r,e);return r&&Uo(r)&&Dv(r)&&!cf(r)?a:r||$L(t)||a}var P2=async function(t){let e=this.getOffsetParent||JL,a=this.getDimensions,r=await a(t.floating);return{reference:N2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function H2(t){return Ra(t).direction==="rtl"}var U2={convertOffsetParentRelativeRectToViewportRelativeRect:k2,getDocumentElement:ja,getClippingRect:B2,getOffsetParent:JL,getElementRects:P2,getClientRects:E2,getDimensions:F2,getScale:ds,isElement:Ta,isRTL:H2};function eI(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function q2(t,e){let a=null,r,n=ja(t);function o(){var s;clearTimeout(r),(s=a)==null||s.disconnect(),a=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();let u=t.getBoundingClientRect(),{left:c,top:d,width:p,height:g}=u;if(s||e(),!p||!g)return;let S=pu(d),b=pu(n.clientWidth-(c+p)),x=pu(n.clientHeight-(d+g)),f=pu(c),v={rootMargin:-S+"px "+-b+"px "+-x+"px "+-f+"px",threshold:qr(0,zn(1,l))||1},y=!0;function _(w){let C=w[0].intersectionRatio;if(C!==l){if(!y)return i();C?i(!1,C):r=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!eI(u,t.getBoundingClientRect())&&i(),y=!1}try{a=new IntersectionObserver(_,{...v,root:n.ownerDocument})}catch{a=new IntersectionObserver(_,v)}a.observe(t)}return i(!0),o}function hf(t,e,a,r){r===void 0&&(r={});let{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Ov(t),c=n||o?[...u?us(u):[],...us(e)]:[];c.forEach(f=>{n&&f.addEventListener("scroll",a,{passive:!0}),o&&f.addEventListener("resize",a)});let d=u&&s?q2(u,a):null,p=-1,g=null;i&&(g=new ResizeObserver(f=>{let[m]=f;m&&m.target===u&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=g)==null||v.observe(e)})),a()}),u&&!l&&g.observe(u),g.observe(e));let S,b=l?qo(t):null;l&&x();function x(){let f=qo(t);b&&!eI(b,f)&&a(),b=f,S=requestAnimationFrame(x)}return a(),()=>{var f;c.forEach(m=>{n&&m.removeEventListener("scroll",a),o&&m.removeEventListener("resize",a)}),d?.(),(f=g)==null||f.disconnect(),g=null,l&&cancelAnimationFrame(S)}}var mf=HL;var gf=UL,vf=NL;var tI=PL,aI=FL;var yf=(t,e,a)=>{let r=new Map,n={platform:U2,...a},o={...n.platform,_c:r};return BL(t,e,{...n,platform:o})};function z2(t){let e=t.getBoundingClientRect(),a=window.innerWidth,r=window.innerHeight;if(!(e.width>a*.8||e.height>r*.8))return t;let o=Math.max(e.left,0),i=Math.max(e.top,0),s=Math.min(e.right,a),l=Math.min(e.bottom,r),u=(o+s)/2,c=(i+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:u,y:c,top:c,left:u,right:u,bottom:c}}}}function rI(t,e,a){let r=t.getBoundingClientRect();r.width>window.innerWidth*.8||r.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});let o=document.createElement("div");if(o.className="syntro-tooltip",o.setAttribute("role","tooltip"),o.innerHTML=ha(a.html),!a.trigger||a.trigger==="immediate"){let f=document.createElement("button");f.className="syntro-tooltip-close",f.setAttribute("aria-label","Close"),f.textContent="\xD7",Object.assign(f.style,{position:"absolute",top:"4px",right:"4px",background:"none",border:"none",color:"inherit",fontSize:"16px",lineHeight:"1",cursor:"pointer",opacity:"0.6",padding:"2px 4px"}),f.addEventListener("mouseenter",()=>{f.style.opacity="1"}),f.addEventListener("mouseleave",()=>{f.style.opacity="0.6"}),f.addEventListener("click",()=>x.destroy()),o.style.position="relative",o.appendChild(f)}let i=o.querySelectorAll("[data-syntro-action]"),s=f=>{let v=f.currentTarget.getAttribute("data-syntro-action");v&&a.onAction&&a.onAction(v)};i.forEach(f=>f.addEventListener("click",s));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let u=[mf(a.offsetPx??8),vf(),gf({padding:8}),tI(),aI({element:l})],c=a.placement&&a.placement!=="auto"?a.placement:"top",d=hf(t,o,async()=>{if(!t.isConnected){x.destroy();return}let f=z2(t),m=await yf(f,o,{placement:c,strategy:"fixed",middleware:u}),{x:v,y,strategy:_,middlewareData:w,placement:C}=m;if(Object.assign(o.style,{left:`${v}px`,top:`${y}px`,position:_}),w.arrow){let{x:A,y:E}=w.arrow,L=C.split("-")[0],k={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:A!=null?`${A}px`:"",top:E!=null?`${E}px`:"",right:"",bottom:"",[k[L]]:"-4px"});let D={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${D[L]||"0deg"})`}}),p=f=>{f.key==="Escape"&&x.destroy()};window.addEventListener("keydown",p);let g=[];if(a.blocking){Array.from(document.body.children).forEach(m=>{m!==e&&m.getAttribute("inert")===null&&(m.setAttribute("inert",""),g.push(m.id||m.tagName))});let f=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(f.length>0){let m=f[0],v=f[f.length-1],y=_=>{_.key==="Tab"&&(_.shiftKey?document.activeElement===m&&(v.focus(),_.preventDefault()):document.activeElement===v&&(m.focus(),_.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>m.focus())}}let b=(()=>{if(a.trigger==="hover"){let f=null,m=()=>{f&&(clearTimeout(f),f=null),o.style.visibility="visible",o.style.opacity="1"},v=()=>{f=setTimeout(()=>{o.style.visibility="hidden",o.style.opacity="0",f=null},100)};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",m),t.addEventListener("mouseleave",v),o.addEventListener("mouseenter",m),o.addEventListener("mouseleave",v),t.addEventListener("focus",m),t.addEventListener("blur",v),()=>{f&&clearTimeout(f),t.removeEventListener("mouseenter",m),t.removeEventListener("mouseleave",v),o.removeEventListener("mouseenter",m),o.removeEventListener("mouseleave",v),t.removeEventListener("focus",m),t.removeEventListener("blur",v)}}if(a.trigger==="click"){let f=()=>{o.style.visibility==="visible"?x.destroy():(o.style.visibility="visible",o.style.opacity="1")};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",f),()=>t.removeEventListener("click",f)}return o.style.opacity="0",o.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{o.style.opacity="1"}),()=>{}})(),x={el:o,destroy(){d(),b(),window.removeEventListener("keydown",p),i.forEach(f=>f.removeEventListener("click",s)),a.blocking&&Array.from(document.body.children).forEach(f=>{f!==e&&f.removeAttribute("inert")}),o.style.pointerEvents="none",o.style.opacity="0",setTimeout(()=>o.remove(),200)}};return x}var Bv=K(Me(),1),je=K(We(),1),uI=K(Bo(),1);var Ve=K(Me(),1);function j2({completed:t,total:e}){let a=e>0?Math.round(t/e*100):0;return(0,Ve.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,Ve.jsx)("div",{role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,className:"se-h-full se-rounded-full se-bg-blue-5 se-transition-all se-duration-300",style:{width:`${a}%`}})})}function G2({step:t,isCompleted:e,isCurrent:a,tourId:r,onStepClick:n}){return(0,Ve.jsxs)("button",{type:"button","data-testid":`step-${t.id}`,"data-current":a?"true":void 0,"data-completed":e?"true":void 0,"aria-current":a?"step":void 0,className:`se-flex se-items-center se-gap-2 se-w-full se-py-1.5 se-px-2 se-rounded se-border-none se-bg-transparent se-cursor-pointer se-text-left se-text-xs ${a?"se-font-semibold se-text-slate-grey-10":"se-text-slate-grey-8"}`,onClick:()=>n(r,t.id),children:[(0,Ve.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,Ve.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):a?(0,Ve.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,Ve.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,Ve.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function W2({workflow:t,expanded:e,onStepClick:a,onDismiss:r}){let n=t.completedSteps.length,o=t.steps.length;return(0,Ve.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,Ve.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,Ve.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,Ve.jsx)("span",{className:"se-flex-1 se-text-[13px] se-font-semibold se-text-slate-grey-10 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.meta.title}),(0,Ve.jsx)("button",{type:"button","data-testid":`dismiss-${t.tourId}`,className:"se-shrink-0 se-py-0.5 se-px-1.5 se-rounded se-border-none se-bg-transparent se-text-slate-grey-7 se-text-xs se-cursor-pointer se-leading-none",onClick:()=>r(t.tourId),"aria-label":`Dismiss ${t.meta.title}`,children:"\u2715"})]}),(0,Ve.jsxs)("div",{className:"se-mb-2",children:[(0,Ve.jsx)(j2,{completed:n,total:o}),(0,Ve.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[n," of ",o," steps"]})]}),(0,Ve.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(i=>(0,Ve.jsx)(G2,{step:i,isCompleted:t.completedSteps.includes(i.id),isCurrent:t.currentStepId===i.id,tourId:t.tourId,onStepClick:a},i.id))}),e&&t.meta.description&&(0,Ve.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function sI({workflows:t,expanded:e,onStepClick:a,onDismiss:r}){return t.length===0?(0,Ve.jsx)("div",{className:"se-flex se-items-center se-justify-center se-py-6 se-text-xs se-text-slate-grey-7",children:"No active workflows"}):(0,Ve.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(n=>(0,Ve.jsx)(W2,{workflow:n,expanded:e,onStepClick:a,onDismiss:r},n.tourId))})}function lI(t,e){let a=document.createElement("div");a.setAttribute("data-testid","workflow-toast"),a.className="se-fixed se-bottom-4 se-right-4 se-z-50",Object.assign(a.style,{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483646",padding:"12px 16px",borderRadius:"8px",backgroundColor:"var(--se-color-bg-surface, #fff)",color:"var(--se-color-text-primary, #1a1a1a)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",maxWidth:"320px",fontFamily:"var(--se-font-family, system-ui, sans-serif)",fontSize:"14px",lineHeight:"1.4",transition:"opacity 0.3s ease"});let r=document.createElement("div");if(r.className="se-font-semibold",r.style.fontWeight="600",r.textContent=e.title,a.appendChild(r),e.body){let i=document.createElement("div");i.className="se-mt-1 se-text-sm",i.style.marginTop="4px",i.style.fontSize="13px",i.style.color="var(--se-color-text-secondary, #666)",i.textContent=e.body,a.appendChild(i)}t.appendChild(a);let n,o=setTimeout(()=>{a.style.opacity="0",n=setTimeout(()=>{a.remove()},300)},4e3);return()=>{clearTimeout(o),clearTimeout(n),a.remove()}}function Z2(t){let e=new Map;for(let a of t){let r=a.action;if(r.kind==="core:tour"&&r.workflow&&r.tourId){let n=r.workflow,i=(r.steps||[]).map(s=>({id:s.id,title:n.stepTitles?.[s.id]||s.id}));e.set(r.tourId,{meta:n,steps:i})}}return e}function X2({runtime:t}){let[e,a]=(0,je.useState)(0),r=(0,je.useMemo)(()=>{let x=t?.actions?.getActive?.()||[];return Z2(x)},[t,e]),n=(0,je.useRef)(r);n.current=r,(0,je.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>a(x=>x+1))},[t]);let o=(0,je.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),i=(0,je.useRef)(new Set),s=(0,je.useRef)([]),l=(0,je.useRef)(null),u=(0,je.useRef)({}),[c,d]=(0,je.useState)([]),p=(0,je.useRef)(!1);if(!p.current&&o){let x=o.get?.("notified")||[];for(let m of x)i.current.add(m);let f=o.get?.("completed")||{};u.current={...f},p.current=!0}(0,je.useEffect)(()=>{if(r.size===0)return;let x=o?.get?.("dismissed")||[],f=o?.get?.("completed")||{};d(m=>{let v=new Set(m.map(_=>_.tourId)),y=[];for(let[_,{meta:w,steps:C}]of r){if(v.has(_))continue;let A="active";x.includes(_)?A="dismissed":f[_]&&(A="completed"),y.push({tourId:_,meta:w,steps:C,currentStepId:null,completedSteps:[],status:A,completedAt:f[_]||void 0})}return y.length>0?[...m,...y]:m});for(let[m,{meta:v}]of r)if(!i.current.has(m)&&v.notification&&l.current&&!x.includes(m)&&!f[m]){i.current.add(m),o?.set?.("notified",[...i.current]);let y=lI(l.current,v.notification);s.current.push(y)}},[r,o]),(0,je.useEffect)(()=>{if(!t?.events?.subscribe)return;let x=t.events.subscribe({patterns:["^tour\\."]},f=>{let m=f.props?.tourId;if(!m)return;let v=n.current;if(!v.has(m)&&f.name==="tour.started"){a(y=>y+1);return}v.has(m)&&d(y=>y.map(w=>{if(w.tourId!==m)return w;switch(f.name){case"tour.started":{let C=f.props?.startStepId||w.steps[0]?.id||null;if(!i.current.has(m)){i.current.add(m),o?.set?.("notified",[...i.current]);let E=v.get(m);if(E?.meta.notification&&l.current){let L=lI(l.current,E.meta.notification);s.current.push(L)}}let A=y.filter(E=>E.status==="active"||E.tourId===m).map(E=>E.tourId);return A.includes(m)||A.push(m),o?.set?.("active",[...new Set(A)]),{...w,status:"active",currentStepId:C,completedSteps:w.status==="active"?w.completedSteps:[]}}case"tour.step_started":{let C=f.props?.stepId;return{...w,currentStepId:C||w.currentStepId}}case"tour.step_changed":{let C=f.props?.previousStepId,A=f.props?.nextStepId,E=C&&!w.completedSteps.includes(C)?[...w.completedSteps,C]:w.completedSteps;return{...w,currentStepId:A||w.currentStepId,completedSteps:E}}case"tour.completed":{let C=Date.now();return u.current[m]=C,o?.set?.("completed",{...u.current}),{...w,status:"completed",currentStepId:null,completedSteps:w.steps.map(A=>A.id),completedAt:C}}case"tour.paused":return w;default:return w}}))});return()=>{x();for(let f of s.current)f();s.current=[]}},[t,o]);let g=(0,je.useCallback)((x,f)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:x,stepId:f})},[t]),S=(0,je.useCallback)(x=>{d(f=>{let m=f.map(y=>y.tourId===x?{...y,status:"dismissed"}:y),v=m.filter(y=>y.status==="dismissed").map(y=>y.tourId);return o?.set?.("dismissed",v),m})},[o]),b=(0,je.useMemo)(()=>c.filter(x=>x.status==="active"),[c]);return(0,Bv.jsx)("div",{ref:l,children:(0,Bv.jsx)(sI,{workflows:b,onStepClick:g,onDismiss:S})})}var cI={mount(t,e){let a=e?.runtime||null,r=(0,uI.createRoot)(t);return r.render(je.default.createElement(X2,{runtime:a})),()=>{r.unmount()}}};var dI=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};a.getAttribute("data-syntro-highlight")&&e.overlayRoot.querySelectorAll(".syntro-spotlight-scrim, .syntro-spotlight-ring").forEach(s=>s.remove()),a.setAttribute("data-syntro-highlight","true");let n=t.style?.color;if(!n)try{let i=getComputedStyle(e.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();i&&(n=i)}catch{}let o=wL(a,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:n,blocking:t.blocking??!1,onClickOutside:t.onClickOutside??!0,onEsc:t.onEsc??!0});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{o.destroy(),a.removeAttribute("data-syntro-highlight")}}},fI=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=t.duration??4e3;await new Promise(b=>requestAnimationFrame(b));let n=b=>({r:parseInt(b.slice(1,3),16),g:parseInt(b.slice(3,5),16),b:parseInt(b.slice(5,7),16)}),i={r:79,g:70,b:229},s=null;try{let b=getComputedStyle(e.overlayRoot),x=b.getPropertyValue("--sc-color-primary")?.trim(),f=b.getPropertyValue("--sc-color-primary-hover")?.trim();x?.startsWith("#")&&x.length>=7&&(i=n(x)),f?.startsWith("#")&&f.length>=7&&(s=n(f))}catch{}let l=document.querySelector("[data-syntro-pulse-styles]");l&&l.remove();let u=document.createElement("style");u.setAttribute("data-syntro-pulse-styles","");let{r:c,g:d,b:p}=i;if(s){let{r:b,g:x,b:f}=s;u.textContent=`
|
|
62
63
|
@keyframes syntro-pulse-anim {
|
|
63
64
|
0%, 100% {
|
|
64
|
-
box-shadow: 0 0 0 0 rgba(
|
|
65
|
+
box-shadow: 0 0 0 0 rgba(${c}, ${d}, ${p}, 0.35);
|
|
66
|
+
}
|
|
67
|
+
25% {
|
|
68
|
+
box-shadow: 0 0 0 12px rgba(${c}, ${d}, ${p}, 0);
|
|
65
69
|
}
|
|
66
70
|
50% {
|
|
67
|
-
box-shadow: 0 0 0
|
|
71
|
+
box-shadow: 0 0 0 0 rgba(${b}, ${x}, ${f}, 0.35);
|
|
72
|
+
}
|
|
73
|
+
75% {
|
|
74
|
+
box-shadow: 0 0 0 12px rgba(${b}, ${x}, ${f}, 0);
|
|
68
75
|
}
|
|
69
76
|
}
|
|
70
|
-
|
|
77
|
+
`}else u.textContent=`
|
|
78
|
+
@keyframes syntro-pulse-anim {
|
|
79
|
+
0%, 100% {
|
|
80
|
+
box-shadow: 0 0 0 0 rgba(${c}, ${d}, ${p}, 0.35);
|
|
81
|
+
}
|
|
82
|
+
50% {
|
|
83
|
+
box-shadow: 0 0 0 12px rgba(${c}, ${d}, ${p}, 0);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
`;document.head.appendChild(u);let g=a.style.animation;a.style.animation="syntro-pulse-anim 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite",a.setAttribute("data-syntro-pulse","true");let S=setTimeout(()=>{a.style.animation=g,a.removeAttribute("data-syntro-pulse")},r);return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:pulse",anchorId:t.anchorId,duration:r}),{cleanup:()=>{clearTimeout(S),a.style.animation=g,a.removeAttribute("data-syntro-pulse")}}},pI=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r="#4f46e5";try{let s=getComputedStyle(e.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();s?.startsWith("#")&&s.length>=7&&(r=s)}catch{}let n=document.createElement("div");n.textContent=t.content,n.setAttribute("data-syntro-badge",t.anchorId.selector),Object.assign(n.style,{position:"absolute",padding:"2px 6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",color:"white",background:r,borderRadius:"9999px",pointerEvents:"none",zIndex:"2147483646",whiteSpace:"nowrap"});let o=t.position??"top-right",i=a.style.position;switch(getComputedStyle(a).position==="static"&&(a.style.position="relative"),a.appendChild(n),o){case"top-left":Object.assign(n.style,{top:"-8px",left:"-8px"});break;case"top-right":Object.assign(n.style,{top:"-8px",right:"-8px"});break;case"bottom-left":Object.assign(n.style,{bottom:"-8px",left:"-8px"});break;case"bottom-right":Object.assign(n.style,{bottom:"-8px",right:"-8px"});break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:badge",anchorId:t.anchorId,content:t.content,position:o}),{cleanup:()=>{n.remove(),i!==void 0&&(a.style.position=i)},updateFn:s=>{"content"in s&&typeof s.content=="string"&&(n.textContent=s.content)}}},hI=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let{content:r}=t,n="";if(r.title&&(n+=`<div class="syntro-tt-title">${ha(r.title)}</div>`),n+=`<div class="syntro-tt-body">${ha(r.body)}</div>`,r.ctaButtons&&r.ctaButtons.length>0){n+='<div class="syntro-tt-actions">';for(let i of r.ctaButtons){let s=i.primary??!1;n+=`
|
|
71
87
|
<button
|
|
72
88
|
class="syntro-tt-btn ${s?"syntro-tt-btn-primary":""}"
|
|
73
|
-
data-syntro-action="${
|
|
89
|
+
data-syntro-action="${ha(i.actionId)}"
|
|
74
90
|
>
|
|
75
|
-
${
|
|
91
|
+
${ha(i.label)}
|
|
76
92
|
</button>
|
|
77
|
-
`}
|
|
93
|
+
`}n+="</div>"}else r.cta&&(n+=`<div class="syntro-tt-actions">
|
|
78
94
|
<button class="syntro-tt-btn syntro-tt-btn-primary" data-syntro-action="cta">
|
|
79
|
-
${
|
|
95
|
+
${ha(r.cta.label)}
|
|
80
96
|
</button>
|
|
81
|
-
</div>`);let
|
|
97
|
+
</div>`);let o=rI(a,e.overlayRoot,{html:n,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:i=>{if(i==="dismiss"){o.destroy();return}if(i==="cta"&&r.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:r.cta.label});else if(r.ctaButtons){let s=r.ctaButtons.find(l=>l.actionId===i);s&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:i,label:s.label})}o.destroy()}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:tooltip",anchorId:t.anchorId,trigger:t.trigger??"immediate"}),{cleanup:()=>{o.destroy()}}},Fv=[{kind:"overlays:highlight",executor:dI},{kind:"overlays:pulse",executor:fI},{kind:"overlays:badge",executor:pI},{kind:"overlays:tooltip",executor:hI},{kind:"overlays:modal",executor:Tv},{kind:"core:tour",executor:kv},{kind:"overlays:celebrate",executor:CL}],bf={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, celebrations, visual overlays, and workflow tracking",executors:Fv,widgets:[{id:"adaptive-overlays:workflow-tracker",component:cI,metadata:{name:"Workflow Tracker",icon:"\u{1F4CB}",description:"Tracks multi-step workflow progress across tours"}}]};function Sf(t){let{appId:e,runtime:a,isBuiltIn:r=!1}=t,n=`app:${e}:`,o=[],i=[],s=a.state.ns(`app:${e}`);return{appId:e,state:{get:u=>s.get(u),set:(u,c)=>s.set(u,c),remove:u=>s.remove(u)},telemetry:a.telemetry?{emit:(u,c)=>{a.events.publish(u,{...c,_appId:e})},getSessionId:()=>a.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(u,c,d)=>{let p=a.surfaces.mount(u,c,{...d,adaptiveId:e});return{unmount:()=>p.unmount(),update:g=>p.update(g)}},canMount:(u,c)=>a.surfaces.canMount(u,c)},events:{subscribe:u=>a.events.subscribe(c=>{u(c)}),publish:(u,c)=>{a.events.publish(u,{...c,_appId:e})}},registerAction:u=>{a.executors.register(u.kind,u.executor,u.schema,e,r),o.push(u.kind)},registerWidget:u=>{a.widgets.register(u.id,u.component,e,u.metadata),i.push(u.id)}}}function Cf(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var Y2=new Set(["overlays:highlight","overlays:pulse","overlays:badge","overlays:tooltip","overlays:modal","content:insertHtml","content:setText","content:setAttr","content:addClass","content:removeClass","content:setStyle","core:mountWidget","core:wait","core:sequence","core:parallel","core:tour"]),K2={faq:"adaptive-faq",nav:"adaptive-nav",gamification:"adaptive-gamification",chatbot:"adaptive-chatbot"};function mI(t){return K2[t]??t}function Nv(t){return Y2.has(t)}function Pv(t){if(Nv(t))return null;let e=t.indexOf(":");return e===-1?null:mI(t.slice(0,e))}function _f(t){let e=t.indexOf(":");return e===-1?null:mI(t.slice(0,e))}function wf(t){let{cdnBase:e,registry:a,timeout:r=1e4,onLoadStart:n,onLoadEnd:o}=t,i=new Map,s=new Set,l=new Map;function u(b){return`${e}/adaptives/${b}/index.js`}async function c(b){if(a.has(b))return{appId:b,success:!0,manifest:a.get(b)?.manifest};if(l.has(b))return l.get(b);if(i.has(b))return i.get(b);let x=(async()=>{n?.(b);try{let f=u(b);if(s.has(f)){let _=a.get(b);if(_)return o?.(b,!0),{appId:b,success:!0,manifest:_.manifest}}let m=new Promise((_,w)=>{setTimeout(()=>w(new Error(`Timeout loading app: ${b}`)),r)}),v=d(f,b);await Promise.race([v,m]),s.add(f);let y=a.get(b);if(!y)throw new Error(`App ${b} did not register after loading`);return o?.(b,!0),{appId:b,success:!0,manifest:y.manifest}}catch(f){let m=f instanceof Error?f.message:String(f);o?.(b,!1,m);let v={appId:b,success:!1,error:m};return l.set(b,v),v}finally{i.delete(b)}})();return i.set(b,x),x}async function d(b,x){if(typeof window<"u"){try{let f=await import(b);f.manifest?a.register(f.manifest):f.default?.manifest?a.register(f.default.manifest):f.default&&a.register(f.default);return}catch{}return new Promise((f,m)=>{let v=document.createElement("script");v.src=b,v.async=!0,v.onload=()=>{a.get(x)?f():m(new Error(`App ${x} did not self-register`))},v.onerror=()=>{m(new Error(`Failed to load app script: ${b}`))},document.head.appendChild(v)})}throw new Error("Dynamic app loading not supported in SSR")}function p(b){let x=new Set;if(b.apps)for(let f of b.apps)x.add(f);if(b.actions)for(let f of b.actions){let m=Pv(f.kind);if(m&&x.add(m),f.kind==="core:mountWidget"){let v=f.widget?.widgetId;if(v){let y=_f(v);y&&x.add(y)}}}if(b.tiles){for(let f of b.tiles)if(f.widget){let m=_f(f.widget);m&&x.add(m)}}return Array.from(x)}async function g(b){let x=p(b);return x.length===0?[]:await Promise.all(x.map(m=>c(m)))}async function S(b){return Promise.all(b.map(x=>c(x)))}return{loadApp:c,loadAppsForConfig:g,preloadApps:S,getRequiredApps:p,getAppUrl:u}}var gu=class{constructor(){$(this,"apps",new Map);$(this,"eventListeners",new Set);$(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,a]of this.apps)a.state==="active"&&await this.deactivate(e);this.runtime=null}register(e){if(!e.id||typeof e.id!="string")throw new Error("App manifest must have an 'id' property");if(!e.version||typeof e.version!="string")throw new Error("App manifest must have a 'version' property");if(!e.name||typeof e.name!="string")throw new Error("App manifest must have a 'name' property");if(this.apps.has(e.id)){if(this.apps.get(e.id).state==="active")throw new Error(`Cannot re-register active app: ${e.id}`);console.warn(`[AppRegistry] Overriding existing app registration: ${e.id}`)}let a={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,a),this.emit({type:"app:registered",appId:e.id,manifest:e}),a}async activate(e){let a=this.apps.get(e);if(!a)throw new Error(`App not registered: ${e}`);if(a.state==="active"||a.state==="activating"){console.warn(`[AppRegistry] App already ${a.state}: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(a.manifest.dependencies)for(let r of a.manifest.dependencies){let n=this.apps.get(r);if(!n||n.state!=="active")throw new Error(`App ${e} depends on ${r}, which is not active`)}a.state="activating";try{let r=a.manifest.metadata?.isBuiltIn===!0,n=Sf({appId:e,runtime:this.runtime,isBuiltIn:r}),{runtime:o}=a.manifest,i=[];if(o){if(o.actions)for(let s of o.actions)n.registerAction(s);if(o.widgets)for(let s of o.widgets)n.registerWidget(s);if(o.events)for(let s of o.events){let l=this.runtime.events.subscribe(u=>{if(s.names.includes(u.name)){let c={appId:e,state:n.state,telemetry:n.telemetry,surfaces:n.surfaces};try{s.handler(u,c)}catch(d){console.error(`[AppRegistry] Event handler error in ${e}:`,d)}}});i.push(l)}}a.cleanup=async()=>{for(let s of i)try{await s()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}Cf(e,this.runtime)},a.state="active",a.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(r){throw a.state="error",a.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async deactivate(e){let a=this.apps.get(e);if(!a)throw new Error(`App not registered: ${e}`);if(a.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[r,n]of this.apps)if(n.state==="active"&&n.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${r} depends on it`);a.state="deactivating";try{a.cleanup&&(await a.cleanup(),a.cleanup=void 0),a.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(r){throw a.state="error",a.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async unregister(e){let a=this.apps.get(e);a&&(a.state==="active"&&await this.deactivate(e),this.apps.delete(e),this.emit({type:"app:unregistered",appId:e}))}get(e){return this.apps.get(e)}has(e){return this.apps.has(e)}isActive(e){return this.apps.get(e)?.state==="active"}list(){return Array.from(this.apps.values())}listActive(){return Array.from(this.apps.values()).filter(e=>e.state==="active")}listEditable(){return Array.from(this.apps.values()).filter(e=>e.manifest.editor!==void 0)}subscribe(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}emit(e){for(let a of this.eventListeners)try{a(e)}catch(r){console.error("[AppRegistry] Event listener error:",r)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},fs=new gu;var Za=K(Me(),1);var zo=K(We(),1),Uv=K(Bo(),1);var $r=K(We(),1);var gI=/```json\s*\n([\s\S]*?)```/g;function vI(t){let e=[],a=t,r=[],n;for(gI.lastIndex=0;(n=gI.exec(t))!==null;)r.push({fullMatch:n[0],json:n[1],index:n.index});for(let o=r.length-1;o>=0;o--){let{fullMatch:i,json:s}=r[o],l;try{l=JSON.parse(s)}catch{continue}typeof l=="object"&&l!==null&&"kind"in l&&typeof l.kind=="string"&&(e.unshift(l),a=a.replace(i,""))}return a=a.replace(/\n{3,}/g,`
|
|
82
98
|
|
|
83
|
-
`).trim(),{displayText:
|
|
84
|
-
<div style="padding: 16px; font-family: system-ui; color: ${
|
|
85
|
-
<p style="margin: 0 0 8px; color: ${
|
|
86
|
-
<p style="margin: 0; font-size: 12px; color: ${
|
|
99
|
+
`).trim(),{displayText:a,actions:e}}var vu=class extends Error{constructor(e){super(e),this.name="AuthError"}};function Q2(){let t=document.cookie.match(/stytch_session_jwt=([^;]*)/);if(!t||!t[1])throw new vu("No authentication token found");let e=localStorage.getItem("syntrologie_workspace_id");if(!e)throw new vu("No workspace ID found");return{Authorization:`Bearer ${t[1]}`,"X-Workspace-Id":e}}async function yI(t,e){let a=Q2(),r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...a},body:JSON.stringify(e)});if(!r.ok)throw r.status===401?new vu("Session expired or unauthorized"):new Error(`Chat request failed: ${r.status} ${r.statusText}`);return r.json()}var J2=0;function Hv(){return`msg-${Date.now()}-${++J2}`}function xI(t){let{backendUrl:e,tileId:a,runtime:r,greeting:n,maxHistory:o=20,mlflowRunId:i,config:s}=t,[l,u]=(0,$r.useState)(()=>n?[{id:Hv(),role:"assistant",text:n,timestamp:Date.now()}]:[]),[c,d]=(0,$r.useState)(!1),[p,g]=(0,$r.useState)(null),S=(0,$r.useRef)(null),b=(0,$r.useCallback)(async f=>{let m=f.trim();if(!m)return;g(null);let v={id:Hv(),role:"user",text:m,timestamp:Date.now()};u(y=>[...y,v]),d(!0);try{let _=[...l,v].slice(-o).map(L=>({role:L.role,content:L.text})),w=await yI(e,{message:m,history:_,mlflow_run_id:i,current_config:s}),{displayText:C,actions:A}=vI(w.response),E={id:Hv(),role:"assistant",text:C,timestamp:Date.now()};u(L=>[...L,E]),A.length>0&&(S.current?.isApplied()&&await S.current.revertAll(),S.current=await r.actions.applyBatch(A),r.events.publish("chatbot.actions_applied",{count:A.length,kinds:A.map(L=>L.kind),tileId:a}))}catch(y){let _=y instanceof Error?y.message:"An unexpected error occurred";g(_)}finally{d(!1)}},[e,l,o,i,s,r,a]),x=(0,$r.useCallback)(()=>{u([]),g(null),S.current?.isApplied()&&(S.current.revertAll(),S.current=null),sessionStorage.removeItem(`syntro:chatbot:history:${a}`)},[a]);return{messages:l,isLoading:c,error:p,sendMessage:b,clearMessages:x}}var Wa={container:{display:"flex",flexDirection:"column",height:"100%",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"14px",touchAction:"none"},messageList:{flex:1,overflowY:"auto",padding:"12px",display:"flex",flexDirection:"column",gap:"8px"},messageBubble:{maxWidth:"85%",padding:"8px 12px",borderRadius:"12px",lineHeight:1.5,wordBreak:"break-word"},userMessage:{alignSelf:"flex-end",backgroundColor:Ft[4],color:Va.white,borderBottomRightRadius:"4px"},assistantMessage:{alignSelf:"flex-start",backgroundColor:"rgba(255, 255, 255, 0.08)",color:I[10],borderBottomLeftRadius:"4px"},loadingDots:{alignSelf:"flex-start",padding:"8px 16px",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:"12px",color:I[8],fontSize:"13px"},errorBanner:{padding:"8px 12px",backgroundColor:"rgba(239, 68, 68, 0.1)",color:ze[4],fontSize:"13px",borderRadius:"8px",margin:"0 12px"},inputForm:{display:"flex",gap:"8px",padding:"12px",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},input:{flex:1,padding:"8px 12px",borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.1)",backgroundColor:"rgba(0, 0, 0, 0.2)",color:I[12],fontSize:"14px",outline:"none",fontFamily:"inherit"},sendButton:{padding:"8px 16px",borderRadius:"8px",border:"none",backgroundColor:Ft[4],color:Va.white,fontWeight:600,fontSize:"13px",cursor:"pointer",whiteSpace:"nowrap"},sendButtonDisabled:{opacity:.5,cursor:"not-allowed"}};function eD({message:t}){let e=t.role==="user",a={...Wa.messageBubble,...e?Wa.userMessage:Wa.assistantMessage};return(0,Za.jsx)("div",{style:a,children:t.text})}function tD({config:t,runtime:e,tileId:a}){let{messages:r,isLoading:n,error:o,sendMessage:i,clearMessages:s}=xI({backendUrl:t.backendUrl,tileId:a,runtime:e,greeting:t.greeting,maxHistory:t.maxHistory,mlflowRunId:t.mlflowRunId}),l=(0,zo.useRef)(null),u=(0,zo.useRef)(null);(0,zo.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[]);let c=d=>{d.preventDefault();let p=u.current;if(!p||!p.value.trim()||n)return;let g=p.value;p.value="",i(g)};return(0,Za.jsxs)("div",{style:Wa.container,"data-testid":"chat-assistant",children:[(0,Za.jsxs)("div",{ref:l,style:Wa.messageList,children:[r.map(d=>(0,Za.jsx)(eD,{message:d},d.id)),n&&(0,Za.jsx)("div",{style:Wa.loadingDots,children:"Thinking..."})]}),o&&(0,Za.jsx)("div",{style:Wa.errorBanner,children:o}),(0,Za.jsxs)("form",{onSubmit:c,style:Wa.inputForm,children:[(0,Za.jsx)("input",{ref:u,style:Wa.input,placeholder:"Ask anything...",disabled:n,"data-testid":"chat-input"}),(0,Za.jsx)("button",{type:"submit",disabled:n,style:{...Wa.sendButton,...n?Wa.sendButtonDisabled:{}},"data-testid":"chat-send",children:"Send"})]})]})}var bI={mount(t,e){let{config:a,runtime:r,tileId:n="chatbot-widget"}=e||{};if(a&&r&&typeof Uv.createRoot=="function"){let o=(0,Uv.createRoot)(t);return o.render(zo.default.createElement(tD,{config:a,runtime:r,tileId:n})),()=>{o.unmount()}}return!a||!r?(t.innerHTML=`<div style="padding: 16px; color: ${I[8]};">Chat widget requires config and runtime.</div>`,()=>{t.innerHTML=""}):(t.innerHTML=`
|
|
100
|
+
<div style="padding: 16px; font-family: system-ui; color: ${I[10]};">
|
|
101
|
+
<p style="margin: 0 0 8px; color: ${I[8]};">${a.greeting||"Hi! How can I help?"}</p>
|
|
102
|
+
<p style="margin: 0; font-size: 12px; color: ${I[7]};">Chat widget mounted. Awaiting React renderer.</p>
|
|
87
103
|
</div>
|
|
88
|
-
`,()=>{t.innerHTML=""})}};var _E={id:"adaptive-chatbot",version:"1.0.0",name:"Chat Assistant",description:"AI chat assistant with action execution capabilities",executors:[],widgets:[{id:"adaptive-chatbot:assistant",component:bE,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function SE(t,e,n){if(e){let i=t.getState().items.find(r=>r.config.id===e);if(i)return i}if(n){let i=t.findByQuestion(n);if(i)return i}throw new Error("FAQ item not found")}async function FM(t,e,n){let i=SE(n,t.itemId,t.itemQuestion),{id:r}=i.config;t.expand!==!1&&n.expand(r);let a=document.querySelector(`[data-faq-item-id="${r}"]`);return a&&a.scrollIntoView({behavior:t.behavior??"smooth"}),e.publishEvent("faq:scroll_to",{itemId:r}),{cleanup:()=>{}}}async function UM(t,e,n){let i=SE(n,t.itemId,t.itemQuestion),{id:r}=i.config,a=t.state??"toggle",o;switch(a){case"open":n.expand(r),o="open";break;case"closed":n.collapse(r),o="closed";break;default:{let s=n.getState().expandedItems.has(r);n.toggle(r),o=s?"closed":"open";break}}return e.publishEvent("faq:toggle",{itemId:r,newState:o}),{cleanup:()=>{}}}async function VM(t,e,n){switch(t.operation){case"add":{let i=t.items??[],r=t.position==="prepend"?"prepend":"append";n.addItems(i,r);break}case"remove":{if(!t.itemId)throw new Error("FAQ item not found");if(!n.getState().items.some(r=>r.config.id===t.itemId))throw new Error("FAQ item not found");n.removeItem(t.itemId);break}case"reorder":{let i=t.order??[];n.reorderItems(i);break}case"replace":{let i=t.items??[];n.replaceItems(i);break}}return e.publishEvent("faq:update",{operation:t.operation}),{cleanup:()=>{}}}var xE=[{kind:"faq:scroll_to",executor:FM},{kind:"faq:toggle_item",executor:UM},{kind:"faq:update",executor:VM}];var $e=ee(qe(),1);var ke=ee(nt(),1),Km=ee(Ko(),1);function wE(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function jM(t){return typeof t=="string"?(0,$e.jsx)("p",{style:{margin:0},children:t}):t.type==="rich"?(0,$e.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}}):(0,$e.jsx)("p",{style:{margin:0},children:t.content})}function qM(t){return t?t===!0?{style:"thumbs"}:t:null}function PM(t){return t.prompt||"Was this helpful?"}var Et={container:{fontFamily:"system-ui, -apple-system, sans-serif",maxWidth:"800px",margin:"0 auto"},searchWrapper:{marginBottom:"16px"},searchInput:{width:"100%",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",outline:"none",transition:"border-color 0.15s ease"},accordion:{display:"flex",flexDirection:"column",gap:"8px"},item:{borderRadius:"8px",overflow:"hidden",transition:"box-shadow 0.15s ease"},question:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",border:"none",cursor:"pointer",fontSize:"15px",fontWeight:500,textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"18px",transition:"transform 0.2s ease"},answer:{padding:"0 20px 16px 20px",fontSize:"14px",lineHeight:1.6,overflow:"hidden",transition:"max-height 0.2s ease, padding 0.2s ease"},category:{display:"inline-block",fontSize:"11px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"4px 8px",borderRadius:"4px",marginBottom:"8px"},categoryHeader:{fontSize:"13px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",padding:"12px 4px 6px 4px",marginTop:"8px"},feedback:{display:"flex",alignItems:"center",gap:"8px",marginTop:"12px",paddingTop:"10px",borderTop:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"13px"},feedbackButton:{background:"none",border:"1px solid transparent",cursor:"pointer",fontSize:"16px",padding:"4px 8px",borderRadius:"4px",transition:"background-color 0.15s ease, border-color 0.15s ease"},feedbackButtonSelected:{borderColor:"rgba(0, 0, 0, 0.2)",backgroundColor:"rgba(0, 0, 0, 0.04)"},emptyState:{textAlign:"center",padding:"48px 24px",fontSize:"14px"},noResults:{textAlign:"center",padding:"32px 16px",fontSize:"14px"}},ns={light:{container:{backgroundColor:Ze.white,color:E[1]},searchInput:{backgroundColor:E[12],border:`1px solid ${E[11]}`,color:E[1]},item:{backgroundColor:E[12],border:`1px solid ${E[11]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},question:{backgroundColor:"transparent",color:E[1]},questionHover:{backgroundColor:E[12]},answer:{color:E[6]},category:{backgroundColor:at[8],color:at[2]},categoryHeader:{color:E[7]},emptyState:{color:E[8]},feedbackPrompt:{color:E[7]}},dark:{container:{backgroundColor:E[1],color:E[12]},searchInput:{backgroundColor:E[3],border:`1px solid ${E[5]}`,color:E[12]},item:{backgroundColor:E[3],border:`1px solid ${E[5]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},question:{backgroundColor:"transparent",color:E[12]},questionHover:{backgroundColor:E[5]},answer:{color:E[8]},category:{backgroundColor:at[0],color:at[6]},categoryHeader:{color:E[8]},emptyState:{color:E[7]},feedbackPrompt:{color:E[8]}}};function GM({item:t,isExpanded:e,onToggle:n,theme:i,feedbackConfig:r,feedbackValue:a,onFeedback:o}){let[s,l]=(0,ke.useState)(!1),c=ns[i],{question:u,answer:f}=t.config,h={...Et.item,...c.item,...e?c.itemExpanded:{}},g={...Et.question,...c.question,...s?c.questionHover:{}},_={...Et.chevron,transform:e?"rotate(180deg)":"rotate(0deg)"},b={...Et.answer,...c.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},w={...Et.feedback,...c.feedbackPrompt};return(0,$e.jsxs)("div",{style:h,"data-faq-item-id":t.config.id,children:[(0,$e.jsxs)("button",{type:"button",style:g,onClick:n,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),"aria-expanded":e,children:[(0,$e.jsx)("span",{children:u}),(0,$e.jsx)("span",{style:_,children:"\u25BC"})]}),(0,$e.jsxs)("div",{style:b,"aria-hidden":!e,children:[jM(f),e&&r&&(0,$e.jsxs)("div",{style:w,children:[(0,$e.jsx)("span",{children:PM(r)}),(0,$e.jsx)("button",{type:"button",style:{...Et.feedbackButton,...a==="up"?Et.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>o(t.config.id,u,"up"),children:"\u{1F44D}"}),(0,$e.jsx)("button",{type:"button",style:{...Et.feedbackButton,...a==="down"?Et.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>o(t.config.id,u,"down"),children:"\u{1F44E}"})]})]})]})}function ZM({config:t,runtime:e,instanceId:n}){let[i,r]=(0,ke.useReducer)(C=>C+1,0),[a,o]=(0,ke.useState)(new Set),[s,l]=(0,ke.useState)(""),[c,u]=(0,ke.useState)(new Map),f=(0,ke.useMemo)(()=>qM(t.feedback),[t.feedback]);(0,ke.useEffect)(()=>e.context.subscribe(()=>{r()}),[e.context]),(0,ke.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{r()})},[e.accumulator]),(0,ke.useEffect)(()=>{if(!t.scope||!e.accumulator?.register)return;let{events:C,urlContains:x,props:M}=t.scope,z=new Set;for(let U of t.actions)if(U.showWhen?.type==="rules")for(let P of U.showWhen.rules)for(let Z of P.conditions)Z.type==="event_count"&&Z.key&&z.add(Z.key);for(let U of z)e.accumulator.register(U,P=>{if(!C.includes(P.name)||x&&!String(P.props?.pathname??"").includes(x))return!1;if(M){for(let[Z,X]of Object.entries(M))if(P.props?.[Z]!==X)return!1}return!0})},[t.scope,t.actions,e.accumulator]),(0,ke.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let M=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(z=>{let U=z.props?.actionId;return typeof U=="string"&&U.startsWith("faq:open:")}).pop();if(M&&Date.now()-M.ts<1e4){let z=M.props.actionId.replace("faq:open:","");o(new Set([z])),requestAnimationFrame(()=>{let U=document.querySelector(`[data-faq-item-id="${z}"]`);U&&U.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},x=>{let M=x.props?.actionId;if(typeof M!="string"||!M.startsWith("faq:open:"))return;let z=M.replace("faq:open:","");o(new Set([z])),requestAnimationFrame(()=>{let U=document.querySelector(`[data-faq-item-id="${z}"]`);U&&U.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]);let h=(0,ke.useMemo)(()=>t.actions.filter(C=>C.showWhen?e.evaluateSync(C.showWhen).value:!0),[t.actions,e,i]),g=(0,ke.useMemo)(()=>t.ordering==="priority"?[...h].sort((C,x)=>(x.config.priority??0)-(C.config.priority??0)):h,[h,t.ordering]),_=(0,ke.useMemo)(()=>{if(!t.searchable||!s.trim())return g;let C=s.toLowerCase();return g.filter(x=>x.config.question.toLowerCase().includes(C)||wE(x.config.answer).toLowerCase().includes(C)||x.config.category?.toLowerCase().includes(C))},[g,s,t.searchable]),b=(0,ke.useMemo)(()=>{let C=new Map;for(let x of _){let M=x.config.category;C.has(M)||C.set(M,[]),C.get(M).push(x)}return C},[_]),w=(0,ke.useMemo)(()=>_.some(C=>C.config.category),[_]),d=(0,ke.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),p=(0,ke.useCallback)(C=>{o(x=>{let M=new Set(x);return t.expandBehavior==="single"?x.has(C)?new Set:new Set([C]):(x.has(C)?M.delete(C):M.add(C),M)}),e.events.publish("faq:toggled",{instanceId:n,questionId:C,expanded:!a.has(C),timestamp:Date.now()})},[t.expandBehavior,e.events,n,a]),m=(0,ke.useCallback)((C,x,M)=>{u(z=>{let U=new Map(z);return U.set(C,M),U}),e.events.publish("faq:feedback",{itemId:C,question:x,value:M})},[e.events]),v={...Et.container,...ns[d].container},S={...Et.searchInput,...ns[d].searchInput},T={...Et.emptyState,...ns[d].emptyState},A={...Et.categoryHeader,...ns[d].categoryHeader},k=C=>C.map(x=>(0,$e.jsx)(GM,{item:x,isExpanded:a.has(x.config.id),onToggle:()=>p(x.config.id),theme:d,feedbackConfig:f,feedbackValue:c.get(x.config.id),onFeedback:m},x.config.id));return h.length===0?(0,$e.jsx)("div",{style:v,"data-adaptive-id":n,"data-adaptive-type":"adaptive-faq",children:(0,$e.jsx)("div",{style:T,children:"No FAQ questions available."})}):(0,$e.jsxs)("div",{style:v,"data-adaptive-id":n,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,$e.jsx)("div",{style:Et.searchWrapper,children:(0,$e.jsx)("input",{type:"text",placeholder:"Search questions...",value:s,onChange:C=>l(C.target.value),style:S})}),(0,$e.jsx)("div",{style:Et.accordion,children:w?Array.from(b.entries()).map(([C,x])=>(0,$e.jsxs)(ke.default.Fragment,{children:[C&&(0,$e.jsx)("div",{style:A,"data-category-header":C,children:C}),k(x)]},C??"__ungrouped")):k(_)}),t.searchable&&_.length===0&&s&&(0,$e.jsxs)("div",{style:{...Et.noResults,...ns[d].emptyState},children:['No questions found matching "',s,'"']})]})}var EE={mount(t,e){let{runtime:n,instanceId:i="faq-widget",...r}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(n&&typeof Km.createRoot=="function"){let o=(0,Km.createRoot)(t);return o.render(ke.default.createElement(ZM,{config:r,runtime:n,instanceId:i})),()=>{o.unmount()}}let a=r.actions||[];return t.innerHTML=`
|
|
104
|
+
`,()=>{t.innerHTML=""})}};var SI={id:"adaptive-chatbot",version:"1.0.0",name:"Chat Assistant",description:"AI chat assistant with action execution capabilities",executors:[],widgets:[{id:"adaptive-chatbot:assistant",component:bI,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function CI(t,e,a){if(e){let r=t.getState().items.find(n=>n.config.id===e);if(r)return r}if(a){let r=t.findByQuestion(a);if(r)return r}throw new Error("FAQ item not found")}async function aD(t,e,a){let r=CI(a,t.itemId,t.itemQuestion),{id:n}=r.config;t.expand!==!1&&a.expand(n);let o=document.querySelector(`[data-faq-item-id="${n}"]`);return o&&o.scrollIntoView({behavior:t.behavior??"smooth"}),e.publishEvent("faq:scroll_to",{itemId:n}),{cleanup:()=>{}}}async function rD(t,e,a){let r=CI(a,t.itemId,t.itemQuestion),{id:n}=r.config,o=t.state??"toggle",i;switch(o){case"open":a.expand(n),i="open";break;case"closed":a.collapse(n),i="closed";break;default:{let s=a.getState().expandedItems.has(n);a.toggle(n),i=s?"closed":"open";break}}return e.publishEvent("faq:toggle",{itemId:n,newState:i}),{cleanup:()=>{}}}async function nD(t,e,a){switch(t.operation){case"add":{let r=t.items??[],n=t.position==="prepend"?"prepend":"append";a.addItems(r,n);break}case"remove":{if(!t.itemId)throw new Error("FAQ item not found");if(!a.getState().items.some(n=>n.config.id===t.itemId))throw new Error("FAQ item not found");a.removeItem(t.itemId);break}case"reorder":{let r=t.order??[];a.reorderItems(r);break}case"replace":{let r=t.items??[];a.replaceItems(r);break}}return e.publishEvent("faq:update",{operation:t.operation}),{cleanup:()=>{}}}var _I=[{kind:"faq:scroll_to",executor:aD},{kind:"faq:toggle_item",executor:rD},{kind:"faq:update",executor:nD}];var He=K(Me(),1);var Ee=K(We(),1),qv=K(Bo(),1);function wI(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function oD(t){return typeof t=="string"?(0,He.jsx)("p",{style:{margin:0},children:t}):t.type==="rich"?(0,He.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}}):(0,He.jsx)("p",{style:{margin:0},children:t.content})}function iD(t){return t?t===!0?{style:"thumbs"}:t:null}function sD(t){return t.prompt||"Was this helpful?"}var Et={container:{fontFamily:"var(--sc-font-family, system-ui, -apple-system, sans-serif)",maxWidth:"800px",margin:"0 auto"},searchWrapper:{marginBottom:"8px"},searchInput:{width:"100%",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",outline:"none",transition:"border-color 0.15s ease",backgroundColor:"var(--sc-content-search-background)",color:"var(--sc-content-search-color)"},accordion:{display:"flex",flexDirection:"column",gap:"var(--sc-content-item-gap, 6px)"},item:{borderRadius:"var(--sc-content-border-radius, 8px)",overflow:"hidden",transition:"box-shadow 0.15s ease"},question:{width:"100%",padding:"var(--sc-content-item-padding, 12px 16px)",display:"flex",alignItems:"center",justifyContent:"space-between",border:"none",cursor:"pointer",fontSize:"var(--sc-content-item-font-size, 15px)",fontWeight:500,textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"20px",transition:"transform 0.2s ease",color:"var(--sc-content-chevron-color, currentColor)"},answer:{padding:"var(--sc-content-body-padding, 0 16px 12px 16px)",fontSize:"var(--sc-content-body-font-size, 14px)",lineHeight:1.6,overflow:"hidden",transition:"max-height 0.2s ease, padding 0.2s ease"},category:{display:"inline-block",fontSize:"11px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"4px 8px",borderRadius:"4px",marginBottom:"8px"},categoryHeader:{fontSize:"var(--sc-content-category-font-size, 12px)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",padding:"var(--sc-content-category-padding, 8px 4px 4px 4px)",marginTop:"var(--sc-content-category-gap, 4px)"},feedback:{display:"flex",alignItems:"center",gap:"8px",marginTop:"12px",paddingTop:"10px",borderTop:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"13px"},feedbackButton:{background:"none",border:"1px solid transparent",cursor:"pointer",fontSize:"16px",padding:"4px 8px",borderRadius:"4px",transition:"background-color 0.15s ease, border-color 0.15s ease"},feedbackButtonSelected:{borderColor:"rgba(0, 0, 0, 0.2)",backgroundColor:"rgba(0, 0, 0, 0.04)"},emptyState:{textAlign:"center",padding:"48px 24px",fontSize:"14px"},noResults:{textAlign:"center",padding:"32px 16px",fontSize:"14px"}},ps={light:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${I[11]}`},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},question:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},questionHover:{backgroundColor:"var(--sc-content-background-hover)"},answer:{color:"var(--sc-content-text-secondary-color)"},category:{backgroundColor:Ft[8],color:Ft[2]},categoryHeader:{color:I[7]},emptyState:{color:I[8]},feedbackPrompt:{color:I[7]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${I[5]}`},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},question:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},questionHover:{backgroundColor:"var(--sc-content-background-hover)"},answer:{color:"var(--sc-content-text-secondary-color)"},category:{backgroundColor:Ft[0],color:Ft[6]},categoryHeader:{color:I[8]},emptyState:{color:I[7]},feedbackPrompt:{color:I[8]}}};function lD({item:t,isExpanded:e,isHighlighted:a,isLast:r,onToggle:n,theme:o,feedbackConfig:i,feedbackValue:s,onFeedback:l}){let[u,c]=(0,Ee.useState)(!1),d=ps[o],{question:p,answer:g}=t.config,S={...Et.item,...d.item,...e?d.itemExpanded:{},...a?{boxShadow:"0 0 0 2px #6366f1, 0 0 12px rgba(99, 102, 241, 0.4)",transition:"box-shadow 0.3s ease"}:{},...r?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},b={...Et.question,...d.question,...u?d.questionHover:{}},x={...Et.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},f={...Et.answer,...d.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},m={...Et.feedback,...d.feedbackPrompt};return(0,He.jsxs)("div",{style:S,"data-faq-item-id":t.config.id,children:[(0,He.jsxs)("button",{type:"button",style:b,onClick:n,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-expanded":e,children:[(0,He.jsx)("span",{children:p}),(0,He.jsx)("span",{style:x,children:"\u203A"})]}),(0,He.jsxs)("div",{style:f,"aria-hidden":!e,children:[oD(g),e&&i&&(0,He.jsxs)("div",{style:m,children:[(0,He.jsx)("span",{children:sD(i)}),(0,He.jsx)("button",{type:"button",style:{...Et.feedbackButton,...s==="up"?Et.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>l(t.config.id,p,"up"),children:"\u{1F44D}"}),(0,He.jsx)("button",{type:"button",style:{...Et.feedbackButton,...s==="down"?Et.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>l(t.config.id,p,"down"),children:"\u{1F44E}"})]})]})]})}function uD({config:t,runtime:e,instanceId:a}){let[r,n]=(0,Ee.useReducer)(k=>k+1,0),[o,i]=(0,Ee.useState)(new Set),[s,l]=(0,Ee.useState)(null),[u,c]=(0,Ee.useState)(""),[d,p]=(0,Ee.useState)(new Map),g=(0,Ee.useMemo)(()=>iD(t.feedback),[t.feedback]);(0,Ee.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,Ee.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]),(0,Ee.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let R=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(F=>{let N=F.props?.actionId;return typeof N=="string"&&N.startsWith("faq:open:")}).pop();if(R&&Date.now()-R.ts<1e4){let F=R.props.actionId.replace("faq:open:","");i(new Set([F])),requestAnimationFrame(()=>{let N=document.querySelector(`[data-faq-item-id="${F}"]`);N&&N.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},D=>{let R=D.props?.actionId;if(typeof R!="string"||!R.startsWith("faq:open:"))return;let F=R.replace("faq:open:","");i(new Set([F])),requestAnimationFrame(()=>{let N=document.querySelector(`[data-faq-item-id="${F}"]`);N&&N.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]),(0,Ee.useEffect)(()=>{if(!e.events.subscribe)return;let k=R=>{let F=R.props?.tileId,N=R.props?.itemId;F===a&&N&&(i(new Set([N])),l(N),setTimeout(()=>l(null),1500),requestAnimationFrame(()=>{let U=document.querySelector(`[data-faq-item-id="${N}"]`);U&&U.scrollIntoView({behavior:"smooth",block:"center"})}))};if(e.events.getRecent){let F=e.events.getRecent({names:["notification.deep_link"]},5).filter(N=>N.props?.tileId===a&&N.props?.itemId).pop();F&&Date.now()-F.ts<1e4&&k(F)}return e.events.subscribe({names:["notification.deep_link"]},k)},[e,a]);let S=(0,Ee.useMemo)(()=>t.actions.filter(k=>k.triggerWhen?e.evaluateSync(k.triggerWhen).value:!0),[t.actions,e,r]),b=(0,Ee.useMemo)(()=>t.ordering==="priority"?[...S].sort((k,D)=>(D.config.priority??0)-(k.config.priority??0)):S,[S,t.ordering]),x=(0,Ee.useMemo)(()=>{if(!t.searchable||!u.trim())return b;let k=u.toLowerCase();return b.filter(D=>D.config.question.toLowerCase().includes(k)||wI(D.config.answer).toLowerCase().includes(k)||D.config.category?.toLowerCase().includes(k))},[b,u,t.searchable]),f=(0,Ee.useMemo)(()=>{let k=new Map;for(let D of x){let R=D.config.category;k.has(R)||k.set(R,[]),k.get(R).push(D)}return k},[x]),m=(0,Ee.useMemo)(()=>x.some(k=>k.config.category),[x]),v=(0,Ee.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),y=(0,Ee.useCallback)(k=>{i(D=>{let R=new Set(D);return t.expandBehavior==="single"?D.has(k)?new Set:new Set([k]):(D.has(k)?R.delete(k):R.add(k),R)}),e.events.publish("faq:toggled",{instanceId:a,questionId:k,expanded:!o.has(k),timestamp:Date.now()})},[t.expandBehavior,e.events,a,o]),_=(0,Ee.useCallback)((k,D,R)=>{p(F=>{let N=new Map(F);return N.set(k,R),N}),e.events.publish("faq:feedback",{itemId:k,question:D,value:R})},[e.events]),w={...Et.container,...ps[v].container},C={...Et.searchInput,...ps[v].searchInput},A={...Et.emptyState,...ps[v].emptyState},E={...Et.categoryHeader,...ps[v].categoryHeader},L=k=>k.map((D,R)=>(0,He.jsx)(lD,{item:D,isExpanded:o.has(D.config.id),isHighlighted:s===D.config.id,isLast:R===k.length-1,onToggle:()=>y(D.config.id),theme:v,feedbackConfig:g,feedbackValue:d.get(D.config.id),onFeedback:_},D.config.id));return S.length===0?(0,He.jsx)("div",{style:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:(0,He.jsx)("div",{style:A,children:"You're all set for now! We'll surface answers here when they're relevant to what you're doing."})}):(0,He.jsxs)("div",{style:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,He.jsxs)("div",{style:Et.searchWrapper,children:[(0,He.jsx)("style",{children:`[data-adaptive-id="${a}"] input::placeholder { color: var(--sc-content-search-color, inherit); opacity: 0.7; }`}),(0,He.jsx)("input",{type:"text",placeholder:"Search questions...",value:u,onChange:k=>c(k.target.value),style:C})]}),(0,He.jsx)("div",{style:Et.accordion,children:m?Array.from(f.entries()).map(([k,D])=>(0,He.jsxs)(Ee.default.Fragment,{children:[k&&(0,He.jsx)("div",{style:E,"data-category-header":k,children:k}),L(D)]},k??"__ungrouped")):L(x)}),t.searchable&&x.length===0&&u&&(0,He.jsxs)("div",{style:{...Et.noResults,...ps[v].emptyState},children:['No questions found matching "',u,'"']})]})}var LI={mount(t,e){let{runtime:a,instanceId:r="faq-widget",...n}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(a&&typeof qv.createRoot=="function"){let i=(0,qv.createRoot)(t);return i.render(Ee.default.createElement(uD,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
|
|
89
105
|
<div style="font-family: system-ui; max-width: 800px;">
|
|
90
|
-
${
|
|
91
|
-
<div style="margin-bottom: 8px; padding: 16px; background: ${
|
|
92
|
-
<strong>${
|
|
93
|
-
<p style="margin-top: 8px; color: ${
|
|
106
|
+
${o.map(i=>`
|
|
107
|
+
<div style="margin-bottom: 8px; padding: 16px; background: ${I[12]}; border-radius: 8px;">
|
|
108
|
+
<strong>${i.config.question}</strong>
|
|
109
|
+
<p style="margin-top: 8px; color: ${I[6]};">${wI(i.config.answer)}</p>
|
|
94
110
|
</div>
|
|
95
111
|
`).join("")}
|
|
96
112
|
</div>
|
|
97
|
-
`,()=>{t.innerHTML=""}}};var
|
|
113
|
+
`,()=>{t.innerHTML=""}}};var II={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:_I,widgets:[{id:"adaptive-faq:accordion",component:LI,metadata:{name:"FAQ Accordion",description:"Collapsible Q&A accordion with search, categories, and feedback",icon:"\u2753",subtitle:"Curated just for you."}}],notifyWatchers(t){return(t.actions??[]).filter(a=>a.notify&&a.triggerWhen).map(a=>({id:`faq:${a.config.id}`,strategy:a.triggerWhen,eventName:"faq:question_revealed",eventProps:{questionId:a.config.id,question:a.config.question,title:a.notify.title,body:a.notify.body,icon:a.notify.icon}}))}};var cD=async(t,e)=>{let{badgeId:a}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:a,awardedAt:Date.now()}),{cleanup:()=>{}}},dD=async(t,e)=>{let{points:a,reason:r}=t;return e.publishEvent("gamification.points_added",{points:a,reason:r,timestamp:Date.now()}),{cleanup:()=>{}}},fD={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},pD=[{kind:"gamification:awardBadge",executor:cD},{kind:"gamification:addPoints",executor:dD}],hD=[fD],AI={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:pD,eventHandlers:hD};var _t=K(Me(),1);var st=K(We(),1),zv=K(Bo(),1);function Lf(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Xa={container:{fontFamily:"var(--sc-font-family, system-ui, -apple-system, sans-serif)",maxWidth:"100%",overflow:"hidden"},accordion:{display:"flex",flexDirection:"column",gap:"var(--sc-content-item-gap, 6px)"},item:{borderRadius:"var(--sc-content-border-radius, 8px)",overflow:"hidden",transition:"box-shadow 0.2s ease"},header:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"var(--sc-content-item-padding, 12px 16px)",border:"none",cursor:"pointer",fontSize:"var(--sc-content-item-font-size, 15px)",fontWeight:500,fontFamily:"inherit",textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"20px",transition:"transform 0.2s ease",marginLeft:"auto",flexShrink:0,color:"var(--sc-content-chevron-color, currentColor)"},icon:{fontSize:"16px",flexShrink:0},body:{overflow:"hidden",transition:"max-height 0.25s ease, padding-bottom 0.25s ease",padding:"var(--sc-content-body-padding, 0 16px 12px 16px)"},description:{fontSize:"var(--sc-content-body-font-size, 14px)",lineHeight:"1.5",margin:0},linkButton:{display:"inline-flex",alignItems:"center",gap:"4px",marginTop:"10px",padding:"6px 12px",borderRadius:"6px",textDecoration:"none",fontSize:"13px",fontWeight:500,cursor:"pointer",border:"none",transition:"background-color 0.15s ease"},categoryHeader:{fontSize:"var(--sc-content-category-font-size, 12px)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"var(--sc-content-category-padding, 8px 4px 4px 4px)"},emptyState:{fontSize:"13px",padding:"16px",textAlign:"center"}},If={light:{container:{backgroundColor:"transparent",color:"inherit"},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},header:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},headerHover:{backgroundColor:"var(--sc-content-background-hover)"},body:{color:"var(--sc-content-text-secondary-color)"},linkButton:{backgroundColor:"var(--sc-color-primary, #6366f1)",color:"#ffffff"},categoryHeader:{color:I[7]},emptyState:{color:I[8]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},header:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},headerHover:{backgroundColor:"var(--sc-content-background-hover)"},body:{color:"var(--sc-content-text-secondary-color)"},linkButton:{backgroundColor:"var(--sc-color-primary, #6366f1)",color:"#ffffff"},categoryHeader:{color:I[8]},emptyState:{color:I[7]}}};function mD({item:t,isExpanded:e,isLast:a,onToggle:r,onNavigate:n,theme:o}){let[i,s]=(0,st.useState)(!1),l=If[o],{title:u,description:c,href:d,icon:p,external:g}=t.config,S={...Xa.item,...l.item,...e?l.itemExpanded:{},...a?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},b={...Xa.header,...l.header,...i?l.headerHover:{}},x={...Xa.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},f={...Xa.body,...l.body,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},m=v=>{v.preventDefault(),v.stopPropagation(),d&&n(d,g??!1)};return(0,_t.jsxs)("div",{style:S,"data-nav-tip-id":t.config.id,children:[(0,_t.jsxs)("button",{type:"button",style:b,onClick:r,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),"aria-expanded":e,children:[p&&(0,_t.jsx)("span",{style:Xa.icon,children:p}),(0,_t.jsx)("span",{children:u}),(0,_t.jsx)("span",{style:x,children:"\u203A"})]}),(0,_t.jsxs)("div",{style:f,"aria-hidden":!e,children:[(0,_t.jsx)("p",{style:Xa.description,children:c}),d&&(0,_t.jsxs)("a",{href:d,onClick:m,style:{...Xa.linkButton,...l.linkButton},target:g?"_blank":void 0,rel:g?"noopener noreferrer":void 0,children:["Go ",g?"\u2197":"\u2192"]})]})]})}function gD({config:t,runtime:e,instanceId:a}){let[r,n]=(0,st.useReducer)(f=>f+1,0),[o,i]=(0,st.useState)(new Set);(0,st.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,st.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]);let s=(0,st.useMemo)(()=>t.actions.filter(f=>{if(!f.triggerWhen)return!0;try{return e.evaluateSync(f.triggerWhen).value}catch{return!1}}),[t.actions,e,r]),l=(0,st.useMemo)(()=>{let f=new Map;for(let m of s){let v=m.config.category;f.has(v)||f.set(v,[]),f.get(v).push(m)}return f},[s]),u=(0,st.useMemo)(()=>s.some(f=>f.config.category),[s]),c=(0,st.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),d=(0,st.useCallback)(f=>{i(m=>{let v=m.has(f),y;if(t.expandBehavior==="single"){for(let _ of m)_!==f&&e.events.publish("nav:toggled",{instanceId:a,tipId:_,expanded:!1,timestamp:Date.now()});y=v?new Set:new Set([f])}else y=new Set(m),v?y.delete(f):y.add(f);return e.events.publish("nav:toggled",{instanceId:a,tipId:f,expanded:!v,timestamp:Date.now()}),y})},[t.expandBehavior,e.events,a]),p=(0,st.useCallback)((f,m)=>{let v=f.trim().toLowerCase();if(!(v.startsWith("javascript:")||v.startsWith("data:")))if(e.events.publish("nav:tip_clicked",{instanceId:a,href:f,external:m,timestamp:Date.now()}),m)window.open(f,"_blank","noopener,noreferrer");else{let y=new URL(f,window.location.origin);y.search=window.location.search,window.location.href=y.toString()}},[e.events,a]),g={...Xa.container,...If[c].container},S={...Xa.categoryHeader,...If[c].categoryHeader},b={...Xa.emptyState,...If[c].emptyState},x=f=>f.map((m,v)=>(0,_t.jsx)(mD,{item:m,isExpanded:o.has(m.config.id),isLast:v===f.length-1,onToggle:()=>d(m.config.id),onNavigate:p,theme:c},m.config.id));return s.length===0?(0,_t.jsx)("div",{style:g,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,_t.jsx)("div",{style:b,children:"You're all set for now! We'll share helpful tips here when they're relevant to what you're doing."})}):(0,_t.jsx)("div",{style:g,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,_t.jsx)("div",{style:Xa.accordion,children:u?Array.from(l.entries()).map(([f,m])=>(0,_t.jsxs)(st.default.Fragment,{children:[f&&(0,_t.jsx)("div",{style:S,"data-category-header":f,children:f}),x(m)]},f??"__ungrouped")):x(s)})})}var kI={mount(t,e){let{runtime:a,instanceId:r="nav-widget",...n}=e||{expandBehavior:"single",theme:"auto",actions:[]};if(a&&typeof zv.createRoot=="function"){let i=(0,zv.createRoot)(t);return i.render(st.default.createElement(gD,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
|
|
98
114
|
<div style="font-family: system-ui; max-width: 100%;">
|
|
99
|
-
${
|
|
100
|
-
<div style="margin-bottom: 4px; padding: 12px 16px; background: ${
|
|
101
|
-
${
|
|
102
|
-
<p style="margin-top: 8px; color: ${
|
|
103
|
-
${
|
|
115
|
+
${o.map(i=>`
|
|
116
|
+
<div style="margin-bottom: 4px; padding: 12px 16px; background: ${I[12]}; border-radius: 8px;">
|
|
117
|
+
${i.config.icon?`<span>${Lf(i.config.icon)}</span> `:""}<strong>${Lf(i.config.title)}</strong>
|
|
118
|
+
<p style="margin-top: 8px; color: ${I[6]}; font-size: 13px;">${Lf(i.config.description)}</p>
|
|
119
|
+
${i.config.href?`<a href="${Lf(i.config.href)}" style="color: ${Ft[2]}; font-size: 13px;">Go →</a>`:""}
|
|
104
120
|
</div>
|
|
105
121
|
`).join("")}
|
|
106
122
|
</div>
|
|
107
|
-
`,()=>{t.innerHTML=""}}};var
|
|
123
|
+
`,()=>{t.innerHTML=""}}};var vD=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);return a?(a.scrollIntoView({behavior:t.behavior??"smooth",block:t.block??"center",inline:t.inline??"nearest"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:scrollTo",anchorId:t.anchorId,behavior:t.behavior??"smooth"}),{cleanup:()=>{}}):(console.error(`[adaptive-nav] Anchor not found for scrollTo, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}})};function yD(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}var xD=async(t,e)=>{let a=t.url.trim();if(a.toLowerCase().startsWith("javascript:"))throw new Error("javascript: URLs are not allowed");let r=t.target??"_self";return e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:navigate",url:t.url,target:r}),r==="_blank"?window.open(a,"_blank","noopener,noreferrer"):!t.forceFullNavigation&&yD(a)?(window.history.pushState(null,"",a),window.dispatchEvent(new PopStateEvent("popstate"))):window.location.href=a,{cleanup:()=>{}}},bD=[{kind:"navigation:scrollTo",executor:vD},{kind:"navigation:navigate",executor:xD}],EI={id:"adaptive-nav",version:"2.0.0",name:"Navigation Tips",description:"Navigation actions and accordion-based tips with per-item conditional visibility",executors:bD,widgets:[{id:"adaptive-nav:tips",component:kI,metadata:{name:"Navigation Tips",description:"Accordion of contextual navigation tips with per-item visibility",icon:"\u{1F9ED}"}}],notifyWatchers(t){return(t.actions??[]).filter(a=>a.notify&&a.triggerWhen).map(a=>({id:`nav:${a.config.id}`,strategy:a.triggerWhen,eventName:"nav:tip_revealed",eventProps:{tipId:a.config.id,title:a.notify.title,body:a.notify.body,icon:a.notify.icon}}))}};var SD=[SI,ef,II,AI,EI,bf],CD=SD.map(t=>({id:t.id,version:t.version,name:t.name,description:t.description,runtime:{actions:(t.executors||[]).map(({kind:e,executor:a})=>({kind:e,executor:a})),widgets:t.widgets,notifyWatchers:t.notifyWatchers,events:t.eventHandlers},editor:void 0,metadata:{isBuiltIn:!0}}));function TI(t){let e=0;for(let a of CD)t.has(a.id)||(t.register(a),e++);console.log("[Syntro Runtime] Registered",e,"built-in runtime modules")}var RI={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important",hostLoadingSelector:"",waitForHostReady:""};function MI(t={}){let{timeout:e,className:a,style:r,hostLoadingSelector:n,waitForHostReady:o}={...RI,...t};if(n&&document.querySelector(n))return()=>{};let i=document.createElement("style");i.textContent=`.${a} { ${r} }`,document.head.appendChild(i),document.documentElement.classList.add(a);let s=!1,l=()=>{s||(s=!0,clearTimeout(c),document.documentElement.classList.remove(a),i.remove(),o&&u&&document.removeEventListener(o,u))},u;o&&(u=()=>l(),document.addEventListener(o,u));let c=setTimeout(()=>{l()},e);return()=>{l()}}function DI(t={}){let{className:e,style:a}={...RI,...t};return`
|
|
108
124
|
(function() {
|
|
109
125
|
var s = document.createElement('style');
|
|
110
|
-
s.textContent = '.${e} { ${
|
|
126
|
+
s.textContent = '.${e} { ${a} }';
|
|
111
127
|
document.head.appendChild(s);
|
|
112
128
|
document.documentElement.className += ' ${e}';
|
|
113
|
-
})();`}function
|
|
129
|
+
})();`}function Af(t,e,a="first-match"){for(let r of e){let n=t.getFeatureValue?.(r,null);if(!n||typeof n!="object")continue;let o=n,i=o.tiles&&o.tiles.length>0,s=o.actions&&o.actions.length>0;if(i||s)return{tiles:o.tiles??[],actions:o.actions??[],fetchedAt:o.fetchedAt??new Date().toISOString(),...o.schemaVersion&&{schemaVersion:o.schemaVersion},...o.configVersion&&{configVersion:o.configVersion},...o.canvasTitle&&{canvasTitle:o.canvasTitle},...o.theme&&{theme:o.theme},...o.launcher&&{launcher:o.launcher}}}return null}var Vv=!1;function OI(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function $v(t){if(OI()){Vv=!0;return}Vv=t??!1}function _D(){return OI()?!0:Vv}function X(t,e,a){_D()&&(a!==void 0?console.log(`[${t}]`,e,a):console.log(`[${t}]`,e))}function ma(t,e,a){a!==void 0?console.warn(`[${t}]`,e,a):console.warn(`[${t}]`,e)}function kf(t,e,a){a!==void 0?console.error(`[${t}]`,e,a):console.error(`[${t}]`,e)}var Ef="2.6.0-canary.1";var jr="2.0";var wD=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function LD(t){try{let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):wD.some(n=>e.hostname===n)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function ID(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var BI="syntro_config_cache",AD=1440*60*1e3;function FI(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function kD(t,e){if(FI())try{let a={config:t,timestamp:Date.now(),sdkVersion:e};localStorage.setItem(BI,JSON.stringify(a))}catch{}}function ED(t){if(!FI())return null;try{let e=localStorage.getItem(BI);if(!e)return null;let a=JSON.parse(e);return!a.config||typeof a.timestamp!="number"||!a.sdkVersion||a.sdkVersion!==t||Date.now()-a.timestamp>AD?null:a.config}catch{return null}}var Tf=({configUri:t,experiments:e,featureKey:a="smart-canvas-config-uri"})=>{if(t)return t;let r=e?.getFeatureValue?.(a,null);if(r)return r};function TD(t,e,a){if(e){let r=t.getFeatureValue?.(e,null);if(r&&typeof r=="object"){let n=r.variant_flags;if(n&&n.length>0)return n}}if(a&&t.getAllFeatures){let r=t.getAllFeatures();return Object.keys(r).filter(n=>n.startsWith(a))}return[]}var Vo=({configUri:t,experiments:e,featureKey:a,credentials:r,configFeatureKey:n="smart-canvas-config",manifestKey:o,variantFlagPrefix:i,sdkVersion:s})=>async()=>{if(e&&n){let c=e.getFeatureValue?.(n,null);if(c&&typeof c=="object")return X("SmartCanvas Config","Resolved config directly from feature flag",c),c}if(e&&(o||i)){let c=TD(e,o,i);if(c.length>0){let d=Af(e,c);if(d)return X("SmartCanvas Config","Resolved config from variant flags",d),d}}let l=Tf({configUri:t,experiments:e,featureKey:a});if(!l)return X("SmartCanvas Config","No config available \u2014 returning empty config"),{tiles:[],actions:[],fetchedAt:new Date().toISOString()};if(!LD(l))throw new Error(`SmartCanvas: config URI not allowed: ${l}`);let u=r??(ID(l)?"include":"omit");try{let c=await fetch(l,{credentials:u,headers:{"X-SDK-Version":Ef,"X-SDK-Schema-Version":jr}});if(!c.ok)throw new Error(`SmartCanvas: failed to fetch config (${c.status})`);let d=await c.json();return X("SmartCanvas Config","Fetched config from URI",d),s&&kD(d,s),d}catch(c){if(s){let d=ED(s);if(d)return X("SmartCanvas Config","Serving config from offline cache"),d}throw c}};var RD=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function NI(t){if(typeof window>"u")return null;let a=new URLSearchParams(window.location.search).get(t);if(!a)return null;try{let r=a.replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(atob(r))}catch(r){return ma("Syntro Runtime",`Failed to decode ${t}:`,r),null}}var hs,ms;function $n(){if(hs==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.token)hs={token:t.token,api_base:t.apiBase||""},console.log(`[DIAG] getEditorSource: from __SYNTRO_EDITOR_PARAMS__ (token=${hs.token.slice(0,15)}...)`);else{let e=NI("editor_source");e&&(hs=e),console.log(`[DIAG] getEditorSource: from URL param \u2192 ${e?`token=${e.token?.slice(0,15)}...`:"NULL"}`),!e&&typeof window<"u"&&console.log(`[DIAG] getEditorSource: URL search = ${window.location.search.slice(0,200)}`)}}return hs??null}function $o(){if(ms==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.mode)ms={mode:t.mode,audit_session_id:t.auditSessionId,syntro_token:t.syntroToken,workspace_id:t.workspaceId},console.log(`[DIAG] getEditorConf: from __SYNTRO_EDITOR_PARAMS__ (mode=${ms.mode})`);else{let e=NI("editor_conf");e&&(ms=e),console.log(`[DIAG] getEditorConf: from URL param \u2192 ${e?`mode=${e.mode}`:"NULL"}`)}}return ms??null}function MD(t){X("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return X("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(ma("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1):RD.some(n=>n.startsWith(".")?e.hostname.endsWith(n)||e.hostname===n.slice(1):e.hostname===n)?(X("Syntro Runtime","\u2713 Editor URL validated"),!0):(ma("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return ma("Syntro Runtime",`\u274C Invalid editor URL: ${t}`,e),!1}}var PI=()=>{let t=$o();return!$n()?.token||!t?null:t.mode==="editor"||t.mode==="audit"||t.mode==="review"?t.mode:null};function DD(){return $n()?.token??null}function OD(){return $n()?.api_base??null}var yu=null,HI=async t=>{if(X("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){X("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){X("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}if(yu)return X("Syntro Runtime","Editor SDK load already in progress, waiting..."),yu;let e=typeof t=="string"?{editorUrl:t}:t??{};if(e.editorUrl==="skip"){X("Syntro Runtime",'editorUrl="skip" \u2014 deferring to caller'),X("Syntro Runtime","================================");return}let a=OD(),n=(a?`${a}/api/editor/sdk/editor-sdk.js`:null)||e.editorUrl;if(!n){ma("Syntro Runtime","\u274C No editor SDK URL available (no api_base, no editorUrl option)"),X("Syntro Runtime","================================");return}let o=DD();if(!o){ma("Syntro Runtime","\u274C No token found in editor_source."),X("Syntro Runtime","================================");return}let i=`${n}?token=${encodeURIComponent(o)}`;if(X("Syntro Runtime","Editor URL:",i),X("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,hasEditorUrl:!!n,hasApiBase:!!a,tokenPrefix:`${o.slice(0,10)}...`}),!MD(n)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",n),X("Syntro Runtime","================================");return}return X("Syntro Runtime","\u2713 URL validated, injecting script tag..."),yu=new Promise((s,l)=>{let u=document.createElement("script");u.src=i,u.async=!0,e.integrity&&(u.integrity=e.integrity,u.crossOrigin="anonymous",X("Syntro Runtime","SRI integrity check enabled")),u.onload=()=>{X("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),X("Syntro Runtime","================================"),s()},u.onerror=c=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",c),console.error("[Syntro Runtime] URL attempted:",i),X("Syntro Runtime","================================"),yu=null,l(c)},document.head.appendChild(u),X("Syntro Runtime","Script tag appended to <head>")}),yu};var BD=new Set(["tag_name","$el_text"]);function FD(t){return BD.has(t)||t.startsWith("attr__")}function UI(t,e){return t.equals!==void 0?e===t.equals:t.contains!==void 0?typeof e=="string"&&e.includes(t.contains):!1}function ND(t){let{events:e,match:a}=t;return r=>{if(!e.includes(r.name))return!1;if(a){for(let[n,o]of Object.entries(a))if(FD(n)){let i=r.props?.elements;if(!i||!i.some(l=>UI(o,l[n])))return!1}else if(!UI(o,r.props?.[n]))return!1}return!0}}function qI(t,e){for(let a of t.rules)for(let r of a.conditions)if(r.type==="event_count"&&r.key){let n=r.counter,o=n?ND(n):()=>!0;e.register(r.key,o)}}function xu(t,e,a){for(let r of t){let n=r.props;if(!n)continue;let o=n.actions;if(o)for(let i of o)i.triggerWhen?.type==="rules"&&qI(i.triggerWhen,e)}if(a)for(let r of a){let n=r;n.triggerWhen?.type==="rules"&&qI(n.triggerWhen,e)}}var cr=null;function VI(t){cr&&cr!==t?t.appendChild(cr):cr=t;let e=t.getRootNode();e instanceof ShadowRoot&&PD(e)}function $I(){return cr||(cr=document.createElement("div"),cr.id="syntro-overlays",Object.assign(cr.style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),document.body.appendChild(cr)),cr}var zI=!1;function PD(t){if(zI)return;let e=`
|
|
114
130
|
:host {
|
|
115
|
-
--syntro-surface: #0f1318;
|
|
116
|
-
--syntro-fg: #cbd0d7;
|
|
117
|
-
--syntro-accent: #b72e2a;
|
|
118
|
-
--syntro-accent-hover: #d44844;
|
|
119
|
-
--syntro-radius: 12px;
|
|
131
|
+
--syntro-surface: var(--sc-overlay-background, #0f1318);
|
|
132
|
+
--syntro-fg: var(--sc-overlay-text-color, #cbd0d7);
|
|
133
|
+
--syntro-accent: var(--sc-color-primary, #b72e2a);
|
|
134
|
+
--syntro-accent-hover: var(--sc-color-primary-hover, #d44844);
|
|
135
|
+
--syntro-radius: var(--sc-border-radius, 12px);
|
|
120
136
|
--syntro-shadow: 0 25px 50px -12px rgba(16,24,40,0.25);
|
|
121
|
-
--syntro-ring: #d44844;
|
|
122
|
-
--syntro-border: #2b333f;
|
|
137
|
+
--syntro-ring: var(--sc-overlay-highlight-ring, #d44844);
|
|
138
|
+
--syntro-border: var(--sc-overlay-border, #2b333f);
|
|
123
139
|
--syntro-tooltip-bg: var(--syntro-surface);
|
|
124
140
|
--syntro-tooltip-fg: var(--syntro-fg);
|
|
141
|
+
--syntro-tooltip-title-color: var(--sc-overlay-title-color, var(--syntro-fg));
|
|
142
|
+
--syntro-tooltip-arrow-bg: var(--sc-overlay-arrow-color, var(--syntro-tooltip-bg));
|
|
143
|
+
--syntro-tooltip-arrow-size: var(--sc-overlay-arrow-size, 8px);
|
|
125
144
|
--syntro-tooltip-radius: var(--syntro-radius);
|
|
126
145
|
--syntro-tooltip-padding: 12px 16px;
|
|
127
146
|
--syntro-tooltip-shadow: var(--syntro-shadow);
|
|
128
|
-
--syntro-spotlight-backdrop: rgba(0,0,0,0.70);
|
|
147
|
+
--syntro-spotlight-backdrop: rgba(0,0,0, var(--sc-overlay-scrim-opacity, 0.70));
|
|
129
148
|
}
|
|
130
149
|
|
|
131
150
|
/* Tooltip container */
|
|
@@ -148,14 +167,13 @@ Error generating stack: `+i.message+`
|
|
|
148
167
|
transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
149
168
|
}
|
|
150
169
|
|
|
151
|
-
/* Tooltip arrow */
|
|
170
|
+
/* Tooltip arrow \u2014 triangle via clip-path (square box so rotation is symmetric) */
|
|
152
171
|
.syntro-tooltip-arrow {
|
|
153
172
|
position: absolute;
|
|
154
|
-
width:
|
|
155
|
-
height:
|
|
156
|
-
background:
|
|
157
|
-
|
|
158
|
-
z-index: -1;
|
|
173
|
+
width: var(--syntro-tooltip-arrow-size);
|
|
174
|
+
height: var(--syntro-tooltip-arrow-size);
|
|
175
|
+
background: var(--syntro-tooltip-arrow-bg);
|
|
176
|
+
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
|
159
177
|
}
|
|
160
178
|
|
|
161
179
|
/* Tooltip content */
|
|
@@ -163,6 +181,7 @@ Error generating stack: `+i.message+`
|
|
|
163
181
|
font-weight: 600;
|
|
164
182
|
font-size: 15px;
|
|
165
183
|
margin-bottom: 6px;
|
|
184
|
+
color: var(--syntro-tooltip-title-color);
|
|
166
185
|
}
|
|
167
186
|
|
|
168
187
|
.syntro-tt-body {
|
|
@@ -369,7 +388,7 @@ Error generating stack: `+i.message+`
|
|
|
369
388
|
.syntro-modal-btn-primary:hover {
|
|
370
389
|
background: var(--syntro-accent-hover, #d44844);
|
|
371
390
|
}
|
|
372
|
-
`,
|
|
391
|
+
`,a=document.createElement("style");a.setAttribute("data-syntro","base-overlay"),a.textContent=e,t.appendChild(a),zI=!0}var p1=K(Bo(),1);var Rf=class{constructor(e){$(this,"state");$(this,"listeners",new Set);let a=e?.open??!1;if(e?.open===void 0)try{let r=sessionStorage?.getItem("syntro:editor:panel-open");r!==null&&(a=JSON.parse(r))}catch{}this.state={open:a}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOpen(e){if(this.state.open!==e){this.state={...this.state,open:e};try{sessionStorage?.setItem("syntro:editor:panel-open",JSON.stringify(e))}catch{}this.emit()}}toggle(){this.setOpen(!this.state.open)}emit(){for(let e of this.listeners)e(this.state)}},jv=t=>new Rf(t);var Mf=K(We(),1),GI=K(Me(),1),jI=(0,Mf.createContext)(null);function Gv({shadowRoot:t,portalRoot:e,overlayContainer:a,children:r}){return(0,GI.jsx)(jI.Provider,{value:{shadowRoot:t,portalRoot:e,overlayContainer:a},children:r})}function jo(){let t=(0,Mf.useContext)(jI);if(!t)throw new Error("useShadowRoot() called outside ShadowRootProvider");return t}var Pt=K(We(),1);var lt=K(We(),1),ry=K(sl(),1);var be={UI_CLICK:"ui.click",UI_SCROLL:"ui.scroll",UI_INPUT:"ui.input",UI_CHANGE:"ui.change",UI_SUBMIT:"ui.submit",NAV_PAGE_VIEW:"nav.page_view",NAV_PAGE_LEAVE:"nav.page_leave",CANVAS_OPENED:"canvas.opened",CANVAS_CLOSED:"canvas.closed",TILE_VIEWED:"tile.viewed",TILE_EXPANDED:"tile.expanded",TILE_COLLAPSED:"tile.collapsed",TILE_ACTION:"tile.action",OVERLAY_STARTED:"overlay.started",OVERLAY_COMPLETED:"overlay.completed",OVERLAY_DISMISSED:"overlay.dismissed",OVERLAY_STEP_VIEWED:"overlay.step_viewed",BEHAVIOR_RAGE_CLICK:"behavior.rage_click",BEHAVIOR_HESITATION:"behavior.hesitation",BEHAVIOR_CONFUSION:"behavior.confusion",ACTION_APPLIED:"action.applied",ACTION_REVERTED:"action.reverted",ACTION_FAILED:"action.failed",ACTION_CTA_CLICKED:"action.cta_clicked",NOTIFICATION_SHOWN:"notification.shown",NOTIFICATION_CLICKED:"notification.clicked",NOTIFICATION_DISMISSED:"notification.dismissed",NOTIFICATION_DEEP_LINK:"notification.deep_link",SURFACE_MOUNTED:"surface.mounted",SURFACE_UNMOUNTED:"surface.unmounted"},Go="1.0.0";function Ya(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:Go}}function HD(t){return Ya(be.CANVAS_OPENED,{surface:t})}function UD(t){return Ya(be.CANVAS_CLOSED,{surface:t})}function qD(t,e){return Ya(be.TILE_VIEWED,{tileId:t,surface:e})}function zD(t,e){return Ya(be.TILE_EXPANDED,{tileId:t,surface:e})}function VD(t,e){return Ya(be.TILE_COLLAPSED,{tileId:t,surface:e})}function $D(t,e,a){return Ya(be.TILE_ACTION,{tileId:t,actionId:e,surface:a})}function jD(t,e){return Ya(be.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function GD(t,e){return Ya(be.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function WD(t,e,a){return Ya(be.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:a})}function ZD(t,e,a){return Ya(be.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:a})}function XD(t,e){let a=t.startsWith("canvas.")?t:`canvas.${t}`;return Ya(a,e)}var gs={canvasOpened:HD,canvasClosed:UD,tileViewed:qD,tileExpanded:zD,tileCollapsed:VD,tileAction:$D,overlayStarted:jD,overlayCompleted:GD,overlayDismissed:WD,overlayStepViewed:ZD,custom:XD};var Ma=K(Me(),1),WI="syntro-toast-styles",YD=`
|
|
373
392
|
@keyframes syntro-toast-slide-in {
|
|
374
393
|
from { opacity: 0; transform: translateY(12px); }
|
|
375
394
|
to { opacity: 1; transform: translateY(0); }
|
|
@@ -387,36 +406,33 @@ Error generating stack: `+i.message+`
|
|
|
387
406
|
.syntro-toast-progress.paused {
|
|
388
407
|
animation-play-state: paused;
|
|
389
408
|
}
|
|
390
|
-
`;function HN(t){if(t.querySelector(`#${qE}`))return;let e=document.createElement("style");e.id=qE,e.textContent=LN,t.appendChild(e)}function sf({notifications:t,onDismiss:e,onClickNotification:n,position:i}){let{shadowRoot:r}=tc();return HN(r),t.length===0?null:(0,Tn.jsx)("div",{"data-testid":"notification-toast-stack",style:{position:"fixed",bottom:"6rem",[i==="right"?"right":"left"]:"2.5rem",display:"flex",flexDirection:"column",gap:"8px",zIndex:2147483648,pointerEvents:"auto",width:"280px"},children:t.map(a=>(0,Tn.jsxs)("div",{className:"syntro-toast-enter",style:{background:oe(E[0],.95),backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:`1px solid ${E[5]}`,borderRadius:"12px",overflow:"hidden",cursor:"pointer",transition:"transform 0.15s ease"},onMouseEnter:o=>{o.currentTarget.style.transform="translateY(-1px)";let s=o.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.add("paused")},onMouseLeave:o=>{o.currentTarget.style.transform="translateY(0)";let s=o.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.remove("paused")},children:[(0,Tn.jsxs)("div",{onClick:()=>n(a),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,Tn.jsx)("div",{style:{width:"28px",height:"28px",borderRadius:"8px",background:oe(ne[3],.15),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontSize:"14px"},children:a.icon??"\u{1F514}"}),(0,Tn.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Tn.jsx)("div",{style:{fontSize:"13px",fontWeight:600,color:dt.primary,lineHeight:"1.3",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a.title}),a.body&&(0,Tn.jsx)("div",{style:{fontSize:"12px",color:dt.secondary,lineHeight:"1.3",marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a.body})]}),(0,Tn.jsx)("button",{type:"button",onClick:o=>{o.stopPropagation(),e(a.id)},"aria-label":"Dismiss notification",style:{background:"none",border:"none",color:dt.tertiary,cursor:"pointer",padding:"2px",fontSize:"14px",lineHeight:1,flexShrink:0},children:"\xD7"})]}),(0,Tn.jsx)("div",{style:{height:"2px",background:oe(Ze.white,.06)},children:(0,Tn.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:`linear-gradient(90deg, ${ne[3]}, ${ne[4]})`,animationDuration:`${a.ttl}ms`}})})]},a.id))})}var Pn=ee(nt(),1);var lf=3,cf=8e3,uf=3e4;var IN=0;function nc(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(n,i)=>!e||!(i in e)?n:String(e[i]))}function zN(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function df(t,e){for(let n of e){let i=n.notifications;if(!(!i||i.length===0))for(let r of i){if(!zN(t.name,r.on))continue;let a=Date.now(),o=r.ttl??8e3;return{notification:{id:`notif-${++IN}-${a}`,title:nc(r.title,t.props),body:r.body?nc(r.body,t.props):void 0,icon:r.icon,tileId:n.id,itemId:r.deepLink?.itemId?nc(r.deepLink.itemId,t.props):void 0,expiresAt:a+o,createdAt:a,ttl:o},rule:r}}}return null}function ff(t,e){let[n,i]=(0,Pn.useState)([]),r=(0,Pn.useRef)(new Map),a=(0,Pn.useRef)(new Map),o=(0,Pn.useCallback)(c=>{t?.publish(ye.NOTIFICATION_DISMISSED,{notificationId:c.id,tileId:c.tileId,itemId:c.itemId})},[t]),s=(0,Pn.useCallback)(c=>{let u=setTimeout(()=>{i(f=>f.filter(h=>h.id!==c.id)),a.current.delete(c.id),o(c)},c.ttl);a.current.set(c.id,u)},[o]),l=(0,Pn.useCallback)(c=>{i(f=>{let h=f.find(g=>g.id===c);return h&&o(h),f.filter(g=>g.id!==c)});let u=a.current.get(c);u&&(clearTimeout(u),a.current.delete(c))},[o]);return(0,Pn.useEffect)(()=>{if(!t)return;let c=t.subscribe(u=>{let f=df(u,e);if(!f)return;let{notification:h,rule:g}=f,_=`${h.tileId}:${u.name}`,b=r.current.get(_),w=Date.now(),d=g.cooldown??3e4;b!==void 0&&w-b<d||(r.current.set(_,w),i(p=>{if(h.itemId&&p.some(S=>S.tileId===h.tileId&&S.itemId===h.itemId))return p;let m=[...p,h];if(m.length>3){let v=m.shift(),S=a.current.get(v.id);S&&(clearTimeout(S),a.current.delete(v.id))}return m}),t.publish(ye.NOTIFICATION_SHOWN,{notificationId:h.id,tileId:h.tileId,itemId:h.itemId,title:h.title}),s(h))});return()=>{c();for(let u of a.current.values())clearTimeout(u);a.current.clear()}},[t,e,s]),{notifications:n,dismiss:l}}var pf=ee(nt(),1);function BN(t,e){let n=[];for(let i of t){let r=i.widget.split(":")[0],o=e.get(r)?.manifest.runtime?.notifyWatchers;o&&n.push(...o(i.props??{}))}return n}function hf(t,e,n){let i=(0,pf.useRef)(new Map);(0,pf.useEffect)(()=>{if(!t?.events||!n)return;let r=BN(e,n);if(r.length===0)return;let a=t.state.ns("notified");for(let s of r)if(!i.current.has(s.id)){let l=t.evaluateSync(s.strategy);i.current.set(s.id,l.value),l.value&&!a.has(s.id)&&(a.set(s.id,!0),t.events.publish(s.eventName,s.eventProps))}return t.events.subscribe(()=>{for(let s of r){let l=t.evaluateSync(s.strategy),c=i.current.get(s.id)??!1;i.current.set(s.id,l.value),!c&&l.value?(a.set(s.id,!0),t.events.publish(s.eventName,s.eventProps)):c&&!l.value&&a.remove(s.id)}})},[t,e,n])}var jt=ee(nt(),1),KE=ee(qe(),1),rv=(0,jt.createContext)({runtime:null,context:null});function gf({runtime:t,children:e}){let[n,i]=(0,jt.useState)(t?t.context.get():null);(0,jt.useEffect)(()=>t?(i(t.context.get()),t.context.subscribe(o=>{i(o)})):void 0,[t]);let r=(0,jt.useMemo)(()=>({runtime:t,context:n}),[t,n]);return(0,KE.jsx)(rv.Provider,{value:r,children:e})}function ri(){let{runtime:t}=(0,jt.useContext)(rv);return t}function ic(){let{context:t}=(0,jt.useContext)(rv);return t}function mf(){return ic()?.page??null}function PE(){return ic()?.session??null}function GE(){return ic()?.viewport??null}function ZE(t,e,n=[]){let i=ri();(0,jt.useEffect)(()=>i?t?i.events.subscribe(t,e):i.events.subscribe(e):void 0,[i,...n,e,t])}function YE(){return ri()?.state??null}function WE(t,e){let n=ri(),[i,r]=(0,jt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,jt.useEffect)(()=>{if(!n||!t){r({value:e,isFallback:!0,isLoading:!1});return}let a=!1;return n.evaluate(t).then(o=>{a||r({value:o.value,isFallback:o.isFallback,isLoading:!1})}),()=>{a=!0}},[n,t,e]),i}var Mt=ee(nt(),1);var kn=ee(qe(),1);function $N({widgetId:t,props:e}){let n=ri(),i=(0,Mt.useRef)(null),r=(0,Mt.useRef)(null),a=n?.widgets,o=a?.has(t)??!1,[,s]=(0,Mt.useReducer)(l=>l+1,0);return(0,Mt.useEffect)(()=>{if(!(!a||o))return a.subscribe(l=>{l.type==="registered"&&l.widgetId===t&&s()})},[a,t,o]),(0,Mt.useEffect)(()=>{if(!i.current||!a||!o)return;let l=a.mount(t,i.current,e);return r.current=l,()=>{l.unmount(),r.current=null}},[a,t,e,o]),!a||!a.has(t)?(0,kn.jsxs)("div",{style:{padding:"0.75rem",fontSize:"0.8rem",color:dt.tertiary,fontStyle:"italic"},children:["Widget not available: ",t]}):(0,kn.jsx)("div",{ref:i,style:{width:"100%",minHeight:"40px"}})}function ls({config:t,surface:e,telemetry:n,style:i}){let{title:r,widget:a,props:o}=t,[,s]=(0,Mt.useState)(0),l=ri();(0,Mt.useEffect)(()=>{l&&s(w=>w+1)},[l]);let[c,u]=(0,Mt.useState)(!1),f=(0,Mt.useCallback)(()=>u(!0),[]),h=(0,Mt.useCallback)(()=>u(!1),[]),g={display:"flex",flexDirection:"column",borderRadius:"14px",background:c?oe(E[1],.7):oe(E[1],.6),backdropFilter:"blur(16px) saturate(1.2)",WebkitBackdropFilter:"blur(16px) saturate(1.2)",border:"1px solid rgba(255, 255, 255, 0.08)",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.3)",color:dt.primary,fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif",overflow:"hidden",cursor:"default",transition:"all 0.25s ease",transform:c?"scale(1.01)":"scale(1)",...i},_={display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.875rem 1rem",minHeight:"72px"},b={width:"40px",height:"40px",borderRadius:"10px",background:`linear-gradient(135deg, ${ne[3]} 0%, ${ne[3]}cc 100%)`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.25rem",flexShrink:0,boxShadow:`0 2px 8px ${ne[3]}40`};return(0,kn.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:g,onMouseEnter:f,onMouseLeave:h,children:[(0,kn.jsxs)("div",{style:_,children:[(0,kn.jsx)("div",{style:b,children:"+"}),(0,kn.jsx)("div",{style:{flex:1,minWidth:0},children:(0,kn.jsx)("h3",{style:{fontSize:"0.95rem",fontWeight:600,color:dt.primary,margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r??a})})]}),(0,kn.jsx)("div",{style:{padding:"0 1rem 1rem",borderTop:`1px solid ${wa.secondary}`},children:(0,kn.jsx)("div",{style:{paddingTop:"0.875rem"},children:(0,kn.jsx)($N,{widgetId:a,props:o})})})]})}var pe=ee(qe(),1),XE="syntro-launcher-styles",FN=`
|
|
409
|
+
`;function KD(t){if(t.querySelector(`#${WI}`))return;let e=document.createElement("style");e.id=WI,e.textContent=YD,t.appendChild(e)}function Df({notifications:t,onDismiss:e,onClickNotification:a,position:r}){let{shadowRoot:n}=jo();return KD(n),t.length===0?null:(0,Ma.jsx)("div",{"data-testid":"notification-toast-stack",style:{position:"fixed",bottom:"6rem",[r==="right"?"right":"left"]:"2.5rem",display:"flex",flexDirection:"column",gap:"8px",zIndex:2147483648,pointerEvents:"auto",width:"280px"},children:t.map(o=>(0,Ma.jsxs)("div",{className:"syntro-toast-enter",style:{background:"var(--sc-notification-background)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:"var(--sc-notification-border)",borderRadius:"var(--sc-notification-border-radius)",overflow:"hidden",cursor:"pointer",transition:"transform 0.15s ease"},onMouseEnter:i=>{i.currentTarget.style.transform="translateY(-1px)";let s=i.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.add("paused")},onMouseLeave:i=>{i.currentTarget.style.transform="translateY(0)";let s=i.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.remove("paused")},children:[(0,Ma.jsxs)("div",{onClick:()=>a(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,Ma.jsx)("div",{style:{width:"28px",height:"28px",borderRadius:"8px",background:"var(--sc-notification-icon-background)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontSize:"14px"},children:o.icon??"\u{1F514}"}),(0,Ma.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Ma.jsx)("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--sc-notification-text-color)",lineHeight:"1.3",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.title}),o.body&&(0,Ma.jsx)("div",{style:{fontSize:"12px",color:"var(--sc-notification-text-secondary-color)",lineHeight:"1.3",marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.body})]}),(0,Ma.jsx)("button",{type:"button",onClick:i=>{i.stopPropagation(),e(o.id)},"aria-label":"Dismiss notification",style:{background:"none",border:"none",color:"var(--sc-notification-text-secondary-color)",cursor:"pointer",padding:"2px",fontSize:"14px",lineHeight:1,flexShrink:0},children:"\xD7"})]}),(0,Ma.jsx)("div",{style:{height:"2px",background:"rgba(0, 0, 0, 0.08)"},children:(0,Ma.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var Ka=K(We(),1);var Of=3,Bf=8e3,Ff=3e4;var QD=0;function bu(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(a,r)=>!e||!(r in e)?a:String(e[r]))}function JD(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function Nf(t,e){for(let a of e){let r=a.notifications;if(!(!r||r.length===0))for(let n of r){if(!JD(t.name,n.on))continue;let o=Date.now(),i=n.ttl??8e3;return{notification:{id:`notif-${++QD}-${o}`,title:bu(n.title,t.props),body:n.body?bu(n.body,t.props):void 0,icon:n.icon,tileId:a.id,itemId:n.deepLink?.itemId?bu(n.deepLink.itemId,t.props):void 0,expiresAt:o+i,createdAt:o,ttl:i},rule:n}}}return null}function Pf(t,e){let[a,r]=(0,Ka.useState)([]),n=(0,Ka.useRef)(new Map),o=(0,Ka.useRef)(new Map),i=(0,Ka.useCallback)(u=>{t?.publish(be.NOTIFICATION_DISMISSED,{notificationId:u.id,tileId:u.tileId,itemId:u.itemId})},[t]),s=(0,Ka.useCallback)(u=>{let c=setTimeout(()=>{r(d=>d.filter(p=>p.id!==u.id)),o.current.delete(u.id),i(u)},u.ttl);o.current.set(u.id,c)},[i]),l=(0,Ka.useCallback)(u=>{r(d=>{let p=d.find(g=>g.id===u);return p&&i(p),d.filter(g=>g.id!==u)});let c=o.current.get(u);c&&(clearTimeout(c),o.current.delete(u))},[i]);return(0,Ka.useEffect)(()=>{if(!t)return;let u=t.subscribe(c=>{let d=Nf(c,e);if(!d)return;let{notification:p,rule:g}=d,S=p.itemId?`${p.tileId}:${c.name}:${p.itemId}`:`${p.tileId}:${c.name}`,b=n.current.get(S),x=Date.now(),f=g.cooldown??3e4;b!==void 0&&x-b<f||(n.current.set(S,x),r(m=>{if(p.itemId&&m.some(_=>_.tileId===p.tileId&&_.itemId===p.itemId))return m;let v=[...m,p];if(v.length>3){let y=v.shift(),_=o.current.get(y.id);_&&(clearTimeout(_),o.current.delete(y.id))}return v}),t.publish(be.NOTIFICATION_SHOWN,{notificationId:p.id,tileId:p.tileId,itemId:p.itemId,title:p.title}),s(p))});return()=>{u();for(let c of o.current.values())clearTimeout(c);o.current.clear()}},[t,e,s]),{notifications:a,dismiss:l}}var Hf=K(We(),1);function eO(t,e){let a=[];for(let r of t){let n=r.widget.split(":")[0],i=e.get(n)?.manifest.runtime?.notifyWatchers;i&&a.push(...i(r.props??{}))}return a}function Uf(t,e,a){let r=(0,Hf.useRef)(new Map);(0,Hf.useEffect)(()=>{if(!t?.events||!a)return;let n=eO(e,a);if(n.length===0)return;let o=t.state.ns("notified");for(let s of n)if(!r.current.has(s.id)){let l=t.evaluateSync(s.strategy);r.current.set(s.id,l.value),l.value&&!o.has(s.id)&&(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps))}return t.events.subscribe(()=>{for(let s of n){let l=t.evaluateSync(s.strategy),u=r.current.get(s.id)??!1;r.current.set(s.id,l.value),!u&&l.value?(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps)):u&&!l.value&&o.remove(s.id)}})},[t,e,a])}var Yt=K(We(),1),JI=K(Me(),1),Wv=(0,Yt.createContext)({runtime:null,context:null});function qf({runtime:t,children:e}){let[a,r]=(0,Yt.useState)(t?t.context.get():null);(0,Yt.useEffect)(()=>t?(r(t.context.get()),t.context.subscribe(i=>{r(i)})):void 0,[t]);let n=(0,Yt.useMemo)(()=>({runtime:t,context:a}),[t,a]);return(0,JI.jsx)(Wv.Provider,{value:n,children:e})}function dr(){let{runtime:t}=(0,Yt.useContext)(Wv);return t}function Su(){let{context:t}=(0,Yt.useContext)(Wv);return t}function zf(){return Su()?.page??null}function ZI(){return Su()?.session??null}function XI(){return Su()?.viewport??null}function YI(t,e,a=[]){let r=dr();(0,Yt.useEffect)(()=>r?t?r.events.subscribe(t,e):r.events.subscribe(e):void 0,[r,...a,e,t])}function KI(){return dr()?.state??null}function QI(t,e){let a=dr(),[r,n]=(0,Yt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Yt.useEffect)(()=>{if(!a||!t){n({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return a.evaluate(t).then(i=>{o||n({value:i.value,isFallback:i.isFallback,isLoading:!1})}),()=>{o=!0}},[a,t,e]),r}function ae(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var tO={colorPrimary:ne[3],colorPrimaryHover:ne[4],colorPrimaryMuted:ne[0],colorBackground:ae(I[1],.95),colorBackgroundElevated:ae(I[3],.95),colorBackgroundSubtle:ae(I[0],.2),colorSurface:ae(I[4],.8),colorSurfaceHover:ae(I[5],.8),colorText:pa.primary,colorTextSecondary:pa.secondary,colorTextMuted:pa.tertiary,colorTextInverse:I[1],colorBorder:Ev.primary,colorBorderSubtle:Ev.secondary,colorSuccess:ke[4],colorSuccessMuted:ke[0],colorWarning:Ct[4],colorWarningMuted:Ct[0],colorError:ze[4],colorErrorMuted:ze[0],colorInfo:fa[4],colorInfoMuted:fa[0],colorNotification:ne[4],colorNotificationMuted:ae(ne[4],.4),glassBackground:ae(I[1],.6),glassBackgroundHover:ae(I[1],.7),glassBorder:"rgba(255, 255, 255, 0.08)",glassBlur:"blur(24px)",glassSaturate:"saturate(1.2)",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",fontFamilyMono:"'SF Mono', 'Fira Code', Consolas, monospace",fontSizeXs:"0.7rem",fontSizeSm:"0.8rem",fontSizeMd:"0.9rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontSizeXxl:"1.5rem",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightNormal:"1.5",lineHeightRelaxed:"1.75",spacingXs:"0.25rem",spacingSm:"0.5rem",spacingMd:"0.75rem",spacingLg:"1rem",spacingXl:"1.5rem",borderRadiusSm:"6px",borderRadiusMd:"10px",borderRadiusLg:"14px",borderRadiusXl:"20px",borderRadiusFull:"9999px",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.2)",shadowMd:"0 2px 12px rgba(0, 0, 0, 0.3)",shadowLg:"0 8px 24px rgba(0, 0, 0, 0.4)",shadowXl:"0 16px 48px rgba(0, 0, 0, 0.5)",backdropBlur:"blur(20px)",backdropSaturate:"saturate(180%)",transitionFast:"0.1s ease",transitionNormal:"0.25s ease",transitionSlow:"0.4s ease"},aO={colorPrimary:ne[3],colorPrimaryHover:ne[2],colorPrimaryMuted:ae(ne[5],.1),colorBackground:ae(I[12],.95),colorBackgroundElevated:ae(I[11],.95),colorBackgroundSubtle:ae(I[0],.02),colorSurface:ae(I[11],.6),colorSurfaceHover:ae(I[10],.6),colorText:I[1],colorTextSecondary:I[6],colorTextMuted:I[8],colorTextInverse:I[12],colorBorder:ae(I[0],.12),colorBorderSubtle:ae(I[0],.06),colorSuccess:ke[4],colorSuccessMuted:ae(ke[4],.12),colorWarning:Ct[4],colorWarningMuted:ae(Ct[4],.12),colorError:ze[4],colorErrorMuted:ae(ze[4],.12),colorInfo:fa[4],colorInfoMuted:ae(fa[4],.12),colorNotification:ne[3],colorNotificationMuted:ae(ne[3],.4),glassBackground:ae(I[12],.7),glassBackgroundHover:ae(I[12],.8),glassBorder:"rgba(0, 0, 0, 0.06)",glassBlur:"blur(24px)",glassSaturate:"saturate(1.2)",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",fontFamilyMono:"'SF Mono', 'Fira Code', Consolas, monospace",fontSizeXs:"0.7rem",fontSizeSm:"0.8rem",fontSizeMd:"0.9rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontSizeXxl:"1.5rem",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightNormal:"1.5",lineHeightRelaxed:"1.75",spacingXs:"0.25rem",spacingSm:"0.5rem",spacingMd:"0.75rem",spacingLg:"1rem",spacingXl:"1.5rem",borderRadiusSm:"6px",borderRadiusMd:"10px",borderRadiusLg:"14px",borderRadiusXl:"20px",borderRadiusFull:"9999px",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.08)",shadowMd:"0 2px 12px rgba(0, 0, 0, 0.12)",shadowLg:"0 8px 24px rgba(0, 0, 0, 0.16)",shadowXl:"0 16px 48px rgba(0, 0, 0, 0.2)",backdropBlur:"blur(20px)",backdropSaturate:"saturate(180%)",transitionFast:"0.1s ease",transitionNormal:"0.25s ease",transitionSlow:"0.4s ease"};function rO(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var Zv={mode:"dark",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:ne[3],colorPrimaryHover:ne[4],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:ae(I[1],.6),blur:"blur(24px)",border:"none",width:"clamp(380px, 25vw, 520px)",transitionDuration:"300ms",transitionEasing:"cubic-bezier(0.16, 1, 0.3, 1)",transitionFade:"6%"},launcher:{background:rf.primary.backgroundDefault,backgroundHover:rf.primary.backgroundHover,color:rf.primary.icon,size:"56px",shadow:`0 8px 32px ${ae(I[0],.6)}`,borderRadius:"9999px"},tile:{background:ae(I[1],.6),backgroundHover:ae(I[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:pa.primary,textColor:pa.secondary,iconBackground:`linear-gradient(135deg, ${ne[3]} 0%, ${ne[3]}cc 100%)`,iconShadow:`0 2px 8px ${ne[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:ae(I[1],.6),textColor:pa.primary,titleColor:pa.primary,arrowColor:ae(I[1],.6),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:ae(I[0],.95),textColor:pa.primary,textSecondaryColor:pa.secondary,border:`1px solid ${I[5]}`,borderRadius:"12px",successColor:ke[4],warningColor:Ct[4],errorColor:ze[4],iconBackground:ae(ne[3],.15),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[4]})`},content:{background:ae(I[3],.8),backgroundHover:ae(I[5],.6),border:`1px solid ${ae(I[5],.5)}`,borderRadius:"8px",textColor:pa.primary,textSecondaryColor:pa.secondary,itemDivider:"none",itemGap:"6px",itemPadding:"12px 16px",itemFontSize:"15px",bodyPadding:"0 16px 12px 16px",bodyFontSize:"14px",categoryPadding:"8px 4px 4px 4px",categoryGap:"4px",categoryFontSize:"12px",searchBackground:ae(I[3],.8),searchColor:pa.primary,chevronColor:"currentColor"}},Xv={mode:"light",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:ne[3],colorPrimaryHover:ne[2],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:ae(I[12],.7),blur:"blur(24px)",border:"none",width:"clamp(380px, 25vw, 520px)",transitionDuration:"300ms",transitionEasing:"cubic-bezier(0.16, 1, 0.3, 1)",transitionFade:"6%"},launcher:{background:ne[3],backgroundHover:ne[2],color:"#ffffff",size:"56px",shadow:"0 8px 32px rgba(0, 0, 0, 0.15)",borderRadius:"9999px"},tile:{background:ae(I[12],.7),backgroundHover:ae(I[12],.8),border:"1px solid rgba(0, 0, 0, 0.06)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.12)",titleColor:I[1],textColor:I[6],iconBackground:`linear-gradient(135deg, ${ne[3]} 0%, ${ne[3]}cc 100%)`,iconShadow:`0 2px 8px ${ne[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:ae(I[12],.7),textColor:I[1],titleColor:I[1],arrowColor:ae(I[12],.7),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:ae(I[12],.95),textColor:I[1],textSecondaryColor:I[6],border:`1px solid ${ae(I[0],.12)}`,borderRadius:"12px",successColor:ke[4],warningColor:Ct[4],errorColor:ze[4],iconBackground:ae(ne[3],.1),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[2]})`},content:{background:ae(I[12],.8),backgroundHover:ae(I[11],.6),border:`1px solid ${I[11]}`,borderRadius:"8px",textColor:I[1],textSecondaryColor:I[6],itemDivider:"none",itemGap:"6px",itemPadding:"12px 16px",itemFontSize:"15px",bodyPadding:"0 16px 12px 16px",bodyFontSize:"14px",categoryPadding:"8px 4px 4px 4px",categoryGap:"4px",categoryFontSize:"12px",searchBackground:I[12],searchColor:I[1],chevronColor:"currentColor"}};function Yv(t){let e=t.mode==="light"?Xv:Zv;return{mode:t.mode??e.mode,fontFamily:t.fontFamily??e.fontFamily,colorPrimary:t.colorPrimary??e.colorPrimary,colorPrimaryHover:t.colorPrimaryHover??e.colorPrimaryHover,borderRadius:t.borderRadius??e.borderRadius,canvas:{...e.canvas,...t.canvas},launcher:{...e.launcher,...t.launcher},tile:{...e.tile,...t.tile},overlay:{...e.overlay,...t.overlay},notification:{...e.notification,...t.notification},content:{...e.content,...t.content}}}function Kv(t,e){let a=e.mode??t.mode??"dark",r=a==="light"?Xv:Zv;return{mode:a,fontFamily:e.fontFamily??t.fontFamily??r.fontFamily,colorPrimary:e.colorPrimary??t.colorPrimary??r.colorPrimary,colorPrimaryHover:e.colorPrimaryHover??t.colorPrimaryHover??r.colorPrimaryHover,borderRadius:e.borderRadius??t.borderRadius??r.borderRadius,canvas:{...r.canvas,...t.canvas,...e.canvas},launcher:{...r.launcher,...t.launcher,...e.launcher},tile:{...r.tile,...t.tile,...e.tile},overlay:{...r.overlay,...t.overlay,...e.overlay},notification:{...r.notification,...t.notification,...e.notification},content:{...r.content,...t.content,...e.content}}}var nO=["canvas","launcher","tile","overlay","notification","content"];function Qv(t){let e={};t.fontFamily&&(e["--sc-font-family"]=t.fontFamily),t.colorPrimary&&(e["--sc-color-primary"]=t.colorPrimary),t.colorPrimaryHover&&(e["--sc-color-primary-hover"]=t.colorPrimaryHover),t.borderRadius&&(e["--sc-border-radius"]=t.borderRadius);for(let a of nO){let r=t[a];if(r)for(let[n,o]of Object.entries(r))o!==void 0&&(e[`--sc-${a}-${rO(n)}`]=o)}return e}var Gr=K(We(),1);var t1=K(Me(),1),e1=(0,Gr.createContext)(null);function Jv({children:t,themeConfig:e,workspaceTheme:a,shadowRoot:r}){let n=(0,Gr.useMemo)(()=>a?Kv(a,e??{}):Yv(e??{}),[e,a]),o=(0,Gr.useMemo)(()=>Qv(n),[n]);(0,Gr.useEffect)(()=>{if(!r)return;let s=r.querySelector("#sc-theme-vars");s||(s=document.createElement("style"),s.id="sc-theme-vars",r.insertBefore(s,r.firstChild));let l=Object.entries(o).map(([u,c])=>` ${u}: ${c};`).join(`
|
|
410
|
+
`);s.textContent=`:host {
|
|
411
|
+
${l}
|
|
412
|
+
}`},[r,o]);let i={config:n,mode:n.mode,cssVariables:o};return(0,t1.jsx)(e1.Provider,{value:i,children:t})}function ey(){let t=(0,Gr.useContext)(e1);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}var Ye=K(We(),1);var $f=K(We());var Vf=(...t)=>t.filter((e,a,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===a).join(" ").trim();var a1=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var r1=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,a,r)=>r?r.toUpperCase():a.toLowerCase());var ty=t=>{let e=r1(t);return e.charAt(0).toUpperCase()+e.slice(1)};var Cu=K(We());var n1={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"};var o1=t=>{for(let e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};var i1=(0,Cu.forwardRef)(({color:t="currentColor",size:e=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:n="",children:o,iconNode:i,...s},l)=>(0,Cu.createElement)("svg",{ref:l,...n1,width:e,height:e,stroke:t,strokeWidth:r?Number(a)*24/Number(e):a,className:Vf("lucide",n),...!o&&!o1(s)&&{"aria-hidden":"true"},...s},[...i.map(([u,c])=>(0,Cu.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var Tt=(t,e)=>{let a=(0,$f.forwardRef)(({className:r,...n},o)=>(0,$f.createElement)(i1,{ref:o,iconNode:e,className:Vf(`lucide-${a1(ty(t))}`,`lucide-${t}`,r),...n}));return a.displayName=ty(t),a};var oO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Qa=Tt("circle-question-mark",oO);var iO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],_u=Tt("compass",iO);var sO=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],wu=Tt("file-text",sO);var lO=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],Lu=Tt("gamepad-2",lO);var uO=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],jn=Tt("layers",uO);var cO=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Iu=Tt("message-circle",cO);var dO=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Gn=Tt("sparkles",dO);var fO=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],Au=Tt("trophy",fO);var ay=K(Me(),1),pO={"\u2753":Qa,"\u{1F9ED}":_u,"\u{1F4DD}":wu,"\u{1F3AF}":jn,"\u{1F3C6}":Au,"\u2728":Gn,"\u{1F4AC}":Iu,"\u{1F3AE}":Lu};function s1({emoji:t,size:e=18,color:a="currentColor"}){let r=pO[t];return r?(0,ay.jsx)(r,{size:e,color:a}):(0,ay.jsx)("span",{children:t})}var Kt=K(Me(),1);function hO({widgetId:t,props:e}){let a=dr(),r=(0,Ye.useRef)(null),n=(0,Ye.useRef)(null),o=a?.widgets,i=o?.has(t)??!1,s=(0,Ye.useRef)(e);s.current=e;let[,l]=(0,Ye.useReducer)(d=>d+1,0);(0,Ye.useEffect)(()=>{if(!(!o||i))return o.subscribe(d=>{d.type==="registered"&&d.widgetId===t&&l()})},[o,t,i]),(0,Ye.useEffect)(()=>{if(!r.current||!o||!i)return;let d=document.createElement("div");d.style.width="100%",d.style.minHeight="40px",r.current.appendChild(d);let p=o.mount(t,d,s.current);return n.current=p,()=>{p.unmount(),n.current=null,d.remove()}},[o,t,i]);let u=JSON.stringify(e),c=(0,Ye.useRef)(u);return(0,Ye.useEffect)(()=>{c.current!==u&&(c.current=u,n.current?.update(s.current))},[u]),!o||!o.has(t)?(0,Kt.jsxs)("div",{style:{padding:"0.75rem",fontSize:"0.8rem",color:"var(--sc-tile-text-color)",fontStyle:"italic"},children:["Widget not available: ",t]}):(0,Kt.jsx)("div",{ref:r})}function vs({config:t,surface:e,telemetry:a,style:r}){let{title:n,subtitle:o,widget:i,props:s,icon:l}=t,[,u]=(0,Ye.useState)(0),c=dr();(0,Ye.useEffect)(()=>{c&&u(_=>_+1)},[c]);let d=(0,Ye.useMemo)(()=>c?.widgets?.getRegistration?.(i),[c?.widgets,i]),p=(0,Ye.useMemo)(()=>l||(d?.metadata?.icon??"+"),[l,d]),g=(0,Ye.useMemo)(()=>o||d?.metadata?.subtitle,[o,d]),[S,b]=(0,Ye.useState)(!1),x=(0,Ye.useCallback)(()=>b(!0),[]),f=(0,Ye.useCallback)(()=>b(!1),[]),m={display:"flex",flexDirection:"column",borderRadius:"var(--sc-tile-border-radius)",background:S?"var(--sc-tile-background-hover)":"var(--sc-tile-background)",backdropFilter:"blur(16px) saturate(1.2)",WebkitBackdropFilter:"blur(16px) saturate(1.2)",border:"var(--sc-tile-border)",boxShadow:"var(--sc-tile-shadow)",color:"var(--sc-tile-title-color)",fontFamily:"var(--sc-font-family)",overflow:"hidden",cursor:"default",transition:"all 0.25s ease",transform:S?"scale(1.01)":"scale(1)",...r},v={display:"flex",alignItems:"center",gap:"var(--sc-tile-gap, 0.25rem)",padding:"var(--sc-tile-header-padding, 0.375rem 0.75rem)",minHeight:"44px"},y={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return(0,Kt.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:m,onMouseEnter:x,onMouseLeave:f,children:[(0,Kt.jsxs)("div",{style:v,children:[(0,Kt.jsx)("div",{style:y,children:(0,Kt.jsx)(s1,{emoji:p,size:g?36:24})}),(0,Kt.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Kt.jsx)("h3",{style:{fontSize:"1.14rem",fontWeight:600,color:"var(--sc-tile-title-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n??i}),g&&(0,Kt.jsx)("p",{style:{fontSize:"0.8rem",fontWeight:400,color:"var(--sc-tile-text-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:g})]})]}),(0,Kt.jsx)("div",{style:{padding:"var(--sc-tile-body-padding, 0 0.75rem 0.5rem)",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},children:(0,Kt.jsx)("div",{style:{paddingTop:"var(--sc-tile-gap, 0.25rem)"},children:(0,Kt.jsx)(hO,{widgetId:i,props:{...s,instanceId:t.id}})})})]})}var ge=K(Me(),1),l1="syntro-launcher-styles";function mO(t,e){if(t.querySelector(`#${l1}`))return;let a=document.createElement("style");a.id=l1,a.textContent=e,t.appendChild(a)}function ny({isOpen:t,onToggle:e,telemetry:a,launcherLabel:r="Adaptives",launcherIcon:n,launcherAnimate:o=!1,launcherAnimationStyle:i="pulse",notificationCount:s,footerSlot:l,tiles:u,isLoading:c,error:d,canvasTitle:p,displayMode:g="standard"}){let[S,b]=(0,lt.useState)(!1),[x,f]=(0,lt.useState)(null),m=(0,lt.useRef)(null),v=dr(),{shadowRoot:y,portalRoot:_}=jo(),{config:w}=ey(),{notifications:C,dismiss:A}=Pf(v?.events??null,u);Uf(v,u,v?.apps);let E=(0,lt.useCallback)(j=>{v&&v.events.publish(be.NOTIFICATION_CLICKED,{notificationId:j.id,tileId:j.tileId,itemId:j.itemId}),t||e(),v&&j.tileId&&v.events.publish(be.NOTIFICATION_DEEP_LINK,{tileId:j.tileId,itemId:j.itemId}),A(j.id)},[v,t,e,A]),L=(0,lt.useMemo)(()=>`
|
|
391
413
|
@keyframes syntro-launcher-pulse {
|
|
392
414
|
0%, 100% {
|
|
393
|
-
box-shadow: 0 20px 45px
|
|
415
|
+
box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 0 ${w.colorPrimary}66;
|
|
394
416
|
}
|
|
395
417
|
50% {
|
|
396
|
-
box-shadow: 0 20px 45px
|
|
418
|
+
box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 8px ${w.colorPrimary}00;
|
|
397
419
|
}
|
|
398
420
|
}
|
|
399
421
|
@keyframes syntro-launcher-glow {
|
|
400
|
-
0%, 100% {
|
|
401
|
-
|
|
402
|
-
}
|
|
403
|
-
50% {
|
|
404
|
-
border-color: ${ne[4]}99;
|
|
405
|
-
}
|
|
422
|
+
0%, 100% { border-color: rgba(255,255,255,0.1); }
|
|
423
|
+
50% { border-color: ${w.colorPrimaryHover}99; }
|
|
406
424
|
}
|
|
407
425
|
.syntro-launcher-animate {
|
|
408
426
|
animation: syntro-launcher-pulse 2s ease-in-out infinite, syntro-launcher-glow 2s ease-in-out infinite;
|
|
409
427
|
}
|
|
410
|
-
.syntro-launcher-animate:hover {
|
|
411
|
-
animation: none;
|
|
412
|
-
}
|
|
428
|
+
.syntro-launcher-animate:hover { animation: none; }
|
|
413
429
|
@keyframes syntro-badge-ping {
|
|
414
430
|
0% { transform: scale(1); opacity: 1; }
|
|
415
431
|
75%, 100% { transform: scale(2.2); opacity: 0; }
|
|
416
432
|
}
|
|
417
433
|
@keyframes syntro-badge-glow {
|
|
418
|
-
0%, 100% { box-shadow: 0 0 8px 2px ${
|
|
419
|
-
50% { box-shadow: 0 0 20px 6px ${
|
|
434
|
+
0%, 100% { box-shadow: 0 0 8px 2px ${w.colorPrimaryHover}4d; }
|
|
435
|
+
50% { box-shadow: 0 0 20px 6px ${w.colorPrimaryHover}80; }
|
|
420
436
|
}
|
|
421
437
|
@keyframes syntro-badge-bounce {
|
|
422
438
|
0%, 100% { transform: translateY(0); }
|
|
@@ -426,8 +442,7 @@ Error generating stack: `+i.message+`
|
|
|
426
442
|
.syntro-badge-ping { animation: syntro-badge-ping 1.5s cubic-bezier(0,0,0.2,1) infinite; }
|
|
427
443
|
.syntro-badge-glow { animation: syntro-badge-glow 2s ease-in-out infinite; }
|
|
428
444
|
.syntro-badge-bounce { animation: syntro-badge-bounce 2s ease-in-out infinite; }
|
|
429
|
-
`;function UN(t){if(t.querySelector(`#${XE}`))return;let e=document.createElement("style");e.id=XE,e.textContent=FN,t.appendChild(e)}var VN={position:"right",baseWidth:"clamp(320px, 16.666vw, 420px)",expandedWidth:"40vw",zIndex:2147483600,backdropBlur:"18px",mode:"dark",colorPrimary:ne[3],colorBackground:E[1],colorText:dt.primary,colorTextSecondary:dt.secondary,borderRadius:"12px",glassBackground:oe(E[1],.6),glassBlur:"blur(24px)",glassSaturate:"saturate(1.2)"};function ov({isOpen:t,onToggle:e,telemetry:n,launcherLabel:i="Adaptives",launcherAnimate:r=!1,launcherAnimationStyle:a="pulse",notificationCount:o,footerSlot:s,tiles:l,isLoading:c,error:u,canvasTitle:f,displayMode:h="standard",theme:g}){let[_,b]=(0,qt.useState)(!1),[w,d]=(0,qt.useState)(null),p=(0,qt.useRef)(null),m=ri(),{shadowRoot:v,portalRoot:S}=tc(),{notifications:T,dismiss:A}=ff(m?.events??null,l);hf(m,l,m?.apps);let k=(0,qt.useCallback)(L=>{m&&m.events.publish(ye.NOTIFICATION_CLICKED,{notificationId:L.id,tileId:L.tileId,itemId:L.itemId}),t||e(),m&&L.tileId&&m.events.publish(ye.NOTIFICATION_DEEP_LINK,{tileId:L.tileId,itemId:L.itemId}),A(L.id)},[m,t,e,A]),C={...VN,...g};(0,qt.useEffect)(()=>{t&&l.forEach(L=>{if(n?.trackRectangleViewed(L.id,"overlay"),m){let de=os.tileViewed(L.id,"overlay");m.events.publish(de.name,de.props,de.source)}})},[n,m,t,l]),(0,qt.useEffect)(()=>{b(!0),UN(v)},[v]);let x=(0,qt.useCallback)(()=>{let L=!t;if(L?n?.trackCanvasOpened("overlay"):n?.trackCanvasClosed("overlay"),m){let de=L?os.canvasOpened("overlay"):os.canvasClosed("overlay");m.events.publish(de.name,de.props,de.source)}e()},[t,n,m,e]),M=(0,qt.useCallback)(L=>{let de=L.currentTarget.getBoundingClientRect();p.current={startX:L.clientX,startY:L.clientY,startElX:de.left,startElY:de.top,dragged:!1},L.currentTarget.setPointerCapture(L.pointerId)},[]),z=(0,qt.useCallback)(L=>{let de=p.current;if(!de)return;let fn=L.clientX-de.startX,We=L.clientY-de.startY;(Math.abs(fn)>5||Math.abs(We)>5)&&(de.dragged=!0),de.dragged&&d({x:de.startElX+fn,y:de.startElY+We})},[]),U=(0,qt.useCallback)(L=>{let de=p.current;p.current=null,de&&!de.dragged&&x()},[x]),P=h==="focused",Z=C.position==="right",X={display:"flex",flexDirection:"column",width:P?C.expandedWidth:C.baseWidth,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:t?"transform 340ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease-out":"transform 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease-in",color:C.colorText||dt.primary,background:P?C.glassBackground??oe(E[1],.6):"transparent",backdropFilter:P?`${C.glassBlur??"blur(24px)"} ${C.glassSaturate??"saturate(1.2)"}`:"blur(6px)",WebkitBackdropFilter:P?`${C.glassBlur??"blur(24px)"} ${C.glassSaturate??"saturate(1.2)"}`:"blur(6px)",...P?{}:{maskImage:Z?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)",WebkitMaskImage:Z?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)"},border:"none",borderRadius:"0",boxShadow:"none",transform:t?"translateX(0)":Z?"translateX(120%)":"translateX(-120%)"},W={position:"absolute",inset:0,display:"flex",flexDirection:Z?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},D=(0,pe.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:C.zIndex},children:(0,pe.jsxs)("div",{style:W,children:[(0,pe.jsxs)("div",{"data-shadow-canvas-id":"overlay-container",style:X,children:[P&&f&&(0,pe.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,pe.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:dt.tertiary},children:f})}),(0,pe.jsx)("div",{style:{flex:1,overflowY:"auto",padding:P?"0":"1rem"},children:c?(0,pe.jsx)("div",{style:{color:dt.primary,padding:P?"1rem":"0"},children:"Loading..."}):u?(0,pe.jsxs)("div",{style:{color:Be[8],padding:P?"1rem":"0"},children:["Failed to load: ",u]}):P?l.length>0?(0,pe.jsx)(ls,{config:l[0],surface:"overlay",telemetry:n,style:{width:"100%",height:"100%"}}):null:(0,pe.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:l.map(L=>(0,pe.jsx)(ls,{config:L,surface:"overlay",telemetry:n,style:{width:"100%"}},L.id))})}),s]}),(0,pe.jsx)("div",{onClick:x,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return _?(0,pe.jsxs)(pe.Fragment,{children:[(0,av.createPortal)((0,pe.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:C.zIndex+47},children:[(0,pe.jsx)(sf,{notifications:T,onDismiss:A,onClickNotification:k,position:C.position}),(0,pe.jsxs)("button",{type:"button","aria-label":"Toggle shadow canvas",className:r&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",...w?{top:w.y,left:w.x}:{bottom:"2.5rem",right:Z?"2.5rem":void 0,left:Z?void 0:"2.5rem"},pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",width:"56px",height:"56px",borderRadius:"9999px",color:Gl.primary.icon,boxShadow:`0 8px 32px ${oe(E[0],.6)}`,transition:p.current?"none":"transform 0.2s ease, opacity 0.3s ease, background-color 0.2s ease",outline:"none",padding:0,border:"none",backgroundColor:Gl.primary.backgroundDefault,cursor:p.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:M,onPointerMove:z,onPointerUp:U,onMouseEnter:L=>{p.current?.dragged||(L.currentTarget.style.backgroundColor=Gl.primary.backgroundHover)},onMouseLeave:L=>{p.current?.dragged||(L.currentTarget.style.backgroundColor=Gl.primary.backgroundDefault)},children:[(0,pe.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transition:"transform 200ms ease"},children:t?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("path",{d:"M18 6L6 18"}),(0,pe.jsx)("path",{d:"M6 6l12 12"})]}):(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("path",{d:"M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 0-1.275-1.275L3 12l5.813-1.912a2 2 0 0 0 1.275-1.275L12 3Z"}),(0,pe.jsx)("path",{d:"M5 3v4"}),(0,pe.jsx)("path",{d:"M3 5h4"}),(0,pe.jsx)("path",{d:"M19 17v4"}),(0,pe.jsx)("path",{d:"M17 19h4"})]})}),!t&&T.length>0&&(0,pe.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,pe.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:oe(ne[4],.4)}}),(0,pe.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,pe.jsx)("span",{className:"syntro-badge-bounce",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"9999px",background:ne[4],color:Ze.white,fontSize:11,fontWeight:700},children:T.length>99?"99+":T.length})]})]})]}),S),t?(0,av.createPortal)(D,S):null]}):null}var Hr=ee(nt(),1);var jN=t=>[...t].sort((e,n)=>(n.priority??0)-(e.priority??0));function sv({fetcher:t,pollIntervalMs:e=3e4,experiments:n,runtime:i,pathname:r}){let[a,o]=(0,Hr.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Hr.useCallback)(async()=>{try{o(u=>({...u,isLoading:!0,error:void 0}));let l=await t();G("SmartCanvas Config","Raw config response",l);let c=l.tiles||[];i?(c=await i.filterTiles(c),n&&(c=c.filter(u=>n.shouldRenderRectangle(u)))):n&&(c=c.filter(u=>n.shouldRenderRectangle(u))),G("SmartCanvas Config",`Tile count after filtering: ${c.length}`),o({tiles:jN(c),actions:l.actions||[],isLoading:!1,fetchedAt:l.fetchedAt,canvasTitle:l.canvasTitle,configVersion:l.configVersion,theme:l.theme,launcher:l.launcher})}catch(l){let c=l instanceof Error?l.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",c,l),o(u=>({...u,isLoading:!1,error:c}))}},[n,t,i]);return(0,Hr.useEffect)(()=>{if(s(),!e)return;let l=setInterval(s,e);return()=>clearInterval(l)},[s,e,r]),(0,Hr.useMemo)(()=>a,[a])}var rc=ee(qe(),1);function lv({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:a="include",pollIntervalMs:o,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:_,launcherLabel:b,canvasHost:w,theme:d,initialBatchHandle:p}){return c?(0,rc.jsx)(gf,{runtime:c,children:(0,rc.jsx)(QE,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:a,pollIntervalMs:o,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:_,launcherLabel:b,canvasHost:w,theme:d,initialBatchHandle:p})}):(0,rc.jsx)(QE,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:a,pollIntervalMs:o,experiments:s,telemetry:l,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:_,launcherLabel:b,canvasHost:w,theme:d,initialBatchHandle:p})}function QE({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:a="include",pollIntervalMs:o,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:_,launcherLabel:b,canvasHost:w,theme:d,initialBatchHandle:p}){let[m,v]=(0,Nt.useState)(t.getState().open),S=mf(),[T,A]=(0,Nt.useState)(()=>typeof window<"u"?window.location.pathname:"/"),k=S?.url?new URL(S.url).pathname:T;(0,Nt.useEffect)(()=>{if(c||typeof window>"u")return;let Z=()=>A(window.location.pathname);window.addEventListener("popstate",Z);let X=history.pushState,W=history.replaceState;return history.pushState=function(...D){X.apply(this,D),queueMicrotask(Z)},history.replaceState=function(...D){W.apply(this,D),queueMicrotask(Z)},()=>{window.removeEventListener("popstate",Z),history.pushState=X,history.replaceState=W}},[c]);let C=(0,Nt.useMemo)(()=>e||Oa({configUri:n,experiments:s,featureKey:i,configFeatureKey:r,credentials:a}),[e,n,s,i,r,a]),x=sv({fetcher:C,pollIntervalMs:o,experiments:s,runtime:c,pathname:k}),M=x.tiles.length>0&&!x.error;(0,Nt.useEffect)(()=>t.subscribe(Z=>v(Z.open)),[t]),(0,Nt.useEffect)(()=>{!x.isLoading&&!M&&t.getState().open&&t.setOpen(!1)},[t,M,x.isLoading]);let z=(0,Nt.useRef)(p??null),U=(0,Nt.useRef)(!!p);(0,Nt.useEffect)(()=>{if(!c?.actions)return;if(U.current){x.actions.length>0&&(U.current=!1);return}let Z=!1;return(async()=>{if(z.current){console.log("[SmartCanvasApp] Reverting previous action batch before re-apply");try{await z.current.revertAll()}catch(W){console.error("[SmartCanvasApp] Failed to revert actions:",W)}z.current=null}if(!Z&&x.actions.length>0){console.log(`[SmartCanvasApp] Applying ${x.actions.length} action(s):`,x.actions.map((W,D)=>`[${D}] ${W.kind}${W.anchorId?` anchor="${W.anchorId}"`:""}${W.label?` "${W.label}"`:""}`).join(", "));try{let W=await c.actions.applyBatch(x.actions);Z?await W.revertAll():(z.current=W,console.log("[SmartCanvasApp] Action batch applied successfully"))}catch(W){Z||console.error("[SmartCanvasApp] Failed to apply actions:",W,`
|
|
430
|
-
Actions that failed:`,JSON.stringify(x.actions,null,2))}}})(),()=>{Z=!0,z.current&&(console.log("[SmartCanvasApp] Cleanup: reverting action batch (actions changed or unmount)"),z.current.revertAll().catch(W=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",W)}),z.current=null)}},[c,x.actions]),(0,Nt.useEffect)(()=>{if(c)return c.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[c,t]);let P=(0,Nt.useMemo)(()=>{let Z=x.theme;return Z?{...Z,...d}:d},[x.theme,d]);return!x.isLoading&&!M?null:(0,rc.jsx)(ov,{tiles:x.tiles,isLoading:x.isLoading,error:x.error,canvasTitle:x.canvasTitle,telemetry:l,launcherLabel:b??x.launcher?.label,launcherAnimate:x.launcher?.animate,launcherAnimationStyle:x.launcher?.animationStyle,notificationCount:x.launcher?.notificationCount??x.tiles.length,footerSlot:_,isOpen:m,onToggle:()=>t.toggle(),displayMode:x.displayMode,theme:P})}var cv=ee(qe(),1),JE="smart-canvas",eC=`
|
|
445
|
+
`,[w.colorPrimary,w.colorPrimaryHover]);(0,lt.useEffect)(()=>{t&&u.forEach(j=>{if(a?.trackRectangleViewed(j.id,"overlay"),v){let re=gs.tileViewed(j.id,"overlay");v.events.publish(re.name,re.props,re.source)}})},[a,v,t,u]),(0,lt.useEffect)(()=>{b(!0),mO(y,L)},[y,L]);let k=(0,lt.useCallback)(()=>{let j=!t;if(j?a?.trackCanvasOpened("overlay"):a?.trackCanvasClosed("overlay"),v){let re=j?gs.canvasOpened("overlay"):gs.canvasClosed("overlay");v.events.publish(re.name,re.props,re.source)}e()},[t,a,v,e]),D=(0,lt.useCallback)(j=>{let re=j.currentTarget.getBoundingClientRect();m.current={startX:j.clientX,startY:j.clientY,startElX:re.left,startElY:re.top,dragged:!1},j.currentTarget.setPointerCapture(j.pointerId)},[]),R=(0,lt.useCallback)(j=>{let re=m.current;if(!re)return;let At=j.clientX-re.startX,dn=j.clientY-re.startY;(Math.abs(At)>5||Math.abs(dn)>5)&&(re.dragged=!0),re.dragged&&f({x:re.startElX+At,y:re.startElY+dn})},[]),F=(0,lt.useCallback)(j=>{let re=m.current;m.current=null,re&&!re.dragged&&k()},[k]),N=g==="focused",U=w.canvas.position==="right",Y=w.canvas.layout==="push",B=w.canvas.border??"none",W=(0,lt.useRef)(null),ve=2147483600;(0,lt.useEffect)(()=>{if(!Y)return;let j=document.documentElement,re=U?"marginRight":"marginLeft",At=w.canvas.transitionDuration??"300ms",dn=w.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)",Bh=j.style.transition;if(j.style.transition=`${re} ${At} ${dn}`,t){let Fh=W.current?.offsetWidth??380;j.style[re]=`${Fh}px`}else j.style[re]="0px";return()=>{j.style[re]="",j.style.transition=Bh}},[Y,t,U,w.canvas.transitionDuration,w.canvas.transitionEasing]),(0,lt.useEffect)(()=>{if(!Y||!t)return;let j=W.current;if(!j)return;let re=U?"marginRight":"marginLeft",At=new ResizeObserver(([dn])=>{document.documentElement.style[re]=`${dn.contentRect.width}px`});return At.observe(j),()=>At.disconnect()},[Y,t,U]);let Ha={display:"flex",flexDirection:"column",width:N?"40vw":w.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:(()=>{let j=w.canvas.transitionDuration??"300ms",re=w.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)";return t?`transform ${j} ${re}, opacity ${j} ease-out`:`transform ${j} ${re}, opacity ${j} ease-in`})(),color:"var(--sc-overlay-text-color)",background:"var(--sc-canvas-background)",...(()=>{let j=w.canvas.blur??"blur(24px)",re=N&&j!=="none"?`${j} saturate(1.2)`:j;return{backdropFilter:re,WebkitBackdropFilter:re}})(),...(()=>{if(N||B&&B!=="none")return{};let j=w.canvas.transitionFade??"6%",re=U?`linear-gradient(to right, transparent, black ${j})`:`linear-gradient(to left, transparent, black ${j})`;return{maskImage:re,WebkitMaskImage:re}})(),border:B,borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":U?"translateX(120%)":"translateX(-120%)"},qt=(0,ge.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:ve},children:(0,ge.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:U?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,ge.jsxs)("div",{ref:W,"data-shadow-canvas-id":"overlay-container",style:Ha,children:[N&&p&&(0,ge.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,ge.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"var(--sc-notification-text-secondary-color)"},children:p})}),(0,ge.jsx)("div",{style:{flex:1,overflowY:"auto",padding:N?"0":"1rem"},children:c?(0,ge.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:N?"1rem":"0"},children:"Loading..."}):d?(0,ge.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:N?"1rem":"0"},children:["Failed to load: ",d]}):N?u.length>0?(0,ge.jsx)(vs,{config:u[0],surface:"overlay",telemetry:a,style:{width:"100%",height:"100%"}}):null:(0,ge.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:u.map(j=>(0,ge.jsx)(vs,{config:j,surface:"overlay",telemetry:a,style:{width:"100%"}},j.id))})}),l]}),(0,ge.jsx)("div",{onClick:k,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return S?(0,ge.jsxs)(ge.Fragment,{children:[(0,ry.createPortal)((0,ge.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:ve+47},children:[(0,ge.jsx)(Df,{notifications:C,onDismiss:A,onClickNotification:E,position:w.canvas.position??"right"}),(0,ge.jsxs)("button",{type:"button","aria-label":"Toggle shadow canvas",className:o&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",...x?{top:x.y,left:x.x}:{bottom:"2.5rem",right:U?"2.5rem":void 0,left:U?void 0:"2.5rem"},pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",width:"var(--sc-launcher-size, 56px)",height:"var(--sc-launcher-size, 56px)",borderRadius:"var(--sc-launcher-border-radius, 9999px)",color:"var(--sc-launcher-color)",boxShadow:"var(--sc-launcher-shadow)",transition:m.current?"none":"transform 0.2s ease, opacity 0.3s ease, background-color 0.2s ease",outline:"none",padding:0,border:"none",backgroundColor:"var(--sc-launcher-background)",cursor:m.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:D,onPointerMove:R,onPointerUp:F,onMouseEnter:j=>{m.current?.dragged||(j.currentTarget.style.backgroundColor=w.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:j=>{m.current?.dragged||(j.currentTarget.style.backgroundColor=w.launcher.background??"var(--sc-launcher-background)")},children:[t?(0,ge.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transition:"transform 200ms ease"},children:[(0,ge.jsx)("path",{d:"M18 6L6 18"}),(0,ge.jsx)("path",{d:"M6 6l12 12"})]}):n?(0,ge.jsx)("img",{src:n,alt:"","aria-hidden":"true",style:{width:"60%",height:"60%",objectFit:"contain",pointerEvents:"none"}}):(0,ge.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transition:"transform 200ms ease"},children:[(0,ge.jsx)("path",{d:"M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 0-1.275-1.275L3 12l5.813-1.912a2 2 0 0 0 1.275-1.275L12 3Z"}),(0,ge.jsx)("path",{d:"M5 3v4"}),(0,ge.jsx)("path",{d:"M3 5h4"}),(0,ge.jsx)("path",{d:"M19 17v4"}),(0,ge.jsx)("path",{d:"M17 19h4"})]}),!t&&C.length>0&&(0,ge.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,ge.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${w.colorPrimaryHover}66`}}),(0,ge.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,ge.jsx)("span",{className:"syntro-badge-bounce",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"9999px",background:w.colorPrimaryHover,color:"#ffffff",fontSize:11,fontWeight:700},children:C.length>99?"99+":C.length})]})]})]}),_),(0,ry.createPortal)(qt,_)]}):null}var Nt=K(We(),1);var u1=t=>[...t].sort((e,a)=>(a.priority??0)-(e.priority??0));function oy({fetcher:t,experiments:e,runtime:a,pageUrl:r,pollIntervalMs:n}){let[o,i]=(0,Nt.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Nt.useRef)("[]"),l=(0,Nt.useRef)(null),u=(0,Nt.useCallback)(async()=>{let d=l.current;if(!d||!a)return;let p=d.tiles||[];p=await a.filterTiles(p),e&&(p=p.filter(g=>e.shouldRenderRectangle(g))),i(g=>({...g,tiles:u1(p)}))},[a,e]),c=(0,Nt.useCallback)(async()=>{try{i(x=>({...x,isLoading:!0,error:void 0}));let d=await t();X("SmartCanvas Config","Raw config response",d),l.current=d;let p=d.tiles||[];a?(p=await a.filterTiles(p),e&&(p=p.filter(x=>e.shouldRenderRectangle(x)))):e&&(p=p.filter(x=>e.shouldRenderRectangle(x))),X("SmartCanvas Config",`Tile count after filtering: ${p.length}`);let g=d.actions||[],S=JSON.stringify(g),b=S!==s.current;b&&(s.current=S),i(x=>({tiles:u1(p),actions:b?g:x.actions,isLoading:!1,fetchedAt:d.fetchedAt,canvasTitle:d.canvasTitle,configVersion:d.configVersion,theme:d.theme,launcher:d.launcher}))}catch(d){let p=d instanceof Error?d.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",p,d),i(g=>({...g,isLoading:!1,error:p}))}},[e,t,a]);return(0,Nt.useEffect)(()=>{if(c(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>c())},[c,e,r]),(0,Nt.useEffect)(()=>{if(a?.accumulator)return a.accumulator.subscribe(()=>{u()})},[a,u]),(0,Nt.useEffect)(()=>{if(a?.context)return a.context.subscribe(()=>{u()})},[a,u]),(0,Nt.useEffect)(()=>{if(!n)return;let d=setInterval(()=>{c()},n);return()=>clearInterval(d)},[c,n]),(0,Nt.useMemo)(()=>o,[o])}var ys=K(Me(),1);function iy({controller:t,fetcher:e,configUri:a,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:n="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:p="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:m}){return u?(0,ys.jsx)(qf,{runtime:u,children:(0,ys.jsx)(c1,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:p,overlayFetchCredentials:g,footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:m})}):(0,ys.jsx)(c1,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:p,overlayFetchCredentials:g,footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:m})}function c1({controller:t,fetcher:e,configUri:a,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:n="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:p="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:m}){let[v,y]=(0,Pt.useState)(t.getState().open),_=zf(),[w,C]=(0,Pt.useState)(()=>typeof window<"u"?window.location.href:"/"),A=_?.url??w;(0,Pt.useEffect)(()=>{if(u||typeof window>"u")return;let Y=()=>C(window.location.href);window.addEventListener("popstate",Y),window.addEventListener("hashchange",Y);let B=history.pushState,W=history.replaceState;return history.pushState=function(...ve){B.apply(this,ve),queueMicrotask(Y)},history.replaceState=function(...ve){W.apply(this,ve),queueMicrotask(Y)},()=>{window.removeEventListener("popstate",Y),window.removeEventListener("hashchange",Y),history.pushState=B,history.replaceState=W}},[u]);let E=(0,Pt.useMemo)(()=>e||Vo({configUri:a,experiments:s,featureKey:r,configFeatureKey:n,credentials:o}),[e,a,s,r,n,o]),L=oy({fetcher:E,experiments:s,runtime:u,pageUrl:A}),k=L.tiles.length>0&&!L.error;(0,Pt.useEffect)(()=>t.subscribe(Y=>y(Y.open)),[t]),(0,Pt.useEffect)(()=>{!L.isLoading&&!k&&t.getState().open&&t.setOpen(!1)},[t,k,L.isLoading]);let D=(0,Pt.useRef)(f??null),R=(0,Pt.useRef)(!!f),F=(0,Pt.useRef)(0);(0,Pt.useEffect)(()=>{if(!u?.actions)return;if(R.current){L.actions.length>0&&(R.current=!1);return}let Y=++F.current,B=()=>Y!==F.current;return(async()=>{if(D.current){try{await D.current.revertAll()}catch(ve){console.error("[SmartCanvasApp] Failed to revert actions:",ve)}D.current=null}if(!B()&&L.actions.length>0)try{let ve=await u.actions.applyBatch(L.actions);B()?await ve.revertAll():D.current=ve}catch(ve){B()||console.error("[SmartCanvasApp] Failed to apply actions:",ve)}})(),()=>{D.current&&(D.current.revertAll().catch(ve=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",ve)}),D.current=null)}},[u,L.actions,A]),(0,Pt.useEffect)(()=>{if(u)return u.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[u,t]);let{shadowRoot:N}=jo(),U=L.theme;return!L.isLoading&&!k?null:(0,ys.jsx)(Jv,{themeConfig:U,workspaceTheme:m,shadowRoot:N,children:(0,ys.jsx)(ny,{tiles:L.tiles,isLoading:L.isLoading,error:L.error,canvasTitle:L.canvasTitle,telemetry:l,launcherLabel:b??L.launcher?.label,launcherIcon:L.launcher?.icon,launcherAnimate:L.launcher?.animate,launcherAnimationStyle:L.launcher?.animationStyle,notificationCount:L.launcher?.notificationCount??L.tiles.length,footerSlot:S,isOpen:v,onToggle:()=>t.toggle(),displayMode:L.displayMode})})}var sy=K(Me(),1),d1="smart-canvas",f1=`
|
|
431
446
|
:host {
|
|
432
447
|
font: inherit;
|
|
433
448
|
color: inherit;
|
|
@@ -441,12 +456,12 @@ Actions that failed:`,JSON.stringify(x.actions,null,2))}}})(),()=>{Z=!0,z.curren
|
|
|
441
456
|
*, *::before, *::after {
|
|
442
457
|
box-sizing: border-box;
|
|
443
458
|
}
|
|
444
|
-
`,Rn,Ir,zr,$i,Fi,Br,Ui,vf=class extends HTMLElement{constructor(){super();ir(this,Rn);ir(this,Ir);ir(this,zr);ir(this,$i);ir(this,Fi);ir(this,Br,null);ir(this,Ui,null);Wn(this,Rn,this.attachShadow({mode:"open",delegatesFocus:!0})),Wn(this,Ir,document.createElement("div")),ge(this,Ir).setAttribute("part","mount"),ge(this,Rn).appendChild(ge(this,Ir)),Wn(this,zr,document.createElement("div")),ge(this,zr).id="portalRoot",ge(this,Rn).appendChild(ge(this,zr)),Wn(this,$i,document.createElement("div")),ge(this,$i).id="overlayContainer",Object.assign(ge(this,$i).style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none"}),ge(this,Rn).appendChild(ge(this,$i)),Wn(this,Fi,ev()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){ge(this,Br)?.unmount(),Wn(this,Br,null)}getMountNode(){return ge(this,Ir)}getController(){return ge(this,Fi)}getPortalRoot(){return ge(this,zr)}getOverlayContainer(){return ge(this,$i)}getShadowRoot(){return ge(this,Rn)}open(){ge(this,Fi).setOpen(!0)}close(){ge(this,Fi).setOpen(!1)}toggle(){ge(this,Fi).toggle()}setOverrideFetcher(n){ge(this,Ui)&&(Wn(this,Ui,{...ge(this,Ui),fetcher:n}),this.render())}mountReactApp(n){Wn(this,Ui,n),this.render()}render(){!this.isConnected||!ge(this,Ui)||(ge(this,Br)||Wn(this,Br,(0,tC.createRoot)(ge(this,Ir))),ge(this,Br).render((0,cv.jsx)(tv,{shadowRoot:ge(this,Rn),portalRoot:ge(this,zr),overlayContainer:ge(this,$i),children:(0,cv.jsx)(lv,{...ge(this,Ui),controller:ge(this,Fi),canvasHost:this})})))}applyBaseStyles(){if(ge(this,Rn).adoptedStyleSheets!==void 0){let n=new CSSStyleSheet;n.replaceSync(eC),ge(this,Rn).adoptedStyleSheets=[n]}else{let n=document.createElement("style");n.textContent=eC,ge(this,Rn).appendChild(n)}}};Rn=new WeakMap,Ir=new WeakMap,zr=new WeakMap,$i=new WeakMap,Fi=new WeakMap,Br=new WeakMap,Ui=new WeakMap;var uv=()=>{typeof window>"u"||customElements.get(JE)||customElements.define(JE,vf)};var yf=async(t={})=>{if(typeof window>"u"||typeof document>"u")throw new Error("SmartCanvas can only be created in a browser-like environment");let e=null;if(t.antiFlicker){let d=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=ME(d)}let n=null,i=null,r=null,a=!0,{runtime:o}=t;async function s(d){!o?.actions||d.length===0||(r?.isApplied()&&await r.revertAll(),r=await o.actions.applyBatch(d))}async function l(){r?.isApplied()&&(await r.revertAll(),r=null)}if(t.fetcher)try{i=t.fetcher,console.log("[SmartCanvas] Fetching initial config...");let d=await t.fetcher();n=d,console.log("[SmartCanvas] Config fetched:",`tiles=${d.tiles?.length??0},`,`actions=${d.actions?.length??0},`,`theme=${d.theme?.name??"none"}`),d.actions?.length&&console.log("[SmartCanvas] Actions to apply:",d.actions.map((p,m)=>`[${m}] ${p.kind}${p.anchorId?` anchor="${p.anchorId}"`:""}${p.label?` "${p.label}"`:""}`).join(", ")),d.actions&&d.actions.length>0&&o?.actions&&(await s(d.actions),console.log("[SmartCanvas] Initial actions applied successfully")),d.tiles&&o?.accumulator&&as(d.tiles,o.accumulator)}catch(d){console.error("[SmartCanvas] Error fetching/applying initial config:",d)}e&&e();let c=zE();uv();let u=document.createElement("smart-canvas");if(FE(u.getOverlayContainer()),t.tokens)for(let[d,p]of Object.entries(t.tokens))u.style.setProperty(d,p);let f=()=>{let d=t.target??document.body;d&&d.appendChild(u)};document.body?f():document.addEventListener("DOMContentLoaded",f,{once:!0}),c&&(console.log(`[SmartCanvas] Loading editor SDK for ${c} mode`),BE(t.editorUrl).catch(console.error));let h=t.integrations?.experiments,g=t.integrations?.telemetry,_=t.fetcher??Oa({configUri:t.configUri,experiments:h,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});i||(i=_);let b={fetcher:_,pollIntervalMs:t.pollIntervalMs,experiments:h,telemetry:g,runtime:o,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,theme:t.theme,initialBatchHandle:r};u.mountReactApp(b),t.defaultOpen&&u.open();let w={el:u,open:()=>u.open(),close:()=>u.close(),destroy:()=>{l(),u.remove()},setTokens:d=>{for(let[p,m]of Object.entries(d))u.style.setProperty(p,m)},getConfig:async()=>{if(i)try{let d=await i();return n=d,d}catch(d){console.error("[SmartCanvas] Error fetching config:",d)}return n??{tiles:[],actions:[],fetchedAt:""}},updateConfig:async d=>{if(console.log("[SmartCanvas] updateConfig:",`tiles=${d.tiles?.length??0},`,`actions=${d.actions?.length??0},`,`enabled=${a}`),n=d,d.tiles&&o?.accumulator&&as(d.tiles,o.accumulator),a)try{await s(d.actions),console.log("[SmartCanvas] updateConfig actions applied successfully")}catch(p){console.error("[SmartCanvas] updateConfig failed to apply actions:",p)}u.setOverrideFetcher(()=>Promise.resolve(d))},setEnabled:async d=>{a=d,d?n&&await s(n.actions):await l()},setOverrideFetcher:d=>{i=d,u.setOverrideFetcher(d),o?.accumulator&&d().then(p=>{p?.tiles&&as(p.tiles,o.accumulator)}).catch(()=>{})},registerTelemetryProperties:d=>{g?.register?.(d)},getSessionId:()=>g?.getSessionId?.(),startSessionRecording:()=>{g?.startSessionRecording?.()},track:(d,p)=>g?.track?(g.track(d,p),!0):!1,runtime:o};if(typeof window<"u"){let d=window.SynOS;d&&(d.handle=w)}return w};typeof window<"u"&&(window.SmartCanvas={async create(t){return yf(t)}});var Fr=ee(nt(),1);var $r=ee(qe(),1);function qN({tiles:t,intervalMs:e=7e3,telemetry:n}){let[i,r]=(0,Fr.useState)(0),a=(0,Fr.useMemo)(()=>[...t].sort((o,s)=>(o.priority??0)-(s.priority??0)),[t]);return(0,Fr.useEffect)(()=>{n?.trackCanvasOpened("wheel")},[n]),(0,Fr.useEffect)(()=>{if(a.length<=1)return;let o=setInterval(()=>{r(s=>(s+1)%a.length)},e);return()=>clearInterval(o)},[a,e]),(0,Fr.useEffect)(()=>{let o=a[i];o&&n?.trackRectangleViewed(o.id,"wheel")},[i,a,n]),a.length?(0,$r.jsxs)("div",{style:{position:"relative",overflow:"hidden",borderRadius:"1.5rem",border:`1px solid ${wa.primary}`,background:E[1],padding:"1.5rem",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},"data-shadow-canvas-id":"wheel",children:[(0,$r.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${i*100}%)`,width:`${a.length*100}%`},children:a.map(o=>(0,$r.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,$r.jsx)(ls,{config:o,surface:"wheel",telemetry:n})},o.id))}),(0,$r.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:a.map((o,s)=>(0,$r.jsx)("button",{type:"button",style:{height:"0.5rem",width:"1.5rem",borderRadius:"9999px",background:s===i?ne[3]:E[6],border:"none",cursor:"pointer",padding:0},onClick:()=>r(s)},o.id))})]}):null}function cs(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function PN(t){let e=[],n=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let i=t;if(i.tiles||n.push("Config missing required field: tiles"),i.actions||n.push("Config missing required field: actions"),i.fetchedAt||n.push("Config missing required field: fetchedAt"),n.length>0)return{valid:!1,errors:n,warnings:e};let r=i.schemaVersion||"1.0",a=cs(r),o=cs(Bi);return a.major>o.major&&e.push(`Config schema v${r} is newer than SDK v${Bi}. Some features may not work. Update SDK to latest version.`),a.major<o.major||!i.schemaVersion?(e.push(`Config schema v${r} is older than SDK v${Bi}. Migrating config to current version.`),{valid:!0,warnings:e,errors:n,migratedConfig:GN(i,r)}):{valid:!0,warnings:e,errors:n}}function GN(t,e){let n={...t};return cs(e).major===1&&(n=ZN(n)),n.schemaVersion=Bi,n}function ZN(t){let e={schemaVersion:"2.0",tiles:[],actions:t.actions||[],fetchedAt:t.fetchedAt||new Date().toISOString()};return t.tiles&&Array.isArray(t.tiles)&&(e.tiles=t.tiles.map(n=>{let i={...n};if(n.experiment&&!n.activation){let r=n.experiment;r.featureKey&&(i.activation={strategy:{type:"external",provider:"growthbook",featureKey:r.featureKey,fallback:!1}}),delete i.experiment}return i})),t.configVersion&&(e.configVersion=t.configVersion),t.canvasTitle&&(e.canvasTitle=t.canvasTitle),t.theme&&(e.theme=t.theme),t.launcher&&(e.launcher=t.launcher),e}function YN(t){if(!t||typeof t!="object")return!1;let e=t,n=e.schemaVersion||"1.0",i=cs(n),r=cs(Bi);return i.major<r.major||!e.schemaVersion}var iC={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function rC(){return iC}function dv(t){let e=2166136261,n=t.length;for(let i=0;i<n;i++)e^=t.charCodeAt(i),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function ac(t,e,n){return n===2?dv(dv(t+e)+"")%1e4/1e4:n===1?dv(e+t)%1e3/1e3:null}function WN(t){return t<=0?[]:new Array(t).fill(1/t)}function bf(t,e){return t>=e[0]&&t<e[1]}function aC(t,e){let n=ac("__"+e[0],t,1);return n===null?!1:n>=e[1]&&n<e[2]}function oC(t,e){for(let n=0;n<e.length;n++)if(bf(t,e[n]))return n;return-1}function pv(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function _f(t,e){if(!e.length)return!1;let n=!1,i=!1;for(let r=0;r<e.length;r++){let a=QN(t,e[r].type,e[r].pattern);if(e[r].include===!1){if(a)return!1}else n=!0,a&&(i=!0)}return i||!n}function KN(t,e,n){try{let i=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return n&&(i="\\/?"+i.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+i+"$","i").test(t)}catch{return!1}}function XN(t,e){try{let n=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),i=[[t.host,n.host,!1],[t.pathname,n.pathname,!0]];return n.hash&&i.push([t.hash,n.hash,!1]),n.searchParams.forEach((r,a)=>{i.push([t.searchParams.get(a)||"",r,!1])}),!i.some(r=>!KN(r[0],r[1],r[2]))}catch{return!1}}function QN(t,e,n){try{let i=new URL(t,"https://_");if(e==="regex"){let r=pv(n);return r?r.test(i.href)||r.test(i.href.substring(i.origin.length)):!1}else if(e==="simple")return XN(i,n);return!1}catch{return!1}}function sC(t,e,n){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let i=WN(t);n=n||i,n.length!==t&&(n=i);let r=n.reduce((o,s)=>s+o,0);(r<.99||r>1.01)&&(n=i);let a=0;return n.map(o=>{let s=a;return a+=o,[s,s+e*o]})}function lC(t,e,n){if(!e)return null;let i=e.split("?")[1];if(!i)return null;let r=i.replace(/#.*/,"").split("&").map(a=>a.split("=",2)).filter(([a])=>a===t).map(([,a])=>parseInt(a));return r.length>0&&r[0]>=0&&r[0]<n?r[0]:null}function cC(t){try{return t()}catch(e){return console.error(e),!1}}var fv=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function Da(t,e,n){if(e=e||"",n=n||globalThis.crypto&&globalThis.crypto.subtle||iC.SubtleCrypto,!n)throw new Error("No SubtleCrypto implementation found");try{let i=await n.importKey("raw",fv(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[r,a]=t.split("."),o=await n.decrypt({name:"AES-CBC",iv:fv(r)},i,fv(a));return new TextDecoder().decode(o)}catch{throw new Error("Failed to decrypt")}}function oc(t){return typeof t=="string"?t:JSON.stringify(t)}function un(t){typeof t=="number"&&(t=t+""),(!t||typeof t!="string")&&(t="0");let e=t.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return e.length===3&&e.push("~"),e.map(n=>n.match(/^[0-9]+$/)?n.padStart(5," "):n).join("-")}function uC(){let t;try{t="1.6.4"}catch{t=""}return t}function dC(t,e){let n,i;try{n=new URL(t),i=new URL(e)}catch(r){return console.error(`Unable to merge query strings: ${r}`),e}return n.searchParams.forEach((r,a)=>{i.searchParams.has(a)||i.searchParams.set(a,r)}),i.toString()}function nC(t){return typeof t=="object"&&t!==null}function Sf(t){return t.urlPatterns&&t.variations.some(e=>nC(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>nC(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function xf(t,e){return new Promise(n=>{let i=!1,r,a=o=>{i||(i=!0,r&&clearTimeout(r),n(o||null))};e&&(r=setTimeout(()=>a(),e)),t.then(o=>a(o)).catch(()=>a())})}var Ct={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},ai=rC(),us={fetchFeaturesCall:({host:t,clientKey:e,headers:n})=>ai.fetch(`${t}/api/features/${e}`,{headers:n}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:n,headers:i})=>{let r={method:"POST",headers:{"Content-Type":"application/json",...i},body:JSON.stringify(n)};return ai.fetch(`${t}/api/eval/${e}`,r)},eventSourceCall:({host:t,clientKey:e,headers:n})=>n?new ai.EventSource(`${t}/sub/${e}`,{headers:n}):new ai.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let n=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),tD()):document.visibilityState==="hidden"&&(t=window.setTimeout(eD,Ct.idleStreamInterval))};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(ai.localStorage=globalThis.localStorage)}catch{}var ds=new Map,fC=!1,Vi=new Map,wf=new Map,fs=new Map,ps=new Set;function hC(t){Object.assign(Ct,t),Ct.backgroundSync||bv()}async function gC({instance:t,timeout:e,skipCache:n,allowStale:i,backgroundSync:r}){return r||(Ct.backgroundSync=!1),nD({instance:t,allowStale:i,timeout:e,skipCache:n})}function JN(t){let e=sc(t),n=ds.get(e)||new Set;n.add(t),ds.set(e,n)}function mC(t){ds.forEach(e=>e.delete(t))}function eD(){fs.forEach(t=>{t&&(t.state="idle",vv(t))})}function tD(){fs.forEach(t=>{t&&t.state==="idle"&&yv(t)})}async function pC(){try{if(!ai.localStorage)return;await ai.localStorage.setItem(Ct.cacheKey,JSON.stringify(Array.from(Vi.entries())))}catch{}}async function nD({instance:t,allowStale:e,timeout:n,skipCache:i}){let r=sc(t),a=gv(t),o=new Date,s=new Date(o.getTime()-Ct.maxAge+Ct.staleTTL);await iD();let l=!Ct.disableCache&&!i?Vi.get(a):void 0;return l&&(e||l.staleAt>o)&&l.staleAt>s?(l.sse&&ps.add(r),l.staleAt<o?hv(t):mv(t),{data:l.data,success:!0,source:"cache"}):await xf(hv(t),n)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function sc(t){let[e,n]=t.getApiInfo();return`${e}||${n}`}function gv(t){let e=sc(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let n=t.getAttributes(),i=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),r={};i.forEach(s=>{r[s]=n[s]});let a=t.getForcedVariations(),o=t.getUrl();return`${e}||${JSON.stringify({ca:r,fv:a,url:o})}`}async function iD(){if(!fC){fC=!0;try{if(ai.localStorage){let t=await ai.localStorage.getItem(Ct.cacheKey);if(!Ct.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([n,i])=>{Vi.set(n,{...i,staleAt:new Date(i.staleAt)})}),vC()}}}catch{}if(!Ct.disableIdleStreams){let t=us.startIdleListener();t&&(us.stopIdleListener=t)}}}function vC(){let t=Array.from(Vi.entries()).map(([n,i])=>({key:n,staleAt:i.staleAt.getTime()})).sort((n,i)=>n.staleAt-i.staleAt),e=Math.min(Math.max(0,Vi.size-Ct.maxEntries),Vi.size);for(let n=0;n<e;n++)Vi.delete(t[n].key)}function yC(t,e,n){let i=n.dateUpdated||"",r=new Date(Date.now()+Ct.staleTTL),a=Ct.disableCache?void 0:Vi.get(e);if(a&&i&&a.version===i){a.staleAt=r,pC();return}Ct.disableCache||(Vi.set(e,{data:n,version:i,staleAt:r,sse:ps.has(t)}),vC()),pC();let o=ds.get(t);o&&o.forEach(s=>rD(s,n))}async function rD(t,e){await t.setPayload(e||t.getPayload())}async function hv(t){let{apiHost:e,apiRequestHeaders:n}=t.getApiHosts(),i=t.getClientKey(),r="isRemoteEval"in t&&t.isRemoteEval(),a=sc(t),o=gv(t),s=wf.get(o);return s||(s=(r?us.fetchRemoteEvalCall({host:e,clientKey:i,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:n}):us.fetchFeaturesCall({host:e,clientKey:i,headers:n})).then(c=>{if(!c.ok)throw new Error(`HTTP error: ${c.status}`);return c.headers.get("x-sse-support")==="enabled"&&ps.add(a),c.json()}).then(c=>(yC(a,o,c),mv(t),wf.delete(o),{data:c,success:!0,source:"network"})).catch(c=>(wf.delete(o),{data:null,source:"error",success:!1,error:c})),wf.set(o,s)),s}function mv(t,e=!1){let n=sc(t),i=gv(t),{streamingHost:r,streamingHostRequestHeaders:a}=t.getApiHosts(),o=t.getClientKey();if(e&&ps.add(n),Ct.backgroundSync&&ps.has(n)&&ai.EventSource){if(fs.has(n))return;let s={src:null,host:r,clientKey:o,headers:a,cb:l=>{try{if(l.type==="features-updated"){let c=ds.get(n);c&&c.forEach(u=>{hv(u)})}else if(l.type==="features"){let c=JSON.parse(l.data);yC(n,i,c)}s.errors=0}catch{bC(s)}},errors:0,state:"active"};fs.set(n,s),yv(s)}}function bC(t){if(t.state!=="idle"&&(t.errors++,t.errors>3||t.src&&t.src.readyState===2)){let e=Math.pow(3,t.errors-3)*(1e3+Math.random()*1e3);vv(t),setTimeout(()=>{["idle","active"].includes(t.state)||yv(t)},Math.min(e,3e5))}}function vv(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function yv(t){t.src=us.eventSourceCall({host:t.host,clientKey:t.clientKey,headers:t.headers}),t.state="active",t.src.addEventListener("features",t.cb),t.src.addEventListener("features-updated",t.cb),t.src.onerror=()=>bC(t),t.src.onopen=()=>{t.errors=0}}function aD(t,e){vv(t),fs.delete(e)}function bv(){ps.clear(),fs.forEach(aD),ds.clear(),us.stopIdleListener()}function Ef(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&mv(t,!0),JN(t)}}var oD=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,xv={revert:function(){}},kf=new Map,wv=new Set;function sD(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function Rf(t){var e=kf.get(t);return e||(e={element:t,attributes:{}},kf.set(t,e)),e}function Of(t,e,n,i,r){var a=n(t),o={isDirty:!1,originalValue:a,virtualValue:a,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&o._positionTimeout)){e==="position"&&(o._positionTimeout=setTimeout(function(){o._positionTimeout=null},1e3));var s=n(t);e==="position"&&s.parentNode===o.virtualValue.parentNode&&s.insertBeforeNode===o.virtualValue.insertBeforeNode||s!==o.virtualValue&&(o.originalValue=s,r(o))}}),mutationRunner:r,setValue:i,getCurrentValue:n};return e==="position"&&t.parentNode?o.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):o.observer.observe(t,sD(e)),o}function Mf(t,e){var n=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!n||t.parentNode!==n.parentNode||t.insertBeforeNode!==n.insertBeforeNode)&&(e.isDirty=!0,_C()):t!==n&&(e.isDirty=!0,_C())}function lD(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),Mf(xD(e),t)}function cD(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(n){return n.mutate(e)}),Mf(Array.from(e).filter(Boolean).join(" "),t)}function uD(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),Mf(e,t)}function dD(t){var e=t.parentSelector,n=t.insertBeforeSelector,i=document.querySelector(e);if(!i)return null;var r=n?document.querySelector(n):null;return n&&!r?null:{parentNode:i,insertBeforeNode:r}}function fD(t){var e=t.originalValue;t.mutations.forEach(function(n){var i=n.mutate(),r=dD(i);e=r||e}),Mf(e,t)}var pD=function(e){return e.innerHTML},hD=function(e,n){return e.innerHTML=n};function xC(t){var e=Rf(t);return e.html||(e.html=Of(t,"html",pD,hD,lD)),e.html}var gD=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},mD=function(e,n){n.insertBeforeNode&&!n.parentNode.contains(n.insertBeforeNode)||n.parentNode.insertBefore(e,n.insertBeforeNode)};function wC(t){var e=Rf(t);return e.position||(e.position=Of(t,"position",gD,mD,fD)),e.position}var vD=function(e,n){return n?e.className=n:e.removeAttribute("class")},yD=function(e){return e.className};function EC(t){var e=Rf(t);return e.classes||(e.classes=Of(t,"class",yD,vD,cD)),e.classes}var bD=function(e){return function(n){var i;return(i=n.getAttribute(e))!=null?i:null}},_D=function(e){return function(n,i){return i!==null?n.setAttribute(e,i):n.removeAttribute(e)}};function CC(t,e){var n=Rf(t);return n.attributes[e]||(n.attributes[e]=Of(t,e,bD(e),_D(e),uD)),n.attributes[e]}function SD(t,e){var n=kf.get(t);if(n)if(e==="html"){var i,r;(i=n.html)==null||(r=i.observer)==null||r.disconnect(),delete n.html}else if(e==="class"){var a,o;(a=n.classes)==null||(o=a.observer)==null||o.disconnect(),delete n.classes}else if(e==="position"){var s,l;(s=n.position)==null||(l=s.observer)==null||l.disconnect(),delete n.position}else{var c,u,f;(c=n.attributes)==null||(u=c[e])==null||(f=u.observer)==null||f.disconnect(),delete n.attributes[e]}}var Cf;function xD(t){return Cf||(Cf=document.createElement("div")),Cf.innerHTML=t,Cf.innerHTML}function Af(t,e,n){if(n.isDirty){n.isDirty=!1;var i=n.virtualValue;n.mutations.length||SD(t,e),n.setValue(t,i)}}function wD(t,e){t.html&&Af(e,"html",t.html),t.classes&&Af(e,"class",t.classes),t.position&&Af(e,"position",t.position),Object.keys(t.attributes).forEach(function(n){Af(e,n,t.attributes[n])})}function _C(){kf.forEach(wD)}function ED(t,e){var n=null;t.kind==="html"?n=xC(e):t.kind==="class"?n=EC(e):t.kind==="attribute"?n=CC(e,t.attribute):t.kind==="position"&&(n=wC(e)),n&&(n.mutations.push(t),n.mutationRunner(n))}function CD(t,e){var n=null;if(t.kind==="html"?n=xC(e):t.kind==="class"?n=EC(e):t.kind==="attribute"?n=CC(e,t.attribute):t.kind==="position"&&(n=wC(e)),!!n){var i=n.mutations.indexOf(t);i!==-1&&n.mutations.splice(i,1),n.mutationRunner(n)}}function AC(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),n=document.querySelectorAll(t.selector);n.forEach(function(i){e.has(i)||(t.elements.add(i),ED(t,i))})}}function AD(t){t.elements.forEach(function(e){return CD(t,e)}),t.elements.clear(),wv.delete(t)}function SC(){wv.forEach(AC)}var _v;function TD(){typeof document>"u"||(_v||(_v=new MutationObserver(function(){SC()})),SC(),_v.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}TD();function Nf(t){return typeof document>"u"?xv:(wv.add(t),AC(t),{revert:function(){AD(t)}})}function Sv(t,e){return Nf({kind:"html",elements:new Set,mutate:e,selector:t})}function TC(t,e){return Nf({kind:"position",elements:new Set,mutate:e,selector:t})}function lc(t,e){return Nf({kind:"class",elements:new Set,mutate:e,selector:t})}function Tf(t,e,n){return oD.test(e)?e==="class"||e==="className"?lc(t,function(i){var r=n(Array.from(i).join(" "));i.clear(),r&&r.split(/\s+/g).filter(Boolean).forEach(function(a){return i.add(a)})}):Nf({kind:"attribute",attribute:e,elements:new Set,mutate:n,selector:t}):xv}function kD(t){var e=t.selector,n=t.action,i=t.value,r=t.attribute,a=t.parentSelector,o=t.insertBeforeSelector;if(r==="html"){if(n==="append")return Sv(e,function(s){return s+(i??"")});if(n==="set")return Sv(e,function(){return i??""})}else if(r==="class"){if(n==="append")return lc(e,function(s){i&&s.add(i)});if(n==="remove")return lc(e,function(s){i&&s.delete(i)});if(n==="set")return lc(e,function(s){s.clear(),i&&s.add(i)})}else if(r==="position"){if(n==="set"&&a)return TC(e,function(){return{insertBeforeSelector:o,parentSelector:a}})}else{if(n==="append")return Tf(e,r,function(s){return s!==null?s+(i??""):i??""});if(n==="set")return Tf(e,r,function(){return i??""});if(n==="remove")return Tf(e,r,function(){return null})}return xv}var RD={html:Sv,classes:lc,attribute:Tf,position:TC,declarative:kD},kC=RD;var Ev={};function Ur(t,e,n){n=n||{};for(let[i,r]of Object.entries(e))switch(i){case"$or":if(!MC(t,r,n))return!1;break;case"$nor":if(MC(t,r,n))return!1;break;case"$and":if(!LD(t,r,n))return!1;break;case"$not":if(Ur(t,r,n))return!1;break;default:if(!cc(r,OD(t,i),n))return!1}return!0}function OD(t,e){let n=e.split("."),i=t;for(let r=0;r<n.length;r++)if(i&&typeof i=="object"&&n[r]in i)i=i[n[r]];else return null;return i}function RC(t,e=!1){let n=`${t}${e?"/i":""}`;return Ev[n]||(Ev[n]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),Ev[n]}function cc(t,e,n,i=!1){if(typeof t=="string")return i?String(e).toLowerCase()===t.toLowerCase():e+""===t;if(typeof t=="number")return e*1===t;if(typeof t=="boolean")return e!==null&&!!e===t;if(t===null)return e===null;if(Array.isArray(t)||!NC(t))return JSON.stringify(e)===JSON.stringify(t);for(let r in t)if(!DD(r,e,t[r],n))return!1;return!0}function NC(t){let e=Object.keys(t);return e.length>0&&e.filter(n=>n[0]==="$").length===e.length}function MD(t){if(t===null)return"null";if(Array.isArray(t))return"array";let e=typeof t;return["string","number","boolean","object","undefined"].includes(e)?e:"unknown"}function ND(t,e,n){if(!Array.isArray(t))return!1;let i=NC(e)?r=>cc(e,r,n):r=>Ur(r,e,n);for(let r=0;r<t.length;r++)if(t[r]&&i(t[r]))return!0;return!1}function hs(t,e,n=!1){if(n){let i=r=>typeof r=="string"?r.toLowerCase():r;return Array.isArray(t)?t.some(r=>e.some(a=>i(r)===i(a))):e.some(r=>i(t)===i(r))}return Array.isArray(t)?t.some(i=>e.includes(i)):e.includes(t)}function OC(t,e,n,i=!1){if(!Array.isArray(t))return!1;for(let r=0;r<e.length;r++){let a=!1;for(let o=0;o<t.length;o++)if(cc(e[r],t[o],n,i)){a=!0;break}if(!a)return!1}return!0}function DD(t,e,n,i){switch(t){case"$veq":return un(e)===un(n);case"$vne":return un(e)!==un(n);case"$vgt":return un(e)>un(n);case"$vgte":return un(e)>=un(n);case"$vlt":return un(e)<un(n);case"$vlte":return un(e)<=un(n);case"$eq":return e===n;case"$ne":return e!==n;case"$lt":return e<n;case"$lte":return e<=n;case"$gt":return e>n;case"$gte":return e>=n;case"$exists":return n?e!=null:e==null;case"$in":return Array.isArray(n)?hs(e,n):!1;case"$ini":return Array.isArray(n)?hs(e,n,!0):!1;case"$inGroup":return hs(e,i[n]||[]);case"$notInGroup":return!hs(e,i[n]||[]);case"$nin":return Array.isArray(n)?!hs(e,n):!1;case"$nini":return Array.isArray(n)?!hs(e,n,!0):!1;case"$not":return!cc(n,e,i);case"$size":return Array.isArray(e)?cc(n,e.length,i):!1;case"$elemMatch":return ND(e,n,i);case"$all":return Array.isArray(n)?OC(e,n,i):!1;case"$alli":return Array.isArray(n)?OC(e,n,i,!0):!1;case"$regex":try{return RC(n).test(e)}catch{return!1}case"$regexi":try{return RC(n,!0).test(e)}catch{return!1}case"$type":return MD(e)===n;default:return console.error("Unknown operator: "+t),!1}}function MC(t,e,n){if(!e.length)return!0;for(let i=0;i<e.length;i++)if(Ur(t,e[i],n))return!0;return!1}function LD(t,e,n){for(let i=0;i<e.length;i++)if(!Ur(t,e[i],n))return!1;return!0}var HD="Feature Evaluated",ID="Experiment Viewed";function zD(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),e}function BD(t){return t.global.forcedVariations&&t.user.forcedVariations?{...t.global.forcedVariations,...t.user.forcedVariations}:t.global.forcedVariations?t.global.forcedVariations:t.user.forcedVariations?t.user.forcedVariations:{}}async function gs(t){try{await t()}catch{}}function DC(t,e,n){if(t.user.trackedExperiments){let r=Hf(e,n);if(t.user.trackedExperiments.has(r))return[];t.user.trackedExperiments.add(r)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:n,timestamp:Date.now().toString(),logType:"experiment"});let i=[];if(t.global.trackingCallback){let r=t.global.trackingCallback;i.push(gs(()=>r(e,n,t.user)))}if(t.user.trackingCallback){let r=t.user.trackingCallback;i.push(gs(()=>r(e,n)))}if(t.global.eventLogger){let r=t.global.eventLogger;i.push(gs(()=>r(ID,{experimentId:e.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},t.user)))}return i}function $D(t,e,n){if(t.user.trackedFeatureUsage){let i=JSON.stringify(n.value);if(t.user.trackedFeatureUsage[e]===i)return;t.user.trackedFeatureUsage[e]=i,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:n,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let i=t.global.onFeatureUsage;gs(()=>i(e,n,t.user))}if(t.user.onFeatureUsage){let i=t.user.onFeatureUsage;gs(()=>i(e,n))}if(t.global.eventLogger){let i=t.global.eventLogger;gs(()=>i(HD,{feature:e,source:n.source,value:n.value,ruleId:n.source==="defaultValue"?"$default":n.ruleId||"",variationId:n.experimentResult?n.experimentResult.key:""},t.user))}}function Df(t,e){if(e.stack.evaluatedFeatures.has(t))return Vr(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let n=zD(e);if(n.has(t))return Vr(e,t,n.get(t),"override");if(!e.global.features||!e.global.features[t])return Vr(e,t,null,"unknownFeature");let i=e.global.features[t];if(i.rules){let r=new Set(e.stack.evaluatedFeatures);e:for(let a of i.rules){if(a.parentConditions)for(let l of a.parentConditions){e.stack.evaluatedFeatures=new Set(r);let c=Df(l.id,e);if(c.source==="cyclicPrerequisite")return Vr(e,t,null,"cyclicPrerequisite");let u={value:c.value};if(!Ur(u,l.condition||{})){if(l.gate)return Vr(e,t,null,"prerequisite");continue e}}if(a.filters&&IC(a.filters,e))continue;if("force"in a){if(a.condition&&!HC(a.condition,e)||!FD(e,a.seed||t,a.hashAttribute,e.user.saveStickyBucketAssignmentDoc&&!a.disableStickyBucketing?a.fallbackAttribute:void 0,a.range,a.coverage,a.hashVersion))continue;return a.tracks&&a.tracks.forEach(l=>{!DC(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),Vr(e,t,a.force,"force",a.id)}if(!a.variations)continue;let o={variations:a.variations,key:a.key||t};"coverage"in a&&(o.coverage=a.coverage),a.weights&&(o.weights=a.weights),a.hashAttribute&&(o.hashAttribute=a.hashAttribute),a.fallbackAttribute&&(o.fallbackAttribute=a.fallbackAttribute),a.disableStickyBucketing&&(o.disableStickyBucketing=a.disableStickyBucketing),a.bucketVersion!==void 0&&(o.bucketVersion=a.bucketVersion),a.minBucketVersion!==void 0&&(o.minBucketVersion=a.minBucketVersion),a.namespace&&(o.namespace=a.namespace),a.meta&&(o.meta=a.meta),a.ranges&&(o.ranges=a.ranges),a.name&&(o.name=a.name),a.phase&&(o.phase=a.phase),a.seed&&(o.seed=a.seed),a.hashVersion&&(o.hashVersion=a.hashVersion),a.filters&&(o.filters=a.filters),a.condition&&(o.condition=a.condition);let{result:s}=Lf(o,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(o,s),s.inExperiment&&!s.passthrough)return Vr(e,t,s.value,"experiment",a.id,o,s)}}return Vr(e,t,i.defaultValue===void 0?null:i.defaultValue,"defaultValue")}function Lf(t,e,n){let i=t.key,r=t.variations.length;if(r<2)return{result:Fe(n,t,-1,!1,e)};if(n.global.enabled===!1||n.user.enabled===!1)return{result:Fe(n,t,-1,!1,e)};if(t=UD(t,n),t.urlPatterns&&!_f(n.user.url||"",t.urlPatterns))return{result:Fe(n,t,-1,!1,e)};let a=lC(i,n.user.url||"",r);if(a!==null)return{result:Fe(n,t,a,!1,e)};let o=BD(n);if(i in o){let w=o[i];return{result:Fe(n,t,w,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:Fe(n,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=La(n,t.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:Fe(n,t,-1,!1,e)};let c=-1,u=!1,f=!1;if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:w,versionIsBlocked:d}=qD({ctx:n,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});u=w>=0,c=w,f=!!d}if(!u){if(t.filters){if(IC(t.filters,n))return{result:Fe(n,t,-1,!1,e)}}else if(t.namespace&&!aC(l,t.namespace))return{result:Fe(n,t,-1,!1,e)};if(t.include&&!cC(t.include))return{result:Fe(n,t,-1,!1,e)};if(t.condition&&!HC(t.condition,n))return{result:Fe(n,t,-1,!1,e)};if(t.parentConditions){let w=new Set(n.stack.evaluatedFeatures);for(let d of t.parentConditions){n.stack.evaluatedFeatures=new Set(w);let p=Df(d.id,n);if(p.source==="cyclicPrerequisite")return{result:Fe(n,t,-1,!1,e)};let m={value:p.value};if(!Ur(m,d.condition||{}))return{result:Fe(n,t,-1,!1,e)}}}if(t.groups&&!jD(t.groups,n))return{result:Fe(n,t,-1,!1,e)}}if(t.url&&!VD(t.url,n))return{result:Fe(n,t,-1,!1,e)};let h=ac(t.seed||i,l,t.hashVersion||1);if(h===null)return{result:Fe(n,t,-1,!1,e)};if(!u){let w=t.ranges||sC(r,t.coverage===void 0?1:t.coverage,t.weights);c=oC(h,w)}if(f)return{result:Fe(n,t,-1,!1,e,void 0,!0)};if(c<0)return{result:Fe(n,t,-1,!1,e)};if("force"in t)return{result:Fe(n,t,t.force===void 0?-1:t.force,!1,e)};if(n.global.qaMode||n.user.qaMode)return{result:Fe(n,t,-1,!1,e)};if(t.status==="stopped")return{result:Fe(n,t,-1,!1,e)};let g=Fe(n,t,c,!0,e,h,u);if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:w,key:d,doc:p}=GD(n,s,oc(l),{[Cv(t.key,t.bucketVersion)]:g.key});w&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[d]=p,n.user.saveStickyBucketAssignmentDoc(p))}let _=DC(n,t,g);_.length===0&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:t,result:g});let b=_.length?_.length===1?_[0]:Promise.all(_).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&n.global.recordChangeId&&n.global.recordChangeId(t.changeId),{result:g,trackingCall:b}}function Vr(t,e,n,i,r,a,o){let s={value:n,on:!!n,off:!n,source:i,ruleId:r||""};return a&&(s.experiment=a),o&&(s.experimentResult=o),i!=="override"&&$D(t,e,s),s}function LC(t){return{...t.user.attributes,...t.user.attributeOverrides}}function HC(t,e){return Ur(LC(e),t,e.global.savedGroups||{})}function IC(t,e){return t.some(n=>{let{hashValue:i}=La(e,n.attribute);if(!i)return!0;let r=ac(n.seed,i,n.hashVersion||2);return r===null?!0:!n.ranges.some(a=>bf(r,a))})}function FD(t,e,n,i,r,a,o){if(!r&&a===void 0)return!0;if(!r&&a===0)return!1;let{hashValue:s}=La(t,n,i);if(!s)return!1;let l=ac(e,s,o||1);return l===null?!1:r?bf(l,r):a!==void 0?l<=a:!0}function Fe(t,e,n,i,r,a,o){let s=!0;(n<0||n>=e.variations.length)&&(n=0,s=!1);let{hashAttribute:l,hashValue:c}=La(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),u=e.meta?e.meta[n]:{},f={key:u.key||""+n,featureId:r,inExperiment:s,hashUsed:i,variationId:n,value:e.variations[n],hashAttribute:l,hashValue:c,stickyBucketUsed:!!o};return u.name&&(f.name=u.name),a!==void 0&&(f.bucket=a),u.passthrough&&(f.passthrough=u.passthrough),f}function UD(t,e){let n=t.key,i=e.global.overrides;return i&&i[n]&&(t=Object.assign({},t,i[n]),typeof t.url=="string"&&(t.url=pv(t.url))),t}function La(t,e,n){let i=e||"id",r="",a=LC(t);return a[i]&&(r=a[i]),!r&&n&&(a[n]&&(r=a[n]),r&&(i=n)),{hashAttribute:i,hashValue:r}}function VD(t,e){let n=e.user.url;if(!n)return!1;let i=n.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(n)||t.test(i))}function jD(t,e){let n=e.global.groups||{};for(let i=0;i<t.length;i++)if(n[t[i]])return!0;return!1}function qD({ctx:t,expKey:e,expBucketVersion:n,expHashAttribute:i,expFallbackAttribute:r,expMinBucketVersion:a,expMeta:o}){n=n||0,a=a||0,i=i||"id",o=o||[];let s=Cv(e,n),l=PD(t,i,r);if(a>0)for(let f=0;f<a;f++){let h=Cv(e,f);if(l[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let c=l[s];if(c===void 0)return{variation:-1};let u=o.findIndex(f=>f.key===c);return u<0?{variation:-1}:{variation:u}}function Cv(t,e){return e=e||0,`${t}__${e}`}function Av(t,e){return`${t}||${e}`}function PD(t,e,n){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:i,hashValue:r}=La(t,e),a=Av(i,oc(r)),{hashAttribute:o,hashValue:s}=La(t,n),l=s?Av(o,oc(s)):null,c={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[a]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[a].assignments||{}),c}function GD(t,e,n,i){let r=Av(e,n),a=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[r]?t.user.stickyBucketAssignmentDocs[r].assignments||{}:{},o={...a,...i},s=JSON.stringify(a)!==JSON.stringify(o);return{key:r,doc:{attributeName:e,attributeValue:n,assignments:o},changed:s}}function ZD(t,e){let n=new Set,i=e&&e.features?e.features:t.global.features||{},r=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(i).forEach(a=>{let o=i[a];if(o.rules)for(let s of o.rules)s.variations&&(n.add(s.hashAttribute||"id"),s.fallbackAttribute&&n.add(s.fallbackAttribute))}),r.map(a=>{n.add(a.hashAttribute||"id"),a.fallbackAttribute&&n.add(a.fallbackAttribute)}),Array.from(n)}async function zC(t,e,n){let i=Tv(t,n);return e.getAllAssignments(i)}function Tv(t,e){let n={};return ZD(t,e).forEach(r=>{let{hashValue:a}=La(t,r);n[r]=oc(a)}),n}async function BC(t,e,n){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await Da(t.encryptedFeatures,e,n))}catch(i){console.error(i)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await Da(t.encryptedExperiments,e,n))}catch(i){console.error(i)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await Da(t.encryptedSavedGroups,e,n))}catch(i){console.error(i)}delete t.encryptedSavedGroups}return t}function $C(t){let e=t.apiHost||"https://cdn.growthbook.io";return{apiHost:e.replace(/\/*$/,""),streamingHost:(t.streamingHost||e).replace(/\/*$/,""),apiRequestHeaders:t.apiHostRequestHeaders,streamingHostRequestHeaders:t.streamingHostRequestHeaders}}function Hf(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var ms=typeof window<"u"&&typeof document<"u",YD=uC(),uc=class{constructor(e){if(e=e||{},this.version=YD,this._options=this.context=e,this._renderer=e.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!e.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl="",this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!e.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._onExperimentEval=this._onExperimentEval.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),e.remoteEval){if(e.decryptionKey)throw new Error("Encryption is not available for remoteEval");if(!e.clientKey)throw new Error("Missing clientKey");let n=!1;try{n=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(n)throw new Error("Cannot use remoteEval on GrowthBook Cloud")}else if(e.cacheKeyAttributes)throw new Error("cacheKeyAttributes are only used for remoteEval");if(e.stickyBucketService){let n=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=i=>n.saveAssignments(i)}if(e.plugins)for(let n of e.plugins)n(this);if(e.features&&(this.ready=!0),ms&&e.enableDevMode&&(window._growthbook=this,document.dispatchEvent(new Event("gbloaded"))),e.experiments&&(this.ready=!0,this._updateAllAutoExperiments()),this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let n in this._options.stickyBucketAssignmentDocs){let i=this._options.stickyBucketAssignmentDocs[n];i&&this._options.stickyBucketService.saveAssignments(i).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let n=await BC(e,this._options.decryptionKey);this._decryptedPayload=n,await this.refreshStickyBuckets(n),n.features&&(this._options.features=n.features),n.savedGroups&&(this._options.savedGroups=n.savedGroups),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let n=e.payload;if(n.encryptedExperiments||n.encryptedFeatures)throw new Error("initSync does not support encrypted payloads");return this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs&&(this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,n)),this._payload=n,this._decryptedPayload=n,n.features&&(this._options.features=n.features),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,Ef(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&hC(e.cacheSettings),e.payload)return await this.setPayload(e.payload),Ef(this,e),{success:!0,source:"init"};{let{data:n,...i}=await this._refresh({...e,allowStale:!0});return Ef(this,e),await this.setPayload(n||{}),i}}async loadFeatures(e){e=e||{},await this.init({skipCache:e.skipCache,timeout:e.timeout,streaming:(this._options.backgroundSync??!0)&&(e.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(e){let n=await this._refresh({...e||{},allowStale:!1});n.data&&await this.setPayload(n.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return $C(this._options)}getClientKey(){return this._options.clientKey||""}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh({timeout:e,skipCache:n,allowStale:i,streaming:r}){if(!this._options.clientKey)throw new Error("Missing clientKey");return gC({instance:this,timeout:e,skipCache:n||this._options.disableCache,allowStale:i,backgroundSync:r??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(e){console.error("Failed to render",e)}}setFeatures(e){this._options.features=e,this.ready=!0,this._render()}async setEncryptedFeatures(e,n,i){let r=await Da(e,n||this._options.decryptionKey,i);this.setFeatures(JSON.parse(r))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,n,i){let r=await Da(e,n||this._options.decryptionKey,i);this.setExperiments(JSON.parse(r))}async setAttributes(e){if(this._options.attributes=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(e){return this.setAttributes({...this._options.attributes,...e})}async setAttributeOverrides(e){if(this._options.attributeOverrides=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(e){if(this._options.forcedVariations=e||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(e){this._options.forcedFeatureValues=e,this._render()}async setURL(e){if(e!==this._options.url){if(this._options.url=e,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(e){return this._subscriptions.add(e),()=>{this._subscriptions.delete(e)}}async _refreshForRemoteEval(){if(!this._options.remoteEval||!this._initialized)return;let e=await this._refresh({allowStale:!1});e.data&&await this.setPayload(e.data)}getAllResults(){return new Map(this._assigned)}onDestroy(e){this._destroyCallbacks.push(e)}isDestroyed(){return!!this._destroyed}destroy(e){e=e||{},this._destroyed=!0,this._destroyCallbacks.forEach(n=>{try{n()}catch(i){console.error(i)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,mC(this),e.destroyAllStreams&&bv(),this.logs=[],ms&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(n=>{n.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,n){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=n,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:n}=Lf(e,null,this._getEvalContext());return this._onExperimentEval(e,n),n}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(i=>i.key===e).map(i=>this._runAutoExperiment(i)).filter(i=>i!==null):null}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._onExperimentEval,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(e,n){let i=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!i)return null;let r=this._isAutoExperimentBlockedByContext(e),a,o;r?a=Fe(this._getEvalContext(),e,-1,!1,""):({result:a,trackingCall:o}=Lf(e,null,this._getEvalContext()),this._onExperimentEval(e,a));let s=JSON.stringify(a.value);if(!n&&a.inExperiment&&i&&i.valueHash===s)return a;if(i&&this._undoActiveAutoExperiment(e),a.inExperiment){let l=Sf(e);if(l==="redirect"&&a.value.urlRedirect&&e.urlPatterns){let c=e.persistQueryString?dC(this._getContextUrl(),a.value.urlRedirect):a.value.urlRedirect;if(_f(c,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),a;this._redirectedUrl=c;let{navigate:u,delay:f}=this._getNavigateFunction();if(u)if(ms)Promise.all([...o?[xf(o,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??f))]).then(()=>{try{u(c)}catch(h){console.error(h)}});else try{u(c)}catch(h){console.error(h)}}else if(l==="visual"){let c=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(a.value):this._applyDOMChanges(a.value);c&&this._activeAutoExperiments.set(e,{undo:c,valueHash:s})}}return a}_undoActiveAutoExperiment(e){let n=this._activeAutoExperiments.get(e);n&&(n.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let n=this._options.experiments||[],i=new Set(n);this._activeAutoExperiments.forEach((r,a)=>{i.has(a)||(r.undo(),this._activeAutoExperiments.delete(a))});for(let r of n){let a=this._runAutoExperiment(r,e);if(a&&a.inExperiment&&Sf(r)==="redirect")break}}_onExperimentEval(e,n){let i=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:n}),this._subscriptions.size>0&&this._fireSubscriptions(e,n,i)}_fireSubscriptions(e,n,i){(!i||i.result.inExperiment!==n.inExperiment||i.result.variationId!==n.variationId)&&this._subscriptions.forEach(r=>{try{r(e,n)}catch(a){console.error(a)}})}_recordChangedId(e){this._completedChangeIds.add(e)}isOn(e){return this.evalFeature(e).on}isOff(e){return this.evalFeature(e).off}getFeatureValue(e,n){let i=this.evalFeature(e).value;return i===null?n:i}feature(e){return this.evalFeature(e)}evalFeature(e){return Df(e,this._getEvalContext())}log(e,n){this.debug&&(this._options.log?this._options.log(e,n):console.log(e,n))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(n=>n&&n.experiment&&n.result).map(n=>[Hf(n.experiment,n.result),n]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(n=>{!n||!n.experiment||!n.result?console.error("Invalid deferred tracking call",{call:n}):e.push(this._options.trackingCallback(n.experiment,n.result))}),this._deferredTrackingCalls.clear(),await Promise.all(e)}setTrackingCallback(e){this._options.trackingCallback=e,this.fireDeferredTrackingCalls()}setEventLogger(e){this._options.eventLogger=e}async logEvent(e,n){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:n,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,n||{},this._getUserContext())}catch(i){console.error(i)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(Hf(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(ms?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let n=Sf(e);if(n==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(i=>i.js))return!0}else if(n==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let i=new URL(this._getContextUrl());for(let r of e.variations){if(!r||!r.urlRedirect)continue;let a=new URL(r.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(a.protocol!==i.protocol||a.host!==i.host))return!0}}catch(i){return this.log("Error parsing current or redirect URL",{id:e.key,error:i}),!0}}else return!0;return!!(e.changeId&&(this._options.blockedChangeIds||[]).includes(e.changeId))}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){return this._options.navigate?{navigate:this._options.navigate,delay:0}:ms?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!ms)return;let n=[];if(e.css){let i=document.createElement("style");i.innerHTML=e.css,document.head.appendChild(i),n.push(()=>i.remove())}if(e.js){let i=document.createElement("script");i.innerHTML=e.js,this._options.jsInjectionNonce&&(i.nonce=this._options.jsInjectionNonce),document.head.appendChild(i),n.push(()=>i.remove())}return e.domMutations&&e.domMutations.forEach(i=>{n.push(kC.declarative(i).revert)}),()=>{n.forEach(i=>i())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let n=this._getEvalContext(),i=await zC(n,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=i}}generateStickyBucketAssignmentDocsSync(e,n){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let i=this._getEvalContext(),r=Tv(i,n);return e.getAllAssignmentsSync(r)}inDevMode(){return!!this._options.enableDevMode}};var WD="https://experiment.syntrologie.com",kv=class{constructor(e={}){V(this,"gb");if(e.client)this.gb=e.client;else{let n=e.onExperimentViewed?(i,r)=>{e.onExperimentViewed(i.key,r.variationId,typeof r.value=="string"?r.value:`variation_${r.variationId}`)}:void 0;this.gb=new uc({...e,apiHost:e.apiHost??WD,enableDevMode:e.enableDevMode??!0,trackingCallback:n}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes(e)}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,n){return this.gb.getFeatureValue(e,n)}getAllFeatures(){let e=this.gb.getFeatures(),n={};for(let i of Object.keys(e))n[i]=this.gb.getFeatureValue(i,null);return n}shouldRenderRectangle(e){return!0}};function If(t={}){return new kv(t)}var FC="syntro_session_metrics",dc=class{constructor(e={}){V(this,"metrics",new Map);V(this,"experiments");V(this,"attributePrefix");V(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,n=1){let r=(this.metrics.get(e)??0)+n;return this.metrics.set(e,r),this.saveToStorage(),this.updateExperimentAttributes(e,r),this.onMetricChange?.(e,r),r}set(e,n){this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,n){return this.get(e)>=n}getAll(){return Object.fromEntries(this.metrics)}reset(e){this.metrics.delete(e),this.saveToStorage(),this.updateExperimentAttributes(e,0),this.onMetricChange?.(e,0)}resetAll(){let e=Array.from(this.metrics.keys());this.metrics.clear(),this.saveToStorage();let n={};for(let i of e)n[`${this.attributePrefix}${i}`]=0,this.onMetricChange?.(i,0);this.experiments?.setAttributes?.(n)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,n){if(!this.experiments?.setAttributes)return;let i=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[i]:n})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[n,i]of this.metrics)e[`${this.attributePrefix}${n}`]=i;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(FC);if(e){let n=JSON.parse(e);for(let[i,r]of Object.entries(n))this.metrics.set(i,r.count)}}catch(e){console.warn("[SessionMetricTracker] Failed to load from sessionStorage:",e)}}saveToStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e={};for(let[n,i]of this.metrics)e[n]={count:i,lastUpdated:Date.now()};sessionStorage.setItem(FC,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function zf(t={}){return new dc(t)}var y={};k_(y,{BRAND:()=>S4,DIRTY:()=>Ha,EMPTY_PATH:()=>JD,INVALID:()=>Y,NEVER:()=>aL,OK:()=>At,ParseStatus:()=>_t,Schema:()=>ae,ZodAny:()=>Pr,ZodArray:()=>Gi,ZodBigInt:()=>za,ZodBoolean:()=>Ba,ZodBranded:()=>pc,ZodCatch:()=>Wa,ZodDate:()=>$a,ZodDefault:()=>Ya,ZodDiscriminatedUnion:()=>Ff,ZodEffects:()=>Nn,ZodEnum:()=>Ga,ZodError:()=>Pt,ZodFirstPartyTypeKind:()=>K,ZodFunction:()=>Vf,ZodIntersection:()=>ja,ZodIssueCode:()=>N,ZodLazy:()=>qa,ZodLiteral:()=>Pa,ZodMap:()=>xs,ZodNaN:()=>Es,ZodNativeEnum:()=>Za,ZodNever:()=>Gn,ZodNull:()=>Ua,ZodNullable:()=>li,ZodNumber:()=>Ia,ZodObject:()=>Gt,ZodOptional:()=>On,ZodParsedType:()=>F,ZodPipeline:()=>hc,ZodPromise:()=>Gr,ZodReadonly:()=>Ka,ZodRecord:()=>Uf,ZodSchema:()=>ae,ZodSet:()=>ws,ZodString:()=>qr,ZodSymbol:()=>_s,ZodTransformer:()=>Nn,ZodTuple:()=>si,ZodType:()=>ae,ZodUndefined:()=>Fa,ZodUnion:()=>Va,ZodUnknown:()=>Pi,ZodVoid:()=>Ss,addIssueToContext:()=>H,any:()=>O4,array:()=>L4,bigint:()=>C4,boolean:()=>XC,coerce:()=>rL,custom:()=>YC,date:()=>A4,datetimeRegex:()=>GC,defaultErrorMap:()=>ji,discriminatedUnion:()=>B4,effect:()=>K4,enum:()=>Z4,function:()=>q4,getErrorMap:()=>vs,getParsedType:()=>oi,instanceof:()=>w4,intersection:()=>$4,isAborted:()=>Bf,isAsync:()=>ys,isDirty:()=>$f,isValid:()=>jr,late:()=>x4,lazy:()=>P4,literal:()=>G4,makeIssue:()=>fc,map:()=>V4,nan:()=>E4,nativeEnum:()=>Y4,never:()=>N4,null:()=>R4,nullable:()=>Q4,number:()=>KC,object:()=>H4,objectUtil:()=>Rv,oboolean:()=>iL,onumber:()=>nL,optional:()=>X4,ostring:()=>tL,pipeline:()=>eL,preprocess:()=>J4,promise:()=>W4,quotelessJson:()=>KD,record:()=>U4,set:()=>j4,setErrorMap:()=>QD,strictObject:()=>I4,string:()=>WC,symbol:()=>T4,transformer:()=>K4,tuple:()=>F4,undefined:()=>k4,union:()=>z4,unknown:()=>M4,util:()=>ce,void:()=>D4});var ce;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{let a={};for(let o of r)a[o]=o;return a},t.getValidEnumValues=r=>{let a=t.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),o={};for(let s of a)o[s]=r[s];return t.objectValues(o)},t.objectValues=r=>t.objectKeys(r).map(function(a){return r[a]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let a=[];for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&a.push(o);return a},t.find=(r,a)=>{for(let o of r)if(a(o))return o},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,a=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}t.joinValues=i,t.jsonStringifyReplacer=(r,a)=>typeof a=="bigint"?a.toString():a})(ce||(ce={}));var Rv;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Rv||(Rv={}));var F=ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),oi=t=>{switch(typeof t){case"undefined":return F.undefined;case"string":return F.string;case"number":return Number.isNaN(t)?F.nan:F.number;case"boolean":return F.boolean;case"function":return F.function;case"bigint":return F.bigint;case"symbol":return F.symbol;case"object":return Array.isArray(t)?F.array:t===null?F.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?F.promise:typeof Map<"u"&&t instanceof Map?F.map:typeof Set<"u"&&t instanceof Set?F.set:typeof Date<"u"&&t instanceof Date?F.date:F.object;default:return F.unknown}};var N=ce.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),KD=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Pt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(a){return a.message},i={_errors:[]},r=a=>{for(let o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)i._errors.push(n(o));else{let s=i,l=0;for(;l<o.path.length;){let c=o.path[l];l===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(o))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return r(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},i=[];for(let r of this.issues)if(r.path.length>0){let a=r.path[0];n[a]=n[a]||[],n[a].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Pt.create=t=>new Pt(t);var XD=(t,e)=>{let n;switch(t.code){case N.invalid_type:t.received===F.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ce.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:n=`Unrecognized key(s) in object: ${ce.joinValues(t.keys,", ")}`;break;case N.invalid_union:n="Invalid input";break;case N.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ce.joinValues(t.options)}`;break;case N.invalid_enum_value:n=`Invalid enum value. Expected ${ce.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:n="Invalid function arguments";break;case N.invalid_return_type:n="Invalid function return type";break;case N.invalid_date:n="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ce.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case N.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case N.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case N.custom:n="Invalid input";break;case N.invalid_intersection_types:n="Intersection results could not be merged";break;case N.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:n="Number must be finite";break;default:n=e.defaultError,ce.assertNever(t)}return{message:n}},ji=XD;var UC=ji;function QD(t){UC=t}function vs(){return UC}var fc=t=>{let{data:e,path:n,errorMaps:i,issueData:r}=t,a=[...n,...r.path||[]],o={...r,path:a};if(r.message!==void 0)return{...r,path:a,message:r.message};let s="",l=i.filter(c=>!!c).slice().reverse();for(let c of l)s=c(o,{data:e,defaultError:s}).message;return{...r,path:a,message:s}},JD=[];function H(t,e){let n=vs(),i=fc({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ji?void 0:ji].filter(r=>!!r)});t.common.issues.push(i)}var _t=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let i=[];for(let r of n){if(r.status==="aborted")return Y;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){let i=[];for(let r of n){let a=await r.key,o=await r.value;i.push({key:a,value:o})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,n){let i={};for(let r of n){let{key:a,value:o}=r;if(a.status==="aborted"||o.status==="aborted")return Y;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(i[a.value]=o.value)}return{status:e.value,value:i}}},Y=Object.freeze({status:"aborted"}),Ha=t=>({status:"dirty",value:t}),At=t=>({status:"valid",value:t}),Bf=t=>t.status==="aborted",$f=t=>t.status==="dirty",jr=t=>t.status==="valid",ys=t=>typeof Promise<"u"&&t instanceof Promise;var q;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(q||(q={}));var Mn=class{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},VC=(t,e)=>{if(jr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Pt(t.common.issues);return this._error=n,this._error}}};function re(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(o,s)=>{let{message:l}=t;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??i??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:r}}var ae=class{get description(){return this._def.description}_getType(e){return oi(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:oi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new _t,ctx:{common:e.parent.common,data:e.data,parsedType:oi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(ys(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:oi(e)},r=this._parseSync({data:e,path:i.path,parent:i});return VC(i,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:oi(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:n});return jr(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>jr(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){let i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:oi(e)},r=this._parse({data:e,path:i.path,parent:i}),a=await(ys(r)?r:Promise.resolve(r));return VC(i,a)}refine(e,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,a)=>{let o=e(r),s=()=>a.addIssue({code:N.custom,...i(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new Nn({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return On.create(this,this._def)}nullable(){return li.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Gi.create(this)}promise(){return Gr.create(this,this._def)}or(e){return Va.create([this,e],this._def)}and(e){return ja.create(this,e,this._def)}transform(e){return new Nn({...re(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Ya({...re(this._def),innerType:this,defaultValue:n,typeName:K.ZodDefault})}brand(){return new pc({typeName:K.ZodBranded,type:this,...re(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Wa({...re(this._def),innerType:this,catchValue:n,typeName:K.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return hc.create(this,e)}readonly(){return Ka.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},e4=/^c[^\s-]{8,}$/i,t4=/^[0-9a-z]+$/,n4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,i4=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,r4=/^[a-z0-9_-]{21}$/i,a4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,o4=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,s4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,l4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ov,c4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,u4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,d4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,f4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,p4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,h4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qC="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",g4=new RegExp(`^${qC}$`);function PC(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function m4(t){return new RegExp(`^${PC(t)}$`)}function GC(t){let e=`${qC}T${PC(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function v4(t,e){return!!((e==="v4"||!e)&&c4.test(t)||(e==="v6"||!e)&&d4.test(t))}function y4(t,e){if(!a4.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function b4(t,e){return!!((e==="v4"||!e)&&u4.test(t)||(e==="v6"||!e)&&f4.test(t))}var qr=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==F.string){let a=this._getOrReturnCtx(e);return H(a,{code:N.invalid_type,expected:F.string,received:a.parsedType}),Y}let i=new _t,r;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:N.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),i.dirty());else if(a.kind==="max")e.data.length>a.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:N.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),i.dirty());else if(a.kind==="length"){let o=e.data.length>a.value,s=e.data.length<a.value;(o||s)&&(r=this._getOrReturnCtx(e,r),o?H(r,{code:N.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&H(r,{code:N.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),i.dirty())}else if(a.kind==="email")s4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"email",code:N.invalid_string,message:a.message}),i.dirty());else if(a.kind==="emoji")Ov||(Ov=new RegExp(l4,"u")),Ov.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"emoji",code:N.invalid_string,message:a.message}),i.dirty());else if(a.kind==="uuid")i4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"uuid",code:N.invalid_string,message:a.message}),i.dirty());else if(a.kind==="nanoid")r4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"nanoid",code:N.invalid_string,message:a.message}),i.dirty());else if(a.kind==="cuid")e4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"cuid",code:N.invalid_string,message:a.message}),i.dirty());else if(a.kind==="cuid2")t4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"cuid2",code:N.invalid_string,message:a.message}),i.dirty());else if(a.kind==="ulid")n4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"ulid",code:N.invalid_string,message:a.message}),i.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),H(r,{validation:"url",code:N.invalid_string,message:a.message}),i.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"regex",code:N.invalid_string,message:a.message}),i.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(e,r),H(r,{code:N.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),i.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(r=this._getOrReturnCtx(e,r),H(r,{code:N.invalid_string,validation:{startsWith:a.value},message:a.message}),i.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(r=this._getOrReturnCtx(e,r),H(r,{code:N.invalid_string,validation:{endsWith:a.value},message:a.message}),i.dirty()):a.kind==="datetime"?GC(a).test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:N.invalid_string,validation:"datetime",message:a.message}),i.dirty()):a.kind==="date"?g4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:N.invalid_string,validation:"date",message:a.message}),i.dirty()):a.kind==="time"?m4(a).test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:N.invalid_string,validation:"time",message:a.message}),i.dirty()):a.kind==="duration"?o4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"duration",code:N.invalid_string,message:a.message}),i.dirty()):a.kind==="ip"?v4(e.data,a.version)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"ip",code:N.invalid_string,message:a.message}),i.dirty()):a.kind==="jwt"?y4(e.data,a.alg)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"jwt",code:N.invalid_string,message:a.message}),i.dirty()):a.kind==="cidr"?b4(e.data,a.version)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"cidr",code:N.invalid_string,message:a.message}),i.dirty()):a.kind==="base64"?p4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"base64",code:N.invalid_string,message:a.message}),i.dirty()):a.kind==="base64url"?h4.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"base64url",code:N.invalid_string,message:a.message}),i.dirty()):ce.assertNever(a);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:N.invalid_string,...q.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...q.errToObj(e)})}url(e){return this._addCheck({kind:"url",...q.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...q.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...q.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...q.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...q.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...q.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...q.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...q.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...q.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...q.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...q.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...q.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...q.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...q.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...q.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...q.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...q.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...q.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...q.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...q.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...q.errToObj(n)})}nonempty(e){return this.min(1,q.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};qr.create=t=>new qr({checks:[],typeName:K.ZodString,coerce:t?.coerce??!1,...re(t)});function _4(t,e){let n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,a=Number.parseInt(t.toFixed(r).replace(".","")),o=Number.parseInt(e.toFixed(r).replace(".",""));return a%o/10**r}var Ia=class t extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==F.number){let a=this._getOrReturnCtx(e);return H(a,{code:N.invalid_type,expected:F.number,received:a.parsedType}),Y}let i,r=new _t;for(let a of this._def.checks)a.kind==="int"?ce.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),H(i,{code:N.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:N.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:N.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="multipleOf"?_4(e.data,a.value)!==0&&(i=this._getOrReturnCtx(e,i),H(i,{code:N.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),H(i,{code:N.not_finite,message:a.message}),r.dirty()):ce.assertNever(a);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,q.toString(n))}gt(e,n){return this.setLimit("min",e,!1,q.toString(n))}lte(e,n){return this.setLimit("max",e,!0,q.toString(n))}lt(e,n){return this.setLimit("max",e,!1,q.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:q.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:q.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:q.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:q.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:q.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:q.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:q.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ce.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Ia.create=t=>new Ia({checks:[],typeName:K.ZodNumber,coerce:t?.coerce||!1,...re(t)});var za=class t extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==F.bigint)return this._getInvalidInput(e);let i,r=new _t;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:N.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:N.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),H(i,{code:N.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):ce.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return H(n,{code:N.invalid_type,expected:F.bigint,received:n.parsedType}),Y}gte(e,n){return this.setLimit("min",e,!0,q.toString(n))}gt(e,n){return this.setLimit("min",e,!1,q.toString(n))}lte(e,n){return this.setLimit("max",e,!0,q.toString(n))}lt(e,n){return this.setLimit("max",e,!1,q.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:q.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:q.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:q.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};za.create=t=>new za({checks:[],typeName:K.ZodBigInt,coerce:t?.coerce??!1,...re(t)});var Ba=class extends ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==F.boolean){let i=this._getOrReturnCtx(e);return H(i,{code:N.invalid_type,expected:F.boolean,received:i.parsedType}),Y}return At(e.data)}};Ba.create=t=>new Ba({typeName:K.ZodBoolean,coerce:t?.coerce||!1,...re(t)});var $a=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==F.date){let a=this._getOrReturnCtx(e);return H(a,{code:N.invalid_type,expected:F.date,received:a.parsedType}),Y}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return H(a,{code:N.invalid_date}),Y}let i=new _t,r;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:N.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),i.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:N.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),i.dirty()):ce.assertNever(a);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:q.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:q.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};$a.create=t=>new $a({checks:[],coerce:t?.coerce||!1,typeName:K.ZodDate,...re(t)});var _s=class extends ae{_parse(e){if(this._getType(e)!==F.symbol){let i=this._getOrReturnCtx(e);return H(i,{code:N.invalid_type,expected:F.symbol,received:i.parsedType}),Y}return At(e.data)}};_s.create=t=>new _s({typeName:K.ZodSymbol,...re(t)});var Fa=class extends ae{_parse(e){if(this._getType(e)!==F.undefined){let i=this._getOrReturnCtx(e);return H(i,{code:N.invalid_type,expected:F.undefined,received:i.parsedType}),Y}return At(e.data)}};Fa.create=t=>new Fa({typeName:K.ZodUndefined,...re(t)});var Ua=class extends ae{_parse(e){if(this._getType(e)!==F.null){let i=this._getOrReturnCtx(e);return H(i,{code:N.invalid_type,expected:F.null,received:i.parsedType}),Y}return At(e.data)}};Ua.create=t=>new Ua({typeName:K.ZodNull,...re(t)});var Pr=class extends ae{constructor(){super(...arguments),this._any=!0}_parse(e){return At(e.data)}};Pr.create=t=>new Pr({typeName:K.ZodAny,...re(t)});var Pi=class extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return At(e.data)}};Pi.create=t=>new Pi({typeName:K.ZodUnknown,...re(t)});var Gn=class extends ae{_parse(e){let n=this._getOrReturnCtx(e);return H(n,{code:N.invalid_type,expected:F.never,received:n.parsedType}),Y}};Gn.create=t=>new Gn({typeName:K.ZodNever,...re(t)});var Ss=class extends ae{_parse(e){if(this._getType(e)!==F.undefined){let i=this._getOrReturnCtx(e);return H(i,{code:N.invalid_type,expected:F.void,received:i.parsedType}),Y}return At(e.data)}};Ss.create=t=>new Ss({typeName:K.ZodVoid,...re(t)});var Gi=class t extends ae{_parse(e){let{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==F.array)return H(n,{code:N.invalid_type,expected:F.array,received:n.parsedType}),Y;if(r.exactLength!==null){let o=n.data.length>r.exactLength.value,s=n.data.length<r.exactLength.value;(o||s)&&(H(n,{code:o?N.too_big:N.too_small,minimum:s?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(H(n,{code:N.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(H(n,{code:N.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((o,s)=>r.type._parseAsync(new Mn(n,o,n.path,s)))).then(o=>_t.mergeArray(i,o));let a=[...n.data].map((o,s)=>r.type._parseSync(new Mn(n,o,n.path,s)));return _t.mergeArray(i,a)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:q.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:q.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:q.toString(n)}})}nonempty(e){return this.min(1,e)}};Gi.create=(t,e)=>new Gi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...re(e)});function bs(t){if(t instanceof Gt){let e={};for(let n in t.shape){let i=t.shape[n];e[n]=On.create(bs(i))}return new Gt({...t._def,shape:()=>e})}else return t instanceof Gi?new Gi({...t._def,type:bs(t.element)}):t instanceof On?On.create(bs(t.unwrap())):t instanceof li?li.create(bs(t.unwrap())):t instanceof si?si.create(t.items.map(e=>bs(e))):t}var Gt=class t extends ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ce.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==F.object){let c=this._getOrReturnCtx(e);return H(c,{code:N.invalid_type,expected:F.object,received:c.parsedType}),Y}let{status:i,ctx:r}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Gn&&this._def.unknownKeys==="strip"))for(let c in r.data)o.includes(c)||s.push(c);let l=[];for(let c of o){let u=a[c],f=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Mn(r,f,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Gn){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")s.length>0&&(H(r,{code:N.unrecognized_keys,keys:s}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of s){let f=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Mn(r,f,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let f=await u.key,h=await u.value;c.push({key:f,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>_t.mergeObjectSync(i,c)):_t.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return q.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:q.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let i of ce.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let i of ce.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}deepPartial(){return bs(this)}partial(e){let n={};for(let i of ce.objectKeys(this.shape)){let r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let i of ce.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let a=this.shape[i];for(;a instanceof On;)a=a._def.innerType;n[i]=a}return new t({...this._def,shape:()=>n})}keyof(){return ZC(ce.objectKeys(this.shape))}};Gt.create=(t,e)=>new Gt({shape:()=>t,unknownKeys:"strip",catchall:Gn.create(),typeName:K.ZodObject,...re(e)});Gt.strictCreate=(t,e)=>new Gt({shape:()=>t,unknownKeys:"strict",catchall:Gn.create(),typeName:K.ZodObject,...re(e)});Gt.lazycreate=(t,e)=>new Gt({shape:t,unknownKeys:"strip",catchall:Gn.create(),typeName:K.ZodObject,...re(e)});var Va=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=this._def.options;function r(a){for(let s of a)if(s.result.status==="valid")return s.result;for(let s of a)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let o=a.map(s=>new Pt(s.ctx.common.issues));return H(n,{code:N.invalid_union,unionErrors:o}),Y}if(n.common.async)return Promise.all(i.map(async a=>{let o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(r);{let a,o=[];for(let l of i){let c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(l=>new Pt(l));return H(n,{code:N.invalid_union,unionErrors:s}),Y}}get options(){return this._def.options}};Va.create=(t,e)=>new Va({options:t,typeName:K.ZodUnion,...re(e)});var qi=t=>t instanceof qa?qi(t.schema):t instanceof Nn?qi(t.innerType()):t instanceof Pa?[t.value]:t instanceof Ga?t.options:t instanceof Za?ce.objectValues(t.enum):t instanceof Ya?qi(t._def.innerType):t instanceof Fa?[void 0]:t instanceof Ua?[null]:t instanceof On?[void 0,...qi(t.unwrap())]:t instanceof li?[null,...qi(t.unwrap())]:t instanceof pc||t instanceof Ka?qi(t.unwrap()):t instanceof Wa?qi(t._def.innerType):[],Ff=class t extends ae{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==F.object)return H(n,{code:N.invalid_type,expected:F.object,received:n.parsedType}),Y;let i=this.discriminator,r=n.data[i],a=this.optionsMap.get(r);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(H(n,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){let r=new Map;for(let a of n){let o=qi(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of o){if(r.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);r.set(s,a)}}return new t({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...re(i)})}};function Mv(t,e){let n=oi(t),i=oi(e);if(t===e)return{valid:!0,data:t};if(n===F.object&&i===F.object){let r=ce.objectKeys(e),a=ce.objectKeys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of a){let l=Mv(t[s],e[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(n===F.array&&i===F.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let a=0;a<t.length;a++){let o=t[a],s=e[a],l=Mv(o,s);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return n===F.date&&i===F.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ja=class extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=(a,o)=>{if(Bf(a)||Bf(o))return Y;let s=Mv(a.value,o.value);return s.valid?(($f(a)||$f(o))&&n.dirty(),{status:n.value,value:s.data}):(H(i,{code:N.invalid_intersection_types}),Y)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([a,o])=>r(a,o)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};ja.create=(t,e,n)=>new ja({left:t,right:e,typeName:K.ZodIntersection,...re(n)});var si=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==F.array)return H(i,{code:N.invalid_type,expected:F.array,received:i.parsedType}),Y;if(i.data.length<this._def.items.length)return H(i,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Y;!this._def.rest&&i.data.length>this._def.items.length&&(H(i,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let a=[...i.data].map((o,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Mn(i,o,i.path,s)):null}).filter(o=>!!o);return i.common.async?Promise.all(a).then(o=>_t.mergeArray(n,o)):_t.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};si.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new si({items:t,typeName:K.ZodTuple,rest:null,...re(e)})};var Uf=class t extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==F.object)return H(i,{code:N.invalid_type,expected:F.object,received:i.parsedType}),Y;let r=[],a=this._def.keyType,o=this._def.valueType;for(let s in i.data)r.push({key:a._parse(new Mn(i,s,i.path,s)),value:o._parse(new Mn(i,i.data[s],i.path,s)),alwaysSet:s in i.data});return i.common.async?_t.mergeObjectAsync(n,r):_t.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof ae?new t({keyType:e,valueType:n,typeName:K.ZodRecord,...re(i)}):new t({keyType:qr.create(),valueType:e,typeName:K.ZodRecord,...re(n)})}},xs=class extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==F.map)return H(i,{code:N.invalid_type,expected:F.map,received:i.parsedType}),Y;let r=this._def.keyType,a=this._def.valueType,o=[...i.data.entries()].map(([s,l],c)=>({key:r._parse(new Mn(i,s,i.path,[c,"key"])),value:a._parse(new Mn(i,l,i.path,[c,"value"]))}));if(i.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of o){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Y;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of o){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Y;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}}}};xs.create=(t,e,n)=>new xs({valueType:e,keyType:t,typeName:K.ZodMap,...re(n)});var ws=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==F.set)return H(i,{code:N.invalid_type,expected:F.set,received:i.parsedType}),Y;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(H(i,{code:N.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(H(i,{code:N.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let a=this._def.valueType;function o(l){let c=new Set;for(let u of l){if(u.status==="aborted")return Y;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}let s=[...i.data.values()].map((l,c)=>a._parse(new Mn(i,l,i.path,c)));return i.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(e,n){return new t({...this._def,minSize:{value:e,message:q.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:q.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};ws.create=(t,e)=>new ws({valueType:t,minSize:null,maxSize:null,typeName:K.ZodSet,...re(e)});var Vf=class t extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==F.function)return H(n,{code:N.invalid_type,expected:F.function,received:n.parsedType}),Y;function i(s,l){return fc({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,vs(),ji].filter(c=>!!c),issueData:{code:N.invalid_arguments,argumentsError:l}})}function r(s,l){return fc({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,vs(),ji].filter(c=>!!c),issueData:{code:N.invalid_return_type,returnTypeError:l}})}let a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Gr){let s=this;return At(async function(...l){let c=new Pt([]),u=await s._def.args.parseAsync(l,a).catch(g=>{throw c.addIssue(i(l,g)),c}),f=await Reflect.apply(o,this,u);return await s._def.returns._def.type.parseAsync(f,a).catch(g=>{throw c.addIssue(r(f,g)),c})})}else{let s=this;return At(function(...l){let c=s._def.args.safeParse(l,a);if(!c.success)throw new Pt([i(l,c.error)]);let u=Reflect.apply(o,this,c.data),f=s._def.returns.safeParse(u,a);if(!f.success)throw new Pt([r(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:si.create(e).rest(Pi.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new t({args:e||si.create([]).rest(Pi.create()),returns:n||Pi.create(),typeName:K.ZodFunction,...re(i)})}},qa=class extends ae{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};qa.create=(t,e)=>new qa({getter:t,typeName:K.ZodLazy,...re(e)});var Pa=class extends ae{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return H(n,{received:n.data,code:N.invalid_literal,expected:this._def.value}),Y}return{status:"valid",value:e.data}}get value(){return this._def.value}};Pa.create=(t,e)=>new Pa({value:t,typeName:K.ZodLiteral,...re(e)});function ZC(t,e){return new Ga({values:t,typeName:K.ZodEnum,...re(e)})}var Ga=class t extends ae{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),i=this._def.values;return H(n,{expected:ce.joinValues(i),received:n.parsedType,code:N.invalid_type}),Y}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),i=this._def.values;return H(n,{received:n.data,code:N.invalid_enum_value,options:i}),Y}return At(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}};Ga.create=ZC;var Za=class extends ae{_parse(e){let n=ce.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==F.string&&i.parsedType!==F.number){let r=ce.objectValues(n);return H(i,{expected:ce.joinValues(r),received:i.parsedType,code:N.invalid_type}),Y}if(this._cache||(this._cache=new Set(ce.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=ce.objectValues(n);return H(i,{received:i.data,code:N.invalid_enum_value,options:r}),Y}return At(e.data)}get enum(){return this._def.values}};Za.create=(t,e)=>new Za({values:t,typeName:K.ZodNativeEnum,...re(e)});var Gr=class extends ae{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==F.promise&&n.common.async===!1)return H(n,{code:N.invalid_type,expected:F.promise,received:n.parsedType}),Y;let i=n.parsedType===F.promise?n.data:Promise.resolve(n.data);return At(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Gr.create=(t,e)=>new Gr({type:t,typeName:K.ZodPromise,...re(e)});var Nn=class extends ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:o=>{H(i,o),o.fatal?n.abort():n.dirty()},get path(){return i.path}};if(a.addIssue=a.addIssue.bind(a),r.type==="preprocess"){let o=r.transform(i.data,a);if(i.common.async)return Promise.resolve(o).then(async s=>{if(n.value==="aborted")return Y;let l=await this._def.schema._parseAsync({data:s,path:i.path,parent:i});return l.status==="aborted"?Y:l.status==="dirty"?Ha(l.value):n.value==="dirty"?Ha(l.value):l});{if(n.value==="aborted")return Y;let s=this._def.schema._parseSync({data:o,path:i.path,parent:i});return s.status==="aborted"?Y:s.status==="dirty"?Ha(s.value):n.value==="dirty"?Ha(s.value):s}}if(r.type==="refinement"){let o=s=>{let l=r.refinement(s,a);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Y:(s.status==="dirty"&&n.dirty(),o(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>s.status==="aborted"?Y:(s.status==="dirty"&&n.dirty(),o(s.value).then(()=>({status:n.value,value:s.value}))))}if(r.type==="transform")if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!jr(o))return Y;let s=r.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>jr(o)?Promise.resolve(r.transform(o.value,a)).then(s=>({status:n.value,value:s})):Y);ce.assertNever(r)}};Nn.create=(t,e,n)=>new Nn({schema:t,typeName:K.ZodEffects,effect:e,...re(n)});Nn.createWithPreprocess=(t,e,n)=>new Nn({schema:e,effect:{type:"preprocess",transform:t},typeName:K.ZodEffects,...re(n)});var On=class extends ae{_parse(e){return this._getType(e)===F.undefined?At(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};On.create=(t,e)=>new On({innerType:t,typeName:K.ZodOptional,...re(e)});var li=class extends ae{_parse(e){return this._getType(e)===F.null?At(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};li.create=(t,e)=>new li({innerType:t,typeName:K.ZodNullable,...re(e)});var Ya=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return n.parsedType===F.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ya.create=(t,e)=>new Ya({innerType:t,typeName:K.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...re(e)});var Wa=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return ys(r)?r.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Pt(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Pt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Wa.create=(t,e)=>new Wa({innerType:t,typeName:K.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...re(e)});var Es=class extends ae{_parse(e){if(this._getType(e)!==F.nan){let i=this._getOrReturnCtx(e);return H(i,{code:N.invalid_type,expected:F.nan,received:i.parsedType}),Y}return{status:"valid",value:e.data}}};Es.create=t=>new Es({typeName:K.ZodNaN,...re(t)});var S4=Symbol("zod_brand"),pc=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},hc=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?Y:a.status==="dirty"?(n.dirty(),Ha(a.value)):this._def.out._parseAsync({data:a.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?Y:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new t({in:e,out:n,typeName:K.ZodPipeline})}},Ka=class extends ae{_parse(e){let n=this._def.innerType._parse(e),i=r=>(jr(r)&&(r.value=Object.freeze(r.value)),r);return ys(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Ka.create=(t,e)=>new Ka({innerType:t,typeName:K.ZodReadonly,...re(e)});function jC(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function YC(t,e={},n){return t?Pr.create().superRefine((i,r)=>{let a=t(i);if(a instanceof Promise)return a.then(o=>{if(!o){let s=jC(e,i),l=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:l})}});if(!a){let o=jC(e,i),s=o.fatal??n??!0;r.addIssue({code:"custom",...o,fatal:s})}}):Pr.create()}var x4={object:Gt.lazycreate},K;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(K||(K={}));var w4=(t,e={message:`Input not instance of ${t.name}`})=>YC(n=>n instanceof t,e),WC=qr.create,KC=Ia.create,E4=Es.create,C4=za.create,XC=Ba.create,A4=$a.create,T4=_s.create,k4=Fa.create,R4=Ua.create,O4=Pr.create,M4=Pi.create,N4=Gn.create,D4=Ss.create,L4=Gi.create,H4=Gt.create,I4=Gt.strictCreate,z4=Va.create,B4=Ff.create,$4=ja.create,F4=si.create,U4=Uf.create,V4=xs.create,j4=ws.create,q4=Vf.create,P4=qa.create,G4=Pa.create,Z4=Ga.create,Y4=Za.create,W4=Gr.create,K4=Nn.create,X4=On.create,Q4=li.create,J4=Nn.createWithPreprocess,eL=hc.create,tL=()=>WC().optional(),nL=()=>KC().optional(),iL=()=>XC().optional(),rL={string:(t=>qr.create({...t,coerce:!0})),number:(t=>Ia.create({...t,coerce:!0})),boolean:(t=>Ba.create({...t,coerce:!0})),bigint:(t=>za.create({...t,coerce:!0})),date:(t=>$a.create({...t,coerce:!0}))};var aL=Y;var Nv=y.union([y.object({type:y.literal("data"),key:y.string(),value:y.string().optional()}),y.object({type:y.literal("css"),value:y.string()}),y.object({type:y.literal("aria"),role:y.string().optional(),label:y.string().optional()}),y.object({type:y.literal("shadow-css"),value:y.string()}),y.object({type:y.literal("ref"),el:y.any()})]),QC=y.object({kind:y.literal("tooltip"),id:y.string(),anchor:Nv,content:y.object({title:y.string().optional(),body:y.string()}),placement:y.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:y.number().optional(),blocking:y.boolean().optional(),trigger:y.enum(["immediate","hover","click"]).optional(),dismiss:y.object({onEsc:y.boolean().optional(),closeButton:y.boolean().optional(),timeoutMs:y.number().optional()}).optional()}),JC=y.object({kind:y.literal("highlight"),id:y.string(),anchor:Nv,copy:y.string().optional(),ring:y.object({paddingPx:y.number().optional(),radiusPx:y.number().optional()}).optional(),scrim:y.object({opacity:y.number().optional()}).optional(),ringColor:y.string().optional(),blocking:y.boolean().optional(),dismiss:y.object({onClickOutside:y.boolean().optional(),onEsc:y.boolean().optional(),timeoutMs:y.number().optional()}).optional()}),jf=y.object({id:y.string(),version:y.number(),routes:y.array(y.string()).optional(),steps:y.array(y.union([QC,JC]))});function oL(t){return jf.parse(t)}var sL=({configUri:t,experiments:e,featureKey:n="smart-canvas-overlay-uri",credentials:i="include"}={})=>async()=>{let r=rf({configUri:t,experiments:e,featureKey:n});if(!r)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let a=await fetch(r,{credentials:i});if(!a.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${a.status})`);let o=await a.json();return jf.parse(o)};var qf=ee(nt(),1),eA=ee(js(),1);function lL({element:t,children:e}){let[n,i]=(0,qf.useState)(null);return(0,qf.useLayoutEffect)(()=>{if(!t){i(null);return}return i(t.getMountNode()),()=>i(null)},[t]),n?(0,eA.createPortal)(e,n):null}function cL(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let n=0;n<16;n++)e+=t[Math.floor(Math.random()*t.length)];return e}var Dv=class{constructor(){V(this,"sessionId");this.sessionId=cL(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,n){}trackAction(e,n,i){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,n,i){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}track(e,n){}};function Pf(){return new Dv}var R=typeof window<"u"?window:void 0,xt=typeof globalThis<"u"?globalThis:R;typeof self>"u"&&(xt.self=xt),typeof File>"u"&&(xt.File=function(){});var KA=Array.prototype,tA=KA.forEach,nA=KA.indexOf,dn=xt?.navigator,B=xt?.document,Yt=xt?.location,Wv=xt?.fetch,Kv=xt!=null&&xt.XMLHttpRequest&&"withCredentials"in new xt.XMLHttpRequest?xt.XMLHttpRequest:void 0,iA=xt?.AbortController,Zt=dn?.userAgent,J=R??{},Yi={DEBUG:!1,LIB_VERSION:"1.302.2"};function rA(t,e,n,i,r,a,o){try{var s=t[a](o),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(i,r)}function aA(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var a=t.apply(e,n);function o(l){rA(a,i,r,o,s,"next",l)}function s(l){rA(a,i,r,o,s,"throw",l)}o(void 0)}))}}function j(){return j=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},j.apply(null,arguments)}function XA(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}var uL=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],oA=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return uL.concat(e).some((i=>{var r=i.toLowerCase();return n.indexOf(r)!==-1}))},dL=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function ue(t,e){return t.indexOf(e)!==-1}var wp=function(t){return t.trim()},Xv=function(t){return t.replace(/^\$/,"")},fL=Array.isArray,QA=Object.prototype,JA=QA.hasOwnProperty,Ep=QA.toString,Ae=fL||function(t){return Ep.call(t)==="[object Array]"},Qr=t=>typeof t=="function",ft=t=>t===Object(t)&&!Ae(t),ks=t=>{if(ft(t)){for(var e in t)if(JA.call(t,e))return!1;return!0}return!1},I=t=>t===void 0,ot=t=>Ep.call(t)=="[object String]",Qv=t=>ot(t)&&t.trim().length===0,Qi=t=>t===null,Ee=t=>I(t)||Qi(t),fi=t=>Ep.call(t)=="[object Number]",Jr=t=>Ep.call(t)==="[object Boolean]",pL=t=>t instanceof FormData,hL=t=>ue(dL,t);function Jv(t){return t===null||typeof t!="object"}function np(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function eT(t){return!I(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var gL=[!0,"true",1,"1","yes"],Lv=t=>ue(gL,t),mL=[!1,"false",0,"0","no"];function ci(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),fi(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),ci(r||n,e,n,i))}var ey=class{constructor(e){this.t={},this.i=e.i,this.o=ci(e.bucketSize,0,100,e.h),this.m=ci(e.refillRate,0,this.o,e.h),this.S=ci(e.refillInterval,0,864e5,e.h)}$(e,n){var i=n-e.lastAccess,r=Math.floor(i/this.S);if(r>0){var a=r*this.m;e.tokens=Math.min(e.tokens+a,this.o),e.lastAccess=e.lastAccess+r*this.S}}consumeRateLimit(e){var n,i=Date.now(),r=String(e),a=this.t[r];return a?this.$(a,i):(a={tokens:this.o,lastAccess:i},this.t[r]=a),a.tokens===0||(a.tokens--,a.tokens===0&&((n=this.i)==null||n.call(this,e)),a.tokens===0)}stop(){this.t={}}},Gf,sA,Hv,vL=t=>t instanceof Error;function yL(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return Hv&&n.length===sA||(sA=n.length,Hv=n.reduce(((i,r)=>{Gf||(Gf={});var a=Gf[r];if(a)i[a[0]]=a[1];else for(var o=t(r),s=o.length-1;s>=0;s--){var l=o[s],c=l?.filename,u=e[r];if(c&&u){i[c]=u,Gf[r]=[c,u];break}}return i}),{})),Hv}}var ty=class{constructor(e,n,i){i===void 0&&(i=[]),this.coercers=e,this.stackParser=n,this.modifiers=i}buildFromUnknown(e,n){n===void 0&&(n={});var i=n&&n.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,n,0).apply(e),a=this.buildParsingContext(),o=this.parseStacktrace(r,a);return{$exception_list:this.convertToExceptionList(o,i),$exception_level:"error"}}modifyFrames(e){var n=this;return aA((function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&Ae(i.stacktrace.frames)&&(i.stacktrace.frames=yield n.applyModifiers(i.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var i,r;return e.cause!=null&&(i=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),n.chunkIdMap)),j({},e,{cause:i,stack:r})}applyChunkIds(e,n){return e.map((i=>(i.filename&&n&&(i.chunk_id=n[i.filename]),i)))}applyCoercers(e,n){for(var i of this.coercers)if(i.match(e))return i.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return aA((function*(){var i=e;for(var r of n.modifiers)i=yield r(i);return i}))()}convertToExceptionList(e,n){var i,r,a,o={type:e.type,value:e.value,mechanism:{type:(i=n.type)!==null&&i!==void 0?i:"generic",handled:(r=n.handled)===null||r===void 0||r,synthetic:(a=e.synthetic)!==null&&a!==void 0&&a}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var s=[o];return e.cause!=null&&s.push(...this.convertToExceptionList(e.cause,j({},n,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:yL(this.stackParser)}}buildCoercingContext(e,n,i){i===void 0&&(i=0);var r=(a,o)=>{if(o<=4){var s=this.buildCoercingContext(e,n,o);return this.applyCoercers(a,s)}};return j({},n,{syntheticException:i==0?n.syntheticException:void 0,mechanism:e,apply:a=>r(a,i),next:a=>r(a,i+1)})}},Ns="?";function ny(t,e,n,i,r){var a={platform:t,filename:e,function:n==="<anonymous>"?Ns:n,in_app:!0};return I(i)||(a.lineno=i),I(r)||(a.colno=r),a}var tT=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,i=t.indexOf("safari-web-extension")!==-1;return n||i?[t.indexOf("@")!==-1?t.split("@")[0]:Ns,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},bL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,_L=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,SL=/\((\S*)(?::(\d+))(?::(\d+))\)/,xL=(t,e)=>{var n=bL.exec(t);if(n){var[,i,r,a]=n;return ny(e,i,Ns,+r,+a)}var o=_L.exec(t);if(o){if(o[2]&&o[2].indexOf("eval")===0){var s=SL.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[l,c]=tT(o[1]||Ns,o[2]);return ny(e,c,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},wL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,EL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,CL=(t,e)=>{var n=wL.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var i=EL.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}var r=n[3],a=n[1]||Ns;return[a,r]=tT(a,r),ny(e,r,a,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},lA=/\(error: (.*)\)/,cA=50;function AL(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return function(r,a){a===void 0&&(a=0);for(var o=[],s=r.split(`
|
|
445
|
-
`),l=a;l<s.length;l++){var c=s[l];if(!(c.length>1024)){var u=lA.test(c)?c.replace(lA,"$1"):c;if(!u.match(/\S*Error: /)){for(var f of n){var h=f(u,t);if(h){o.push(h);break}}if(o.length>=cA)break}}}return(function(g){if(!g.length)return[];var _=Array.from(g);return _.reverse(),_.slice(0,cA).map((b=>{return j({},b,{filename:b.filename||(w=_,w[w.length-1]||{}).filename,function:b.function||Ns});var w}))})(o)}}var iy=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var i=ot(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return np(e,"DOMException")}isDOMError(e){return np(e,"DOMError")}},ry=class{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var i=e.message;return i.error&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}},ay=class{constructor(){}match(e){return np(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var i,r=n.apply(e.error);return r||{type:"ErrorEvent",value:e.message,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},TL=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,oy=class{match(e){return typeof e=="string"}coerce(e,n){var i,[r,a]=this.getInfos(e);return{type:r??"Error",value:a??e,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}getInfos(e){var n="Error",i=e,r=e.match(TL);return r&&(n=r[1],i=r[2]),[n,i]}},kL=["fatal","error","warning","log","info","debug"];function nT(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var i=n.length;i>0;i--){var r=n.slice(0,i).join(", ");if(!(r.length>e))return i===n.length||r.length<=e?r:r.slice(0,e)+"..."}return""}var sy=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var i,r=this.getErrorPropertyFromObject(e);return r?n.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(i=n.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return eT(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var i=this.getObjectClassName(e);return(i&&i!=="Object"?"'"+i+"'":"Object")+" captured as exception with keys: "+nT(e)}isSeverityLevel(e){return ot(e)&&!Qv(e)&&kL.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=e[n];if(vL(i))return i}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},ly=class{match(e){return eT(e)}coerce(e,n){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+nT(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},cy=class{match(e){return Jv(e)}coerce(e,n){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},uy=class{match(e){return np(e,"PromiseRejectionEvent")}coerce(e,n){var i,r=this.getUnhandledRejectionReason(e);return Jv(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}:n.apply(r)}getUnhandledRejectionReason(e){if(Jv(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}},iT=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,i={k:function(r){if(R&&(Yi.DEBUG||J.POSTHOG_DEBUG||n)&&!I(R.console)&&R.console){for(var a=("__rrweb_original__"in R.console[r])?R.console[r].__rrweb_original__:R.console[r],o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];a(t,...s)}},info:function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];i.k("log",...a)},warn:function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];i.k("warn",...a)},error:function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];i.k("error",...a)},critical:function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];console.error(t,...a)},uninitializedWarning:r=>{i.error("You must initialize PostHog before calling "+r)},createLogger:(r,a)=>iT(t+" "+r,a)};return i},$=iT("[PostHog.js]"),st=$.createLogger,RL=st("[ExternalScriptsLoader]"),uA=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return RL.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var i=B?.querySelectorAll("script");if(i){for(var r,a=function(){if(i[o].src===e){var l=i[o];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",(c=>{l.__posthog_loading_callback_fired=!0,n(void 0,c)})),l.onerror=c=>n(c),{v:void 0})}},o=0;o<i.length;o++)if(r=a())return r.v}var s=()=>{if(!B)return n("document not found");var l=B.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=f=>{l.__posthog_loading_callback_fired=!0,n(void 0,f)},l.onerror=f=>n(f),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");var c,u=B.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):B.body.appendChild(l)};B!=null&&B.body?s():B?.addEventListener("DOMContentLoaded",s)};J.__PosthogExtensions__=J.__PosthogExtensions__||{},J.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var i="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(i="/array/"+t.config.token+"/config.js"),e==="toolbar"){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}var a=t.requestRouter.endpointFor("assets",i);uA(t,a,n)},J.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var i=t.requestRouter.endpointFor("api",e);uA(t,i,n)};var ip={};function ea(t,e,n){if(Ae(t)){if(tA&&t.forEach===tA)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var i=0,r=t.length;i<r;i++)if(i in t&&e.call(n,t[i],i)===ip)return}}}function Re(t,e,n){if(!Ee(t)){if(Ae(t))return ea(t,e,n);if(pL(t)){for(var i of t.entries())if(e.call(n,i[1],i[0])===ip)return}else for(var r in t)if(JA.call(t,r)&&e.call(n,t[r],r)===ip)return}}var Ye=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return ea(n,(function(r){for(var a in r)r[a]!==void 0&&(t[a]=r[a])})),t},Hs=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return ea(n,(function(r){ea(r,(function(a){t.push(a)}))})),t};function Jf(t){for(var e=Object.keys(t),n=e.length,i=new Array(n);n--;)i[n]=[e[n],t[e[n]]];return i}var dA=function(t){try{return t()}catch{return}},OL=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(this,n)}catch(r){$.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),$.critical(r)}}},ab=function(t){var e={};return Re(t,(function(n,i){(ot(n)&&n.length>0||fi(n))&&(e[i]=n)})),e};function ML(t,e){return n=t,i=a=>ot(a)&&!Qi(e)?a.slice(0,e):a,r=new Set,(function a(o,s){return o!==Object(o)?i?i(o,s):o:r.has(o)?void 0:(r.add(o),Ae(o)?(l=[],ea(o,(c=>{l.push(a(c))}))):(l={},Re(o,((c,u)=>{r.has(c)||(l[u]=a(c,u))}))),l);var l})(n);var n,i,r}var NL=["herokuapp.com","vercel.app","netlify.app"];function DL(t){var e=t?.hostname;if(!ot(e))return!1;var n=e.split(".").slice(-2).join(".");for(var i of NL)if(n===i)return!1;return!0}function rT(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function tt(t,e,n,i){var{capture:r=!1,passive:a=!0}=i??{};t?.addEventListener(e,n,{capture:r,passive:a})}var aT="$people_distinct_id",Ec="__alias",Cc="__timers",fA="$autocapture_disabled_server_side",dy="$heatmaps_enabled_server_side",pA="$exception_capture_enabled_server_side",fy="$error_tracking_suppression_rules",hA="$error_tracking_capture_extension_exceptions",gA="$web_vitals_enabled_server_side",oT="$dead_clicks_enabled_server_side",mA="$web_vitals_allowed_metrics",Iv="$session_recording_remote_config",rp="$sesid",sT="$session_is_sampled",Rs="$enabled_feature_flags",Ac="$early_access_features",py="$feature_flag_details",Tc="$stored_person_properties",Ja="$stored_group_properties",hy="$surveys",Zf="$surveys_activated",ap="$flag_call_reported",Wi="$user_state",gy="$client_session_props",my="$capture_rate_limit",vy="$initial_campaign_params",yy="$initial_referrer_info",op="$initial_person_info",sp="$epp",lT="__POSTHOG_TOOLBAR__",gc="$posthog_cookieless",LL=[aT,Ec,"__cmpns",Cc,"$session_recording_enabled_server_side",dy,rp,Rs,fy,Wi,Ac,py,Ja,Tc,hy,ap,gy,my,vy,yy,sp,op];function vA(t){return t instanceof Element&&(t.id===lT||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Cp(t){return!!t&&t.nodeType===1}function ta(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function cT(t){return!!t&&t.nodeType===3}function uT(t){return!!t&&t.nodeType===11}function ob(t){return t?wp(t).split(/\s+/):[]}function yA(t){var e=R?.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function lp(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return ob(e)}function dT(t){return Ee(t)?null:wp(t).split(/(\s+)/).filter((e=>Lc(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Fc(t){var e="";return by(t)&&!mT(t)&&t.childNodes&&t.childNodes.length&&Re(t.childNodes,(function(n){var i;cT(n)&&n.textContent&&(e+=(i=dT(n.textContent))!==null&&i!==void 0?i:"")})),wp(e)}function fT(t){return I(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var sb=["a","button","form","input","select","textarea","label"];function pT(t,e){if(I(e))return!0;var n,i=function(a){if(e.some((o=>a.matches(o))))return{v:!0}};for(var r of t)if(n=i(r))return n.v;return!1}function hT(t){var e=t.parentNode;return!(!e||!Cp(e))&&e}var HL=["next","previous","prev",">","<"],bA=10,_A=[".ph-no-rageclick",".ph-no-capture"];function IL(t,e){if(!R||lb(t))return!1;var n,i,r;if(Jr(e)?(n=!!e&&_A,i=void 0):(n=(r=e?.css_selector_ignorelist)!==null&&r!==void 0?r:_A,i=e?.content_ignorelist),n===!1)return!1;var{targetElementList:a}=gT(t,!1);return!(function(o,s){if(o===!1||I(o))return!1;var l;if(o===!0)l=HL;else{if(!Ae(o))return!1;if(o.length>bA)return $.error("[PostHog] content_ignorelist array cannot exceed "+bA+" items. Use css_selector_ignorelist for more complex matching."),!1;l=o.map((c=>c.toLowerCase()))}return s.some((c=>{var{safeText:u,ariaLabel:f}=c;return l.some((h=>u.includes(h)||f.includes(h)))}))})(i,a.map((o=>{var s;return{safeText:Fc(o).toLowerCase(),ariaLabel:((s=o.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!pT(a,n)}var lb=t=>!t||ta(t,"html")||!Cp(t),gT=(t,e)=>{if(!R||lb(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,i=[t],r=t;r.parentNode&&!ta(r,"body");)if(uT(r.parentNode))i.push(r.parentNode.host),r=r.parentNode.host;else{var a=hT(r);if(!a)break;if(e||sb.indexOf(a.tagName.toLowerCase())>-1)n=!0;else{var o=R.getComputedStyle(a);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}i.push(a),r=a}return{parentIsUsefulElement:n,targetElementList:i}};function zL(t,e,n,i,r){var a,o,s,l;if(n===void 0&&(n=void 0),!R||lb(t)||(a=n)!=null&&a.url_allowlist&&!yA(n.url_allowlist)||(o=n)!=null&&o.url_ignorelist&&yA(n.url_ignorelist))return!1;if((s=n)!=null&&s.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some((_=>e.type===_)))return!1}var{parentIsUsefulElement:u,targetElementList:f}=gT(t,i);if(!(function(_,b){var w=b?.element_allowlist;if(I(w))return!0;var d,p=function(v){if(w.some((S=>v.tagName.toLowerCase()===S)))return{v:!0}};for(var m of _)if(d=p(m))return d.v;return!1})(f,n)||!pT(f,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var h=R.getComputedStyle(t);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=t.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return u?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(sb.indexOf(g)>-1||t.getAttribute("contenteditable")==="true")}}function by(t){for(var e=t;e.parentNode&&!ta(e,"body");e=e.parentNode){var n=lp(e);if(ue(n,"ph-sensitive")||ue(n,"ph-no-capture"))return!1}if(ue(lp(t),"ph-include"))return!0;var i=t.type||"";if(ot(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";return!(ot(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function mT(t){return!!(ta(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ta(t,"select")||ta(t,"textarea")||t.getAttribute("contenteditable")==="true")}var vT="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",BL=new RegExp("^(?:"+vT+")$"),$L=new RegExp(vT),yT="\\d{3}-?\\d{2}-?\\d{4}",FL=new RegExp("^("+yT+")$"),UL=new RegExp("("+yT+")");function Lc(t,e){return e===void 0&&(e=!0),!(Ee(t)||ot(t)&&(t=wp(t),(e?BL:$L).test((t||"").replace(/[- ]/g,""))||(e?FL:UL).test(t)))}function bT(t){var e=Fc(t);return Lc(e=(e+" "+_T(t)).trim())?e:""}function _T(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Re(t.childNodes,(function(n){var i;if(n&&((i=n.tagName)==null?void 0:i.toLowerCase())==="span")try{var r=Fc(n);e=(e+" "+r).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+_T(n)).trim())}catch(a){$.error("[AutoCapture]",a)}})),e}function VL(t){return(function(e){var n=e.map((i=>{var r,a,o="";if(i.tag_name&&(o+=i.tag_name),i.attr_class)for(var s of(i.attr_class.sort(),i.attr_class))o+="."+s.replace(/"/g,"");var l=j({},i.text?{text:i.text}:{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(a=i.nth_of_type)!==null&&a!==void 0?a:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),c={};return Jf(l).sort(((u,f)=>{var[h]=u,[g]=f;return h.localeCompare(g)})).forEach((u=>{var[f,h]=u;return c[SA(f.toString())]=SA(h.toString())})),o+=":",o+=Jf(c).map((u=>{var[f,h]=u;return f+'="'+h+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var i,r,a={text:(i=n.$el_text)==null?void 0:i.slice(0,400),tag_name:n.tag_name,href:(r=n.attr__href)==null?void 0:r.slice(0,2048),attr_class:jL(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Jf(n).filter((o=>{var[s]=o;return s.indexOf("attr__")===0})).forEach((o=>{var[s,l]=o;return a.attributes[s]=l})),a}))})(t))}function SA(t){return t.replace(/"|\\"/g,'\\"')}function jL(t){var e=t.attr__class;return e?Ae(e)?e:ob(e):void 0}var cp=class{constructor(e){this.disabled=e===!1;var n=ft(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(n-r.y)<this.thresholdPx&&i-r.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:i}];return!1}},zv="$copy_autocapture",Xi=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var up=t=>{var e=B?.createElement("a");return I(e)?null:(e.href=t,e)},qL=function(t,e){var n,i;e===void 0&&(e="&");var r=[];return Re(t,(function(a,o){I(a)||I(o)||o==="undefined"||(n=encodeURIComponent((s=>s instanceof File)(a)?a.name:a.toString()),i=encodeURIComponent(o),r[r.length]=i+"="+n)})),r.join(e)},dp=function(t,e){for(var n,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var a=i[r].split("=");if(a[0]===e){n=a;break}}if(!Ae(n)||n.length<2)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{$.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Uc=function(t,e,n){if(!t||!e||!e.length)return t;for(var i=t.split("#"),r=i[0]||"",a=i[1],o=r.split("?"),s=o[1],l=o[0],c=(s||"").split("&"),u=[],f=0;f<c.length;f++){var h=c[f].split("=");Ae(h)&&(e.includes(h[0])?u.push(h[0]+"="+n):u.push(c[f]))}var g=l;return s!=null&&(g+="?"+u.join("&")),a!=null&&(g+="#"+a),g},fp=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},xA=st("[AutoCapture]");function Bv(t,e){return e.length>t?e.slice(0,t)+"...":e}function PL(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Cp(e));return e}function GL(t,e,n,i){var r=t.tagName.toLowerCase(),a={tag_name:r};sb.indexOf(r)>-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?a.$el_text=Bv(1024,bT(t)):a.$el_text=Bv(1024,Fc(t)));var o=lp(t);o.length>0&&(a.classes=o.filter((function(u){return u!==""}))),Re(t.attributes,(function(u){var f;if((!mT(t)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(i==null||!i.includes(u.name))&&!e&&Lc(u.value)&&(f=u.name,!ot(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var h=u.value;u.name==="class"&&(h=ob(h).join(" ")),a["attr__"+u.name]=Bv(1024,h)}}));for(var s=1,l=1,c=t;c=PL(c);)s++,c.tagName===t.tagName&&l++;return a.nth_child=s,a.nth_of_type=l,a}function ZL(t,e){for(var n,i,{e:r,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,c=[t],u=t;u.parentNode&&!ta(u,"body");)uT(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var f,h=[],g={},_=!1,b=!1;if(Re(c,(v=>{var S=by(v);v.tagName.toLowerCase()==="a"&&(_=v.getAttribute("href"),_=S&&_&&Lc(_)&&_),ue(lp(v),"ph-no-capture")&&(b=!0),h.push(GL(v,a,o,s));var T=(function(A){if(!by(A))return{};var k={};return Re(A.attributes,(function(C){if(C.name&&C.name.indexOf("data-ph-capture-attribute")===0){var x=C.name.replace("data-ph-capture-attribute-",""),M=C.value;x&&M&&Lc(M)&&(k[x]=M)}})),k})(v);Ye(g,T)})),b)return{props:{},explicitNoCapture:b};if(o||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=bT(t):h[0].$el_text=Fc(t)),_){var w,d;h[0].attr__href=_;var p=(w=up(_))==null?void 0:w.host,m=R==null||(d=R.location)==null?void 0:d.host;p&&m&&p!==m&&(f=_)}return{props:Ye({$event_type:r.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:VL(h)},(n=h[0])!=null&&n.$el_text?{$el_text:(i=h[0])==null?void 0:i.$el_text}:{},f&&r.type==="click"?{$external_click_url:f}:{},g)}}var _y=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new cp(e.config.rageclick),this.I=null}get F(){var e,n,i=ft(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),i.url_ignorelist=(n=i.url_ignorelist)==null?void 0:n.map((r=>new RegExp(r))),i}C(){if(this.isBrowserSupported()){if(R&&B){var e=i=>{i=i||R?.event;try{this.M(i)}catch(r){xA.error("Failed to capture event",r)}};if(tt(B,"submit",e,{capture:!0}),tt(B,"change",e,{capture:!0}),tt(B,"click",e,{capture:!0}),this.F.capture_copied_text){var n=i=>{i=i||R?.event,this.M(i,zv)};tt(B,"copy",n,{capture:!0}),tt(B,"cut",n,{capture:!0})}}}else xA.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.C(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.R=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[fA]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var n,i=[];return(n=this.I)==null||n.forEach((r=>{var a=B?.querySelectorAll(r);a?.forEach((o=>{e===o&&i.push(r)}))})),i}get isEnabled(){var e,n,i=(e=this.instance.persistence)==null?void 0:e.props[fA],r=this.T;if(Qi(r)&&!Jr(i)&&!this.instance.O())return!1;var a=(n=this.T)!==null&&n!==void 0?n:!!i;return!!this.instance.config.autocapture&&!a}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var i,r=fT(e);cT(r)&&(r=r.parentNode||null),n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&IL(r,this.instance.config.rageclick)&&this.M(e,"$rageclick");var a=n===zv;if(r&&zL(r,e,this.F,a,a?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=ZL(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.F.element_attribute_ignorelist,elementsChainAsString:this.R});if(s)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(o.$element_selectors=l),n===zv){var c,u=dT(R==null||(c=R.getSelection())==null?void 0:c.toString()),f=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=f}return this.instance.capture(n,o),!0}}}isBrowserSupported(){return Qr(B?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return fi(t)&&isFinite(t)&&Math.floor(t)===t});var wA="0123456789abcdef",Sy=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,i,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||n<0||i<0||r<0||e>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var a=new Uint8Array(16);return a[0]=e/Math.pow(2,40),a[1]=e/Math.pow(2,32),a[2]=e/Math.pow(2,24),a[3]=e/Math.pow(2,16),a[4]=e/Math.pow(2,8),a[5]=e,a[6]=112|n>>>8,a[7]=n,a[8]=128|i>>>24,a[9]=i>>>16,a[10]=i>>>8,a[11]=i,a[12]=r>>>24,a[13]=r>>>16,a[14]=r>>>8,a[15]=r,new t(a)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+wA.charAt(this.bytes[n]>>>4)+wA.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var i=this.bytes[n]-e.bytes[n];if(i!==0)return Math.sign(i)}return 0}},xy=class{constructor(){this.A=0,this.D=0,this.j=new wy}generate(){var e=this.generateOrAbort();if(I(e)){this.A=0;var n=this.generateOrAbort();if(I(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return Sy.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}},EA,ST=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};R&&!I(R.crypto)&&crypto.getRandomValues&&(ST=t=>crypto.getRandomValues(t));var wy=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(ST(this.N),this.U=0),this.N[this.U++]}},Xr=()=>YL().toString(),YL=()=>(EA||(EA=new xy)).generate(),mc="",WL=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function KL(t,e){if(e){var n=(function(r,a){if(a===void 0&&(a=B),mc)return mc;if(!a||["localhost","127.0.0.1"].includes(r))return"";for(var o=r.split("."),s=Math.min(o.length,8),l="dmn_chk_"+Xr();!mc&&s--;){var c=o.slice(s).join("."),u=l+"=1;domain=."+c+";path=/";a.cookie=u+";max-age=3",a.cookie.includes(l)&&(a.cookie=u+";max-age=0",mc=c)}return mc})(t);if(!n){var i=(r=>{var a=r.match(WL);return a?a[0]:""})(t);i!==n&&$.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}var di={H:()=>!!B,B:function(t){$.error("cookieStore error: "+t)},q:function(t){if(B){try{for(var e=t+"=",n=B.cookie.split(";").filter((a=>a.length)),i=0;i<n.length;i++){for(var r=n[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(di.q(t))||{}}catch{}return e},G:function(t,e,n,i,r){if(B)try{var a="",o="",s=KL(B.location.hostname,i);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),a="; expires="+l.toUTCString()}r&&(o="; secure");var c=t+"="+encodeURIComponent(JSON.stringify(e))+a+"; SameSite=Lax; path=/"+s+o;return c.length>3686.4&&$.warn("cookieStore warning: large cookie, len="+c.length),B.cookie=c,c}catch{return}},V:function(t,e){if(B!=null&&B.cookie)try{di.G(t,"",-1,e)}catch{return}}},$v=null,Ue={H:function(){if(!Qi($v))return $v;var t=!0;if(I(R))t=!1;else try{var e="__mplssupport__";Ue.G(e,"xyz"),Ue.q(e)!=='"xyz"'&&(t=!1),Ue.V(e)}catch{t=!1}return t||$.error("localStorage unsupported; falling back to cookie store"),$v=t,t},B:function(t){$.error("localStorage error: "+t)},q:function(t){try{return R?.localStorage.getItem(t)}catch(e){Ue.B(e)}return null},W:function(t){try{return JSON.parse(Ue.q(t))||{}}catch{}return null},G:function(t,e){try{R?.localStorage.setItem(t,JSON.stringify(e))}catch(n){Ue.B(n)}},V:function(t){try{R?.localStorage.removeItem(t)}catch(e){Ue.B(e)}}},XL=["distinct_id",rp,sT,sp,op],Yf=j({},Ue,{W:function(t){try{var e={};try{e=di.W(t)||{}}catch{}var n=Ye(e,JSON.parse(Ue.q(t)||"{}"));return Ue.G(t,n),n}catch{}return null},G:function(t,e,n,i,r,a){try{Ue.G(t,e,void 0,void 0,a);var o={};XL.forEach((s=>{e[s]&&(o[s]=e[s])})),Object.keys(o).length&&di.G(t,o,n,i,r,a)}catch(s){Ue.B(s)}},V:function(t,e){try{R?.localStorage.removeItem(t),di.V(t,e)}catch(n){Ue.B(n)}}}),Wf={},QL={H:function(){return!0},B:function(t){$.error("memoryStorage error: "+t)},q:function(t){return Wf[t]||null},W:function(t){return Wf[t]||null},G:function(t,e){Wf[t]=e},V:function(t){delete Wf[t]}},Xa=null,St={H:function(){if(!Qi(Xa))return Xa;if(Xa=!0,I(R))Xa=!1;else try{var t="__support__";St.G(t,"xyz"),St.q(t)!=='"xyz"'&&(Xa=!1),St.V(t)}catch{Xa=!1}return Xa},B:function(t){$.error("sessionStorage error: ",t)},q:function(t){try{return R?.sessionStorage.getItem(t)}catch(e){St.B(e)}return null},W:function(t){try{return JSON.parse(St.q(t))||null}catch{}return null},G:function(t,e){try{R?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){St.B(n)}},V:function(t){try{R?.sessionStorage.removeItem(t)}catch(e){St.B(e)}}},Ki=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),Ey=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?Ki.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===Ki.DENIED||this.consent===Ki.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Ki.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:i}=this._instance.config;return i||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return Lv(e)?Ki.GRANTED:ue(mL,e)?Ki.DENIED:Ki.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Ue:di;var n=e==="localStorage"?di:Ue;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Lv(n.q(this.X))),n.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!rT([dn?.doNotTrack,dn?.msDoNotTrack,J.doNotTrack],(e=>Lv(e)))}},Kf=st("[Dead Clicks]"),JL=()=>!0,e3=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(oT)),i=t.instance.config.capture_dead_clicks;return Jr(i)?i:!!ft(i)||n},pp=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,i){this.instance=e,this.isEnabled=n,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[oT]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var n,i;(n=J.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(i=J.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(r=>{r?Kf.error("failed to load script",r):e()}))}et(){var e;if(B){if(!this.tt&&(e=J.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=ft(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=J.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(B),Kf.info("starting...")}}else Kf.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Kf.info("stopping..."))}},vc=st("[ExceptionAutocapture]"),Cy=class{constructor(e){var n,i,r;this.rt=()=>{var a;if(R&&this.isEnabled&&(a=J.__PosthogExtensions__)!=null&&a.errorWrappingFunctions){var o=J.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=J.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=J.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=o(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=s(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){vc.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((n=this._instance.persistence)==null||!n.props[pA]),this.F=this.ht(),this.vt=new ey({refillRate:(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:vc}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ft(e)?n=j({},n,e):(I(e)?this.ut:e)&&(n=j({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(vc.info("enabled"),this.it(this.rt))}it(e){var n,i;(n=J.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(i=J.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return vc.error("failed to load script",r);e()}))}lt(){var e,n,i;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(i=this.ot)==null||i.call(this),this.ot=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ut=!!n||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[pA]:this.ut}),this.startIfEnabled()}captureException(e){var n,i,r=(n=e==null||(i=e.$exception_list)==null||(i=i[0])==null?void 0:i.type)!==null&&n!==void 0?n:"Exception";this.vt.consumeRateLimit(r)?vc.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}};function CA(t,e,n){try{if(!(e in t))return()=>{};var i=t[e],r=n(i);return Qr(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=r,()=>{t[e]=i}}catch{return()=>{}}}var Ay=class{constructor(e){var n;this._instance=e,this.dt=(R==null||(n=R.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&($.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,$.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(R&&R.history){var i=this;(e=R.history.pushState)!=null&&e.__posthog_wrapped__||CA(R.history,"pushState",(r=>function(a,o,s){r.call(this,a,o,s),i.ft("pushState")})),(n=R.history.replaceState)!=null&&n.__posthog_wrapped__||CA(R.history,"replaceState",(r=>function(a,o,s){r.call(this,a,o,s),i.ft("replaceState")})),this.gt()}}ft(e){try{var n,i=R==null||(n=R.location)==null?void 0:n.pathname;if(!i)return;i!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=i}catch(r){$.error("Error capturing "+e+" pageview",r)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};tt(R,"popstate",e),this.ct=()=>{R&&R.removeEventListener("popstate",e)}}}},Fv=st("[SegmentIntegration]");function t3(t,e){var n=t.config.segment;if(!n)return e();(function(i,r){var a=i.config.segment;if(!a)return r();var o=l=>{var c=()=>l.anonymousId()||Xr();i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(Wi,"identified")),r()},s=a.user();"then"in s&&Qr(s.then)?s.then((l=>o(l))):o(s)})(t,(()=>{n.register((i=>{Promise&&Promise.resolve||Fv.warn("This browser does not have Promise support, and can not use the segment integration");var r=(a,o)=>{if(!o)return a;a.event.userId||a.event.anonymousId===i.get_distinct_id()||(Fv.info("No userId set, resetting PostHog"),i.reset()),a.event.userId&&a.event.userId!==i.get_distinct_id()&&(Fv.info("UserId set, identifying with PostHog"),i.identify(a.event.userId));var s=i.calculateEventProperties(o,a.event.properties);return a.event.properties=Object.assign({},s,a.event.properties),a};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:a=>r(a,a.event.event),page:a=>r(a,"$pageview"),identify:a=>r(a,"$identify"),screen:a=>r(a,"$screen")}})(t)).then((()=>{e()}))}))}var xT="posthog-js";function wT(t,e){var{organization:n,projectId:i,prefix:r,severityAllowList:a=["error"],sendExceptionsToPostHog:o=!0}=e===void 0?{}:e;return s=>{var l,c,u,f,h;if(!(a==="*"||a.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var g=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());s.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var _=((l=s.exception)==null?void 0:l.values)||[],b=_.map((d=>j({},d,{stacktrace:d.stacktrace?j({},d.stacktrace,{type:"raw",frames:(d.stacktrace.frames||[]).map((p=>j({},p,{platform:"web:javascript"})))}):void 0}))),w={$exception_message:((c=_[0])==null?void 0:c.value)||s.message,$exception_type:(u=_[0])==null?void 0:u.type,$exception_level:s.level,$exception_list:b,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((f=_[0])==null?void 0:f.value)||s.message,$sentry_exception_type:(h=_[0])==null?void 0:h.type,$sentry_tags:s.tags};return n&&i&&(w.$sentry_url=(r||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+s.event_id),o&&t.exceptions.sendExceptionEvent(w),s}}var Ty=class{constructor(e,n,i,r,a,o){this.name=xT,this.setupOnce=function(s){s(wT(e,{organization:n,projectId:i,prefix:r,severityAllowList:a,sendExceptionsToPostHog:o==null||o}))}}},n3=R!=null&&R.location?fp(R.location.hash,"__posthog")||fp(location.hash,"state"):null,AA="_postHogToolbarParams",TA=st("[Toolbar]"),Kr=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(Kr||{}),ky=class{constructor(e){this.instance=e}_t(e){J.ph_toolbar_state=e}yt(){var e;return(e=J.ph_toolbar_state)!==null&&e!==void 0?e:Kr.UNINITIALIZED}maybeLoadToolbar(e,n,i){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),!R||!B)return!1;e=e??R.location,i=i??R.history;try{if(!n){try{R.localStorage.setItem("test","test"),R.localStorage.removeItem("test")}catch{return!1}n=R?.localStorage}var r,a=n3||fp(e.hash,"__posthog")||fp(e.hash,"state"),o=a?dA((()=>JSON.parse(atob(decodeURIComponent(a)))))||dA((()=>JSON.parse(decodeURIComponent(a)))):null;return o&&o.action==="ph_authorize"?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(n.getItem(AA)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}bt(e){var n=J.ph_load_toolbar||J.ph_load_editor;!Ee(n)&&Qr(n)?n(e,this.instance):TA.warn("No toolbar load function found")}loadToolbar(e){var n=!(B==null||!B.getElementById(lT));if(!R||n)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=j({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(R.localStorage.setItem(AA,JSON.stringify(j({},r,{source:void 0}))),this.yt()===Kr.LOADED)this.bt(r);else if(this.yt()===Kr.UNINITIALIZED){var a;this._t(Kr.LOADING),(a=J.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this.instance,"toolbar",(o=>{if(o)return TA.error("[Toolbar] Failed to load",o),void this._t(Kr.UNINITIALIZED);this._t(Kr.LOADED),this.bt(r)})),tt(R,"turbolinks:load",(()=>{this._t(Kr.UNINITIALIZED),this.loadToolbar(r)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,i){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),this.maybeLoadToolbar(e,n,i)}},i3=st("[TracingHeaders]"),Ry=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var n,i;I(this.xt)&&((n=J.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),I(this.St)&&((i=J.__PosthogExtensions__)==null||(i=i.tracingHeadersPatchFns)==null||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var n,i;(n=J.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(i=J.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return i3.error("failed to load script",r);e()}))}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(n=this.St)==null||n.call(this),this.xt=void 0,this.St=void 0)}},Dn="Mobile",hp="iOS",ui="Android",Hc="Tablet",ET=ui+" "+Hc,CT="iPad",AT="Apple",TT=AT+" Watch",Ic="Safari",Ds="BlackBerry",kT="Samsung",RT=kT+"Browser",OT=kT+" Internet",eo="Chrome",r3=eo+" OS",MT=eo+" "+hp,cb="Internet Explorer",NT=cb+" "+Dn,ub="Opera",a3=ub+" Mini",db="Edge",DT="Microsoft "+db,Os="Firefox",LT=Os+" "+hp,zc="Nintendo",Bc="PlayStation",Ms="Xbox",HT=ui+" "+Dn,IT=Dn+" "+Ic,kc="Windows",Oy=kc+" Phone",kA="Nokia",My="Ouya",zT="Generic",o3=zT+" "+Dn.toLowerCase(),BT=zT+" "+Hc.toLowerCase(),Ny="Konqueror",Dt="(\\d+(\\.\\d+)?)",Uv=new RegExp("Version/"+Dt),s3=new RegExp(Ms,"i"),l3=new RegExp(Bc+" \\w+","i"),c3=new RegExp(zc+" \\w+","i"),fb=new RegExp(Ds+"|PlayBook|BB10","i"),u3={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},d3=(t,e)=>e&&ue(e,AT)||(function(n){return ue(n,Ic)&&!ue(n,eo)&&!ue(n,ui)})(t),$T=function(t,e){return e=e||"",ue(t," OPR/")&&ue(t,"Mini")?a3:ue(t," OPR/")?ub:fb.test(t)?Ds:ue(t,"IE"+Dn)||ue(t,"WPDesktop")?NT:ue(t,RT)?OT:ue(t,db)||ue(t,"Edg/")?DT:ue(t,"FBIOS")?"Facebook "+Dn:ue(t,"UCWEB")||ue(t,"UCBrowser")?"UC Browser":ue(t,"CriOS")?MT:ue(t,"CrMo")||ue(t,eo)?eo:ue(t,ui)&&ue(t,Ic)?HT:ue(t,"FxiOS")?LT:ue(t.toLowerCase(),Ny.toLowerCase())?Ny:d3(t,e)?ue(t,Dn)?IT:Ic:ue(t,Os)?Os:ue(t,"MSIE")||ue(t,"Trident/")?cb:ue(t,"Gecko")?Os:""},f3={[NT]:[new RegExp("rv:"+Dt)],[DT]:[new RegExp(db+"?\\/"+Dt)],[eo]:[new RegExp("("+eo+"|CrMo)\\/"+Dt)],[MT]:[new RegExp("CriOS\\/"+Dt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Dt)],[Ic]:[Uv],[IT]:[Uv],[ub]:[new RegExp("(Opera|OPR)\\/"+Dt)],[Os]:[new RegExp(Os+"\\/"+Dt)],[LT]:[new RegExp("FxiOS\\/"+Dt)],[Ny]:[new RegExp("Konqueror[:/]?"+Dt,"i")],[Ds]:[new RegExp(Ds+" "+Dt),Uv],[HT]:[new RegExp("android\\s"+Dt,"i")],[OT]:[new RegExp(RT+"\\/"+Dt)],[cb]:[new RegExp("(rv:|MSIE )"+Dt)],Mozilla:[new RegExp("rv:"+Dt)]},p3=function(t,e){var n=$T(t,e),i=f3[n];if(I(i))return null;for(var r=0;r<i.length;r++){var a=i[r],o=t.match(a);if(o)return parseFloat(o[o.length-2])}return null},RA=[[new RegExp(Ms+"; "+Ms+" (.*?)[);]","i"),t=>[Ms,t&&t[1]||""]],[new RegExp(zc,"i"),[zc,""]],[new RegExp(Bc,"i"),[Bc,""]],[fb,[Ds,""]],[new RegExp(kc,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Oy,""];if(new RegExp(Dn).test(e)&&!/IEMobile\b/.test(e))return[kc+" "+Dn,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var i=n[1],r=u3[i]||"";return/arm/i.test(e)&&(r="RT"),[kc,r]}return[kc,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[hp,e.join(".")]}return[hp,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=I(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+ui+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ui+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[ui,e.join(".")]}return[ui,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[r3,""]],[/Linux|debian/i,["Linux",""]]],OA=function(t){return c3.test(t)?zc:l3.test(t)?Bc:s3.test(t)?Ms:new RegExp(My,"i").test(t)?My:new RegExp("("+Oy+"|WPDesktop)","i").test(t)?Oy:/iPad/.test(t)?CT:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?TT:fb.test(t)?Ds:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(kA,"i").test(t)?kA:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(Dn).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?ui:ET:ui:new RegExp("(pda|"+Dn+")","i").test(t)?o3:new RegExp(Hc,"i").test(t)&&!new RegExp(Hc+" pc","i").test(t)?BT:""},Xf="https?://(.*)",Is=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],h3=Hs(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Is),Vc="<masked>",g3=["li_fat_id"];function FT(t,e,n){if(!B)return{};var i,r=e?Hs([],Is,n||[]):[],a=UT(Uc(B.URL,r,Vc),t),o=(i={},Re(g3,(function(s){var l=di.q(s);i[s]=l||null})),i);return Ye(o,a)}function UT(t,e){var n=h3.concat(e||[]),i={};return Re(n,(function(r){var a=dp(t,r);i[r]=a||null})),i}function VT(t){var e=(function(a){return a?a.search(Xf+"google.([^/?]*)")===0?"google":a.search(Xf+"bing.com")===0?"bing":a.search(Xf+"yahoo.com")===0?"yahoo":a.search(Xf+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",i={};if(!Qi(e)){i.$search_engine=e;var r=B?dp(B.referrer,n):"";r.length&&(i.ph_keyword=r)}return i}function MA(){return navigator.language||navigator.userLanguage}function jT(){return B?.referrer||"$direct"}function qT(t,e){var n=t?Hs([],Is,e||[]):[],i=Yt?.href.substring(0,1e3);return{r:jT().substring(0,1e3),u:i?Uc(i,n,Vc):void 0}}function PT(t){var e,{r:n,u:i}=t,r={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=up(n))==null?void 0:e.host};if(i){r.$current_url=i;var a=up(i);r.$host=a?.host,r.$pathname=a?.pathname;var o=UT(i);Ye(r,o)}if(n){var s=VT(n);Ye(r,s)}return r}function GT(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function m3(){try{return new Date().getTimezoneOffset()}catch{return}}function v3(t,e){if(!Zt)return{};var n,i,r,a=t?Hs([],Is,e||[]):[],[o,s]=(function(l){for(var c=0;c<RA.length;c++){var[u,f]=RA[c],h=u.exec(l),g=h&&(Qr(f)?f(h,l):f);if(g)return g}return["",""]})(Zt);return Ye(ab({$os:o,$os_version:s,$browser:$T(Zt,navigator.vendor),$device:OA(Zt),$device_type:(i=Zt,r=OA(i),r===CT||r===ET||r==="Kobo"||r==="Kindle Fire"||r===BT?Hc:r===zc||r===Ms||r===Bc||r===My?"Console":r===TT?"Wearable":r?Dn:"Desktop"),$timezone:GT(),$timezone_offset:m3()}),{$current_url:Uc(Yt?.href,a,Vc),$host:Yt?.host,$pathname:Yt?.pathname,$raw_user_agent:Zt.length>1e3?Zt.substring(0,997)+"...":Zt,$browser_version:p3(Zt,navigator.vendor),$browser_language:MA(),$browser_language_prefix:(n=MA(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:R?.screen.height,$screen_width:R?.screen.width,$viewport_height:R?.innerHeight,$viewport_width:R?.innerWidth,$lib:"web",$lib_version:Yi.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Zr=st("[Web Vitals]"),NA=9e5,Dy=class{constructor(e){var n;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((i,r)=>j({},i,{["$web_vitals_"+r.name+"_event"]:j({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=i=>{var r,a=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(I(a))Zr.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=this.Tt();I(o)||(Ee(i?.name)||Ee(i?.value)?Zr.error("Invalid metric received",i):this.Rt&&i.value>=this.Rt?Zr.error("Ignoring metric with value >= "+this.Rt,i):(this.N.url!==o&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),I(this.N.url)&&(this.N.url=o),this.N.firstMetricTimestamp=I(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.N.metrics.push(j({},i,{$current_url:o,$session_id:a.sessionId,$window_id:a.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var i,r,a,o,s=J.__PosthogExtensions__;I(s)||I(s.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:r,onFCP:a,onINP:o}=s.postHogWebVitalsCallbacks),i&&r&&a&&o?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&a(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&o(this.Pt.bind(this)),this.P=!0):Zr.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((n=this._instance.persistence)==null||!n.props[gA]),this.startIfEnabled()}get allowedMetrics(){var e,n,i=ft(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return I(i)?((n=this._instance.persistence)==null?void 0:n.props[mA])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(ft(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=ft(this._instance.config.capture_performance)&&fi(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:NA;return 0<e&&e<=6e4?NA:e}get isEnabled(){var e=Yt?.protocol;if(e!=="http:"&&e!=="https:")return Zr.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=ft(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Jr(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Jr(n)?n:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(Zr.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=ft(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=ft(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[gA]:n}),this._instance.persistence.register({[mA]:i})),this.Et=n,this.startIfEnabled()}it(e){var n,i;(n=J.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(i=J.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",(r=>{r?Zr.error("failed to load script",r):e()}))}Tt(){var e=R?R.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,r=n?Hs([],Is,i||[]):[];return Uc(e,r,Vc)}Zr.error("Could not determine current URL")}},y3=st("[Heatmaps]");function DA(t){return ft(t)&&"clientX"in t&&"clientY"in t&&fi(t.clientX)&&fi(t.clientY)}var Ly=class{constructor(e){var n;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((n=this.instance.persistence)==null||!n.props[dy]),this.rageclicks=new cp(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return ft(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return I(this.instance.config.capture_heatmaps)?I(this.instance.config.enable_heatmaps)?this.Et:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;y3.info("starting..."),this.Ft(),this.Ct()}else{var e;clearInterval((e=this.It)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[dy]:n}),this.Et=n,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ct(){this.It&&clearInterval(this.It),this.It=(function(e){return e?.visibilityState==="visible"})(B)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){R&&B&&(this.jt=this.Dt.bind(this),tt(R,"beforeunload",this.jt),this.Lt=e=>this.At(e||R?.event),tt(B,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||R?.event),tt(B,"mousemove",this.Nt,{capture:!0}),this.zt=new pp(this.instance,JL,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),tt(B,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;R&&B&&(this.jt&&R.removeEventListener("beforeunload",this.jt),this.Lt&&B.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&B.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&B.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,n){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),o=(function(s,l,c){for(var u=s;u&&Cp(u)&&!ta(u,"body");){if(u===c)return!1;if(ue(l,R?.getComputedStyle(u).position))return!0;u=hT(u)}return!1})(fT(e),["fixed","sticky"],a);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:n}}At(e,n){var i;if(n===void 0&&(n="click"),!vA(e.target)&&DA(e)){var r=this.qt(e,n);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(j({},r,{type:"rageclick"})),this.Wt(r)}}Ut(e){!vA(e.target)&&DA(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(R){var n=R.location.href,i=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,a=i?Hs([],Is,r||[]):[],o=Uc(n,a,Vc);this.N=this.N||{},this.N[o]||(this.N[o]=[]),this.N[o].push(e)}}Dt(){this.N&&!ks(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},Hy=class{constructor(e){this._instance=e}doPageView(e,n){var i,r=this.Gt(e,n);return this.Vt={pathname:(i=R?.location.pathname)!==null&&i!==void 0?i:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var n;return this.Gt(e,(n=this.Vt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,n){var i=this.Vt;if(!i)return{$pageview_id:n};var r={$pageview_id:n,$prev_pageview_id:i.pageViewId},a=this._instance.scrollManager.getContext();if(a&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:s,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:f}=a;if(!(I(o)||I(s)||I(l)||I(c)||I(u)||I(f))){o=Math.ceil(o),s=Math.ceil(s),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),f=Math.ceil(f);var h=o<=1?1:ci(s/o,0,1,$),g=o<=1?1:ci(l/o,0,1,$),_=c<=1?1:ci(u/c,0,1,$),b=c<=1?1:ci(f/c,0,1,$);r=Ye(r,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:b})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}},Ln=Uint8Array,Lt=Uint16Array,Ls=Uint32Array,pb=new Ln([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),hb=new Ln([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),LA=new Ln([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ZT=function(t,e){for(var n=new Lt(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new Ls(n[30]);for(i=1;i<30;++i)for(var a=n[i];a<n[i+1];++a)r[a]=a-n[i]<<5|i;return[n,r]},YT=ZT(pb,2),b3=YT[0],Iy=YT[1];b3[28]=258,Iy[258]=28;for(zy=ZT(hb,0)[1],gp=new Lt(32768),Oe=0;Oe<32768;++Oe)Yr=(43690&Oe)>>>1|(21845&Oe)<<1,Yr=(61680&(Yr=(52428&Yr)>>>2|(13107&Yr)<<2))>>>4|(3855&Yr)<<4,gp[Oe]=((65280&Yr)>>>8|(255&Yr)<<8)>>>1;var Yr,zy,gp,Oe,Mc=function(t,e,n){for(var i=t.length,r=0,a=new Lt(e);r<i;++r)++a[t[r]-1];var o,s=new Lt(e);for(r=0;r<e;++r)s[r]=s[r-1]+a[r-1]<<1;if(n){o=new Lt(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],u=e-t[r],f=s[t[r]-1]++<<u,h=f|(1<<u)-1;f<=h;++f)o[gp[f]>>>l]=c}else for(o=new Lt(i),r=0;r<i;++r)o[r]=gp[s[t[r]-1]++]>>>15-t[r];return o},to=new Ln(288);for(Oe=0;Oe<144;++Oe)to[Oe]=8;for(Oe=144;Oe<256;++Oe)to[Oe]=9;for(Oe=256;Oe<280;++Oe)to[Oe]=7;for(Oe=280;Oe<288;++Oe)to[Oe]=8;var mp=new Ln(32);for(Oe=0;Oe<32;++Oe)mp[Oe]=5;var _3=Mc(to,9,0),S3=Mc(mp,5,0),WT=function(t){return(t/8>>0)+(7&t&&1)},KT=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var i=new(t instanceof Lt?Lt:t instanceof Ls?Ls:Ln)(n-e);return i.set(t.subarray(e,n)),i},Zi=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8},yc=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8,t[i+2]|=n>>>16},Vv=function(t,e){for(var n=[],i=0;i<t.length;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,a=n.slice();if(!r)return[new Ln(0),0];if(r==1){var o=new Ln(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(S,T){return S.f-T.f})),n.push({s:-1,f:25001});var s=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:s.f+l.f,l:s,r:l};var h=a[0].s;for(i=1;i<r;++i)a[i].s>h&&(h=a[i].s);var g=new Lt(h+1),_=By(n[u-1],g,0);if(_>e){i=0;var b=0,w=_-e,d=1<<w;for(a.sort((function(S,T){return g[T.s]-g[S.s]||S.f-T.f}));i<r;++i){var p=a[i].s;if(!(g[p]>e))break;b+=d-(1<<_-g[p]),g[p]=e}for(b>>>=w;b>0;){var m=a[i].s;g[m]<e?b-=1<<e-g[m]++-1:++i}for(;i>=0&&b;--i){var v=a[i].s;g[v]==e&&(--g[v],++b)}_=e}return[new Ln(g),_]},By=function(t,e,n){return t.s==-1?Math.max(By(t.l,e,n+1),By(t.r,e,n+1)):e[t.s]=n},HA=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Lt(++e),i=0,r=t[0],a=1,o=function(l){n[i++]=l},s=1;s<=e;++s)if(t[s]==r&&s!=e)++a;else{if(!r&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(r),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(r);a=1,r=t[s]}return[n.subarray(0,i),e]},bc=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},$y=function(t,e,n){var i=n.length,r=WT(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var a=0;a<i;++a)t[r+a+4]=n[a];return 8*(r+4+i)},IA=function(t,e,n,i,r,a,o,s,l,c,u){Zi(e,u++,n),++r[256];for(var f=Vv(r,15),h=f[0],g=f[1],_=Vv(a,15),b=_[0],w=_[1],d=HA(h),p=d[0],m=d[1],v=HA(b),S=v[0],T=v[1],A=new Lt(19),k=0;k<p.length;++k)A[31&p[k]]++;for(k=0;k<S.length;++k)A[31&S[k]]++;for(var C=Vv(A,7),x=C[0],M=C[1],z=19;z>4&&!x[LA[z-1]];--z);var U,P,Z,X,W=c+5<<3,D=bc(r,to)+bc(a,mp)+o,L=bc(r,h)+bc(a,b)+o+14+3*z+bc(A,x)+(2*A[16]+3*A[17]+7*A[18]);if(W<=D&&W<=L)return $y(e,u,t.subarray(l,l+c));if(Zi(e,u,1+(L<D)),u+=2,L<D){U=Mc(h,g,0),P=h,Z=Mc(b,w,0),X=b;var de=Mc(x,M,0);for(Zi(e,u,m-257),Zi(e,u+5,T-1),Zi(e,u+10,z-4),u+=14,k=0;k<z;++k)Zi(e,u+3*k,x[LA[k]]);u+=3*z;for(var fn=[p,S],We=0;We<2;++We){var pn=fn[We];for(k=0;k<pn.length;++k){var Wt=31&pn[k];Zi(e,u,de[Wt]),u+=x[Wt],Wt>15&&(Zi(e,u,pn[k]>>>5&127),u+=pn[k]>>>12)}}}else U=_3,P=to,Z=S3,X=mp;for(k=0;k<s;++k)if(i[k]>255){Wt=i[k]>>>18&31,yc(e,u,U[Wt+257]),u+=P[Wt+257],Wt>7&&(Zi(e,u,i[k]>>>23&31),u+=pb[Wt]);var no=31&i[k];yc(e,u,Z[no]),u+=X[no],no>3&&(yc(e,u,i[k]>>>5&8191),u+=hb[no])}else yc(e,u,U[i[k]]),u+=P[i[k]];return yc(e,u,U[256]),u+P[256]},x3=new Ls([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),w3=(function(){for(var t=new Ls(256),e=0;e<256;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),E3=function(t,e,n,i,r){return(function(a,o,s,l,c,u){var f=a.length,h=new Ln(l+f+5*(1+Math.floor(f/7e3))+c),g=h.subarray(l,h.length-c),_=0;if(!o||f<8)for(var b=0;b<=f;b+=65535){var w=b+65535;w<f?_=$y(g,_,a.subarray(b,w)):(g[b]=u,_=$y(g,_,a.subarray(b,f)))}else{for(var d=x3[o-1],p=d>>>13,m=8191&d,v=(1<<s)-1,S=new Lt(32768),T=new Lt(v+1),A=Math.ceil(s/3),k=2*A,C=function(Qp){return(a[Qp]^a[Qp+1]<<A^a[Qp+2]<<k)&v},x=new Ls(25e3),M=new Lt(288),z=new Lt(32),U=0,P=0,Z=(b=0,0),X=0,W=0;b<f;++b){var D=C(b),L=32767&b,de=T[D];if(S[L]=de,T[D]=L,X<=b){var fn=f-b;if((U>7e3||Z>24576)&&fn>423){_=IA(a,g,0,x,M,z,P,Z,W,b-W,_),Z=U=P=0,W=b;for(var We=0;We<286;++We)M[We]=0;for(We=0;We<30;++We)z[We]=0}var pn=2,Wt=0,no=m,tr=L-de&32767;if(fn>2&&D==C(b-tr))for(var Wk=Math.min(p,fn)-1,Kk=Math.min(32767,b),Xk=Math.min(258,fn);tr<=Kk&&--no&&L!=de;){if(a[b+pn]==a[b+pn-tr]){for(var nr=0;nr<Xk&&a[b+nr]==a[b+nr-tr];++nr);if(nr>pn){if(pn=nr,Wt=tr,nr>Wk)break;var Qk=Math.min(tr,nr-2),w_=0;for(We=0;We<Qk;++We){var Xp=b-tr+We+32768&32767,E_=Xp-S[Xp]+32768&32767;E_>w_&&(w_=E_,de=Xp)}}}tr+=(L=de)-(de=S[L])+32768&32767}if(Wt){x[Z++]=268435456|Iy[pn]<<18|zy[Wt];var C_=31&Iy[pn],A_=31&zy[Wt];P+=pb[C_]+hb[A_],++M[257+C_],++z[A_],X=b+pn,++U}else x[Z++]=a[b],++M[a[b]]}}_=IA(a,g,u,x,M,z,P,Z,W,b-W,_)}return KT(h,0,l+WT(_)+c)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,i,!0)},jv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function C3(t,e){e===void 0&&(e={});var n=(function(){var s=4294967295;return{p:function(l){for(var c=s,u=0;u<l.length;++u)c=w3[255&c^l[u]]^c>>>8;s=c},d:function(){return 4294967295^s}}})(),i=t.length;n.p(t);var r,a=E3(t,e,10+((r=e).filename&&r.filename.length+1||0),8),o=a.length;return(function(s,l){var c=l.filename;if(s[0]=31,s[1]=139,s[2]=8,s[8]=l.level<2?4:l.level==9?2:0,s[9]=3,l.mtime!=0&&jv(s,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){s[3]=8;for(var u=0;u<=c.length;++u)s[u+10]=c.charCodeAt(u)}})(a,e),jv(a,o-8,n.d()),jv(a,o-4,i),a}var A3=function(t){var e,n,i,r,a="";for(e=n=0,i=(t=(t+"").replace(/\r\n/g,`
|
|
459
|
+
`,Da,Wn,Zn,Wr,Zr,Xn,Xr,jf=class extends HTMLElement{constructor(){super();pn(this,Da);pn(this,Wn);pn(this,Zn);pn(this,Wr);pn(this,Zr);pn(this,Xn,null);pn(this,Xr,null);ar(this,Da,this.attachShadow({mode:"open",delegatesFocus:!0})),ar(this,Wn,document.createElement("div")),me(this,Wn).setAttribute("part","mount"),me(this,Da).appendChild(me(this,Wn)),ar(this,Zn,document.createElement("div")),me(this,Zn).id="portalRoot",me(this,Da).appendChild(me(this,Zn)),ar(this,Wr,document.createElement("div")),me(this,Wr).id="overlayContainer",Object.assign(me(this,Wr).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),me(this,Da).appendChild(me(this,Wr)),ar(this,Zr,jv()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){me(this,Xn)?.unmount(),ar(this,Xn,null)}getMountNode(){return me(this,Wn)}getController(){return me(this,Zr)}getPortalRoot(){return me(this,Zn)}getOverlayContainer(){return me(this,Wr)}getShadowRoot(){return me(this,Da)}open(){me(this,Zr).setOpen(!0)}close(){me(this,Zr).setOpen(!1)}toggle(){me(this,Zr).toggle()}setOverrideFetcher(a){me(this,Xr)&&(ar(this,Xr,{...me(this,Xr),fetcher:a}),this.render())}mountReactApp(a){ar(this,Xr,a),this.render()}render(){!this.isConnected||!me(this,Xr)||(me(this,Xn)||ar(this,Xn,(0,p1.createRoot)(me(this,Wn))),me(this,Xn).render((0,sy.jsx)(Gv,{shadowRoot:me(this,Da),portalRoot:me(this,Zn),overlayContainer:me(this,Wr),children:(0,sy.jsx)(iy,{...me(this,Xr),controller:me(this,Zr),canvasHost:this})})))}applyBaseStyles(){if(me(this,Da).adoptedStyleSheets!==void 0){let a=new CSSStyleSheet;a.replaceSync(f1),me(this,Da).adoptedStyleSheets=[a]}else{let a=document.createElement("style");a.textContent=f1,me(this,Da).appendChild(a)}}};Da=new WeakMap,Wn=new WeakMap,Zn=new WeakMap,Wr=new WeakMap,Zr=new WeakMap,Xn=new WeakMap,Xr=new WeakMap;var ly=()=>{typeof window>"u"||customElements.get(d1)||customElements.define(d1,jf)};var Gf=async(t={})=>{if(typeof window>"u"||typeof document>"u")throw new Error("SmartCanvas can only be created in a browser-like environment");let e=null;if(t.antiFlicker){let x=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=MI(x)}let a=null,r=null,n=null,{runtime:o}=t;async function i(x){!o?.actions||x.length===0||(n?.isApplied()&&await n.revertAll(),n=await o.actions.applyBatch(x))}async function s(){n?.isApplied()&&(await n.revertAll(),n=null)}if(t.fetcher)try{r=t.fetcher,console.log("[SmartCanvas] Fetching initial config...");let x=await t.fetcher();a=x,console.log("[SmartCanvas] Config fetched:",`tiles=${x.tiles?.length??0},`,`actions=${x.actions?.length??0},`,`theme=${x.theme?.mode??"default"}`),x.actions?.length&&console.log("[SmartCanvas] Actions to apply:",x.actions.map((f,m)=>`[${m}] ${f.kind}${f.anchorId?` anchor="${typeof f.anchorId=="string"?f.anchorId:f.anchorId.selector}"`:""}${f.label?` "${f.label}"`:""}`).join(", ")),x.actions&&x.actions.length>0&&o?.actions&&(await i(x.actions),console.log("[SmartCanvas] Initial actions applied successfully")),x.tiles&&o?.accumulator&&xu(x.tiles,o.accumulator,x.actions)}catch(x){console.error("[SmartCanvas] Error fetching/applying initial config:",x)}e&&e();let l=PI();ly();let u=document.createElement("smart-canvas");if(VI(u.getOverlayContainer()),t.tokens)for(let[x,f]of Object.entries(t.tokens))u.style.setProperty(x,f);let c=()=>{let x=t.target??document.body;x&&x.appendChild(u)};document.body?c():document.addEventListener("DOMContentLoaded",c,{once:!0}),l&&(console.log(`[SmartCanvas] Loading editor SDK for ${l} mode`),HI(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,p=t.integrations?.telemetry,g=t.fetcher??Vo({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});r||(r=g);let S={fetcher:g,pollIntervalMs:t.pollIntervalMs,experiments:d,telemetry:p,runtime:o,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,initialBatchHandle:n,workspaceTheme:t.workspaceTheme};u.mountReactApp(S),t.defaultOpen&&u.open();let b={el:u,open:()=>u.open(),close:()=>u.close(),destroy:()=>{s(),u.remove()},setTokens:x=>{for(let[f,m]of Object.entries(x))u.style.setProperty(f,m)},getConfig:async()=>{if(r)try{let x=await r();return a=x,x}catch(x){console.error("[SmartCanvas] Error fetching config:",x)}return a??{tiles:[],actions:[],fetchedAt:""}},setEnabled:async x=>{x?a&&await i(a.actions):await s()},setOverrideFetcher:x=>{r=x,u.setOverrideFetcher(x),o?.accumulator&&x().then(f=>{f?.tiles&&xu(f.tiles,o.accumulator,f.actions)}).catch(()=>{})},registerTelemetryProperties:x=>{p?.register?.(x)},getSessionId:()=>p?.getSessionId?.(),startSessionRecording:()=>{p?.startSessionRecording?.()},track:(x,f)=>p?.track?(p.track(x,f),!0):!1,runtime:o};if(typeof window<"u"){let x=window.SynOS;x&&(x.handle=b)}return b};typeof window<"u"&&(window.SmartCanvas={async create(t){return Gf(t)}});var Kn=K(We(),1);var Yn=K(Me(),1);function gO({tiles:t,intervalMs:e=7e3,telemetry:a}){let[r,n]=(0,Kn.useState)(0),o=(0,Kn.useMemo)(()=>[...t].sort((i,s)=>(i.priority??0)-(s.priority??0)),[t]);return(0,Kn.useEffect)(()=>{a?.trackCanvasOpened("wheel")},[a]),(0,Kn.useEffect)(()=>{if(o.length<=1)return;let i=setInterval(()=>{n(s=>(s+1)%o.length)},e);return()=>clearInterval(i)},[o,e]),(0,Kn.useEffect)(()=>{let i=o[r];i&&a?.trackRectangleViewed(i.id,"wheel")},[r,o,a]),o.length?(0,Yn.jsxs)("div",{style:{position:"relative",overflow:"hidden",borderRadius:"1.5rem",border:"var(--sc-tile-border)",background:"var(--sc-tile-background)",padding:"1.5rem",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},"data-shadow-canvas-id":"wheel",children:[(0,Yn.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${r*100}%)`,width:`${o.length*100}%`},children:o.map(i=>(0,Yn.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,Yn.jsx)(vs,{config:i,surface:"wheel",telemetry:a})},i.id))}),(0,Yn.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((i,s)=>(0,Yn.jsx)("button",{type:"button",style:{height:"0.5rem",width:"1.5rem",borderRadius:"9999px",background:s===r?"var(--sc-color-primary)":"var(--sc-tile-text-color)",border:"none",cursor:"pointer",padding:0},onClick:()=>n(s)},i.id))})]}):null}function xs(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function vO(t){let e=[],a=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let r=t;if(r.tiles||a.push("Config missing required field: tiles"),r.actions||a.push("Config missing required field: actions"),r.fetchedAt||a.push("Config missing required field: fetchedAt"),a.length>0)return{valid:!1,errors:a,warnings:e};let n=r.schemaVersion||"1.0",o=xs(n),i=xs(jr);return o.major>i.major&&e.push(`Config schema v${n} is newer than SDK v${jr}. Some features may not work. Update SDK to latest version.`),o.major<i.major||!r.schemaVersion?(e.push(`Config schema v${n} is older than SDK v${jr}. Migrating config to current version.`),{valid:!0,warnings:e,errors:a,migratedConfig:yO(r,n)}):{valid:!0,warnings:e,errors:a}}function yO(t,e){let a={...t};return xs(e).major===1&&(a=xO(a)),a.schemaVersion=jr,a}function xO(t){let e={schemaVersion:"2.0",tiles:[],actions:t.actions||[],fetchedAt:t.fetchedAt||new Date().toISOString()};return t.tiles&&Array.isArray(t.tiles)&&(e.tiles=t.tiles.map(a=>{let r={...a};return a.experiment&&delete r.experiment,r})),t.configVersion&&(e.configVersion=t.configVersion),t.canvasTitle&&(e.canvasTitle=t.canvasTitle),t.theme&&(e.theme=t.theme),t.launcher&&(e.launcher=t.launcher),e}function bO(t){if(!t||typeof t!="object")return!1;let e=t,a=e.schemaVersion||"1.0",r=xs(a),n=xs(jr);return r.major<n.major||!e.schemaVersion}var m1={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function g1(){return m1}function uy(t){let e=2166136261,a=t.length;for(let r=0;r<a;r++)e^=t.charCodeAt(r),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function ku(t,e,a){return a===2?uy(uy(t+e)+"")%1e4/1e4:a===1?uy(e+t)%1e3/1e3:null}function SO(t){return t<=0?[]:new Array(t).fill(1/t)}function Wf(t,e){return t>=e[0]&&t<e[1]}function v1(t,e){let a=ku("__"+e[0],t,1);return a===null?!1:a>=e[1]&&a<e[2]}function y1(t,e){for(let a=0;a<e.length;a++)if(Wf(t,e[a]))return a;return-1}function dy(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function Zf(t,e){if(!e.length)return!1;let a=!1,r=!1;for(let n=0;n<e.length;n++){let o=wO(t,e[n].type,e[n].pattern);if(e[n].include===!1){if(o)return!1}else a=!0,o&&(r=!0)}return r||!a}function CO(t,e,a){try{let r=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return a&&(r="\\/?"+r.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+r+"$","i").test(t)}catch{return!1}}function _O(t,e){try{let a=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),r=[[t.host,a.host,!1],[t.pathname,a.pathname,!0]];return a.hash&&r.push([t.hash,a.hash,!1]),a.searchParams.forEach((n,o)=>{r.push([t.searchParams.get(o)||"",n,!1])}),!r.some(n=>!CO(n[0],n[1],n[2]))}catch{return!1}}function wO(t,e,a){try{let r=new URL(t,"https://_");if(e==="regex"){let n=dy(a);return n?n.test(r.href)||n.test(r.href.substring(r.origin.length)):!1}else if(e==="simple")return _O(r,a);return!1}catch{return!1}}function x1(t,e,a){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let r=SO(t);a=a||r,a.length!==t&&(a=r);let n=a.reduce((i,s)=>s+i,0);(n<.99||n>1.01)&&(a=r);let o=0;return a.map(i=>{let s=o;return o+=i,[s,s+e*i]})}function b1(t,e,a){if(!e)return null;let r=e.split("?")[1];if(!r)return null;let n=r.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return n.length>0&&n[0]>=0&&n[0]<a?n[0]:null}function S1(t){try{return t()}catch(e){return console.error(e),!1}}var cy=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function Wo(t,e,a){if(e=e||"",a=a||globalThis.crypto&&globalThis.crypto.subtle||m1.SubtleCrypto,!a)throw new Error("No SubtleCrypto implementation found");try{let r=await a.importKey("raw",cy(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[n,o]=t.split("."),i=await a.decrypt({name:"AES-CBC",iv:cy(n)},r,cy(o));return new TextDecoder().decode(i)}catch{throw new Error("Failed to decrypt")}}function Eu(t){return typeof t=="string"?t:JSON.stringify(t)}function ga(t){typeof t=="number"&&(t=t+""),(!t||typeof t!="string")&&(t="0");let e=t.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return e.length===3&&e.push("~"),e.map(a=>a.match(/^[0-9]+$/)?a.padStart(5," "):a).join("-")}function C1(){let t;try{t="1.6.4"}catch{t=""}return t}function _1(t,e){let a,r;try{a=new URL(t),r=new URL(e)}catch(n){return console.error(`Unable to merge query strings: ${n}`),e}return a.searchParams.forEach((n,o)=>{r.searchParams.has(o)||r.searchParams.set(o,n)}),r.toString()}function h1(t){return typeof t=="object"&&t!==null}function Xf(t){return t.urlPatterns&&t.variations.some(e=>h1(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>h1(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function Yf(t,e){return new Promise(a=>{let r=!1,n,o=i=>{r||(r=!0,n&&clearTimeout(n),a(i||null))};e&&(n=setTimeout(()=>o(),e)),t.then(i=>o(i)).catch(()=>o())})}var Rt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},fr=g1(),bs={fetchFeaturesCall:({host:t,clientKey:e,headers:a})=>fr.fetch(`${t}/api/features/${e}`,{headers:a}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:a,headers:r})=>{let n={method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(a)};return fr.fetch(`${t}/api/eval/${e}`,n)},eventSourceCall:({host:t,clientKey:e,headers:a})=>a?new fr.EventSource(`${t}/sub/${e}`,{headers:a}):new fr.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let a=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),AO()):document.visibilityState==="hidden"&&(t=window.setTimeout(IO,Rt.idleStreamInterval))};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(fr.localStorage=globalThis.localStorage)}catch{}var Ss=new Map,w1=!1,Yr=new Map,Kf=new Map,Cs=new Map,_s=new Set;function I1(t){Object.assign(Rt,t),Rt.backgroundSync||vy()}async function A1({instance:t,timeout:e,skipCache:a,allowStale:r,backgroundSync:n}){return n||(Rt.backgroundSync=!1),kO({instance:t,allowStale:r,timeout:e,skipCache:a})}function LO(t){let e=Tu(t),a=Ss.get(e)||new Set;a.add(t),Ss.set(e,a)}function k1(t){Ss.forEach(e=>e.delete(t))}function IO(){Cs.forEach(t=>{t&&(t.state="idle",my(t))})}function AO(){Cs.forEach(t=>{t&&t.state==="idle"&&gy(t)})}async function L1(){try{if(!fr.localStorage)return;await fr.localStorage.setItem(Rt.cacheKey,JSON.stringify(Array.from(Yr.entries())))}catch{}}async function kO({instance:t,allowStale:e,timeout:a,skipCache:r}){let n=Tu(t),o=py(t),i=new Date,s=new Date(i.getTime()-Rt.maxAge+Rt.staleTTL);await EO();let l=!Rt.disableCache&&!r?Yr.get(o):void 0;return l&&(e||l.staleAt>i)&&l.staleAt>s?(l.sse&&_s.add(n),l.staleAt<i?fy(t):hy(t),{data:l.data,success:!0,source:"cache"}):await Yf(fy(t),a)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function Tu(t){let[e,a]=t.getApiInfo();return`${e}||${a}`}function py(t){let e=Tu(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let a=t.getAttributes(),r=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),n={};r.forEach(s=>{n[s]=a[s]});let o=t.getForcedVariations(),i=t.getUrl();return`${e}||${JSON.stringify({ca:n,fv:o,url:i})}`}async function EO(){if(!w1){w1=!0;try{if(fr.localStorage){let t=await fr.localStorage.getItem(Rt.cacheKey);if(!Rt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([a,r])=>{Yr.set(a,{...r,staleAt:new Date(r.staleAt)})}),E1()}}}catch{}if(!Rt.disableIdleStreams){let t=bs.startIdleListener();t&&(bs.stopIdleListener=t)}}}function E1(){let t=Array.from(Yr.entries()).map(([a,r])=>({key:a,staleAt:r.staleAt.getTime()})).sort((a,r)=>a.staleAt-r.staleAt),e=Math.min(Math.max(0,Yr.size-Rt.maxEntries),Yr.size);for(let a=0;a<e;a++)Yr.delete(t[a].key)}function T1(t,e,a){let r=a.dateUpdated||"",n=new Date(Date.now()+Rt.staleTTL),o=Rt.disableCache?void 0:Yr.get(e);if(o&&r&&o.version===r){o.staleAt=n,L1();return}Rt.disableCache||(Yr.set(e,{data:a,version:r,staleAt:n,sse:_s.has(t)}),E1()),L1();let i=Ss.get(t);i&&i.forEach(s=>TO(s,a))}async function TO(t,e){await t.setPayload(e||t.getPayload())}async function fy(t){let{apiHost:e,apiRequestHeaders:a}=t.getApiHosts(),r=t.getClientKey(),n="isRemoteEval"in t&&t.isRemoteEval(),o=Tu(t),i=py(t),s=Kf.get(i);return s||(s=(n?bs.fetchRemoteEvalCall({host:e,clientKey:r,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:a}):bs.fetchFeaturesCall({host:e,clientKey:r,headers:a})).then(u=>{if(!u.ok)throw new Error(`HTTP error: ${u.status}`);return u.headers.get("x-sse-support")==="enabled"&&_s.add(o),u.json()}).then(u=>(T1(o,i,u),hy(t),Kf.delete(i),{data:u,success:!0,source:"network"})).catch(u=>(Kf.delete(i),{data:null,source:"error",success:!1,error:u})),Kf.set(i,s)),s}function hy(t,e=!1){let a=Tu(t),r=py(t),{streamingHost:n,streamingHostRequestHeaders:o}=t.getApiHosts(),i=t.getClientKey();if(e&&_s.add(a),Rt.backgroundSync&&_s.has(a)&&fr.EventSource){if(Cs.has(a))return;let s={src:null,host:n,clientKey:i,headers:o,cb:l=>{try{if(l.type==="features-updated"){let u=Ss.get(a);u&&u.forEach(c=>{fy(c)})}else if(l.type==="features"){let u=JSON.parse(l.data);T1(a,r,u)}s.errors=0}catch{R1(s)}},errors:0,state:"active"};Cs.set(a,s),gy(s)}}function R1(t){if(t.state!=="idle"&&(t.errors++,t.errors>3||t.src&&t.src.readyState===2)){let e=Math.pow(3,t.errors-3)*(1e3+Math.random()*1e3);my(t),setTimeout(()=>{["idle","active"].includes(t.state)||gy(t)},Math.min(e,3e5))}}function my(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function gy(t){t.src=bs.eventSourceCall({host:t.host,clientKey:t.clientKey,headers:t.headers}),t.state="active",t.src.addEventListener("features",t.cb),t.src.addEventListener("features-updated",t.cb),t.src.onerror=()=>R1(t),t.src.onopen=()=>{t.errors=0}}function RO(t,e){my(t),Cs.delete(e)}function vy(){_s.clear(),Cs.forEach(RO),Ss.clear(),bs.stopIdleListener()}function Qf(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&hy(t,!0),LO(t)}}var MO=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,by={revert:function(){}},ap=new Map,Sy=new Set;function DO(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function rp(t){var e=ap.get(t);return e||(e={element:t,attributes:{}},ap.set(t,e)),e}function np(t,e,a,r,n){var o=a(t),i={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&i._positionTimeout)){e==="position"&&(i._positionTimeout=setTimeout(function(){i._positionTimeout=null},1e3));var s=a(t);e==="position"&&s.parentNode===i.virtualValue.parentNode&&s.insertBeforeNode===i.virtualValue.insertBeforeNode||s!==i.virtualValue&&(i.originalValue=s,n(i))}}),mutationRunner:n,setValue:r,getCurrentValue:a};return e==="position"&&t.parentNode?i.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):i.observer.observe(t,DO(e)),i}function op(t,e){var a=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!a||t.parentNode!==a.parentNode||t.insertBeforeNode!==a.insertBeforeNode)&&(e.isDirty=!0,M1()):t!==a&&(e.isDirty=!0,M1())}function OO(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),op(ZO(e),t)}function BO(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(a){return a.mutate(e)}),op(Array.from(e).filter(Boolean).join(" "),t)}function FO(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),op(e,t)}function NO(t){var e=t.parentSelector,a=t.insertBeforeSelector,r=document.querySelector(e);if(!r)return null;var n=a?document.querySelector(a):null;return a&&!n?null:{parentNode:r,insertBeforeNode:n}}function PO(t){var e=t.originalValue;t.mutations.forEach(function(a){var r=a.mutate(),n=NO(r);e=n||e}),op(e,t)}var HO=function(e){return e.innerHTML},UO=function(e,a){return e.innerHTML=a};function O1(t){var e=rp(t);return e.html||(e.html=np(t,"html",HO,UO,OO)),e.html}var qO=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},zO=function(e,a){a.insertBeforeNode&&!a.parentNode.contains(a.insertBeforeNode)||a.parentNode.insertBefore(e,a.insertBeforeNode)};function B1(t){var e=rp(t);return e.position||(e.position=np(t,"position",qO,zO,PO)),e.position}var VO=function(e,a){return a?e.className=a:e.removeAttribute("class")},$O=function(e){return e.className};function F1(t){var e=rp(t);return e.classes||(e.classes=np(t,"class",$O,VO,BO)),e.classes}var jO=function(e){return function(a){var r;return(r=a.getAttribute(e))!=null?r:null}},GO=function(e){return function(a,r){return r!==null?a.setAttribute(e,r):a.removeAttribute(e)}};function N1(t,e){var a=rp(t);return a.attributes[e]||(a.attributes[e]=np(t,e,jO(e),GO(e),FO)),a.attributes[e]}function WO(t,e){var a=ap.get(t);if(a)if(e==="html"){var r,n;(r=a.html)==null||(n=r.observer)==null||n.disconnect(),delete a.html}else if(e==="class"){var o,i;(o=a.classes)==null||(i=o.observer)==null||i.disconnect(),delete a.classes}else if(e==="position"){var s,l;(s=a.position)==null||(l=s.observer)==null||l.disconnect(),delete a.position}else{var u,c,d;(u=a.attributes)==null||(c=u[e])==null||(d=c.observer)==null||d.disconnect(),delete a.attributes[e]}}var Jf;function ZO(t){return Jf||(Jf=document.createElement("div")),Jf.innerHTML=t,Jf.innerHTML}function ep(t,e,a){if(a.isDirty){a.isDirty=!1;var r=a.virtualValue;a.mutations.length||WO(t,e),a.setValue(t,r)}}function XO(t,e){t.html&&ep(e,"html",t.html),t.classes&&ep(e,"class",t.classes),t.position&&ep(e,"position",t.position),Object.keys(t.attributes).forEach(function(a){ep(e,a,t.attributes[a])})}function M1(){ap.forEach(XO)}function YO(t,e){var a=null;t.kind==="html"?a=O1(e):t.kind==="class"?a=F1(e):t.kind==="attribute"?a=N1(e,t.attribute):t.kind==="position"&&(a=B1(e)),a&&(a.mutations.push(t),a.mutationRunner(a))}function KO(t,e){var a=null;if(t.kind==="html"?a=O1(e):t.kind==="class"?a=F1(e):t.kind==="attribute"?a=N1(e,t.attribute):t.kind==="position"&&(a=B1(e)),!!a){var r=a.mutations.indexOf(t);r!==-1&&a.mutations.splice(r,1),a.mutationRunner(a)}}function P1(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),a=document.querySelectorAll(t.selector);a.forEach(function(r){e.has(r)||(t.elements.add(r),YO(t,r))})}}function QO(t){t.elements.forEach(function(e){return KO(t,e)}),t.elements.clear(),Sy.delete(t)}function D1(){Sy.forEach(P1)}var yy;function JO(){typeof document>"u"||(yy||(yy=new MutationObserver(function(){D1()})),D1(),yy.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}JO();function ip(t){return typeof document>"u"?by:(Sy.add(t),P1(t),{revert:function(){QO(t)}})}function xy(t,e){return ip({kind:"html",elements:new Set,mutate:e,selector:t})}function H1(t,e){return ip({kind:"position",elements:new Set,mutate:e,selector:t})}function Ru(t,e){return ip({kind:"class",elements:new Set,mutate:e,selector:t})}function tp(t,e,a){return MO.test(e)?e==="class"||e==="className"?Ru(t,function(r){var n=a(Array.from(r).join(" "));r.clear(),n&&n.split(/\s+/g).filter(Boolean).forEach(function(o){return r.add(o)})}):ip({kind:"attribute",attribute:e,elements:new Set,mutate:a,selector:t}):by}function eB(t){var e=t.selector,a=t.action,r=t.value,n=t.attribute,o=t.parentSelector,i=t.insertBeforeSelector;if(n==="html"){if(a==="append")return xy(e,function(s){return s+(r??"")});if(a==="set")return xy(e,function(){return r??""})}else if(n==="class"){if(a==="append")return Ru(e,function(s){r&&s.add(r)});if(a==="remove")return Ru(e,function(s){r&&s.delete(r)});if(a==="set")return Ru(e,function(s){s.clear(),r&&s.add(r)})}else if(n==="position"){if(a==="set"&&o)return H1(e,function(){return{insertBeforeSelector:i,parentSelector:o}})}else{if(a==="append")return tp(e,n,function(s){return s!==null?s+(r??""):r??""});if(a==="set")return tp(e,n,function(){return r??""});if(a==="remove")return tp(e,n,function(){return null})}return by}var tB={html:xy,classes:Ru,attribute:tp,position:H1,declarative:eB},U1=tB;var Cy={};function Qn(t,e,a){a=a||{};for(let[r,n]of Object.entries(e))switch(r){case"$or":if(!V1(t,n,a))return!1;break;case"$nor":if(V1(t,n,a))return!1;break;case"$and":if(!iB(t,n,a))return!1;break;case"$not":if(Qn(t,n,a))return!1;break;default:if(!Mu(n,aB(t,r),a))return!1}return!0}function aB(t,e){let a=e.split("."),r=t;for(let n=0;n<a.length;n++)if(r&&typeof r=="object"&&a[n]in r)r=r[a[n]];else return null;return r}function q1(t,e=!1){let a=`${t}${e?"/i":""}`;return Cy[a]||(Cy[a]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),Cy[a]}function Mu(t,e,a,r=!1){if(typeof t=="string")return r?String(e).toLowerCase()===t.toLowerCase():e+""===t;if(typeof t=="number")return e*1===t;if(typeof t=="boolean")return e!==null&&!!e===t;if(t===null)return e===null;if(Array.isArray(t)||!$1(t))return JSON.stringify(e)===JSON.stringify(t);for(let n in t)if(!oB(n,e,t[n],a))return!1;return!0}function $1(t){let e=Object.keys(t);return e.length>0&&e.filter(a=>a[0]==="$").length===e.length}function rB(t){if(t===null)return"null";if(Array.isArray(t))return"array";let e=typeof t;return["string","number","boolean","object","undefined"].includes(e)?e:"unknown"}function nB(t,e,a){if(!Array.isArray(t))return!1;let r=$1(e)?n=>Mu(e,n,a):n=>Qn(n,e,a);for(let n=0;n<t.length;n++)if(t[n]&&r(t[n]))return!0;return!1}function ws(t,e,a=!1){if(a){let r=n=>typeof n=="string"?n.toLowerCase():n;return Array.isArray(t)?t.some(n=>e.some(o=>r(n)===r(o))):e.some(n=>r(t)===r(n))}return Array.isArray(t)?t.some(r=>e.includes(r)):e.includes(t)}function z1(t,e,a,r=!1){if(!Array.isArray(t))return!1;for(let n=0;n<e.length;n++){let o=!1;for(let i=0;i<t.length;i++)if(Mu(e[n],t[i],a,r)){o=!0;break}if(!o)return!1}return!0}function oB(t,e,a,r){switch(t){case"$veq":return ga(e)===ga(a);case"$vne":return ga(e)!==ga(a);case"$vgt":return ga(e)>ga(a);case"$vgte":return ga(e)>=ga(a);case"$vlt":return ga(e)<ga(a);case"$vlte":return ga(e)<=ga(a);case"$eq":return e===a;case"$ne":return e!==a;case"$lt":return e<a;case"$lte":return e<=a;case"$gt":return e>a;case"$gte":return e>=a;case"$exists":return a?e!=null:e==null;case"$in":return Array.isArray(a)?ws(e,a):!1;case"$ini":return Array.isArray(a)?ws(e,a,!0):!1;case"$inGroup":return ws(e,r[a]||[]);case"$notInGroup":return!ws(e,r[a]||[]);case"$nin":return Array.isArray(a)?!ws(e,a):!1;case"$nini":return Array.isArray(a)?!ws(e,a,!0):!1;case"$not":return!Mu(a,e,r);case"$size":return Array.isArray(e)?Mu(a,e.length,r):!1;case"$elemMatch":return nB(e,a,r);case"$all":return Array.isArray(a)?z1(e,a,r):!1;case"$alli":return Array.isArray(a)?z1(e,a,r,!0):!1;case"$regex":try{return q1(a).test(e)}catch{return!1}case"$regexi":try{return q1(a,!0).test(e)}catch{return!1}case"$type":return rB(e)===a;default:return console.error("Unknown operator: "+t),!1}}function V1(t,e,a){if(!e.length)return!0;for(let r=0;r<e.length;r++)if(Qn(t,e[r],a))return!0;return!1}function iB(t,e,a){for(let r=0;r<e.length;r++)if(!Qn(t,e[r],a))return!1;return!0}var sB="Feature Evaluated",lB="Experiment Viewed";function uB(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((a,r)=>e.set(r,a)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((a,r)=>e.set(r,a)),e}function cB(t){return t.global.forcedVariations&&t.user.forcedVariations?{...t.global.forcedVariations,...t.user.forcedVariations}:t.global.forcedVariations?t.global.forcedVariations:t.user.forcedVariations?t.user.forcedVariations:{}}async function Ls(t){try{await t()}catch{}}function j1(t,e,a){if(t.user.trackedExperiments){let n=up(e,a);if(t.user.trackedExperiments.has(n))return[];t.user.trackedExperiments.add(n)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:a,timestamp:Date.now().toString(),logType:"experiment"});let r=[];if(t.global.trackingCallback){let n=t.global.trackingCallback;r.push(Ls(()=>n(e,a,t.user)))}if(t.user.trackingCallback){let n=t.user.trackingCallback;r.push(Ls(()=>n(e,a)))}if(t.global.eventLogger){let n=t.global.eventLogger;r.push(Ls(()=>n(lB,{experimentId:e.key,variationId:a.key,hashAttribute:a.hashAttribute,hashValue:a.hashValue},t.user)))}return r}function dB(t,e,a){if(t.user.trackedFeatureUsage){let r=JSON.stringify(a.value);if(t.user.trackedFeatureUsage[e]===r)return;t.user.trackedFeatureUsage[e]=r,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:a,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let r=t.global.onFeatureUsage;Ls(()=>r(e,a,t.user))}if(t.user.onFeatureUsage){let r=t.user.onFeatureUsage;Ls(()=>r(e,a))}if(t.global.eventLogger){let r=t.global.eventLogger;Ls(()=>r(sB,{feature:e,source:a.source,value:a.value,ruleId:a.source==="defaultValue"?"$default":a.ruleId||"",variationId:a.experimentResult?a.experimentResult.key:""},t.user))}}function sp(t,e){if(e.stack.evaluatedFeatures.has(t))return Jn(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let a=uB(e);if(a.has(t))return Jn(e,t,a.get(t),"override");if(!e.global.features||!e.global.features[t])return Jn(e,t,null,"unknownFeature");let r=e.global.features[t];if(r.rules){let n=new Set(e.stack.evaluatedFeatures);e:for(let o of r.rules){if(o.parentConditions)for(let l of o.parentConditions){e.stack.evaluatedFeatures=new Set(n);let u=sp(l.id,e);if(u.source==="cyclicPrerequisite")return Jn(e,t,null,"cyclicPrerequisite");let c={value:u.value};if(!Qn(c,l.condition||{})){if(l.gate)return Jn(e,t,null,"prerequisite");continue e}}if(o.filters&&Z1(o.filters,e))continue;if("force"in o){if(o.condition&&!W1(o.condition,e)||!fB(e,o.seed||t,o.hashAttribute,e.user.saveStickyBucketAssignmentDoc&&!o.disableStickyBucketing?o.fallbackAttribute:void 0,o.range,o.coverage,o.hashVersion))continue;return o.tracks&&o.tracks.forEach(l=>{!j1(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),Jn(e,t,o.force,"force",o.id)}if(!o.variations)continue;let i={variations:o.variations,key:o.key||t};"coverage"in o&&(i.coverage=o.coverage),o.weights&&(i.weights=o.weights),o.hashAttribute&&(i.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(i.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(i.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(i.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(i.minBucketVersion=o.minBucketVersion),o.namespace&&(i.namespace=o.namespace),o.meta&&(i.meta=o.meta),o.ranges&&(i.ranges=o.ranges),o.name&&(i.name=o.name),o.phase&&(i.phase=o.phase),o.seed&&(i.seed=o.seed),o.hashVersion&&(i.hashVersion=o.hashVersion),o.filters&&(i.filters=o.filters),o.condition&&(i.condition=o.condition);let{result:s}=lp(i,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(i,s),s.inExperiment&&!s.passthrough)return Jn(e,t,s.value,"experiment",o.id,i,s)}}return Jn(e,t,r.defaultValue===void 0?null:r.defaultValue,"defaultValue")}function lp(t,e,a){let r=t.key,n=t.variations.length;if(n<2)return{result:$e(a,t,-1,!1,e)};if(a.global.enabled===!1||a.user.enabled===!1)return{result:$e(a,t,-1,!1,e)};if(t=pB(t,a),t.urlPatterns&&!Zf(a.user.url||"",t.urlPatterns))return{result:$e(a,t,-1,!1,e)};let o=b1(r,a.user.url||"",n);if(o!==null)return{result:$e(a,t,o,!1,e)};let i=cB(a);if(r in i){let x=i[r];return{result:$e(a,t,x,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:$e(a,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=Zo(a,t.hashAttribute,a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:$e(a,t,-1,!1,e)};let u=-1,c=!1,d=!1;if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:x,versionIsBlocked:f}=gB({ctx:a,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});c=x>=0,u=x,d=!!f}if(!c){if(t.filters){if(Z1(t.filters,a))return{result:$e(a,t,-1,!1,e)}}else if(t.namespace&&!v1(l,t.namespace))return{result:$e(a,t,-1,!1,e)};if(t.include&&!S1(t.include))return{result:$e(a,t,-1,!1,e)};if(t.condition&&!W1(t.condition,a))return{result:$e(a,t,-1,!1,e)};if(t.parentConditions){let x=new Set(a.stack.evaluatedFeatures);for(let f of t.parentConditions){a.stack.evaluatedFeatures=new Set(x);let m=sp(f.id,a);if(m.source==="cyclicPrerequisite")return{result:$e(a,t,-1,!1,e)};let v={value:m.value};if(!Qn(v,f.condition||{}))return{result:$e(a,t,-1,!1,e)}}}if(t.groups&&!mB(t.groups,a))return{result:$e(a,t,-1,!1,e)}}if(t.url&&!hB(t.url,a))return{result:$e(a,t,-1,!1,e)};let p=ku(t.seed||r,l,t.hashVersion||1);if(p===null)return{result:$e(a,t,-1,!1,e)};if(!c){let x=t.ranges||x1(n,t.coverage===void 0?1:t.coverage,t.weights);u=y1(p,x)}if(d)return{result:$e(a,t,-1,!1,e,void 0,!0)};if(u<0)return{result:$e(a,t,-1,!1,e)};if("force"in t)return{result:$e(a,t,t.force===void 0?-1:t.force,!1,e)};if(a.global.qaMode||a.user.qaMode)return{result:$e(a,t,-1,!1,e)};if(t.status==="stopped")return{result:$e(a,t,-1,!1,e)};let g=$e(a,t,u,!0,e,p,c);if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:x,key:f,doc:m}=yB(a,s,Eu(l),{[_y(t.key,t.bucketVersion)]:g.key});x&&(a.user.stickyBucketAssignmentDocs=a.user.stickyBucketAssignmentDocs||{},a.user.stickyBucketAssignmentDocs[f]=m,a.user.saveStickyBucketAssignmentDoc(m))}let S=j1(a,t,g);S.length===0&&a.global.saveDeferredTrack&&a.global.saveDeferredTrack({experiment:t,result:g});let b=S.length?S.length===1?S[0]:Promise.all(S).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&a.global.recordChangeId&&a.global.recordChangeId(t.changeId),{result:g,trackingCall:b}}function Jn(t,e,a,r,n,o,i){let s={value:a,on:!!a,off:!a,source:r,ruleId:n||""};return o&&(s.experiment=o),i&&(s.experimentResult=i),r!=="override"&&dB(t,e,s),s}function G1(t){return{...t.user.attributes,...t.user.attributeOverrides}}function W1(t,e){return Qn(G1(e),t,e.global.savedGroups||{})}function Z1(t,e){return t.some(a=>{let{hashValue:r}=Zo(e,a.attribute);if(!r)return!0;let n=ku(a.seed,r,a.hashVersion||2);return n===null?!0:!a.ranges.some(o=>Wf(n,o))})}function fB(t,e,a,r,n,o,i){if(!n&&o===void 0)return!0;if(!n&&o===0)return!1;let{hashValue:s}=Zo(t,a,r);if(!s)return!1;let l=ku(e,s,i||1);return l===null?!1:n?Wf(l,n):o!==void 0?l<=o:!0}function $e(t,e,a,r,n,o,i){let s=!0;(a<0||a>=e.variations.length)&&(a=0,s=!1);let{hashAttribute:l,hashValue:u}=Zo(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),c=e.meta?e.meta[a]:{},d={key:c.key||""+a,featureId:n,inExperiment:s,hashUsed:r,variationId:a,value:e.variations[a],hashAttribute:l,hashValue:u,stickyBucketUsed:!!i};return c.name&&(d.name=c.name),o!==void 0&&(d.bucket=o),c.passthrough&&(d.passthrough=c.passthrough),d}function pB(t,e){let a=t.key,r=e.global.overrides;return r&&r[a]&&(t=Object.assign({},t,r[a]),typeof t.url=="string"&&(t.url=dy(t.url))),t}function Zo(t,e,a){let r=e||"id",n="",o=G1(t);return o[r]&&(n=o[r]),!n&&a&&(o[a]&&(n=o[a]),n&&(r=a)),{hashAttribute:r,hashValue:n}}function hB(t,e){let a=e.user.url;if(!a)return!1;let r=a.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(a)||t.test(r))}function mB(t,e){let a=e.global.groups||{};for(let r=0;r<t.length;r++)if(a[t[r]])return!0;return!1}function gB({ctx:t,expKey:e,expBucketVersion:a,expHashAttribute:r,expFallbackAttribute:n,expMinBucketVersion:o,expMeta:i}){a=a||0,o=o||0,r=r||"id",i=i||[];let s=_y(e,a),l=vB(t,r,n);if(o>0)for(let d=0;d<o;d++){let p=_y(e,d);if(l[p]!==void 0)return{variation:-1,versionIsBlocked:!0}}let u=l[s];if(u===void 0)return{variation:-1};let c=i.findIndex(d=>d.key===u);return c<0?{variation:-1}:{variation:c}}function _y(t,e){return e=e||0,`${t}__${e}`}function wy(t,e){return`${t}||${e}`}function vB(t,e,a){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:r,hashValue:n}=Zo(t,e),o=wy(r,Eu(n)),{hashAttribute:i,hashValue:s}=Zo(t,a),l=s?wy(i,Eu(s)):null,u={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(u,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[o]&&Object.assign(u,t.user.stickyBucketAssignmentDocs[o].assignments||{}),u}function yB(t,e,a,r){let n=wy(e,a),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[n]?t.user.stickyBucketAssignmentDocs[n].assignments||{}:{},i={...o,...r},s=JSON.stringify(o)!==JSON.stringify(i);return{key:n,doc:{attributeName:e,attributeValue:a,assignments:i},changed:s}}function xB(t,e){let a=new Set,r=e&&e.features?e.features:t.global.features||{},n=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(r).forEach(o=>{let i=r[o];if(i.rules)for(let s of i.rules)s.variations&&(a.add(s.hashAttribute||"id"),s.fallbackAttribute&&a.add(s.fallbackAttribute))}),n.map(o=>{a.add(o.hashAttribute||"id"),o.fallbackAttribute&&a.add(o.fallbackAttribute)}),Array.from(a)}async function X1(t,e,a){let r=Ly(t,a);return e.getAllAssignments(r)}function Ly(t,e){let a={};return xB(t,e).forEach(n=>{let{hashValue:o}=Zo(t,n);a[n]=Eu(o)}),a}async function Y1(t,e,a){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await Wo(t.encryptedFeatures,e,a))}catch(r){console.error(r)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await Wo(t.encryptedExperiments,e,a))}catch(r){console.error(r)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await Wo(t.encryptedSavedGroups,e,a))}catch(r){console.error(r)}delete t.encryptedSavedGroups}return t}function K1(t){let e=t.apiHost||"https://cdn.growthbook.io";return{apiHost:e.replace(/\/*$/,""),streamingHost:(t.streamingHost||e).replace(/\/*$/,""),apiRequestHeaders:t.apiHostRequestHeaders,streamingHostRequestHeaders:t.streamingHostRequestHeaders}}function up(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var Is=typeof window<"u"&&typeof document<"u",bB=C1(),Du=class{constructor(e){if(e=e||{},this.version=bB,this._options=this.context=e,this._renderer=e.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!e.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl="",this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!e.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._onExperimentEval=this._onExperimentEval.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),e.remoteEval){if(e.decryptionKey)throw new Error("Encryption is not available for remoteEval");if(!e.clientKey)throw new Error("Missing clientKey");let a=!1;try{a=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(a)throw new Error("Cannot use remoteEval on GrowthBook Cloud")}else if(e.cacheKeyAttributes)throw new Error("cacheKeyAttributes are only used for remoteEval");if(e.stickyBucketService){let a=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=r=>a.saveAssignments(r)}if(e.plugins)for(let a of e.plugins)a(this);if(e.features&&(this.ready=!0),Is&&e.enableDevMode&&(window._growthbook=this,document.dispatchEvent(new Event("gbloaded"))),e.experiments&&(this.ready=!0,this._updateAllAutoExperiments()),this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let a in this._options.stickyBucketAssignmentDocs){let r=this._options.stickyBucketAssignmentDocs[a];r&&this._options.stickyBucketService.saveAssignments(r).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let a=await Y1(e,this._options.decryptionKey);this._decryptedPayload=a,await this.refreshStickyBuckets(a),a.features&&(this._options.features=a.features),a.savedGroups&&(this._options.savedGroups=a.savedGroups),a.experiments&&(this._options.experiments=a.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let a=e.payload;if(a.encryptedExperiments||a.encryptedFeatures)throw new Error("initSync does not support encrypted payloads");return this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs&&(this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,a)),this._payload=a,this._decryptedPayload=a,a.features&&(this._options.features=a.features),a.experiments&&(this._options.experiments=a.experiments,this._updateAllAutoExperiments()),this.ready=!0,Qf(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&I1(e.cacheSettings),e.payload)return await this.setPayload(e.payload),Qf(this,e),{success:!0,source:"init"};{let{data:a,...r}=await this._refresh({...e,allowStale:!0});return Qf(this,e),await this.setPayload(a||{}),r}}async loadFeatures(e){e=e||{},await this.init({skipCache:e.skipCache,timeout:e.timeout,streaming:(this._options.backgroundSync??!0)&&(e.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(e){let a=await this._refresh({...e||{},allowStale:!1});a.data&&await this.setPayload(a.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return K1(this._options)}getClientKey(){return this._options.clientKey||""}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh({timeout:e,skipCache:a,allowStale:r,streaming:n}){if(!this._options.clientKey)throw new Error("Missing clientKey");return A1({instance:this,timeout:e,skipCache:a||this._options.disableCache,allowStale:r,backgroundSync:n??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(e){console.error("Failed to render",e)}}setFeatures(e){this._options.features=e,this.ready=!0,this._render()}async setEncryptedFeatures(e,a,r){let n=await Wo(e,a||this._options.decryptionKey,r);this.setFeatures(JSON.parse(n))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,a,r){let n=await Wo(e,a||this._options.decryptionKey,r);this.setExperiments(JSON.parse(n))}async setAttributes(e){if(this._options.attributes=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(e){return this.setAttributes({...this._options.attributes,...e})}async setAttributeOverrides(e){if(this._options.attributeOverrides=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(e){if(this._options.forcedVariations=e||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(e){this._options.forcedFeatureValues=e,this._render()}async setURL(e){if(e!==this._options.url){if(this._options.url=e,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(e){return this._subscriptions.add(e),()=>{this._subscriptions.delete(e)}}async _refreshForRemoteEval(){if(!this._options.remoteEval||!this._initialized)return;let e=await this._refresh({allowStale:!1});e.data&&await this.setPayload(e.data)}getAllResults(){return new Map(this._assigned)}onDestroy(e){this._destroyCallbacks.push(e)}isDestroyed(){return!!this._destroyed}destroy(e){e=e||{},this._destroyed=!0,this._destroyCallbacks.forEach(a=>{try{a()}catch(r){console.error(r)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,k1(this),e.destroyAllStreams&&vy(),this.logs=[],Is&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(a=>{a.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,a){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=a,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:a}=lp(e,null,this._getEvalContext());return this._onExperimentEval(e,a),a}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(r=>r.key===e).map(r=>this._runAutoExperiment(r)).filter(r=>r!==null):null}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._onExperimentEval,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(e,a){let r=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!r)return null;let n=this._isAutoExperimentBlockedByContext(e),o,i;n?o=$e(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:i}=lp(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let s=JSON.stringify(o.value);if(!a&&o.inExperiment&&r&&r.valueHash===s)return o;if(r&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=Xf(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let u=e.persistQueryString?_1(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(Zf(u,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),o;this._redirectedUrl=u;let{navigate:c,delay:d}=this._getNavigateFunction();if(c)if(Is)Promise.all([...i?[Yf(i,this._options.maxNavigateDelay??1e3)]:[],new Promise(p=>window.setTimeout(p,this._options.navigateDelay??d))]).then(()=>{try{c(u)}catch(p){console.error(p)}});else try{c(u)}catch(p){console.error(p)}}else if(l==="visual"){let u=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);u&&this._activeAutoExperiments.set(e,{undo:u,valueHash:s})}}return o}_undoActiveAutoExperiment(e){let a=this._activeAutoExperiments.get(e);a&&(a.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let a=this._options.experiments||[],r=new Set(a);this._activeAutoExperiments.forEach((n,o)=>{r.has(o)||(n.undo(),this._activeAutoExperiments.delete(o))});for(let n of a){let o=this._runAutoExperiment(n,e);if(o&&o.inExperiment&&Xf(n)==="redirect")break}}_onExperimentEval(e,a){let r=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:a}),this._subscriptions.size>0&&this._fireSubscriptions(e,a,r)}_fireSubscriptions(e,a,r){(!r||r.result.inExperiment!==a.inExperiment||r.result.variationId!==a.variationId)&&this._subscriptions.forEach(n=>{try{n(e,a)}catch(o){console.error(o)}})}_recordChangedId(e){this._completedChangeIds.add(e)}isOn(e){return this.evalFeature(e).on}isOff(e){return this.evalFeature(e).off}getFeatureValue(e,a){let r=this.evalFeature(e).value;return r===null?a:r}feature(e){return this.evalFeature(e)}evalFeature(e){return sp(e,this._getEvalContext())}log(e,a){this.debug&&(this._options.log?this._options.log(e,a):console.log(e,a))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(a=>a&&a.experiment&&a.result).map(a=>[up(a.experiment,a.result),a]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(a=>{!a||!a.experiment||!a.result?console.error("Invalid deferred tracking call",{call:a}):e.push(this._options.trackingCallback(a.experiment,a.result))}),this._deferredTrackingCalls.clear(),await Promise.all(e)}setTrackingCallback(e){this._options.trackingCallback=e,this.fireDeferredTrackingCalls()}setEventLogger(e){this._options.eventLogger=e}async logEvent(e,a){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:a,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,a||{},this._getUserContext())}catch(r){console.error(r)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(up(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(Is?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let a=Xf(e);if(a==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(r=>r.js))return!0}else if(a==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let r=new URL(this._getContextUrl());for(let n of e.variations){if(!n||!n.urlRedirect)continue;let o=new URL(n.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(o.protocol!==r.protocol||o.host!==r.host))return!0}}catch(r){return this.log("Error parsing current or redirect URL",{id:e.key,error:r}),!0}}else return!0;return!!(e.changeId&&(this._options.blockedChangeIds||[]).includes(e.changeId))}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){return this._options.navigate?{navigate:this._options.navigate,delay:0}:Is?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!Is)return;let a=[];if(e.css){let r=document.createElement("style");r.innerHTML=e.css,document.head.appendChild(r),a.push(()=>r.remove())}if(e.js){let r=document.createElement("script");r.innerHTML=e.js,this._options.jsInjectionNonce&&(r.nonce=this._options.jsInjectionNonce),document.head.appendChild(r),a.push(()=>r.remove())}return e.domMutations&&e.domMutations.forEach(r=>{a.push(U1.declarative(r).revert)}),()=>{a.forEach(r=>r())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let a=this._getEvalContext(),r=await X1(a,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=r}}generateStickyBucketAssignmentDocsSync(e,a){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let r=this._getEvalContext(),n=Ly(r,a);return e.getAllAssignmentsSync(n)}inDevMode(){return!!this._options.enableDevMode}};var SB="https://experiment.syntrologie.com",Iy=class{constructor(e={}){$(this,"gb");$(this,"featureListeners",new Set);if(e.client)this.gb=e.client;else{let a=e.onExperimentViewed?(r,n)=>{e.onExperimentViewed(r.key,n.variationId,typeof n.value=="string"?n.value:`variation_${n.variationId}`)}:void 0;this.gb=new Du({...e,apiHost:e.apiHost??SB,enableDevMode:e.enableDevMode??!0,trackingCallback:a}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes(e)}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,a){return this.gb.getFeatureValue(e,a)}getAllFeatures(){let e=this.gb.getFeatures(),a={};for(let r of Object.keys(e))a[r]=this.gb.getFeatureValue(r,null);return a}shouldRenderRectangle(e){return!0}onFeaturesChanged(e){return this.featureListeners.add(e),this.featureListeners.size===1&&this.gb.setRenderer(()=>{for(let a of this.featureListeners)a()}),()=>{this.featureListeners.delete(e),this.featureListeners.size===0&&this.gb.setRenderer(null)}}};function cp(t={}){return new Iy(t)}var Q1="syntro_session_metrics",Ou=class{constructor(e={}){$(this,"metrics",new Map);$(this,"experiments");$(this,"attributePrefix");$(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,a=1){let n=(this.metrics.get(e)??0)+a;return this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n),n}set(e,a){this.metrics.set(e,a),this.saveToStorage(),this.updateExperimentAttributes(e,a),this.onMetricChange?.(e,a)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,a){return this.get(e)>=a}getAll(){return Object.fromEntries(this.metrics)}reset(e){this.metrics.delete(e),this.saveToStorage(),this.updateExperimentAttributes(e,0),this.onMetricChange?.(e,0)}resetAll(){let e=Array.from(this.metrics.keys());this.metrics.clear(),this.saveToStorage();let a={};for(let r of e)a[`${this.attributePrefix}${r}`]=0,this.onMetricChange?.(r,0);this.experiments?.setAttributes?.(a)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,a){if(!this.experiments?.setAttributes)return;let r=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[r]:a})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[a,r]of this.metrics)e[`${this.attributePrefix}${a}`]=r;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(Q1);if(e){let a=JSON.parse(e);for(let[r,n]of Object.entries(a))this.metrics.set(r,n.count)}}catch(e){console.warn("[SessionMetricTracker] Failed to load from sessionStorage:",e)}}saveToStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e={};for(let[a,r]of this.metrics)e[a]={count:r,lastUpdated:Date.now()};sessionStorage.setItem(Q1,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function dp(t={}){return new Ou(t)}var h={};xS(h,{BRAND:()=>WB,DIRTY:()=>Xo,EMPTY_PATH:()=>LB,INVALID:()=>Q,NEVER:()=>RF,OK:()=>Mt,ParseStatus:()=>wt,Schema:()=>le,ZodAny:()=>ao,ZodArray:()=>en,ZodBigInt:()=>Ko,ZodBoolean:()=>Qo,ZodBranded:()=>Fu,ZodCatch:()=>ui,ZodDate:()=>Jo,ZodDefault:()=>li,ZodDiscriminatedUnion:()=>hp,ZodEffects:()=>Fa,ZodEnum:()=>ii,ZodError:()=>Qt,ZodFirstPartyTypeKind:()=>J,ZodFunction:()=>gp,ZodIntersection:()=>ri,ZodIssueCode:()=>O,ZodLazy:()=>ni,ZodLiteral:()=>oi,ZodMap:()=>Ms,ZodNaN:()=>Os,ZodNativeEnum:()=>si,ZodNever:()=>Ja,ZodNull:()=>ti,ZodNullable:()=>mr,ZodNumber:()=>Yo,ZodObject:()=>Jt,ZodOptional:()=>Oa,ZodParsedType:()=>V,ZodPipeline:()=>Nu,ZodPromise:()=>ro,ZodReadonly:()=>ci,ZodRecord:()=>mp,ZodSchema:()=>le,ZodSet:()=>Ds,ZodString:()=>to,ZodSymbol:()=>Ts,ZodTransformer:()=>Fa,ZodTuple:()=>hr,ZodType:()=>le,ZodUndefined:()=>ei,ZodUnion:()=>ai,ZodUnknown:()=>Jr,ZodVoid:()=>Rs,addIssueToContext:()=>P,any:()=>aF,array:()=>iF,bigint:()=>KB,boolean:()=>uA,coerce:()=>TF,custom:()=>iA,date:()=>QB,datetimeRegex:()=>nA,defaultErrorMap:()=>Kr,discriminatedUnion:()=>cF,effect:()=>CF,enum:()=>xF,function:()=>gF,getErrorMap:()=>As,getParsedType:()=>pr,instanceof:()=>XB,intersection:()=>dF,isAborted:()=>fp,isAsync:()=>ks,isDirty:()=>pp,isValid:()=>eo,late:()=>ZB,lazy:()=>vF,literal:()=>yF,makeIssue:()=>Bu,map:()=>hF,nan:()=>YB,nativeEnum:()=>bF,never:()=>nF,null:()=>tF,nullable:()=>wF,number:()=>lA,object:()=>sF,objectUtil:()=>Ay,oboolean:()=>EF,onumber:()=>kF,optional:()=>_F,ostring:()=>AF,pipeline:()=>IF,preprocess:()=>LF,promise:()=>SF,quotelessJson:()=>CB,record:()=>pF,set:()=>mF,setErrorMap:()=>wB,strictObject:()=>lF,string:()=>sA,symbol:()=>JB,transformer:()=>CF,tuple:()=>fF,undefined:()=>eF,union:()=>uF,unknown:()=>rF,util:()=>de,void:()=>oF});var de;(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function a(n){throw new Error}t.assertNever=a,t.arrayToEnum=n=>{let o={};for(let i of n)o[i]=i;return o},t.getValidEnumValues=n=>{let o=t.objectKeys(n).filter(s=>typeof n[n[s]]!="number"),i={};for(let s of o)i[s]=n[s];return t.objectValues(i)},t.objectValues=n=>t.objectKeys(n).map(function(o){return n[o]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&o.push(i);return o},t.find=(n,o)=>{for(let i of n)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,o=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(de||(de={}));var Ay;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ay||(Ay={}));var V=de.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pr=t=>{switch(typeof t){case"undefined":return V.undefined;case"string":return V.string;case"number":return Number.isNaN(t)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(t)?V.array:t===null?V.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?V.promise:typeof Map<"u"&&t instanceof Map?V.map:typeof Set<"u"&&t instanceof Set?V.set:typeof Date<"u"&&t instanceof Date?V.date:V.object;default:return V.unknown}};var O=de.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),CB=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Qt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){let a=e||function(o){return o.message},r={_errors:[]},n=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let s=r,l=0;for(;l<i.path.length;){let u=i.path[l];l===i.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(a(i))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return n(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,de.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){let a={},r=[];for(let n of this.issues)if(n.path.length>0){let o=n.path[0];a[o]=a[o]||[],a[o].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}};Qt.create=t=>new Qt(t);var _B=(t,e)=>{let a;switch(t.code){case O.invalid_type:t.received===V.undefined?a="Required":a=`Expected ${t.expected}, received ${t.received}`;break;case O.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,de.jsonStringifyReplacer)}`;break;case O.unrecognized_keys:a=`Unrecognized key(s) in object: ${de.joinValues(t.keys,", ")}`;break;case O.invalid_union:a="Invalid input";break;case O.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${de.joinValues(t.options)}`;break;case O.invalid_enum_value:a=`Invalid enum value. Expected ${de.joinValues(t.options)}, received '${t.received}'`;break;case O.invalid_arguments:a="Invalid function arguments";break;case O.invalid_return_type:a="Invalid function return type";break;case O.invalid_date:a="Invalid date";break;case O.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(a=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?a=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?a=`Invalid input: must end with "${t.validation.endsWith}"`:de.assertNever(t.validation):t.validation!=="regex"?a=`Invalid ${t.validation}`:a="Invalid";break;case O.too_small:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?a=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:a="Invalid input";break;case O.too_big:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?a=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:a="Invalid input";break;case O.custom:a="Invalid input";break;case O.invalid_intersection_types:a="Intersection results could not be merged";break;case O.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case O.not_finite:a="Number must be finite";break;default:a=e.defaultError,de.assertNever(t)}return{message:a}},Kr=_B;var J1=Kr;function wB(t){J1=t}function As(){return J1}var Bu=t=>{let{data:e,path:a,errorMaps:r,issueData:n}=t,o=[...a,...n.path||[]],i={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let s="",l=r.filter(u=>!!u).slice().reverse();for(let u of l)s=u(i,{data:e,defaultError:s}).message;return{...n,path:o,message:s}},LB=[];function P(t,e){let a=As(),r=Bu({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===Kr?void 0:Kr].filter(n=>!!n)});t.common.issues.push(r)}var wt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,a){let r=[];for(let n of a){if(n.status==="aborted")return Q;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,a){let r=[];for(let n of a){let o=await n.key,i=await n.value;r.push({key:o,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,a){let r={};for(let n of a){let{key:o,value:i}=n;if(o.status==="aborted"||i.status==="aborted")return Q;o.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[o.value]=i.value)}return{status:e.value,value:r}}},Q=Object.freeze({status:"aborted"}),Xo=t=>({status:"dirty",value:t}),Mt=t=>({status:"valid",value:t}),fp=t=>t.status==="aborted",pp=t=>t.status==="dirty",eo=t=>t.status==="valid",ks=t=>typeof Promise<"u"&&t instanceof Promise;var Z;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Z||(Z={}));var Ba=class{constructor(e,a,r,n){this._cachedPath=[],this.parent=e,this.data=a,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},eA=(t,e)=>{if(eo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let a=new Qt(t.common.issues);return this._error=a,this._error}}};function se(t){if(!t)return{};let{errorMap:e,invalid_type_error:a,required_error:r,description:n}=t;if(e&&(a||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,s)=>{let{message:l}=t;return i.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:l??a??s.defaultError}},description:n}}var le=class{get description(){return this._def.description}_getType(e){return pr(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wt,ctx:{common:e.parent.common,data:e.data,parsedType:pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let a=this._parse(e);if(ks(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(e){let a=this._parse(e);return Promise.resolve(a)}parse(e,a){let r=this.safeParse(e,a);if(r.success)return r.data;throw r.error}safeParse(e,a){let r={common:{issues:[],async:a?.async??!1,contextualErrorMap:a?.errorMap},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pr(e)},n=this._parseSync({data:e,path:r.path,parent:r});return eA(r,n)}"~validate"(e){let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pr(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:a});return eo(r)?{value:r.value}:{issues:a.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(r=>eo(r)?{value:r.value}:{issues:a.common.issues})}async parseAsync(e,a){let r=await this.safeParseAsync(e,a);if(r.success)return r.data;throw r.error}async safeParseAsync(e,a){let r={common:{issues:[],contextualErrorMap:a?.errorMap,async:!0},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pr(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(ks(n)?n:Promise.resolve(n));return eA(r,o)}refine(e,a){let r=n=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(n):a;return this._refinement((n,o)=>{let i=e(n),s=()=>o.addIssue({code:O.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(e,a){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof a=="function"?a(r,n):a),!1))}_refinement(e){return new Fa({schema:this,typeName:J.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a=>this["~validate"](a)}}optional(){return Oa.create(this,this._def)}nullable(){return mr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return en.create(this)}promise(){return ro.create(this,this._def)}or(e){return ai.create([this,e],this._def)}and(e){return ri.create(this,e,this._def)}transform(e){return new Fa({...se(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let a=typeof e=="function"?e:()=>e;return new li({...se(this._def),innerType:this,defaultValue:a,typeName:J.ZodDefault})}brand(){return new Fu({typeName:J.ZodBranded,type:this,...se(this._def)})}catch(e){let a=typeof e=="function"?e:()=>e;return new ui({...se(this._def),innerType:this,catchValue:a,typeName:J.ZodCatch})}describe(e){let a=this.constructor;return new a({...this._def,description:e})}pipe(e){return Nu.create(this,e)}readonly(){return ci.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},IB=/^c[^\s-]{8,}$/i,AB=/^[0-9a-z]+$/,kB=/^[0-9A-HJKMNP-TV-Z]{26}$/i,EB=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,TB=/^[a-z0-9_-]{21}$/i,RB=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,MB=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,DB=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,OB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ky,BB=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,FB=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,NB=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,PB=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,HB=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,UB=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,aA="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",qB=new RegExp(`^${aA}$`);function rA(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let a=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${a}`}function zB(t){return new RegExp(`^${rA(t)}$`)}function nA(t){let e=`${aA}T${rA(t)}`,a=[];return a.push(t.local?"Z?":"Z"),t.offset&&a.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${a.join("|")})`,new RegExp(`^${e}$`)}function VB(t,e){return!!((e==="v4"||!e)&&BB.test(t)||(e==="v6"||!e)&&NB.test(t))}function $B(t,e){if(!RB.test(t))return!1;try{let[a]=t.split(".");if(!a)return!1;let r=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function jB(t,e){return!!((e==="v4"||!e)&&FB.test(t)||(e==="v6"||!e)&&PB.test(t))}var to=class t extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){let o=this._getOrReturnCtx(e);return P(o,{code:O.invalid_type,expected:V.string,received:o.parsedType}),Q}let r=new wt,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:O.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:O.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let i=e.data.length>o.value,s=e.data.length<o.value;(i||s)&&(n=this._getOrReturnCtx(e,n),i?P(n,{code:O.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&P(n,{code:O.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")DB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"email",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")ky||(ky=new RegExp(OB,"u")),ky.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"emoji",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")EB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"uuid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")TB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"nanoid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")IB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"cuid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")AB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"cuid2",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")kB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"ulid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),P(n,{validation:"url",code:O.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"regex",code:O.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(e,n),P(n,{code:O.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(n=this._getOrReturnCtx(e,n),P(n,{code:O.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),P(n,{code:O.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?nA(o).test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:O.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?qB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:O.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?zB(o).test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:O.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?MB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"duration",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?VB(e.data,o.version)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"ip",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?$B(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"jwt",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?jB(e.data,o.version)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"cidr",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?HB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"base64",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?UB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"base64url",code:O.invalid_string,message:o.message}),r.dirty()):de.assertNever(o);return{status:r.value,value:e.data}}_regex(e,a,r){return this.refinement(n=>e.test(n),{validation:a,code:O.invalid_string,...Z.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Z.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Z.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Z.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...Z.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a?.position,...Z.errToObj(a?.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...Z.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...Z.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...Z.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...Z.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...Z.errToObj(a)})}nonempty(e){return this.min(1,Z.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxLength(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};to.create=t=>new to({checks:[],typeName:J.ZodString,coerce:t?.coerce??!1,...se(t)});function GB(t,e){let a=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=a>r?a:r,o=Number.parseInt(t.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return o%i/10**n}var Yo=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==V.number){let o=this._getOrReturnCtx(e);return P(o,{code:O.invalid_type,expected:V.number,received:o.parsedType}),Q}let r,n=new wt;for(let o of this._def.checks)o.kind==="int"?de.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:O.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:O.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:O.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?GB(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),P(r,{code:O.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:O.not_finite,message:o.message}),n.dirty()):de.assertNever(o);return{status:n.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,Z.toString(a))}gt(e,a){return this.setLimit("min",e,!1,Z.toString(a))}lte(e,a){return this.setLimit("max",e,!0,Z.toString(a))}lt(e,a){return this.setLimit("max",e,!1,Z.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:Z.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:Z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.toString(e)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&de.isInteger(e.value))}get isFinite(){let e=null,a=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(a===null||r.value>a)&&(a=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(a)&&Number.isFinite(e)}};Yo.create=t=>new Yo({checks:[],typeName:J.ZodNumber,coerce:t?.coerce||!1,...se(t)});var Ko=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==V.bigint)return this._getInvalidInput(e);let r,n=new wt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:O.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:O.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),P(r,{code:O.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):de.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let a=this._getOrReturnCtx(e);return P(a,{code:O.invalid_type,expected:V.bigint,received:a.parsedType}),Q}gte(e,a){return this.setLimit("min",e,!0,Z.toString(a))}gt(e,a){return this.setLimit("min",e,!1,Z.toString(a))}lte(e,a){return this.setLimit("max",e,!0,Z.toString(a))}lt(e,a){return this.setLimit("max",e,!1,Z.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:Z.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(a)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};Ko.create=t=>new Ko({checks:[],typeName:J.ZodBigInt,coerce:t?.coerce??!1,...se(t)});var Qo=class extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let r=this._getOrReturnCtx(e);return P(r,{code:O.invalid_type,expected:V.boolean,received:r.parsedType}),Q}return Mt(e.data)}};Qo.create=t=>new Qo({typeName:J.ZodBoolean,coerce:t?.coerce||!1,...se(t)});var Jo=class t extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){let o=this._getOrReturnCtx(e);return P(o,{code:O.invalid_type,expected:V.date,received:o.parsedType}),Q}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return P(o,{code:O.invalid_date}),Q}let r=new wt,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:O.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:O.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):de.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,a){return this._addCheck({kind:"min",value:e.getTime(),message:Z.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:Z.toString(a)})}get minDate(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e!=null?new Date(e):null}};Jo.create=t=>new Jo({checks:[],coerce:t?.coerce||!1,typeName:J.ZodDate,...se(t)});var Ts=class extends le{_parse(e){if(this._getType(e)!==V.symbol){let r=this._getOrReturnCtx(e);return P(r,{code:O.invalid_type,expected:V.symbol,received:r.parsedType}),Q}return Mt(e.data)}};Ts.create=t=>new Ts({typeName:J.ZodSymbol,...se(t)});var ei=class extends le{_parse(e){if(this._getType(e)!==V.undefined){let r=this._getOrReturnCtx(e);return P(r,{code:O.invalid_type,expected:V.undefined,received:r.parsedType}),Q}return Mt(e.data)}};ei.create=t=>new ei({typeName:J.ZodUndefined,...se(t)});var ti=class extends le{_parse(e){if(this._getType(e)!==V.null){let r=this._getOrReturnCtx(e);return P(r,{code:O.invalid_type,expected:V.null,received:r.parsedType}),Q}return Mt(e.data)}};ti.create=t=>new ti({typeName:J.ZodNull,...se(t)});var ao=class extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return Mt(e.data)}};ao.create=t=>new ao({typeName:J.ZodAny,...se(t)});var Jr=class extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Mt(e.data)}};Jr.create=t=>new Jr({typeName:J.ZodUnknown,...se(t)});var Ja=class extends le{_parse(e){let a=this._getOrReturnCtx(e);return P(a,{code:O.invalid_type,expected:V.never,received:a.parsedType}),Q}};Ja.create=t=>new Ja({typeName:J.ZodNever,...se(t)});var Rs=class extends le{_parse(e){if(this._getType(e)!==V.undefined){let r=this._getOrReturnCtx(e);return P(r,{code:O.invalid_type,expected:V.void,received:r.parsedType}),Q}return Mt(e.data)}};Rs.create=t=>new Rs({typeName:J.ZodVoid,...se(t)});var en=class t extends le{_parse(e){let{ctx:a,status:r}=this._processInputParams(e),n=this._def;if(a.parsedType!==V.array)return P(a,{code:O.invalid_type,expected:V.array,received:a.parsedType}),Q;if(n.exactLength!==null){let i=a.data.length>n.exactLength.value,s=a.data.length<n.exactLength.value;(i||s)&&(P(a,{code:i?O.too_big:O.too_small,minimum:s?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(n.minLength!==null&&a.data.length<n.minLength.value&&(P(a,{code:O.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),n.maxLength!==null&&a.data.length>n.maxLength.value&&(P(a,{code:O.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),a.common.async)return Promise.all([...a.data].map((i,s)=>n.type._parseAsync(new Ba(a,i,a.path,s)))).then(i=>wt.mergeArray(r,i));let o=[...a.data].map((i,s)=>n.type._parseSync(new Ba(a,i,a.path,s)));return wt.mergeArray(r,o)}get element(){return this._def.type}min(e,a){return new t({...this._def,minLength:{value:e,message:Z.toString(a)}})}max(e,a){return new t({...this._def,maxLength:{value:e,message:Z.toString(a)}})}length(e,a){return new t({...this._def,exactLength:{value:e,message:Z.toString(a)}})}nonempty(e){return this.min(1,e)}};en.create=(t,e)=>new en({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...se(e)});function Es(t){if(t instanceof Jt){let e={};for(let a in t.shape){let r=t.shape[a];e[a]=Oa.create(Es(r))}return new Jt({...t._def,shape:()=>e})}else return t instanceof en?new en({...t._def,type:Es(t.element)}):t instanceof Oa?Oa.create(Es(t.unwrap())):t instanceof mr?mr.create(Es(t.unwrap())):t instanceof hr?hr.create(t.items.map(e=>Es(e))):t}var Jt=class t extends le{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),a=de.objectKeys(e);return this._cached={shape:e,keys:a},this._cached}_parse(e){if(this._getType(e)!==V.object){let u=this._getOrReturnCtx(e);return P(u,{code:O.invalid_type,expected:V.object,received:u.parsedType}),Q}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ja&&this._def.unknownKeys==="strip"))for(let u in n.data)i.includes(u)||s.push(u);let l=[];for(let u of i){let c=o[u],d=n.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Ba(n,d,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof Ja){let u=this._def.unknownKeys;if(u==="passthrough")for(let c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(u==="strict")s.length>0&&(P(n,{code:O.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let c of s){let d=n.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Ba(n,d,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let c of l){let d=await c.key,p=await c.value;u.push({key:d,value:p,alwaysSet:c.alwaysSet})}return u}).then(u=>wt.mergeObjectSync(r,u)):wt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Z.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(a,r)=>{let n=this._def.errorMap?.(a,r).message??r.defaultError;return a.code==="unrecognized_keys"?{message:Z.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:J.ZodObject})}setKey(e,a){return this.augment({[e]:a})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let a={};for(let r of de.objectKeys(e))e[r]&&this.shape[r]&&(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}omit(e){let a={};for(let r of de.objectKeys(this.shape))e[r]||(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}deepPartial(){return Es(this)}partial(e){let a={};for(let r of de.objectKeys(this.shape)){let n=this.shape[r];e&&!e[r]?a[r]=n:a[r]=n.optional()}return new t({...this._def,shape:()=>a})}required(e){let a={};for(let r of de.objectKeys(this.shape))if(e&&!e[r])a[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Oa;)o=o._def.innerType;a[r]=o}return new t({...this._def,shape:()=>a})}keyof(){return oA(de.objectKeys(this.shape))}};Jt.create=(t,e)=>new Jt({shape:()=>t,unknownKeys:"strip",catchall:Ja.create(),typeName:J.ZodObject,...se(e)});Jt.strictCreate=(t,e)=>new Jt({shape:()=>t,unknownKeys:"strict",catchall:Ja.create(),typeName:J.ZodObject,...se(e)});Jt.lazycreate=(t,e)=>new Jt({shape:t,unknownKeys:"strip",catchall:Ja.create(),typeName:J.ZodObject,...se(e)});var ai=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),r=this._def.options;function n(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return a.common.issues.push(...s.ctx.common.issues),s.result;let i=o.map(s=>new Qt(s.ctx.common.issues));return P(a,{code:O.invalid_union,unionErrors:i}),Q}if(a.common.async)return Promise.all(r.map(async o=>{let i={...a,common:{...a.common,issues:[]},parent:null};return{result:await o._parseAsync({data:a.data,path:a.path,parent:i}),ctx:i}})).then(n);{let o,i=[];for(let l of r){let u={...a,common:{...a.common,issues:[]},parent:null},c=l._parseSync({data:a.data,path:a.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return a.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map(l=>new Qt(l));return P(a,{code:O.invalid_union,unionErrors:s}),Q}}get options(){return this._def.options}};ai.create=(t,e)=>new ai({options:t,typeName:J.ZodUnion,...se(e)});var Qr=t=>t instanceof ni?Qr(t.schema):t instanceof Fa?Qr(t.innerType()):t instanceof oi?[t.value]:t instanceof ii?t.options:t instanceof si?de.objectValues(t.enum):t instanceof li?Qr(t._def.innerType):t instanceof ei?[void 0]:t instanceof ti?[null]:t instanceof Oa?[void 0,...Qr(t.unwrap())]:t instanceof mr?[null,...Qr(t.unwrap())]:t instanceof Fu||t instanceof ci?Qr(t.unwrap()):t instanceof ui?Qr(t._def.innerType):[],hp=class t extends le{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.object)return P(a,{code:O.invalid_type,expected:V.object,received:a.parsedType}),Q;let r=this.discriminator,n=a.data[r],o=this.optionsMap.get(n);return o?a.common.async?o._parseAsync({data:a.data,path:a.path,parent:a}):o._parseSync({data:a.data,path:a.path,parent:a}):(P(a,{code:O.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,a,r){let n=new Map;for(let o of a){let i=Qr(o.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of i){if(n.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,o)}}return new t({typeName:J.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:n,...se(r)})}};function Ey(t,e){let a=pr(t),r=pr(e);if(t===e)return{valid:!0,data:t};if(a===V.object&&r===V.object){let n=de.objectKeys(e),o=de.objectKeys(t).filter(s=>n.indexOf(s)!==-1),i={...t,...e};for(let s of o){let l=Ey(t[s],e[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(a===V.array&&r===V.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let o=0;o<t.length;o++){let i=t[o],s=e[o],l=Ey(i,s);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return a===V.date&&r===V.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ri=class extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(fp(o)||fp(i))return Q;let s=Ey(o.value,i.value);return s.valid?((pp(o)||pp(i))&&a.dirty(),{status:a.value,value:s.data}):(P(r,{code:O.invalid_intersection_types}),Q)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>n(o,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};ri.create=(t,e,a)=>new ri({left:t,right:e,typeName:J.ZodIntersection,...se(a)});var hr=class t extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.array)return P(r,{code:O.invalid_type,expected:V.array,received:r.parsedType}),Q;if(r.data.length<this._def.items.length)return P(r,{code:O.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&r.data.length>this._def.items.length&&(P(r,{code:O.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());let o=[...r.data].map((i,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Ba(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>wt.mergeArray(a,i)):wt.mergeArray(a,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};hr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new hr({items:t,typeName:J.ZodTuple,rest:null,...se(e)})};var mp=class t extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.object)return P(r,{code:O.invalid_type,expected:V.object,received:r.parsedType}),Q;let n=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)n.push({key:o._parse(new Ba(r,s,r.path,s)),value:i._parse(new Ba(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?wt.mergeObjectAsync(a,n):wt.mergeObjectSync(a,n)}get element(){return this._def.valueType}static create(e,a,r){return a instanceof le?new t({keyType:e,valueType:a,typeName:J.ZodRecord,...se(r)}):new t({keyType:to.create(),valueType:e,typeName:J.ZodRecord,...se(a)})}},Ms=class extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.map)return P(r,{code:O.invalid_type,expected:V.map,received:r.parsedType}),Q;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,l],u)=>({key:n._parse(new Ba(r,s,r.path,[u,"key"])),value:o._parse(new Ba(r,l,r.path,[u,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of i){let u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}})}else{let s=new Map;for(let l of i){let u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}}}};Ms.create=(t,e,a)=>new Ms({valueType:e,keyType:t,typeName:J.ZodMap,...se(a)});var Ds=class t extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.set)return P(r,{code:O.invalid_type,expected:V.set,received:r.parsedType}),Q;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(P(r,{code:O.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),a.dirty()),n.maxSize!==null&&r.data.size>n.maxSize.value&&(P(r,{code:O.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),a.dirty());let o=this._def.valueType;function i(l){let u=new Set;for(let c of l){if(c.status==="aborted")return Q;c.status==="dirty"&&a.dirty(),u.add(c.value)}return{status:a.value,value:u}}let s=[...r.data.values()].map((l,u)=>o._parse(new Ba(r,l,r.path,u)));return r.common.async?Promise.all(s).then(l=>i(l)):i(s)}min(e,a){return new t({...this._def,minSize:{value:e,message:Z.toString(a)}})}max(e,a){return new t({...this._def,maxSize:{value:e,message:Z.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}};Ds.create=(t,e)=>new Ds({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...se(e)});var gp=class t extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.function)return P(a,{code:O.invalid_type,expected:V.function,received:a.parsedType}),Q;function r(s,l){return Bu({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,As(),Kr].filter(u=>!!u),issueData:{code:O.invalid_arguments,argumentsError:l}})}function n(s,l){return Bu({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,As(),Kr].filter(u=>!!u),issueData:{code:O.invalid_return_type,returnTypeError:l}})}let o={errorMap:a.common.contextualErrorMap},i=a.data;if(this._def.returns instanceof ro){let s=this;return Mt(async function(...l){let u=new Qt([]),c=await s._def.args.parseAsync(l,o).catch(g=>{throw u.addIssue(r(l,g)),u}),d=await Reflect.apply(i,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(g=>{throw u.addIssue(n(d,g)),u})})}else{let s=this;return Mt(function(...l){let u=s._def.args.safeParse(l,o);if(!u.success)throw new Qt([r(l,u.error)]);let c=Reflect.apply(i,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new Qt([n(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:hr.create(e).rest(Jr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,a,r){return new t({args:e||hr.create([]).rest(Jr.create()),returns:a||Jr.create(),typeName:J.ZodFunction,...se(r)})}},ni=class extends le{get schema(){return this._def.getter()}_parse(e){let{ctx:a}=this._processInputParams(e);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}};ni.create=(t,e)=>new ni({getter:t,typeName:J.ZodLazy,...se(e)});var oi=class extends le{_parse(e){if(e.data!==this._def.value){let a=this._getOrReturnCtx(e);return P(a,{received:a.data,code:O.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}};oi.create=(t,e)=>new oi({value:t,typeName:J.ZodLiteral,...se(e)});function oA(t,e){return new ii({values:t,typeName:J.ZodEnum,...se(e)})}var ii=class t extends le{_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),r=this._def.values;return P(a,{expected:de.joinValues(r),received:a.parsedType,code:O.invalid_type}),Q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let a=this._getOrReturnCtx(e),r=this._def.values;return P(a,{received:a.data,code:O.invalid_enum_value,options:r}),Q}return Mt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let a of this._def.values)e[a]=a;return e}get Values(){let e={};for(let a of this._def.values)e[a]=a;return e}get Enum(){let e={};for(let a of this._def.values)e[a]=a;return e}extract(e,a=this._def){return t.create(e,{...this._def,...a})}exclude(e,a=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...a})}};ii.create=oA;var si=class extends le{_parse(e){let a=de.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==V.string&&r.parsedType!==V.number){let n=de.objectValues(a);return P(r,{expected:de.joinValues(n),received:r.parsedType,code:O.invalid_type}),Q}if(this._cache||(this._cache=new Set(de.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=de.objectValues(a);return P(r,{received:r.data,code:O.invalid_enum_value,options:n}),Q}return Mt(e.data)}get enum(){return this._def.values}};si.create=(t,e)=>new si({values:t,typeName:J.ZodNativeEnum,...se(e)});var ro=class extends le{unwrap(){return this._def.type}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.promise&&a.common.async===!1)return P(a,{code:O.invalid_type,expected:V.promise,received:a.parsedType}),Q;let r=a.parsedType===V.promise?a.data:Promise.resolve(a.data);return Mt(r.then(n=>this._def.type.parseAsync(n,{path:a.path,errorMap:a.common.contextualErrorMap})))}};ro.create=(t,e)=>new ro({type:t,typeName:J.ZodPromise,...se(e)});var Fa=class extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:i=>{P(r,i),i.fatal?a.abort():a.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let i=n.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async s=>{if(a.value==="aborted")return Q;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?Q:l.status==="dirty"?Xo(l.value):a.value==="dirty"?Xo(l.value):l});{if(a.value==="aborted")return Q;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?Q:s.status==="dirty"?Xo(s.value):a.value==="dirty"?Xo(s.value):s}}if(n.type==="refinement"){let i=s=>{let l=n.refinement(s,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Q:(s.status==="dirty"&&a.dirty(),i(s.value),{status:a.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?Q:(s.status==="dirty"&&a.dirty(),i(s.value).then(()=>({status:a.value,value:s.value}))))}if(n.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!eo(i))return Q;let s=n.transform(i.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>eo(i)?Promise.resolve(n.transform(i.value,o)).then(s=>({status:a.value,value:s})):Q);de.assertNever(n)}};Fa.create=(t,e,a)=>new Fa({schema:t,typeName:J.ZodEffects,effect:e,...se(a)});Fa.createWithPreprocess=(t,e,a)=>new Fa({schema:e,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...se(a)});var Oa=class extends le{_parse(e){return this._getType(e)===V.undefined?Mt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Oa.create=(t,e)=>new Oa({innerType:t,typeName:J.ZodOptional,...se(e)});var mr=class extends le{_parse(e){return this._getType(e)===V.null?Mt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};mr.create=(t,e)=>new mr({innerType:t,typeName:J.ZodNullable,...se(e)});var li=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return a.parsedType===V.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:a.path,parent:a})}removeDefault(){return this._def.innerType}};li.create=(t,e)=>new li({innerType:t,typeName:J.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...se(e)});var ui=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),r={...a,common:{...a.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ks(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};ui.create=(t,e)=>new ui({innerType:t,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...se(e)});var Os=class extends le{_parse(e){if(this._getType(e)!==V.nan){let r=this._getOrReturnCtx(e);return P(r,{code:O.invalid_type,expected:V.nan,received:r.parsedType}),Q}return{status:"valid",value:e.data}}};Os.create=t=>new Os({typeName:J.ZodNaN,...se(t)});var WB=Symbol("zod_brand"),Fu=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return this._def.type._parse({data:r,path:a.path,parent:a})}unwrap(){return this._def.type}},Nu=class t extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Q:o.status==="dirty"?(a.dirty(),Xo(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?Q:n.status==="dirty"?(a.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,a){return new t({in:e,out:a,typeName:J.ZodPipeline})}},ci=class extends le{_parse(e){let a=this._def.innerType._parse(e),r=n=>(eo(n)&&(n.value=Object.freeze(n.value)),n);return ks(a)?a.then(n=>r(n)):r(a)}unwrap(){return this._def.innerType}};ci.create=(t,e)=>new ci({innerType:t,typeName:J.ZodReadonly,...se(e)});function tA(t,e){let a=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof a=="string"?{message:a}:a}function iA(t,e={},a){return t?ao.create().superRefine((r,n)=>{let o=t(r);if(o instanceof Promise)return o.then(i=>{if(!i){let s=tA(e,r),l=s.fatal??a??!0;n.addIssue({code:"custom",...s,fatal:l})}});if(!o){let i=tA(e,r),s=i.fatal??a??!0;n.addIssue({code:"custom",...i,fatal:s})}}):ao.create()}var ZB={object:Jt.lazycreate},J;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(J||(J={}));var XB=(t,e={message:`Input not instance of ${t.name}`})=>iA(a=>a instanceof t,e),sA=to.create,lA=Yo.create,YB=Os.create,KB=Ko.create,uA=Qo.create,QB=Jo.create,JB=Ts.create,eF=ei.create,tF=ti.create,aF=ao.create,rF=Jr.create,nF=Ja.create,oF=Rs.create,iF=en.create,sF=Jt.create,lF=Jt.strictCreate,uF=ai.create,cF=hp.create,dF=ri.create,fF=hr.create,pF=mp.create,hF=Ms.create,mF=Ds.create,gF=gp.create,vF=ni.create,yF=oi.create,xF=ii.create,bF=si.create,SF=ro.create,CF=Fa.create,_F=Oa.create,wF=mr.create,LF=Fa.createWithPreprocess,IF=Nu.create,AF=()=>sA().optional(),kF=()=>lA().optional(),EF=()=>uA().optional(),TF={string:(t=>to.create({...t,coerce:!0})),number:(t=>Yo.create({...t,coerce:!0})),boolean:(t=>Qo.create({...t,coerce:!0})),bigint:(t=>Ko.create({...t,coerce:!0})),date:(t=>Jo.create({...t,coerce:!0}))};var RF=Q;var Ty=h.union([h.object({type:h.literal("data"),key:h.string(),value:h.string().optional()}),h.object({type:h.literal("css"),value:h.string()}),h.object({type:h.literal("aria"),role:h.string().optional(),label:h.string().optional()}),h.object({type:h.literal("shadow-css"),value:h.string()}),h.object({type:h.literal("ref"),el:h.any()})]),cA=h.object({kind:h.literal("tooltip"),id:h.string(),anchor:Ty,content:h.object({title:h.string().optional(),body:h.string()}),placement:h.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:h.number().optional(),blocking:h.boolean().optional(),trigger:h.enum(["immediate","hover","click"]).optional(),dismiss:h.object({onEsc:h.boolean().optional(),closeButton:h.boolean().optional(),timeoutMs:h.number().optional()}).optional()}),dA=h.object({kind:h.literal("highlight"),id:h.string(),anchor:Ty,copy:h.string().optional(),ring:h.object({paddingPx:h.number().optional(),radiusPx:h.number().optional()}).optional(),scrim:h.object({opacity:h.number().optional()}).optional(),ringColor:h.string().optional(),blocking:h.boolean().optional(),dismiss:h.object({onClickOutside:h.boolean().optional(),onEsc:h.boolean().optional(),timeoutMs:h.number().optional()}).optional()}),vp=h.object({id:h.string(),version:h.number(),routes:h.array(h.string()).optional(),steps:h.array(h.union([cA,dA]))});function MF(t){return vp.parse(t)}var DF=({configUri:t,experiments:e,featureKey:a="smart-canvas-overlay-uri",credentials:r="include"}={})=>async()=>{let n=Tf({configUri:t,experiments:e,featureKey:a});if(!n)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(n,{credentials:r});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let i=await o.json();return vp.parse(i)};var yp=K(We(),1),fA=K(sl(),1);function OF({element:t,children:e}){let[a,r]=(0,yp.useState)(null);return(0,yp.useLayoutEffect)(()=>{if(!t){r(null);return}return r(t.getMountNode()),()=>r(null)},[t]),a?(0,fA.createPortal)(e,a):null}function BF(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let a=0;a<16;a++)e+=t[Math.floor(Math.random()*t.length)];return e}var Ry=class{constructor(){$(this,"sessionId");this.sessionId=BF(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,a){}trackAction(e,a,r){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,a,r){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}track(e,a){}};function xp(){return new Ry}var T=typeof window<"u"?window:void 0,It=typeof globalThis<"u"?globalThis:T;typeof self>"u"&&(It.self=It),typeof File>"u"&&(It.File=function(){});var lk=Array.prototype,pA=lk.forEach,hA=lk.indexOf,va=It?.navigator,q=It?.document,ta=It?.location,Wy=It?.fetch,Zy=It!=null&&It.XMLHttpRequest&&"withCredentials"in new It.XMLHttpRequest?It.XMLHttpRequest:void 0,mA=It?.AbortController,ea=va?.userAgent,te=T??{},an={DEBUG:!1,LIB_VERSION:"1.302.2"};function gA(t,e,a,r,n,o,i){try{var s=t[o](i),l=s.value}catch(u){return void a(u)}s.done?e(l):Promise.resolve(l).then(r,n)}function vA(t){return function(){var e=this,a=arguments;return new Promise((function(r,n){var o=t.apply(e,a);function i(l){gA(o,r,n,i,s,"next",l)}function s(l){gA(o,r,n,i,s,"throw",l)}i(void 0)}))}}function G(){return G=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},G.apply(null,arguments)}function uk(t,e){if(t==null)return{};var a={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;a[r]=t[r]}return a}var FF=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],yA=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var a=t.toLowerCase();return FF.concat(e).some((r=>{var n=r.toLowerCase();return a.indexOf(n)!==-1}))},NF=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function fe(t,e){return t.indexOf(e)!==-1}var Kp=function(t){return t.trim()},Xy=function(t){return t.replace(/^\$/,"")},PF=Array.isArray,ck=Object.prototype,dk=ck.hasOwnProperty,Qp=ck.toString,Te=PF||function(t){return Qp.call(t)==="[object Array]"},uo=t=>typeof t=="function",mt=t=>t===Object(t)&&!Te(t),Ps=t=>{if(mt(t)){for(var e in t)if(dk.call(t,e))return!1;return!0}return!1},H=t=>t===void 0,ut=t=>Qp.call(t)=="[object String]",Yy=t=>ut(t)&&t.trim().length===0,sn=t=>t===null,Ie=t=>H(t)||sn(t),xr=t=>Qp.call(t)=="[object Number]",co=t=>Qp.call(t)==="[object Boolean]",HF=t=>t instanceof FormData,UF=t=>fe(NF,t);function Ky(t){return t===null||typeof t!="object"}function Tp(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function fk(t){return!H(Event)&&(function(e,a){try{return e instanceof a}catch{return!1}})(t,Event)}var qF=[!0,"true",1,"1","yes"],My=t=>fe(qF,t),zF=[!1,"false",0,"0","no"];function gr(t,e,a,r,n){return e>a&&(r.warn("min cannot be greater than max."),e=a),xr(t)?t>a?(r.warn(" cannot be greater than max: "+a+". Using max value instead."),a):t<e?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+a+", fallback: "+n),gr(n||a,e,a,r))}var Qy=class{constructor(e){this.t={},this.i=e.i,this.o=gr(e.bucketSize,0,100,e.h),this.m=gr(e.refillRate,0,this.o,e.h),this.S=gr(e.refillInterval,0,864e5,e.h)}$(e,a){var r=a-e.lastAccess,n=Math.floor(r/this.S);if(n>0){var o=n*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+n*this.S}}consumeRateLimit(e){var a,r=Date.now(),n=String(e),o=this.t[n];return o?this.$(o,r):(o={tokens:this.o,lastAccess:r},this.t[n]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((a=this.i)==null||a.call(this,e)),o.tokens===0)}stop(){this.t={}}},bp,xA,Dy,VF=t=>t instanceof Error;function $F(t){var e=globalThis._posthogChunkIds;if(e){var a=Object.keys(e);return Dy&&a.length===xA||(xA=a.length,Dy=a.reduce(((r,n)=>{bp||(bp={});var o=bp[n];if(o)r[o[0]]=o[1];else for(var i=t(n),s=i.length-1;s>=0;s--){var l=i[s],u=l?.filename,c=e[n];if(u&&c){r[u]=c,bp[n]=[u,c];break}}return r}),{})),Dy}}var Jy=class{constructor(e,a,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=a,this.modifiers=r}buildFromUnknown(e,a){a===void 0&&(a={});var r=a&&a.mechanism||{handled:!0,type:"generic"},n=this.buildCoercingContext(r,a,0).apply(e),o=this.buildParsingContext(),i=this.parseStacktrace(n,o);return{$exception_list:this.convertToExceptionList(i,r),$exception_level:"error"}}modifyFrames(e){var a=this;return vA((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&Te(r.stacktrace.frames)&&(r.stacktrace.frames=yield a.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var a;return{type:"Error",value:"Unknown error",stack:(a=e.syntheticException)==null?void 0:a.stack,synthetic:!0}}parseStacktrace(e,a){var r,n;return e.cause!=null&&(r=this.parseStacktrace(e.cause,a)),e.stack!=""&&e.stack!=null&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),a.chunkIdMap)),G({},e,{cause:r,stack:n})}applyChunkIds(e,a){return e.map((r=>(r.filename&&a&&(r.chunk_id=a[r.filename]),r)))}applyCoercers(e,a){for(var r of this.coercers)if(r.match(e))return r.coerce(e,a);return this.coerceFallback(a)}applyModifiers(e){var a=this;return vA((function*(){var r=e;for(var n of a.modifiers)r=yield n(r);return r}))()}convertToExceptionList(e,a){var r,n,o,i={type:e.type,value:e.value,mechanism:{type:(r=a.type)!==null&&r!==void 0?r:"generic",handled:(n=a.handled)===null||n===void 0||n,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(i.stacktrace={type:"raw",frames:e.stack});var s=[i];return e.cause!=null&&s.push(...this.convertToExceptionList(e.cause,G({},a,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:$F(this.stackParser)}}buildCoercingContext(e,a,r){r===void 0&&(r=0);var n=(o,i)=>{if(i<=4){var s=this.buildCoercingContext(e,a,i);return this.applyCoercers(o,s)}};return G({},a,{syntheticException:r==0?a.syntheticException:void 0,mechanism:e,apply:o=>n(o,r),next:o=>n(o,r+1)})}},zs="?";function ex(t,e,a,r,n){var o={platform:t,filename:e,function:a==="<anonymous>"?zs:a,in_app:!0};return H(r)||(o.lineno=r),H(n)||(o.colno=n),o}var pk=(t,e)=>{var a=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return a||r?[t.indexOf("@")!==-1?t.split("@")[0]:zs,a?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},jF=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,GF=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,WF=/\((\S*)(?::(\d+))(?::(\d+))\)/,ZF=(t,e)=>{var a=jF.exec(t);if(a){var[,r,n,o]=a;return ex(e,r,zs,+n,+o)}var i=GF.exec(t);if(i){if(i[2]&&i[2].indexOf("eval")===0){var s=WF.exec(i[2]);s&&(i[2]=s[1],i[3]=s[2],i[4]=s[3])}var[l,u]=pk(i[1]||zs,i[2]);return ex(e,u,l,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},XF=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,YF=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,KF=(t,e)=>{var a=XF.exec(t);if(a){if(a[3]&&a[3].indexOf(" > eval")>-1){var r=YF.exec(a[3]);r&&(a[1]=a[1]||"eval",a[3]=r[1],a[4]=r[2],a[5]="")}var n=a[3],o=a[1]||zs;return[o,n]=pk(o,n),ex(e,n,o,a[4]?+a[4]:void 0,a[5]?+a[5]:void 0)}},bA=/\(error: (.*)\)/,SA=50;function QF(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return function(n,o){o===void 0&&(o=0);for(var i=[],s=n.split(`
|
|
460
|
+
`),l=o;l<s.length;l++){var u=s[l];if(!(u.length>1024)){var c=bA.test(u)?u.replace(bA,"$1"):u;if(!c.match(/\S*Error: /)){for(var d of a){var p=d(c,t);if(p){i.push(p);break}}if(i.length>=SA)break}}}return(function(g){if(!g.length)return[];var S=Array.from(g);return S.reverse(),S.slice(0,SA).map((b=>{return G({},b,{filename:b.filename||(x=S,x[x.length-1]||{}).filename,function:b.function||zs});var x}))})(i)}}var tx=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,a){var r=ut(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?a.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var a=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?a+": "+e.message:a}isDOMException(e){return Tp(e,"DOMException")}isDOMError(e){return Tp(e,"DOMError")}},ax=class{match(e){return(a=>a instanceof Error)(e)}coerce(e,a){return{type:this.getType(e),value:this.getMessage(e,a),stack:this.getStack(e),cause:e.cause?a.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,a){var r=e.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}},rx=class{constructor(){}match(e){return Tp(e,"ErrorEvent")&&e.error!=null}coerce(e,a){var r,n=a.apply(e.error);return n||{type:"ErrorEvent",value:e.message,stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},JF=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,nx=class{match(e){return typeof e=="string"}coerce(e,a){var r,[n,o]=this.getInfos(e);return{type:n??"Error",value:o??e,stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var a="Error",r=e,n=e.match(JF);return n&&(a=n[1],r=n[2]),[a,r]}},eN=["fatal","error","warning","log","info","debug"];function hk(t,e){e===void 0&&(e=40);var a=Object.keys(t);if(a.sort(),!a.length)return"[object has no keys]";for(var r=a.length;r>0;r--){var n=a.slice(0,r).join(", ");if(!(n.length>e))return r===a.length||n.length<=e?n:n.slice(0,e)+"..."}return""}var ox=class{match(e){return typeof e=="object"&&e!==null}coerce(e,a){var r,n=this.getErrorPropertyFromObject(e);return n?a.apply(n):{type:this.getType(e),value:this.getValue(e),stack:(r=a.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return fk(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var a="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(a+=" with message: '"+e.message+"'"),a}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+hk(e)}isSeverityLevel(e){return ut(e)&&!Yy(e)&&eN.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var r=e[a];if(VF(r))return r}}getObjectClassName(e){try{var a=Object.getPrototypeOf(e);return a?a.constructor.name:void 0}catch{return}}},ix=class{match(e){return fk(e)}coerce(e,a){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+hk(e),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},sx=class{match(e){return Ky(e)}coerce(e,a){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},lx=class{match(e){return Tp(e,"PromiseRejectionEvent")}coerce(e,a){var r,n=this.getUnhandledRejectionReason(e);return Ky(n)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(n),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}:a.apply(n)}getUnhandledRejectionReason(e){if(Ky(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}},mk=function(t,e){var{debugEnabled:a}=e===void 0?{}:e,r={k:function(n){if(T&&(an.DEBUG||te.POSTHOG_DEBUG||a)&&!H(T.console)&&T.console){for(var o=("__rrweb_original__"in T.console[n])?T.console[n].__rrweb_original__:T.console[n],i=arguments.length,s=new Array(i>1?i-1:0),l=1;l<i;l++)s[l-1]=arguments[l];o(t,...s)}},info:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("log",...o)},warn:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("warn",...o)},error:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("error",...o)},critical:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];console.error(t,...o)},uninitializedWarning:n=>{r.error("You must initialize PostHog before calling "+n)},createLogger:(n,o)=>mk(t+" "+n,o)};return r},z=mk("[PostHog.js]"),ct=z.createLogger,tN=ct("[ExternalScriptsLoader]"),CA=(t,e,a)=>{if(t.config.disable_external_dependency_loading)return tN.warn(e+" was requested but loading of external scripts is disabled."),a("Loading of external scripts is disabled");var r=q?.querySelectorAll("script");if(r){for(var n,o=function(){if(r[i].src===e){var l=r[i];return l.__posthog_loading_callback_fired?{v:a()}:(l.addEventListener("load",(u=>{l.__posthog_loading_callback_fired=!0,a(void 0,u)})),l.onerror=u=>a(u),{v:void 0})}},i=0;i<r.length;i++)if(n=o())return n.v}var s=()=>{if(!q)return a("document not found");var l=q.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,a(void 0,d)},l.onerror=d=>a(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return a("prepare_external_dependency_script returned null");var u,c=q.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):q.body.appendChild(l)};q!=null&&q.body?s():q?.addEventListener("DOMContentLoaded",s)};te.__PosthogExtensions__=te.__PosthogExtensions__||{},te.__PosthogExtensions__.loadExternalDependency=(t,e,a)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var n=3e5;r=r+"&t="+Math.floor(Date.now()/n)*n}var o=t.requestRouter.endpointFor("assets",r);CA(t,o,a)},te.__PosthogExtensions__.loadSiteApp=(t,e,a)=>{var r=t.requestRouter.endpointFor("api",e);CA(t,r,a)};var Rp={};function fo(t,e,a){if(Te(t)){if(pA&&t.forEach===pA)t.forEach(e,a);else if("length"in t&&t.length===+t.length){for(var r=0,n=t.length;r<n;r++)if(r in t&&e.call(a,t[r],r)===Rp)return}}}function De(t,e,a){if(!Ie(t)){if(Te(t))return fo(t,e,a);if(HF(t)){for(var r of t.entries())if(e.call(a,r[1],r[0])===Rp)return}else for(var n in t)if(dk.call(t,n)&&e.call(a,t[n],n)===Rp)return}}var Je=function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return fo(a,(function(n){for(var o in n)n[o]!==void 0&&(t[o]=n[o])})),t},js=function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return fo(a,(function(n){fo(n,(function(o){t.push(o)}))})),t};function Ap(t){for(var e=Object.keys(t),a=e.length,r=new Array(a);a--;)r[a]=[e[a],t[e[a]]];return r}var _A=function(t){try{return t()}catch{return}},aN=function(t){return function(){try{for(var e=arguments.length,a=new Array(e),r=0;r<e;r++)a[r]=arguments[r];return t.apply(this,a)}catch(n){z.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),z.critical(n)}}},rb=function(t){var e={};return De(t,(function(a,r){(ut(a)&&a.length>0||xr(a))&&(e[r]=a)})),e};function rN(t,e){return a=t,r=o=>ut(o)&&!sn(e)?o.slice(0,e):o,n=new Set,(function o(i,s){return i!==Object(i)?r?r(i,s):i:n.has(i)?void 0:(n.add(i),Te(i)?(l=[],fo(i,(u=>{l.push(o(u))}))):(l={},De(i,((u,c)=>{n.has(u)||(l[c]=o(u,c))}))),l);var l})(a);var a,r,n}var nN=["herokuapp.com","vercel.app","netlify.app"];function oN(t){var e=t?.hostname;if(!ut(e))return!1;var a=e.split(".").slice(-2).join(".");for(var r of nN)if(a===r)return!1;return!0}function gk(t,e){for(var a=0;a<t.length;a++)if(e(t[a]))return t[a]}function nt(t,e,a,r){var{capture:n=!1,passive:o=!0}=r??{};t?.addEventListener(e,a,{capture:n,passive:o})}var vk="$people_distinct_id",Wu="__alias",Zu="__timers",wA="$autocapture_disabled_server_side",ux="$heatmaps_enabled_server_side",LA="$exception_capture_enabled_server_side",cx="$error_tracking_suppression_rules",IA="$error_tracking_capture_extension_exceptions",AA="$web_vitals_enabled_server_side",yk="$dead_clicks_enabled_server_side",kA="$web_vitals_allowed_metrics",Oy="$session_recording_remote_config",Mp="$sesid",xk="$session_is_sampled",Hs="$enabled_feature_flags",Xu="$early_access_features",dx="$feature_flag_details",Yu="$stored_person_properties",pi="$stored_group_properties",fx="$surveys",Sp="$surveys_activated",Dp="$flag_call_reported",rn="$user_state",px="$client_session_props",hx="$capture_rate_limit",mx="$initial_campaign_params",gx="$initial_referrer_info",Op="$initial_person_info",Bp="$epp",bk="__POSTHOG_TOOLBAR__",Pu="$posthog_cookieless",iN=[vk,Wu,"__cmpns",Zu,"$session_recording_enabled_server_side",ux,Mp,Hs,cx,rn,Xu,dx,pi,Yu,fx,Dp,px,hx,mx,gx,Bp,Op];function EA(t){return t instanceof Element&&(t.id===bk||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Jp(t){return!!t&&t.nodeType===1}function po(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Sk(t){return!!t&&t.nodeType===3}function Ck(t){return!!t&&t.nodeType===11}function nb(t){return t?Kp(t).split(/\s+/):[]}function TA(t){var e=T?.location.href;return!!(e&&t&&t.some((a=>e.match(a))))}function Fp(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return nb(e)}function _k(t){return Ie(t)?null:Kp(t).split(/(\s+)/).filter((e=>rc(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function uc(t){var e="";return vx(t)&&!kk(t)&&t.childNodes&&t.childNodes.length&&De(t.childNodes,(function(a){var r;Sk(a)&&a.textContent&&(e+=(r=_k(a.textContent))!==null&&r!==void 0?r:"")})),Kp(e)}function wk(t){return H(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var ob=["a","button","form","input","select","textarea","label"];function Lk(t,e){if(H(e))return!0;var a,r=function(o){if(e.some((i=>o.matches(i))))return{v:!0}};for(var n of t)if(a=r(n))return a.v;return!1}function Ik(t){var e=t.parentNode;return!(!e||!Jp(e))&&e}var sN=["next","previous","prev",">","<"],RA=10,MA=[".ph-no-rageclick",".ph-no-capture"];function lN(t,e){if(!T||ib(t))return!1;var a,r,n;if(co(e)?(a=!!e&&MA,r=void 0):(a=(n=e?.css_selector_ignorelist)!==null&&n!==void 0?n:MA,r=e?.content_ignorelist),a===!1)return!1;var{targetElementList:o}=Ak(t,!1);return!(function(i,s){if(i===!1||H(i))return!1;var l;if(i===!0)l=sN;else{if(!Te(i))return!1;if(i.length>RA)return z.error("[PostHog] content_ignorelist array cannot exceed "+RA+" items. Use css_selector_ignorelist for more complex matching."),!1;l=i.map((u=>u.toLowerCase()))}return s.some((u=>{var{safeText:c,ariaLabel:d}=u;return l.some((p=>c.includes(p)||d.includes(p)))}))})(r,o.map((i=>{var s;return{safeText:uc(i).toLowerCase(),ariaLabel:((s=i.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!Lk(o,a)}var ib=t=>!t||po(t,"html")||!Jp(t),Ak=(t,e)=>{if(!T||ib(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var a=!1,r=[t],n=t;n.parentNode&&!po(n,"body");)if(Ck(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=Ik(n);if(!o)break;if(e||ob.indexOf(o.tagName.toLowerCase())>-1)a=!0;else{var i=T.getComputedStyle(o);i&&i.getPropertyValue("cursor")==="pointer"&&(a=!0)}r.push(o),n=o}return{parentIsUsefulElement:a,targetElementList:r}};function uN(t,e,a,r,n){var o,i,s,l;if(a===void 0&&(a=void 0),!T||ib(t)||(o=a)!=null&&o.url_allowlist&&!TA(a.url_allowlist)||(i=a)!=null&&i.url_ignorelist&&TA(a.url_ignorelist))return!1;if((s=a)!=null&&s.dom_event_allowlist){var u=a.dom_event_allowlist;if(u&&!u.some((S=>e.type===S)))return!1}var{parentIsUsefulElement:c,targetElementList:d}=Ak(t,r);if(!(function(S,b){var x=b?.element_allowlist;if(H(x))return!0;var f,m=function(y){if(x.some((_=>y.tagName.toLowerCase()===_)))return{v:!0}};for(var v of S)if(f=m(v))return f.v;return!1})(d,a)||!Lk(d,(l=a)==null?void 0:l.css_selector_allowlist))return!1;var p=T.getComputedStyle(t);if(p&&p.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=t.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return c?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(ob.indexOf(g)>-1||t.getAttribute("contenteditable")==="true")}}function vx(t){for(var e=t;e.parentNode&&!po(e,"body");e=e.parentNode){var a=Fp(e);if(fe(a,"ph-sensitive")||fe(a,"ph-no-capture"))return!1}if(fe(Fp(t),"ph-include"))return!0;var r=t.type||"";if(ut(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!(ut(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function kk(t){return!!(po(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||po(t,"select")||po(t,"textarea")||t.getAttribute("contenteditable")==="true")}var Ek="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",cN=new RegExp("^(?:"+Ek+")$"),dN=new RegExp(Ek),Tk="\\d{3}-?\\d{2}-?\\d{4}",fN=new RegExp("^("+Tk+")$"),pN=new RegExp("("+Tk+")");function rc(t,e){return e===void 0&&(e=!0),!(Ie(t)||ut(t)&&(t=Kp(t),(e?cN:dN).test((t||"").replace(/[- ]/g,""))||(e?fN:pN).test(t)))}function Rk(t){var e=uc(t);return rc(e=(e+" "+Mk(t)).trim())?e:""}function Mk(t){var e="";return t&&t.childNodes&&t.childNodes.length&&De(t.childNodes,(function(a){var r;if(a&&((r=a.tagName)==null?void 0:r.toLowerCase())==="span")try{var n=uc(a);e=(e+" "+n).trim(),a.childNodes&&a.childNodes.length&&(e=(e+" "+Mk(a)).trim())}catch(o){z.error("[AutoCapture]",o)}})),e}function hN(t){return(function(e){var a=e.map((r=>{var n,o,i="";if(r.tag_name&&(i+=r.tag_name),r.attr_class)for(var s of(r.attr_class.sort(),r.attr_class))i+="."+s.replace(/"/g,"");var l=G({},r.text?{text:r.text}:{},{"nth-child":(n=r.nth_child)!==null&&n!==void 0?n:0,"nth-of-type":(o=r.nth_of_type)!==null&&o!==void 0?o:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),u={};return Ap(l).sort(((c,d)=>{var[p]=c,[g]=d;return p.localeCompare(g)})).forEach((c=>{var[d,p]=c;return u[DA(d.toString())]=DA(p.toString())})),i+=":",i+=Ap(u).map((c=>{var[d,p]=c;return d+'="'+p+'"'})).join("")}));return a.join(";")})((function(e){return e.map((a=>{var r,n,o={text:(r=a.$el_text)==null?void 0:r.slice(0,400),tag_name:a.tag_name,href:(n=a.attr__href)==null?void 0:n.slice(0,2048),attr_class:mN(a),attr_id:a.attr__id,nth_child:a.nth_child,nth_of_type:a.nth_of_type,attributes:{}};return Ap(a).filter((i=>{var[s]=i;return s.indexOf("attr__")===0})).forEach((i=>{var[s,l]=i;return o.attributes[s]=l})),o}))})(t))}function DA(t){return t.replace(/"|\\"/g,'\\"')}function mN(t){var e=t.attr__class;return e?Te(e)?e:nb(e):void 0}var Np=class{constructor(e){this.disabled=e===!1;var a=mt(e)?e:{};this.thresholdPx=a.threshold_px||30,this.timeoutMs=a.timeout_ms||1e3,this.clickCount=a.click_count||3,this.clicks=[]}isRageClick(e,a,r){if(this.disabled)return!1;var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(a-n.y)<this.thresholdPx&&r-n.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:a,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:a,timestamp:r}];return!1}},By="$copy_autocapture",on=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var Pp=t=>{var e=q?.createElement("a");return H(e)?null:(e.href=t,e)},gN=function(t,e){var a,r;e===void 0&&(e="&");var n=[];return De(t,(function(o,i){H(o)||H(i)||i==="undefined"||(a=encodeURIComponent((s=>s instanceof File)(o)?o.name:o.toString()),r=encodeURIComponent(i),n[n.length]=r+"="+a)})),n.join(e)},Hp=function(t,e){for(var a,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]===e){a=o;break}}if(!Te(a)||a.length<2)return"";var i=a[1];try{i=decodeURIComponent(i)}catch{z.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},cc=function(t,e,a){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[0]||"",o=r[1],i=n.split("?"),s=i[1],l=i[0],u=(s||"").split("&"),c=[],d=0;d<u.length;d++){var p=u[d].split("=");Te(p)&&(e.includes(p[0])?c.push(p[0]+"="+a):c.push(u[d]))}var g=l;return s!=null&&(g+="?"+c.join("&")),o!=null&&(g+="#"+o),g},Up=function(t,e){var a=t.match(new RegExp(e+"=([^&]*)"));return a?a[1]:null},OA=ct("[AutoCapture]");function Fy(t,e){return e.length>t?e.slice(0,t)+"...":e}function vN(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Jp(e));return e}function yN(t,e,a,r){var n=t.tagName.toLowerCase(),o={tag_name:n};ob.indexOf(n)>-1&&!a&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?o.$el_text=Fy(1024,Rk(t)):o.$el_text=Fy(1024,uc(t)));var i=Fp(t);i.length>0&&(o.classes=i.filter((function(c){return c!==""}))),De(t.attributes,(function(c){var d;if((!kk(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!e&&rc(c.value)&&(d=c.name,!ut(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var p=c.value;c.name==="class"&&(p=nb(p).join(" ")),o["attr__"+c.name]=Fy(1024,p)}}));for(var s=1,l=1,u=t;u=vN(u);)s++,u.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function xN(t,e){for(var a,r,{e:n,maskAllElementAttributes:o,maskAllText:i,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!po(c,"body");)Ck(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,p=[],g={},S=!1,b=!1;if(De(u,(y=>{var _=vx(y);y.tagName.toLowerCase()==="a"&&(S=y.getAttribute("href"),S=_&&S&&rc(S)&&S),fe(Fp(y),"ph-no-capture")&&(b=!0),p.push(yN(y,o,i,s));var w=(function(C){if(!vx(C))return{};var A={};return De(C.attributes,(function(E){if(E.name&&E.name.indexOf("data-ph-capture-attribute")===0){var L=E.name.replace("data-ph-capture-attribute-",""),k=E.value;L&&k&&rc(k)&&(A[L]=k)}})),A})(y);Je(g,w)})),b)return{props:{},explicitNoCapture:b};if(i||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?p[0].$el_text=Rk(t):p[0].$el_text=uc(t)),S){var x,f;p[0].attr__href=S;var m=(x=Pp(S))==null?void 0:x.host,v=T==null||(f=T.location)==null?void 0:f.host;m&&v&&m!==v&&(d=S)}return{props:Je({$event_type:n.type,$ce_version:1},l?{}:{$elements:p},{$elements_chain:hN(p)},(a=p[0])!=null&&a.$el_text?{$el_text:(r=p[0])==null?void 0:r.$el_text}:{},d&&n.type==="click"?{$external_click_url:d}:{},g)}}var yx=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new Np(e.config.rageclick),this.I=null}get F(){var e,a,r=mt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)==null?void 0:e.map((n=>new RegExp(n))),r.url_ignorelist=(a=r.url_ignorelist)==null?void 0:a.map((n=>new RegExp(n))),r}C(){if(this.isBrowserSupported()){if(T&&q){var e=r=>{r=r||T?.event;try{this.M(r)}catch(n){OA.error("Failed to capture event",n)}};if(nt(q,"submit",e,{capture:!0}),nt(q,"change",e,{capture:!0}),nt(q,"click",e,{capture:!0}),this.F.capture_copied_text){var a=r=>{r=r||T?.event,this.M(r,By)};nt(q,"copy",a,{capture:!0}),nt(q,"cut",a,{capture:!0})}}}else OA.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.C(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.R=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[wA]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var a,r=[];return(a=this.I)==null||a.forEach((n=>{var o=q?.querySelectorAll(n);o?.forEach((i=>{e===i&&r.push(n)}))})),r}get isEnabled(){var e,a,r=(e=this.instance.persistence)==null?void 0:e.props[wA],n=this.T;if(sn(n)&&!co(r)&&!this.instance.O())return!1;var o=(a=this.T)!==null&&a!==void 0?a:!!r;return!!this.instance.config.autocapture&&!o}M(e,a){if(a===void 0&&(a="$autocapture"),this.isEnabled){var r,n=wk(e);Sk(n)&&(n=n.parentNode||null),a==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&lN(n,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=a===By;if(n&&uN(n,e,this.F,o,o?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:s}=xN(n,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.F.element_attribute_ignorelist,elementsChainAsString:this.R});if(s)return!1;var l=this.getElementSelectors(n);if(l&&l.length>0&&(i.$element_selectors=l),a===By){var u,c=_k(T==null||(u=T.getSelection())==null?void 0:u.toString()),d=e.type||"clipboard";if(!c)return!1;i.$selected_content=c,i.$copy_type=d}return this.instance.capture(a,i),!0}}}isBrowserSupported(){return uo(q?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return xr(t)&&isFinite(t)&&Math.floor(t)===t});var BA="0123456789abcdef",xx=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,a,r,n){if(!Number.isInteger(e)||!Number.isInteger(a)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||a<0||r<0||n<0||e>0xffffffffffff||a>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|a>>>8,o[7]=a,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=n>>>24,o[13]=n>>>16,o[14]=n>>>8,o[15]=n,new t(o)}toString(){for(var e="",a=0;a<this.bytes.length;a++)e=e+BA.charAt(this.bytes[a]>>>4)+BA.charAt(15&this.bytes[a]),a!==3&&a!==5&&a!==7&&a!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var a=0;a<16;a++){var r=this.bytes[a]-e.bytes[a];if(r!==0)return Math.sign(r)}return 0}},bx=class{constructor(){this.A=0,this.D=0,this.j=new Sx}generate(){var e=this.generateOrAbort();if(H(e)){this.A=0;var a=this.generateOrAbort();if(H(a))throw new Error("Could not generate UUID after timestamp reset");return a}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return xx.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}},FA,Dk=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};T&&!H(T.crypto)&&crypto.getRandomValues&&(Dk=t=>crypto.getRandomValues(t));var Sx=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(Dk(this.N),this.U=0),this.N[this.U++]}},lo=()=>bN().toString(),bN=()=>(FA||(FA=new bx)).generate(),Hu="",SN=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function CN(t,e){if(e){var a=(function(n,o){if(o===void 0&&(o=q),Hu)return Hu;if(!o||["localhost","127.0.0.1"].includes(n))return"";for(var i=n.split("."),s=Math.min(i.length,8),l="dmn_chk_"+lo();!Hu&&s--;){var u=i.slice(s).join("."),c=l+"=1;domain=."+u+";path=/";o.cookie=c+";max-age=3",o.cookie.includes(l)&&(o.cookie=c+";max-age=0",Hu=u)}return Hu})(t);if(!a){var r=(n=>{var o=n.match(SN);return o?o[0]:""})(t);r!==a&&z.info("Warning: cookie subdomain discovery mismatch",r,a),a=r}return a?"; domain=."+a:""}return""}var yr={H:()=>!!q,B:function(t){z.error("cookieStore error: "+t)},q:function(t){if(q){try{for(var e=t+"=",a=q.cookie.split(";").filter((o=>o.length)),r=0;r<a.length;r++){for(var n=a[r];n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return decodeURIComponent(n.substring(e.length,n.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(yr.q(t))||{}}catch{}return e},G:function(t,e,a,r,n){if(q)try{var o="",i="",s=CN(q.location.hostname,r);if(a){var l=new Date;l.setTime(l.getTime()+24*a*60*60*1e3),o="; expires="+l.toUTCString()}n&&(i="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+i;return u.length>3686.4&&z.warn("cookieStore warning: large cookie, len="+u.length),q.cookie=u,u}catch{return}},V:function(t,e){if(q!=null&&q.cookie)try{yr.G(t,"",-1,e)}catch{return}}},Ny=null,Ge={H:function(){if(!sn(Ny))return Ny;var t=!0;if(H(T))t=!1;else try{var e="__mplssupport__";Ge.G(e,"xyz"),Ge.q(e)!=='"xyz"'&&(t=!1),Ge.V(e)}catch{t=!1}return t||z.error("localStorage unsupported; falling back to cookie store"),Ny=t,t},B:function(t){z.error("localStorage error: "+t)},q:function(t){try{return T?.localStorage.getItem(t)}catch(e){Ge.B(e)}return null},W:function(t){try{return JSON.parse(Ge.q(t))||{}}catch{}return null},G:function(t,e){try{T?.localStorage.setItem(t,JSON.stringify(e))}catch(a){Ge.B(a)}},V:function(t){try{T?.localStorage.removeItem(t)}catch(e){Ge.B(e)}}},_N=["distinct_id",Mp,xk,Bp,Op],Cp=G({},Ge,{W:function(t){try{var e={};try{e=yr.W(t)||{}}catch{}var a=Je(e,JSON.parse(Ge.q(t)||"{}"));return Ge.G(t,a),a}catch{}return null},G:function(t,e,a,r,n,o){try{Ge.G(t,e,void 0,void 0,o);var i={};_N.forEach((s=>{e[s]&&(i[s]=e[s])})),Object.keys(i).length&&yr.G(t,i,a,r,n,o)}catch(s){Ge.B(s)}},V:function(t,e){try{T?.localStorage.removeItem(t),yr.V(t,e)}catch(a){Ge.B(a)}}}),_p={},wN={H:function(){return!0},B:function(t){z.error("memoryStorage error: "+t)},q:function(t){return _p[t]||null},W:function(t){return _p[t]||null},G:function(t,e){_p[t]=e},V:function(t){delete _p[t]}},di=null,Lt={H:function(){if(!sn(di))return di;if(di=!0,H(T))di=!1;else try{var t="__support__";Lt.G(t,"xyz"),Lt.q(t)!=='"xyz"'&&(di=!1),Lt.V(t)}catch{di=!1}return di},B:function(t){z.error("sessionStorage error: ",t)},q:function(t){try{return T?.sessionStorage.getItem(t)}catch(e){Lt.B(e)}return null},W:function(t){try{return JSON.parse(Lt.q(t))||null}catch{}return null},G:function(t,e){try{T?.sessionStorage.setItem(t,JSON.stringify(e))}catch(a){Lt.B(a)}},V:function(t){try{T?.sessionStorage.removeItem(t)}catch(e){Lt.B(e)}}},nn=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),Cx=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?nn.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===nn.DENIED||this.consent===nn.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===nn.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:a,consent_persistence_name:r}=this._instance.config;return r||(a?a+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return My(e)?nn.GRANTED:fe(zF,e)?nn.DENIED:nn.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Ge:yr;var a=e==="localStorage"?yr:Ge;a.q(this.X)&&(this.Z.q(this.X)||this.optInOut(My(a.q(this.X))),a.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!gk([va?.doNotTrack,va?.msDoNotTrack,te.doNotTrack],(e=>My(e)))}},wp=ct("[Dead Clicks]"),LN=()=>!0,IN=t=>{var e,a=!((e=t.instance.persistence)==null||!e.get_property(yk)),r=t.instance.config.capture_dead_clicks;return co(r)?r:!!mt(r)||a},qp=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,a,r){this.instance=e,this.isEnabled=a,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[yk]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.initDeadClicksAutocapture&&e(),(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(n=>{n?wp.error("failed to load script",n):e()}))}et(){var e;if(q){if(!this.tt&&(e=te.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var a=mt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};a.__onCapture=this.onCapture,this.tt=te.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,a),this.tt.start(q),wp.info("starting...")}}else wp.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,wp.info("stopping..."))}},Uu=ct("[ExceptionAutocapture]"),_x=class{constructor(e){var a,r,n;this.rt=()=>{var o;if(T&&this.isEnabled&&(o=te.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var i=te.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=te.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=te.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=i(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=s(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(u){Uu.error("failed to start",u),this.lt()}}},this._instance=e,this.ut=!((a=this._instance.persistence)==null||!a.props[LA]),this.F=this.ht(),this.vt=new Qy({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(n=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&n!==void 0?n:10,refillInterval:1e4,h:Uu}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,a={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return mt(e)?a=G({},a,e):(H(e)?this.ut:e)&&(a=G({},a,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),a}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Uu.info("enabled"),this.it(this.rt))}it(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.errorWrappingFunctions&&e(),(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(n=>{if(n)return Uu.error("failed to load script",n);e()}))}lt(){var e,a,r;(e=this.st)==null||e.call(this),this.st=void 0,(a=this.nt)==null||a.call(this),this.nt=void 0,(r=this.ot)==null||r.call(this),this.ot=void 0}onRemoteConfig(e){var a=e.autocaptureExceptions;this.ut=!!a||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[LA]:this.ut}),this.startIfEnabled()}captureException(e){var a,r,n=(a=e==null||(r=e.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&a!==void 0?a:"Exception";this.vt.consumeRateLimit(n)?Uu.info("Skipping exception capture because of client rate limiting.",{exception:n}):this._instance.exceptions.sendExceptionEvent(e)}};function NA(t,e,a){try{if(!(e in t))return()=>{};var r=t[e],n=a(r);return uo(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=r}}catch{return()=>{}}}var wx=class{constructor(e){var a;this._instance=e,this.dt=(T==null||(a=T.location)==null?void 0:a.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(z.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,z.info("History API monitoring stopped")}monitorHistoryChanges(){var e,a;if(T&&T.history){var r=this;(e=T.history.pushState)!=null&&e.__posthog_wrapped__||NA(T.history,"pushState",(n=>function(o,i,s){n.call(this,o,i,s),r.ft("pushState")})),(a=T.history.replaceState)!=null&&a.__posthog_wrapped__||NA(T.history,"replaceState",(n=>function(o,i,s){n.call(this,o,i,s),r.ft("replaceState")})),this.gt()}}ft(e){try{var a,r=T==null||(a=T.location)==null?void 0:a.pathname;if(!r)return;r!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=r}catch(n){z.error("Error capturing "+e+" pageview",n)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};nt(T,"popstate",e),this.ct=()=>{T&&T.removeEventListener("popstate",e)}}}},Py=ct("[SegmentIntegration]");function AN(t,e){var a=t.config.segment;if(!a)return e();(function(r,n){var o=r.config.segment;if(!o)return n();var i=l=>{var u=()=>l.anonymousId()||lo();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(rn,"identified")),n()},s=o.user();"then"in s&&uo(s.then)?s.then((l=>i(l))):i(s)})(t,(()=>{a.register((r=>{Promise&&Promise.resolve||Py.warn("This browser does not have Promise support, and can not use the segment integration");var n=(o,i)=>{if(!i)return o;o.event.userId||o.event.anonymousId===r.get_distinct_id()||(Py.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(Py.info("UserId set, identifying with PostHog"),r.identify(o.event.userId));var s=r.calculateEventProperties(i,o.event.properties);return o.event.properties=Object.assign({},s,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>n(o,o.event.event),page:o=>n(o,"$pageview"),identify:o=>n(o,"$identify"),screen:o=>n(o,"$screen")}})(t)).then((()=>{e()}))}))}var Ok="posthog-js";function Bk(t,e){var{organization:a,projectId:r,prefix:n,severityAllowList:o=["error"],sendExceptionsToPostHog:i=!0}=e===void 0?{}:e;return s=>{var l,u,c,d,p;if(!(o==="*"||o.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var g=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());s.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var S=((l=s.exception)==null?void 0:l.values)||[],b=S.map((f=>G({},f,{stacktrace:f.stacktrace?G({},f.stacktrace,{type:"raw",frames:(f.stacktrace.frames||[]).map((m=>G({},m,{platform:"web:javascript"})))}):void 0}))),x={$exception_message:((u=S[0])==null?void 0:u.value)||s.message,$exception_type:(c=S[0])==null?void 0:c.type,$exception_level:s.level,$exception_list:b,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((d=S[0])==null?void 0:d.value)||s.message,$sentry_exception_type:(p=S[0])==null?void 0:p.type,$sentry_tags:s.tags};return a&&r&&(x.$sentry_url=(n||"https://sentry.io/organizations/")+a+"/issues/?project="+r+"&query="+s.event_id),i&&t.exceptions.sendExceptionEvent(x),s}}var Lx=class{constructor(e,a,r,n,o,i){this.name=Ok,this.setupOnce=function(s){s(Bk(e,{organization:a,projectId:r,prefix:n,severityAllowList:o,sendExceptionsToPostHog:i==null||i}))}}},kN=T!=null&&T.location?Up(T.location.hash,"__posthog")||Up(location.hash,"state"):null,PA="_postHogToolbarParams",HA=ct("[Toolbar]"),so=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(so||{}),Ix=class{constructor(e){this.instance=e}_t(e){te.ph_toolbar_state=e}yt(){var e;return(e=te.ph_toolbar_state)!==null&&e!==void 0?e:so.UNINITIALIZED}maybeLoadToolbar(e,a,r){if(e===void 0&&(e=void 0),a===void 0&&(a=void 0),r===void 0&&(r=void 0),!T||!q)return!1;e=e??T.location,r=r??T.history;try{if(!a){try{T.localStorage.setItem("test","test"),T.localStorage.removeItem("test")}catch{return!1}a=T?.localStorage}var n,o=kN||Up(e.hash,"__posthog")||Up(e.hash,"state"),i=o?_A((()=>JSON.parse(atob(decodeURIComponent(o)))))||_A((()=>JSON.parse(decodeURIComponent(o)))):null;return i&&i.action==="ph_authorize"?((n=i).source="url",n&&Object.keys(n).length>0&&(i.desiredHash?e.hash=i.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((n=JSON.parse(a.getItem(PA)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token)&&(this.loadToolbar(n),!0)}catch{return!1}}bt(e){var a=te.ph_load_toolbar||te.ph_load_editor;!Ie(a)&&uo(a)?a(e,this.instance):HA.warn("No toolbar load function found")}loadToolbar(e){var a=!(q==null||!q.getElementById(bk));if(!T||a)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=G({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(T.localStorage.setItem(PA,JSON.stringify(G({},n,{source:void 0}))),this.yt()===so.LOADED)this.bt(n);else if(this.yt()===so.UNINITIALIZED){var o;this._t(so.LOADING),(o=te.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return HA.error("[Toolbar] Failed to load",i),void this._t(so.UNINITIALIZED);this._t(so.LOADED),this.bt(n)})),nt(T,"turbolinks:load",(()=>{this._t(so.UNINITIALIZED),this.loadToolbar(n)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,a,r){return e===void 0&&(e=void 0),a===void 0&&(a=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,a,r)}},EN=ct("[TracingHeaders]"),Ax=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var a,r;H(this.xt)&&((a=te.__PosthogExtensions__)==null||(a=a.tracingHeadersPatchFns)==null||a._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),H(this.St)&&((r=te.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.tracingHeadersPatchFns&&e(),(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(n=>{if(n)return EN.error("failed to load script",n);e()}))}startIfEnabledOrStop(){var e,a;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(a=this.St)==null||a.call(this),this.xt=void 0,this.St=void 0)}},Na="Mobile",zp="iOS",vr="Android",nc="Tablet",Fk=vr+" "+nc,Nk="iPad",Pk="Apple",Hk=Pk+" Watch",oc="Safari",Vs="BlackBerry",Uk="Samsung",qk=Uk+"Browser",zk=Uk+" Internet",hi="Chrome",TN=hi+" OS",Vk=hi+" "+zp,sb="Internet Explorer",$k=sb+" "+Na,lb="Opera",RN=lb+" Mini",ub="Edge",jk="Microsoft "+ub,Us="Firefox",Gk=Us+" "+zp,ic="Nintendo",sc="PlayStation",qs="Xbox",Wk=vr+" "+Na,Zk=Na+" "+oc,Ku="Windows",kx=Ku+" Phone",UA="Nokia",Ex="Ouya",Xk="Generic",MN=Xk+" "+Na.toLowerCase(),Yk=Xk+" "+nc.toLowerCase(),Tx="Konqueror",Ht="(\\d+(\\.\\d+)?)",Hy=new RegExp("Version/"+Ht),DN=new RegExp(qs,"i"),ON=new RegExp(sc+" \\w+","i"),BN=new RegExp(ic+" \\w+","i"),cb=new RegExp(Vs+"|PlayBook|BB10","i"),FN={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},NN=(t,e)=>e&&fe(e,Pk)||(function(a){return fe(a,oc)&&!fe(a,hi)&&!fe(a,vr)})(t),Kk=function(t,e){return e=e||"",fe(t," OPR/")&&fe(t,"Mini")?RN:fe(t," OPR/")?lb:cb.test(t)?Vs:fe(t,"IE"+Na)||fe(t,"WPDesktop")?$k:fe(t,qk)?zk:fe(t,ub)||fe(t,"Edg/")?jk:fe(t,"FBIOS")?"Facebook "+Na:fe(t,"UCWEB")||fe(t,"UCBrowser")?"UC Browser":fe(t,"CriOS")?Vk:fe(t,"CrMo")||fe(t,hi)?hi:fe(t,vr)&&fe(t,oc)?Wk:fe(t,"FxiOS")?Gk:fe(t.toLowerCase(),Tx.toLowerCase())?Tx:NN(t,e)?fe(t,Na)?Zk:oc:fe(t,Us)?Us:fe(t,"MSIE")||fe(t,"Trident/")?sb:fe(t,"Gecko")?Us:""},PN={[$k]:[new RegExp("rv:"+Ht)],[jk]:[new RegExp(ub+"?\\/"+Ht)],[hi]:[new RegExp("("+hi+"|CrMo)\\/"+Ht)],[Vk]:[new RegExp("CriOS\\/"+Ht)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ht)],[oc]:[Hy],[Zk]:[Hy],[lb]:[new RegExp("(Opera|OPR)\\/"+Ht)],[Us]:[new RegExp(Us+"\\/"+Ht)],[Gk]:[new RegExp("FxiOS\\/"+Ht)],[Tx]:[new RegExp("Konqueror[:/]?"+Ht,"i")],[Vs]:[new RegExp(Vs+" "+Ht),Hy],[Wk]:[new RegExp("android\\s"+Ht,"i")],[zk]:[new RegExp(qk+"\\/"+Ht)],[sb]:[new RegExp("(rv:|MSIE )"+Ht)],Mozilla:[new RegExp("rv:"+Ht)]},HN=function(t,e){var a=Kk(t,e),r=PN[a];if(H(r))return null;for(var n=0;n<r.length;n++){var o=r[n],i=t.match(o);if(i)return parseFloat(i[i.length-2])}return null},qA=[[new RegExp(qs+"; "+qs+" (.*?)[);]","i"),t=>[qs,t&&t[1]||""]],[new RegExp(ic,"i"),[ic,""]],[new RegExp(sc,"i"),[sc,""]],[cb,[Vs,""]],[new RegExp(Ku,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[kx,""];if(new RegExp(Na).test(e)&&!/IEMobile\b/.test(e))return[Ku+" "+Na,""];var a=/Windows NT ([0-9.]+)/i.exec(e);if(a&&a[1]){var r=a[1],n=FN[r]||"";return/arm/i.test(e)&&(n="RT"),[Ku,n]}return[Ku,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[zp,e.join(".")]}return[zp,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=H(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+vr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+vr+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[vr,e.join(".")]}return[vr,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var a=[t[1],t[2],t[3]||"0"];e[1]=a.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[TN,""]],[/Linux|debian/i,["Linux",""]]],zA=function(t){return BN.test(t)?ic:ON.test(t)?sc:DN.test(t)?qs:new RegExp(Ex,"i").test(t)?Ex:new RegExp("("+kx+"|WPDesktop)","i").test(t)?kx:/iPad/.test(t)?Nk:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Hk:cb.test(t)?Vs:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(UA,"i").test(t)?UA:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(Na).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?vr:Fk:vr:new RegExp("(pda|"+Na+")","i").test(t)?MN:new RegExp(nc,"i").test(t)&&!new RegExp(nc+" pc","i").test(t)?Yk:""},Lp="https?://(.*)",Gs=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],UN=js(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Gs),dc="<masked>",qN=["li_fat_id"];function Qk(t,e,a){if(!q)return{};var r,n=e?js([],Gs,a||[]):[],o=Jk(cc(q.URL,n,dc),t),i=(r={},De(qN,(function(s){var l=yr.q(s);r[s]=l||null})),r);return Je(i,o)}function Jk(t,e){var a=UN.concat(e||[]),r={};return De(a,(function(n){var o=Hp(t,n);r[n]=o||null})),r}function eE(t){var e=(function(o){return o?o.search(Lp+"google.([^/?]*)")===0?"google":o.search(Lp+"bing.com")===0?"bing":o.search(Lp+"yahoo.com")===0?"yahoo":o.search(Lp+"duckduckgo.com")===0?"duckduckgo":null:null})(t),a=e!="yahoo"?"q":"p",r={};if(!sn(e)){r.$search_engine=e;var n=q?Hp(q.referrer,a):"";n.length&&(r.ph_keyword=n)}return r}function VA(){return navigator.language||navigator.userLanguage}function tE(){return q?.referrer||"$direct"}function aE(t,e){var a=t?js([],Gs,e||[]):[],r=ta?.href.substring(0,1e3);return{r:tE().substring(0,1e3),u:r?cc(r,a,dc):void 0}}function rE(t){var e,{r:a,u:r}=t,n={$referrer:a,$referring_domain:a==null?void 0:a=="$direct"?"$direct":(e=Pp(a))==null?void 0:e.host};if(r){n.$current_url=r;var o=Pp(r);n.$host=o?.host,n.$pathname=o?.pathname;var i=Jk(r);Je(n,i)}if(a){var s=eE(a);Je(n,s)}return n}function nE(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function zN(){try{return new Date().getTimezoneOffset()}catch{return}}function VN(t,e){if(!ea)return{};var a,r,n,o=t?js([],Gs,e||[]):[],[i,s]=(function(l){for(var u=0;u<qA.length;u++){var[c,d]=qA[u],p=c.exec(l),g=p&&(uo(d)?d(p,l):d);if(g)return g}return["",""]})(ea);return Je(rb({$os:i,$os_version:s,$browser:Kk(ea,navigator.vendor),$device:zA(ea),$device_type:(r=ea,n=zA(r),n===Nk||n===Fk||n==="Kobo"||n==="Kindle Fire"||n===Yk?nc:n===ic||n===qs||n===sc||n===Ex?"Console":n===Hk?"Wearable":n?Na:"Desktop"),$timezone:nE(),$timezone_offset:zN()}),{$current_url:cc(ta?.href,o,dc),$host:ta?.host,$pathname:ta?.pathname,$raw_user_agent:ea.length>1e3?ea.substring(0,997)+"...":ea,$browser_version:HN(ea,navigator.vendor),$browser_language:VA(),$browser_language_prefix:(a=VA(),typeof a=="string"?a.split("-")[0]:void 0),$screen_height:T?.screen.height,$screen_width:T?.screen.width,$viewport_height:T?.innerHeight,$viewport_width:T?.innerWidth,$lib:"web",$lib_version:an.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var no=ct("[Web Vitals]"),$A=9e5,Rx=class{constructor(e){var a;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((r,n)=>G({},r,{["$web_vitals_"+n.name+"_event"]:G({},n),["$web_vitals_"+n.name+"_value"]:n.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=r=>{var n,o=(n=this._instance.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0);if(H(o))no.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Tt();H(i)||(Ie(r?.name)||Ie(r?.value)?no.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?no.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==i&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),H(this.N.url)&&(this.N.url=i),this.N.firstMetricTimestamp=H(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(G({},r,{$current_url:i,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var r,n,o,i,s=te.__PosthogExtensions__;H(s)||H(s.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:n,onFCP:o,onINP:i}=s.postHogWebVitalsCallbacks),r&&n&&o&&i?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Pt.bind(this)),this.P=!0):no.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((a=this._instance.persistence)==null||!a.props[AA]),this.startIfEnabled()}get allowedMetrics(){var e,a,r=mt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return H(r)?((a=this._instance.persistence)==null?void 0:a.props[kA])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(mt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=mt(this._instance.config.capture_performance)&&xr(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:$A;return 0<e&&e<=6e4?$A:e}get isEnabled(){var e=ta?.protocol;if(e!=="http:"&&e!=="https:")return no.info("Web Vitals are disabled on non-http/https protocols"),!1;var a=mt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:co(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return co(a)?a:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(no.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var a=mt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=mt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[AA]:a}),this._instance.persistence.register({[kA]:r})),this.Et=a,this.startIfEnabled()}it(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.postHogWebVitalsCallbacks&&e(),(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",(n=>{n?no.error("failed to load script",n):e()}))}Tt(){var e=T?T.location.href:void 0;if(e){var a=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,n=a?js([],Gs,r||[]):[];return cc(e,n,dc)}no.error("Could not determine current URL")}},$N=ct("[Heatmaps]");function jA(t){return mt(t)&&"clientX"in t&&"clientY"in t&&xr(t.clientX)&&xr(t.clientY)}var Mx=class{constructor(e){var a;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((a=this.instance.persistence)==null||!a.props[ux]),this.rageclicks=new Np(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return mt(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return H(this.instance.config.capture_heatmaps)?H(this.instance.config.enable_heatmaps)?this.Et:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;$N.info("starting..."),this.Ft(),this.Ct()}else{var e;clearInterval((e=this.It)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var a=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ux]:a}),this.Et=a,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ct(){this.It&&clearInterval(this.It),this.It=(function(e){return e?.visibilityState==="visible"})(q)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){T&&q&&(this.jt=this.Dt.bind(this),nt(T,"beforeunload",this.jt),this.Lt=e=>this.At(e||T?.event),nt(q,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||T?.event),nt(q,"mousemove",this.Nt,{capture:!0}),this.zt=new qp(this.instance,LN,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),nt(q,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;T&&q&&(this.jt&&T.removeEventListener("beforeunload",this.jt),this.Lt&&q.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&q.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&q.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,a){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),i=(function(s,l,u){for(var c=s;c&&Jp(c)&&!po(c,"body");){if(c===u)return!1;if(fe(l,T?.getComputedStyle(c).position))return!0;c=Ik(c)}return!1})(wk(e),["fixed","sticky"],o);return{x:e.clientX+(i?0:n),y:e.clientY+(i?0:r),target_fixed:i,type:a}}At(e,a){var r;if(a===void 0&&(a="click"),!EA(e.target)&&jA(e)){var n=this.qt(e,a);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(G({},n,{type:"rageclick"})),this.Wt(n)}}Ut(e){!EA(e.target)&&jA(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(T){var a=T.location.href,r=this.instance.config.mask_personal_data_properties,n=this.instance.config.custom_personal_data_properties,o=r?js([],Gs,n||[]):[],i=cc(a,o,dc);this.N=this.N||{},this.N[i]||(this.N[i]=[]),this.N[i].push(e)}}Dt(){this.N&&!Ps(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},Dx=class{constructor(e){this._instance=e}doPageView(e,a){var r,n=this.Gt(e,a);return this.Vt={pathname:(r=T?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:a,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var a;return this.Gt(e,(a=this.Vt)==null?void 0:a.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,a){var r=this.Vt;if(!r)return{$pageview_id:a};var n={$pageview_id:a,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:i,lastScrollY:s,maxScrollY:l,maxContentHeight:u,lastContentY:c,maxContentY:d}=o;if(!(H(i)||H(s)||H(l)||H(u)||H(c)||H(d))){i=Math.ceil(i),s=Math.ceil(s),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d);var p=i<=1?1:gr(s/i,0,1,z),g=i<=1?1:gr(l/i,0,1,z),S=u<=1?1:gr(c/u,0,1,z),b=u<=1?1:gr(d/u,0,1,z);n=Je(n,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:S,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:b})}}return r.pathname&&(n.$prev_pageview_pathname=r.pathname),r.timestamp&&(n.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),n}},Pa=Uint8Array,Ut=Uint16Array,$s=Uint32Array,db=new Pa([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fb=new Pa([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),GA=new Pa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),oE=function(t,e){for(var a=new Ut(31),r=0;r<31;++r)a[r]=e+=1<<t[r-1];var n=new $s(a[30]);for(r=1;r<30;++r)for(var o=a[r];o<a[r+1];++o)n[o]=o-a[r]<<5|r;return[a,n]},iE=oE(db,2),jN=iE[0],Ox=iE[1];jN[28]=258,Ox[258]=28;for(Bx=oE(fb,0)[1],Vp=new Ut(32768),Oe=0;Oe<32768;++Oe)oo=(43690&Oe)>>>1|(21845&Oe)<<1,oo=(61680&(oo=(52428&oo)>>>2|(13107&oo)<<2))>>>4|(3855&oo)<<4,Vp[Oe]=((65280&oo)>>>8|(255&oo)<<8)>>>1;var oo,Bx,Vp,Oe,ec=function(t,e,a){for(var r=t.length,n=0,o=new Ut(e);n<r;++n)++o[t[n]-1];var i,s=new Ut(e);for(n=0;n<e;++n)s[n]=s[n-1]+o[n-1]<<1;if(a){i=new Ut(1<<e);var l=15-e;for(n=0;n<r;++n)if(t[n])for(var u=n<<4|t[n],c=e-t[n],d=s[t[n]-1]++<<c,p=d|(1<<c)-1;d<=p;++d)i[Vp[d]>>>l]=u}else for(i=new Ut(r),n=0;n<r;++n)i[n]=Vp[s[t[n]-1]++]>>>15-t[n];return i},mi=new Pa(288);for(Oe=0;Oe<144;++Oe)mi[Oe]=8;for(Oe=144;Oe<256;++Oe)mi[Oe]=9;for(Oe=256;Oe<280;++Oe)mi[Oe]=7;for(Oe=280;Oe<288;++Oe)mi[Oe]=8;var $p=new Pa(32);for(Oe=0;Oe<32;++Oe)$p[Oe]=5;var GN=ec(mi,9,0),WN=ec($p,5,0),sE=function(t){return(t/8>>0)+(7&t&&1)},lE=function(t,e,a){(a==null||a>t.length)&&(a=t.length);var r=new(t instanceof Ut?Ut:t instanceof $s?$s:Pa)(a-e);return r.set(t.subarray(e,a)),r},tn=function(t,e,a){a<<=7&e;var r=e/8>>0;t[r]|=a,t[r+1]|=a>>>8},qu=function(t,e,a){a<<=7&e;var r=e/8>>0;t[r]|=a,t[r+1]|=a>>>8,t[r+2]|=a>>>16},Uy=function(t,e){for(var a=[],r=0;r<t.length;++r)t[r]&&a.push({s:r,f:t[r]});var n=a.length,o=a.slice();if(!n)return[new Pa(0),0];if(n==1){var i=new Pa(a[0].s+1);return i[a[0].s]=1,[i,1]}a.sort((function(_,w){return _.f-w.f})),a.push({s:-1,f:25001});var s=a[0],l=a[1],u=0,c=1,d=2;for(a[0]={s:-1,f:s.f+l.f,l:s,r:l};c!=n-1;)s=a[a[u].f<a[d].f?u++:d++],l=a[u!=c&&a[u].f<a[d].f?u++:d++],a[c++]={s:-1,f:s.f+l.f,l:s,r:l};var p=o[0].s;for(r=1;r<n;++r)o[r].s>p&&(p=o[r].s);var g=new Ut(p+1),S=Fx(a[c-1],g,0);if(S>e){r=0;var b=0,x=S-e,f=1<<x;for(o.sort((function(_,w){return g[w.s]-g[_.s]||_.f-w.f}));r<n;++r){var m=o[r].s;if(!(g[m]>e))break;b+=f-(1<<S-g[m]),g[m]=e}for(b>>>=x;b>0;){var v=o[r].s;g[v]<e?b-=1<<e-g[v]++-1:++r}for(;r>=0&&b;--r){var y=o[r].s;g[y]==e&&(--g[y],++b)}S=e}return[new Pa(g),S]},Fx=function(t,e,a){return t.s==-1?Math.max(Fx(t.l,e,a+1),Fx(t.r,e,a+1)):e[t.s]=a},WA=function(t){for(var e=t.length;e&&!t[--e];);for(var a=new Ut(++e),r=0,n=t[0],o=1,i=function(l){a[r++]=l},s=1;s<=e;++s)if(t[s]==n&&s!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(n),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(n);o=1,n=t[s]}return[a.subarray(0,r),e]},zu=function(t,e){for(var a=0,r=0;r<e.length;++r)a+=t[r]*e[r];return a},Nx=function(t,e,a){var r=a.length,n=sE(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;o<r;++o)t[n+o+4]=a[o];return 8*(n+4+r)},ZA=function(t,e,a,r,n,o,i,s,l,u,c){tn(e,c++,a),++n[256];for(var d=Uy(n,15),p=d[0],g=d[1],S=Uy(o,15),b=S[0],x=S[1],f=WA(p),m=f[0],v=f[1],y=WA(b),_=y[0],w=y[1],C=new Ut(19),A=0;A<m.length;++A)C[31&m[A]]++;for(A=0;A<_.length;++A)C[31&_[A]]++;for(var E=Uy(C,7),L=E[0],k=E[1],D=19;D>4&&!L[GA[D-1]];--D);var R,F,N,U,Y=u+5<<3,B=zu(n,mi)+zu(o,$p)+i,W=zu(n,p)+zu(o,b)+i+14+3*D+zu(C,L)+(2*C[16]+3*C[17]+7*C[18]);if(Y<=B&&Y<=W)return Nx(e,c,t.subarray(l,l+u));if(tn(e,c,1+(W<B)),c+=2,W<B){R=ec(p,g,0),F=p,N=ec(b,x,0),U=b;var ve=ec(L,k,0);for(tn(e,c,v-257),tn(e,c+5,w-1),tn(e,c+10,D-4),c+=14,A=0;A<D;++A)tn(e,c+3*A,L[GA[A]]);c+=3*D;for(var Ha=[m,_],dt=0;dt<2;++dt){var qt=Ha[dt];for(A=0;A<qt.length;++A){var j=31&qt[A];tn(e,c,ve[j]),c+=L[j],j>15&&(tn(e,c,qt[A]>>>5&127),c+=qt[A]>>>12)}}}else R=GN,F=mi,N=WN,U=$p;for(A=0;A<s;++A)if(r[A]>255){j=r[A]>>>18&31,qu(e,c,R[j+257]),c+=F[j+257],j>7&&(tn(e,c,r[A]>>>23&31),c+=db[j]);var re=31&r[A];qu(e,c,N[re]),c+=U[re],re>3&&(qu(e,c,r[A]>>>5&8191),c+=fb[re])}else qu(e,c,R[r[A]]),c+=F[r[A]];return qu(e,c,R[256]),c+F[256]},ZN=new $s([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),XN=(function(){for(var t=new $s(256),e=0;e<256;++e){for(var a=e,r=9;--r;)a=(1&a&&3988292384)^a>>>1;t[e]=a}return t})(),YN=function(t,e,a,r,n){return(function(o,i,s,l,u,c){var d=o.length,p=new Pa(l+d+5*(1+Math.floor(d/7e3))+u),g=p.subarray(l,p.length-u),S=0;if(!i||d<8)for(var b=0;b<=d;b+=65535){var x=b+65535;x<d?S=Nx(g,S,o.subarray(b,x)):(g[b]=c,S=Nx(g,S,o.subarray(b,d)))}else{for(var f=ZN[i-1],m=f>>>13,v=8191&f,y=(1<<s)-1,_=new Ut(32768),w=new Ut(y+1),C=Math.ceil(s/3),A=2*C,E=function(Ph){return(o[Ph]^o[Ph+1]<<C^o[Ph+2]<<A)&y},L=new $s(25e3),k=new Ut(288),D=new Ut(32),R=0,F=0,N=(b=0,0),U=0,Y=0;b<d;++b){var B=E(b),W=32767&b,ve=w[B];if(_[W]=ve,w[B]=W,U<=b){var Ha=d-b;if((R>7e3||N>24576)&&Ha>423){S=ZA(o,g,0,L,k,D,F,N,Y,b-Y,S),N=R=F=0,Y=b;for(var dt=0;dt<286;++dt)k[dt]=0;for(dt=0;dt<30;++dt)D[dt]=0}var qt=2,j=0,re=v,At=W-ve&32767;if(Ha>2&&B==E(b-At))for(var dn=Math.min(m,Ha)-1,Bh=Math.min(32767,b),Fh=Math.min(258,Ha);At<=Bh&&--re&&W!=ve;){if(o[b+qt]==o[b+qt-At]){for(var fn=0;fn<Fh&&o[b+fn]==o[b+fn-At];++fn);if(fn>qt){if(qt=fn,j=At,fn>dn)break;var YE=Math.min(At,fn-2),hS=0;for(dt=0;dt<YE;++dt){var Nh=b-At+dt+32768&32767,mS=Nh-_[Nh]+32768&32767;mS>hS&&(hS=mS,ve=Nh)}}}At+=(W=ve)-(ve=_[W])+32768&32767}if(j){L[N++]=268435456|Ox[qt]<<18|Bx[j];var gS=31&Ox[qt],vS=31&Bx[j];F+=db[gS]+fb[vS],++k[257+gS],++D[vS],U=b+qt,++R}else L[N++]=o[b],++k[o[b]]}}S=ZA(o,g,c,L,k,D,F,N,Y,b-Y,S)}return lE(p,0,l+sE(S)+u)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,a,r,!0)},qy=function(t,e,a){for(;a;++e)t[e]=a,a>>>=8};function KN(t,e){e===void 0&&(e={});var a=(function(){var s=4294967295;return{p:function(l){for(var u=s,c=0;c<l.length;++c)u=XN[255&u^l[c]]^u>>>8;s=u},d:function(){return 4294967295^s}}})(),r=t.length;a.p(t);var n,o=YN(t,e,10+((n=e).filename&&n.filename.length+1||0),8),i=o.length;return(function(s,l){var u=l.filename;if(s[0]=31,s[1]=139,s[2]=8,s[8]=l.level<2?4:l.level==9?2:0,s[9]=3,l.mtime!=0&&qy(s,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){s[3]=8;for(var c=0;c<=u.length;++c)s[c+10]=u.charCodeAt(c)}})(o,e),qy(o,i-8,a.d()),qy(o,i-4,r),o}var QN=function(t){var e,a,r,n,o="";for(e=a=0,r=(t=(t+"").replace(/\r\n/g,`
|
|
446
461
|
`).replace(/\r/g,`
|
|
447
|
-
`)).length,r=0;r<i;r++){var o=t.charCodeAt(r),s=null;o<128?n++:s=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Qi(s)||(n>e&&(a+=t.substring(e,n)),a+=s,e=n=r+1)}return n>e&&(a+=t.substring(e,t.length)),a},T3=!!Kv||!!Wv,zA="text/plain",vp=function(t,e,n){var i;n===void 0&&(n=!0);var[r,a]=t.split("?"),o=j({},e),s=(i=a?.split("&").map((c=>{var u,[f,h]=c.split("="),g=n&&(u=o[f])!==null&&u!==void 0?u:h;return delete o[f],f+"="+g})))!==null&&i!==void 0?i:[],l=qL(o);return l&&s.push(l),r+"?"+s.join("&")},Rc=(t,e)=>JSON.stringify(t,((n,i)=>typeof i=="bigint"?i.toString():i),e),qv=t=>{var{data:e,compression:n}=t;if(e){if(n===Xi.GZipJS){var i=C3((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var f=new Ln(l.length+(l.length>>>1)),h=0,g=function(d){f[h++]=d},_=0;_<u;++_){if(h+5>f.length){var b=new Ln(h+8+(u-_<<1));b.set(f),f=b}var w=l.charCodeAt(_);w<128||c?g(w):w<2048?(g(192|w>>>6),g(128|63&w)):w>55295&&w<57344?(g(240|(w=65536+(1047552&w)|1023&l.charCodeAt(++_))>>>18),g(128|w>>>12&63),g(128|w>>>6&63),g(128|63&w)):(g(224|w>>>12),g(128|w>>>6&63),g(128|63&w))}return KT(f,0,h)})(Rc(e)),{mtime:0}),r=new Blob([i],{type:zA});return{contentType:zA,body:r,estimatedSize:r.size}}if(n===Xi.Base64){var a=(function(l){var c,u,f,h,g,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b=0,w=0,d="",p=[];if(!l)return l;l=A3(l);do c=(g=l.charCodeAt(b++)<<16|l.charCodeAt(b++)<<8|l.charCodeAt(b++))>>18&63,u=g>>12&63,f=g>>6&63,h=63&g,p[w++]=_.charAt(c)+_.charAt(u)+_.charAt(f)+_.charAt(h);while(b<l.length);switch(d=p.join(""),l.length%3){case 1:d=d.slice(0,-2)+"==";break;case 2:d=d.slice(0,-1)+"="}return d})(Rc(e)),o=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Rc(l)))(a);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var s=Rc(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},ep=[];Wv&&ep.push({transport:"fetch",method:t=>{var e,n,{contentType:i,body:r,estimatedSize:a}=(e=qv(t))!==null&&e!==void 0?e:{},o=new Headers;Re(t.headers,(function(u,f){o.append(f,u)})),i&&o.append("Content-Type",i);var s=t.url,l=null;if(iA){var c=new iA;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),t.timeout)}}Wv(s,j({method:t?.method||"GET",headers:o,keepalive:t.method==="POST"&&(a||0)<52428.8,body:r,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then((u=>u.text().then((f=>{var h={statusCode:u.status,text:f};if(u.status===200)try{h.json=JSON.parse(f)}catch(g){$.error(g)}t.callback==null||t.callback(h)})))).catch((u=>{$.error(u),t.callback==null||t.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Kv&&ep.push({transport:"XHR",method:t=>{var e,n=new Kv;n.open(t.method||"GET",t.url,!0);var{contentType:i,body:r}=(e=qv(t))!==null&&e!==void 0?e:{};Re(t.headers,(function(a,o){n.setRequestHeader(o,a)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var a={statusCode:n.status,text:n.responseText};if(n.status===200)try{a.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(a)}},n.send(r)}}),dn!=null&&dn.sendBeacon&&ep.push({transport:"sendBeacon",method:t=>{var e=vp(t.url,{beacon:"1"});try{var n,{contentType:i,body:r}=(n=qv(t))!==null&&n!==void 0?n:{},a=typeof r=="string"?new Blob([r],{type:i}):r;dn.sendBeacon(e,a)}catch{}}});var yp=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function BA(t,e,n){return Rc({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var XT={exact:(t,e)=>e.some((n=>t.some((i=>n===i)))),is_not:(t,e)=>e.every((n=>t.every((i=>n!==i)))),regex:(t,e)=>e.some((n=>t.some((i=>yp(n,i))))),not_regex:(t,e)=>e.every((n=>t.every((i=>!yp(n,i))))),icontains:(t,e)=>e.map(Qf).some((n=>t.map(Qf).some((i=>n.includes(i))))),not_icontains:(t,e)=>e.map(Qf).every((n=>t.map(Qf).every((i=>!n.includes(i)))))},Qf=t=>t.toLowerCase();function QT(t,e){return!t||Object.entries(t).every((n=>{var[i,r]=n,a=e?.[i];if(I(a)||Qi(a))return!1;var o=[String(a)],s=XT[r.operator];return!!s&&s(r.values,o)}))}var Pv=st("[Error tracking]"),Fy=class{constructor(e){var n,i;this.Jt=[],this.Kt=new ty([new iy,new uy,new ay,new ry,new ly,new sy,new oy,new cy],AL("web:javascript",xL,CL)),this._instance=e,this.Jt=(n=(i=this._instance.persistence)==null?void 0:i.get_property(fy))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,i,r,a=(n=(i=e.errorTracking)==null?void 0:i.suppressionRules)!==null&&n!==void 0?n:[],o=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Jt=a,this._instance.persistence&&this._instance.persistence.register({[fy]:this.Jt,[hA]:o})}get Yt(){var e,n=!!this._instance.get_property(hA),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.Kt.buildFromUnknown(e,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.Xt(n)){if(this.Qt(n))return void Pv.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void Pv.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))return void Pv.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var n=e.reduce(((i,r)=>{var{type:a,value:o}=r;return ot(a)&&a.length>0&&i.$exception_types.push(a),ot(o)&&o.length>0&&i.$exception_values.push(o),i}),{$exception_types:[],$exception_values:[]});return this.Jt.some((i=>{var r=i.values.map((a=>{var o,s=XT[a.operator],l=Ae(a.value)?a.value:[a.value],c=(o=n[a.key])!==null&&o!==void 0?o:[];return l.length>0&&s(l,c)}));return i.type==="OR"?r.some(Boolean):r.every(Boolean)}))}Zt(e){return e.flatMap((n=>{var i,r;return(i=(r=n.stacktrace)==null?void 0:r.frames)!==null&&i!==void 0?i:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var n,i,r,a,o=(n=(i=e[0].stacktrace)==null?void 0:i.frames)!==null&&n!==void 0?n:[],s=o[o.length-1];return(r=s==null||(a=s.filename)==null?void 0:a.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Xt(e){return!Ee(e)&&Ae(e)}},Zn=st("[FeatureFlags]"),_c=st("[FeatureFlags]",{debugEnabled:!0}),Gv="$active_feature_flags",Cs="$override_feature_flags",$A="$feature_flag_payloads",Sc="$override_feature_flag_payloads",FA="$feature_flag_request_id",UA="$feature_flag_evaluated_at",VA=t=>{var e={};for(var[n,i]of Jf(t||{}))i&&(e[n]=i);return e},k3=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((n=>{var i;return[n,(i=e[n].variant)!==null&&i!==void 0?i:e[n].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((n=>e[n].enabled)).filter((n=>{var i;return(i=e[n].metadata)==null?void 0:i.payload})).map((n=>{var i;return[n,(i=e[n].metadata)==null?void 0:i.payload]})))):Zn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},R3=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),Uy=class{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((n=>{var i=n&&typeof n=="string"&&n.trim().length>0;return i||Zn.error("Invalid evaluation environment found:",n,"Expected non-empty string"),i})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.vi({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(py),n=this._instance.get_property(Cs),i=this._instance.get_property(Sc);if(!i&&!n)return e||{};var r=Ye({},e||{}),a=[...new Set([...Object.keys(i||{}),...Object.keys(n||{})])];for(var o of a){var s,l,c=r[o],u=n?.[o],f=I(u)?(s=c?.enabled)!==null&&s!==void 0&&s:!!u,h=I(u)?c.variant:typeof u=="string"?u:void 0,g=i?.[o],_=j({},c,{enabled:f,variant:f?h??c?.variant:void 0});f!==c?.enabled&&(_.original_enabled=c?.enabled),h!==c?.variant&&(_.original_variant=c?.variant),g&&(_.metadata=j({},c?.metadata,{payload:g,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),r[o]=_}return this.ii||(Zn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var e=this._instance.get_property(Rs),n=this._instance.get_property(Cs);if(!n)return e||{};for(var i=Ye({},e),r=Object.keys(n),a=0;a<r.length;a++)i[r[a]]=n[r[a]];return this.ii||(Zn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property($A),n=this._instance.get_property(Sc);if(!n)return e||{};for(var i=Ye({},e||{}),r=Object.keys(n),a=0;a<r.length;a++)i[r[a]]=n[r[a]];return this.ii||(Zn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:i}),this.ii=!0),i}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.vi()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}vi(e){var n;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:j({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(Tc)||{}),group_properties:this._instance.get_property(Ja)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ui()&&(i.evaluation_environments=this.li());var r=this._instance.config.__preview_remote_config,a=r?"/flags/?v=2":"/flags/?v=2&config=true",o=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("flags",a+o);r&&(i.timezone=GT()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:i,compression:this._instance.config.disable_compression?void 0:Xi.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,f=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),f=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((u=l.json)!==null&&u!==void 0?u:{})),!i.disable_flags||this.ni)if(this.ai=!f,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(R3.FeatureFlags))Zn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var h;i.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},f),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],r=""+i,a=this._instance.get_property(FA)||void 0,o=this._instance.get_property(UA)||void 0,s=this._instance.get_property(ap)||{};if((n.send_event||!("send_event"in n))&&(!(e in s)||!s[e].includes(r))){var l,c,u,f,h,g,_,b,w;Ae(s[e])?s[e].push(r):s[e]=[r],(l=this._instance.persistence)==null||l.register({[ap]:s});var d=this.getFeatureFlagDetails(e),p={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:o,$feature_flag_bootstrapped_response:((c=this._instance.config.bootstrap)==null||(c=c.featureFlags)==null?void 0:c[e])||null,$feature_flag_bootstrapped_payload:((u=this._instance.config.bootstrap)==null||(u=u.featureFlagPayloads)==null?void 0:u[e])||null,$used_bootstrap_value:!this.ai};I(d==null||(f=d.metadata)==null?void 0:f.version)||(p.$feature_flag_version=d.metadata.version);var m,v=(h=d==null||(g=d.reason)==null?void 0:g.description)!==null&&h!==void 0?h:d==null||(_=d.reason)==null?void 0:_.code;v&&(p.$feature_flag_reason=v),d!=null&&(b=d.metadata)!=null&&b.id&&(p.$feature_flag_id=d.metadata.id),I(d?.original_variant)&&I(d?.original_enabled)||(p.$feature_flag_original_response=I(d.original_variant)?d.original_enabled:d.original_variant),d!=null&&(w=d.metadata)!=null&&w.original_payload&&(p.$feature_flag_original_payload=d==null||(m=d.metadata)==null?void 0:m.original_payload),this._instance.capture("$feature_flag_called",p)}return i}Zn.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,n){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.ui()&&(r.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:Xi.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:a=>{var o,s=(o=a.json)==null?void 0:o.featureFlagPayloads;n(s?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,n);return I(i)?void 0:!!i}Zn.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==e))}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ei=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(o,s,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var f=k3(o),h=f.flags,g=f.featureFlags,_=f.featureFlagPayloads;if(g){var b=o.requestId,w=o.evaluatedAt;if(Ae(g)){Zn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(g)for(var p=0;p<g.length;p++)d[g[p]]=!0;s&&s.register({[Gv]:g,[Rs]:d})}else{var m=g,v=_,S=h;o.errorsWhileComputingFlags&&(m=j({},l,m),v=j({},c,v),S=j({},u,S)),s&&s.register(j({[Gv]:Object.keys(VA(m)),[Rs]:m||{},[$A]:v||{},[py]:S||{}},b?{[FA]:b}:{},w?{[UA]:w}:{}))}}})(e,this._instance.persistence,i,r,a),this.pi(n)}}override(e,n){n===void 0&&(n=!1),Zn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Zn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Cs),this._instance.persistence.unregister(Sc),this.pi(),_c.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,i=e;if(this.ii=!!((n=i.suppressWarning)!==null&&n!==void 0&&n),"flags"in i){if(i.flags===!1)this._instance.persistence.unregister(Cs),_c.info("Flag overrides cleared");else if(i.flags){if(Ae(i.flags)){for(var r={},a=0;a<i.flags.length;a++)r[i.flags[a]]=!0;this._instance.persistence.register({[Cs]:r})}else this._instance.persistence.register({[Cs]:i.flags});_c.info("Flag overrides set",{flags:i.flags})}}return"payloads"in i&&(i.payloads===!1?(this._instance.persistence.unregister(Sc),_c.info("Payload overrides cleared")):i.payloads&&(this._instance.persistence.register({[Sc]:i.payloads}),_c.info("Payload overrides set",{payloads:i.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:n,flagVariants:i}=this.gi();e(n,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,i){var r,a=(this._instance.get_property(Ac)||[]).find((c=>c.flagKey===e)),o={["$feature_enrollment/"+e]:n},s={$feature_flag:e,$feature_enrollment:n,$set:o};a&&(s.$early_access_feature_name=a.name),i&&(s.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(o,!1);var l=j({},this.getFlagVariants(),{[e]:n});(r=this._instance.persistence)==null||r.register({[Gv]:Object.keys(VA(l)),[Rs]:l}),this.pi()}getEarlyAccessFeatures(e,n,i){n===void 0&&(n=!1);var r=this._instance.get_property(Ac),a=i?"&"+i.map((o=>"stage="+o)).join("&"):"";if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+a),method:"GET",callback:o=>{var s,l;if(o.json){var c=o.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.unregister(Ac),(l=this._instance.persistence)==null||l.register({[Ac]:c}),e(c)}}})}gi(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter((i=>n[i])),flagVariants:Object.keys(n).filter((i=>n[i])).reduce(((i,r)=>(i[r]=n[r],i)),{})}}pi(e){var{flags:n,flagVariants:i}=this.gi();this.featureFlagEventHandlers.forEach((r=>r(n,i,{errorsLoading:e})))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(Tc)||{};this._instance.register({[Tc]:j({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Tc)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(Ja)||{};Object.keys(i).length!==0&&Object.keys(i).forEach((r=>{i[r]=j({},i[r],e[r]),delete e[r]})),this._instance.register({[Ja]:j({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(Ja)||{};this._instance.register({[Ja]:j({},n,{[e]:{}})})}else this._instance.unregister(Ja)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.di(),this.ii=!1}},O3=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Nc=class{constructor(e,n){this.F=e,this.props={},this.mi=!1,this.yi=(i=>{var r="";return i.token&&(r=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+r+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&$.info("Persistence loaded",e.persistence,j({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.wi}bi(e){O3.indexOf(e.persistence.toLowerCase())===-1&&($.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&Ue.H()?Ue:n==="localstorage+cookie"&&Yf.H()?Yf:n==="sessionstorage"&&St.H()?St:n==="memory"?QL:n==="cookie"?di:Yf.H()?Yf:di}properties(){var e={};return Re(this.props,(function(n,i){if(i===Rs&&ft(n))for(var r=Object.keys(n),a=0;a<r.length;a++)e["$feature/"+r[a]]=n[r[a]];else s=i,l=!1,(Qi(o=LL)?l:nA&&o.indexOf===nA?o.indexOf(s)!=-1:(Re(o,(function(c){if(l||(l=c===s))return ip})),l))||(e[i]=n);var o,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Ye({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,n,i){if(ft(e)){I(n)&&(n="None"),this.xi=I(i)?this.$i:i;var r=!1;if(Re(e,((a,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=a,r=!0)})),r)return this.save(),!0}return!1}register(e,n){if(ft(e)){this.xi=I(n)?this.$i:n;var i=!1;if(Re(e,((r,a)=>{e.hasOwnProperty(a)&&this.props[a]!==r&&(this.props[a]=r,i=!0)})),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=FT(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);ks(ab(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=B?.referrer)?VT(e):{})}update_referrer_info(){var e;this.register_once({$referrer:jT(),$referring_domain:B!=null&&B.referrer&&((e=up(B.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[vy]||this.props[yy]||this.register_once({[op]:qT(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Re([yy,vy],(o=>{var s=this.props[o];s&&Re(s,(function(l,c){e["$initial_"+Xv(c)]=l}))}));var n,i,r=this.props[op];if(r){var a=(n=PT(r),i={},Re(n,(function(o,s){i["$initial_"+Xv(s)]=o})),i);Ye(e,a)}return e}safe_merge(e){return Re(this.props,(function(n,i){i in e||(e[i]=n)})),e}update_config(e,n,i){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence){var r=this.bi(e),a=this.props;this.clear(),this.Y=r,this.props=a,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_secure(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_event_timer(e,n){var i=this.props[Cc]||{};i[e]=n,this.props[Cc]=i,this.save()}remove_event_timer(e){var n=(this.props[Cc]||{})[e];return I(n)||(delete this.props[Cc][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}},xc=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),NB=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),DB=(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({}),LB=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),Zv=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),HB=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),IB=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),zB=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),tp=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),jA=(function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t})({}),JT=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),$c=class{constructor(){this.ki={},this.ki={}}on(e,n){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(n),()=>{this.ki[e]=this.ki[e].filter((i=>i!==n))}}emit(e,n){for(var i of this.ki[e]||[])i(n);for(var r of this.ki["*"]||[])r(e,n)}};function As(t,e,n){if(Ee(t))return!1;switch(n){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var Vy=class{constructor(e){this.Pi=new $c,this.Ti=(n,i)=>this.Ri(n,i)&&this.Ii(n,i)&&this.Fi(n,i)&&this.Ci(n,i),this.Ri=(n,i)=>i==null||!i.event||n?.event===i?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!I((e=this._instance)==null?void 0:e.Ai)){var n;(n=this._instance)==null||n.Ai(((i,r)=>{this.on(i,r)}))}}register(e){var n,i;if(!I((n=this._instance)==null?void 0:n.Ai)&&(e.forEach((o=>{var s,l;(s=this.Oi)==null||s.add(o),(l=o.steps)==null||l.forEach((c=>{var u;(u=this.Mi)==null||u.add(c?.event||"")}))})),(i=this._instance)!=null&&i.autocapture)){var r,a=new Set;e.forEach((o=>{var s;(s=o.steps)==null||s.forEach((l=>{l!=null&&l.selector&&a.add(l?.selector)}))})),(r=this._instance)==null||r.autocapture.setElementSelectors(a)}}on(e,n){var i;n!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(n?.event))&&this.Oi&&((i=this.Oi)==null?void 0:i.size)>0&&this.Oi.forEach((r=>{this.Di(n,r)&&this.Pi.emit("actionCaptured",r.name)}))}ji(e){this.onAction("actionCaptured",(n=>e(n)))}Di(e,n){if(n?.steps==null)return!1;for(var i of n.steps)if(this.Ti(e,i))return!0;return!1}onAction(e,n){return this.Pi.on(e,n)}Ii(e,n){if(n!=null&&n.url){var i,r=e==null||(i=e.properties)==null?void 0:i.$current_url;if(!r||typeof r!="string"||!As(r,n.url,n.url_matching||"contains"))return!1}return!0}Fi(e,n){return!!this.Li(e,n)&&!!this.Ni(e,n)&&!!this.Ui(e,n)}Li(e,n){var i;if(n==null||!n.href)return!0;var r=this.zi(e);if(r.length>0)return r.some((s=>As(s.href,n.href,n.href_matching||"exact")));var a,o=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!o&&As((a=o.match(/(?::|")href="(.*?)"/))?a[1]:"",n.href,n.href_matching||"exact")}Ni(e,n){var i;if(n==null||!n.text)return!0;var r=this.zi(e);if(r.length>0)return r.some((c=>As(c.text,n.text,n.text_matching||"exact")||As(c.$el_text,n.text,n.text_matching||"exact")));var a,o,s,l=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!l&&(a=(function(c){for(var u,f=[],h=/(?::|")text="(.*?)"/g;!Ee(u=h.exec(c));)f.includes(u[1])||f.push(u[1]);return f})(l),o=n.text,s=n.text_matching||"exact",a.some((c=>As(c,o,s))))}Ui(e,n){var i,r;if(n==null||!n.selector)return!0;var a=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(a!=null&&a.includes(n.selector))return!0;var o=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}zi(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}Ci(e,n){return n==null||!n.properties||n.properties.length===0||QT(n.properties.reduce(((i,r)=>{var a=Ae(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return i[r.key]={values:a,operator:r.operator||"exact"},i}),{}),e?.properties)}},Se=st("[Surveys]"),jy="seenSurvey_",M3=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},qA=t=>{var e=""+jy+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+jy+t.id+"_"+t.current_iteration),e},N3=[Zv.Popover,Zv.Widget,Zv.API],D3={ignoreConditions:!1,ignoreDelay:!1,displayType:JT.Popover},qy=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,n){return!!e&&QT(e.propertyFilters,n?.properties)}Gi(e,n){var i=new Map;return e.forEach((r=>{var a;(a=r.conditions)==null||(a=a[n])==null||(a=a.values)==null||a.forEach((o=>{if(o!=null&&o.name){var s=i.get(o.name)||[];s.push(r.id),i.set(o.name,s)}}))})),i}Vi(e,n,i){var r,a=(i===xc.Activation?this.Hi:this.Bi).get(e),o=[];return(r=this._instance)==null||r.getSurveys((s=>{o=s.filter((l=>a?.includes(l.id)))})),o.filter((s=>{var l,c=(l=s.conditions)==null||(l=l[i])==null||(l=l.values)==null?void 0:l.find((u=>u.name===e));return this.Wi(c,n)}))}register(e){var n;I((n=this._instance)==null?void 0:n.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var n=e.filter((i=>{var r,a;return((r=i.conditions)==null?void 0:r.actions)&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0}));n.length!==0&&(this.Yi==null&&(this.Yi=new Vy(this._instance),this.Yi.init(),this.Yi.ji((i=>{this.onAction(i)}))),n.forEach((i=>{var r,a,o,s,l;i.conditions&&(r=i.conditions)!=null&&r.actions&&(a=i.conditions)!=null&&(a=a.actions)!=null&&a.values&&((o=i.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((s=this.Yi)==null||s.register(i.conditions.actions.values),(l=i.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((c=>{if(c&&c.name){var u=this.qi.get(c.name);u&&u.push(i.id),this.qi.set(c.name,u||[i.id])}})))})))}Ji(e){var n,i=e.filter((a=>{var o,s;return((o=a.conditions)==null?void 0:o.events)&&((s=a.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0})),r=e.filter((a=>{var o,s;return((o=a.conditions)==null?void 0:o.cancelEvents)&&((s=a.conditions)==null||(s=s.cancelEvents)==null||(s=s.values)==null?void 0:s.length)>0}));(i.length!==0||r.length!==0)&&((n=this._instance)==null||n.Ai(((a,o)=>{this.onEvent(a,o)})),this.Hi=this.Gi(e,xc.Activation),this.Bi=this.Gi(e,xc.Cancellation))}onEvent(e,n){var i,r=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[Zf])||[];if(tp.SHOWN===e&&n&&r.length>0){var a;Se.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:r});var o=n==null||(a=n.properties)==null?void 0:a.$survey_id;if(o){var s=r.indexOf(o);s>=0&&(r.splice(s,1),this.Xi(r))}}else{if(this.Bi.has(e)){var l=this.Vi(e,n,xc.Cancellation);l.length>0&&(Se.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((u=>u.id))}),l.forEach((u=>{var f,h=r.indexOf(u.id);h>=0&&r.splice(h,1),(f=this._instance)==null||f.cancelPendingSurvey(u.id)})),this.Xi(r))}if(this.Hi.has(e)){Se.info("survey event name matched",{event:e,eventPayload:n,surveys:this.Hi.get(e)});var c=this.Vi(e,n,xc.Activation);this.Xi(r.concat(c.map((u=>u.id))||[]))}}}onAction(e){var n,i=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[Zf])||[];this.qi.has(e)&&this.Xi(i.concat(this.qi.get(e)||[]))}Xi(e){var n;Se.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[Zf]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[Zf];return n||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},Py=class{constructor(e){this.Zi=void 0,this._surveyManager=null,this.te=!1,this.ie=!1,this.ee=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(Ee(n))return Se.warn("Flags not loaded yet. Not loading surveys.");var i=Ae(n);this.Zi=i?n.length>0:n,Se.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var i=localStorage.key(n);(i!=null&&i.startsWith(jy)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)Se.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Se.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Se.info("Not loading surveys in cookieless mode without consent.");else{var e=J?.__PosthogExtensions__;if(e){if(!I(this.Zi)||this._instance.config.advanced_enable_surveys){var n=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var i=e.generateSurveys;if(i)return void this.re(i,n);var r=e.loadExternalDependency;if(!r)return void this.se("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(a=>{a||!e.generateSurveys?this.se("Could not load surveys script",a):this.re(e.generateSurveys,n)}))}catch(a){throw this.se("Error initializing surveys",a),a}finally{this.ie=!1}}}else Se.error("PostHog Extensions not found.")}}re(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new qy(this._instance),Se.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,n){Se.error(e,n),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((n=>n!==e))}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return Se.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(hy);if(i&&!n)return e(i,{isLoaded:!0});if(this.te)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var a;this.te=!1;var o=r.statusCode;if(o!==200||!r.json){var s="Surveys API could not be loaded, status: "+o;return Se.error(s),e([],{isLoaded:!1,error:s})}var l,c=r.json.surveys||[],u=c.filter((f=>(function(h){return!(!h.start_date||h.end_date)})(f)&&((function(h){var g;return!((g=h.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)})(f)||(function(h){var g;return!((g=h.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)})(f))));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(a=this._instance.persistence)==null||a.register({[hy]:c}),e(c,{isLoaded:!0})}})}catch(r){throw this.te=!1,r}}ne(e){for(var n of this.ee)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(i){Se.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!Ee(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);Se.warn("init was not called")}oe(e){var n=null;return this.getSurveys((i=>{var r;n=(r=i.find((a=>a.id===e)))!==null&&r!==void 0?r:null})),n}ae(e){if(Ee(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.oe(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Ee(this._surveyManager))return Se.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.ae(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return Ee(this._surveyManager)?(Se.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((i=>{this.getSurveys((r=>{var a,o=(a=r.find((l=>l.id===e)))!==null&&a!==void 0?a:null;if(o){var s=this.ae(o);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n){var i;if(Ee(this._surveyManager))Se.warn("init was not called");else{var r=typeof e=="string"?this.oe(e):e;if(r!=null&&r.id)if(N3.includes(r.type)){var a=B?.querySelector(n);if(a)return(i=r.appearance)!=null&&i.surveyPopupDelaySeconds?(Se.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var o,s;Se.info("Rendering survey "+r.id+" with delay of "+((o=r.appearance)==null?void 0:o.surveyPopupDelaySeconds)+" seconds"),(s=this._surveyManager)==null||s.renderSurvey(r,a),Se.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,a);Se.warn("Survey element not found")}else Se.warn("Surveys of type "+r.type+" cannot be rendered in the app");else Se.warn("Survey not found")}}displaySurvey(e,n){var i;if(Ee(this._surveyManager))Se.warn("init was not called");else{var r=this.oe(e);if(r){var a=r;if((i=r.appearance)!=null&&i.surveyPopupDelaySeconds&&n.ignoreDelay&&(a=j({},r,{appearance:j({},r.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var o=this.canRenderSurvey(r);if(!o.visible)return void Se.warn("Survey is not eligible to be displayed: ",o.disabledReason)}n.displayType!==JT.Inline?this._surveyManager.handlePopoverSurvey(a):this.renderSurvey(a,n.selector)}else Se.warn("Survey not found")}}cancelPendingSurvey(e){Ee(this._surveyManager)?Se.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},PA=st("[RateLimiter]"),Gy=class{constructor(e){var n,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var a=r.text;if(a&&a.length)try{(JSON.parse(a).quota_limited||[]).forEach((o=>{PA.info((o||"events")+" is quota limited."),this.serverLimits[o]=new Date().getTime()+6e4}))}catch(o){return void PA.warn('could not rate limit - continuing. Error: "'+o?.message+'"',{text:a})}},this.instance=e,this.captureEventsPerSecond=((n=e.config.rate_limiting)==null?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)==null?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var n,i,r;e===void 0&&(e=!1);var a=new Date().getTime(),o=(n=(i=this.instance.persistence)==null?void 0:i.get_property(my))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:a};o.tokens+=(a-o.last)/1e3*this.captureEventsPerSecond,o.last=a,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||e||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,(r=this.instance.persistence)==null||r.set_property(my,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}},Qa=st("[RemoteConfig]"),Zy=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=J._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var n,i;(n=J.__PosthogExtensions__)!=null&&n.loadExternalDependency?(i=J.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(Qa.error("PostHog Extensions not found. Cannot load remote config."),e())}ue(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return Qa.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void Qa.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return Qa.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((n=>{this.fi(n)}));this.fi(e)}))}catch(e){Qa.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):Qa.info("__preview_remote_config is disabled. Logging config instead",e):Qa.error("Failed to fetch remote config from PostHog.")}},Yy=3e3,Wy=class{constructor(e,n){this.he=!0,this.ve=[],this.de=ci(n?.flush_interval_ms||Yy,250,5e3,$.createLogger("flush interval"),Yy),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},n=Object.values(e);[...n.filter((i=>i.url.indexOf("/e")===0)),...n.filter((i=>i.url.indexOf("/e")!==0))].map((i=>{this.ce(j({},i,{transport:"sendBeacon"}))}))}enable(){this.he=!1,this.pe()}pe(){var e=this;this.he||(this.fe=setTimeout((()=>{if(this.ge(),this.ve.length>0){var n=this._e(),i=function(){var a=n[r],o=new Date().getTime();a.data&&Ae(a.data)&&Re(a.data,(s=>{s.offset=Math.abs(s.timestamp-o),delete s.timestamp})),e.ce(a)};for(var r in n)i()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return Re(this.ve,(n=>{var i,r=n,a=(r?r.batchKey:null)||r.url;I(e[a])&&(e[a]=j({},r,{data:[]})),(i=e[a].data)==null||i.push(r.data)})),this.ve=[],e}},L3=["retriesPerformedSoFar"],Ky=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!I(R)&&"onLine"in R.navigator&&(this.be=R.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},tt(R,"online",this.we),tt(R,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,i=XA(e,L3);fi(n)&&n>0&&(i.url=vp(i.url,{retry_count:n})),this._instance.ci(j({},i,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(n??0)<10?this.Se(j({retriesPerformedSoFar:n},i)):i.callback==null||i.callback(r)}}))}Se(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var i=(function(o){var s=3e3*Math.pow(2,o),l=s/2,c=Math.min(18e5,s),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(n),r=Date.now()+i;this.ve.push({retryAt:r,requestOptions:e});var a="Enqueued failed request for retry in "+i;navigator.onLine||(a+=" (Browser is offline)"),$.warn(a),this.me||(this.me=!0,this.Ee())}Ee(){if(this.$e&&clearTimeout(this.$e),this.ve.length===0)return this.me=!1,void(this.$e=void 0);this.$e=setTimeout((()=>{this.be&&this.ve.length>0&&this.Dt(),this.Ee()}),this.ye)}Dt(){var e=Date.now(),n=[],i=this.ve.filter((a=>a.retryAt<e||(n.push(a),!1)));if(this.ve=n,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,I(R)||(this.we&&(R.removeEventListener("online",this.we),this.we=void 0),this.xe&&(R.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(j({},e,{transport:"sendBeacon"}))}catch(n){$.error(n)}this.ve=[]}},Xy=class{constructor(e){this.ke=()=>{var n,i,r,a;this.Pe||(this.Pe={});var o=this.scrollElement(),s=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,c=s+(o?.clientHeight||0),u=o?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(s),this.Pe.maxScrollY=Math.max(s,(n=this.Pe.maxScrollY)!==null&&n!==void 0?n:0),this.Pe.maxScrollHeight=Math.max(l,(i=this.Pe.maxScrollHeight)!==null&&i!==void 0?i:0),this.Pe.lastContentY=c,this.Pe.maxContentY=Math.max(c,(r=this.Pe.maxContentY)!==null&&r!==void 0?r:0),this.Pe.maxContentHeight=Math.max(u,(a=this.Pe.maxContentHeight)!==null&&a!==void 0?a:0)},this._instance=e}getContext(){return this.Pe}resetContext(){var e=this.Pe;return setTimeout(this.ke,0),e}startMeasuringScrollPosition(){tt(R,"scroll",this.ke,{capture:!0}),tt(R,"scrollend",this.ke,{capture:!0}),tt(R,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return R?.document.documentElement;var e=Ae(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var i=R?.document.querySelector(n);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return R&&(R.scrollY||R.pageYOffset||R.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return R&&(R.scrollX||R.pageXOffset||R.document.documentElement.scrollLeft)||0}},H3=t=>qT(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),bp=class{constructor(e,n,i,r){this.Te=a=>{var o=this.Re();if(!o||o.sessionId!==a){var s={sessionId:a,props:this.Ie(this._instance)};this.Fe.register({[gy]:s})}},this._instance=e,this.Ce=n,this.Fe=i,this.Ie=r||H3,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[gy]}getSetOnceProps(){var e,n=(e=this.Re())==null?void 0:e.props;return n?"r"in n?PT(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return Re(ab(this.getSetOnceProps()),((n,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+Xv(i)]=n})),e}},Yv=st("[SessionId]"),_p=class{on(e,n){return this.Me.on(e,n)}constructor(e,n,i){var r;if(this.Oe=[],this.Ae=void 0,this.Me=new $c,this.De=(u,f)=>Math.abs(u-f)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.F=e.config,this.Fe=e.persistence,this.je=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ne=n||Xr,this.Ue=i||Xr;var a=this.F.persistence_name||this.F.token,o=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*ci(o,60,36e3,Yv.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+a+"_window_id",this.Be="ph_"+a+"_primary_window_exists",this.qe()){var s=St.W(this.He),l=St.W(this.Be);s&&!l?this.je=s:St.V(this.He),St.G(this.Be,!0)}if((r=this.F.bootstrap)!=null&&r.sessionID)try{var c=(u=>{var f=u.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),c)}catch(u){Yv.error("Invalid sessionID in bootstrap",u)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return I(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((n=>n!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&St.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&St.G(this.He,e))}Je(){return this.je?this.je:this.qe()?St.W(this.He):null}We(e,n,i){e===this.Le&&n===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=n,this.Le=e,this.Fe.register({[rp]:[n,e,i]}))}Ke(){var e=this.Fe.props[rp];return Ae(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.We(null,null,null)}destroy(){clearTimeout(this.Ye),this.Ye=void 0,this.Ae&&R&&(R.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&St.V(this.Be)},tt(R,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=n||new Date().getTime(),[r,a,o]=this.Ke(),s=this.Je(),l=fi(o)&&o>0&&Math.abs(i-o)>864e5,c=!1,u=!a,f=!u&&!e&&this.De(i,r);u||f||l?(a=this.Ne(),s=this.Ue(),Yv.info("new session ID generated",{sessionId:a,windowId:s,changeReason:{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}}),o=i,c=!0):s||(s=this.Ue(),c=!0);var h=r===0||!e||l?i:r,g=o===0?new Date().getTime():o;return this.Ve(s),this.We(a,h,g),e||this.ze(),c&&this.Oe.forEach((_=>_(a,s,c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0))),{sessionId:a,windowId:s,sessionStartTimestamp:g,changeReason:c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var n=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}},I3=["$set_once","$set"],Wr=st("[SiteApps]"),Qy=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,n){if(n){var i=this.globalsForEvent(n);this.Xe.push(i),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=J._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ai(this.Qe.bind(this));this.Ze=()=>{e(),this.Xe=[],this.Ze=void 0}}}globalsForEvent(e){var n,i,r,a,o,s,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(var[h,g]of Object.entries(f))c[h]={id:u[h],type:h,properties:g};var{$set_once:_,$set:b}=e;return{event:j({},XA(e,I3),{properties:j({},e.properties,b?{$set:j({},(n=(i=e.properties)==null?void 0:i.$set)!==null&&n!==void 0?n:{},b)}:{},_?{$set_once:j({},(r=(a=e.properties)==null?void 0:a.$set_once)!==null&&r!==void 0?r:{},_)}:{}),elements_chain:(o=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&o!==void 0?o:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var n=this.apps[e.id],i=()=>{var s;!n.errored&&this.Xe.length&&(Wr.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>n.processEvent==null?void 0:n.processEvent(l))),n.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((s=this.Ze)==null||s.call(this))},r=!1,a=s=>{n.errored=!s,n.loaded=!0,Wr.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:o}=e.init({posthog:this._instance,callback:s=>{a(s)}});o&&(n.processEvent=o),r=!0}catch(s){Wr.error("Error while initializing PostHog app with config id "+e.id,s),a(!1)}if(r&&n.loaded)try{i()}catch(s){Wr.error("Error while processing buffered events PostHog app with config id "+e.id,s),n.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var n of e)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}ir(e){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{i.processEvent==null||i.processEvent(n)}catch(r){Wr.error("Error while processing event "+e.event+" for site app "+i.id,r)}}}onRemoteConfig(e){var n,i,r,a=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(c=>this.ir(c)))):void Wr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.Ze)==null||i.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var o=function(c){var u;J["__$$ph_site_app_"+c]=a._instance,(u=J.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(a._instance,l,(f=>{if(f)return Wr.error("Error while initializing PostHog app with config id "+c,f)}))};for(var{id:s,url:l}of e.siteApps)o(s)}else Wr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},ek=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&oA(n,e))return!0;try{var i=t?.userAgentData;if(i!=null&&i.brands&&i.brands.some((r=>oA(r?.brand,e))))return!0}catch{}return!!t.webdriver},Oc=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),GA="i.posthog.com",Jy=class{constructor(e){this.er={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+GA,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Oc.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Oc.EU:this.er[this.apiHost]=Oc.CUSTOM),this.er[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Oc.CUSTOM)return this.apiHost+n;var i=GA+n;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}},z3={icontains:(t,e)=>!!R&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!R&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!R&&yp(e.href,t),not_regex:(t,e)=>!!R&&!yp(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},eb=class t{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),n.getWebExperiments((r=>{t.rr("retrieved web experiments from the server"),n.sr=new Map,r.forEach((a=>{if(a.feature_flag_key){var o;n.sr&&(t.rr("setting flag key ",a.feature_flag_key," to web experiment ",a),(o=n.sr)==null||o.set(a.feature_flag_key,a));var s=n._instance.getFeatureFlag(a.feature_flag_key);ot(s)&&a.variants[s]&&n.nr(a.name,s,a.variants[s].transforms)}else if(a.variants)for(var l in a.variants){var c=a.variants[l];t.ar(c)&&n.nr(a.name,l,c.transforms)}}))}),i)},this._instance=e,this._instance.onFeatureFlags((i=>{this.onFeatureFlags(i)}))}onFeatureFlags(e){if(this._is_bot())t.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Ee(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((n=>{var i;if(this.sr&&(i=this.sr)!=null&&i.has(n)){var r,a=this._instance.getFeatureFlag(n),o=(r=this.sr)==null?void 0:r.get(n);a&&o!=null&&o.variants[a]&&this.nr(o.name,a,o.variants[a].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=dp(e?.search,"__experiment_id"),i=dp(e?.search,"__experiment_variant");n&&i&&(t.rr("previewing web experiments "+n+" && "+i),this.getWebExperiments((r=>{this.lr(parseInt(n),i,r)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:a=>{if(a.statusCode!==200||!a.json)return e([]);var o=a.json.experiments||[];return e(o)}})}lr(e,n,i){var r=i.filter((a=>a.id===e));r&&r.length>0&&(t.rr("Previewing web experiment ["+r[0].name+"] with variant ["+n+"]"),this.nr(r[0].name,n,r[0].variants[n].transforms))}static ar(e){return!Ee(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var n;if(Ee(e.conditions)||Ee((n=e.conditions)==null?void 0:n.url))return!0;var i,r,a,o=t.getWindowLocation();return!!o&&((i=e.conditions)==null||!i.url||z3[(r=(a=e.conditions)==null?void 0:a.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,o))}static getWindowLocation(){return R?.location}static hr(e){var n;if(Ee(e.conditions)||Ee((n=e.conditions)==null?void 0:n.utm))return!0;var i=FT();if(i.utm_source){var r,a,o,s,l,c,u,f,h=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_campaign)==i.utm_campaign,g=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==i.utm_source,_=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==i.utm_medium,b=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((f=e.conditions)==null||(f=f.utm)==null?void 0:f.utm_term)==i.utm_term;return h&&_&&b&&g}return!1}static rr(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];$.info("[WebExperiments] "+e,i)}nr(e,n,i){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?i.forEach((r=>{if(r.selector){var a;t.rr("applying transform of variant "+n+" for experiment "+e+" ",r);var o=(a=document)==null?void 0:a.querySelectorAll(r.selector);o?.forEach((s=>{var l=s;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return dn&&this._instance?ek(dn,this._instance.config.custom_blocked_useragents):void 0}},B3=st("[PostHog ExternalIntegrations]"),$3={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},tb=class{constructor(e){this._instance=e}it(e,n){var i;(i=J.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,(r=>{if(r)return B3.error("failed to load script",r);n()}))}startIfEnabledOrStop(){var e=this,n=function(o){var s,l,c;!r||(s=J.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[o]||e.it($3[o],(()=>{var u;(u=J.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[o])==null||u.start(e._instance)})),!r&&(l=J.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[o]&&((c=J.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[o])==null||c.stop())};for(var[i,r]of Object.entries((a=this._instance.config.integrations)!==null&&a!==void 0?a:{})){var a;n(i)}}},nb="[SessionRecording]",wc=st(nb),Sp=class{get started(){var e;return!((e=this.vr)==null||!e.isStarted)}get status(){return this.vr?this.vr.status:this.dr&&!this.cr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.dr=!1,this.pr=void 0,this._instance=e,!this._instance.sessionManager)throw wc.error("started without valid sessionManager"),new Error(nb+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(nb+' cannot be used with cookieless_mode="always"')}get cr(){var e,n=!((e=this._instance.get_property(Iv))==null||!e.enabled),i=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return R&&n&&i&&!r}startIfEnabledOrStop(e){var n;if(!this.cr||(n=this.vr)==null||!n.isStarted){var i=!I(Object.assign)&&!I(Array.from);this.cr&&i?(this.gr(e),wc.info("starting")):this.stopRecording()}}gr(e){var n,i,r;this.cr&&(J!=null&&(n=J.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(i=J.__PosthogExtensions__)!=null&&i.initSessionRecording?this._r(e):(r=J.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.mr,(a=>{if(a)return wc.error("could not load recorder",a);this._r(e)})))}stopRecording(){var e,n;(e=this.pr)==null||e.call(this),this.pr=void 0,(n=this.vr)==null||n.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(sT)}br(e){if(this._instance.persistence){var n,i,r=this._instance.persistence,a=()=>{var o=e.sessionRecording===!1?void 0:e.sessionRecording,s=o?.sampleRate,l=Ee(s)?null:parseFloat(s);Ee(l)&&this.yr();var c=o?.minimumDurationMilliseconds;r.register({[Iv]:j({enabled:!!o},o,{networkPayloadCapture:j({capturePerformance:e.capturePerformance},o?.networkPayloadCapture),canvasRecording:{enabled:o?.recordCanvas,fps:o?.canvasFps,quality:o?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:I(c)?null:c,endpoint:o?.endpoint,triggerMatchType:o?.triggerMatchType,masking:o?.masking,urlTriggers:o?.urlTriggers})})};a(),(n=this.pr)==null||n.call(this),this.pr=(i=this._instance.sessionManager)==null?void 0:i.onSessionId(a)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:wc.info("skipping remote config with no sessionRecording",e)}log(e,n){var i;n===void 0&&(n="log"),(i=this.vr)!=null&&i.log?this.vr.log(e,n):wc.warn("log called before recorder was ready")}get mr(){var e,n,i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Iv);return(i==null||(n=i.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}_r(e){var n,i;if((n=J.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(i=J.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var n;(n=this.vr)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var n,i;this.vr||(i=this._instance.persistence)==null||i.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(n=this.vr)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var i;return!((i=this.vr)==null||!i.tryAddCustomEvent(e,n))}},Dc={},ib=()=>{},Ts="posthog",tk=!T3&&Zt?.indexOf("MSIE")===-1&&Zt?.indexOf("Mozilla")===-1,ZA=t=>{var e;return j({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:DL(B?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:ib,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:Yt&&ot(Yt?.search)&&Yt.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(R==null||(e=R.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var i="Bad HTTP status: "+n.statusCode+" "+n.text;$.error(i)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Yy},error_tracking:{},_onCapture:ib,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},YA=t=>{var e={};I(t.process_person)||(e.person_profiles=t.process_person),I(t.xhr_headers)||(e.request_headers=t.xhr_headers),I(t.cookie_name)||(e.persistence_name=t.cookie_name),I(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),I(t.store_google)||(e.save_campaign_params=t.store_google),I(t.verbose)||(e.debug=t.verbose);var n=Ye({},e,t);return Ae(t.property_blacklist)&&(I(t.property_denylist)?n.property_denylist=t.property_blacklist:Ae(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:$.error("Invalid value for property_denylist config: "+t.property_denylist)),n},rb=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){$.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},xp=class t{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new rb,this.Sr=!1,this.version=Yi.LIB_VERSION,this.Er=new $c,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ZA(),this.SentryIntegration=Ty,this.sentryIntegration=e=>(function(n,i){var r=wT(n,i);return{name:xT,processEvent:a=>r(a)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.$r=!1,this.kr=null,this.Pr=null,this.Tr=null,this.featureFlags=new Uy(this),this.toolbar=new ky(this),this.scrollManager=new Xy(this),this.pageViewManager=new Hy(this),this.surveys=new Py(this),this.experiments=new eb(this),this.exceptions=new Fy(this),this.rateLimiter=new Gy(this),this.requestRouter=new Jy(this),this.consent=new Ey(this),this.externalIntegrations=new tb(this),this.people={set:(e,n,i)=>{var r=ot(e)?{[e]:n}:e;this.setPersonProperties(r),i?.({})},set_once:(e,n,i)=>{var r=ot(e)?{[e]:n}:e;this.setPersonProperties(void 0,r),i?.({})}},this.on("eventCaptured",(e=>$.info('send "'+e?.event+'"',e)))}init(e,n,i){if(i&&i!==Ts){var r,a=(r=Dc[i])!==null&&r!==void 0?r:new t;return a._init(e,n,i),Dc[i]=a,Dc[Ts][i]=a,a}return this._init(e,n,i)}_init(e,n,i){var r;if(n===void 0&&(n={}),I(e)||Qv(e))return $.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Rr(n.debug),this.Ir=n,this.Fr=[],n.person_profiles&&(this.Pr=n.person_profiles),this.set_config(Ye({},ZA(n.defaults),YA(n),{name:i,token:e})),this.config.on_xhr_error&&$.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Xi.GZipJS;var a=this.Cr();this.persistence=new Nc(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Nc(j({},this.config,{persistence:"sessionStorage"}),a);var o=j({},this.persistence.props),s=j({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new Wy((p=>this.Or(p)),this.config.request_queue_config),this.Ar=new Ky(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new _p(this),this.sessionPropsManager=new bp(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?($.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):($.info("Initializing extensions synchronously"),this.Dr(l)),Yi.DEBUG=Yi.DEBUG||this.config.debug,Yi.DEBUG&&$.info("Starting in debug mode",{this:this,config:n,thisC:j({},this.config),p:o,s}),((r=n.bootstrap)==null?void 0:r.distinctID)!==void 0){var c,u,f=this.config.get_device_id(Xr()),h=(c=n.bootstrap)!=null&&c.isIdentifiedID?f:n.bootstrap.distinctID;this.persistence.set_property(Wi,(u=n.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:h})}if(this.jr()){var g,_,b=Object.keys(((g=n.bootstrap)==null?void 0:g.featureFlags)||{}).filter((p=>{var m;return!((m=n.bootstrap)==null||(m=m.featureFlags)==null||!m[p])})).reduce(((p,m)=>{var v;return p[m]=((v=n.bootstrap)==null||(v=v.featureFlags)==null?void 0:v[m])||!1,p}),{}),w=Object.keys(((_=n.bootstrap)==null?void 0:_.featureFlagPayloads)||{}).filter((p=>b[p])).reduce(((p,m)=>{var v,S;return(v=n.bootstrap)!=null&&(v=v.featureFlagPayloads)!=null&&v[m]&&(p[m]=(S=n.bootstrap)==null||(S=S.featureFlagPayloads)==null?void 0:S[m]),p}),{});this.featureFlags.receivedFeatureFlags({featureFlags:b,featureFlagPayloads:w})}if(l)this.register_once({distinct_id:gc,$device_id:null},"");else if(!this.get_distinct_id()){var d=this.config.get_device_id(Xr());this.register_once({distinct_id:d,$device_id:d},""),this.persistence.set_property(Wi,"anonymous")}return tt(R,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?t3(this,(()=>this.Lr())):this.Lr(),Qr(this.config._onCapture)&&this.config._onCapture!==ib&&($.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(p=>this.config._onCapture(p.event,p)))),this.config.ip&&$.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Dr(e){var n=performance.now();this.historyAutocapture=new Ay(this),this.historyAutocapture.startIfEnabled();var i=[];i.push((()=>{new Ry(this).startIfEnabledOrStop()})),i.push((()=>{var r;this.siteApps=new Qy(this),(r=this.siteApps)==null||r.init()})),e||i.push((()=>{this.sessionRecording=new Sp(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),i.push((()=>{this.autocapture=new _y(this),this.autocapture.startIfEnabled()})),i.push((()=>{this.surveys.loadIfEnabled()})),i.push((()=>{this.heatmaps=new Ly(this),this.heatmaps.startIfEnabled()})),i.push((()=>{this.webVitalsAutocapture=new Dy(this)})),i.push((()=>{this.exceptionObserver=new Cy(this),this.exceptionObserver.startIfEnabled()})),i.push((()=>{this.deadClicksAutocapture=new pp(this,e3),this.deadClicksAutocapture.startIfEnabled()})),i.push((()=>{if(this.Nr){var r=this.Nr;this.Nr=void 0,this.fi(r)}})),this.Ur(i,n)}Ur(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,n)}),0);var i=e.shift();if(i)try{i()}catch(a){$.error("Error initializing extension:",a)}}var r=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&$.info("PostHog extensions initialized ("+r+"ms)")}fi(e){var n,i,r,a,o,s,l,c;if(!B||!B.body)return $.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Nr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=ue(e.supportedCompression,Xi.GZipJS)?Xi.GZipJS:ue(e.supportedCompression,Xi.Base64)?Xi.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(i=this.siteApps)==null||i.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(a=this.autocapture)==null||a.onRemoteConfig(e),(o=this.heatmaps)==null||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){$.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new Zy(this).load(),this.featureFlags.flags()}zr(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Mr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&ea(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,n;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(n=this.Ar)==null||n.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(tk?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=vp(e.url,{ip:this.config.ip?1:0}),e.headers=j({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var i,r,a,o=j({},n);o.timeout=o.timeout||6e4,o.url=vp(o.url,{_:new Date().getTime().toString(),ver:Yi.LIB_VERSION,compression:o.compression});var s=(i=o.transport)!==null&&i!==void 0?i:"fetch",l=ep.filter((u=>!o.disableTransport||!u.transport||!o.disableTransport.includes(u.transport))),c=(r=(a=rT(l,(u=>u.transport===s)))==null?void 0:a.method)!==null&&r!==void 0?r:l[0].method;if(!c)throw new Error("No available transport method");c(o)})(j({},e,{callback:n=>{var i,r;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((i=(r=this.config).on_request_error)==null||i.call(r,n)),e.callback==null||e.callback(n)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var n,i=[],r=[],a=[];ea(e,(s=>{s&&(n=s[0],Ae(n)?a.push(s):Qr(s)?s.call(this):Ae(s)&&n==="alias"?i.push(s):Ae(s)&&n.indexOf("capture")!==-1&&Qr(this[n])?a.push(s):r.push(s))}));var o=function(s,l){ea(s,(function(c){if(Ae(c[0])){var u=l;Re(c,(function(f){u=u[f[0]].apply(u,f.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};o(i,this),o(r,this),o(a,this)}jr(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!I(e)&&ot(e)){var a=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(a&&!this.config.__preview_capture_bot_pageviews)){var o=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){n!=null&&n.$current_url&&!ot(n?.$current_url)&&($.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,l=i?.timestamp||s,c=Xr(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,n||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&a&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),o&&(u.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),i?.$set&&(u.$set=i?.$set);var f,h=this.qr(i?.$set_once);if(h&&(u.$set_once=h),(u=ML(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,I(i?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=s),e===tp.DISMISSED||e===tp.SENT){var g=n?.[jA.SURVEY_ID],_=n?.[jA.SURVEY_ITERATION];f={id:g,current_iteration:_},localStorage.getItem(qA(f))||localStorage.setItem(qA(f),"true"),u.$set=j({},u.$set,{[M3({id:g,current_iteration:_},e===tp.SENT?"responded":"dismissed")]:!0})}var b=j({},u.properties.$set,u.$set);if(ks(b)||this.setPersonPropertiesForFlags(b),!Ee(this.config.before_send)){var w=this.Wr(u);if(!w)return;u=w}this.Er.emit("eventCaptured",u);var d={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.Or(d):this.Mr.enqueue(d),u}$.critical("This capture call is ignored due to client rate limiting.")}}else $.error("No event name provided to posthog.capture")}else $.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,i,r,a){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return n;var o=a?void 0:this.persistence.remove_event_timer(e),s=j({},n);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(s.$cookieless_mode=!0),e==="$snapshot"){var l=j({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!ot(s.distinct_id)&&!fi(s.distinct_id)||Qv(s.distinct_id))&&$.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var c,u=v3(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(a,i.getTime());s.$session_id=f,s.$window_id=h}this.sessionPropsManager&&Ye(s,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Ye(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(g=this.Ar)==null?void 0:g.length}catch(d){s.$sdk_debug_error_capturing_properties=String(d)}if(this.requestRouter.region===Oc.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||a?e!=="$pageleave"||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),s=Ye(s,c),e==="$pageview"&&B&&(s.title=B.title),!I(o)){var _=i.getTime()-o;s.$duration=parseFloat((_/1e3).toFixed(3))}Zt&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Ye({},u,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Ae(this.config.property_denylist)?Re(this.config.property_denylist,(function(d){delete s[d]})):$.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&($.error("sanitize_properties is deprecated. Use before_send instead"),s=b(s,e));var w=this.Gr();return s.$process_person_profile=w,w&&!a&&this.Vr("_calculate_event_properties"),s}qr(e){var n;if(!this.persistence||!this.Gr()||this.Sr)return e;var i=this.persistence.get_initial_props(),r=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),a=Ye({},i,r||{},e||{}),o=this.config.sanitize_properties;return o&&($.error("sanitize_properties is deprecated. Use before_send instead"),a=o(a,"$set_once")),this.Sr=!0,ks(a)?void 0:a}register(e,n){var i;(i=this.persistence)==null||i.register(e,n)}register_once(e,n,i){var r;(r=this.persistence)==null||r.register_once(e,n,i)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}Jr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,n,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,i)}getEarlyAccessFeatures(e,n,i){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,i)}on(e,n){return this.Er.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,i;return(n=(i=this.sessionManager)==null?void 0:i.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=D3),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,i){if(!this.__loaded||!this.persistence)return $.uninitializedWarning("posthog.identify");if(fi(e)&&(e=e.toString(),$.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))$.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==gc){if(this.Vr("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var a=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:a},"")}e!==r&&e!==this.get_property(Ec)&&(this.unregister(Ec),this.register({distinct_id:e}));var o=(this.persistence.get_property(Wi)||"anonymous")==="anonymous";e!==r&&o?(this.persistence.set_property(Wi,"identified"),this.setPersonPropertiesForFlags(j({},i||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:n||{},$set_once:i||{}}),this.Tr=BA(e,n,i),this.featureFlags.setAnonymousDistinctId(r)):(n||i)&&this.setPersonProperties(n,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(ap))}}else $.critical('The string "'+gc+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else $.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Vr("posthog.setPersonProperties")){var i=BA(this.get_distinct_id(),e,n);this.Tr!==i?(this.setPersonPropertiesForFlags(j({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Tr=i):$.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,i){if(e&&n){if(this.Vr("posthog.group")){var r=this.getGroups();r[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:j({},r,{[e]:n})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===n||i||this.reloadFeatureFlags()}}else $.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,i,r,a;if($.info("reset"),!this.__loaded)return $.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(i=this.sessionPersistence)==null||i.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(Wi,"anonymous"),(a=this.sessionManager)==null||a.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:gc,$device_id:null},"");else{var s=this.config.get_device_id(Xr());this.register_once({distinct_id:s,$device_id:e?s:o},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&i){var a,o=(a=e.timestampLookBack)!==null&&a!==void 0?a:10;if(!i)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-o,0)}return r}alias(e,n){return e===this.get_property(aT)?($.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(I(n)&&(n=this.get_distinct_id()),e!==n?(this.Jr(Ec,e),this.capture("$create_alias",{alias:e,distinct_id:n})):($.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=j({},this.config);if(ft(e)){var i,r,a,o,s;Ye(this.config,YA(e));var l=this.Cr();(i=this.persistence)==null||i.update_config(this.config,n,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Nc(j({},this.config,{persistence:"sessionStorage"}),l);var c=this.Rr(this.config.debug);Jr(c)&&(this.config.debug=c),Jr(this.config.debug)&&(this.config.debug?(Yi.DEBUG=!0,Ue.H()&&Ue.G("ph_debug","true"),$.info("set_config",{config:e,oldConfig:n,newConfig:j({},this.config)})):(Yi.DEBUG=!1,Ue.H()&&Ue.V("ph_debug"))),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(a=this.autocapture)==null||a.startIfEnabled(),(o=this.heatmaps)==null||o.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,i={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var r,a,o,s,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),i.sampling&&((a=this.sessionRecording)==null||a.overrideSampling()),i.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),i.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),i.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(j({},r,n))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Ts;return n!==Ts&&(n=Ts+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Wi))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(Wi))==="identified"}Gr(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ks(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Ec])&&((n=this.persistence)==null||(n=n.props)==null||!n[sp]))}Br(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Gr()||this.Vr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Vr(e){return this.config.person_profiles==="never"?($.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(sp,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}Kr(){var e,n,i,r,a=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==a&&((i=this.persistence)==null||i.set_disabled(a)),((n=this.sessionPersistence)==null?void 0:n.wi)!==a&&((r=this.sessionPersistence)==null||r.set_disabled(a)),a}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var i,r;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(i=this.sessionManager)==null||i.destroy(),this.sessionManager=new _p(this),this.persistence&&(this.sessionPropsManager=new bp(this,this.sessionManager,this.persistence)),this.sessionRecording=new Sp(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(I(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((r=e?.captureEventName)!==null&&r!==void 0?r:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else $.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:gc,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Hr())):$.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Ki.GRANTED?"granted":e===Ki.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kr()}_is_bot(){return dn?ek(dn,this.config.custom_blocked_useragents):void 0}Hr(){B&&(B.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:B.title},{send_instantly:!0}),this.kr&&(B.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),tt(B,"visibilitychange",this.kr)))}debug(e){e===!1?(R?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(R?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,n,i,r,a,o,s,l=this.Ir||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?($.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(i="advanced_disable_decide",r=!1,a=$,o=(n="advanced_disable_flags")in(e=l)&&!I(e[n]),s=i in e&&!I(e[i]),o?e[n]:s?(a&&a.warn("Config field '"+i+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[i]):r)}Wr(e){if(Ee(this.config.before_send))return e;var n=Ae(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of n){if(i=r(i),Ee(i)){var a="Event '"+e.event+"' was rejected in beforeSend function";return hL(e.event)?$.warn(a+". This can cause unexpected behavior."):$.info(a),null}i.properties&&!ks(i.properties)||$.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(i)})}Rr(e){var n=Jr(e)&&!e,i=Ue.H()&&Ue.q("ph_debug")==="true";return!n&&(!!i||e)}};(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=OL(t.prototype[e[n]])})(xp,["identify"]);var WA,nk=(WA=Dc[Ts]=new xp,(function(){function t(){t.done||(t.done=!0,tk=!1,Re(Dc,(function(e){e._dom_loaded()})))}B!=null&&B.addEventListener?B.readyState==="complete"?t():tt(B,"DOMContentLoaded",t,{capture:!1}):R&&$.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),WA);var gb=class{constructor(e={}){this.options=e;V(this,"client");V(this,"featureFlagsCallback");V(this,"captureCallback");V(this,"consentUnsub");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&e.consent&&e.requireExplicitConsent&&typeof window<"u"&&e.apiKey){let n=e.consent;n.getStatus()==="granted"&&this.initPostHog(),this.consentUnsub=n.subscribe(r=>{r==="granted"?this.client?this.client.opt_in_capturing():this.initPostHog():r==="denied"&&this.client&&this.client.opt_out_capturing()});return}!this.client&&typeof window<"u"&&e.apiKey&&this.initPostHog()}initPostHog(){let e=this.options;if(!e.apiKey)return;let n=e.enableFeatureFlags??!0,i=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=nk.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!n,advanced_disable_feature_flags_on_first_load:!n,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:r=>{if(n&&this.featureFlagsCallback){r.onFeatureFlags(()=>{let o=this.getAllFeatureFlags();o&&this.featureFlagsCallback&&this.featureFlagsCallback(o)});let a=this.getAllFeatureFlags();a&&Object.keys(a).length>0&&this.featureFlagsCallback(a)}this.captureCallback&&r.on("eventCaptured",a=>{let o=typeof a=="string"?a:a?.event,s=typeof a=="string"?void 0:a?.properties;typeof o=="string"&&this.captureCallback?.(o,s)})}},i)}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let n={};for(let[i,r]of Object.entries(e))i.startsWith("in_segment_")&&(n[i]=r===!0);return n}identify(e,n){this.client?.identify(e,n)}alias(e,n){this.client?.alias(e,n)}track(e,n){this.client?.capture(e,n)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,n){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:n})}trackAction(e,n,i){this.track("shadow_canvas_action",{action:e,rectangleId:n,surface:i})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,n,i){let r=`$experiment_${e}`;this.register({[r]:i??`variation_${n}`,[`${r}_id`]:n}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:n,$experiment_variation_name:i??`variation_${n}`})}setPersonProperties(e){this.client?.capture("$set",{$set:e})}setPersonPropertiesOnce(e){this.client?.capture("$set",{$set_once:e})}getDistinctId(){return this.client?.get_distinct_id?.()}};function Ap(t={}){return new gb(t)}var mb=async(t,e)=>{let n=[];if(e.applyAction)for(let i of t.actions){let r=await e.applyAction(i);n.push(r)}return{cleanup:async()=>{for(let i=n.length-1;i>=0;i--)try{await n[i].revert()}catch{}}}},vb=async(t,e)=>{let n=[];if(e.applyAction){let i=t.actions.map(r=>e.applyAction(r));if(t.waitFor==="any"){let r=await Promise.race(i);n.push(r);let a=await Promise.allSettled(i);for(let o of a)o.status==="fulfilled"&&o.value!==r&&n.push(o.value)}else{let r=await Promise.all(i);n.push(...r)}}return{cleanup:async()=>{for(let i of n)try{await i.revert()}catch{}}}},yb=async(t,e)=>{let n,i,r=!1,a={cleanup:()=>{r=!0,i&&clearTimeout(i),n&&n()}};return t.event&&e.subscribeEvent?await new Promise(o=>{n=e.subscribeEvent(t.event,()=>{r||o()}),t.durationMs!==void 0&&(i=setTimeout(()=>{r||o()},t.durationMs))}):t.durationMs!==void 0&&await new Promise(o=>{i=setTimeout(()=>{r||o()},t.durationMs)}),a};var _b="syntro_active_tour",Tp=new Map;function F3(t){try{let e=localStorage.getItem(_b);if(!e)return null;let n=JSON.parse(e);return n.tourId!==t?null:n}catch{return null}}function bb(t){try{localStorage.setItem(_b,JSON.stringify(t))}catch{}}function U3(){try{localStorage.removeItem(_b)}catch{}}function jc(){return window.location.pathname}function V3(t){if(!t.route)return!0;let e=jc();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var Sb=async(t,e)=>{let{tourId:n,steps:i,startStep:r,autoStart:a=!0}=t;if(i.length===0)throw new Error(`Tour "${n}" has no steps`);if(Tp.has(n))return{cleanup:async()=>{let m=Tp.get(n);m&&await m.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let o=F3(n),s=!!o;if(!s&&!a)return{cleanup:()=>{}};o||(o={tourId:n,currentStepId:r||i[0].id,startedAt:Date.now()},bb(o));let l=i.findIndex(m=>m.id===o.currentStepId);if(l===-1){let m=r||i[0].id;l=i.findIndex(v=>v.id===m),l===-1&&(l=0),o.currentStepId=i[l].id,bb(o)}let c=i[l];if(!V3(c))return e.publishEvent("tour.waiting_for_route",{tourId:n,stepId:c.id,expectedRoute:c.route,currentRoute:jc()}),{cleanup:()=>{}};let u=!1,f=null,h=null,g=null,_=async()=>{h&&(h(),h=null),f?.isApplied()&&(await f.revert(),f=null)},b=async m=>{if(u)return;if(await _(),m==="end"){U3(),e.publishEvent("tour.completed",{tourId:n,totalSteps:i.length}),u=!0;return}let v=i.find(S=>S.id===m);if(!v){console.error(`[Tour] Step "${m}" not found`);return}if(o.currentStepId=m,bb(o),e.publishEvent("tour.step_changed",{tourId:n,previousStepId:c.id,nextStepId:m}),v.route&&v.route!==jc()){e.publishEvent("tour.awaiting_navigation",{tourId:n,stepId:m,targetRoute:v.route});return}await w(v)},w=async m=>{if(!u){e.publishEvent("tour.step_started",{tourId:n,stepId:m.id,stepIndex:i.findIndex(v=>v.id===m.id),totalSteps:i.length});try{f=await e.applyAction(m.action)}catch(v){console.error(`[Tour] Failed to execute step "${m.id}":`,v),e.publishEvent("tour.step_failed",{tourId:n,stepId:m.id,error:String(v)});return}if(m.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",T=>{let A=T?.actionId;if(A&&m.onAction){let k=m.onAction[A];k&&b(k)}});let v=e.subscribeEvent("action.tooltip_cta_clicked",T=>{let A=T?.actionId;if(A&&m.onAction){let k=m.onAction[A];k&&b(k)}}),S=h;h=()=>{S(),v()}}}};g=(()=>{let m=jc(),v=()=>{let A=jc();A!==m&&(m=A,e.publishEvent("tour.route_changed",{tourId:n,newRoute:A}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>v());window.addEventListener("popstate",v);let S=history.pushState.bind(history),T=history.replaceState.bind(history);return history.pushState=(...A)=>{S(...A),queueMicrotask(v)},history.replaceState=(...A)=>{T(...A),queueMicrotask(v)},()=>{window.removeEventListener("popstate",v),history.pushState=S,history.replaceState=T}})(),s?e.publishEvent("tour.resumed",{tourId:n,stepId:o.currentStepId}):e.publishEvent("tour.started",{tourId:n,totalSteps:i.length,startStepId:o.currentStepId}),await w(c);let p=async()=>{u=!0,Tp.delete(n),await _(),g&&g(),e.publishEvent("tour.paused",{tourId:n,stepId:o.currentStepId})};return Tp.set(n,{cleanup:p}),{cleanup:p}};var qc=class{constructor(){V(this,"executors",new Map);for(let{kind:e,executor:n}of $m)this.registerCore(e,n);for(let{kind:e,executor:n}of Pm)this.registerCore(e,n);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",mb),this.registerCore("core:parallel",vb),this.registerCore("core:wait",yb),this.registerCore("core:tour",Sb)}registerCore(e,n,i){this.executors.set(e,{kind:e,executor:n,schema:i,source:"core",isBuiltIn:!0})}register(e,n,i,r="custom",a=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)return;console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e} (source: ${r})`)}console.log(`[ExecutorRegistry] Registered executor: ${e} (source: ${r})`),this.executors.set(e,{kind:e,executor:n,schema:i,source:r,isBuiltIn:a})}unregister(e){let n=this.executors.get(e);return n?n.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[n,i]of this.executors.entries())i.source===e&&this.executors.delete(n)}get(e){return this.executors.get(e)?.executor}getRegistration(e){return this.executors.get(e)}has(e){return this.executors.has(e)}validate(e){let n=[];if(!e||typeof e!="object")return n.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:n,warnings:[]};let{kind:i}=e;if(!i||typeof i!="string")return n.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:n,warnings:[]};let r=this.executors.get(i);if(!r)return n.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:n,warnings:[]};if(r.schema){let a=r.schema.safeParse(e);if(!a.success){for(let o of a.error.issues)n.push({code:"SCHEMA_VALIDATION_ERROR",message:o.message,field:o.path.join(".")});return{valid:!1,errors:n,warnings:[]}}}return{valid:!0,errors:[],warnings:[]}}list(){return Array.from(this.executors.keys())}listRegistrations(){return Array.from(this.executors.values())}getBuiltInKinds(){return Array.from(this.executors.entries()).filter(([,e])=>e.isBuiltIn).map(([e])=>e)}getCustomKinds(){return Array.from(this.executors.entries()).filter(([,e])=>!e.isBuiltIn).map(([e])=>e)}},pi=new qc;function ik(t){return pi.get(t)}function kp(t){return pi.has(t)}var j3=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),rk=5e4,ak=50;function Ji(t){let e=[],n=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:n};let{kind:i}=t;if(!i||typeof i!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:n};if(!kp(i)&&i!=="core:mountWidget"){let r=pi.list();return console.error(`[ActionValidation] Unknown action kind: "${i}". Registered kinds (${r.length}): [${r.join(", ")}]. This usually means the app that provides "${i}" hasn't been activated yet, or the executor was never registered in ExecutorRegistry.`),e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:e,warnings:n}}switch(i){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":na(t,e,n);break;case"overlays:badge":na(t,e,n),q3(t,e,n);break;case"overlays:tooltip":na(t,e,n),P3(t,e,n);break;case"overlays:modal":n5(t,e,n);break;case"content:insertHtml":na(t,e,n),G3(t,e,n);break;case"content:setText":na(t,e,n),Z3(t,e,n);break;case"content:setAttr":na(t,e,n),Y3(t,e,n);break;case"content:addClass":case"content:removeClass":na(t,e,n),W3(t,e,n);break;case"content:setStyle":na(t,e,n),K3(t,e,n);break;case"core:mountWidget":X3(t,e,n);break;case"core:wait":Q3(t,e,n);break;case"core:sequence":J3(t,e,n);break;case"core:parallel":e5(t,e,n);break;case"core:tour":i5(t,e,n);break;case"navigation:navigate":t5(t,e,n);break}return{valid:e.length===0,errors:e,warnings:n}}function na(t,e,n){!t.anchorId||typeof t.anchorId!="string"?e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' property",field:"anchorId"}):t.anchorId.length>200&&n.push({code:"LONG_ANCHOR_ID",message:"Anchor ID is unusually long",suggestion:"Consider using a shorter, more descriptive ID"})}function q3(t,e,n){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&n.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function P3(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Tooltip action requires 'content' object",field:"content"});return}(!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Tooltip content requires 'body' property",field:"content.body"})}function G3(t,e,n){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>rk&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${rk}`,field:"html"});let i=["before","after","prepend","append","replace"];(!t.position||!i.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${i.join(", ")}`,field:"position"})}function Z3(t,e,n){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function Y3(t,e,n){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(j3.has(t.attr.toLowerCase())||t.attr.toLowerCase().startsWith("on"))&&e.push({code:"DANGEROUS_ATTR",message:`Event handler attributes are not allowed: ${t.attr}`,field:"attr"}),(t.value===void 0||t.value===null)&&e.push({code:"MISSING_VALUE",message:"setAttr action requires 'value' property",field:"value"})}function W3(t,e,n){!t.className||typeof t.className!="string"?e.push({code:"MISSING_CLASS_NAME",message:"Class action requires 'className' property",field:"className"}):/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t.className)||n.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function K3(t,e,n){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let i=Object.keys(t.styles).length;i>ak&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${i}). Maximum is ${ak}`,field:"styles"});for(let[r,a]of Object.entries(t.styles))typeof a=="string"&&a.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${r}`,field:`styles.${r}`})}}function X3(t,e,n){(!t.slot||typeof t.slot!="string")&&e.push({code:"MISSING_SLOT",message:"mountWidget action requires 'slot' property",field:"slot"}),!t.widget||typeof t.widget!="object"?e.push({code:"MISSING_WIDGET",message:"mountWidget action requires 'widget' object",field:"widget"}):(!t.widget.widgetId||typeof t.widget.widgetId!="string")&&e.push({code:"MISSING_WIDGET_ID",message:"Widget must have a 'widgetId' property",field:"widget.widgetId"})}function Q3(t,e,n){t.durationMs===void 0&&!t.event&&e.push({code:"MISSING_WAIT_CONFIG",message:"wait action requires either 'durationMs' or 'event' property"}),t.durationMs!==void 0&&t.durationMs<0&&e.push({code:"INVALID_DURATION",message:"durationMs must be a positive number",field:"durationMs"}),t.event!==void 0&&typeof t.event!="string"&&e.push({code:"INVALID_EVENT",message:"event must be a string",field:"event"})}function J3(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"sequence action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let i=0;i<t.actions.length;i++){let r=Ji(t.actions[i]);for(let a of r.errors)e.push({...a,field:`actions[${i}]${a.field?`.${a.field}`:""}`});for(let a of r.warnings)n.push(a)}}function e5(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"parallel action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_PARALLEL",message:"parallel has no actions",suggestion:"Add at least one action to the parallel group"}),t.waitFor&&!["all","any"].includes(t.waitFor)&&e.push({code:"INVALID_WAIT_FOR",message:"waitFor must be 'all' or 'any'",field:"waitFor"});for(let i=0;i<t.actions.length;i++){let r=Ji(t.actions[i]);for(let a of r.errors)e.push({...a,field:`actions[${i}]${a.field?`.${a.field}`:""}`});for(let a of r.warnings)n.push(a)}}function t5(t,e,n){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let i=t.url.trim().toLowerCase();i.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),i.startsWith("data:")&&n.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function n5(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Modal action requires 'content' object",field:"content"});return}if((!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Modal content requires 'body' property",field:"content.body"}),t.size&&!["sm","md","lg"].includes(t.size)&&e.push({code:"INVALID_SIZE",message:"Modal size must be 'sm', 'md', or 'lg'",field:"size"}),t.ctaButtons)if(!Array.isArray(t.ctaButtons))e.push({code:"INVALID_CTA_BUTTONS",message:"ctaButtons must be an array",field:"ctaButtons"});else for(let i=0;i<t.ctaButtons.length;i++){let r=t.ctaButtons[i];(!r.label||typeof r.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${i} requires 'label' property`,field:`ctaButtons[${i}].label`}),(!r.actionId||typeof r.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${i} requires 'actionId' property`,field:`ctaButtons[${i}].actionId`})}}function i5(t,e,n){if((!t.tourId||typeof t.tourId!="string")&&e.push({code:"MISSING_TOUR_ID",message:"Tour action requires 'tourId' property",field:"tourId"}),!t.steps||!Array.isArray(t.steps)){e.push({code:"MISSING_STEPS",message:"Tour action requires 'steps' array",field:"steps"});return}t.steps.length===0&&e.push({code:"EMPTY_STEPS",message:"Tour must have at least one step",field:"steps"});let i=new Set;for(let r=0;r<t.steps.length;r++){let a=t.steps[r];if(!a.id||typeof a.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${r} requires 'id' property`,field:`steps[${r}].id`}):(i.has(a.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${a.id}`,field:`steps[${r}].id`}),i.add(a.id)),!a.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${r} requires 'action' property`,field:`steps[${r}].action`});else{let o=Ji(a.action);for(let s of o.errors)e.push({...s,field:`steps[${r}].action${s.field?`.${s.field}`:""}`});for(let s of o.warnings)n.push(s)}if(a.onAction)for(let[o,s]of Object.entries(a.onAction))s!=="end"&&!t.steps.some(l=>l.id===s)&&n.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${a.id}" references unknown target step: ${s}`,suggestion:`Make sure step "${s}" exists in the tour`})}}function Rp(t){let e=[],n=[];if(!Array.isArray(t))return console.error("[ActionValidation] validateActions called with non-array:",typeof t),e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:n};for(let i=0;i<t.length;i++){let r=Ji(t[i]);if(!r.valid){let a=t[i];console.error(`[ActionValidation] Action [${i}] failed validation:`,`kind="${a?.kind??"undefined"}"`,r.errors.map(o=>`${o.code}: ${o.message}`).join("; "),a)}for(let a of r.errors)e.push({...a,field:a.field?`[${i}].${a.field}`:`[${i}]`});for(let a of r.warnings)n.push({...a,suggestion:a.suggestion?`Action ${i}: ${a.suggestion}`:void 0})}return e.length>0&&console.error(`[ActionValidation] Batch validation failed: ${e.length} error(s) in ${t.length} action(s).`,e.map(i=>`${i.field??"?"}: ${i.message}`).join(" | ")),{valid:e.length===0,errors:e,warnings:n}}var r5=0;function Op(t){let{overlayRoot:e,eventBus:n,surfaces:i,anchorResolver:r,adaptiveId:a,executorRegistry:o=pi,subscribeNavigation:s}=t,l=new Map;function c(){return`action-${++r5}`}function u(p,m){n&&n.publish(p,m)}function f(){return{overlayRoot:e,resolveAnchor:r,generateId:c,publishEvent:u,adaptiveId:a,applyAction:g,subscribeEvent:n?(p,m)=>n.subscribe({names:[p]},v=>m(v.props)):void 0,subscribeNavigation:s}}async function h(p,m){if(!i)throw new Error("Surfaces provider required for core:mountWidget actions");let v=i.mount(p.slot,{type:"widget",widgetId:p.widget.widgetId,config:p.widget.props},{priority:p.widget.priority});return m.publishEvent("action.applied",{id:m.generateId(),kind:"core:mountWidget",slot:p.slot,widgetId:p.widget.widgetId}),{cleanup:()=>{v.unmount()},updateFn:S=>{if("widget"in S&&S.widget){let T=S.widget;T.props&&v.update({type:"widget",widgetId:p.widget.widgetId,config:T.props})}}}}async function g(p){let m=Ji(p);if(!m.valid){let C=m.errors.map(x=>x.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${p?.kind}":`,C,p),new Error(`Action validation failed: ${C}`)}let v=c(),S=f(),T;if(p.kind==="core:mountWidget")T=await h(p,S);else{let C=o.get(p.kind);if(!C){let x="list"in o?o.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${p.kind}".`,`Registered: [${x}]`),new Error(`No executor for action kind: ${p.kind}`)}T=await C(p,S)}let A={id:v,action:p,adaptiveId:a,appliedTs:Date.now(),state:"applied",cleanup:T.cleanup,updateFn:T.updateFn};return l.set(v,A),u("action.applied",{id:v,kind:p.kind,anchorId:"anchorId"in p?p.anchorId:void 0}),{id:v,action:p,async revert(){let C=l.get(v);if(!(!C||C.state!=="applied"))try{await C.cleanup(),C.state="reverted",u("action.reverted",{id:v,kind:p.kind})}catch(x){throw C.state="failed",u("action.failed",{id:v,kind:p.kind,error:String(x)}),x}finally{l.delete(v)}},isApplied(){return l.get(v)?.state==="applied"},async update(C){let x=l.get(v);if(!x||x.state!=="applied")throw new Error("Cannot update action that is not applied");if(x.updateFn)await x.updateFn(C);else throw new Error(`Action kind ${p.kind} does not support updates`)},getState(){return l.get(v)?.state??"reverted"}}}async function _(p){console.log(`[ActionEngine] applyBatch: ${p.length} action(s)`,p.map(k=>k.kind).join(", "));let m=Rp(p);if(!m.valid){let k=m.errors.map(C=>C.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${p.length} action(s):`,k,`
|
|
448
|
-
Actions:`,
|
|
449
|
-
`)),new Error(`Batch validation failed: ${k}`)}let v=c(),S=[],T=[];try{for(let k of p){let C=await g(k);S.push(C),T.push(C)}}catch(k){console.error(`[ActionEngine] Batch apply FAILED at action ${T.length+1}/${p.length}.`,`Successfully applied: ${T.length}. Rolling back...`,k);for(let C of T)try{await C.revert()}catch{}throw k}return{id:v,handles:S,async revertAll(){for(let k=S.length-1;k>=0;k--)try{await S[k].revert()}catch(C){console.error(`[ActionEngine] Error reverting action ${S[k].id}:`,C)}},isApplied(){return S.every(k=>k.isApplied())}}}function b(p){return Ji(p)}function w(){return Array.from(l.values()).map(p=>({id:p.id,action:p.action,adaptiveId:p.adaptiveId,appliedTs:p.appliedTs,state:p.state}))}function d(){for(let p of l.values())if(p.state==="applied")try{p.cleanup()}catch(m){console.error("[ActionEngine] Error during cleanup:",m)}l.clear()}return{apply:g,applyBatch:_,validate:b,getActive:w,destroy:d}}var ok=y.object({type:y.literal("page_url"),url:y.string()}),sk=y.object({type:y.literal("route"),routeId:y.string()}),lk=y.object({type:y.literal("anchor_visible"),anchorId:y.string(),state:y.enum(["visible","present","absent"])}),ck=y.object({type:y.literal("event_occurred"),eventName:y.string(),withinMs:y.number().optional()}),uk=y.object({type:y.literal("state_equals"),key:y.string(),value:y.unknown()}),dk=y.object({type:y.literal("viewport"),minWidth:y.number().optional(),maxWidth:y.number().optional(),minHeight:y.number().optional(),maxHeight:y.number().optional()}),fk=y.object({type:y.literal("session_metric"),key:y.string(),operator:y.enum(["gte","lte","eq","gt","lt"]),threshold:y.number()}),pk=y.object({type:y.literal("dismissed"),key:y.string(),inverted:y.boolean().optional()}),hk=y.object({type:y.literal("cooldown_active"),key:y.string(),inverted:y.boolean().optional()}),gk=y.object({type:y.literal("frequency_limit"),key:y.string(),limit:y.number(),inverted:y.boolean().optional()}),mk=y.object({type:y.literal("event_count"),key:y.string(),operator:y.enum(["gte","lte","eq","gt","lt"]),count:y.number().int().min(0),withinMs:y.number().positive().optional()}),Mp=y.discriminatedUnion("type",[ok,sk,lk,ck,uk,dk,fk,pk,hk,gk,mk]),xb=y.object({conditions:y.array(Mp),value:y.unknown()}),wb=y.object({type:y.literal("rules"),rules:y.array(xb),default:y.unknown()}),Eb=y.object({type:y.literal("score"),field:y.string(),threshold:y.number(),above:y.unknown(),below:y.unknown()}),Cb=y.object({type:y.literal("model"),modelId:y.string(),inputs:y.array(y.string()),outputMapping:y.record(y.string(),y.unknown()),default:y.unknown()}),Ab=y.object({type:y.literal("external"),endpoint:y.string(),method:y.enum(["GET","POST"]).optional(),default:y.unknown(),timeoutMs:y.number().optional()}),Tb=y.discriminatedUnion("type",[wb,Eb,Cb,Ab]),kb=y.object({include:y.array(y.string()).optional(),exclude:y.array(y.string()).optional()}),Pc=y.object({routes:kb,strategy:Tb.optional()});function a5(t){return Mp.safeParse(t)}function o5(t){return Tb.safeParse(t)}function s5(t){return Pc.safeParse(t)}var l5=[{defName:"activationConfig",schema:Pc},{defName:"routeFilter",schema:kb},{defName:"ruleStrategy",schema:wb},{defName:"scoreStrategy",schema:Eb},{defName:"modelStrategy",schema:Cb},{defName:"externalStrategy",schema:Ab},{defName:"rule",schema:xb},{defName:"condition",schema:Mp}];var pt={activation:Pc.optional()},Rb=y.object({color:y.string().optional(),scrimOpacity:y.number().min(0).max(1).optional(),paddingPx:y.number().optional(),radiusPx:y.number().optional()}).strict(),Ob=y.enum(["top-left","top-right","bottom-left","bottom-right"]),Mb=y.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),Dp=y.object({label:y.string(),actionId:y.string(),primary:y.boolean().optional()}).strict(),Nb=y.object({title:y.string().optional(),body:y.string(),ctaButtons:y.array(Dp).optional()}).strict(),Db=y.object({title:y.string().optional(),body:y.string()}).strict(),Lb=y.enum(["before","after","prepend","append","replace"]),Hb=y.enum(["immediate","hover","click"]),Ib=y.object({widgetId:y.string(),props:y.record(y.unknown()).optional(),priority:y.number().optional()}).strict(),zb=y.object({id:y.string(),action:y.any(),route:y.string().optional(),onAction:y.record(y.string()).optional()}).strict(),Bb=y.enum(["auto","smooth","instant"]),Np=y.enum(["start","center","end","nearest"]),$b=y.object({kind:y.literal("content:setText"),anchorId:y.string(),text:y.string(),label:y.string().optional()}).extend(pt).strict(),Fb=y.object({kind:y.literal("content:setAttr"),anchorId:y.string(),attr:y.string(),value:y.string(),label:y.string().optional()}).extend(pt).strict(),Ub=y.object({kind:y.literal("content:addClass"),anchorId:y.string(),className:y.string(),label:y.string().optional()}).extend(pt).strict(),Vb=y.object({kind:y.literal("content:removeClass"),anchorId:y.string(),className:y.string(),label:y.string().optional()}).extend(pt).strict(),jb=y.object({kind:y.literal("content:setStyle"),anchorId:y.string(),styles:y.record(y.string()),label:y.string().optional()}).extend(pt).strict(),qb=y.object({kind:y.literal("content:insertHtml"),anchorId:y.string(),html:y.string(),position:Lb,label:y.string().optional()}).extend(pt).strict(),Pb=y.object({kind:y.literal("overlays:highlight"),anchorId:y.string(),style:Rb.optional(),duration:y.number().optional(),label:y.string().optional()}).extend(pt).strict(),Gb=y.object({kind:y.literal("overlays:pulse"),anchorId:y.string(),duration:y.number().optional(),label:y.string().optional()}).extend(pt).strict(),Zb=y.object({kind:y.literal("overlays:badge"),anchorId:y.string(),content:y.string(),position:Ob.optional(),label:y.string().optional()}).extend(pt).strict(),Yb=y.object({kind:y.literal("overlays:tooltip"),anchorId:y.string(),content:Nb,trigger:Hb.optional(),placement:Mb.optional(),waitFor:y.string().optional(),label:y.string().optional()}).extend(pt).strict(),Wb=y.object({kind:y.literal("overlays:modal"),content:Db,size:y.enum(["sm","md","lg"]).optional(),blocking:y.boolean().optional(),scrim:y.object({opacity:y.number().min(0).max(1).optional()}).strict().optional(),dismiss:y.object({onEsc:y.boolean().optional(),closeButton:y.boolean().optional(),timeoutMs:y.number().min(0).optional()}).strict().optional(),ctaButtons:y.array(Dp).optional(),waitFor:y.string().optional(),label:y.string().optional()}).extend(pt).strict(),Kb=y.object({kind:y.literal("navigation:scrollTo"),anchorId:y.string(),behavior:Bb.optional(),block:Np.optional(),inline:Np.optional(),label:y.string().optional()}).extend(pt).strict(),Xb=y.object({kind:y.literal("navigation:navigate"),url:y.string(),target:y.enum(["_self","_blank"]).optional(),label:y.string().optional()}).extend(pt).strict(),Qb=y.object({kind:y.literal("core:mountWidget"),slot:y.string(),widget:Ib,label:y.string().optional()}).extend(pt).strict(),Jb=y.object({kind:y.literal("core:wait"),durationMs:y.number().min(0).optional(),event:y.string().optional(),label:y.string().optional()}).extend(pt).strict(),e_=y.object({kind:y.literal("core:sequence"),actions:y.array(y.any()),label:y.string().optional()}).extend(pt).strict(),t_=y.object({kind:y.literal("core:parallel"),actions:y.array(y.any()),waitFor:y.enum(["all","any"]).optional(),label:y.string().optional()}).extend(pt).strict(),n_=y.object({kind:y.literal("core:tour"),tourId:y.string(),steps:y.array(zb).min(1),startStep:y.string().optional(),autoStart:y.boolean().optional(),label:y.string().optional()}).extend(pt).strict(),vk=[{defName:"setText",schema:$b},{defName:"setAttr",schema:Fb},{defName:"addClass",schema:Ub},{defName:"removeClass",schema:Vb},{defName:"setStyle",schema:jb},{defName:"insertHtml",schema:qb},{defName:"highlight",schema:Pb},{defName:"pulse",schema:Gb},{defName:"badge",schema:Zb},{defName:"tooltip",schema:Yb},{defName:"modal",schema:Wb},{defName:"scrollTo",schema:Kb},{defName:"navigate",schema:Xb},{defName:"mountWidget",schema:Qb},{defName:"wait",schema:Jb},{defName:"sequence",schema:e_},{defName:"parallel",schema:t_},{defName:"tour",schema:n_}];function c5(){let t=Date.now();return{page:{url:typeof window<"u"?window.location.href:"",title:typeof document<"u"?document.title:void 0},session:{sessionId:"",startTs:t,pageHistory:[]},viewport:{width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0}}}function i_(t,e){if(!e)return;let n;try{n=new URL(t).pathname}catch{n=t}if(e.exclude){for(let i of e.exclude)if(yk(n,i))return}if(e.include){for(let i of e.include)if(yk(n,i))return i;return}return n}function yk(t,e){let n=t.replace(/\/$/,"")||"/",i=e.replace(/\/$/,"")||"/";if(n===i)return!0;let r=i.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${r}$`).test(n)}var Gc=class{constructor(e={}){V(this,"context");V(this,"previousContext");V(this,"listeners",new Set);V(this,"telemetry");V(this,"routes");V(this,"navigation");V(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=c5(),this.previousContext={...this.context},e.telemetry?.getSessionId){let n=e.telemetry.getSessionId();n&&(this.context.session.sessionId=n)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=i_(this.context.page.url,this.routes),this.addPageToHistory(this.context.page.url),typeof window<"u"&&this.setupBrowserListeners()}get(){return{...this.context}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setRoutes(e){this.routes=e;let n=i_(this.context.page.url,this.routes);n!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:n}})}setAnchors(e){this.updateContext({anchors:e})}setSessionId(e){e!==this.context.session.sessionId&&this.updateContext({session:{...this.context.session,sessionId:e}})}destroy(){for(let e of this.cleanupFns)e();this.cleanupFns=[],this.listeners.clear()}setupBrowserListeners(){let e,n=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};if(window.addEventListener("resize",n),this.cleanupFns.push(()=>window.removeEventListener("resize",n)),this.navigation){let i=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(i)}else{let i=()=>{this.updatePage()};window.addEventListener("popstate",i),this.cleanupFns.push(()=>window.removeEventListener("popstate",i));let r=history.pushState.bind(history),a=history.replaceState.bind(history);history.pushState=(...o)=>{r(...o),queueMicrotask(()=>this.updatePage())},history.replaceState=(...o)=>{a(...o),queueMicrotask(()=>this.updatePage())},this.cleanupFns.push(()=>{history.pushState=r,history.replaceState=a})}}updateViewport(){let e={width:window.innerWidth,height:window.innerHeight};(e.width!==this.context.viewport.width||e.height!==this.context.viewport.height)&&this.updateContext({viewport:e})}updatePage(){let e=window.location.href,{title:n}=document,i=i_(e,this.routes),r={url:e,title:n,routeId:i};(r.url!==this.context.page.url||r.title!==this.context.page.title||r.routeId!==this.context.page.routeId)&&(r.url!==this.context.page.url&&this.addPageToHistory(r.url),this.updateContext({page:r}))}addPageToHistory(e){let n={url:e,ts:Date.now()},i=[...this.context.session.pageHistory||[],n];i.length>50&&i.shift(),this.context.session.pageHistory=i}updateContext(e){this.previousContext={...this.context},this.context={...this.context,...e},this.notifyListeners()}notifyListeners(){for(let e of this.listeners)try{e(this.context,this.previousContext)}catch(n){console.error("[ContextManager] Listener error:",n)}}};function Lp(t={}){return new Gc(t)}var bk=y.object({url:y.string(),routeId:y.string().optional(),title:y.string().optional(),locale:y.string().optional()}),_k=y.object({url:y.string(),ts:y.number()}),Sk=y.object({sessionId:y.string(),startTs:y.number(),pageHistory:y.array(_k).optional()}),xk=y.object({width:y.number(),height:y.number()}),wk=y.object({x:y.number(),y:y.number(),w:y.number(),h:y.number()}),Ek=y.object({anchorId:y.string(),present:y.boolean(),visible:y.boolean().optional(),boundingBox:wk.optional()}),Ck=y.record(y.string(),y.union([y.number(),y.string(),y.boolean(),y.undefined()])),Ak=y.object({page:bk,session:Sk,viewport:xk,anchors:y.array(Ek).optional(),augmented:Ck.optional()});function u5(t){return Ak.safeParse(t)}function r_(t,e){let{context:n,state:i,events:r}=e;switch(t.type){case"page_url":{let{url:a}=t,o=n.page.url,s=a.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(`^${s}$`).test(o)}case"route":return n.page.routeId===t.routeId;case"anchor_visible":{let a=n.anchors?.find(o=>o.anchorId===t.anchorId);switch(t.state){case"visible":return a?.visible===!0;case"present":return a?.present===!0;case"absent":return!a?.present;default:return!1}}case"event_occurred":{if(!r)return!1;let a=t.withinMs??6e4;return r.hasRecentEvent(t.eventName,a)}case"state_equals":return!1;case"viewport":{let{width:a,height:o}=n.viewport;return!(t.minWidth!==void 0&&a<t.minWidth||t.maxWidth!==void 0&&a>t.maxWidth||t.minHeight!==void 0&&o<t.minHeight||t.maxHeight!==void 0&&o>t.maxHeight)}case"session_metric":{if(!i)return!1;let a=i.getSessionMetric(t.key),{operator:o,threshold:s}=t;switch(o){case"gte":return a>=s;case"lte":return a<=s;case"eq":return a===s;case"gt":return a>s;case"lt":return a<s;default:return!1}}case"dismissed":{if(!i)return t.inverted??!1;let a=i.isDismissed(t.key);return t.inverted?!a:a}case"cooldown_active":{if(!i)return t.inverted??!1;let a=i.isCooldownActive(t.key);return t.inverted?!a:a}case"frequency_limit":{if(!i)return t.inverted??!1;let o=i.getFrequencyCount(t.key)>=t.limit;return t.inverted?!o:o}case"event_count":{if(!e.accumulator)return!1;let a=t,o=e.accumulator.getCount(a.key,a.withinMs);switch(a.operator){case"gte":return o>=a.count;case"lte":return o<=a.count;case"eq":return o===a.count;case"gt":return o>a.count;case"lt":return o<a.count;default:return!1}}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function a_(t,e){let n=[];for(let i of t.conditions){let r=r_(i,e);if(n.push({condition:i,result:r}),!r)return{matched:!1,conditionResults:n}}return{matched:!0,conditionResults:n}}function Zc(t,e){for(let n=0;n<t.rules.length;n++){let i=t.rules[n],{matched:r,conditionResults:a}=a_(i,e);if(r)return{value:i.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:n,evaluatedConditions:a}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function Yc(t,e){let{context:n}=e,i=n.augmented?.[t.field];return i===void 0||typeof i!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:i>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function Tk(t,e){let{state:n,events:i,sessionMetrics:r,accumulator:a}=e;return{context:t,state:n?{isDismissed:o=>n.dismissals.isDismissed(o),isCooldownActive:o=>n.cooldowns.isActive(o),getFrequencyCount:o=>n.frequency.count(o),getSessionMetric:o=>r?.get(o)??0}:void 0,events:i?{hasRecentEvent:(o,s)=>i.hasRecentEvent(o,s)}:void 0,accumulator:a?{getCount:(o,s)=>a.getCount(o,s)}:void 0}}async function o_(t,e,n={}){let i=Tk(e,n);switch(t.type){case"rules":return Zc(t,i);case"score":return Yc(t,i);case"model":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"model"}};case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"external"}};default:return console.warn("[DecisionEngine] Unknown strategy type:",t.type),{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function s_(t,e,n={}){let i=Tk(e,n);switch(t.type){case"rules":return Zc(t,i);case"score":return Yc(t,i);case"model":case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:t.type}};default:return{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function Hp(t){return{evaluate:(e,n)=>o_(e,n,t),evaluateSync:(e,n)=>s_(e,n,t)}}function Ip(t){let{eventBus:e,stateStore:n}=t,i=new Map,r=new Set,a=null,o=n.ns("accumulator");function s(c){let u=!1;for(let f of i.values()){if(!f.predicate(c))continue;let h=o.get(f.stateKey)||{count:0};h.count++,f.needsTimestamps&&(h.timestamps||(h.timestamps=[]),h.timestamps.push(c.ts),h.timestamps.length>200&&(h.timestamps=h.timestamps.slice(-200))),o.set(f.stateKey,h),u=!0}if(u)for(let f of r)try{f()}catch(h){console.error("[EventAccumulator] Subscriber error:",h)}}function l(){a||i.size===0||(a=e.subscribe(s))}return{register(c,u,f=!1){let h=`ev:${c}`,g=i.get(h);if(g){f&&!g.needsTimestamps&&(g.needsTimestamps=!0);return}i.set(h,{stateKey:h,needsTimestamps:f,predicate:u}),l()},getCount(c,u){let f=`ev:${c}`,h=o.get(f);if(!h)return 0;if(u===void 0||!h.timestamps)return h.count;let g=Date.now()-u;return h.timestamps.filter(_=>_>=g).length},subscribe(c){return r.add(c),()=>{r.delete(c)}},destroy(){a&&(a(),a=null),i.clear(),r.clear()}}}function l_(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(i=>{try{return new RegExp(i).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var Wc=class{constructor(e={}){V(this,"subscriptions",new Set);V(this,"history",[]);V(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,n){let i,r;typeof e=="function"?(i=void 0,r=e):(i=e,r=n);let a={filter:i,callback:r};return this.subscriptions.add(a),()=>{this.subscriptions.delete(a)}}publish(e,n,i="canvas"){let r={ts:Date.now(),name:e,source:i,props:n,schemaVersion:Na};this.publishEvent(r)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let n of this.subscriptions)if(l_(e,n.filter))try{n.callback(e)}catch(i){console.error("[EventBus] Subscriber error:",i)}}getRecent(e,n){let i=this.history;return e&&(i=i.filter(r=>l_(r,e))),n&&n>0&&(i=i.slice(-n)),i}hasRecentEvent(e,n,i){let r=Date.now()-n;return this.history.some(a=>a.name===e&&a.ts>=r&&(i===void 0||a.source===i))}countRecentEvents(e,n){let i=this.history.filter(r=>l_(r,e));if(n!==void 0){let r=Date.now()-n;i=i.filter(a=>a.ts>=r)}return i.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function zs(t={}){return new Wc(t)}var kk={$autocapture:"ui.click",$click:ye.UI_CLICK,$scroll:ye.UI_SCROLL,$input:ye.UI_INPUT,$change:ye.UI_CHANGE,$submit:ye.UI_SUBMIT,$pageview:ye.NAV_PAGE_VIEW,$pageleave:ye.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function d5(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(kk[e])return kk[e];if(e==="$autocapture"){let n=t.properties?.$tag_name,i=t.properties?.$event_type;return i==="submit"?ye.UI_SUBMIT:i==="change"?ye.UI_CHANGE:n==="input"||n==="textarea"?ye.UI_INPUT:ye.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function f5(t){let e={},n=t.properties||{},i=n.$elements;return n.$tag_name?e.tagName=n.$tag_name:i?.[0]?.tag_name&&(e.tagName=i[0].tag_name),n.$el_text&&(e.elementText=n.$el_text),i&&(e.elements=i),n.$current_url&&(e.url=n.$current_url),n.$pathname&&(e.pathname=n.$pathname),n.$host&&(e.host=n.$host),n.$viewport_width&&(e.viewportWidth=n.$viewport_width),n.$viewport_height&&(e.viewportHeight=n.$viewport_height),n.$session_id&&(e.sessionId=n.$session_id),n.$scroll_depth&&(e.scrollDepth=n.$scroll_depth),n.$scroll_percentage&&(e.scrollPercentage=n.$scroll_percentage),e.originalEvent=t.event,e}function c_(t){let e;return typeof t.timestamp=="number"?e=t.timestamp:typeof t.timestamp=="string"?e=new Date(t.timestamp).getTime():e=Date.now(),{ts:e,name:d5(t),source:"posthog",props:f5(t),schemaVersion:Na}}function u_(t){let e=t.event;return!(typeof e!="string"||["$feature_flag_called","$feature_flags","$groups","$groupidentify","$set","$set_once","$unset","$create_alias","$capture_metrics","$performance_event","$web_vitals","$exception","$dead_click","$heatmap"].includes(e))}function zp(t){return(e,n)=>{if(typeof e!="string")return;let i={event:e,properties:n,timestamp:Date.now()};if(u_(i)){let r=c_(i);t(r)}}}var d_=y.enum(["posthog","canvas","derived"]),Rk=y.object({ts:y.number(),name:y.string(),source:d_,props:y.record(y.string(),y.unknown()).optional(),schemaVersion:y.string()}),Ok=y.object({names:y.array(y.string()).optional(),patterns:y.array(y.string()).optional(),sources:y.array(d_).optional()});function p5(t){return Rk.safeParse(t)}function h5(t){return Ok.safeParse(t)}var Bs=class{constructor(){V(this,"listeners",new Set);V(this,"capturedPushState");V(this,"capturedReplaceState");V(this,"wasNative");V(this,"destroyed",!1);V(this,"onPopState",()=>{this.notify(window.location.href,"popstate")});this.wasNative=this.isNativeFunction(history.pushState),this.capturedPushState=history.pushState,this.capturedReplaceState=history.replaceState,history.pushState=(...e)=>{this.capturedPushState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"pushState"))},history.replaceState=(...e)=>{this.capturedReplaceState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"replaceState"))},window.addEventListener("popstate",this.onPopState)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}diagnose(){return{isNative:this.wasNative,subscriberCount:this.listeners.size}}destroy(){this.destroyed||(this.destroyed=!0,history.pushState=this.capturedPushState,history.replaceState=this.capturedReplaceState,window.removeEventListener("popstate",this.onPopState),this.listeners.clear())}notify(e,n){if(!this.destroyed)for(let i of this.listeners)try{i(e,n)}catch{}}isNativeFunction(e){try{return Function.prototype.toString.call(e).includes("[native code]")}catch{return!1}}};var f_="cooldown:";function Mk(t){return{set(e,n){let i=f_+e,r=Date.now()+n;t.set(i,r)},isActive(e){return this.remaining(e)>0},remaining(e){let n=f_+e,i=t.get(n);if(i===void 0)return 0;let r=i-Date.now();return r<=0?(t.remove(n),0):r},clear(e){let n=f_+e;t.remove(n)}}}var Kc="dismissed:";function Nk(t,e){return{mark(n,i=!1){let r=Kc+n;(i?e:t).set(r,!0)},isDismissed(n){let i=Kc+n;return t.has(i)||e.has(i)},clear(n){let i=Kc+n;t.remove(i),e.remove(i)},clearAll(){for(let n of t.keys())n.startsWith(Kc)&&t.remove(n);for(let n of e.keys())n.startsWith(Kc)&&e.remove(n)}}}var p_="freq:";function Dk(t){function e(n){let i=p_+n,r=t.get(i);if(r){if(r.resetAt&&Date.now()>=r.resetAt){t.remove(i);return}return r}}return{increment(n,i){let r=p_+n,a=e(n),o=(a?.count??0)+1,s={count:o,resetAt:a?.resetAt??(i?Date.now()+i:void 0)};return t.set(r,s),o},count(n){return e(n)?.count??0},reset(n){let i=p_+n;t.remove(i)},hasReachedLimit(n,i){return this.count(n)>=i}}}var g5="syntro";function h_(t,e){let n=`${e}:`;return{get(i){if(t)try{let r=t.getItem(n+i);if(!r)return;let a=JSON.parse(r);if(a.expiresAt&&Date.now()>=a.expiresAt){t.removeItem(n+i);return}return a.value}catch{return}},set(i,r,a){if(t)try{let o={value:r,expiresAt:a?Date.now()+a:void 0};t.setItem(n+i,JSON.stringify(o))}catch(o){console.warn("[StateStore] Failed to save:",o)}},remove(i){t&&t.removeItem(n+i)},has(i){return t?this.get(i)!==void 0:!1},keys(){if(!t)return[];let i=[];for(let r=0;r<t.length;r++){let a=t.key(r);a?.startsWith(n)&&i.push(a.slice(n.length))}return i},clear(){if(!t)return;let i=this.keys();for(let r of i)t.removeItem(n+r)}}}function g_(t){let e=new Map,n=`${t}:`;return{get(i){let r=e.get(n+i);if(r){if(r.expiresAt&&Date.now()>=r.expiresAt){e.delete(n+i);return}return r.value}},set(i,r,a){e.set(n+i,{value:r,expiresAt:a?Date.now()+a:void 0})},remove(i){e.delete(n+i)},has(i){return this.get(i)!==void 0},keys(){let i=[];for(let r of e.keys())r.startsWith(n)&&i.push(r.slice(n.length));return i},clear(){for(let i of e.keys())i.startsWith(n)&&e.delete(i)}}}var Xc=class{constructor(e={}){V(this,"session");V(this,"user");V(this,"dismissals");V(this,"cooldowns");V(this,"frequency");V(this,"namespace");V(this,"namespacedStorages",new Map);this.namespace=e.namespace??g5,typeof window<"u"?(this.session=h_(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=h_(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=g_(this.namespace),this.user=g_(this.namespace)),this.dismissals=Nk(this.session,this.user),this.cooldowns=Mk(this.user),this.frequency=Dk(this.session)}ns(e){let n=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(n)){let i=typeof window<"u"&&typeof sessionStorage<"u"?h_(sessionStorage,n):g_(n);this.namespacedStorages.set(n,i)}return this.namespacedStorages.get(n)}};function Bp(t={}){return new Xc(t)}function $s(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function Qc(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var m_={drawer_right:{position:"fixed",top:"0",right:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_left:{position:"fixed",top:"0",left:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_bottom:{position:"fixed",left:"0",right:"0",bottom:"0",maxHeight:"50vh"},overlay_center:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxWidth:"90vw",maxHeight:"90vh"},overlay_corner_br:{position:"fixed",bottom:"16px",right:"16px",maxWidth:"400px",maxHeight:"80vh"},overlay_corner_bl:{position:"fixed",bottom:"16px",left:"16px",maxWidth:"400px",maxHeight:"80vh"},toast_top:{position:"fixed",top:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"},toast_bottom:{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"}},Fs={fade:[{opacity:0},{opacity:1}],slide:[{opacity:0,transform:"translateY(10px)"},{opacity:1,transform:"translateY(0)"}],scale:[{opacity:0,transform:"scale(0.95)"},{opacity:1,transform:"scale(1)"}],none:[]},Lk={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function $p(t,e,n){let i=m_[e];Object.assign(t.style,i),n&&(n.maxWidth&&(t.style.maxWidth=n.maxWidth),n.maxHeight&&(t.style.maxHeight=n.maxHeight),n.minWidth&&(t.style.minWidth=n.minWidth),n.minHeight&&(t.style.minHeight=n.minHeight))}function Fp(t,e,n){let i=n.placement==="auto"?"bottom":n.placement,r=[Vd(n.offset?{mainAxis:n.offset.y,crossAxis:n.offset.x}:8)];return n.flip!==!1&&r.push(qd()),n.shift!==!1&&r.push(jd({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",Ud(e,t,async()=>{let{x:o,y:s,strategy:l}=await Pd(e,t,{placement:i,middleware:r});Object.assign(t.style,{position:l,left:`${o}px`,top:`${s}px`})})}function Up(t,e,n="append"){return t.style.position="relative",t.style.display="inline-block",n==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function Vp(t,e){return e==="none"||Fs[e].length===0?null:t.animate(Fs[e],Lk)}function jp(t,e){if(e==="none"||Fs[e].length===0)return Promise.resolve();let n=[...Fs[e]].reverse(),i=t.animate(n,Lk);return new Promise(r=>{i.onfinish=()=>r(),i.oncancel=()=>r()})}function qp(t,e){let n=document.createElement("div");return n.setAttribute("data-syntro-surface",t),n.setAttribute("data-syntro-mount-id",e),n.className="syntro-surface",Object.assign(n.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),n}function Pp(t){switch($s(t)){case"static":return t.startsWith("drawer")?2147483640:t.startsWith("overlay")?2147483642:t.startsWith("toast")?2147483644:2147483640;case"inline":return 1;case"adjacent":return 2147483638;default:return 2147483640}}function Hk(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),c=document.createElement("div");return c.append(l),c.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),a=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]),o=[];for(;r.nextNode();){let s=r.currentNode,l=s.tagName.toLowerCase();if(!a.has(l)){o.push(s);continue}for(let c of Array.from(s.attributes)){let u=c.name.toLowerCase(),f=c.value.trim().toLowerCase(),h=u.startsWith("on"),g=(u==="href"||u==="src")&&f.startsWith("javascript:");(h||g)&&s.removeAttribute(c.name)}}for(let s of o){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML=(i.firstChild,n.innerHTML)}var m5=0;function Gp(t){let{overlayRoot:e,eventBus:n,anchorResolver:i,defaultAnimation:r="fade",widgetRegistry:a}=t,o=new Map,s=new Map,l=new Map;function c(){return`mount-${++m5}`}function u(v,S){n&&n.publish(v,S)}function f(v){let S=l.get(v);if(S){let T=w(v);for(let A of S)try{A(T)}catch(k){console.error("[Surfaces] State callback error:",k)}}}let h=new Map;function g(v,S,T){switch(S.type){case"html":v.innerHTML=Hk(S.content);return;case"widget":{if(a?.has(S.widgetId)){let A=a.mount(S.widgetId,v,S.config);return T&&h.set(T,A),()=>{A.unmount(),T&&h.delete(T)}}console.warn(`[Surfaces] Widget not found: ${S.widgetId}`),v.innerHTML=`<div data-widget-id="${S.widgetId}" data-widget-missing="true">Widget: ${S.widgetId}</div>`;return}case"custom":return S.mount(v);case"react":v.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function _(v,S,T){let A=c(),k=$s(v),C=T?.priority??0,x=T?.animation??r,M=T?.exclusive??!0,z=o.get(v);if(z&&M){if(z.options.priority>C)throw new Error(`Slot ${v} is occupied by higher priority content (${z.options.priority} > ${C})`);b(z)}let U=qp(v,A);U.style.zIndex=String(Pp(v));let P;if(k==="static")$p(U,v,T?.constraints),e.appendChild(U);else if(k==="inline"){let D=Qc(v);if(!D)throw new Error(`Invalid inline slot: ${v}`);if(!i)throw new Error("Anchor resolver required for inline slots");let L=i(D);if(!L)throw new Error(`Anchor not found for inline slot: ${D}`);P=Up(U,L)}else if(k==="adjacent"){let D=Qc(v);if(!D)throw new Error(`Invalid adjacent slot: ${v}`);if(!i)throw new Error("Anchor resolver required for adjacent slots");let L=i(D);if(!L)throw new Error(`Anchor not found for adjacent slot: ${D}`);e.appendChild(U),P=Fp(U,L,T?.position??{placement:"bottom"})}let Z=g(U,S,A);Vp(U,x);let X={id:A,slot:v,content:S,options:{priority:C,exclusive:M,animation:x,position:T?.position??{placement:"auto"},constraints:T?.constraints??{},adaptiveId:T?.adaptiveId,autoUnmountOnRouteChange:T?.autoUnmountOnRouteChange??!0},container:U,cleanup:()=>{P?.(),Z?.()},mountedAt:Date.now()};return o.set(v,X),s.set(v,(s.get(v)??0)+1),u("surface.mounted",{slot:v,id:A,adaptiveId:T?.adaptiveId}),f(v),{id:A,update(D){let L=o.get(v);if(!L||L.id!==A)throw new Error("Mount no longer active");let de=h.get(A);if(de){if(D.type==="widget"){de.update(D.config),L.content=D;return}de.unmount(),h.delete(A)}L.container.innerHTML="";let fn=g(L.container,D,A);if(L.content=D,fn){let We=L.cleanup;L.cleanup=()=>{We?.(),fn()}}},setOptions(D){let L=o.get(v);if(!L||L.id!==A)throw new Error("Mount no longer active");D.priority!==void 0&&(L.options.priority=D.priority),D.animation!==void 0&&(L.options.animation=D.animation),D.constraints&&k==="static"&&(D.constraints.maxWidth&&(L.container.style.maxWidth=D.constraints.maxWidth),D.constraints.maxHeight&&(L.container.style.maxHeight=D.constraints.maxHeight),D.constraints.minWidth&&(L.container.style.minWidth=D.constraints.minWidth),D.constraints.minHeight&&(L.container.style.minHeight=D.constraints.minHeight)),f(v)},async unmount(){let D=o.get(v);!D||D.id!==A||await b(D)},isMounted(){return o.get(v)?.id===A},getContainer(){let D=o.get(v);return D?.id===A?D.container:null}}}async function b(v){await jp(v.container,v.options.animation),v.cleanup?.(),v.container.remove(),o.delete(v.slot),u("surface.unmounted",{slot:v.slot,id:v.id}),f(v.slot)}function w(v){let S=o.get(v);return{slot:v,occupied:!!S,currentPriority:S?.options.priority,currentAdaptiveId:S?.options.adaptiveId,mountCount:s.get(v)??0,currentMountId:S?.id}}function d(v,S){let T=l.get(v);return T||(T=new Set,l.set(v,T)),T.add(S),()=>{T?.delete(S),T?.size===0&&l.delete(v)}}function p(v,S){let T=o.get(v);return T?S!==void 0?S>=T.options.priority:!1:!0}function m(){for(let v of o.values())try{v.cleanup?.(),v.container.remove()}catch(S){console.error("[Surfaces] Error during cleanup:",S)}o.clear(),l.clear()}return{mount:_,getState:w,onStateChange:d,canMount:p,destroy:m}}var Jc=class{constructor(){V(this,"widgets",new Map);V(this,"mountedWidgets",new Map);V(this,"mountIdCounter",0);V(this,"runtimeRef");V(this,"listeners",new Set)}bindRuntime(e){this.runtimeRef=e}register(e,n,i="custom",r){if(this.widgets.has(e)){if(this.widgets.get(e).source==="built-in")throw new Error(`Cannot override built-in widget: ${e}`);console.warn(`[WidgetRegistry] Overriding widget: ${e}`)}this.widgets.set(e,{id:e,widget:n,source:i,metadata:r}),this.notify({type:"registered",widgetId:e})}unregister(e){let n=this.widgets.get(e);return n?n.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),this.notify({type:"unregistered",widgetId:e}),!0):!1}unregisterBySource(e){for(let[n,i]of this.widgets.entries())i.source===e&&this.widgets.delete(n)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,n,i){let r=this.widgets.get(e);if(!r)throw new Error(`Widget not found: ${e}`);let a=`widget-mount-${++this.mountIdCounter}`;n.setAttribute("data-widget-mount-id",a),n.setAttribute("data-widget-id",e);let o={...i,runtime:this.runtimeRef},s=r.widget.mount(n,o);return this.mountedWidgets.set(a,{cleanup:s??void 0,container:n}),{widgetId:e,container:n,unmount:()=>{let c=this.mountedWidgets.get(a);c&&(c.cleanup?.(),this.mountedWidgets.delete(a),n.removeAttribute("data-widget-mount-id"),n.removeAttribute("data-widget-id"),n.innerHTML="")},update:c=>{if(r.widget.update)r.widget.update(n,c);else{let u=this.mountedWidgets.get(a);if(u){u.cleanup?.(),n.innerHTML="";let f={...c,runtime:this.runtimeRef},h=r.widget.mount(n,f);u.cleanup=h??void 0}}}}}list(){return Array.from(this.widgets.keys())}listRegistrations(){return Array.from(this.widgets.values())}getBySource(e){return Array.from(this.widgets.values()).filter(n=>n.source===e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){for(let n of this.listeners)try{n(e)}catch(i){console.error("[WidgetRegistry] Listener error:",i)}}destroy(){for(let[e,n]of this.mountedWidgets.entries())n.cleanup?.(),n.container.innerHTML="";this.mountedWidgets.clear()}},Zp=new Jc;var v_="2.0.0";function v5(t,e){if(!e)return!0;let n;try{n=new URL(t).pathname}catch{n=t}let i=n.replace(/\/$/,"")||"/";if(e.exclude){for(let r of e.exclude)if(Ik(i,r))return!1}if(e.include&&e.include.length>0){for(let r of e.include)if(Ik(i,r))return!0;return!1}return!0}function Ik(t,e){let n=e.replace(/\/$/,"")||"/";if(t===n)return!0;let i=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${i}$`).test(t)}function y5(t){try{return document.querySelector(t)}catch{return null}}function Yp(t={}){let{telemetry:e,sessionMetrics:n,routes:i,mode:r="production",namespace:a}=t,o=t.widgets??Zp,s=t.executors??pi,l=t.apps??ts,c=new Bs,u=Lp({telemetry:e,routes:i,navigation:c}),f=t.events??zs(),h=Bp({namespace:a}),g=Ip({eventBus:f,stateStore:h}),_=Hp({state:h,events:f,sessionMetrics:n,accumulator:g}),b=UE(),w=v=>y5(v),d=Gp({overlayRoot:b,eventBus:f,anchorResolver:w,widgetRegistry:o}),p=Op({overlayRoot:b,eventBus:f,surfaces:d,anchorResolver:w,executorRegistry:s,subscribeNavigation:v=>c.subscribe(v)}),m={telemetry:e,context:u,events:f,state:h,sessionMetrics:n,actions:p,surfaces:d,widgets:o,executors:s,apps:l,accumulator:g,navigation:c,version:v_,mode:r,async evaluate(v){return _.evaluate(v,u.get())},evaluateSync(v){return _.evaluateSync(v,u.get())},async filterTiles(v){let S=u.get().page.url,T=[];for(let A of v){let k=A.activation;if(!k){T.push(A);continue}if(!v5(S,k.routes))continue;if(!k.strategy){T.push(A);continue}(await this.evaluate(k.strategy)).value&&T.push(A)}return T},setRoutes(v){u.setRoutes(v)},destroy(){l.unbind().catch(v=>{console.error("[Runtime] Error unbinding apps registry:",v)}),g.destroy(),c.destroy(),u.destroy(),p.destroy(),d.destroy()}};return l.bind(m),o.bindRuntime(m),m}var zk=y.object({value:y.unknown(),expiresAt:y.number().optional()}),Bk=y.object({count:y.number(),resetAt:y.number().optional()});function b5(t){return zk.safeParse(t)}function _5(t){return Bk.safeParse(t)}var $k={growthbook:t=>If({...t,autoInit:!0})};function Fk(t,e){let n=$k[t];if(!n)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys($k).join(", ")}`);return n(e)}var S5=["cdn.syntrologie.com","localhost","127.0.0.1"];function x5(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):S5.some(r=>e.hostname===r)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var y_=class{constructor(e){V(this,"name","cdn");V(this,"url");V(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!x5(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),n=await fetch(this.url,{credentials:"omit",cache:"default"});if(!n.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${n.status})`);let i=await n.text();if(this.integrity){let l=await w5(i),c=this.integrity.replace("sha384-","");if(l!==c)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${c}, got ${l}`)}let r=JSON.parse(i),a=performance.now()-e,o=n.headers.get("cache-control"),s=n.headers.get("age");return{config:r,meta:{source:"cdn",fetchTimeMs:a,cached:o?.includes("public")??!1,cacheAge:s?parseInt(s,10):void 0}}}};async function w5(t){let n=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-384",n),r=new Uint8Array(i);return btoa(String.fromCharCode(...r))}function Uk(t){return new y_(t)}var E5="syntro_exp",C5="syntro_var",b_=class{constructor(e){V(this,"name","experiments");V(this,"client");V(this,"featureKey");V(this,"manifestKey");V(this,"variantFlagPrefix");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config",this.manifestKey=e.manifestKey,this.variantFlagPrefix=e.variantFlagPrefix}async fetch(){let e=performance.now();if(typeof window<"u"){let r=new URLSearchParams(window.location.search),a=r.get(E5),o=r.get(C5);if(a&&o!==null&&this.client.setForcedVariations){let s=parseInt(o,10);Number.isNaN(s)||(console.log(`[SmartCanvas] Preview mode: forcing "${a}" to variation ${s}`),this.client.setForcedVariations({[a]:s}))}}if(this.manifestKey||this.variantFlagPrefix){let r=this.fetchMultiFlag();if(r){let a=performance.now()-e;return{config:r,meta:{source:"experiments",fetchTimeMs:a,cached:!0}}}}let n=this.client.getFeatureValue?.(this.featureKey,null);if(!n||typeof n!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let i=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:i,cached:!0}}}fetchMultiFlag(){let e=this.getVariantFlagKeys();return!e||e.length===0?null:ef(this.client,e)}getVariantFlagKeys(){if(this.manifestKey){let e=this.client.getFeatureValue?.(this.manifestKey,null);if(e&&typeof e=="object"){let n=e.variant_flags;if(n&&n.length>0)return n}}if(this.variantFlagPrefix&&this.client.getAllFeatures){let e=this.client.getAllFeatures();return Object.keys(e).filter(n=>n.startsWith(this.variantFlagPrefix))}return[]}};function Vk(t){return new b_(t)}var A5="https://cdn.syntrologie.com/configs",jk={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return Uk({baseUrl:t.baseUrl??A5,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return Vk({featureKey:t.featureKey})}};function qk(t,e={}){let n=jk[t];if(!n)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(jk).join(", ")}`);return n(e)}var Pk={posthog:t=>Ap(t),noop:()=>Pf()};function Gk(t,e){let n=Pk[t];if(!n)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(Pk).join(", ")}`);return n(e)}var __="syn_";function eu(t){if(!t.startsWith(__))throw new Error("Invalid Syntro token: must start with 'syn_'");let n=t.slice(__.length).replace(/-/g,"+").replace(/_/g,"/"),i=atob(n),r=JSON.parse(i);if(r.v!==1)throw new Error(`Unsupported token version: ${r.v}`);return r}function Wp(t){let e=JSON.stringify(t),n=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return __+n}function er(t){if(typeof process<"u"&&process.env)return process.env[t];try{let e=(0,eval)("import.meta");if(e?.env)return e.env[t]}catch{}}function T5(){if(typeof window>"u")return G("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=Ma(),n=!!(Lr()?.token&&t?.mode==="editor");return G("Syntro Bootstrap","isEditorMode:",n),n}function k5(){if(typeof window>"u")return G("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=Ma(),n=!!(Lr()?.token&&t?.mode==="audit");return G("Syntro Bootstrap","isAuditMode:",n),n}function R5(){if(typeof window>"u")return G("Syntro Bootstrap","isReviewMode: not in browser"),!1;let t=Ma(),n=!!(Lr()?.token&&t?.mode==="review");return G("Syntro Bootstrap","isReviewMode:",n),n}var Zk="syntro_segment_attributes";function O5(){if(typeof window>"u")return{};try{let t=localStorage.getItem(Zk);if(t){let e=JSON.parse(t);return G("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){cn("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function M5(t){if(!(typeof window>"u"))try{localStorage.setItem(Zk,JSON.stringify(t)),G("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){cn("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function N5(t){if(!t)return{};let e={};for(let[n,i]of Object.entries(t))n.startsWith("in_segment_")&&(e[n]=i===!0);return e}async function D5(t){Jm(),G("Syntro Bootstrap","====== INIT ======"),G("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=T5(),n=k5(),i=R5(),r=e?"editor":n?"audit":i?"review":null;if(console.log(`[DIAG] Mode detection: editor=${e}, audit=${n}, review=${i}, sdkMode=${r}`),console.log("[DIAG] editorSource:",Lr()),console.log("[DIAG] editorConf:",Ma()),G("Syntro Bootstrap","SDK mode:",r??"normal"),!r&&typeof window<"u"){let x=!!window.__SYNTRO_EDITOR_PARAMS__,M=!!window.__SYNTRO_AUDIT_LEGEND__,z=!!window.__SYNTRO_REVIEW_DATA__;if(x||M||z){let U=[x&&"__SYNTRO_EDITOR_PARAMS__",M&&"__SYNTRO_AUDIT_LEGEND__",z&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${U.join(", ")}. This suggests URL params were lost (redirect?) but the service worker injected mode data. Check if replaceState failed or if page JS changed the URL before init().`)}}console.log(`[DIAG] Token resolution: options.token=${t.token?t.token.slice(0,15)+"...":"null"}`);let a=t.token;if(!a&&r){let M=Ma()?.syntro_token;M?.startsWith("syn_")&&(a=M,G("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${r} mode)`))}let o;if(a)if(a.startsWith("syn_"))G("Syntro Bootstrap","Token starts with syn_, decoding..."),o=eu(a),Jm(o.d);else if(r)G("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${r} mode)`);else throw tf("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),tf("Syntro Bootstrap","Token received:",a),new Error("Invalid Syntro token: must start with 'syn_'");else if(r)G("Syntro Bootstrap",`\u2713 No token, but ${r} mode - proceeding`);else throw tf("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit/review mode!"),new Error("Syntro token is required (unless in editor, audit, or review mode)");let s=er("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||er("VITE_SYNTRO_EXPERIMENT_HOST")||o?.eh,l=er("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||er("VITE_SYNTRO_TELEMETRY_HOST")||o?.th,c=er("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||er("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,u=O5();G("Syntro Bootstrap","Phase 1: Using cached segment attributes:",u);let f,h=zs();console.log("[Syntro Bootstrap] EventBus created");let g=zp(x=>{h.publishEvent(x)}),_=x=>{G("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let M=N5(x);if(G("Syntro Bootstrap","Segment flags from PostHog:",M),M5(M),f){let U={...w?.getAll?.()??{},...M};G("Syntro Bootstrap","Updating GrowthBook with attributes:",U),f.setAttributes?.(U)}},b;if(o?.t){let x=o.t==="noop"?"noop":"posthog";b=Gk(x,{apiKey:o.t,apiHost:l,enableFeatureFlags:!0,onFeatureFlagsLoaded:_,onCapture:g}),console.log(`[Syntro Bootstrap] Telemetry client created (${x}) with EventBus wiring`)}let w;o?.e&&(f=Fk("growthbook",{clientKey:o.e,apiHost:s,attributes:u,onExperimentViewed:b?.trackExperiment?(x,M,z)=>{b.trackExperiment(x,M,z)}:void 0})),t.enableSessionMetrics&&(w=zf({experiments:f,onMetricChange:(x,M)=>{G("Syntro Bootstrap",`Session metric changed: ${x} = ${M}`)}}),G("Syntro Bootstrap","SessionMetricTracker created"));let d="production";e?d="editor":n?d="audit":er("NODE_ENV")==="development"&&(d="development");let p=Yp({telemetry:b,sessionMetrics:w,mode:d,events:h});G("Syntro Bootstrap","Runtime created:",{version:p.version,mode:p.mode,hasContext:!!p.context,hasEvents:!!p.events,hasState:!!p.state}),G("Syntro Bootstrap","Core app executors already registered");let m=t.cdnBase||er("NEXT_PUBLIC_SYNTRO_CDN_BASE")||er("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",v=Kd({cdnBase:m,registry:p.apps,onLoadStart:x=>{G("Syntro Bootstrap",`Loading app from CDN: ${x}`)},onLoadEnd:(x,M,z)=>{M?G("Syntro Bootstrap",`App loaded successfully: ${x}`):cn("Syntro Bootstrap",`Failed to load app: ${x}`,z)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:p.apps,runtime:p,version:p.version},G("Syntro Bootstrap","Global SynOS object exposed"));let S=p.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${S.length} apps in registry:`,S.map(x=>`${x.manifest.id}(${x.state})`).join(", "));for(let x of S)if(x.state==="registered")try{await p.apps.activate(x.manifest.id),console.log(`[DIAG] Activated: ${x.manifest.id} \u2192 widgets: [${p.widgets.list().join(", ")}]`)}catch(M){console.error(`[DIAG] FAILED to activate: ${x.manifest.id}`,M),cn("Syntro Bootstrap",`Failed to auto-activate built-in app: ${x.manifest.id}`,M)}if(console.log(`[DIAG] Activation complete. Total widgets: [${p.widgets.list().join(", ")}]`),f?.refreshFeatures)try{await f.refreshFeatures(),G("Syntro Bootstrap","GrowthBook features loaded")}catch(x){cn("Syntro Bootstrap","Failed to load GrowthBook features:",x)}let T;if(t.fetcher)T=t.fetcher;else if(o?.f){let x=qk(o.f,o.o??{});T=async()=>{let M=await x.fetch();return{...M.config,tiles:M.config.tiles??[]}}}else f&&(T=Oa({experiments:f}));let A=new Set,k=T?async()=>{let x=await T();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${x.tiles?.length??0},`,`actions=${x.actions?.length??0},`,`theme=${x.theme?.name??"none"}`),x.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",x.actions.map((U,P)=>`[${P}] ${U.kind}${U.anchorId?` anchor="${U.anchorId}"`:""}${U.label?` "${U.label}"`:""}`).join(", "));let M=x,z=v.getRequiredApps(M);return z.length>0?console.log("[Syntro Bootstrap] Required external apps:",z.join(", ")):G("Syntro Bootstrap","No external apps required (all executors are built-in)"),z.length>0&&await v.loadAppsForConfig(M).then(async P=>{let Z=P.filter(D=>D.success),X=P.filter(D=>!D.success);Z.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${Z.map(D=>D.appId).join(", ")}`);let W=X.filter(D=>!A.has(D.appId));W.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",W.map(D=>`${D.appId} (${D.error})`).join(", ")),W.forEach(D=>A.add(D.appId)));for(let D of z)if(p.apps.has(D))try{await p.apps.activate(D),console.log(`[Syntro Bootstrap] App activated: ${D}`)}catch(L){console.error(`[Syntro Bootstrap] Failed to activate app: ${D}`,L)}else console.error(`[Syntro Bootstrap] App "${D}" required by config but NOT registered.`,`Available apps: [${Array.from(p.apps.list?.()??[]).join(", ")}]`)}),x}:void 0;return{canvas:await yf({...t.canvas,fetcher:k,integrations:{experiments:f,telemetry:b},editorUrl:c,runtime:p}),runtime:p,experiments:f,telemetry:b,sessionMetrics:w,appLoader:v}}var S_={init:D5,encodeToken:Wp,decodeToken:eu};typeof window<"u"&&(window.Syntro=S_);var x_="2026-02-26T22:38:37.348Z (38fdc4fa1)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${x_}`);let t=window.SynOS,e=t?.appRegistry||ts;window.SynOS={...t,appRegistry:e,_runtimeBuild:x_,React:Yk.default,ReactDOM:{...L5,createPortal:Kp.createPortal,flushSync:Kp.flushSync}},RE(e)}return aR(H5);})();
|
|
462
|
+
`)).length,n=0;n<r;n++){var i=t.charCodeAt(n),s=null;i<128?a++:s=i>127&&i<2048?String.fromCharCode(i>>6|192,63&i|128):String.fromCharCode(i>>12|224,i>>6&63|128,63&i|128),sn(s)||(a>e&&(o+=t.substring(e,a)),o+=s,e=a=n+1)}return a>e&&(o+=t.substring(e,t.length)),o},JN=!!Zy||!!Wy,XA="text/plain",jp=function(t,e,a){var r;a===void 0&&(a=!0);var[n,o]=t.split("?"),i=G({},e),s=(r=o?.split("&").map((u=>{var c,[d,p]=u.split("="),g=a&&(c=i[d])!==null&&c!==void 0?c:p;return delete i[d],d+"="+g})))!==null&&r!==void 0?r:[],l=gN(i);return l&&s.push(l),n+"?"+s.join("&")},Qu=(t,e)=>JSON.stringify(t,((a,r)=>typeof r=="bigint"?r.toString():r),e),zy=t=>{var{data:e,compression:a}=t;if(e){if(a===on.GZipJS){var r=KN((function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new Pa(l.length+(l.length>>>1)),p=0,g=function(f){d[p++]=f},S=0;S<c;++S){if(p+5>d.length){var b=new Pa(p+8+(c-S<<1));b.set(d),d=b}var x=l.charCodeAt(S);x<128||u?g(x):x<2048?(g(192|x>>>6),g(128|63&x)):x>55295&&x<57344?(g(240|(x=65536+(1047552&x)|1023&l.charCodeAt(++S))>>>18),g(128|x>>>12&63),g(128|x>>>6&63),g(128|63&x)):(g(224|x>>>12),g(128|x>>>6&63),g(128|63&x))}return lE(d,0,p)})(Qu(e)),{mtime:0}),n=new Blob([r],{type:XA});return{contentType:XA,body:n,estimatedSize:n.size}}if(a===on.Base64){var o=(function(l){var u,c,d,p,g,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b=0,x=0,f="",m=[];if(!l)return l;l=QN(l);do u=(g=l.charCodeAt(b++)<<16|l.charCodeAt(b++)<<8|l.charCodeAt(b++))>>18&63,c=g>>12&63,d=g>>6&63,p=63&g,m[x++]=S.charAt(u)+S.charAt(c)+S.charAt(d)+S.charAt(p);while(b<l.length);switch(f=m.join(""),l.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"="}return f})(Qu(e)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Qu(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=Qu(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},kp=[];Wy&&kp.push({transport:"fetch",method:t=>{var e,a,{contentType:r,body:n,estimatedSize:o}=(e=zy(t))!==null&&e!==void 0?e:{},i=new Headers;De(t.headers,(function(c,d){i.append(d,c)})),r&&i.append("Content-Type",r);var s=t.url,l=null;if(mA){var u=new mA;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),t.timeout)}}Wy(s,G({method:t?.method||"GET",headers:i,keepalive:t.method==="POST"&&(o||0)<52428.8,body:n,signal:(a=l)==null?void 0:a.signal},t.fetchOptions)).then((c=>c.text().then((d=>{var p={statusCode:c.status,text:d};if(c.status===200)try{p.json=JSON.parse(d)}catch(g){z.error(g)}t.callback==null||t.callback(p)})))).catch((c=>{z.error(c),t.callback==null||t.callback({statusCode:0,text:c})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Zy&&kp.push({transport:"XHR",method:t=>{var e,a=new Zy;a.open(t.method||"GET",t.url,!0);var{contentType:r,body:n}=(e=zy(t))!==null&&e!==void 0?e:{};De(t.headers,(function(o,i){a.setRequestHeader(i,o)})),r&&a.setRequestHeader("Content-Type",r),t.timeout&&(a.timeout=t.timeout),t.disableXHRCredentials||(a.withCredentials=!0),a.onreadystatechange=()=>{if(a.readyState===4){var o={statusCode:a.status,text:a.responseText};if(a.status===200)try{o.json=JSON.parse(a.responseText)}catch{}t.callback==null||t.callback(o)}},a.send(n)}}),va!=null&&va.sendBeacon&&kp.push({transport:"sendBeacon",method:t=>{var e=jp(t.url,{beacon:"1"});try{var a,{contentType:r,body:n}=(a=zy(t))!==null&&a!==void 0?a:{},o=typeof n=="string"?new Blob([n],{type:r}):n;va.sendBeacon(e,o)}catch{}}});var Gp=function(t,e){if(!(function(a){try{new RegExp(a)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function YA(t,e,a){return Qu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:a})}var uE={exact:(t,e)=>e.some((a=>t.some((r=>a===r)))),is_not:(t,e)=>e.every((a=>t.every((r=>a!==r)))),regex:(t,e)=>e.some((a=>t.some((r=>Gp(a,r))))),not_regex:(t,e)=>e.every((a=>t.every((r=>!Gp(a,r))))),icontains:(t,e)=>e.map(Ip).some((a=>t.map(Ip).some((r=>a.includes(r))))),not_icontains:(t,e)=>e.map(Ip).every((a=>t.map(Ip).every((r=>!a.includes(r)))))},Ip=t=>t.toLowerCase();function cE(t,e){return!t||Object.entries(t).every((a=>{var[r,n]=a,o=e?.[r];if(H(o)||sn(o))return!1;var i=[String(o)],s=uE[n.operator];return!!s&&s(n.values,i)}))}var Vy=ct("[Error tracking]"),Px=class{constructor(e){var a,r;this.Jt=[],this.Kt=new Jy([new tx,new lx,new rx,new ax,new ix,new ox,new nx,new sx],QF("web:javascript",ZF,KF)),this._instance=e,this.Jt=(a=(r=this._instance.persistence)==null?void 0:r.get_property(cx))!==null&&a!==void 0?a:[]}onRemoteConfig(e){var a,r,n,o=(a=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&a!==void 0?a:[],i=(n=e.errorTracking)==null?void 0:n.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[cx]:this.Jt,[IA]:i})}get Yt(){var e,a=!!this._instance.get_property(IA),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??a)!==null&&e!==void 0&&e}buildProperties(e,a){return this.Kt.buildFromUnknown(e,{syntheticException:a?.syntheticException,mechanism:{handled:a?.handled}})}sendExceptionEvent(e){var a=e.$exception_list;if(this.Xt(a)){if(this.Qt(a))return void Vy.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(a))return void Vy.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(a))return void Vy.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var a=e.reduce(((r,n)=>{var{type:o,value:i}=n;return ut(o)&&o.length>0&&r.$exception_types.push(o),ut(i)&&i.length>0&&r.$exception_values.push(i),r}),{$exception_types:[],$exception_values:[]});return this.Jt.some((r=>{var n=r.values.map((o=>{var i,s=uE[o.operator],l=Te(o.value)?o.value:[o.value],u=(i=a[o.key])!==null&&i!==void 0?i:[];return l.length>0&&s(l,u)}));return r.type==="OR"?n.some(Boolean):n.every(Boolean)}))}Zt(e){return e.flatMap((a=>{var r,n;return(r=(n=a.stacktrace)==null?void 0:n.frames)!==null&&r!==void 0?r:[]})).some((a=>a.filename&&a.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var a,r,n,o,i=(a=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&a!==void 0?a:[],s=i[i.length-1];return(n=s==null||(o=s.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&n!==void 0&&n}return!1}Xt(e){return!Ie(e)&&Te(e)}},er=ct("[FeatureFlags]"),Vu=ct("[FeatureFlags]",{debugEnabled:!0}),$y="$active_feature_flags",Bs="$override_feature_flags",KA="$feature_flag_payloads",$u="$override_feature_flag_payloads",QA="$feature_flag_request_id",JA="$feature_flag_evaluated_at",ek=t=>{var e={};for(var[a,r]of Ap(t||{}))r&&(e[a]=r);return e},eP=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((a=>{var r;return[a,(r=e[a].variant)!==null&&r!==void 0?r:e[a].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((a=>e[a].enabled)).filter((a=>{var r;return(r=e[a].metadata)==null?void 0:r.payload})).map((a=>{var r;return[a,(r=e[a].metadata)==null?void 0:r.payload]})))):er.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},tP=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),Hx=class{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((a=>{var r=a&&typeof a=="string"&&a.trim().length>0;return r||er.error("Invalid evaluation environment found:",a,"Expected non-empty string"),r})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.vi({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(dx),a=this._instance.get_property(Bs),r=this._instance.get_property($u);if(!r&&!a)return e||{};var n=Je({},e||{}),o=[...new Set([...Object.keys(r||{}),...Object.keys(a||{})])];for(var i of o){var s,l,u=n[i],c=a?.[i],d=H(c)?(s=u?.enabled)!==null&&s!==void 0&&s:!!c,p=H(c)?u.variant:typeof c=="string"?c:void 0,g=r?.[i],S=G({},u,{enabled:d,variant:d?p??u?.variant:void 0});d!==u?.enabled&&(S.original_enabled=u?.enabled),p!==u?.variant&&(S.original_variant=u?.variant),g&&(S.metadata=G({},u?.metadata,{payload:g,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),n[i]=S}return this.ii||(er.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:n}),this.ii=!0),n}getFlagVariants(){var e=this._instance.get_property(Hs),a=this._instance.get_property(Bs);if(!a)return e||{};for(var r=Je({},e),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.ii||(er.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:a,finalFlags:r}),this.ii=!0),r}getFlagPayloads(){var e=this._instance.get_property(KA),a=this._instance.get_property($u);if(!a)return e||{};for(var r=Je({},e||{}),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.ii||(er.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:a,finalPayloads:r}),this.ii=!0),r}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.vi()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}vi(e){var a;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var r={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:G({},((a=this._instance.persistence)==null?void 0:a.get_initial_props())||{},this._instance.get_property(Yu)||{}),group_properties:this._instance.get_property(pi)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.ui()&&(r.evaluation_environments=this.li());var n=this._instance.config.__preview_remote_config,o=n?"/flags/?v=2":"/flags/?v=2&config=true",i=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("flags",o+i);n&&(r.timezone=nE()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:r,compression:this._instance.config.disable_compression?void 0:on.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,c,d=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),d=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((c=l.json)!==null&&c!==void 0?c:{})),!r.disable_flags||this.ni)if(this.ai=!d,l.json&&(u=l.json.quotaLimited)!=null&&u.includes(tP.FeatureFlags))er.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var p;r.disable_flags||this.receivedFeatureFlags((p=l.json)!==null&&p!==void 0?p:{},d),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,a){if(a===void 0&&(a={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],n=""+r,o=this._instance.get_property(QA)||void 0,i=this._instance.get_property(JA)||void 0,s=this._instance.get_property(Dp)||{};if((a.send_event||!("send_event"in a))&&(!(e in s)||!s[e].includes(n))){var l,u,c,d,p,g,S,b,x;Te(s[e])?s[e].push(n):s[e]=[n],(l=this._instance.persistence)==null||l.register({[Dp]:s});var f=this.getFeatureFlagDetails(e),m={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:i,$feature_flag_bootstrapped_response:((u=this._instance.config.bootstrap)==null||(u=u.featureFlags)==null?void 0:u[e])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[e])||null,$used_bootstrap_value:!this.ai};H(f==null||(d=f.metadata)==null?void 0:d.version)||(m.$feature_flag_version=f.metadata.version);var v,y=(p=f==null||(g=f.reason)==null?void 0:g.description)!==null&&p!==void 0?p:f==null||(S=f.reason)==null?void 0:S.code;y&&(m.$feature_flag_reason=y),f!=null&&(b=f.metadata)!=null&&b.id&&(m.$feature_flag_id=f.metadata.id),H(f?.original_variant)&&H(f?.original_enabled)||(m.$feature_flag_original_response=H(f.original_variant)?f.original_enabled:f.original_variant),f!=null&&(x=f.metadata)!=null&&x.original_payload&&(m.$feature_flag_original_payload=f==null||(v=f.metadata)==null?void 0:v.original_payload),this._instance.capture("$feature_flag_called",m)}return r}er.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,a){var r=this._instance.config.token,n={distinct_id:this._instance.get_distinct_id(),token:r};this.ui()&&(n.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:n,compression:this._instance.config.disable_compression?void 0:on.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var i,s=(i=o.json)==null?void 0:i.featureFlagPayloads;a(s?.[e]||void 0)}})}isFeatureEnabled(e,a){if(a===void 0&&(a={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,a);return H(r)?void 0:!!r}er.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((a=>a!==e))}receivedFeatureFlags(e,a){if(this._instance.persistence){this.ei=!0;var r=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(i,s,l,u,c){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var d=eP(i),p=d.flags,g=d.featureFlags,S=d.featureFlagPayloads;if(g){var b=i.requestId,x=i.evaluatedAt;if(Te(g)){er.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(g)for(var m=0;m<g.length;m++)f[g[m]]=!0;s&&s.register({[$y]:g,[Hs]:f})}else{var v=g,y=S,_=p;i.errorsWhileComputingFlags&&(v=G({},l,v),y=G({},u,y),_=G({},c,_)),s&&s.register(G({[$y]:Object.keys(ek(v)),[Hs]:v||{},[KA]:y||{},[dx]:_||{}},b?{[QA]:b}:{},x?{[JA]:x}:{}))}}})(e,this._instance.persistence,r,n,o),this.pi(a)}}override(e,a){a===void 0&&(a=!1),er.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:a})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return er.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Bs),this._instance.persistence.unregister($u),this.pi(),Vu.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var a,r=e;if(this.ii=!!((a=r.suppressWarning)!==null&&a!==void 0&&a),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(Bs),Vu.info("Flag overrides cleared");else if(r.flags){if(Te(r.flags)){for(var n={},o=0;o<r.flags.length;o++)n[r.flags[o]]=!0;this._instance.persistence.register({[Bs]:n})}else this._instance.persistence.register({[Bs]:r.flags});Vu.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister($u),Vu.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[$u]:r.payloads}),Vu.info("Payload overrides set",{payloads:r.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:a,flagVariants:r}=this.gi();e(a,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,a,r){var n,o=(this._instance.get_property(Xu)||[]).find((u=>u.flagKey===e)),i={["$feature_enrollment/"+e]:a},s={$feature_flag:e,$feature_enrollment:a,$set:i};o&&(s.$early_access_feature_name=o.name),r&&(s.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(i,!1);var l=G({},this.getFlagVariants(),{[e]:a});(n=this._instance.persistence)==null||n.register({[$y]:Object.keys(ek(l)),[Hs]:l}),this.pi()}getEarlyAccessFeatures(e,a,r){a===void 0&&(a=!1);var n=this._instance.get_property(Xu),o=r?"&"+r.map((i=>"stage="+i)).join("&"):"";if(n&&!a)return e(n);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:i=>{var s,l;if(i.json){var u=i.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.unregister(Xu),(l=this._instance.persistence)==null||l.register({[Xu]:u}),e(u)}}})}gi(){var e=this.getFlags(),a=this.getFlagVariants();return{flags:e.filter((r=>a[r])),flagVariants:Object.keys(a).filter((r=>a[r])).reduce(((r,n)=>(r[n]=a[n],r)),{})}}pi(e){var{flags:a,flagVariants:r}=this.gi();this.featureFlagEventHandlers.forEach((n=>n(a,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(Yu)||{};this._instance.register({[Yu]:G({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Yu)}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(pi)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((n=>{r[n]=G({},r[n],e[n]),delete e[n]})),this._instance.register({[pi]:G({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var a=this._instance.get_property(pi)||{};this._instance.register({[pi]:G({},a,{[e]:{}})})}else this._instance.unregister(pi)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.di(),this.ii=!1}},aP=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],tc=class{constructor(e,a){this.F=e,this.props={},this.mi=!1,this.yi=(r=>{var n="";return r.token&&(n=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+n+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&z.info("Persistence loaded",e.persistence,G({},this.props)),this.update_config(e,e,a),this.save()}isDisabled(){return!!this.wi}bi(e){aP.indexOf(e.persistence.toLowerCase())===-1&&(z.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var a=e.persistence.toLowerCase();return a==="localstorage"&&Ge.H()?Ge:a==="localstorage+cookie"&&Cp.H()?Cp:a==="sessionstorage"&&Lt.H()?Lt:a==="memory"?wN:a==="cookie"?yr:Cp.H()?Cp:yr}properties(){var e={};return De(this.props,(function(a,r){if(r===Hs&&mt(a))for(var n=Object.keys(a),o=0;o<n.length;o++)e["$feature/"+n[o]]=a[n[o]];else s=r,l=!1,(sn(i=iN)?l:hA&&i.indexOf===hA?i.indexOf(s)!=-1:(De(i,(function(u){if(l||(l=u===s))return Rp})),l))||(e[r]=a);var i,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Je({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,a,r){if(mt(e)){H(a)&&(a="None"),this.xi=H(r)?this.$i:r;var n=!1;if(De(e,((o,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==a||(this.props[i]=o,n=!0)})),n)return this.save(),!0}return!1}register(e,a){if(mt(e)){this.xi=H(a)?this.$i:a;var r=!1;if(De(e,((n,o)=>{e.hasOwnProperty(o)&&this.props[o]!==n&&(this.props[o]=n,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=Qk(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);Ps(rb(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=q?.referrer)?eE(e):{})}update_referrer_info(){var e;this.register_once({$referrer:tE(),$referring_domain:q!=null&&q.referrer&&((e=Pp(q.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[mx]||this.props[gx]||this.register_once({[Op]:aE(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};De([gx,mx],(i=>{var s=this.props[i];s&&De(s,(function(l,u){e["$initial_"+Xy(u)]=l}))}));var a,r,n=this.props[Op];if(n){var o=(a=rE(n),r={},De(a,(function(i,s){r["$initial_"+Xy(s)]=i})),r);Je(e,o)}return e}safe_merge(e){return De(this.props,(function(a,r){r in e||(e[r]=a)})),e}update_config(e,a,r){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==a.persistence){var n=this.bi(e),o=this.props;this.clear(),this.Y=n,this.props=o,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_secure(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_event_timer(e,a){var r=this.props[Zu]||{};r[e]=a,this.props[Zu]=r,this.save()}remove_event_timer(e){var a=(this.props[Zu]||{})[e];return H(a)||(delete this.props[Zu][e],this.save()),a}get_property(e){return this.props[e]}set_property(e,a){this.props[e]=a,this.save()}},ju=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),iz=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),sz=(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({}),lz=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),jy=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),uz=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),cz=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),dz=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),Ep=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),tk=(function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t})({}),dE=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),lc=class{constructor(){this.ki={},this.ki={}}on(e,a){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(a),()=>{this.ki[e]=this.ki[e].filter((r=>r!==a))}}emit(e,a){for(var r of this.ki[e]||[])r(a);for(var n of this.ki["*"]||[])n(e,a)}};function Fs(t,e,a){if(Ie(t))return!1;switch(a){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var Ux=class{constructor(e){this.Pi=new lc,this.Ti=(a,r)=>this.Ri(a,r)&&this.Ii(a,r)&&this.Fi(a,r)&&this.Ci(a,r),this.Ri=(a,r)=>r==null||!r.event||a?.event===r?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!H((e=this._instance)==null?void 0:e.Ai)){var a;(a=this._instance)==null||a.Ai(((r,n)=>{this.on(r,n)}))}}register(e){var a,r;if(!H((a=this._instance)==null?void 0:a.Ai)&&(e.forEach((i=>{var s,l;(s=this.Oi)==null||s.add(i),(l=i.steps)==null||l.forEach((u=>{var c;(c=this.Mi)==null||c.add(u?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var n,o=new Set;e.forEach((i=>{var s;(s=i.steps)==null||s.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(n=this._instance)==null||n.autocapture.setElementSelectors(o)}}on(e,a){var r;a!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(a?.event))&&this.Oi&&((r=this.Oi)==null?void 0:r.size)>0&&this.Oi.forEach((n=>{this.Di(a,n)&&this.Pi.emit("actionCaptured",n.name)}))}ji(e){this.onAction("actionCaptured",(a=>e(a)))}Di(e,a){if(a?.steps==null)return!1;for(var r of a.steps)if(this.Ti(e,r))return!0;return!1}onAction(e,a){return this.Pi.on(e,a)}Ii(e,a){if(a!=null&&a.url){var r,n=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!n||typeof n!="string"||!Fs(n,a.url,a.url_matching||"contains"))return!1}return!0}Fi(e,a){return!!this.Li(e,a)&&!!this.Ni(e,a)&&!!this.Ui(e,a)}Li(e,a){var r;if(a==null||!a.href)return!0;var n=this.zi(e);if(n.length>0)return n.some((s=>Fs(s.href,a.href,a.href_matching||"exact")));var o,i=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!i&&Fs((o=i.match(/(?::|")href="(.*?)"/))?o[1]:"",a.href,a.href_matching||"exact")}Ni(e,a){var r;if(a==null||!a.text)return!0;var n=this.zi(e);if(n.length>0)return n.some((u=>Fs(u.text,a.text,a.text_matching||"exact")||Fs(u.$el_text,a.text,a.text_matching||"exact")));var o,i,s,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(o=(function(u){for(var c,d=[],p=/(?::|")text="(.*?)"/g;!Ie(c=p.exec(u));)d.includes(c[1])||d.push(c[1]);return d})(l),i=a.text,s=a.text_matching||"exact",o.some((u=>Fs(u,i,s))))}Ui(e,a){var r,n;if(a==null||!a.selector)return!0;var o=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(o!=null&&o.includes(a.selector))return!0;var i=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";if(a.selector_regex&&i)try{return new RegExp(a.selector_regex).test(i)}catch{return!1}return!1}zi(e){var a;return(e==null||(a=e.properties)==null?void 0:a.$elements)==null?[]:e?.properties.$elements}Ci(e,a){return a==null||!a.properties||a.properties.length===0||cE(a.properties.reduce(((r,n)=>{var o=Te(n.value)?n.value.map(String):n.value!=null?[String(n.value)]:[];return r[n.key]={values:o,operator:n.operator||"exact"},r}),{}),e?.properties)}},_e=ct("[Surveys]"),qx="seenSurvey_",rP=(t,e)=>{var a="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(a="$survey_"+e+"/"+t.id+"/"+t.current_iteration),a},ak=t=>{var e=""+qx+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+qx+t.id+"_"+t.current_iteration),e},nP=[jy.Popover,jy.Widget,jy.API],oP={ignoreConditions:!1,ignoreDelay:!1,displayType:dE.Popover},zx=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,a){return!!e&&cE(e.propertyFilters,a?.properties)}Gi(e,a){var r=new Map;return e.forEach((n=>{var o;(o=n.conditions)==null||(o=o[a])==null||(o=o.values)==null||o.forEach((i=>{if(i!=null&&i.name){var s=r.get(i.name)||[];s.push(n.id),r.set(i.name,s)}}))})),r}Vi(e,a,r){var n,o=(r===ju.Activation?this.Hi:this.Bi).get(e),i=[];return(n=this._instance)==null||n.getSurveys((s=>{i=s.filter((l=>o?.includes(l.id)))})),i.filter((s=>{var l,u=(l=s.conditions)==null||(l=l[r])==null||(l=l.values)==null?void 0:l.find((c=>c.name===e));return this.Wi(u,a)}))}register(e){var a;H((a=this._instance)==null?void 0:a.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var a=e.filter((r=>{var n,o;return((n=r.conditions)==null?void 0:n.actions)&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));a.length!==0&&(this.Yi==null&&(this.Yi=new Ux(this._instance),this.Yi.init(),this.Yi.ji((r=>{this.onAction(r)}))),a.forEach((r=>{var n,o,i,s,l;r.conditions&&(n=r.conditions)!=null&&n.actions&&(o=r.conditions)!=null&&(o=o.actions)!=null&&o.values&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0&&((s=this.Yi)==null||s.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((u=>{if(u&&u.name){var c=this.qi.get(u.name);c&&c.push(r.id),this.qi.set(u.name,c||[r.id])}})))})))}Ji(e){var a,r=e.filter((o=>{var i,s;return((i=o.conditions)==null?void 0:i.events)&&((s=o.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0})),n=e.filter((o=>{var i,s;return((i=o.conditions)==null?void 0:i.cancelEvents)&&((s=o.conditions)==null||(s=s.cancelEvents)==null||(s=s.values)==null?void 0:s.length)>0}));(r.length!==0||n.length!==0)&&((a=this._instance)==null||a.Ai(((o,i)=>{this.onEvent(o,i)})),this.Hi=this.Gi(e,ju.Activation),this.Bi=this.Gi(e,ju.Cancellation))}onEvent(e,a){var r,n=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[Sp])||[];if(Ep.SHOWN===e&&a&&n.length>0){var o;_e.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:a,existingActivatedSurveys:n});var i=a==null||(o=a.properties)==null?void 0:o.$survey_id;if(i){var s=n.indexOf(i);s>=0&&(n.splice(s,1),this.Xi(n))}}else{if(this.Bi.has(e)){var l=this.Vi(e,a,ju.Cancellation);l.length>0&&(_e.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((c=>c.id))}),l.forEach((c=>{var d,p=n.indexOf(c.id);p>=0&&n.splice(p,1),(d=this._instance)==null||d.cancelPendingSurvey(c.id)})),this.Xi(n))}if(this.Hi.has(e)){_e.info("survey event name matched",{event:e,eventPayload:a,surveys:this.Hi.get(e)});var u=this.Vi(e,a,ju.Activation);this.Xi(n.concat(u.map((c=>c.id))||[]))}}}onAction(e){var a,r=((a=this._instance)==null||(a=a.persistence)==null?void 0:a.props[Sp])||[];this.qi.has(e)&&this.Xi(r.concat(this.qi.get(e)||[]))}Xi(e){var a;_e.info("updating activated surveys",{activatedSurveys:e}),(a=this._instance)==null||(a=a.persistence)==null||a.register({[Sp]:[...new Set(e)]})}getSurveys(){var e,a=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[Sp];return a||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},Vx=class{constructor(e){this.Zi=void 0,this._surveyManager=null,this.te=!1,this.ie=!1,this.ee=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var a=e.surveys;if(Ie(a))return _e.warn("Flags not loaded yet. Not loading surveys.");var r=Te(a);this.Zi=r?a.length>0:a,_e.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],a=0;a<localStorage.length;a++){var r=localStorage.key(a);(r!=null&&r.startsWith(qx)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((n=>localStorage.removeItem(n)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)_e.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)_e.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())_e.info("Not loading surveys in cookieless mode without consent.");else{var e=te?.__PosthogExtensions__;if(e){if(!H(this.Zi)||this._instance.config.advanced_enable_surveys){var a=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var r=e.generateSurveys;if(r)return void this.re(r,a);var n=e.loadExternalDependency;if(!n)return void this.se("PostHog loadExternalDependency extension not found.");n(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,a)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else _e.error("PostHog Extensions not found.")}}re(e,a){this._surveyManager=e(this._instance,a),this._surveyEventReceiver=new zx(this._instance),_e.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,a){_e.error(e,a),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((a=>a!==e))}}getSurveys(e,a){if(a===void 0&&(a=!1),this._instance.config.disable_surveys)return _e.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(fx);if(r&&!a)return e(r,{isLoaded:!0});if(this.te)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:n=>{var o;this.te=!1;var i=n.statusCode;if(i!==200||!n.json){var s="Surveys API could not be loaded, status: "+i;return _e.error(s),e([],{isLoaded:!1,error:s})}var l,u=n.json.surveys||[],c=u.filter((d=>(function(p){return!(!p.start_date||p.end_date)})(d)&&((function(p){var g;return!((g=p.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)})(d)||(function(p){var g;return!((g=p.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)})(d))));return c.length>0&&((l=this._surveyEventReceiver)==null||l.register(c)),(o=this._instance.persistence)==null||o.register({[fx]:u}),e(u,{isLoaded:!0})}})}catch(n){throw this.te=!1,n}}ne(e){for(var a of this.ee)try{if(!e.isLoaded)return a([],e);this.getSurveys(a)}catch(r){_e.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,a){if(a===void 0&&(a=!1),!Ie(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,a);_e.warn("init was not called")}oe(e){var a=null;return this.getSurveys((r=>{var n;a=(n=r.find((o=>o.id===e)))!==null&&n!==void 0?n:null})),a}ae(e){if(Ie(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var a=typeof e=="string"?this.oe(e):e;return a?this._surveyManager.checkSurveyEligibility(a):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Ie(this._surveyManager))return _e.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var a=this.ae(e);return{visible:a.eligible,disabledReason:a.reason}}canRenderSurveyAsync(e,a){return Ie(this._surveyManager)?(_e.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((n=>{var o,i=(o=n.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(i){var s=this.ae(i);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),a)}))}renderSurvey(e,a){var r;if(Ie(this._surveyManager))_e.warn("init was not called");else{var n=typeof e=="string"?this.oe(e):e;if(n!=null&&n.id)if(nP.includes(n.type)){var o=q?.querySelector(a);if(o)return(r=n.appearance)!=null&&r.surveyPopupDelaySeconds?(_e.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var i,s;_e.info("Rendering survey "+n.id+" with delay of "+((i=n.appearance)==null?void 0:i.surveyPopupDelaySeconds)+" seconds"),(s=this._surveyManager)==null||s.renderSurvey(n,o),_e.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,o);_e.warn("Survey element not found")}else _e.warn("Surveys of type "+n.type+" cannot be rendered in the app");else _e.warn("Survey not found")}}displaySurvey(e,a){var r;if(Ie(this._surveyManager))_e.warn("init was not called");else{var n=this.oe(e);if(n){var o=n;if((r=n.appearance)!=null&&r.surveyPopupDelaySeconds&&a.ignoreDelay&&(o=G({},n,{appearance:G({},n.appearance,{surveyPopupDelaySeconds:0})})),a.ignoreConditions===!1){var i=this.canRenderSurvey(n);if(!i.visible)return void _e.warn("Survey is not eligible to be displayed: ",i.disabledReason)}a.displayType!==dE.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,a.selector)}else _e.warn("Survey not found")}}cancelPendingSurvey(e){Ie(this._surveyManager)?_e.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},rk=ct("[RateLimiter]"),$x=class{constructor(e){var a,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var o=n.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((i=>{rk.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void rk.warn('could not rate limit - continuing. Error: "'+i?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((a=e.config.rate_limiting)==null?void 0:a.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=e.config.rate_limiting)==null?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var a,r,n;e===void 0&&(e=!1);var o=new Date().getTime(),i=(a=(r=this.instance.persistence)==null?void 0:r.get_property(hx))!==null&&a!==void 0?a:{tokens:this.captureEventsBurstLimit,last:o};i.tokens+=(o-i.last)/1e3*this.captureEventsPerSecond,i.last=o,i.tokens>this.captureEventsBurstLimit&&(i.tokens=this.captureEventsBurstLimit);var s=i.tokens<1;return s||e||(i.tokens=Math.max(0,i.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,(n=this.instance.persistence)==null||n.set_property(hx,i),{isRateLimited:s,remainingTokens:i.tokens}}isServerRateLimited(e){var a=this.serverLimits[e||"events"]||!1;return a!==!1&&new Date().getTime()<a}},fi=ct("[RemoteConfig]"),jx=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=te._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.loadExternalDependency?(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(fi.error("PostHog Extensions not found. Cannot load remote config."),e())}ue(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:a=>{e(a.json)}})}load(){try{if(this.remoteConfig)return fi.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void fi.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return fi.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((a=>{this.fi(a)}));this.fi(e)}))}catch(e){fi.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):fi.info("__preview_remote_config is disabled. Logging config instead",e):fi.error("Failed to fetch remote config from PostHog.")}},Gx=3e3,Wx=class{constructor(e,a){this.he=!0,this.ve=[],this.de=gr(a?.flush_interval_ms||Gx,250,5e3,z.createLogger("flush interval"),Gx),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},a=Object.values(e);[...a.filter((r=>r.url.indexOf("/e")===0)),...a.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ce(G({},r,{transport:"sendBeacon"}))}))}enable(){this.he=!1,this.pe()}pe(){var e=this;this.he||(this.fe=setTimeout((()=>{if(this.ge(),this.ve.length>0){var a=this._e(),r=function(){var o=a[n],i=new Date().getTime();o.data&&Te(o.data)&&De(o.data,(s=>{s.offset=Math.abs(s.timestamp-i),delete s.timestamp})),e.ce(o)};for(var n in a)r()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return De(this.ve,(a=>{var r,n=a,o=(n?n.batchKey:null)||n.url;H(e[o])&&(e[o]=G({},n,{data:[]})),(r=e[o].data)==null||r.push(n.data)})),this.ve=[],e}},iP=["retriesPerformedSoFar"],Zx=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!H(T)&&"onLine"in T.navigator&&(this.be=T.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},nt(T,"online",this.we),nt(T,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:a}=e,r=uk(e,iP);xr(a)&&a>0&&(r.url=jp(r.url,{retry_count:a})),this._instance.ci(G({},r,{callback:n=>{n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(a??0)<10?this.Se(G({retriesPerformedSoFar:a},r)):r.callback==null||r.callback(n)}}))}Se(e){var a=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=a+1;var r=(function(i){var s=3e3*Math.pow(2,i),l=s/2,u=Math.min(18e5,s),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)})(a),n=Date.now()+r;this.ve.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),z.warn(o),this.me||(this.me=!0,this.Ee())}Ee(){if(this.$e&&clearTimeout(this.$e),this.ve.length===0)return this.me=!1,void(this.$e=void 0);this.$e=setTimeout((()=>{this.be&&this.ve.length>0&&this.Dt(),this.Ee()}),this.ye)}Dt(){var e=Date.now(),a=[],r=this.ve.filter((o=>o.retryAt<e||(a.push(o),!1)));if(this.ve=a,r.length>0)for(var{requestOptions:n}of r)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,H(T)||(this.we&&(T.removeEventListener("online",this.we),this.we=void 0),this.xe&&(T.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(G({},e,{transport:"sendBeacon"}))}catch(a){z.error(a)}this.ve=[]}},Xx=class{constructor(e){this.ke=()=>{var a,r,n,o;this.Pe||(this.Pe={});var i=this.scrollElement(),s=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=s+(i?.clientHeight||0),c=i?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(s),this.Pe.maxScrollY=Math.max(s,(a=this.Pe.maxScrollY)!==null&&a!==void 0?a:0),this.Pe.maxScrollHeight=Math.max(l,(r=this.Pe.maxScrollHeight)!==null&&r!==void 0?r:0),this.Pe.lastContentY=u,this.Pe.maxContentY=Math.max(u,(n=this.Pe.maxContentY)!==null&&n!==void 0?n:0),this.Pe.maxContentHeight=Math.max(c,(o=this.Pe.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Pe}resetContext(){var e=this.Pe;return setTimeout(this.ke,0),e}startMeasuringScrollPosition(){nt(T,"scroll",this.ke,{capture:!0}),nt(T,"scrollend",this.ke,{capture:!0}),nt(T,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return T?.document.documentElement;var e=Te(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var a of e){var r=T?.document.querySelector(a);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return T&&(T.scrollY||T.pageYOffset||T.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return T&&(T.scrollX||T.pageXOffset||T.document.documentElement.scrollLeft)||0}},sP=t=>aE(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),Wp=class{constructor(e,a,r,n){this.Te=o=>{var i=this.Re();if(!i||i.sessionId!==o){var s={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[px]:s})}},this._instance=e,this.Ce=a,this.Fe=r,this.Ie=n||sP,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[px]}getSetOnceProps(){var e,a=(e=this.Re())==null?void 0:e.props;return a?"r"in a?rE(a):{$referring_domain:a.referringDomain,$pathname:a.initialPathName,utm_source:a.utm_source,utm_campaign:a.utm_campaign,utm_medium:a.utm_medium,utm_content:a.utm_content,utm_term:a.utm_term}:{}}getSessionProps(){var e={};return De(rb(this.getSetOnceProps()),((a,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+Xy(r)]=a})),e}},Gy=ct("[SessionId]"),Zp=class{on(e,a){return this.Me.on(e,a)}constructor(e,a,r){var n;if(this.Oe=[],this.Ae=void 0,this.Me=new lc,this.De=(c,d)=>Math.abs(c-d)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.F=e.config,this.Fe=e.persistence,this.je=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ne=a||lo,this.Ue=r||lo;var o=this.F.persistence_name||this.F.token,i=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*gr(i,60,36e3,Gy.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+o+"_window_id",this.Be="ph_"+o+"_primary_window_exists",this.qe()){var s=Lt.W(this.He),l=Lt.W(this.Be);s&&!l?this.je=s:Lt.V(this.He),Lt.G(this.Be,!0)}if((n=this.F.bootstrap)!=null&&n.sessionID)try{var u=(c=>{var d=c.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),u)}catch(c){Gy.error("Invalid sessionID in bootstrap",c)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return H(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((a=>a!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&Lt.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Lt.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Lt.W(this.He):null}We(e,a,r){e===this.Le&&a===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=a,this.Le=e,this.Fe.register({[Mp]:[a,e,r]}))}Ke(){var e=this.Fe.props[Mp];return Te(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.We(null,null,null)}destroy(){clearTimeout(this.Ye),this.Ye=void 0,this.Ae&&T&&(T.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Lt.V(this.Be)},nt(T,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,a){if(e===void 0&&(e=!1),a===void 0&&(a=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=a||new Date().getTime(),[n,o,i]=this.Ke(),s=this.Je(),l=xr(i)&&i>0&&Math.abs(r-i)>864e5,u=!1,c=!o,d=!c&&!e&&this.De(r,n);c||d||l?(o=this.Ne(),s=this.Ue(),Gy.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}}),i=r,u=!0):s||(s=this.Ue(),u=!0);var p=n===0||!e||l?r:n,g=i===0?new Date().getTime():i;return this.Ve(s),this.We(o,p,g),e||this.ze(),u&&this.Oe.forEach((S=>S(o,s,u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:s,sessionStartTimestamp:g,changeReason:u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:n}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var a=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:a})}}),1.1*this.sessionTimeoutMs)}},lP=["$set_once","$set"],io=ct("[SiteApps]"),Yx=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,a){if(a){var r=this.globalsForEvent(a);this.Xe.push(r),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=te._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ai(this.Qe.bind(this));this.Ze=()=>{e(),this.Xe=[],this.Ze=void 0}}}globalsForEvent(e){var a,r,n,o,i,s,l;if(!e)throw new Error("Event payload is required");var u={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[p,g]of Object.entries(d))u[p]={id:c[p],type:p,properties:g};var{$set_once:S,$set:b}=e;return{event:G({},uk(e,lP),{properties:G({},e.properties,b?{$set:G({},(a=(r=e.properties)==null?void 0:r.$set)!==null&&a!==void 0?a:{},b)}:{},S?{$set_once:G({},(n=(o=e.properties)==null?void 0:o.$set_once)!==null&&n!==void 0?n:{},S)}:{}),elements_chain:(i=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var a=this.apps[e.id],r=()=>{var s;!a.errored&&this.Xe.length&&(io.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>a.processEvent==null?void 0:a.processEvent(l))),a.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((s=this.Ze)==null||s.call(this))},n=!1,o=s=>{a.errored=!s,a.loaded=!0,io.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),n&&r()};try{var{processEvent:i}=e.init({posthog:this._instance,callback:s=>{o(s)}});i&&(a.processEvent=i),n=!0}catch(s){io.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(n&&a.loaded)try{r()}catch(s){io.error("Error while processing buffered events PostHog app with config id "+e.id,s),a.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var a of e)this.apps[a.id]={id:a.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}ir(e){if(Object.keys(this.apps).length!==0){var a=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(a)}catch(n){io.error("Error while processing event "+e.event+" for site app "+r.id,n)}}}onRemoteConfig(e){var a,r,n,o=this;if((a=this.siteAppLoaders)!=null&&a.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(u=>this.ir(u)))):void io.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Ze)==null||r.call(this),(n=e.siteApps)!=null&&n.length)if(this.isEnabled){var i=function(u){var c;te["__$$ph_site_app_"+u]=o._instance,(c=te.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(o._instance,l,(d=>{if(d)return io.error("Error while initializing PostHog app with config id "+u,d)}))};for(var{id:s,url:l}of e.siteApps)i(s)}else io.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},fE=function(t,e){if(!t)return!1;var a=t.userAgent;if(a&&yA(a,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some((n=>yA(n?.brand,e))))return!0}catch{}return!!t.webdriver},Ju=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),nk="i.posthog.com",Kx=class{constructor(e){this.er={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,a=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return a||(a=this.apiHost.replace("."+nk,".posthog.com")),a==="https://app.posthog.com"?"https://us.posthog.com":a}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Ju.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Ju.EU:this.er[this.apiHost]=Ju.CUSTOM),this.er[this.apiHost]}endpointFor(e,a){if(a===void 0&&(a=""),a&&(a=a[0]==="/"?a:"/"+a),e==="ui")return this.uiHost+a;if(e==="flags")return this.flagsApiHost+a;if(this.region===Ju.CUSTOM)return this.apiHost+a;var r=nk+a;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}},uP={icontains:(t,e)=>!!T&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!T&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!T&&Gp(e.href,t),not_regex:(t,e)=>!!T&&!Gp(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},Qx=class t{constructor(e){var a=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),a.getWebExperiments((n=>{t.rr("retrieved web experiments from the server"),a.sr=new Map,n.forEach((o=>{if(o.feature_flag_key){var i;a.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(i=a.sr)==null||i.set(o.feature_flag_key,o));var s=a._instance.getFeatureFlag(o.feature_flag_key);ut(s)&&o.variants[s]&&a.nr(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var u=o.variants[l];t.ar(u)&&a.nr(o.name,l,u.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}onFeatureFlags(e){if(this._is_bot())t.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Ie(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((a=>{var r;if(this.sr&&(r=this.sr)!=null&&r.has(a)){var n,o=this._instance.getFeatureFlag(a),i=(n=this.sr)==null?void 0:n.get(a);o&&i!=null&&i.variants[o]&&this.nr(i.name,o,i.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var a=Hp(e?.search,"__experiment_id"),r=Hp(e?.search,"__experiment_variant");a&&r&&(t.rr("previewing web experiments "+a+" && "+r),this.getWebExperiments((n=>{this.lr(parseInt(a),r,n)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,a,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var n=this._instance.get_property("$web_experiments");if(n&&!a)return e(n);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var i=o.json.experiments||[];return e(i)}})}lr(e,a,r){var n=r.filter((o=>o.id===e));n&&n.length>0&&(t.rr("Previewing web experiment ["+n[0].name+"] with variant ["+a+"]"),this.nr(n[0].name,a,n[0].variants[a].transforms))}static ar(e){return!Ie(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var a;if(Ie(e.conditions)||Ie((a=e.conditions)==null?void 0:a.url))return!0;var r,n,o,i=t.getWindowLocation();return!!i&&((r=e.conditions)==null||!r.url||uP[(n=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&n!==void 0?n:"icontains"](e.conditions.url,i))}static getWindowLocation(){return T?.location}static hr(e){var a;if(Ie(e.conditions)||Ie((a=e.conditions)==null?void 0:a.utm))return!0;var r=Qk();if(r.utm_source){var n,o,i,s,l,u,c,d,p=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==r.utm_campaign,g=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==r.utm_source,S=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,b=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return p&&S&&b&&g}return!1}static rr(e){for(var a=arguments.length,r=new Array(a>1?a-1:0),n=1;n<a;n++)r[n-1]=arguments[n];z.info("[WebExperiments] "+e,r)}nr(e,a,r){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):a!=="control"?r.forEach((n=>{if(n.selector){var o;t.rr("applying transform of variant "+a+" for experiment "+e+" ",n);var i=(o=document)==null?void 0:o.querySelectorAll(n.selector);i?.forEach((s=>{var l=s;n.html&&(l.innerHTML=n.html),n.css&&l.setAttribute("style",n.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return va&&this._instance?fE(va,this._instance.config.custom_blocked_useragents):void 0}},cP=ct("[PostHog ExternalIntegrations]"),dP={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Jx=class{constructor(e){this._instance=e}it(e,a){var r;(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(n=>{if(n)return cP.error("failed to load script",n);a()}))}startIfEnabledOrStop(){var e=this,a=function(i){var s,l,u;!n||(s=te.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[i]||e.it(dP[i],(()=>{var c;(c=te.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[i])==null||c.start(e._instance)})),!n&&(l=te.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[i]&&((u=te.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[i])==null||u.stop())};for(var[r,n]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;a(r)}}},eb="[SessionRecording]",Gu=ct(eb),Xp=class{get started(){var e;return!((e=this.vr)==null||!e.isStarted)}get status(){return this.vr?this.vr.status:this.dr&&!this.cr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.dr=!1,this.pr=void 0,this._instance=e,!this._instance.sessionManager)throw Gu.error("started without valid sessionManager"),new Error(eb+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(eb+' cannot be used with cookieless_mode="always"')}get cr(){var e,a=!((e=this._instance.get_property(Oy))==null||!e.enabled),r=!this._instance.config.disable_session_recording,n=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return T&&a&&r&&!n}startIfEnabledOrStop(e){var a;if(!this.cr||(a=this.vr)==null||!a.isStarted){var r=!H(Object.assign)&&!H(Array.from);this.cr&&r?(this.gr(e),Gu.info("starting")):this.stopRecording()}}gr(e){var a,r,n;this.cr&&(te!=null&&(a=te.__PosthogExtensions__)!=null&&(a=a.rrweb)!=null&&a.record&&(r=te.__PosthogExtensions__)!=null&&r.initSessionRecording?this._r(e):(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return Gu.error("could not load recorder",o);this._r(e)})))}stopRecording(){var e,a;(e=this.pr)==null||e.call(this),this.pr=void 0,(a=this.vr)==null||a.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(xk)}br(e){if(this._instance.persistence){var a,r,n=this._instance.persistence,o=()=>{var i=e.sessionRecording===!1?void 0:e.sessionRecording,s=i?.sampleRate,l=Ie(s)?null:parseFloat(s);Ie(l)&&this.yr();var u=i?.minimumDurationMilliseconds;n.register({[Oy]:G({enabled:!!i},i,{networkPayloadCapture:G({capturePerformance:e.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:H(u)?null:u,endpoint:i?.endpoint,triggerMatchType:i?.triggerMatchType,masking:i?.masking,urlTriggers:i?.urlTriggers})})};o(),(a=this.pr)==null||a.call(this),this.pr=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:Gu.info("skipping remote config with no sessionRecording",e)}log(e,a){var r;a===void 0&&(a="log"),(r=this.vr)!=null&&r.log?this.vr.log(e,a):Gu.warn("log called before recorder was ready")}get mr(){var e,a,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Oy);return(r==null||(a=r.scriptConfig)==null?void 0:a.script)||"lazy-recorder"}_r(e){var a,r;if((a=te.__PosthogExtensions__)==null||!a.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(r=te.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var a;(a=this.vr)==null||a.onRRwebEmit==null||a.onRRwebEmit(e)}overrideLinkedFlag(){var e,a;this.vr||(a=this._instance.persistence)==null||a.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,a;this.vr||(a=this._instance.persistence)==null||a.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var a,r;this.vr||(r=this._instance.persistence)==null||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(a=this.vr)==null||a.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,a){var r;return!((r=this.vr)==null||!r.tryAddCustomEvent(e,a))}},ac={},tb=()=>{},Ns="posthog",pE=!JN&&ea?.indexOf("MSIE")===-1&&ea?.indexOf("Mozilla")===-1,ok=t=>{var e;return G({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:oN(q?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:tb,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:ta&&ut(ta?.search)&&ta.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(T==null||(e=T.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:a=>{var r="Bad HTTP status: "+a.statusCode+" "+a.text;z.error(r)},get_device_id:a=>a,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Gx},error_tracking:{},_onCapture:tb,__preview_eager_load_replay:!1},(a=>({rageclick:!(a&&a>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(a&&a>="2025-05-24")||"history_change",session_recording:a&&a>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},ik=t=>{var e={};H(t.process_person)||(e.person_profiles=t.process_person),H(t.xhr_headers)||(e.request_headers=t.xhr_headers),H(t.cookie_name)||(e.persistence_name=t.cookie_name),H(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),H(t.store_google)||(e.save_campaign_params=t.store_google),H(t.verbose)||(e.debug=t.verbose);var a=Je({},e,t);return Te(t.property_blacklist)&&(H(t.property_denylist)?a.property_denylist=t.property_blacklist:Te(t.property_denylist)?a.property_denylist=[...t.property_blacklist,...t.property_denylist]:z.error("Invalid value for property_denylist config: "+t.property_denylist)),a},ab=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){z.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Yp=class t{get decideEndpointWasHit(){var e,a;return(e=(a=this.featureFlags)==null?void 0:a.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,a;return(e=(a=this.featureFlags)==null?void 0:a.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new ab,this.Sr=!1,this.version=an.LIB_VERSION,this.Er=new lc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ok(),this.SentryIntegration=Lx,this.sentryIntegration=e=>(function(a,r){var n=Bk(a,r);return{name:Ok,processEvent:o=>n(o)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.$r=!1,this.kr=null,this.Pr=null,this.Tr=null,this.featureFlags=new Hx(this),this.toolbar=new Ix(this),this.scrollManager=new Xx(this),this.pageViewManager=new Dx(this),this.surveys=new Vx(this),this.experiments=new Qx(this),this.exceptions=new Px(this),this.rateLimiter=new $x(this),this.requestRouter=new Kx(this),this.consent=new Cx(this),this.externalIntegrations=new Jx(this),this.people={set:(e,a,r)=>{var n=ut(e)?{[e]:a}:e;this.setPersonProperties(n),r?.({})},set_once:(e,a,r)=>{var n=ut(e)?{[e]:a}:e;this.setPersonProperties(void 0,n),r?.({})}},this.on("eventCaptured",(e=>z.info('send "'+e?.event+'"',e)))}init(e,a,r){if(r&&r!==Ns){var n,o=(n=ac[r])!==null&&n!==void 0?n:new t;return o._init(e,a,r),ac[r]=o,ac[Ns][r]=o,o}return this._init(e,a,r)}_init(e,a,r){var n;if(a===void 0&&(a={}),H(e)||Yy(e))return z.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},a.debug=this.Rr(a.debug),this.Ir=a,this.Fr=[],a.person_profiles&&(this.Pr=a.person_profiles),this.set_config(Je({},ok(a.defaults),ik(a),{name:r,token:e})),this.config.on_xhr_error&&z.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=a.disable_compression?void 0:on.GZipJS;var o=this.Cr();this.persistence=new tc(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new tc(G({},this.config,{persistence:"sessionStorage"}),o);var i=G({},this.persistence.props),s=G({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new Wx((m=>this.Or(m)),this.config.request_queue_config),this.Ar=new Zx(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new Zp(this),this.sessionPropsManager=new Wp(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(z.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(z.info("Initializing extensions synchronously"),this.Dr(l)),an.DEBUG=an.DEBUG||this.config.debug,an.DEBUG&&z.info("Starting in debug mode",{this:this,config:a,thisC:G({},this.config),p:i,s}),((n=a.bootstrap)==null?void 0:n.distinctID)!==void 0){var u,c,d=this.config.get_device_id(lo()),p=(u=a.bootstrap)!=null&&u.isIdentifiedID?d:a.bootstrap.distinctID;this.persistence.set_property(rn,(c=a.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:p})}if(this.jr()){var g,S,b=Object.keys(((g=a.bootstrap)==null?void 0:g.featureFlags)||{}).filter((m=>{var v;return!((v=a.bootstrap)==null||(v=v.featureFlags)==null||!v[m])})).reduce(((m,v)=>{var y;return m[v]=((y=a.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[v])||!1,m}),{}),x=Object.keys(((S=a.bootstrap)==null?void 0:S.featureFlagPayloads)||{}).filter((m=>b[m])).reduce(((m,v)=>{var y,_;return(y=a.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[v]&&(m[v]=(_=a.bootstrap)==null||(_=_.featureFlagPayloads)==null?void 0:_[v]),m}),{});this.featureFlags.receivedFeatureFlags({featureFlags:b,featureFlagPayloads:x})}if(l)this.register_once({distinct_id:Pu,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(lo());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(rn,"anonymous")}return nt(T,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),a.segment?AN(this,(()=>this.Lr())):this.Lr(),uo(this.config._onCapture)&&this.config._onCapture!==tb&&(z.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(m=>this.config._onCapture(m.event,m)))),this.config.ip&&z.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Dr(e){var a=performance.now();this.historyAutocapture=new wx(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new Ax(this).startIfEnabledOrStop()})),r.push((()=>{var n;this.siteApps=new Yx(this),(n=this.siteApps)==null||n.init()})),e||r.push((()=>{this.sessionRecording=new Xp(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new yx(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Mx(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Rx(this)})),r.push((()=>{this.exceptionObserver=new _x(this),this.exceptionObserver.startIfEnabled()})),r.push((()=>{this.deadClicksAutocapture=new qp(this,IN),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.Nr){var n=this.Nr;this.Nr=void 0,this.fi(n)}})),this.Ur(r,a)}Ur(e,a){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-a>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,a)}),0);var r=e.shift();if(r)try{r()}catch(o){z.error("Error initializing extension:",o)}}var n=Math.round(performance.now()-a);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:n}),this.config.__preview_deferred_init_extensions&&z.info("PostHog extensions initialized ("+n+"ms)")}fi(e){var a,r,n,o,i,s,l,u;if(!q||!q.body)return z.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Nr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=fe(e.supportedCompression,on.GZipJS)?on.GZipJS:fe(e.supportedCompression,on.Base64)?on.Base64:void 0),(a=e.analytics)!=null&&a.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(n=this.sessionRecording)==null||n.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(i=this.heatmaps)==null||i.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(u=this.deadClicksAutocapture)==null||u.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){z.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new jx(this).load(),this.featureFlags.flags()}zr(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Mr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&fo(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,a;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(a=this.Ar)==null||a.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(pE?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=jp(e.url,{ip:this.config.ip?1:0}),e.headers=G({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(a=>{var r,n,o,i=G({},a);i.timeout=i.timeout||6e4,i.url=jp(i.url,{_:new Date().getTime().toString(),ver:an.LIB_VERSION,compression:i.compression});var s=(r=i.transport)!==null&&r!==void 0?r:"fetch",l=kp.filter((c=>!i.disableTransport||!c.transport||!i.disableTransport.includes(c.transport))),u=(n=(o=gk(l,(c=>c.transport===s)))==null?void 0:o.method)!==null&&n!==void 0?n:l[0].method;if(!u)throw new Error("No available transport method");u(i)})(G({},e,{callback:a=>{var r,n;this.rateLimiter.checkForLimiting(a),a.statusCode>=400&&((r=(n=this.config).on_request_error)==null||r.call(n,a)),e.callback==null||e.callback(a)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var a,r=[],n=[],o=[];fo(e,(s=>{s&&(a=s[0],Te(a)?o.push(s):uo(s)?s.call(this):Te(s)&&a==="alias"?r.push(s):Te(s)&&a.indexOf("capture")!==-1&&uo(this[a])?o.push(s):n.push(s))}));var i=function(s,l){fo(s,(function(u){if(Te(u[0])){var c=l;De(u,(function(d){c=c[d[0]].apply(c,d.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),l)};i(r,this),i(n,this),i(o,this)}jr(){var e,a;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((a=this.config.bootstrap)==null?void 0:a.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,a,r){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!H(e)&&ut(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var i=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(i==null||!i.isRateLimited){a!=null&&a.$current_url&&!ut(a?.$current_url)&&(z.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),a==null||delete a.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,l=r?.timestamp||s,u=lo(),c={uuid:u,event:e,properties:this.calculateEventProperties(e,a||{},l,u)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),i&&(c.properties.$lib_rate_limit_remaining_tokens=i.remainingTokens),r?.$set&&(c.$set=r?.$set);var d,p=this.qr(r?.$set_once);if(p&&(c.$set_once=p),(c=rN(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,H(r?.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s),e===Ep.DISMISSED||e===Ep.SENT){var g=a?.[tk.SURVEY_ID],S=a?.[tk.SURVEY_ITERATION];d={id:g,current_iteration:S},localStorage.getItem(ak(d))||localStorage.setItem(ak(d),"true"),c.$set=G({},c.$set,{[rP({id:g,current_iteration:S},e===Ep.SENT?"responded":"dismissed")]:!0})}var b=G({},c.properties.$set,c.$set);if(Ps(b)||this.setPersonPropertiesForFlags(b),!Ie(this.config.before_send)){var x=this.Wr(c);if(!x)return;c=x}this.Er.emit("eventCaptured",c);var f={method:"POST",url:(n=r?._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Or(f):this.Mr.enqueue(f),c}z.critical("This capture call is ignored due to client rate limiting.")}}else z.error("No event name provided to posthog.capture")}else z.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(a=>e(a.event,a)))}calculateEventProperties(e,a,r,n,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return a;var i=o?void 0:this.persistence.remove_event_timer(e),s=G({},a);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(s.$cookieless_mode=!0),e==="$snapshot"){var l=G({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!ut(s.distinct_id)&&!xr(s.distinct_id)||Yy(s.distinct_id))&&z.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,c=VN(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:p}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());s.$session_id=d,s.$window_id=p}this.sessionPropsManager&&Je(s,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Je(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(g=this.Ar)==null?void 0:g.length}catch(f){s.$sdk_debug_error_capturing_properties=String(f)}if(this.requestRouter.region===Ju.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),u=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,n),s=Je(s,u),e==="$pageview"&&q&&(s.title=q.title),!H(i)){var S=r.getTime()-i;s.$duration=parseFloat((S/1e3).toFixed(3))}ea&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Je({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Te(this.config.property_denylist)?De(this.config.property_denylist,(function(f){delete s[f]})):z.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(z.error("sanitize_properties is deprecated. Use before_send instead"),s=b(s,e));var x=this.Gr();return s.$process_person_profile=x,x&&!o&&this.Vr("_calculate_event_properties"),s}qr(e){var a;if(!this.persistence||!this.Gr()||this.Sr)return e;var r=this.persistence.get_initial_props(),n=(a=this.sessionPropsManager)==null?void 0:a.getSetOnceProps(),o=Je({},r,n||{},e||{}),i=this.config.sanitize_properties;return i&&(z.error("sanitize_properties is deprecated. Use before_send instead"),o=i(o,"$set_once")),this.Sr=!0,Ps(o)?void 0:o}register(e,a){var r;(r=this.persistence)==null||r.register(e,a)}register_once(e,a,r){var n;(n=this.persistence)==null||n.register_once(e,a,r)}register_for_session(e){var a;(a=this.sessionPersistence)==null||a.register(e)}unregister(e){var a;(a=this.persistence)==null||a.unregister(e)}unregister_for_session(e){var a;(a=this.sessionPersistence)==null||a.unregister(e)}Jr(e,a){this.register({[e]:a})}getFeatureFlag(e,a){return this.featureFlags.getFeatureFlag(e,a)}getFeatureFlagPayload(e){var a=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(a)}catch{return a}}isFeatureEnabled(e,a){return this.featureFlags.isFeatureEnabled(e,a)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,a,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,a,r)}getEarlyAccessFeatures(e,a,r){return a===void 0&&(a=!1),this.featureFlags.getEarlyAccessFeatures(e,a,r)}on(e,a){return this.Er.on(e,a)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var a,r;return(a=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&a!==void 0?a:()=>{}}getSurveys(e,a){a===void 0&&(a=!1),this.surveys.getSurveys(e,a)}getActiveMatchingSurveys(e,a){a===void 0&&(a=!1),this.surveys.getActiveMatchingSurveys(e,a)}renderSurvey(e,a){this.surveys.renderSurvey(e,a)}displaySurvey(e,a){a===void 0&&(a=oP),this.surveys.displaySurvey(e,a)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,a){return a===void 0&&(a=!1),this.surveys.canRenderSurveyAsync(e,a)}identify(e,a,r){if(!this.__loaded||!this.persistence)return z.uninitializedWarning("posthog.identify");if(xr(e)&&(e=e.toString(),z.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))z.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==Pu){if(this.Vr("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==n&&e!==this.get_property(Wu)&&(this.unregister(Wu),this.register({distinct_id:e}));var i=(this.persistence.get_property(rn)||"anonymous")==="anonymous";e!==n&&i?(this.persistence.set_property(rn,"identified"),this.setPersonPropertiesForFlags(G({},r||{},a||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:a||{},$set_once:r||{}}),this.Tr=YA(e,a,r),this.featureFlags.setAnonymousDistinctId(n)):(a||r)&&this.setPersonProperties(a,r),e!==n&&(this.reloadFeatureFlags(),this.unregister(Dp))}}else z.critical('The string "'+Pu+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else z.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,a){if((e||a)&&this.Vr("posthog.setPersonProperties")){var r=YA(this.get_distinct_id(),e,a);this.Tr!==r?(this.setPersonPropertiesForFlags(G({},a||{},e||{})),this.capture("$set",{$set:e||{},$set_once:a||{}}),this.Tr=r):z.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,a,r){if(e&&a){if(this.Vr("posthog.group")){var n=this.getGroups();n[e]!==a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:G({},n,{[e]:a})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:a,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),n[e]===a||r||this.reloadFeatureFlags()}}else z.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0),this.featureFlags.setPersonPropertiesForFlags(e,a)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,a)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var a,r,n,o;if(z.info("reset"),!this.__loaded)return z.uninitializedWarning("posthog.reset");var i=this.get_property("$device_id");if(this.consent.reset(),(a=this.persistence)==null||a.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(n=this.persistence)==null||n.set_property(rn,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Pu,$device_id:null},"");else{var s=this.config.get_device_id(lo());this.register_once({distinct_id:s,$device_id:e?s:i},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,a;return(e=(a=this.sessionManager)==null?void 0:a.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:a,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+a);if(e!=null&&e.withTimestamp&&r){var o,i=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return n;n+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-i,0)}return n}alias(e,a){return e===this.get_property(vk)?(z.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(H(a)&&(a=this.get_distinct_id()),e!==a?(this.Jr(Wu,e),this.capture("$create_alias",{alias:e,distinct_id:a})):(z.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var a=G({},this.config);if(mt(e)){var r,n,o,i,s;Je(this.config,ik(e));var l=this.Cr();(r=this.persistence)==null||r.update_config(this.config,a,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new tc(G({},this.config,{persistence:"sessionStorage"}),l);var u=this.Rr(this.config.debug);co(u)&&(this.config.debug=u),co(this.config.debug)&&(this.config.debug?(an.DEBUG=!0,Ge.H()&&Ge.G("ph_debug","true"),z.info("set_config",{config:e,oldConfig:a,newConfig:G({},this.config)})):(an.DEBUG=!1,Ge.H()&&Ge.V("ph_debug"))),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(i=this.heatmaps)==null||i.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var a=e===!0,r={sampling:a||!(e==null||!e.sampling),linked_flag:a||!(e==null||!e.linked_flag),url_trigger:a||!(e==null||!e.url_trigger),event_trigger:a||!(e==null||!e.event_trigger)};if(Object.values(r).some(Boolean)){var n,o,i,s,l;(n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),r.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),r.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),r.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),r.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,a){var r=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(G({},n,a))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var a;return(a=this.persistence)==null?void 0:a.props[e]}getSessionProperty(e){var a;return(a=this.sessionPersistence)==null?void 0:a.props[e]}toString(){var e,a=(e=this.config.name)!==null&&e!==void 0?e:Ns;return a!==Ns&&(a=Ns+"."+a),a}_isIdentified(){var e,a;return((e=this.persistence)==null?void 0:e.get_property(rn))==="identified"||((a=this.sessionPersistence)==null?void 0:a.get_property(rn))==="identified"}Gr(){var e,a;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ps(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Wu])&&((a=this.persistence)==null||(a=a.props)==null||!a[Bp]))}Br(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Gr()||this.Vr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Vr(e){return this.config.person_profiles==="never"?(z.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(Bp,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),a=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!a}Kr(){var e,a,r,n,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((r=this.persistence)==null||r.set_disabled(o)),((a=this.sessionPersistence)==null?void 0:a.wi)!==o&&((n=this.sessionPersistence)==null||n.set_disabled(o)),o}opt_in_capturing(e){var a;if(this.config.cookieless_mode!=="always"){var r,n;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),this.sessionManager=new Zp(this),this.persistence&&(this.sessionPropsManager=new Wp(this,this.sessionManager,this.persistence)),this.sessionRecording=new Xp(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(H(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((n=e?.captureEventName)!==null&&n!==void 0?n:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else z.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,a;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Pu,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(a=this.sessionRecording)==null||a.stopRecording(),this.sessionRecording=void 0,this.Hr())):z.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===nn.GRANTED?"granted":e===nn.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kr()}_is_bot(){return va?fE(va,this.config.custom_blocked_useragents):void 0}Hr(){q&&(q.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:q.title},{send_instantly:!0}),this.kr&&(q.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),nt(q,"visibilitychange",this.kr)))}debug(e){e===!1?(T?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(T?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,a,r,n,o,i,s,l=this.Ir||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(z.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",n=!1,o=z,i=(a="advanced_disable_flags")in(e=l)&&!H(e[a]),s=r in e&&!H(e[r]),i?e[a]:s?(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+a+"' instead. The old field will be removed in a future major version."),e[r]):n)}Wr(e){if(Ie(this.config.before_send))return e;var a=Te(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of a){if(r=n(r),Ie(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return UF(e.event)?z.warn(o+". This can cause unexpected behavior."):z.info(o),null}r.properties&&!Ps(r.properties)||z.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,a){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:a})}captureTraceMetric(e,a,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:a,$ai_metric_value:String(r)})}Rr(e){var a=co(e)&&!e,r=Ge.H()&&Ge.q("ph_debug")==="true";return!a&&(!!r||e)}};(function(t,e){for(var a=0;a<e.length;a++)t.prototype[e[a]]=aN(t.prototype[e[a]])})(Yp,["identify"]);var sk,hE=(sk=ac[Ns]=new Yp,(function(){function t(){t.done||(t.done=!0,pE=!1,De(ac,(function(e){e._dom_loaded()})))}q!=null&&q.addEventListener?q.readyState==="complete"?t():nt(q,"DOMContentLoaded",t,{capture:!1}):T&&z.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),sk);var pb=class{constructor(e={}){this.options=e;$(this,"client");$(this,"featureFlagsCallback");$(this,"captureCallback");$(this,"consentUnsub");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&e.consent&&e.requireExplicitConsent&&typeof window<"u"&&e.apiKey){let a=e.consent;a.getStatus()==="granted"&&this.initPostHog(),this.consentUnsub=a.subscribe(n=>{n==="granted"?this.client?this.client.opt_in_capturing():this.initPostHog():n==="denied"&&this.client&&this.client.opt_out_capturing()});return}!this.client&&typeof window<"u"&&e.apiKey&&this.initPostHog()}initPostHog(){let e=this.options;if(!e.apiKey)return;let a=e.enableFeatureFlags??!0,r=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=hE.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!a,advanced_disable_feature_flags_on_first_load:!a,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:n=>{if(a&&this.featureFlagsCallback){n.onFeatureFlags(()=>{let i=this.getAllFeatureFlags();i&&this.featureFlagsCallback&&this.featureFlagsCallback(i)});let o=this.getAllFeatureFlags();o&&Object.keys(o).length>0&&this.featureFlagsCallback(o)}this.captureCallback&&n.on("eventCaptured",o=>{let i=typeof o=="string"?o:o?.event,s=typeof o=="string"?void 0:o?.properties;typeof i=="string"&&this.captureCallback?.(i,s)})}},r)}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let a={};for(let[r,n]of Object.entries(e))r.startsWith("in_segment_")&&(a[r]=n===!0);return a}identify(e,a){this.client?.identify(e,a)}alias(e,a){this.client?.alias(e,a)}track(e,a){this.client?.capture(e,a)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,a){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:a})}trackAction(e,a,r){this.track("shadow_canvas_action",{action:e,rectangleId:a,surface:r})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,a,r){let n=`$experiment_${e}`;this.register({[n]:r??`variation_${a}`,[`${n}_id`]:a}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:a,$experiment_variation_name:r??`variation_${a}`})}setPersonProperties(e){this.client?.capture("$set",{$set:e})}setPersonPropertiesOnce(e){this.client?.capture("$set",{$set_once:e})}getDistinctId(){return this.client?.get_distinct_id?.()}};function eh(t={}){return new pb(t)}var hb=async(t,e)=>{let a=[];if(e.applyAction)for(let r of t.actions){let n=await e.applyAction(r);a.push(n)}return{cleanup:async()=>{for(let r=a.length-1;r>=0;r--)try{await a[r].revert()}catch{}}}},mb=async(t,e)=>{let a=[];if(e.applyAction){let r=t.actions.map(n=>e.applyAction(n));if(t.waitFor==="any"){let n=await Promise.race(r);a.push(n);let o=await Promise.allSettled(r);for(let i of o)i.status==="fulfilled"&&i.value!==n&&a.push(i.value)}else{let n=await Promise.all(r);a.push(...n)}}return{cleanup:async()=>{for(let r of a)try{await r.revert()}catch{}}}},gb=async(t,e)=>{let a,r,n=!1,o={cleanup:()=>{n=!0,r&&clearTimeout(r),a&&a()}};return t.event&&e.subscribeEvent?await new Promise(i=>{a=e.subscribeEvent(t.event,()=>{n||i()}),t.durationMs!==void 0&&(r=setTimeout(()=>{n||i()},t.durationMs))}):t.durationMs!==void 0&&await new Promise(i=>{r=setTimeout(()=>{n||i()},t.durationMs)}),o};var fc=class{constructor(){$(this,"executors",new Map);for(let{kind:e,executor:a}of Lv)this.registerCore(e,a);for(let{kind:e,executor:a}of Fv)this.registerCore(e,a);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",hb),this.registerCore("core:parallel",mb),this.registerCore("core:wait",gb)}registerCore(e,a,r){this.executors.set(e,{kind:e,executor:a,schema:r,source:"core",isBuiltIn:!0})}register(e,a,r,n="custom",o=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)return;console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e} (source: ${n})`)}console.log(`[ExecutorRegistry] Registered executor: ${e} (source: ${n})`),this.executors.set(e,{kind:e,executor:a,schema:r,source:n,isBuiltIn:o})}unregister(e){let a=this.executors.get(e);return a?a.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[a,r]of this.executors.entries())r.source===e&&this.executors.delete(a)}get(e){return this.executors.get(e)?.executor}getRegistration(e){return this.executors.get(e)}has(e){return this.executors.has(e)}validate(e){let a=[];if(!e||typeof e!="object")return a.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:a,warnings:[]};let{kind:r}=e;if(!r||typeof r!="string")return a.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:a,warnings:[]};let n=this.executors.get(r);if(!n)return a.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:a,warnings:[]};if(n.schema){let o=n.schema.safeParse(e);if(!o.success){for(let i of o.error.issues)a.push({code:"SCHEMA_VALIDATION_ERROR",message:i.message,field:i.path.join(".")});return{valid:!1,errors:a,warnings:[]}}}return{valid:!0,errors:[],warnings:[]}}list(){return Array.from(this.executors.keys())}listRegistrations(){return Array.from(this.executors.values())}getBuiltInKinds(){return Array.from(this.executors.entries()).filter(([,e])=>e.isBuiltIn).map(([e])=>e)}getCustomKinds(){return Array.from(this.executors.entries()).filter(([,e])=>!e.isBuiltIn).map(([e])=>e)}},br=new fc;function mE(t){return br.get(t)}function th(t){return br.has(t)}var fP=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),gE=5e4,vE=50;function ln(t){let e=[],a=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:a};let{kind:r}=t;if(!r||typeof r!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:a};if(!th(r)&&r!=="core:mountWidget"){let n=br.list();return console.error(`[ActionValidation] Unknown action kind: "${r}". Registered kinds (${n.length}): [${n.join(", ")}]. This usually means the app that provides "${r}" hasn't been activated yet, or the executor was never registered in ExecutorRegistry.`),e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:e,warnings:a}}switch(r){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":ho(t,e,a);break;case"overlays:badge":ho(t,e,a),pP(t,e,a);break;case"overlays:tooltip":ho(t,e,a),hP(t,e,a);break;case"overlays:modal":LP(t,e,a);break;case"content:insertHtml":ho(t,e,a),mP(t,e,a);break;case"content:setText":ho(t,e,a),gP(t,e,a);break;case"content:setAttr":ho(t,e,a),vP(t,e,a);break;case"content:addClass":case"content:removeClass":ho(t,e,a),yP(t,e,a);break;case"content:setStyle":ho(t,e,a),xP(t,e,a);break;case"core:mountWidget":bP(t,e,a);break;case"core:wait":SP(t,e,a);break;case"core:sequence":CP(t,e,a);break;case"core:parallel":_P(t,e,a);break;case"core:tour":IP(t,e,a);break;case"navigation:navigate":wP(t,e,a);break}return{valid:e.length===0,errors:e,warnings:a}}function ho(t,e,a){let r=t.anchorId;if(!r||typeof r!="object"){e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' object with a 'selector' string",field:"anchorId"});return}if(!r.selector||typeof r.selector!="string"?e.push({code:"MISSING_ANCHOR_SELECTOR",message:"anchorId requires a 'selector' string",field:"anchorId.selector"}):r.selector.length>200&&a.push({code:"LONG_ANCHOR_ID",message:"Anchor selector is unusually long",suggestion:"Consider using a shorter, more descriptive selector"}),r.route===void 0||r.route===null)e.push({code:"MISSING_ANCHOR_ROUTE",message:`anchorId requires a 'route' (string or array of strings). Use "**" for all routes.`,field:"anchorId.route"});else{let n=Array.isArray(r.route)?r.route:[r.route];for(let o of n)if(typeof o!="string"){e.push({code:"INVALID_ANCHOR_ROUTE",message:"anchorId.route must be a string or array of strings",field:"anchorId.route"});break}}}function pP(t,e,a){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&a.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function hP(t,e,a){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Tooltip action requires 'content' object",field:"content"});return}(!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Tooltip content requires 'body' property",field:"content.body"})}function mP(t,e,a){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>gE&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${gE}`,field:"html"});let r=["before","after","prepend","append","replace"];(!t.position||!r.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${r.join(", ")}`,field:"position"})}function gP(t,e,a){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function vP(t,e,a){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(fP.has(t.attr.toLowerCase())||t.attr.toLowerCase().startsWith("on"))&&e.push({code:"DANGEROUS_ATTR",message:`Event handler attributes are not allowed: ${t.attr}`,field:"attr"}),(t.value===void 0||t.value===null)&&e.push({code:"MISSING_VALUE",message:"setAttr action requires 'value' property",field:"value"})}function yP(t,e,a){!t.className||typeof t.className!="string"?e.push({code:"MISSING_CLASS_NAME",message:"Class action requires 'className' property",field:"className"}):/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t.className)||a.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function xP(t,e,a){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let r=Object.keys(t.styles).length;r>vE&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${r}). Maximum is ${vE}`,field:"styles"});for(let[n,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${n}`,field:`styles.${n}`})}}function bP(t,e,a){(!t.slot||typeof t.slot!="string")&&e.push({code:"MISSING_SLOT",message:"mountWidget action requires 'slot' property",field:"slot"}),!t.widget||typeof t.widget!="object"?e.push({code:"MISSING_WIDGET",message:"mountWidget action requires 'widget' object",field:"widget"}):(!t.widget.widgetId||typeof t.widget.widgetId!="string")&&e.push({code:"MISSING_WIDGET_ID",message:"Widget must have a 'widgetId' property",field:"widget.widgetId"})}function SP(t,e,a){t.durationMs===void 0&&!t.event&&e.push({code:"MISSING_WAIT_CONFIG",message:"wait action requires either 'durationMs' or 'event' property"}),t.durationMs!==void 0&&t.durationMs<0&&e.push({code:"INVALID_DURATION",message:"durationMs must be a positive number",field:"durationMs"}),t.event!==void 0&&typeof t.event!="string"&&e.push({code:"INVALID_EVENT",message:"event must be a string",field:"event"})}function CP(t,e,a){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"sequence action requires 'actions' array",field:"actions"});return}t.actions.length===0&&a.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let r=0;r<t.actions.length;r++){let n=ln(t.actions[r]);for(let o of n.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of n.warnings)a.push(o)}}function _P(t,e,a){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"parallel action requires 'actions' array",field:"actions"});return}t.actions.length===0&&a.push({code:"EMPTY_PARALLEL",message:"parallel has no actions",suggestion:"Add at least one action to the parallel group"}),t.waitFor&&!["all","any"].includes(t.waitFor)&&e.push({code:"INVALID_WAIT_FOR",message:"waitFor must be 'all' or 'any'",field:"waitFor"});for(let r=0;r<t.actions.length;r++){let n=ln(t.actions[r]);for(let o of n.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of n.warnings)a.push(o)}}function wP(t,e,a){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let r=t.url.trim().toLowerCase();r.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),r.startsWith("data:")&&a.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function LP(t,e,a){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Modal action requires 'content' object",field:"content"});return}if((!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Modal content requires 'body' property",field:"content.body"}),t.size&&!["sm","md","lg"].includes(t.size)&&e.push({code:"INVALID_SIZE",message:"Modal size must be 'sm', 'md', or 'lg'",field:"size"}),t.ctaButtons)if(!Array.isArray(t.ctaButtons))e.push({code:"INVALID_CTA_BUTTONS",message:"ctaButtons must be an array",field:"ctaButtons"});else for(let r=0;r<t.ctaButtons.length;r++){let n=t.ctaButtons[r];(!n.label||typeof n.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${r} requires 'label' property`,field:`ctaButtons[${r}].label`}),(!n.actionId||typeof n.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${r} requires 'actionId' property`,field:`ctaButtons[${r}].actionId`})}}function IP(t,e,a){if((!t.tourId||typeof t.tourId!="string")&&e.push({code:"MISSING_TOUR_ID",message:"Tour action requires 'tourId' property",field:"tourId"}),!t.steps||!Array.isArray(t.steps)){e.push({code:"MISSING_STEPS",message:"Tour action requires 'steps' array",field:"steps"});return}t.steps.length===0&&e.push({code:"EMPTY_STEPS",message:"Tour must have at least one step",field:"steps"});let r=new Set;for(let n=0;n<t.steps.length;n++){let o=t.steps[n];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${n} requires 'id' property`,field:`steps[${n}].id`}):(r.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${n}].id`}),r.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${n} requires 'action' property`,field:`steps[${n}].action`});else{let i=ln(o.action);for(let s of i.errors)e.push({...s,field:`steps[${n}].action${s.field?`.${s.field}`:""}`});for(let s of i.warnings)a.push(s)}if(o.onAction)for(let[i,s]of Object.entries(o.onAction))s!=="end"&&!t.steps.some(l=>l.id===s)&&a.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${s}`,suggestion:`Make sure step "${s}" exists in the tour`})}}function ah(t){let e=[],a=[];if(!Array.isArray(t))return console.error("[ActionValidation] validateActions called with non-array:",typeof t),e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:a};for(let r=0;r<t.length;r++){let n=ln(t[r]);if(!n.valid){let o=t[r];console.error(`[ActionValidation] Action [${r}] failed validation:`,`kind="${o?.kind??"undefined"}"`,n.errors.map(i=>`${i.code}: ${i.message}`).join("; "),o)}for(let o of n.errors)e.push({...o,field:o.field?`[${r}].${o.field}`:`[${r}]`});for(let o of n.warnings)a.push({...o,suggestion:o.suggestion?`Action ${r}: ${o.suggestion}`:void 0})}return e.length>0&&console.error(`[ActionValidation] Batch validation failed: ${e.length} error(s) in ${t.length} action(s).`,e.map(r=>`${r.field??"?"}: ${r.message}`).join(" | ")),{valid:e.length===0,errors:e,warnings:a}}var AP=0;function rh(t){let{overlayRoot:e,eventBus:a,surfaces:r,anchorResolver:n,waitForAnchor:o,adaptiveId:i,executorRegistry:s=br,subscribeNavigation:l,runtime:u}=t,c=new Map,d=new Map;function p(){return`action-${++AP}`}function g(C,A){a&&a.publish(C,A)}function S(){return{overlayRoot:e,resolveAnchor:n,waitForAnchor:o,generateId:p,publishEvent:g,adaptiveId:i,applyAction:m,subscribeEvent:a?(C,A)=>a.subscribe({names:[C]},E=>A(E.props)):void 0,subscribeNavigation:l}}async function b(C,A){if(!r)throw new Error("Surfaces provider required for core:mountWidget actions");let E=r.mount(C.slot,{type:"widget",widgetId:C.widget.widgetId,config:C.widget.props},{priority:C.widget.priority});return A.publishEvent("action.applied",{id:A.generateId(),kind:"core:mountWidget",slot:C.slot,widgetId:C.widget.widgetId}),{cleanup:()=>{E.unmount()},updateFn:L=>{if("widget"in L&&L.widget){let k=L.widget;k.props&&E.update({type:"widget",widgetId:C.widget.widgetId,config:k.props})}}}}async function x(C,A){if(C.kind==="core:mountWidget")return b(C,A);let E=s.get(C.kind);if(!E){let L="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${C.kind}".`,`Registered: [${L}]`),new Error(`No executor for action kind: ${C.kind}`)}return E(C,A)}function f(C,A,E,L){if(!u)return;let k=[],D=async()=>{let R=c.get(C);if(!R)return;let N=u.evaluateSync(E).value;if(R.state==="applied"&&!N){try{await R.cleanup()}catch(U){console.error(`[ActionEngine] Error reverting conditional action ${C}:`,U)}R.state="deferred",R.cleanup=()=>{},R.updateFn=void 0,g("action.deferred",{id:C,kind:A.kind})}else if(R.state==="deferred"&&N)try{let U=S(),Y=await x(A,U);R.state="applied",R.cleanup=Y.cleanup,R.updateFn=Y.updateFn,R.appliedTs=Date.now(),g("action.applied",{id:C,kind:A.kind,anchorId:"anchorId"in A?A.anchorId:void 0})}catch(U){console.error(`[ActionEngine] Error applying deferred action ${C}:`,U),R.state="failed"}};u.context&&k.push(u.context.subscribe(D)),u.accumulator&&k.push(u.accumulator.subscribe(D)),d.set(C,k)}async function m(C){let A=ln(C);if(!A.valid){let N=A.errors.map(U=>U.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${C?.kind}":`,N,C),new Error(`Action validation failed: ${N}`)}let E=p(),L=C.triggerWhen;if(L&&u&&!u.evaluateSync(L).value){let U={id:E,action:C,adaptiveId:i,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};c.set(E,U);let Y={id:E,action:C,async revert(){let B=c.get(E);if(!B)return;let W=d.get(E);if(W){for(let ve of W)ve();d.delete(E)}B.state="reverted",c.delete(E)},isApplied(){return c.get(E)?.state==="applied"},async update(B){let W=c.get(E);if(!W||W.state!=="applied")throw new Error("Cannot update action that is not applied");if(W.updateFn)await W.updateFn(B);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(E)?.state??"reverted"}};return f(E,C,L,Y),Y}let k=S(),D=await x(C,k),R={id:E,action:C,adaptiveId:i,appliedTs:Date.now(),state:"applied",cleanup:D.cleanup,updateFn:D.updateFn};c.set(E,R),g("action.applied",{id:E,kind:C.kind,anchorId:"anchorId"in C?C.anchorId:void 0});let F={id:E,action:C,async revert(){let N=c.get(E);if(!N||N.state!=="applied")return;let U=d.get(E);if(U){for(let Y of U)Y();d.delete(E)}try{await N.cleanup(),N.state="reverted",g("action.reverted",{id:E,kind:C.kind})}catch(Y){throw N.state="failed",g("action.failed",{id:E,kind:C.kind,error:String(Y)}),Y}finally{c.delete(E)}},isApplied(){return c.get(E)?.state==="applied"},async update(N){let U=c.get(E);if(!U||U.state!=="applied")throw new Error("Cannot update action that is not applied");if(U.updateFn)await U.updateFn(N);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(E)?.state??"reverted"}};return L&&u&&f(E,C,L,F),F}async function v(C){console.log(`[ActionEngine] applyBatch: ${C.length} action(s)`,C.map(R=>R.kind).join(", "));let A=ah(C);if(!A.valid){let R=A.errors.map(F=>F.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${C.length} action(s):`,R,`
|
|
463
|
+
Actions:`,C.map((F,N)=>` [${N}] ${F.kind} ${F.anchorId?`anchor="${typeof F.anchorId=="string"?F.anchorId:F.anchorId.selector}"`:""} ${F.label?`label="${F.label}"`:""}`).join(`
|
|
464
|
+
`)),new Error(`Batch validation failed: ${R}`)}let E=p(),L=[],k=[];try{for(let R of C){let F=await m(R);L.push(F),k.push(F)}}catch(R){console.error(`[ActionEngine] Batch apply FAILED at action ${k.length+1}/${C.length}.`,`Successfully applied: ${k.length}. Rolling back...`,R);for(let F of k)try{await F.revert()}catch{}throw R}return{id:E,handles:L,async revertAll(){for(let R=L.length-1;R>=0;R--)try{await L[R].revert()}catch(F){console.error(`[ActionEngine] Error reverting action ${L[R].id}:`,F)}},isApplied(){return L.every(R=>R.isApplied())}}}function y(C){return ln(C)}function _(){return Array.from(c.values()).map(C=>({id:C.id,action:C.action,adaptiveId:C.adaptiveId,appliedTs:C.appliedTs,state:C.state}))}function w(){for(let C of d.values())for(let A of C)try{A()}catch{}d.clear();for(let C of c.values())if(C.state==="applied")try{C.cleanup()}catch(A){console.error("[ActionEngine] Error during cleanup:",A)}c.clear()}return{apply:m,applyBatch:v,validate:y,getActive:_,destroy:w}}var kP=h.object({selector:h.string(),route:h.union([h.string(),h.array(h.string())])}).strict(),nh=h.object({type:h.literal("page_url"),url:h.string()}),oh=h.object({type:h.literal("route"),routeId:h.string()}),ih=h.object({type:h.literal("anchor_visible"),anchorId:h.string(),state:h.enum(["visible","present","absent"])}),sh=h.object({type:h.literal("event_occurred"),eventName:h.string(),withinMs:h.number().optional()}),lh=h.object({type:h.literal("state_equals"),key:h.string(),value:h.unknown()}),uh=h.object({type:h.literal("viewport"),minWidth:h.number().optional(),maxWidth:h.number().optional(),minHeight:h.number().optional(),maxHeight:h.number().optional()}),ch=h.object({type:h.literal("session_metric"),key:h.string(),operator:h.enum(["gte","lte","eq","gt","lt"]),threshold:h.number()}),dh=h.object({type:h.literal("dismissed"),key:h.string(),inverted:h.boolean().optional()}),fh=h.object({type:h.literal("cooldown_active"),key:h.string(),inverted:h.boolean().optional()}),ph=h.object({type:h.literal("frequency_limit"),key:h.string(),limit:h.number(),inverted:h.boolean().optional()}),Ws=h.object({equals:h.union([h.string(),h.number(),h.boolean()]).optional(),contains:h.string().optional()}),Zs=h.object({events:h.array(h.string()).min(1),match:h.record(h.string(),Ws).optional()}),hh=h.object({type:h.literal("event_count"),key:h.string(),operator:h.enum(["gte","lte","eq","gt","lt"]),count:h.number().int().min(0),withinMs:h.number().positive().optional(),counter:Zs.optional()}),un=h.discriminatedUnion("type",[nh,oh,ih,sh,lh,uh,ch,dh,fh,ph,hh]),Xs=h.object({conditions:h.array(un),value:h.unknown()}),Ys=h.object({type:h.literal("rules"),rules:h.array(Xs),default:h.unknown()}),Ks=h.object({type:h.literal("score"),field:h.string(),threshold:h.number(),above:h.unknown(),below:h.unknown()}),Qs=h.object({type:h.literal("model"),modelId:h.string(),inputs:h.array(h.string()),outputMapping:h.record(h.string(),h.unknown()),default:h.unknown()}),Js=h.object({type:h.literal("external"),endpoint:h.string(),method:h.enum(["GET","POST"]).optional(),default:h.unknown(),timeoutMs:h.number().optional()}),el=h.discriminatedUnion("type",[Ys,Ks,Qs,Js]),pc=el.nullable().optional(),EP=h.object({events:h.array(h.string()),urlContains:h.string().optional(),props:h.record(h.union([h.string(),h.number(),h.boolean()])).optional()}),TP=h.object({title:h.string().optional(),body:h.string().optional(),icon:h.string().optional()}).nullable().optional();var vb=h.object({include:h.array(h.string()).optional().describe("URL patterns where this tile appears. Supports *, **, :param wildcards. Use sparingly \u2014 mostly to isolate to specific webapp functionality. Omit to appear on all routes."),exclude:h.array(h.string()).optional().describe("URL patterns where this tile should NOT appear. Evaluated before include.")}),hc=h.object({routes:vb,onlyIfPopulated:h.boolean().optional().describe("When true, tile is hidden if none of its props.actions[] have an active triggerWhen. Useful for tiles with all-deferred FAQ questions or nav tips. Default: false.")});function RP(t){return un.safeParse(t)}function MP(t){return el.safeParse(t)}function DP(t){return hc.safeParse(t)}var OP=[{defName:"matchOp",schema:Ws},{defName:"counterDef",schema:Zs},{defName:"activationConfig",schema:hc},{defName:"routeFilter",schema:vb},{defName:"ruleStrategy",schema:Ys},{defName:"scoreStrategy",schema:Ks},{defName:"modelStrategy",schema:Qs},{defName:"externalStrategy",schema:Js},{defName:"rule",schema:Xs},{defName:"condition",schema:un}];var yb=h.object({tileId:h.string(),itemId:h.string().optional()}).strict(),BP=h.object({on:h.string(),title:h.string(),body:h.string().optional(),icon:h.string().optional(),ttl:h.number().optional(),cooldown:h.number().optional(),deepLink:yb.optional()}).strict(),FP=h.object({id:h.string(),title:h.string().optional(),subtitle:h.string().optional(),icon:h.string().optional(),priority:h.number().optional(),widget:h.string(),props:h.record(h.unknown()).optional(),activation:hc.optional(),notifications:h.array(BP).optional()}).strict(),NP=h.object({position:h.enum(["left","right"]).optional(),layout:h.enum(["overlay","push"]).optional(),background:h.string().optional(),blur:h.string().optional(),border:h.string().optional(),width:h.string().optional(),transitionDuration:h.string().optional(),transitionEasing:h.string().optional(),transitionFade:h.string().optional()}),PP=h.object({background:h.string().optional(),backgroundHover:h.string().optional(),color:h.string().optional(),size:h.string().optional(),shadow:h.string().optional(),borderRadius:h.string().optional()}),HP=h.object({background:h.string().optional(),backgroundHover:h.string().optional(),border:h.string().optional(),borderRadius:h.string().optional(),shadow:h.string().optional(),titleColor:h.string().optional(),textColor:h.string().optional(),iconBackground:h.string().optional(),iconShadow:h.string().optional(),headerPadding:h.string().optional(),bodyPadding:h.string().optional(),gap:h.string().optional()}),UP=h.object({background:h.string().optional(),textColor:h.string().optional(),titleColor:h.string().optional(),arrowColor:h.string().optional(),arrowSize:h.string().optional(),border:h.string().optional(),borderRadius:h.string().optional(),scrimOpacity:h.string().optional(),highlightRing:h.string().optional()}),qP=h.object({background:h.string().optional(),textColor:h.string().optional(),textSecondaryColor:h.string().optional(),border:h.string().optional(),borderRadius:h.string().optional(),successColor:h.string().optional(),warningColor:h.string().optional(),errorColor:h.string().optional(),iconBackground:h.string().optional(),progressGradient:h.string().optional()}),zP=h.object({background:h.string().optional(),backgroundHover:h.string().optional(),border:h.string().optional(),borderRadius:h.string().optional(),textColor:h.string().optional(),textSecondaryColor:h.string().optional(),itemDivider:h.string().optional(),itemGap:h.string().optional(),itemPadding:h.string().optional(),itemFontSize:h.string().optional(),bodyPadding:h.string().optional(),bodyFontSize:h.string().optional(),categoryPadding:h.string().optional(),categoryGap:h.string().optional(),categoryFontSize:h.string().optional(),searchBackground:h.string().optional(),searchColor:h.string().optional(),chevronColor:h.string().optional()}),VP=h.object({mode:h.enum(["dark","light"]).optional(),fontFamily:h.string().optional(),colorPrimary:h.string().optional(),colorPrimaryHover:h.string().optional(),borderRadius:h.string().optional(),canvas:NP.optional(),launcher:PP.optional(),tile:HP.optional(),overlay:UP.optional(),notification:qP.optional(),content:zP.optional()}).strict(),$P=h.object({enabled:h.boolean().optional(),label:h.string().optional(),icon:h.string().optional(),position:h.string().optional(),animate:h.boolean().optional(),animationStyle:h.enum(["pulse","bounce","glow"]).optional(),notificationCount:h.number().optional()}).strict(),Vz=h.object({schemaVersion:h.string().optional(),fetchedAt:h.string().datetime(),configVersion:h.string().optional(),canvasTitle:h.string().optional(),tiles:h.array(FP),actions:h.array(h.any()),theme:VP.optional(),launcher:$P.optional(),meta:h.object({verificationSteps:h.array(h.union([h.string(),h.object({text:h.string(),check:un.optional()})])).optional()}).passthrough().optional()}).strict();var gt={triggerWhen:pc},ya=h.object({selector:h.string(),route:h.union([h.string(),h.array(h.string())])}).strict(),xb=h.object({color:h.string().optional(),scrimOpacity:h.number().min(0).max(1).optional(),paddingPx:h.number().optional(),radiusPx:h.number().optional()}).strict(),bb=h.enum(["top-left","top-right","bottom-left","bottom-right"]),Sb=h.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),gh=h.object({label:h.string(),actionId:h.string(),primary:h.boolean().optional()}).strict(),Cb=h.object({title:h.string().optional(),body:h.string(),ctaButtons:h.array(gh).optional()}).strict(),_b=h.object({title:h.string().optional(),body:h.string()}).strict(),wb=h.enum(["before","after","prepend","append","replace"]),Lb=h.enum(["immediate","hover","click"]),Ib=h.object({widgetId:h.string(),props:h.record(h.unknown()).optional(),priority:h.number().optional()}).strict(),Ab=h.object({id:h.string(),action:h.any(),route:h.string().optional(),onAction:h.record(h.string()).optional()}).passthrough(),kb=h.enum(["auto","smooth","instant"]),mh=h.enum(["start","center","end","nearest"]),Eb=h.object({kind:h.literal("content:setText"),anchorId:ya,text:h.string(),label:h.string().optional()}).extend(gt).strict(),Tb=h.object({kind:h.literal("content:setAttr"),anchorId:ya,attr:h.string(),value:h.string(),label:h.string().optional()}).extend(gt).strict(),Rb=h.object({kind:h.literal("content:addClass"),anchorId:ya,className:h.string(),label:h.string().optional()}).extend(gt).strict(),Mb=h.object({kind:h.literal("content:removeClass"),anchorId:ya,className:h.string(),label:h.string().optional()}).extend(gt).strict(),Db=h.object({kind:h.literal("content:setStyle"),anchorId:ya,styles:h.record(h.string()),label:h.string().optional()}).extend(gt).strict(),Ob=h.object({kind:h.literal("content:insertHtml"),anchorId:ya,html:h.string(),position:wb,deepLink:yb.optional(),label:h.string().optional()}).extend(gt).strict(),Bb=h.object({kind:h.literal("overlays:highlight"),anchorId:ya,style:xb.optional(),duration:h.number().optional(),label:h.string().optional()}).extend(gt).strict(),Fb=h.object({kind:h.literal("overlays:pulse"),anchorId:ya,duration:h.number().optional(),label:h.string().optional()}).extend(gt).strict(),Nb=h.object({kind:h.literal("overlays:badge"),anchorId:ya,content:h.string(),position:bb.optional(),label:h.string().optional()}).extend(gt).strict(),Pb=h.object({kind:h.literal("overlays:tooltip"),anchorId:ya,content:Cb,trigger:Lb.optional(),placement:Sb.optional(),waitFor:h.string().optional(),label:h.string().optional()}).extend(gt).strict(),Hb=h.object({kind:h.literal("overlays:modal"),content:_b,size:h.enum(["sm","md","lg"]).optional(),blocking:h.boolean().optional(),scrim:h.object({opacity:h.number().min(0).max(1).optional()}).strict().optional(),dismiss:h.object({onEsc:h.boolean().optional(),closeButton:h.boolean().optional(),timeoutMs:h.number().min(0).optional()}).strict().optional(),ctaButtons:h.array(gh).optional(),waitFor:h.string().optional(),label:h.string().optional()}).extend(gt).strict(),Ub=h.object({kind:h.literal("navigation:scrollTo"),anchorId:ya,behavior:kb.optional(),block:mh.optional(),inline:mh.optional(),label:h.string().optional()}).extend(gt).strict(),qb=h.object({kind:h.literal("navigation:navigate"),url:h.string(),target:h.enum(["_self","_blank"]).optional(),label:h.string().optional()}).extend(gt).strict(),zb=h.object({kind:h.literal("core:mountWidget"),slot:h.string(),widget:Ib,label:h.string().optional()}).extend(gt).strict(),Vb=h.object({kind:h.literal("core:wait"),durationMs:h.number().min(0).optional(),event:h.string().optional(),label:h.string().optional()}).extend(gt).strict(),$b=h.object({kind:h.literal("core:sequence"),actions:h.array(h.any()),label:h.string().optional()}).extend(gt).strict(),jb=h.object({kind:h.literal("core:parallel"),actions:h.array(h.any()),waitFor:h.enum(["all","any"]).optional(),label:h.string().optional()}).extend(gt).strict(),Gb=h.object({kind:h.literal("core:tour"),tourId:h.string(),steps:h.array(Ab).min(1),startStep:h.string().optional(),autoStart:h.boolean().optional(),label:h.string().optional()}).extend(gt).passthrough(),yE=[{defName:"setText",schema:Eb},{defName:"setAttr",schema:Tb},{defName:"addClass",schema:Rb},{defName:"removeClass",schema:Mb},{defName:"setStyle",schema:Db},{defName:"insertHtml",schema:Ob},{defName:"highlight",schema:Bb},{defName:"pulse",schema:Fb},{defName:"badge",schema:Nb},{defName:"tooltip",schema:Pb},{defName:"modal",schema:Hb},{defName:"scrollTo",schema:Ub},{defName:"navigate",schema:qb},{defName:"mountWidget",schema:zb},{defName:"wait",schema:Vb},{defName:"sequence",schema:$b},{defName:"parallel",schema:jb},{defName:"tour",schema:Gb}];function vh(t){let e=t?.root??(typeof document<"u"?document.body:null),a=t?.defaultTimeoutMs??5e3,r=new Map,n=new Map,o=null,i=!1;function s(x){if(!e)return null;try{return e.querySelector(x)}catch{return null}}function l(){for(let[x,f]of r){let m=s(x);if(m){for(let v of f)clearTimeout(v.timer),v.resolve(m);r.delete(x)}}for(let[x,f]of n){let m=s(x);if(m){for(let v of f)v.cancelled||v.cb(m);n.delete(x)}}r.size===0&&n.size===0&&c()}function u(){o||i||typeof MutationObserver>"u"||!e||(o=new MutationObserver(()=>{l()}),o.observe(e,{childList:!0,subtree:!0}))}function c(){o&&(o.disconnect(),o=null)}function d(x,f){let m=r.get(x);m&&(m.delete(f),m.size===0&&r.delete(x)),r.size===0&&n.size===0&&c()}function p(x,f){if(i)return Promise.reject(new Error("AnchorResolver destroyed"));let m=s(x);if(m)return Promise.resolve(m);let v=f??a;return new Promise((y,_)=>{let w={resolve:y,reject:_,timer:setTimeout(()=>{d(x,w),_(new Error(`waitFor("${x}") timed out after ${v}ms`))},v)},C=r.get(x);C||(C=new Set,r.set(x,C)),C.add(w),u()})}function g(x,f){if(i)return()=>{};let m=s(x);if(m)return f(m),()=>{};let v={cb:f,cancelled:!1},y=n.get(x);return y||(y=new Set,n.set(x,y)),y.add(v),u(),()=>{v.cancelled=!0;let _=n.get(x);_&&(_.delete(v),_.size===0&&n.delete(x)),r.size===0&&n.size===0&&c()}}function S(){let x=0;for(let f of r.values())x+=f.size;return x}function b(){i=!0,c();let x=new Error("AnchorResolver destroyed");for(let f of r.values())for(let m of f)clearTimeout(m.timer),m.reject(x);r.clear(),n.clear()}return{resolve:s,waitFor:p,onAppear:g,pendingCount:S,destroy:b}}function jP(){let t=Date.now();return{page:{url:typeof window<"u"?window.location.href:"",title:typeof document<"u"?document.title:void 0},session:{sessionId:"",startTs:t,pageHistory:[]},viewport:{width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0}}}function Wb(t,e){if(!e)return;let a;try{a=new URL(t).pathname}catch{a=t}if(e.exclude){for(let r of e.exclude)if(xE(a,r))return}if(e.include){for(let r of e.include)if(xE(a,r))return r;return}return a}function xE(t,e){let a=t.replace(/\/$/,"")||"/",r=e.replace(/\/$/,"")||"/";if(a===r)return!0;let n=r.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${n}$`).test(a)}var mc=class{constructor(e={}){$(this,"context");$(this,"previousContext");$(this,"listeners",new Set);$(this,"telemetry");$(this,"routes");$(this,"navigation");$(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=jP(),this.previousContext={...this.context},e.telemetry?.getSessionId){let a=e.telemetry.getSessionId();a&&(this.context.session.sessionId=a)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=Wb(this.context.page.url,this.routes),this.addPageToHistory(this.context.page.url),typeof window<"u"&&this.setupBrowserListeners()}get(){return{...this.context}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setRoutes(e){this.routes=e;let a=Wb(this.context.page.url,this.routes);a!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:a}})}setAnchors(e){this.updateContext({anchors:e})}setSessionId(e){e!==this.context.session.sessionId&&this.updateContext({session:{...this.context.session,sessionId:e}})}destroy(){for(let e of this.cleanupFns)e();this.cleanupFns=[],this.listeners.clear()}setupBrowserListeners(){let e,a=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};if(window.addEventListener("resize",a),this.cleanupFns.push(()=>window.removeEventListener("resize",a)),this.navigation){let r=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(r)}else{let r=()=>{this.updatePage()};window.addEventListener("popstate",r),this.cleanupFns.push(()=>window.removeEventListener("popstate",r));let n=history.pushState.bind(history),o=history.replaceState.bind(history);history.pushState=(...i)=>{n(...i),queueMicrotask(()=>this.updatePage())},history.replaceState=(...i)=>{o(...i),queueMicrotask(()=>this.updatePage())},this.cleanupFns.push(()=>{history.pushState=n,history.replaceState=o})}}updateViewport(){let e={width:window.innerWidth,height:window.innerHeight};(e.width!==this.context.viewport.width||e.height!==this.context.viewport.height)&&this.updateContext({viewport:e})}updatePage(){let e=window.location.href,{title:a}=document,r=Wb(e,this.routes),n={url:e,title:a,routeId:r};(n.url!==this.context.page.url||n.title!==this.context.page.title||n.routeId!==this.context.page.routeId)&&(n.url!==this.context.page.url&&this.addPageToHistory(n.url),this.updateContext({page:n}))}addPageToHistory(e){let a={url:e,ts:Date.now()},r=[...this.context.session.pageHistory||[],a];r.length>50&&r.shift(),this.context.session.pageHistory=r}updateContext(e){this.previousContext={...this.context},this.context={...this.context,...e},this.notifyListeners()}notifyListeners(){for(let e of this.listeners)try{e(this.context,this.previousContext)}catch(a){console.error("[ContextManager] Listener error:",a)}}};function yh(t={}){return new mc(t)}var bE=h.object({url:h.string(),routeId:h.string().optional(),title:h.string().optional(),locale:h.string().optional()}),SE=h.object({url:h.string(),ts:h.number()}),CE=h.object({sessionId:h.string(),startTs:h.number(),pageHistory:h.array(SE).optional()}),_E=h.object({width:h.number(),height:h.number()}),wE=h.object({x:h.number(),y:h.number(),w:h.number(),h:h.number()}),LE=h.object({anchorId:h.string(),present:h.boolean(),visible:h.boolean().optional(),boundingBox:wE.optional()}),IE=h.record(h.string(),h.union([h.number(),h.string(),h.boolean(),h.undefined()])),AE=h.object({page:bE,session:CE,viewport:_E,anchors:h.array(LE).optional(),augmented:IE.optional()});function GP(t){return AE.safeParse(t)}function Zb(t,e){let{context:a,state:r,events:n}=e;switch(t.type){case"page_url":{let{url:o}=t,i=a.page.url.split("?")[0].split("#")[0],s=o.replace(/\*\*/g,"\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*");return new RegExp(`^${s}$`).test(i)}case"route":return a.page.routeId===t.routeId;case"anchor_visible":{let o=typeof t.anchorId=="string"?t.anchorId:t.anchorId?.selector??"",i=a.anchors?.find(s=>s.anchorId===o);switch(t.state){case"visible":return i?.visible===!0;case"present":return i?.present===!0;case"absent":return!i?.present;default:return!1}}case"event_occurred":{if(!n)return!1;let o=t.withinMs??6e4;return n.hasRecentEvent(t.eventName,o)}case"state_equals":return!1;case"viewport":{let{width:o,height:i}=a.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&i<t.minHeight||t.maxHeight!==void 0&&i>t.maxHeight)}case"session_metric":{if(!r)return!1;let o=r.getSessionMetric(t.key),{operator:i,threshold:s}=t;switch(i){case"gte":return o>=s;case"lte":return o<=s;case"eq":return o===s;case"gt":return o>s;case"lt":return o<s;default:return!1}}case"dismissed":{if(!r)return t.inverted??!1;let o=r.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!r)return t.inverted??!1;let o=r.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!r)return t.inverted??!1;let i=r.getFrequencyCount(t.key)>=t.limit;return t.inverted?!i:i}case"event_count":{if(!e.accumulator)return!1;let o=t,i=e.accumulator.getCount(o.key,o.withinMs);switch(o.operator){case"gte":return i>=o.count;case"lte":return i<=o.count;case"eq":return i===o.count;case"gt":return i>o.count;case"lt":return i<o.count;default:return!1}}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function Xb(t,e){let a=[];for(let r of t.conditions){let n=Zb(r,e);if(a.push({condition:r,result:n}),!n)return{matched:!1,conditionResults:a}}return{matched:!0,conditionResults:a}}function gc(t,e){for(let a=0;a<t.rules.length;a++){let r=t.rules[a],{matched:n,conditionResults:o}=Xb(r,e);if(n)return{value:r.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:a,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function vc(t,e){let{context:a}=e,r=a.augmented?.[t.field];return r===void 0||typeof r!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:r>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function kE(t,e){let{state:a,events:r,sessionMetrics:n,accumulator:o}=e;return{context:t,state:a?{isDismissed:i=>a.dismissals.isDismissed(i),isCooldownActive:i=>a.cooldowns.isActive(i),getFrequencyCount:i=>a.frequency.count(i),getSessionMetric:i=>n?.get(i)??0}:void 0,events:r?{hasRecentEvent:(i,s)=>r.hasRecentEvent(i,s)}:void 0,accumulator:o?{getCount:(i,s)=>o.getCount(i,s)}:void 0}}async function Yb(t,e,a={}){let r=kE(e,a);switch(t.type){case"rules":return gc(t,r);case"score":return vc(t,r);case"model":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"model"}};case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"external"}};default:return console.warn("[DecisionEngine] Unknown strategy type:",t.type),{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function Kb(t,e,a={}){let r=kE(e,a);switch(t.type){case"rules":return gc(t,r);case"score":return vc(t,r);case"model":case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:t.type}};default:return{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function xh(t){return{evaluate:(e,a)=>Yb(e,a,t),evaluateSync:(e,a)=>Kb(e,a,t)}}function bh(t){let{eventBus:e,stateStore:a}=t,r=new Map,n=new Set,o=null,i=a.ns("accumulator");function s(u){let c=!1;for(let d of r.values()){if(!d.predicate(u))continue;let p=i.get(d.stateKey)||{count:0};p.count++,d.needsTimestamps&&(p.timestamps||(p.timestamps=[]),p.timestamps.push(u.ts),p.timestamps.length>200&&(p.timestamps=p.timestamps.slice(-200))),i.set(d.stateKey,p),c=!0}if(c)for(let d of n)try{d()}catch(p){console.error("[EventAccumulator] Subscriber error:",p)}}function l(){o||r.size===0||(o=e.subscribe(s))}return{register(u,c,d=!1){let p=`ev:${u}`,g=r.get(p);if(g){d&&!g.needsTimestamps&&(g.needsTimestamps=!0);return}r.set(p,{stateKey:p,needsTimestamps:d,predicate:c}),l()},getCount(u,c){let d=`ev:${u}`,p=i.get(d);if(!p)return 0;if(c===void 0||!p.timestamps)return p.count;let g=Date.now()-c;return p.timestamps.filter(S=>S>=g).length},subscribe(u){return n.add(u),()=>{n.delete(u)}},destroy(){o&&(o(),o=null),r.clear(),n.clear()}}}function Qb(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(r=>{try{return new RegExp(r).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var yc=class{constructor(e={}){$(this,"subscriptions",new Set);$(this,"history",[]);$(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,a){let r,n;typeof e=="function"?(r=void 0,n=e):(r=e,n=a);let o={filter:r,callback:n};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,a,r="canvas"){let n={ts:Date.now(),name:e,source:r,props:a,schemaVersion:Go};this.publishEvent(n)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let a of this.subscriptions)if(Qb(e,a.filter))try{a.callback(e)}catch(r){console.error("[EventBus] Subscriber error:",r)}}getRecent(e,a){let r=this.history;return e&&(r=r.filter(n=>Qb(n,e))),a&&a>0&&(r=r.slice(-a)),r}hasRecentEvent(e,a,r){let n=Date.now()-a;return this.history.some(o=>o.name===e&&o.ts>=n&&(r===void 0||o.source===r))}countRecentEvents(e,a){let r=this.history.filter(n=>Qb(n,e));if(a!==void 0){let n=Date.now()-a;r=r.filter(o=>o.ts>=n)}return r.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function tl(t={}){return new yc(t)}var EE={$autocapture:"ui.click",$click:be.UI_CLICK,$scroll:be.UI_SCROLL,$input:be.UI_INPUT,$change:be.UI_CHANGE,$submit:be.UI_SUBMIT,$pageview:be.NAV_PAGE_VIEW,$pageleave:be.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function WP(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(EE[e])return EE[e];if(e==="$autocapture"){let a=t.properties?.$tag_name,r=t.properties?.$event_type;return r==="submit"?be.UI_SUBMIT:r==="change"?be.UI_CHANGE:a==="input"||a==="textarea"?be.UI_INPUT:be.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function ZP(t){let e={},a=t.properties||{},r=a.$elements;return a.$tag_name?e.tagName=a.$tag_name:r?.[0]?.tag_name&&(e.tagName=r[0].tag_name),a.$el_text&&(e.elementText=a.$el_text),r&&(e.elements=r),a.$current_url&&(e.url=a.$current_url),a.$pathname&&(e.pathname=a.$pathname),a.$host&&(e.host=a.$host),a.$viewport_width&&(e.viewportWidth=a.$viewport_width),a.$viewport_height&&(e.viewportHeight=a.$viewport_height),a.$session_id&&(e.sessionId=a.$session_id),a.$scroll_depth&&(e.scrollDepth=a.$scroll_depth),a.$scroll_percentage&&(e.scrollPercentage=a.$scroll_percentage),e.originalEvent=t.event,e}function Jb(t){let e;return typeof t.timestamp=="number"?e=t.timestamp:typeof t.timestamp=="string"?e=new Date(t.timestamp).getTime():e=Date.now(),{ts:e,name:WP(t),source:"posthog",props:ZP(t),schemaVersion:Go}}function eS(t){let e=t.event;return!(typeof e!="string"||["$feature_flag_called","$feature_flags","$groups","$groupidentify","$set","$set_once","$unset","$create_alias","$capture_metrics","$performance_event","$web_vitals","$exception","$dead_click","$heatmap"].includes(e))}function Sh(t){return(e,a)=>{if(typeof e!="string")return;let r={event:e,properties:a,timestamp:Date.now()};if(eS(r)){let n=Jb(r);t(n)}}}var tS=h.enum(["posthog","canvas","derived"]),TE=h.object({ts:h.number(),name:h.string(),source:tS,props:h.record(h.string(),h.unknown()).optional(),schemaVersion:h.string()}),RE=h.object({names:h.array(h.string()).optional(),patterns:h.array(h.string()).optional(),sources:h.array(tS).optional()});function XP(t){return TE.safeParse(t)}function YP(t){return RE.safeParse(t)}var al=class{constructor(){$(this,"listeners",new Set);$(this,"capturedPushState");$(this,"capturedReplaceState");$(this,"wasNative");$(this,"destroyed",!1);$(this,"onPopState",()=>{this.notify(window.location.href,"popstate")});this.wasNative=this.isNativeFunction(history.pushState),this.capturedPushState=history.pushState,this.capturedReplaceState=history.replaceState,history.pushState=(...e)=>{this.capturedPushState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"pushState"))},history.replaceState=(...e)=>{this.capturedReplaceState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"replaceState"))},window.addEventListener("popstate",this.onPopState)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}diagnose(){return{isNative:this.wasNative,subscriberCount:this.listeners.size}}destroy(){this.destroyed||(this.destroyed=!0,history.pushState=this.capturedPushState,history.replaceState=this.capturedReplaceState,window.removeEventListener("popstate",this.onPopState),this.listeners.clear())}notify(e,a){if(!this.destroyed)for(let r of this.listeners)try{r(e,a)}catch{}}isNativeFunction(e){try{return Function.prototype.toString.call(e).includes("[native code]")}catch{return!1}}};var aS="cooldown:";function ME(t){return{set(e,a){let r=aS+e,n=Date.now()+a;t.set(r,n)},isActive(e){return this.remaining(e)>0},remaining(e){let a=aS+e,r=t.get(a);if(r===void 0)return 0;let n=r-Date.now();return n<=0?(t.remove(a),0):n},clear(e){let a=aS+e;t.remove(a)}}}var xc="dismissed:";function DE(t,e){return{mark(a,r=!1){let n=xc+a;(r?e:t).set(n,!0)},isDismissed(a){let r=xc+a;return t.has(r)||e.has(r)},clear(a){let r=xc+a;t.remove(r),e.remove(r)},clearAll(){for(let a of t.keys())a.startsWith(xc)&&t.remove(a);for(let a of e.keys())a.startsWith(xc)&&e.remove(a)}}}var rS="freq:";function OE(t){function e(a){let r=rS+a,n=t.get(r);if(n){if(n.resetAt&&Date.now()>=n.resetAt){t.remove(r);return}return n}}return{increment(a,r){let n=rS+a,o=e(a),i=(o?.count??0)+1,s={count:i,resetAt:o?.resetAt??(r?Date.now()+r:void 0)};return t.set(n,s),i},count(a){return e(a)?.count??0},reset(a){let r=rS+a;t.remove(r)},hasReachedLimit(a,r){return this.count(a)>=r}}}var KP="syntro";function nS(t,e){let a=`${e}:`;return{get(r){if(t)try{let n=t.getItem(a+r);if(!n)return;let o=JSON.parse(n);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(a+r);return}return o.value}catch{return}},set(r,n,o){if(t)try{let i={value:n,expiresAt:o?Date.now()+o:void 0};t.setItem(a+r,JSON.stringify(i))}catch(i){console.warn("[StateStore] Failed to save:",i)}},remove(r){t&&t.removeItem(a+r)},has(r){return t?this.get(r)!==void 0:!1},keys(){if(!t)return[];let r=[];for(let n=0;n<t.length;n++){let o=t.key(n);o?.startsWith(a)&&r.push(o.slice(a.length))}return r},clear(){if(!t)return;let r=this.keys();for(let n of r)t.removeItem(a+n)}}}function oS(t){let e=new Map,a=`${t}:`;return{get(r){let n=e.get(a+r);if(n){if(n.expiresAt&&Date.now()>=n.expiresAt){e.delete(a+r);return}return n.value}},set(r,n,o){e.set(a+r,{value:n,expiresAt:o?Date.now()+o:void 0})},remove(r){e.delete(a+r)},has(r){return this.get(r)!==void 0},keys(){let r=[];for(let n of e.keys())n.startsWith(a)&&r.push(n.slice(a.length));return r},clear(){for(let r of e.keys())r.startsWith(a)&&e.delete(r)}}}var bc=class{constructor(e={}){$(this,"session");$(this,"user");$(this,"dismissals");$(this,"cooldowns");$(this,"frequency");$(this,"namespace");$(this,"namespacedStorages",new Map);this.namespace=e.namespace??KP,typeof window<"u"?(this.session=nS(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=nS(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=oS(this.namespace),this.user=oS(this.namespace)),this.dismissals=DE(this.session,this.user),this.cooldowns=ME(this.user),this.frequency=OE(this.session)}ns(e){let a=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(a)){let r=typeof window<"u"&&typeof sessionStorage<"u"?nS(sessionStorage,a):oS(a);this.namespacedStorages.set(a,r)}return this.namespacedStorages.get(a)}};function Ch(t={}){return new bc(t)}function rl(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function Sc(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var iS={drawer_right:{position:"fixed",top:"0",right:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_left:{position:"fixed",top:"0",left:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_bottom:{position:"fixed",left:"0",right:"0",bottom:"0",maxHeight:"50vh"},overlay_center:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxWidth:"90vw",maxHeight:"90vh"},overlay_corner_br:{position:"fixed",bottom:"16px",right:"16px",maxWidth:"400px",maxHeight:"80vh"},overlay_corner_bl:{position:"fixed",bottom:"16px",left:"16px",maxWidth:"400px",maxHeight:"80vh"},toast_top:{position:"fixed",top:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"},toast_bottom:{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"}},nl={fade:[{opacity:0},{opacity:1}],slide:[{opacity:0,transform:"translateY(10px)"},{opacity:1,transform:"translateY(0)"}],scale:[{opacity:0,transform:"scale(0.95)"},{opacity:1,transform:"scale(1)"}],none:[]},BE={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function _h(t,e,a){let r=iS[e];Object.assign(t.style,r),a&&(a.maxWidth&&(t.style.maxWidth=a.maxWidth),a.maxHeight&&(t.style.maxHeight=a.maxHeight),a.minWidth&&(t.style.minWidth=a.minWidth),a.minHeight&&(t.style.minHeight=a.minHeight))}function wh(t,e,a){let r=a.placement==="auto"?"bottom":a.placement,n=[mf(a.offset?{mainAxis:a.offset.y,crossAxis:a.offset.x}:8)];return a.flip!==!1&&n.push(vf()),a.shift!==!1&&n.push(gf({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",hf(e,t,async()=>{let{x:i,y:s,strategy:l}=await yf(e,t,{placement:r,middleware:n});Object.assign(t.style,{position:l,left:`${i}px`,top:`${s}px`})})}function Lh(t,e,a="append"){return t.style.position="relative",t.style.display="inline-block",a==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function Ih(t,e){return e==="none"||nl[e].length===0?null:t.animate(nl[e],BE)}function Ah(t,e){if(e==="none"||nl[e].length===0)return Promise.resolve();let a=[...nl[e]].reverse(),r=t.animate(a,BE);return new Promise(n=>{r.onfinish=()=>n(),r.oncancel=()=>n()})}function kh(t,e){let a=document.createElement("div");return a.setAttribute("data-syntro-surface",t),a.setAttribute("data-syntro-mount-id",e),a.className="syntro-surface",Object.assign(a.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),a}function Eh(t){switch(rl(t)){case"static":return t.startsWith("drawer")?2147483640:t.startsWith("overlay")?2147483642:t.startsWith("toast")?2147483644:2147483640;case"inline":return 1;case"adjacent":return 2147483638;default:return 2147483640}}function FE(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),u=document.createElement("div");return u.append(l),u.innerHTML}catch{}let a=document.createElement("template");a.innerHTML=t;let r=a.content,n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]),i=[];for(;n.nextNode();){let s=n.currentNode,l=s.tagName.toLowerCase();if(!o.has(l)){i.push(s);continue}for(let u of Array.from(s.attributes)){let c=u.name.toLowerCase(),d=u.value.trim().toLowerCase(),p=c.startsWith("on"),g=(c==="href"||c==="src")&&d.startsWith("javascript:");(p||g)&&s.removeAttribute(u.name)}}for(let s of i){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return a.innerHTML=(r.firstChild,a.innerHTML)}var QP=0;function Th(t){let{overlayRoot:e,eventBus:a,anchorResolver:r,defaultAnimation:n="fade",widgetRegistry:o}=t,i=new Map,s=new Map,l=new Map;function u(){return`mount-${++QP}`}function c(y,_){a&&a.publish(y,_)}function d(y){let _=l.get(y);if(_){let w=x(y);for(let C of _)try{C(w)}catch(A){console.error("[Surfaces] State callback error:",A)}}}let p=new Map;function g(y,_,w){switch(_.type){case"html":y.innerHTML=FE(_.content);return;case"widget":{if(o?.has(_.widgetId)){let C=o.mount(_.widgetId,y,_.config);return w&&p.set(w,C),()=>{C.unmount(),w&&p.delete(w)}}console.warn(`[Surfaces] Widget not found: ${_.widgetId}`),y.innerHTML=`<div data-widget-id="${_.widgetId}" data-widget-missing="true">Widget: ${_.widgetId}</div>`;return}case"custom":return _.mount(y);case"react":y.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function S(y,_,w){let C=u(),A=rl(y),E=w?.priority??0,L=w?.animation??n,k=w?.exclusive??!0,D=i.get(y);if(D&&k){if(D.options.priority>E)throw new Error(`Slot ${y} is occupied by higher priority content (${D.options.priority} > ${E})`);b(D)}let R=kh(y,C);R.style.zIndex=String(Eh(y));let F;if(A==="static")_h(R,y,w?.constraints),e.appendChild(R);else if(A==="inline"){let B=Sc(y);if(!B)throw new Error(`Invalid inline slot: ${y}`);if(!r)throw new Error("Anchor resolver required for inline slots");let W=r({selector:B,route:"**"});if(!W)throw new Error(`Anchor not found for inline slot: ${B}`);F=Lh(R,W)}else if(A==="adjacent"){let B=Sc(y);if(!B)throw new Error(`Invalid adjacent slot: ${y}`);if(!r)throw new Error("Anchor resolver required for adjacent slots");let W=r({selector:B,route:"**"});if(!W)throw new Error(`Anchor not found for adjacent slot: ${B}`);e.appendChild(R),F=wh(R,W,w?.position??{placement:"bottom"})}let N=g(R,_,C);Ih(R,L);let U={id:C,slot:y,content:_,options:{priority:E,exclusive:k,animation:L,position:w?.position??{placement:"auto"},constraints:w?.constraints??{},adaptiveId:w?.adaptiveId,autoUnmountOnRouteChange:w?.autoUnmountOnRouteChange??!0},container:R,cleanup:()=>{F?.(),N?.()},mountedAt:Date.now()};return i.set(y,U),s.set(y,(s.get(y)??0)+1),c("surface.mounted",{slot:y,id:C,adaptiveId:w?.adaptiveId}),d(y),{id:C,update(B){let W=i.get(y);if(!W||W.id!==C)throw new Error("Mount no longer active");let ve=p.get(C);if(ve){if(B.type==="widget"){ve.update(B.config),W.content=B;return}ve.unmount(),p.delete(C)}W.container.innerHTML="";let Ha=g(W.container,B,C);if(W.content=B,Ha){let dt=W.cleanup;W.cleanup=()=>{dt?.(),Ha()}}},setOptions(B){let W=i.get(y);if(!W||W.id!==C)throw new Error("Mount no longer active");B.priority!==void 0&&(W.options.priority=B.priority),B.animation!==void 0&&(W.options.animation=B.animation),B.constraints&&A==="static"&&(B.constraints.maxWidth&&(W.container.style.maxWidth=B.constraints.maxWidth),B.constraints.maxHeight&&(W.container.style.maxHeight=B.constraints.maxHeight),B.constraints.minWidth&&(W.container.style.minWidth=B.constraints.minWidth),B.constraints.minHeight&&(W.container.style.minHeight=B.constraints.minHeight)),d(y)},async unmount(){let B=i.get(y);!B||B.id!==C||await b(B)},isMounted(){return i.get(y)?.id===C},getContainer(){let B=i.get(y);return B?.id===C?B.container:null}}}async function b(y){await Ah(y.container,y.options.animation),y.cleanup?.(),y.container.remove(),i.delete(y.slot),c("surface.unmounted",{slot:y.slot,id:y.id}),d(y.slot)}function x(y){let _=i.get(y);return{slot:y,occupied:!!_,currentPriority:_?.options.priority,currentAdaptiveId:_?.options.adaptiveId,mountCount:s.get(y)??0,currentMountId:_?.id}}function f(y,_){let w=l.get(y);return w||(w=new Set,l.set(y,w)),w.add(_),()=>{w?.delete(_),w?.size===0&&l.delete(y)}}function m(y,_){let w=i.get(y);return w?_!==void 0?_>=w.options.priority:!1:!0}function v(){for(let y of i.values())try{y.cleanup?.(),y.container.remove()}catch(_){console.error("[Surfaces] Error during cleanup:",_)}i.clear(),l.clear()}return{mount:S,getState:x,onStateChange:f,canMount:m,destroy:v}}var Cc=class{constructor(){$(this,"widgets",new Map);$(this,"mountedWidgets",new Map);$(this,"mountIdCounter",0);$(this,"runtimeRef");$(this,"listeners",new Set)}bindRuntime(e){this.runtimeRef=e}register(e,a,r="custom",n){if(this.widgets.has(e)){if(this.widgets.get(e).source==="built-in")throw new Error(`Cannot override built-in widget: ${e}`);console.warn(`[WidgetRegistry] Overriding widget: ${e}`)}this.widgets.set(e,{id:e,widget:a,source:r,metadata:n}),this.notify({type:"registered",widgetId:e})}unregister(e){let a=this.widgets.get(e);return a?a.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),this.notify({type:"unregistered",widgetId:e}),!0):!1}unregisterBySource(e){for(let[a,r]of this.widgets.entries())r.source===e&&this.widgets.delete(a)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,a,r){let n=this.widgets.get(e);if(!n)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;a.setAttribute("data-widget-mount-id",o),a.setAttribute("data-widget-id",e);let i={...r,runtime:this.runtimeRef},s=n.widget.mount(a,i);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:a}),{widgetId:e,container:a,unmount:()=>{let u=this.mountedWidgets.get(o);u&&(u.cleanup?.(),this.mountedWidgets.delete(o),a.removeAttribute("data-widget-mount-id"),a.removeAttribute("data-widget-id"),a.innerHTML="")},update:u=>{if(n.widget.update)n.widget.update(a,u);else{let c=this.mountedWidgets.get(o);if(c){c.cleanup?.(),a.innerHTML="";let d={...u,runtime:this.runtimeRef},p=n.widget.mount(a,d);c.cleanup=p??void 0}}}}}list(){return Array.from(this.widgets.keys())}listRegistrations(){return Array.from(this.widgets.values())}getBySource(e){return Array.from(this.widgets.values()).filter(a=>a.source===e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){for(let a of this.listeners)try{a(e)}catch(r){console.error("[WidgetRegistry] Listener error:",r)}}destroy(){for(let[e,a]of this.mountedWidgets.entries())a.cleanup?.(),a.container.innerHTML="";this.mountedWidgets.clear()}},Rh=new Cc;var lS="2.0.0";function JP(t,e){if(!e)return!0;let a;try{a=new URL(t).pathname}catch{a=t}let r=a.replace(/\/$/,"")||"/";if(e.exclude){for(let n of e.exclude)if(sS(r,n))return!1}if(e.include&&e.include.length>0){for(let n of e.include)if(sS(r,n))return!0;return!1}return!0}function sS(t,e){let a=e.replace(/\/$/,"")||"/";if(t===a)return!0;let r=a.replace(/\*\*/g,"\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${r}$`).test(t)}function NE(t){let a=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(n=>sS(a,n))}function Mh(t={}){let{telemetry:e,sessionMetrics:a,routes:r,mode:n="production",namespace:o}=t,i=t.widgets??Rh,s=t.executors??br,l=t.apps??fs,u=new al,c=yh({telemetry:e,routes:r,navigation:u}),d=t.events??tl(),p=Ch({namespace:o}),g=bh({eventBus:d,stateStore:p}),S=xh({state:p,events:d,sessionMetrics:a,accumulator:g}),b=$I(),x=vh(),f=w=>NE(w)?x.resolve(w.selector):null,m=async(w,C)=>{if(!NE(w))return null;try{return await x.waitFor(w.selector,C)}catch{return null}},v=Th({overlayRoot:b,eventBus:d,anchorResolver:f,widgetRegistry:i}),y=rh({overlayRoot:b,eventBus:d,surfaces:v,anchorResolver:f,waitForAnchor:m,executorRegistry:s,subscribeNavigation:w=>u.subscribe(w),runtime:{evaluateSync:w=>S.evaluateSync(w,c.get()),context:c,accumulator:g}}),_={telemetry:e,context:c,events:d,state:p,sessionMetrics:a,actions:y,surfaces:v,widgets:i,executors:s,apps:l,accumulator:g,anchorResolver:x,navigation:u,version:lS,mode:n,async evaluate(w){return S.evaluate(w,c.get())},evaluateSync(w){return S.evaluateSync(w,c.get())},async filterTiles(w){let C=c.get().page.url,A=[];for(let E of w){let L=E.activation;if(!L){A.push(E);continue}if(JP(C,L.routes)){if(L.onlyIfPopulated){let k=E.props?.actions??[];if(k.length>0&&!k.some(R=>R.triggerWhen?S.evaluateSync(R.triggerWhen,c.get()).value:!0))continue}A.push(E)}}return A},setRoutes(w){c.setRoutes(w)},destroy(){l.unbind().catch(w=>{console.error("[Runtime] Error unbinding apps registry:",w)}),x.destroy(),g.destroy(),u.destroy(),c.destroy(),y.destroy(),v.destroy()}};return l.bind(_),i.bindRuntime(_),_}var PE=h.object({value:h.unknown(),expiresAt:h.number().optional()}),HE=h.object({count:h.number(),resetAt:h.number().optional()});function eH(t){return PE.safeParse(t)}function tH(t){return HE.safeParse(t)}var UE={growthbook:t=>cp({...t,autoInit:!0})};function qE(t,e){let a=UE[t];if(!a)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(UE).join(", ")}`);return a(e)}var aH=["cdn.syntrologie.com","localhost","127.0.0.1"];function rH(t){try{let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):aH.some(n=>e.hostname===n)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var uS=class{constructor(e){$(this,"name","cdn");$(this,"url");$(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!rH(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),a=await fetch(this.url,{credentials:"omit",cache:"default"});if(!a.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${a.status})`);let r=await a.text();if(this.integrity){let l=await nH(r),u=this.integrity.replace("sha384-","");if(l!==u)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${u}, got ${l}`)}let n=JSON.parse(r),o=performance.now()-e,i=a.headers.get("cache-control"),s=a.headers.get("age");return{config:n,meta:{source:"cdn",fetchTimeMs:o,cached:i?.includes("public")??!1,cacheAge:s?parseInt(s,10):void 0}}}};async function nH(t){let a=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-384",a),n=new Uint8Array(r);return btoa(String.fromCharCode(...n))}function zE(t){return new uS(t)}var oH="syntro_exp",iH="syntro_var",cS=class{constructor(e){$(this,"name","experiments");$(this,"client");$(this,"featureKey");$(this,"manifestKey");$(this,"variantFlagPrefix");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config",this.manifestKey=e.manifestKey,this.variantFlagPrefix=e.variantFlagPrefix}async fetch(){let e=performance.now();if(typeof window<"u"){let n=new URLSearchParams(window.location.search),o=n.get(oH),i=n.get(iH);if(o&&i!==null&&this.client.setForcedVariations){let s=parseInt(i,10);Number.isNaN(s)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${s}`),this.client.setForcedVariations({[o]:s}))}}if(this.manifestKey||this.variantFlagPrefix){let n=this.fetchMultiFlag();if(n){let o=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:o,cached:!0}}}}let a=this.client.getFeatureValue?.(this.featureKey,null);if(!a||typeof a!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let r=performance.now()-e;return{config:a,meta:{source:"experiments",fetchTimeMs:r,cached:!0}}}fetchMultiFlag(){let e=this.getVariantFlagKeys();return!e||e.length===0?null:Af(this.client,e)}getVariantFlagKeys(){if(this.manifestKey){let e=this.client.getFeatureValue?.(this.manifestKey,null);if(e&&typeof e=="object"){let a=e.variant_flags;if(a&&a.length>0)return a}}if(this.variantFlagPrefix&&this.client.getAllFeatures){let e=this.client.getAllFeatures();return Object.keys(e).filter(a=>a.startsWith(this.variantFlagPrefix))}return[]}};function VE(t){return new cS(t)}var sH="https://cdn.syntrologie.com/configs",$E={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return zE({baseUrl:t.baseUrl??sH,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return VE({featureKey:t.featureKey})}};function jE(t,e={}){let a=$E[t];if(!a)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys($E).join(", ")}`);return a(e)}var GE={posthog:t=>eh(t),noop:()=>xp()};function WE(t,e){let a=GE[t];if(!a)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(GE).join(", ")}`);return a(e)}var dS="syn_";function _c(t){if(!t.startsWith(dS))throw new Error("Invalid Syntro token: must start with 'syn_'");let a=t.slice(dS.length).replace(/-/g,"+").replace(/_/g,"/"),r=atob(a),n=JSON.parse(r);if(n.v!==1)throw new Error(`Unsupported token version: ${n.v}`);return n}function Dh(t){let e=JSON.stringify(t),a=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return dS+a}function cn(t){if(typeof process<"u"&&process.env)return process.env[t];try{let e=(0,eval)("import.meta");if(e?.env)return e.env[t]}catch{}}function lH(){if(typeof window>"u")return X("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=$o(),a=!!($n()?.token&&t?.mode==="editor");return X("Syntro Bootstrap","isEditorMode:",a),a}function uH(){if(typeof window>"u")return X("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=$o(),a=!!($n()?.token&&t?.mode==="audit");return X("Syntro Bootstrap","isAuditMode:",a),a}function cH(){if(typeof window>"u")return X("Syntro Bootstrap","isReviewMode: not in browser"),!1;let t=$o(),a=!!($n()?.token&&t?.mode==="review");return X("Syntro Bootstrap","isReviewMode:",a),a}var ZE="syntro_segment_attributes";function dH(){if(typeof window>"u")return{};try{let t=localStorage.getItem(ZE);if(t){let e=JSON.parse(t);return X("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){ma("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function fH(t){if(!(typeof window>"u"))try{localStorage.setItem(ZE,JSON.stringify(t)),X("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){ma("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function pH(t){if(!t)return{};let e={};for(let[a,r]of Object.entries(t))a.startsWith("in_segment_")&&(e[a]=r===!0);return e}async function hH(t){$v(),X("Syntro Bootstrap","====== INIT ======"),X("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=lH(),a=uH(),r=cH(),n=e?"editor":a?"audit":r?"review":null;if(console.log(`[DIAG] Mode detection: editor=${e}, audit=${a}, review=${r}, sdkMode=${n}`),console.log("[DIAG] editorSource:",$n()),console.log("[DIAG] editorConf:",$o()),X("Syntro Bootstrap","SDK mode:",n??"normal"),!n&&typeof window<"u"){let L=!!window.__SYNTRO_EDITOR_PARAMS__,k=!!window.__SYNTRO_AUDIT_LEGEND__,D=!!window.__SYNTRO_REVIEW_DATA__;if(L||k||D){let R=[L&&"__SYNTRO_EDITOR_PARAMS__",k&&"__SYNTRO_AUDIT_LEGEND__",D&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${R.join(", ")}. This suggests URL params were lost (redirect?) but the service worker injected mode data. Check if replaceState failed or if page JS changed the URL before init().`)}}console.log(`[DIAG] Token resolution: options.token=${t.token?t.token.slice(0,15)+"...":"null"}`);let o=t.token;if(!o&&n){let k=$o()?.syntro_token;k?.startsWith("syn_")&&(o=k,X("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${n} mode)`))}let i;if(o)if(o.startsWith("syn_"))X("Syntro Bootstrap","Token starts with syn_, decoding..."),i=_c(o),$v(i.d);else if(n)X("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${n} mode)`);else throw kf("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),kf("Syntro Bootstrap","Token received:",o),new Error("Invalid Syntro token: must start with 'syn_'");else if(n)X("Syntro Bootstrap",`\u2713 No token, but ${n} mode - proceeding`);else throw kf("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit/review mode!"),new Error("Syntro token is required (unless in editor, audit, or review mode)");let s=cn("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||cn("VITE_SYNTRO_EXPERIMENT_HOST")||i?.eh,l=cn("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||cn("VITE_SYNTRO_TELEMETRY_HOST")||i?.th,u=cn("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||cn("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,c=dH();X("Syntro Bootstrap","Phase 1: Using cached segment attributes:",c);let d,p=tl();console.log("[Syntro Bootstrap] EventBus created");let g=Sh(L=>{p.publishEvent(L)}),S=L=>{X("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let k=pH(L);if(X("Syntro Bootstrap","Segment flags from PostHog:",k),fH(k),d){let R={...x?.getAll?.()??{},...k};X("Syntro Bootstrap","Updating GrowthBook with attributes:",R),d.setAttributes?.(R)}},b;if(i?.t){let L=i.t==="noop"?"noop":"posthog";b=WE(L,{apiKey:i.t,apiHost:l,enableFeatureFlags:!0,onFeatureFlagsLoaded:S,onCapture:g}),console.log(`[Syntro Bootstrap] Telemetry client created (${L}) with EventBus wiring`)}let x;i?.e&&(d=qE("growthbook",{clientKey:i.e,apiHost:s,attributes:c,onExperimentViewed:b?.trackExperiment?(L,k,D)=>{b.trackExperiment(L,k,D)}:void 0})),t.enableSessionMetrics&&(x=dp({experiments:d,onMetricChange:(L,k)=>{X("Syntro Bootstrap",`Session metric changed: ${L} = ${k}`)}}),X("Syntro Bootstrap","SessionMetricTracker created"));let f="production";e?f="editor":a?f="audit":cn("NODE_ENV")==="development"&&(f="development");let m=Mh({telemetry:b,sessionMetrics:x,mode:f,events:p});X("Syntro Bootstrap","Runtime created:",{version:m.version,mode:m.mode,hasContext:!!m.context,hasEvents:!!m.events,hasState:!!m.state}),X("Syntro Bootstrap","Core app executors already registered");let v=t.cdnBase||cn("NEXT_PUBLIC_SYNTRO_CDN_BASE")||cn("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",y=wf({cdnBase:v,registry:m.apps,onLoadStart:L=>{X("Syntro Bootstrap",`Loading app from CDN: ${L}`)},onLoadEnd:(L,k,D)=>{k?X("Syntro Bootstrap",`App loaded successfully: ${L}`):ma("Syntro Bootstrap",`Failed to load app: ${L}`,D)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:m.apps,runtime:m,version:m.version},X("Syntro Bootstrap","Global SynOS object exposed"));let _=m.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${_.length} apps in registry:`,_.map(L=>`${L.manifest.id}(${L.state})`).join(", "));for(let L of _)if(L.state==="registered")try{await m.apps.activate(L.manifest.id),console.log(`[DIAG] Activated: ${L.manifest.id} \u2192 widgets: [${m.widgets.list().join(", ")}]`)}catch(k){console.error(`[DIAG] FAILED to activate: ${L.manifest.id}`,k),ma("Syntro Bootstrap",`Failed to auto-activate built-in app: ${L.manifest.id}`,k)}if(console.log(`[DIAG] Activation complete. Total widgets: [${m.widgets.list().join(", ")}]`),d?.refreshFeatures)try{await d.refreshFeatures(),X("Syntro Bootstrap","GrowthBook features loaded")}catch(L){ma("Syntro Bootstrap","Failed to load GrowthBook features:",L)}let w;if(t.fetcher)w=t.fetcher;else if(i?.f){let L=jE(i.f,i.o??{});w=async()=>{let k=await L.fetch();return{...k.config,tiles:k.config.tiles??[]}}}else d&&(w=Vo({experiments:d}));let C=new Set,A=w?async()=>{let L=await w();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${L.tiles?.length??0},`,`actions=${L.actions?.length??0},`,`theme=${L.theme?.name??"none"}`),L.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",L.actions.map((R,F)=>`[${F}] ${R.kind}${R.anchorId?` anchor="${typeof R.anchorId=="string"?R.anchorId:R.anchorId.selector}"`:""}${R.label?` "${R.label}"`:""}`).join(", "));let k=L,D=y.getRequiredApps(k);return D.length>0?console.log("[Syntro Bootstrap] Required external apps:",D.join(", ")):X("Syntro Bootstrap","No external apps required (all executors are built-in)"),D.length>0&&await y.loadAppsForConfig(k).then(async F=>{let N=F.filter(B=>B.success),U=F.filter(B=>!B.success);N.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${N.map(B=>B.appId).join(", ")}`);let Y=U.filter(B=>!C.has(B.appId));Y.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",Y.map(B=>`${B.appId} (${B.error})`).join(", ")),Y.forEach(B=>C.add(B.appId)));for(let B of D)if(m.apps.has(B))try{await m.apps.activate(B),console.log(`[Syntro Bootstrap] App activated: ${B}`)}catch(W){console.error(`[Syntro Bootstrap] Failed to activate app: ${B}`,W)}else console.error(`[Syntro Bootstrap] App "${B}" required by config but NOT registered.`,`Available apps: [${Array.from(m.apps.list?.()??[]).join(", ")}]`)}),L}:void 0;return{canvas:await Gf({...t.canvas,fetcher:A,integrations:{experiments:d,telemetry:b},editorUrl:u,runtime:m}),runtime:m,experiments:d,telemetry:b,sessionMetrics:x,appLoader:y}}var fS={init:hH,encodeToken:Dh,decodeToken:_c};typeof window<"u"&&(window.Syntro=fS);var pS="2026-03-05T02:13:27.223Z (1e5675c314)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${pS}`);let t=window.SynOS,e=t?.appRegistry||fs;window.SynOS={...t,appRegistry:e,_runtimeBuild:pS,React:XE.default,ReactDOM:{...mH,createPortal:Oh.createPortal,flushSync:Oh.flushSync}},TI(e)}return rT(gH);})();
|
|
450
465
|
/*! Bundled license information:
|
|
451
466
|
|
|
452
467
|
react/cjs/react.production.js:
|
|
@@ -503,6 +518,30 @@ react/cjs/react-jsx-runtime.production.js:
|
|
|
503
518
|
* This source code is licensed under the MIT license found in the
|
|
504
519
|
* LICENSE file in the root directory of this source tree.
|
|
505
520
|
*)
|
|
521
|
+
|
|
522
|
+
lucide-react/dist/esm/shared/src/utils/mergeClasses.js:
|
|
523
|
+
lucide-react/dist/esm/shared/src/utils/toKebabCase.js:
|
|
524
|
+
lucide-react/dist/esm/shared/src/utils/toCamelCase.js:
|
|
525
|
+
lucide-react/dist/esm/shared/src/utils/toPascalCase.js:
|
|
526
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
|
527
|
+
lucide-react/dist/esm/shared/src/utils/hasA11yProp.js:
|
|
528
|
+
lucide-react/dist/esm/Icon.js:
|
|
529
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
|
530
|
+
lucide-react/dist/esm/icons/circle-question-mark.js:
|
|
531
|
+
lucide-react/dist/esm/icons/compass.js:
|
|
532
|
+
lucide-react/dist/esm/icons/file-text.js:
|
|
533
|
+
lucide-react/dist/esm/icons/gamepad-2.js:
|
|
534
|
+
lucide-react/dist/esm/icons/layers.js:
|
|
535
|
+
lucide-react/dist/esm/icons/message-circle.js:
|
|
536
|
+
lucide-react/dist/esm/icons/sparkles.js:
|
|
537
|
+
lucide-react/dist/esm/icons/trophy.js:
|
|
538
|
+
lucide-react/dist/esm/lucide-react.js:
|
|
539
|
+
(**
|
|
540
|
+
* @license lucide-react v0.576.0 - ISC
|
|
541
|
+
*
|
|
542
|
+
* This source code is licensed under the ISC license.
|
|
543
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
544
|
+
*)
|
|
506
545
|
*/
|
|
507
546
|
window.Syntro=SyntrologieSDK.Syntro;
|
|
508
547
|
//# sourceMappingURL=smart-canvas.min.js.map
|