@syntrologie/runtime-sdk 2.8.0-canary.9 → 2.8.0-canary.90
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 +291 -181
- package/README.md +3 -0
- package/dist/actions/schema.d.ts +783 -783
- package/dist/actions/schema.js +3 -3
- package/dist/actions/types.d.ts +3 -3
- package/dist/actions/validation-core.d.ts +24 -0
- package/dist/actions/validation-rules.d.ts +74 -0
- package/dist/actions/validation.d.ts +5 -11
- package/dist/anchor/AnchorResolver.d.ts +1 -0
- package/dist/bootstrap-init.d.ts +33 -0
- package/dist/bootstrap-runtime.d.ts +7 -0
- package/dist/bootstrap-types.d.ts +101 -0
- package/dist/bootstrap.d.ts +19 -83
- package/dist/{chunk-R5DNAIRI.js → chunk-77TNZ66J.js} +4 -4
- package/dist/{chunk-R5DNAIRI.js.map → chunk-77TNZ66J.js.map} +2 -2
- package/dist/{chunk-XDYJ64IN.js → chunk-IR6UOR63.js} +4 -4
- package/dist/chunk-IR6UOR63.js.map +7 -0
- package/dist/{chunk-UURRUKSW.js → chunk-TOBT6CVT.js} +1917 -725
- package/dist/chunk-TOBT6CVT.js.map +7 -0
- package/dist/chunk-YLLWLUQX.js +241 -0
- package/dist/chunk-YLLWLUQX.js.map +7 -0
- package/dist/components/ShadowCanvasOverlay.d.ts +1 -2
- package/dist/components/TileIcon.d.ts +2 -2
- package/dist/components/emojiToIcon.d.ts +24 -0
- package/dist/config/schema.d.ts +147 -136
- package/dist/config/schema.js +2 -2
- package/dist/decisions/schema.d.ts +47 -47
- package/dist/decisions/schema.js +1 -1
- package/dist/events/EventBus.d.ts +27 -1
- package/dist/events/history.d.ts +9 -0
- package/dist/events/index.d.ts +3 -0
- package/dist/events/normalizers/posthog.d.ts +4 -50
- package/dist/events/types.d.ts +30 -23
- package/dist/events/validation.d.ts +7 -0
- package/dist/fetchers/experimentsFetcher.d.ts +3 -3
- package/dist/fetchers/mergeConfigs.d.ts +7 -7
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1198 -2035
- package/dist/index.js.map +4 -4
- package/dist/overlays/runtime/overlay/overlay-runner.d.ts +4 -0
- package/dist/overlays/runtime/overlay/overlay-state.d.ts +21 -0
- package/dist/overlays/types.d.ts +3 -1
- package/dist/react.js +6 -4
- package/dist/react.js.map +2 -2
- package/dist/smart-canvas.esm.js +104 -109
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +6277 -5463
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +104 -109
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/telemetry/InterventionTracker.d.ts +23 -0
- package/dist/telemetry/adapters/posthog.d.ts +30 -4
- package/dist/telemetry/index.d.ts +1 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/token.d.ts +2 -0
- package/dist/version.d.ts +1 -1
- package/package.json +23 -28
- package/schema/canvas-config.schema.json +2369 -11366
- package/scripts/syntroReactPlugin.mjs +3 -0
- package/scripts/validate-config.mjs +42 -0
- package/dist/chunk-BU4Z6PD7.js +0 -218
- package/dist/chunk-BU4Z6PD7.js.map +0 -7
- package/dist/chunk-UURRUKSW.js.map +0 -7
- package/dist/chunk-XDYJ64IN.js.map +0 -7
package/dist/smart-canvas.esm.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var CT=Object.create;var xc=Object.defineProperty;var _T=Object.getOwnPropertyDescriptor;var wT=Object.getOwnPropertyNames;var LT=Object.getPrototypeOf,kT=Object.prototype.hasOwnProperty;var n0=t=>{throw TypeError(t)};var IT=(t,e,a)=>e in t?xc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var rn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),AT=(t,e)=>{for(var a in e)xc(t,a,{get:e[a],enumerable:!0})},ET=(t,e,a,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of wT(e))!kT.call(t,r)&&r!==a&&xc(t,r,{get:()=>e[r],enumerable:!(n=_T(e,r))||n.enumerable});return t};var K=(t,e,a)=>(a=t!=null?CT(LT(t)):{},ET(e||!t||!t.__esModule?xc(a,"default",{value:t,enumerable:!0}):a,t));var B=(t,e,a)=>IT(t,typeof e!="symbol"?e+"":e,a),r0=(t,e,a)=>e.has(t)||n0("Cannot "+a);var me=(t,e,a)=>(r0(t,e,"read from private field"),a?a.call(t):e.get(t)),gr=(t,e,a)=>e.has(t)?n0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),on=(t,e,a,n)=>(r0(t,e,"write to private field"),n?n.call(t,a):e.set(t,a),a);var m0=rn(oe=>{"use strict";var rh=Symbol.for("react.transitional.element"),TT=Symbol.for("react.portal"),RT=Symbol.for("react.fragment"),MT=Symbol.for("react.strict_mode"),DT=Symbol.for("react.profiler"),OT=Symbol.for("react.consumer"),BT=Symbol.for("react.context"),PT=Symbol.for("react.forward_ref"),FT=Symbol.for("react.suspense"),NT=Symbol.for("react.memo"),u0=Symbol.for("react.lazy"),HT=Symbol.for("react.activity"),o0=Symbol.iterator;function UT(t){return t===null||typeof t!="object"?null:(t=o0&&t[o0]||t["@@iterator"],typeof t=="function"?t:null)}var c0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},d0=Object.assign,f0={};function bi(t,e,a){this.props=t,this.context=e,this.refs=f0,this.updater=a||c0}bi.prototype.isReactComponent={};bi.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")};bi.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function p0(){}p0.prototype=bi.prototype;function oh(t,e,a){this.props=t,this.context=e,this.refs=f0,this.updater=a||c0}var ih=oh.prototype=new p0;ih.constructor=oh;d0(ih,bi.prototype);ih.isPureReactComponent=!0;var i0=Array.isArray;function nh(){}var Fe={H:null,A:null,T:null,S:null},h0=Object.prototype.hasOwnProperty;function sh(t,e,a){var n=a.ref;return{$$typeof:rh,type:t,key:e,ref:n!==void 0?n:null,props:a}}function zT(t,e){return sh(t.type,e,t.props)}function lh(t){return typeof t=="object"&&t!==null&&t.$$typeof===rh}function qT(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(a){return e[a]})}var s0=/\/+/g;function ah(t,e){return typeof t=="object"&&t!==null&&t.key!=null?qT(""+t.key):e.toString(36)}function $T(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(nh,nh):(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 xi(t,e,a,n,r){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 rh:case TT:i=!0;break;case u0:return i=t._init,xi(i(t._payload),e,a,n,r)}}if(i)return r=r(t),i=n===""?"."+ah(t,0):n,i0(r)?(a="",i!=null&&(a=i.replace(s0,"$&/")+"/"),xi(r,e,a,"",function(u){return u})):r!=null&&(lh(r)&&(r=zT(r,a+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(s0,"$&/")+"/")+i)),e.push(r)),1;i=0;var s=n===""?".":n+":";if(i0(t))for(var l=0;l<t.length;l++)n=t[l],o=s+ah(n,l),i+=xi(n,e,a,o,r);else if(l=UT(t),typeof l=="function")for(t=l.call(t),l=0;!(n=t.next()).done;)n=n.value,o=s+ah(n,l++),i+=xi(n,e,a,o,r);else if(o==="object"){if(typeof t.then=="function")return xi($T(t),e,a,n,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 i}function bc(t,e,a){if(t==null)return t;var n=[],r=0;return xi(t,n,"","",function(o){return e.call(a,o,r++)}),n}function VT(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 l0=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)},jT={map:bc,forEach:function(t,e,a){bc(t,function(){e.apply(this,arguments)},a)},count:function(t){var e=0;return bc(t,function(){e++}),e},toArray:function(t){return bc(t,function(e){return e})||[]},only:function(t){if(!lh(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};oe.Activity=HT;oe.Children=jT;oe.Component=bi;oe.Fragment=RT;oe.Profiler=DT;oe.PureComponent=oh;oe.StrictMode=MT;oe.Suspense=FT;oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Fe;oe.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Fe.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 n=d0({},t.props),r=t.key;if(e!=null)for(o in e.key!==void 0&&(r=""+e.key),e)!h0.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(n[o]=e[o]);var o=arguments.length-2;if(o===1)n.children=a;else if(1<o){for(var i=Array(o),s=0;s<o;s++)i[s]=arguments[s+2];n.children=i}return sh(t.type,r,n)};oe.createContext=function(t){return t={$$typeof:BT,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:OT,_context:t},t};oe.createElement=function(t,e,a){var n,r={},o=null;if(e!=null)for(n in e.key!==void 0&&(o=""+e.key),e)h0.call(e,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(r[n]=e[n]);var i=arguments.length-2;if(i===1)r.children=a;else if(1<i){for(var s=Array(i),l=0;l<i;l++)s[l]=arguments[l+2];r.children=s}if(t&&t.defaultProps)for(n in i=t.defaultProps,i)r[n]===void 0&&(r[n]=i[n]);return sh(t,o,r)};oe.createRef=function(){return{current:null}};oe.forwardRef=function(t){return{$$typeof:PT,render:t}};oe.isValidElement=lh;oe.lazy=function(t){return{$$typeof:u0,_payload:{_status:-1,_result:t},_init:VT}};oe.memo=function(t,e){return{$$typeof:NT,type:t,compare:e===void 0?null:e}};oe.startTransition=function(t){var e=Fe.T,a={};Fe.T=a;try{var n=t(),r=Fe.S;r!==null&&r(a,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(nh,l0)}catch(o){l0(o)}finally{e!==null&&a.types!==null&&(e.types=a.types),Fe.T=e}};oe.unstable_useCacheRefresh=function(){return Fe.H.useCacheRefresh()};oe.use=function(t){return Fe.H.use(t)};oe.useActionState=function(t,e,a){return Fe.H.useActionState(t,e,a)};oe.useCallback=function(t,e){return Fe.H.useCallback(t,e)};oe.useContext=function(t){return Fe.H.useContext(t)};oe.useDebugValue=function(){};oe.useDeferredValue=function(t,e){return Fe.H.useDeferredValue(t,e)};oe.useEffect=function(t,e){return Fe.H.useEffect(t,e)};oe.useEffectEvent=function(t){return Fe.H.useEffectEvent(t)};oe.useId=function(){return Fe.H.useId()};oe.useImperativeHandle=function(t,e,a){return Fe.H.useImperativeHandle(t,e,a)};oe.useInsertionEffect=function(t,e){return Fe.H.useInsertionEffect(t,e)};oe.useLayoutEffect=function(t,e){return Fe.H.useLayoutEffect(t,e)};oe.useMemo=function(t,e){return Fe.H.useMemo(t,e)};oe.useOptimistic=function(t,e){return Fe.H.useOptimistic(t,e)};oe.useReducer=function(t,e,a){return Fe.H.useReducer(t,e,a)};oe.useRef=function(t){return Fe.H.useRef(t)};oe.useState=function(t){return Fe.H.useState(t)};oe.useSyncExternalStore=function(t,e,a){return Fe.H.useSyncExternalStore(t,e,a)};oe.useTransition=function(){return Fe.H.useTransition()};oe.version="19.2.4"});var Xe=rn((R3,g0)=>{"use strict";g0.exports=m0()});var y0=rn(Pt=>{"use strict";var GT=Xe();function v0(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 vr(){}var Bt={d:{f:vr,r:function(){throw Error(v0(522))},D:vr,C:vr,L:vr,m:vr,X:vr,S:vr,M:vr},p:0,findDOMNode:null},ZT=Symbol.for("react.portal");function WT(t,e,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ZT,key:n==null?null:""+n,children:t,containerInfo:e,implementation:a}}var Xs=GT.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Sc(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Pt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Bt;Pt.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(v0(299));return WT(t,e,null,a)};Pt.flushSync=function(t){var e=Xs.T,a=Bt.p;try{if(Xs.T=null,Bt.p=2,t)return t()}finally{Xs.T=e,Bt.p=a,Bt.d.f()}};Pt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Bt.d.C(t,e))};Pt.prefetchDNS=function(t){typeof t=="string"&&Bt.d.D(t)};Pt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var a=e.as,n=Sc(a,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?Bt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:r,fetchPriority:o}):a==="script"&&Bt.d.X(t,{crossOrigin:n,integrity:r,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Pt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=Sc(e.as,e.crossOrigin);Bt.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&&Bt.d.M(t)};Pt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,n=Sc(a,e.crossOrigin);Bt.d.L(t,a,{crossOrigin:n,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})}};Pt.preloadModule=function(t,e){if(typeof t=="string")if(e){var a=Sc(e.as,e.crossOrigin);Bt.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 Bt.d.m(t)};Pt.requestFormReset=function(t){Bt.d.r(t)};Pt.unstable_batchedUpdates=function(t,e){return t(e)};Pt.useFormState=function(t,e,a){return Xs.H.useFormState(t,e,a)};Pt.useFormStatus=function(){return Xs.H.useHostTransitionStatus()};Pt.version="19.2.4"});var Ys=rn((D3,b0)=>{"use strict";function x0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(x0)}catch(t){console.error(t)}}x0(),b0.exports=y0()});var T0=rn(qe=>{"use strict";function fh(t,e){var a=t.length;t.push(e);e:for(;0<a;){var n=a-1>>>1,r=t[n];if(0<Cc(r,e))t[n]=e,t[a]=r,a=n;else break e}}function sn(t){return t.length===0?null:t[0]}function wc(t){if(t.length===0)return null;var e=t[0],a=t.pop();if(a!==e){t[0]=a;e:for(var n=0,r=t.length,o=r>>>1;n<o;){var i=2*(n+1)-1,s=t[i],l=i+1,u=t[l];if(0>Cc(s,a))l<r&&0>Cc(u,s)?(t[n]=u,t[l]=a,n=l):(t[n]=s,t[i]=a,n=i);else if(l<r&&0>Cc(u,a))t[n]=u,t[l]=a,n=l;else break e}}return e}function Cc(t,e){var a=t.sortIndex-e.sortIndex;return a!==0?a:t.id-e.id}qe.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(S0=performance,qe.unstable_now=function(){return S0.now()}):(uh=Date,C0=uh.now(),qe.unstable_now=function(){return uh.now()-C0});var S0,uh,C0,wn=[],yr=[],XT=1,Sa=null,Tt=3,ph=!1,Ks=!1,Qs=!1,hh=!1,L0=typeof setTimeout=="function"?setTimeout:null,k0=typeof clearTimeout=="function"?clearTimeout:null,_0=typeof setImmediate<"u"?setImmediate:null;function _c(t){for(var e=sn(yr);e!==null;){if(e.callback===null)wc(yr);else if(e.startTime<=t)wc(yr),e.sortIndex=e.expirationTime,fh(wn,e);else break;e=sn(yr)}}function mh(t){if(Qs=!1,_c(t),!Ks)if(sn(wn)!==null)Ks=!0,Ci||(Ci=!0,Si());else{var e=sn(yr);e!==null&&gh(mh,e.startTime-t)}}var Ci=!1,Js=-1,I0=5,A0=-1;function E0(){return hh?!0:!(qe.unstable_now()-A0<I0)}function ch(){if(hh=!1,Ci){var t=qe.unstable_now();A0=t;var e=!0;try{e:{Ks=!1,Qs&&(Qs=!1,k0(Js),Js=-1),ph=!0;var a=Tt;try{t:{for(_c(t),Sa=sn(wn);Sa!==null&&!(Sa.expirationTime>t&&E0());){var n=Sa.callback;if(typeof n=="function"){Sa.callback=null,Tt=Sa.priorityLevel;var r=n(Sa.expirationTime<=t);if(t=qe.unstable_now(),typeof r=="function"){Sa.callback=r,_c(t),e=!0;break t}Sa===sn(wn)&&wc(wn),_c(t)}else wc(wn);Sa=sn(wn)}if(Sa!==null)e=!0;else{var o=sn(yr);o!==null&&gh(mh,o.startTime-t),e=!1}}break e}finally{Sa=null,Tt=a,ph=!1}e=void 0}}finally{e?Si():Ci=!1}}}var Si;typeof _0=="function"?Si=function(){_0(ch)}:typeof MessageChannel<"u"?(dh=new MessageChannel,w0=dh.port2,dh.port1.onmessage=ch,Si=function(){w0.postMessage(null)}):Si=function(){L0(ch,0)};var dh,w0;function gh(t,e){Js=L0(function(){t(qe.unstable_now())},e)}qe.unstable_IdlePriority=5;qe.unstable_ImmediatePriority=1;qe.unstable_LowPriority=4;qe.unstable_NormalPriority=3;qe.unstable_Profiling=null;qe.unstable_UserBlockingPriority=2;qe.unstable_cancelCallback=function(t){t.callback=null};qe.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"):I0=0<t?Math.floor(1e3/t):5};qe.unstable_getCurrentPriorityLevel=function(){return Tt};qe.unstable_next=function(t){switch(Tt){case 1:case 2:case 3:var e=3;break;default:e=Tt}var a=Tt;Tt=e;try{return t()}finally{Tt=a}};qe.unstable_requestPaint=function(){hh=!0};qe.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var a=Tt;Tt=t;try{return e()}finally{Tt=a}};qe.unstable_scheduleCallback=function(t,e,a){var n=qe.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?n+a:n):a=n,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=a+r,t={id:XT++,callback:e,priorityLevel:t,startTime:a,expirationTime:r,sortIndex:-1},a>n?(t.sortIndex=a,fh(yr,t),sn(wn)===null&&t===sn(yr)&&(Qs?(k0(Js),Js=-1):Qs=!0,gh(mh,a-n))):(t.sortIndex=r,fh(wn,t),Ks||ph||(Ks=!0,Ci||(Ci=!0,Si()))),t};qe.unstable_shouldYield=E0;qe.unstable_wrapCallback=function(t){var e=Tt;return function(){var a=Tt;Tt=e;try{return t.apply(this,arguments)}finally{Tt=a}}}});var M0=rn((B3,R0)=>{"use strict";R0.exports=T0()});var Vw=rn(Xd=>{"use strict";var lt=M0(),rC=Xe(),YT=Ys();function R(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 oC(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Hl(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 iC(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 sC(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 D0(t){if(Hl(t)!==t)throw Error(R(188))}function KT(t){var e=t.alternate;if(!e){if(e=Hl(t),e===null)throw Error(R(188));return e!==t?null:t}for(var a=t,n=e;;){var r=a.return;if(r===null)break;var o=r.alternate;if(o===null){if(n=r.return,n!==null){a=n;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===a)return D0(r),t;if(o===n)return D0(r),e;o=o.sibling}throw Error(R(188))}if(a.return!==n.return)a=r,n=o;else{for(var i=!1,s=r.child;s;){if(s===a){i=!0,a=r,n=o;break}if(s===n){i=!0,n=r,a=o;break}s=s.sibling}if(!i){for(s=o.child;s;){if(s===a){i=!0,a=o,n=r;break}if(s===n){i=!0,n=o,a=r;break}s=s.sibling}if(!i)throw Error(R(189))}}if(a.alternate!==n)throw Error(R(190))}if(a.tag!==3)throw Error(R(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 Ue=Object.assign,QT=Symbol.for("react.element"),Lc=Symbol.for("react.transitional.element"),sl=Symbol.for("react.portal"),Ai=Symbol.for("react.fragment"),uC=Symbol.for("react.strict_mode"),Yh=Symbol.for("react.profiler"),cC=Symbol.for("react.consumer"),Mn=Symbol.for("react.context"),jm=Symbol.for("react.forward_ref"),Kh=Symbol.for("react.suspense"),Qh=Symbol.for("react.suspense_list"),Gm=Symbol.for("react.memo"),xr=Symbol.for("react.lazy"),Jh=Symbol.for("react.activity"),JT=Symbol.for("react.memo_cache_sentinel"),O0=Symbol.iterator;function el(t){return t===null||typeof t!="object"?null:(t=O0&&t[O0]||t["@@iterator"],typeof t=="function"?t:null)}var eR=Symbol.for("react.client.reference");function em(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===eR?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ai:return"Fragment";case Yh:return"Profiler";case uC:return"StrictMode";case Kh:return"Suspense";case Qh:return"SuspenseList";case Jh:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case sl:return"Portal";case Mn:return t.displayName||"Context";case cC:return(t._context.displayName||"Context")+".Consumer";case jm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Gm:return e=t.displayName||null,e!==null?e:em(t.type)||"Memo";case xr:e=t._payload,t=t._init;try{return em(t(e))}catch{}}return null}var ll=Array.isArray,ee=rC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe=YT.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Lo={pending:!1,data:null,method:null,action:null},tm=[],Ei=-1;function fn(t){return{current:t}}function gt(t){0>Ei||(t.current=tm[Ei],tm[Ei]=null,Ei--)}function De(t,e){Ei++,tm[Ei]=t.current,t.current=e}var dn=fn(null),Ll=fn(null),Tr=fn(null),rd=fn(null);function od(t,e){switch(De(Tr,e),De(Ll,t),De(dn,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?zS(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=zS(e),t=Tw(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}gt(dn),De(dn,t)}function Zi(){gt(dn),gt(Ll),gt(Tr)}function am(t){t.memoizedState!==null&&De(rd,t);var e=dn.current,a=Tw(e,t.type);e!==a&&(De(Ll,t),De(dn,a))}function id(t){Ll.current===t&&(gt(dn),gt(Ll)),rd.current===t&&(gt(rd),Pl._currentValue=Lo)}var vh,B0;function So(t){if(vh===void 0)try{throw Error()}catch(a){var e=a.stack.trim().match(/\n( *(at )?)/);vh=e&&e[1]||"",B0=-1<a.stack.indexOf(`
|
|
1
|
+
var HR=Object.create;var $c=Object.defineProperty;var UR=Object.getOwnPropertyDescriptor;var zR=Object.getOwnPropertyNames;var qR=Object.getPrototypeOf,VR=Object.prototype.hasOwnProperty;var rS=t=>{throw TypeError(t)};var $R=(t,e,a)=>e in t?$c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var fr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),jR=(t,e)=>{for(var a in e)$c(t,a,{get:e[a],enumerable:!0})},GR=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of zR(e))!VR.call(t,n)&&n!==a&&$c(t,n,{get:()=>e[n],enumerable:!(r=UR(e,n))||r.enumerable});return t};var Y=(t,e,a)=>(a=t!=null?HR(qR(t)):{},GR(e||!t||!t.__esModule?$c(a,"default",{value:t,enumerable:!0}):a,t));var D=(t,e,a)=>$R(t,typeof e!="symbol"?e+"":e,a),nS=(t,e,a)=>e.has(t)||rS("Cannot "+a);var ye=(t,e,a)=>(nS(t,e,"read from private field"),a?a.call(t):e.get(t)),Cn=(t,e,a)=>e.has(t)?rS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),pr=(t,e,a,r)=>(nS(t,e,"write to private field"),r?r.call(t,a):e.set(t,a),a);var mS=fr(oe=>{"use strict";var Bh=Symbol.for("react.transitional.element"),WR=Symbol.for("react.portal"),ZR=Symbol.for("react.fragment"),XR=Symbol.for("react.strict_mode"),KR=Symbol.for("react.profiler"),YR=Symbol.for("react.consumer"),QR=Symbol.for("react.context"),JR=Symbol.for("react.forward_ref"),e2=Symbol.for("react.suspense"),t2=Symbol.for("react.memo"),uS=Symbol.for("react.lazy"),a2=Symbol.for("react.activity"),oS=Symbol.iterator;function r2(t){return t===null||typeof t!="object"?null:(t=oS&&t[oS]||t["@@iterator"],typeof t=="function"?t:null)}var cS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},dS=Object.assign,fS={};function Ai(t,e,a){this.props=t,this.context=e,this.refs=fS,this.updater=a||cS}Ai.prototype.isReactComponent={};Ai.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")};Ai.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function pS(){}pS.prototype=Ai.prototype;function Ph(t,e,a){this.props=t,this.context=e,this.refs=fS,this.updater=a||cS}var Nh=Ph.prototype=new pS;Nh.constructor=Ph;dS(Nh,Ai.prototype);Nh.isPureReactComponent=!0;var iS=Array.isArray;function Dh(){}var Ue={H:null,A:null,T:null,S:null},hS=Object.prototype.hasOwnProperty;function Fh(t,e,a){var r=a.ref;return{$$typeof:Bh,type:t,key:e,ref:r!==void 0?r:null,props:a}}function n2(t,e){return Fh(t.type,e,t.props)}function Hh(t){return typeof t=="object"&&t!==null&&t.$$typeof===Bh}function o2(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(a){return e[a]})}var sS=/\/+/g;function Oh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?o2(""+t.key):e.toString(36)}function i2(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Dh,Dh):(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 Ii(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 Bh:case WR:i=!0;break;case uS:return i=t._init,Ii(i(t._payload),e,a,r,n)}}if(i)return n=n(t),i=r===""?"."+Oh(t,0):r,iS(n)?(a="",i!=null&&(a=i.replace(sS,"$&/")+"/"),Ii(n,e,a,"",function(u){return u})):n!=null&&(Hh(n)&&(n=n2(n,a+(n.key==null||t&&t.key===n.key?"":(""+n.key).replace(sS,"$&/")+"/")+i)),e.push(n)),1;i=0;var s=r===""?".":r+":";if(iS(t))for(var l=0;l<t.length;l++)r=t[l],o=s+Oh(r,l),i+=Ii(r,e,a,o,n);else if(l=r2(t),typeof l=="function")for(t=l.call(t),l=0;!(r=t.next()).done;)r=r.value,o=s+Oh(r,l++),i+=Ii(r,e,a,o,n);else if(o==="object"){if(typeof t.then=="function")return Ii(i2(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 jc(t,e,a){if(t==null)return t;var r=[],n=0;return Ii(t,r,"","",function(o){return e.call(a,o,n++)}),r}function s2(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)},l2={map:jc,forEach:function(t,e,a){jc(t,function(){e.apply(this,arguments)},a)},count:function(t){var e=0;return jc(t,function(){e++}),e},toArray:function(t){return jc(t,function(e){return e})||[]},only:function(t){if(!Hh(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};oe.Activity=a2;oe.Children=l2;oe.Component=Ai;oe.Fragment=ZR;oe.Profiler=KR;oe.PureComponent=Ph;oe.StrictMode=XR;oe.Suspense=e2;oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ue;oe.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Ue.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=dS({},t.props),n=t.key;if(e!=null)for(o in e.key!==void 0&&(n=""+e.key),e)!hS.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 Fh(t.type,n,r)};oe.createContext=function(t){return t={$$typeof:QR,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:YR,_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)hS.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 Fh(t,o,n)};oe.createRef=function(){return{current:null}};oe.forwardRef=function(t){return{$$typeof:JR,render:t}};oe.isValidElement=Hh;oe.lazy=function(t){return{$$typeof:uS,_payload:{_status:-1,_result:t},_init:s2}};oe.memo=function(t,e){return{$$typeof:t2,type:t,compare:e===void 0?null:e}};oe.startTransition=function(t){var e=Ue.T,a={};Ue.T=a;try{var r=t(),n=Ue.S;n!==null&&n(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Dh,lS)}catch(o){lS(o)}finally{e!==null&&a.types!==null&&(e.types=a.types),Ue.T=e}};oe.unstable_useCacheRefresh=function(){return Ue.H.useCacheRefresh()};oe.use=function(t){return Ue.H.use(t)};oe.useActionState=function(t,e,a){return Ue.H.useActionState(t,e,a)};oe.useCallback=function(t,e){return Ue.H.useCallback(t,e)};oe.useContext=function(t){return Ue.H.useContext(t)};oe.useDebugValue=function(){};oe.useDeferredValue=function(t,e){return Ue.H.useDeferredValue(t,e)};oe.useEffect=function(t,e){return Ue.H.useEffect(t,e)};oe.useEffectEvent=function(t){return Ue.H.useEffectEvent(t)};oe.useId=function(){return Ue.H.useId()};oe.useImperativeHandle=function(t,e,a){return Ue.H.useImperativeHandle(t,e,a)};oe.useInsertionEffect=function(t,e){return Ue.H.useInsertionEffect(t,e)};oe.useLayoutEffect=function(t,e){return Ue.H.useLayoutEffect(t,e)};oe.useMemo=function(t,e){return Ue.H.useMemo(t,e)};oe.useOptimistic=function(t,e){return Ue.H.useOptimistic(t,e)};oe.useReducer=function(t,e,a){return Ue.H.useReducer(t,e,a)};oe.useRef=function(t){return Ue.H.useRef(t)};oe.useState=function(t){return Ue.H.useState(t)};oe.useSyncExternalStore=function(t,e,a){return Ue.H.useSyncExternalStore(t,e,a)};oe.useTransition=function(){return Ue.H.useTransition()};oe.version="19.2.1"});var tt=fr((sU,gS)=>{"use strict";gS.exports=mS()});var yS=fr($t=>{"use strict";var u2=tt();function vS(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 wn(){}var Vt={d:{f:wn,r:function(){throw Error(vS(522))},D:wn,C:wn,L:wn,m:wn,X:wn,S:wn,M:wn},p:0,findDOMNode:null},c2=Symbol.for("react.portal");function d2(t,e,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c2,key:r==null?null:""+r,children:t,containerInfo:e,implementation:a}}var ol=u2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Gc(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}$t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Vt;$t.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(vS(299));return d2(t,e,null,a)};$t.flushSync=function(t){var e=ol.T,a=Vt.p;try{if(ol.T=null,Vt.p=2,t)return t()}finally{ol.T=e,Vt.p=a,Vt.d.f()}};$t.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Vt.d.C(t,e))};$t.prefetchDNS=function(t){typeof t=="string"&&Vt.d.D(t)};$t.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var a=e.as,r=Gc(a,e.crossOrigin),n=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?Vt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:r,integrity:n,fetchPriority:o}):a==="script"&&Vt.d.X(t,{crossOrigin:r,integrity:n,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};$t.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=Gc(e.as,e.crossOrigin);Vt.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&&Vt.d.M(t)};$t.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,r=Gc(a,e.crossOrigin);Vt.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})}};$t.preloadModule=function(t,e){if(typeof t=="string")if(e){var a=Gc(e.as,e.crossOrigin);Vt.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 Vt.d.m(t)};$t.requestFormReset=function(t){Vt.d.r(t)};$t.unstable_batchedUpdates=function(t,e){return t(e)};$t.useFormState=function(t,e,a){return ol.H.useFormState(t,e,a)};$t.useFormStatus=function(){return ol.H.useHostTransitionStatus()};$t.version="19.2.1"});var il=fr((uU,bS)=>{"use strict";function xS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xS)}catch(t){console.error(t)}}xS(),bS.exports=yS()});var TS=fr(We=>{"use strict";function Vh(t,e){var a=t.length;t.push(e);e:for(;0<a;){var r=a-1>>>1,n=t[r];if(0<Wc(n,e))t[r]=e,t[a]=n,a=r;else break e}}function hr(t){return t.length===0?null:t[0]}function Xc(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>Wc(s,a))l<n&&0>Wc(u,s)?(t[r]=u,t[l]=a,r=l):(t[r]=s,t[i]=a,r=i);else if(l<n&&0>Wc(u,a))t[r]=u,t[l]=a,r=l;else break e}}return e}function Wc(t,e){var a=t.sortIndex-e.sortIndex;return a!==0?a:t.id-e.id}We.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(SS=performance,We.unstable_now=function(){return SS.now()}):(Uh=Date,_S=Uh.now(),We.unstable_now=function(){return Uh.now()-_S});var SS,Uh,_S,Tr=[],Ln=[],f2=1,Aa=null,Ht=3,$h=!1,sl=!1,ll=!1,jh=!1,LS=typeof setTimeout=="function"?setTimeout:null,kS=typeof clearTimeout=="function"?clearTimeout:null,CS=typeof setImmediate<"u"?setImmediate:null;function Zc(t){for(var e=hr(Ln);e!==null;){if(e.callback===null)Xc(Ln);else if(e.startTime<=t)Xc(Ln),e.sortIndex=e.expirationTime,Vh(Tr,e);else break;e=hr(Ln)}}function Gh(t){if(ll=!1,Zc(t),!sl)if(hr(Tr)!==null)sl=!0,Ti||(Ti=!0,Ei());else{var e=hr(Ln);e!==null&&Wh(Gh,e.startTime-t)}}var Ti=!1,ul=-1,IS=5,AS=-1;function ES(){return jh?!0:!(We.unstable_now()-AS<IS)}function zh(){if(jh=!1,Ti){var t=We.unstable_now();AS=t;var e=!0;try{e:{sl=!1,ll&&(ll=!1,kS(ul),ul=-1),$h=!0;var a=Ht;try{t:{for(Zc(t),Aa=hr(Tr);Aa!==null&&!(Aa.expirationTime>t&&ES());){var r=Aa.callback;if(typeof r=="function"){Aa.callback=null,Ht=Aa.priorityLevel;var n=r(Aa.expirationTime<=t);if(t=We.unstable_now(),typeof n=="function"){Aa.callback=n,Zc(t),e=!0;break t}Aa===hr(Tr)&&Xc(Tr),Zc(t)}else Xc(Tr);Aa=hr(Tr)}if(Aa!==null)e=!0;else{var o=hr(Ln);o!==null&&Wh(Gh,o.startTime-t),e=!1}}break e}finally{Aa=null,Ht=a,$h=!1}e=void 0}}finally{e?Ei():Ti=!1}}}var Ei;typeof CS=="function"?Ei=function(){CS(zh)}:typeof MessageChannel<"u"?(qh=new MessageChannel,wS=qh.port2,qh.port1.onmessage=zh,Ei=function(){wS.postMessage(null)}):Ei=function(){LS(zh,0)};var qh,wS;function Wh(t,e){ul=LS(function(){t(We.unstable_now())},e)}We.unstable_IdlePriority=5;We.unstable_ImmediatePriority=1;We.unstable_LowPriority=4;We.unstable_NormalPriority=3;We.unstable_Profiling=null;We.unstable_UserBlockingPriority=2;We.unstable_cancelCallback=function(t){t.callback=null};We.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"):IS=0<t?Math.floor(1e3/t):5};We.unstable_getCurrentPriorityLevel=function(){return Ht};We.unstable_next=function(t){switch(Ht){case 1:case 2:case 3:var e=3;break;default:e=Ht}var a=Ht;Ht=e;try{return t()}finally{Ht=a}};We.unstable_requestPaint=function(){jh=!0};We.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var a=Ht;Ht=t;try{return e()}finally{Ht=a}};We.unstable_scheduleCallback=function(t,e,a){var r=We.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:f2++,callback:e,priorityLevel:t,startTime:a,expirationTime:n,sortIndex:-1},a>r?(t.sortIndex=a,Vh(Ln,t),hr(Tr)===null&&t===hr(Ln)&&(ll?(kS(ul),ul=-1):ll=!0,Wh(Gh,a-r))):(t.sortIndex=n,Vh(Tr,t),sl||$h||(sl=!0,Ti||(Ti=!0,Ei()))),t};We.unstable_shouldYield=ES;We.unstable_wrapCallback=function(t){var e=Ht;return function(){var a=Ht;Ht=e;try{return t.apply(this,arguments)}finally{Ht=a}}}});var MS=fr((dU,RS)=>{"use strict";RS.exports=TS()});var $L=fr(Sf=>{"use strict";var yt=MS(),nC=tt(),p2=il();function O(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 oC(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Xl(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 iC(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 sC(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 OS(t){if(Xl(t)!==t)throw Error(O(188))}function h2(t){var e=t.alternate;if(!e){if(e=Xl(t),e===null)throw Error(O(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 OS(n),t;if(o===r)return OS(n),e;o=o.sibling}throw Error(O(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(O(189))}}if(a.alternate!==r)throw Error(O(190))}if(a.tag!==3)throw Error(O(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 Ve=Object.assign,m2=Symbol.for("react.element"),Kc=Symbol.for("react.transitional.element"),vl=Symbol.for("react.portal"),Pi=Symbol.for("react.fragment"),uC=Symbol.for("react.strict_mode"),Im=Symbol.for("react.profiler"),cC=Symbol.for("react.consumer"),Fr=Symbol.for("react.context"),_g=Symbol.for("react.forward_ref"),Am=Symbol.for("react.suspense"),Em=Symbol.for("react.suspense_list"),Cg=Symbol.for("react.memo"),kn=Symbol.for("react.lazy"),Tm=Symbol.for("react.activity"),g2=Symbol.for("react.memo_cache_sentinel"),DS=Symbol.iterator;function cl(t){return t===null||typeof t!="object"?null:(t=DS&&t[DS]||t["@@iterator"],typeof t=="function"?t:null)}var v2=Symbol.for("react.client.reference");function Rm(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===v2?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Pi:return"Fragment";case Im:return"Profiler";case uC:return"StrictMode";case Am:return"Suspense";case Em:return"SuspenseList";case Tm:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case vl:return"Portal";case Fr:return t.displayName||"Context";case cC:return(t._context.displayName||"Context")+".Consumer";case _g:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Cg:return e=t.displayName||null,e!==null?e:Rm(t.type)||"Memo";case kn:e=t._payload,t=t._init;try{return Rm(t(e))}catch{}}return null}var yl=Array.isArray,ae=nC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e=p2.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ro={pending:!1,data:null,method:null,action:null},Mm=[],Ni=-1;function xr(t){return{current:t}}function Ct(t){0>Ni||(t.current=Mm[Ni],Mm[Ni]=null,Ni--)}function Ne(t,e){Ni++,Mm[Ni]=t.current,t.current=e}var yr=xr(null),Bl=xr(null),Nn=xr(null),Ed=xr(null);function Td(t,e){switch(Ne(Nn,e),Ne(Bl,t),Ne(yr,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?z_(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=z_(e),t=TL(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Ct(yr),Ne(yr,t)}function ts(){Ct(yr),Ct(Bl),Ct(Nn)}function Om(t){t.memoizedState!==null&&Ne(Ed,t);var e=yr.current,a=TL(e,t.type);e!==a&&(Ne(Bl,t),Ne(yr,a))}function Rd(t){Bl.current===t&&(Ct(yr),Ct(Bl)),Ed.current===t&&(Ct(Ed),Gl._currentValue=Ro)}var Zh,BS;function Io(t){if(Zh===void 0)try{throw Error()}catch(a){var e=a.stack.trim().match(/\n( *(at )?)/);Zh=e&&e[1]||"",BS=-1<a.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+
|
|
3
|
+
`+Zh+t+BS}var Xh=!1;function Kh(t,e){if(!t||Xh)return"";Xh=!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(h){var f=h}Reflect.construct(t,[],d)}else{try{d.call()}catch(h){f=h}t.call(d.prototype)}}else{try{throw Error()}catch(h){f=h}(d=t())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(h){if(h&&f&&typeof h.stack=="string")return[h.stack,f.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
4
|
`),u=s.split(`
|
|
5
|
-
`);for(r=
|
|
6
|
-
`+l[
|
|
7
|
-
Error generating stack: `+
|
|
8
|
-
`+n.stack}}var nm=Object.prototype.hasOwnProperty,Zm=lt.unstable_scheduleCallback,bh=lt.unstable_cancelCallback,aR=lt.unstable_shouldYield,nR=lt.unstable_requestPaint,ua=lt.unstable_now,rR=lt.unstable_getCurrentPriorityLevel,dC=lt.unstable_ImmediatePriority,fC=lt.unstable_UserBlockingPriority,sd=lt.unstable_NormalPriority,oR=lt.unstable_LowPriority,pC=lt.unstable_IdlePriority,iR=lt.log,sR=lt.unstable_setDisableYieldValue,Ul=null,ca=null;function Lr(t){if(typeof iR=="function"&&sR(t),ca&&typeof ca.setStrictMode=="function")try{ca.setStrictMode(Ul,t)}catch{}}var da=Math.clz32?Math.clz32:cR,lR=Math.log,uR=Math.LN2;function cR(t){return t>>>=0,t===0?32:31-(lR(t)/uR|0)|0}var kc=256,Ic=262144,Ac=4194304;function Co(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 Dd(t,e,a){var n=t.pendingLanes;if(n===0)return 0;var r=0,o=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var s=n&134217727;return s!==0?(n=s&~o,n!==0?r=Co(n):(i&=s,i!==0?r=Co(i):a||(a=s&~t,a!==0&&(r=Co(a))))):(s=n&~o,s!==0?r=Co(s):i!==0?r=Co(i):a||(a=n&~t,a!==0&&(r=Co(a)))),r===0?0:e!==0&&e!==r&&(e&o)===0&&(o=r&-r,a=e&-e,o>=a||o===32&&(a&4194048)!==0)?e:r}function zl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function dR(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 hC(){var t=Ac;return Ac<<=1,(Ac&62914560)===0&&(Ac=4194304),t}function Sh(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function ql(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function fR(t,e,a,n,r,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-da(a),d=1<<c;s[c]=0,l[c]=-1;var f=u[c];if(f!==null)for(u[c]=null,c=0;c<f.length;c++){var m=f[c];m!==null&&(m.lane&=-536870913)}a&=~d}n!==0&&mC(t,n,0),o!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=o&~(i&~e))}function mC(t,e,a){t.pendingLanes|=e,t.suspendedLanes&=~e;var n=31-da(e);t.entangledLanes|=e,t.entanglements[n]=t.entanglements[n]|1073741824|a&261930}function gC(t,e){var a=t.entangledLanes|=e;for(t=t.entanglements;a;){var n=31-da(a),r=1<<n;r&e|t[n]&e&&(t[n]|=e),a&=~r}}function vC(t,e){var a=e&-e;return a=(a&42)!==0?1:Wm(a),(a&(t.suspendedLanes|e))!==0?0:a}function Wm(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 Xm(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function yC(){var t=xe.p;return t!==0?t:(t=window.event,t===void 0?32:zw(t.type))}function F0(t,e){var a=xe.p;try{return xe.p=t,e()}finally{xe.p=a}}var $r=Math.random().toString(36).slice(2),bt="__reactFiber$"+$r,Yt="__reactProps$"+$r,rs="__reactContainer$"+$r,rm="__reactEvents$"+$r,pR="__reactListeners$"+$r,hR="__reactHandles$"+$r,N0="__reactResources$"+$r,$l="__reactMarker$"+$r;function Ym(t){delete t[bt],delete t[Yt],delete t[rm],delete t[pR],delete t[hR]}function Ti(t){var e=t[bt];if(e)return e;for(var a=t.parentNode;a;){if(e=a[rs]||a[bt]){if(a=e.alternate,e.child!==null||a!==null&&a.child!==null)for(t=GS(t);t!==null;){if(a=t[bt])return a;t=GS(t)}return e}t=a,a=t.parentNode}return null}function os(t){if(t=t[bt]||t[rs]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function ul(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(R(33))}function Ui(t){var e=t[N0];return e||(e=t[N0]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function mt(t){t[$l]=!0}var xC=new Set,bC={};function Bo(t,e){Wi(t,e),Wi(t+"Capture",e)}function Wi(t,e){for(bC[t]=e,t=0;t<e.length;t++)xC.add(e[t])}var mR=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]*$"),H0={},U0={};function gR(t){return nm.call(U0,t)?!0:nm.call(H0,t)?!1:mR.test(t)?U0[t]=!0:(H0[t]=!0,!1)}function $c(t,e,a){if(gR(e))if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var n=e.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+a)}}function Ec(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 Ln(t,e,a,n){if(n===null)t.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(e,a,""+n)}}function _a(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function SC(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function vR(t,e,a){var n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(i){a=""+i,o.call(this,i)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function om(t){if(!t._valueTracker){var e=SC(t)?"checked":"value";t._valueTracker=vR(t,e,""+t[e])}}function CC(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),n="";return t&&(n=SC(t)?t.checked?"true":"false":t.value),t=n,t!==a?(e.setValue(t),!0):!1}function ld(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 ka(t){return t.replace(yR,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function im(t,e,a,n,r,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=""+_a(e)):t.value!==""+_a(e)&&(t.value=""+_a(e)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),e!=null?sm(t,i,_a(e)):a!=null?sm(t,i,_a(a)):n!=null&&t.removeAttribute("value"),r==null&&o!=null&&(t.defaultChecked=!!o),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+_a(s):t.removeAttribute("name")}function _C(t,e,a,n,r,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)){om(t);return}a=a!=null?""+_a(a):"",e=e!=null?""+_a(e):a,s||e===t.value||(t.value=e),t.defaultValue=e}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,t.checked=s?t.checked:!!n,t.defaultChecked=!!n,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),om(t)}function sm(t,e,a){e==="number"&&ld(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function zi(t,e,a,n){if(t=t.options,e){e={};for(var r=0;r<a.length;r++)e["$"+a[r]]=!0;for(a=0;a<t.length;a++)r=e.hasOwnProperty("$"+t[a].value),t[a].selected!==r&&(t[a].selected=r),r&&n&&(t[a].defaultSelected=!0)}else{for(a=""+_a(a),e=null,r=0;r<t.length;r++){if(t[r].value===a){t[r].selected=!0,n&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function wC(t,e,a){if(e!=null&&(e=""+_a(e),e!==t.value&&(t.value=e),a==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=a!=null?""+_a(a):""}function LC(t,e,a,n){if(e==null){if(n!=null){if(a!=null)throw Error(R(92));if(ll(n)){if(1<n.length)throw Error(R(93));n=n[0]}a=n}a==null&&(a=""),e=a}a=_a(e),t.defaultValue=a,n=t.textContent,n===a&&n!==""&&n!==null&&(t.value=n),om(t)}function Xi(t,e){if(e){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=e;return}}t.textContent=e}var xR=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 z0(t,e,a){var n=e.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":n?t.setProperty(e,a):typeof a!="number"||a===0||xR.has(e)?e==="float"?t.cssFloat=a:t[e]=(""+a).trim():t[e]=a+"px"}function kC(t,e,a){if(e!=null&&typeof e!="object")throw Error(R(62));if(t=t.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||e!=null&&e.hasOwnProperty(n)||(n.indexOf("--")===0?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="");for(var r in e)n=e[r],e.hasOwnProperty(r)&&a[r]!==n&&z0(t,r,n)}else for(var o in e)e.hasOwnProperty(o)&&z0(t,o,e[o])}function Km(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 bR=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"]]),SR=/^[\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 Vc(t){return SR.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Dn(){}var lm=null;function Qm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ri=null,qi=null;function q0(t){var e=os(t);if(e&&(t=e.stateNode)){var a=t[Yt]||null;e:switch(t=e.stateNode,e.type){case"input":if(im(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="'+ka(""+e)+'"][type="radio"]'),e=0;e<a.length;e++){var n=a[e];if(n!==t&&n.form===t.form){var r=n[Yt]||null;if(!r)throw Error(R(90));im(n,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<a.length;e++)n=a[e],n.form===t.form&&CC(n)}break e;case"textarea":wC(t,a.value,a.defaultValue);break e;case"select":e=a.value,e!=null&&zi(t,!!a.multiple,e,!1)}}}var Ch=!1;function IC(t,e,a){if(Ch)return t(e,a);Ch=!0;try{var n=t(e);return n}finally{if(Ch=!1,(Ri!==null||qi!==null)&&(jd(),Ri&&(e=Ri,t=qi,qi=Ri=null,q0(e),t)))for(e=0;e<t.length;e++)q0(t[e])}}function kl(t,e){var a=t.stateNode;if(a===null)return null;var n=a[Yt]||null;if(n===null)return null;a=n[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":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(R(231,e,typeof a));return a}var Nn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),um=!1;if(Nn)try{_i={},Object.defineProperty(_i,"passive",{get:function(){um=!0}}),window.addEventListener("test",_i,_i),window.removeEventListener("test",_i,_i)}catch{um=!1}var _i,kr=null,Jm=null,jc=null;function AC(){if(jc)return jc;var t,e=Jm,a=e.length,n,r="value"in kr?kr.value:kr.textContent,o=r.length;for(t=0;t<a&&e[t]===r[t];t++);var i=a-t;for(n=1;n<=i&&e[a-n]===r[o-n];n++);return jc=r.slice(t,1<n?1-n:void 0)}function Gc(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Tc(){return!0}function $0(){return!1}function Kt(t){function e(a,n,r,o,i){this._reactName=a,this._targetInst=r,this.type=n,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)?Tc:$0,this.isPropagationStopped=$0,this}return Ue(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=Tc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Tc)},persist:function(){},isPersistent:Tc}),e}var Po={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Od=Kt(Po),Vl=Ue({},Po,{view:0,detail:0}),CR=Kt(Vl),_h,wh,tl,Bd=Ue({},Vl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eg,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!==tl&&(tl&&t.type==="mousemove"?(_h=t.screenX-tl.screenX,wh=t.screenY-tl.screenY):wh=_h=0,tl=t),_h)},movementY:function(t){return"movementY"in t?t.movementY:wh}}),V0=Kt(Bd),_R=Ue({},Bd,{dataTransfer:0}),wR=Kt(_R),LR=Ue({},Vl,{relatedTarget:0}),Lh=Kt(LR),kR=Ue({},Po,{animationName:0,elapsedTime:0,pseudoElement:0}),IR=Kt(kR),AR=Ue({},Po,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),ER=Kt(AR),TR=Ue({},Po,{data:0}),j0=Kt(TR),RR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},MR={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"},DR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OR(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=DR[t])?!!e[t]:!1}function eg(){return OR}var BR=Ue({},Vl,{key:function(t){if(t.key){var e=RR[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Gc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?MR[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eg,charCode:function(t){return t.type==="keypress"?Gc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Gc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),PR=Kt(BR),FR=Ue({},Bd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),G0=Kt(FR),NR=Ue({},Vl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eg}),HR=Kt(NR),UR=Ue({},Po,{propertyName:0,elapsedTime:0,pseudoElement:0}),zR=Kt(UR),qR=Ue({},Bd,{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}),$R=Kt(qR),VR=Ue({},Po,{newState:0,oldState:0}),jR=Kt(VR),GR=[9,13,27,32],tg=Nn&&"CompositionEvent"in window,fl=null;Nn&&"documentMode"in document&&(fl=document.documentMode);var ZR=Nn&&"TextEvent"in window&&!fl,EC=Nn&&(!tg||fl&&8<fl&&11>=fl),Z0=" ",W0=!1;function TC(t,e){switch(t){case"keyup":return GR.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function RC(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Mi=!1;function WR(t,e){switch(t){case"compositionend":return RC(e);case"keypress":return e.which!==32?null:(W0=!0,Z0);case"textInput":return t=e.data,t===Z0&&W0?null:t;default:return null}}function XR(t,e){if(Mi)return t==="compositionend"||!tg&&TC(t,e)?(t=AC(),jc=Jm=kr=null,Mi=!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 EC&&e.locale!=="ko"?null:e.data;default:return null}}var YR={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 X0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!YR[t.type]:e==="textarea"}function MC(t,e,a,n){Ri?qi?qi.push(n):qi=[n]:Ri=n,e=kd(e,"onChange"),0<e.length&&(a=new Od("onChange","change",null,a,n),t.push({event:a,listeners:e}))}var pl=null,Il=null;function KR(t){Iw(t,0)}function Pd(t){var e=ul(t);if(CC(e))return t}function Y0(t,e){if(t==="change")return e}var DC=!1;Nn&&(Nn?(Mc="oninput"in document,Mc||(kh=document.createElement("div"),kh.setAttribute("oninput","return;"),Mc=typeof kh.oninput=="function"),Rc=Mc):Rc=!1,DC=Rc&&(!document.documentMode||9<document.documentMode));var Rc,Mc,kh;function K0(){pl&&(pl.detachEvent("onpropertychange",OC),Il=pl=null)}function OC(t){if(t.propertyName==="value"&&Pd(Il)){var e=[];MC(e,Il,t,Qm(t)),IC(KR,e)}}function QR(t,e,a){t==="focusin"?(K0(),pl=e,Il=a,pl.attachEvent("onpropertychange",OC)):t==="focusout"&&K0()}function JR(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Pd(Il)}function eM(t,e){if(t==="click")return Pd(e)}function tM(t,e){if(t==="input"||t==="change")return Pd(e)}function aM(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var pa=typeof Object.is=="function"?Object.is:aM;function Al(t,e){if(pa(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var a=Object.keys(t),n=Object.keys(e);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var r=a[n];if(!nm.call(e,r)||!pa(t[r],e[r]))return!1}return!0}function Q0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function J0(t,e){var a=Q0(t);t=0;for(var n;a;){if(a.nodeType===3){if(n=t+a.textContent.length,t<=e&&n>=e)return{node:a,offset:e-t};t=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Q0(a)}}function BC(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?BC(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function PC(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=ld(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=ld(t.document)}return e}function ag(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 nM=Nn&&"documentMode"in document&&11>=document.documentMode,Di=null,cm=null,hl=null,dm=!1;function eS(t,e,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;dm||Di==null||Di!==ld(n)||(n=Di,"selectionStart"in n&&ag(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),hl&&Al(hl,n)||(hl=n,n=kd(cm,"onSelect"),0<n.length&&(e=new Od("onSelect","select",null,e,a),t.push({event:e,listeners:n}),e.target=Di)))}function bo(t,e){var a={};return a[t.toLowerCase()]=e.toLowerCase(),a["Webkit"+t]="webkit"+e,a["Moz"+t]="moz"+e,a}var Oi={animationend:bo("Animation","AnimationEnd"),animationiteration:bo("Animation","AnimationIteration"),animationstart:bo("Animation","AnimationStart"),transitionrun:bo("Transition","TransitionRun"),transitionstart:bo("Transition","TransitionStart"),transitioncancel:bo("Transition","TransitionCancel"),transitionend:bo("Transition","TransitionEnd")},Ih={},FC={};Nn&&(FC=document.createElement("div").style,"AnimationEvent"in window||(delete Oi.animationend.animation,delete Oi.animationiteration.animation,delete Oi.animationstart.animation),"TransitionEvent"in window||delete Oi.transitionend.transition);function Fo(t){if(Ih[t])return Ih[t];if(!Oi[t])return t;var e=Oi[t],a;for(a in e)if(e.hasOwnProperty(a)&&a in FC)return Ih[t]=e[a];return t}var NC=Fo("animationend"),HC=Fo("animationiteration"),UC=Fo("animationstart"),rM=Fo("transitionrun"),oM=Fo("transitionstart"),iM=Fo("transitioncancel"),zC=Fo("transitionend"),qC=new Map,fm="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(" ");fm.push("scrollEnd");function ja(t,e){qC.set(t,e),Bo(e,[t])}var ud=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)},Ca=[],Bi=0,ng=0;function Fd(){for(var t=Bi,e=ng=Bi=0;e<t;){var a=Ca[e];Ca[e++]=null;var n=Ca[e];Ca[e++]=null;var r=Ca[e];Ca[e++]=null;var o=Ca[e];if(Ca[e++]=null,n!==null&&r!==null){var i=n.pending;i===null?r.next=r:(r.next=i.next,i.next=r),n.pending=r}o!==0&&$C(a,r,o)}}function Nd(t,e,a,n){Ca[Bi++]=t,Ca[Bi++]=e,Ca[Bi++]=a,Ca[Bi++]=n,ng|=n,t.lanes|=n,t=t.alternate,t!==null&&(t.lanes|=n)}function rg(t,e,a,n){return Nd(t,e,a,n),cd(t)}function No(t,e){return Nd(t,null,null,e),cd(t)}function $C(t,e,a){t.lanes|=a;var n=t.alternate;n!==null&&(n.lanes|=a);for(var r=!1,o=t.return;o!==null;)o.childLanes|=a,n=o.alternate,n!==null&&(n.childLanes|=a),o.tag===22&&(t=o.stateNode,t===null||t._visibility&1||(r=!0)),t=o,o=o.return;return t.tag===3?(o=t.stateNode,r&&e!==null&&(r=31-da(a),t=o.hiddenUpdates,n=t[r],n===null?t[r]=[e]:n.push(e),e.lane=a|536870912),o):null}function cd(t){if(50<_l)throw _l=0,Dm=null,Error(R(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Pi={};function sM(t,e,a,n){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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sa(t,e,a,n){return new sM(t,e,a,n)}function og(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Bn(t,e){var a=t.alternate;return a===null?(a=sa(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 VC(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 Zc(t,e,a,n,r,o){var i=0;if(n=t,typeof t=="function")og(t)&&(i=1);else if(typeof t=="string")i=c2(t,a,dn.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Jh:return t=sa(31,a,e,r),t.elementType=Jh,t.lanes=o,t;case Ai:return ko(a.children,r,o,e);case uC:i=8,r|=24;break;case Yh:return t=sa(12,a,e,r|2),t.elementType=Yh,t.lanes=o,t;case Kh:return t=sa(13,a,e,r),t.elementType=Kh,t.lanes=o,t;case Qh:return t=sa(19,a,e,r),t.elementType=Qh,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Mn:i=10;break e;case cC:i=9;break e;case jm:i=11;break e;case Gm:i=14;break e;case xr:i=16,n=null;break e}i=29,a=Error(R(130,t===null?"null":typeof t,"")),n=null}return e=sa(i,a,e,r),e.elementType=t,e.type=n,e.lanes=o,e}function ko(t,e,a,n){return t=sa(7,t,n,e),t.lanes=a,t}function Ah(t,e,a){return t=sa(6,t,null,e),t.lanes=a,t}function jC(t){var e=sa(18,null,null,0);return e.stateNode=t,e}function Eh(t,e,a){return e=sa(4,t.children!==null?t.children:[],t.key,e),e.lanes=a,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var tS=new WeakMap;function Ia(t,e){if(typeof t=="object"&&t!==null){var a=tS.get(t);return a!==void 0?a:(e={value:t,source:e,stack:P0(e)},tS.set(t,e),e)}return{value:t,source:e,stack:P0(e)}}var Fi=[],Ni=0,dd=null,El=0,wa=[],La=0,Hr=null,ln=1,un="";function Tn(t,e){Fi[Ni++]=El,Fi[Ni++]=dd,dd=t,El=e}function GC(t,e,a){wa[La++]=ln,wa[La++]=un,wa[La++]=Hr,Hr=t;var n=ln;t=un;var r=32-da(n)-1;n&=~(1<<r),a+=1;var o=32-da(e)+r;if(30<o){var i=r-r%5;o=(n&(1<<i)-1).toString(32),n>>=i,r-=i,ln=1<<32-da(e)+r|a<<r|n,un=o+t}else ln=1<<o|a<<r|n,un=t}function ig(t){t.return!==null&&(Tn(t,1),GC(t,1,0))}function sg(t){for(;t===dd;)dd=Fi[--Ni],Fi[Ni]=null,El=Fi[--Ni],Fi[Ni]=null;for(;t===Hr;)Hr=wa[--La],wa[La]=null,un=wa[--La],wa[La]=null,ln=wa[--La],wa[La]=null}function ZC(t,e){wa[La++]=ln,wa[La++]=un,wa[La++]=Hr,ln=e.id,un=e.overflow,Hr=t}var St=null,He=null,he=!1,Rr=null,Aa=!1,pm=Error(R(519));function Ur(t){var e=Error(R(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Tl(Ia(e,t)),pm}function aS(t){var e=t.stateNode,a=t.type,n=t.memoizedProps;switch(e[bt]=t,e[Yt]=n,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<Ol.length;a++)ue(Ol[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),_C(e,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":ue("invalid",e);break;case"textarea":ue("invalid",e),LC(e,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||e.textContent===""+a||n.suppressHydrationWarning===!0||Ew(e.textContent,a)?(n.popover!=null&&(ue("beforetoggle",e),ue("toggle",e)),n.onScroll!=null&&ue("scroll",e),n.onScrollEnd!=null&&ue("scrollend",e),n.onClick!=null&&(e.onclick=Dn),e=!0):e=!1,e||Ur(t,!0)}function nS(t){for(St=t.return;St;)switch(St.tag){case 5:case 31:case 13:Aa=!1;return;case 27:case 3:Aa=!0;return;default:St=St.return}}function wi(t){if(t!==St)return!1;if(!he)return nS(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")||Nm(t.type,t.memoizedProps)),a=!a),a&&He&&Ur(t),nS(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(R(317));He=jS(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(R(317));He=jS(t)}else e===27?(e=He,Vr(t.type)?(t=qm,qm=null,He=t):He=e):He=St?Ta(t.stateNode.nextSibling):null;return!0}function To(){He=St=null,he=!1}function Th(){var t=Rr;return t!==null&&(Wt===null?Wt=t:Wt.push.apply(Wt,t),Rr=null),t}function Tl(t){Rr===null?Rr=[t]:Rr.push(t)}var hm=fn(null),Ho=null,On=null;function Sr(t,e,a){De(hm,e._currentValue),e._currentValue=a}function Pn(t){t._currentValue=hm.current,gt(hm)}function mm(t,e,a){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===a)break;t=t.return}}function gm(t,e,a,n){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var o=r.dependencies;if(o!==null){var i=r.child;o=o.firstContext;e:for(;o!==null;){var s=o;o=r;for(var l=0;l<e.length;l++)if(s.context===e[l]){o.lanes|=a,s=o.alternate,s!==null&&(s.lanes|=a),mm(o.return,a,t),n||(i=null);break e}o=s.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(R(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),mm(i,a,t),i=null}else i=r.child;if(i!==null)i.return=r;else for(i=r;i!==null;){if(i===t){i=null;break}if(r=i.sibling,r!==null){r.return=i.return,i=r;break}i=i.return}r=i}}function is(t,e,a,n){t=null;for(var r=e,o=!1;r!==null;){if(!o){if((r.flags&524288)!==0)o=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var i=r.alternate;if(i===null)throw Error(R(387));if(i=i.memoizedProps,i!==null){var s=r.type;pa(r.pendingProps.value,i.value)||(t!==null?t.push(s):t=[s])}}else if(r===rd.current){if(i=r.alternate,i===null)throw Error(R(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(Pl):t=[Pl])}r=r.return}t!==null&&gm(e,t,a,n),e.flags|=262144}function fd(t){for(t=t.firstContext;t!==null;){if(!pa(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ro(t){Ho=t,On=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ct(t){return WC(Ho,t)}function Dc(t,e){return Ho===null&&Ro(t),WC(t,e)}function WC(t,e){var a=e._currentValue;if(e={context:e,memoizedValue:a,next:null},On===null){if(t===null)throw Error(R(308));On=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else On=On.next=e;return a}var lM=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(a,n){t.push(n)}};this.abort=function(){e.aborted=!0,t.forEach(function(a){return a()})}},uM=lt.unstable_scheduleCallback,cM=lt.unstable_NormalPriority,rt={$$typeof:Mn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lg(){return{controller:new lM,data:new Map,refCount:0}}function jl(t){t.refCount--,t.refCount===0&&uM(cM,function(){t.controller.abort()})}var ml=null,vm=0,Yi=0,$i=null;function dM(t,e){if(ml===null){var a=ml=[];vm=0,Yi=Dg(),$i={status:"pending",value:void 0,then:function(n){a.push(n)}}}return vm++,e.then(rS,rS),e}function rS(){if(--vm===0&&ml!==null){$i!==null&&($i.status="fulfilled");var t=ml;ml=null,Yi=0,$i=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function fM(t,e){var a=[],n={status:"pending",value:null,reason:null,then:function(r){a.push(r)}};return t.then(function(){n.status="fulfilled",n.value=e;for(var r=0;r<a.length;r++)(0,a[r])(e)},function(r){for(n.status="rejected",n.reason=r,r=0;r<a.length;r++)(0,a[r])(void 0)}),n}var oS=ee.S;ee.S=function(t,e){lw=ua(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&dM(t,e),oS!==null&&oS(t,e)};var Io=fn(null);function ug(){var t=Io.current;return t!==null?t:Ee.pooledCache}function Wc(t,e){e===null?De(Io,Io.current):De(Io,e.pool)}function XC(){var t=ug();return t===null?null:{parent:rt._currentValue,pool:t}}var ss=Error(R(460)),cg=Error(R(474)),Hd=Error(R(542)),pd={then:function(){}};function iS(t){return t=t.status,t==="fulfilled"||t==="rejected"}function YC(t,e,a){switch(a=t[a],a===void 0?t.push(e):a!==e&&(e.then(Dn,Dn),e=a),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,lS(t),t;default:if(typeof e.status=="string")e.then(Dn,Dn);else{if(t=Ee,t!==null&&100<t.shellSuspendCounter)throw Error(R(482));t=e,t.status="pending",t.then(function(n){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=n}},function(n){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=n}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,lS(t),t}throw Ao=e,ss}}function _o(t){try{var e=t._init;return e(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ao=a,ss):a}}var Ao=null;function sS(){if(Ao===null)throw Error(R(459));var t=Ao;return Ao=null,t}function lS(t){if(t===ss||t===Hd)throw Error(R(483))}var Vi=null,Rl=0;function Oc(t){var e=Rl;return Rl+=1,Vi===null&&(Vi=[]),YC(Vi,t,e)}function al(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Bc(t,e){throw e.$$typeof===QT?Error(R(525)):(t=Object.prototype.toString.call(e),Error(R(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function KC(t){function e(p,g){if(t){var v=p.deletions;v===null?(p.deletions=[g],p.flags|=16):v.push(g)}}function a(p,g){if(!t)return null;for(;g!==null;)e(p,g),g=g.sibling;return null}function n(p){for(var g=new Map;p!==null;)p.key!==null?g.set(p.key,p):g.set(p.index,p),p=p.sibling;return g}function r(p,g){return p=Bn(p,g),p.index=0,p.sibling=null,p}function o(p,g,v){return p.index=v,t?(v=p.alternate,v!==null?(v=v.index,v<g?(p.flags|=67108866,g):v):(p.flags|=67108866,g)):(p.flags|=1048576,g)}function i(p){return t&&p.alternate===null&&(p.flags|=67108866),p}function s(p,g,v,y){return g===null||g.tag!==6?(g=Ah(v,p.mode,y),g.return=p,g):(g=r(g,v),g.return=p,g)}function l(p,g,v,y){var _=v.type;return _===Ai?c(p,g,v.props.children,y,v.key):g!==null&&(g.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===xr&&_o(_)===g.type)?(g=r(g,v.props),al(g,v),g.return=p,g):(g=Zc(v.type,v.key,v.props,null,p.mode,y),al(g,v),g.return=p,g)}function u(p,g,v,y){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=Eh(v,p.mode,y),g.return=p,g):(g=r(g,v.children||[]),g.return=p,g)}function c(p,g,v,y,_){return g===null||g.tag!==7?(g=ko(v,p.mode,y,_),g.return=p,g):(g=r(g,v),g.return=p,g)}function d(p,g,v){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Ah(""+g,p.mode,v),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Lc:return v=Zc(g.type,g.key,g.props,null,p.mode,v),al(v,g),v.return=p,v;case sl:return g=Eh(g,p.mode,v),g.return=p,g;case xr:return g=_o(g),d(p,g,v)}if(ll(g)||el(g))return g=ko(g,p.mode,v,null),g.return=p,g;if(typeof g.then=="function")return d(p,Oc(g),v);if(g.$$typeof===Mn)return d(p,Dc(p,g),v);Bc(p,g)}return null}function f(p,g,v,y){var _=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return _!==null?null:s(p,g,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Lc:return v.key===_?l(p,g,v,y):null;case sl:return v.key===_?u(p,g,v,y):null;case xr:return v=_o(v),f(p,g,v,y)}if(ll(v)||el(v))return _!==null?null:c(p,g,v,y,null);if(typeof v.then=="function")return f(p,g,Oc(v),y);if(v.$$typeof===Mn)return f(p,g,Dc(p,v),y);Bc(p,v)}return null}function m(p,g,v,y,_){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return p=p.get(v)||null,s(g,p,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Lc:return p=p.get(y.key===null?v:y.key)||null,l(g,p,y,_);case sl:return p=p.get(y.key===null?v:y.key)||null,u(g,p,y,_);case xr:return y=_o(y),m(p,g,v,y,_)}if(ll(y)||el(y))return p=p.get(v)||null,c(g,p,y,_,null);if(typeof y.then=="function")return m(p,g,v,Oc(y),_);if(y.$$typeof===Mn)return m(p,g,v,Dc(g,y),_);Bc(g,y)}return null}function S(p,g,v,y){for(var _=null,L=null,C=g,A=g=0,w=null;C!==null&&A<v.length;A++){C.index>A?(w=C,C=null):w=C.sibling;var k=f(p,C,v[A],y);if(k===null){C===null&&(C=w);break}t&&C&&k.alternate===null&&e(p,C),g=o(k,g,A),L===null?_=k:L.sibling=k,L=k,C=w}if(A===v.length)return a(p,C),he&&Tn(p,A),_;if(C===null){for(;A<v.length;A++)C=d(p,v[A],y),C!==null&&(g=o(C,g,A),L===null?_=C:L.sibling=C,L=C);return he&&Tn(p,A),_}for(C=n(C);A<v.length;A++)w=m(C,p,A,v[A],y),w!==null&&(t&&w.alternate!==null&&C.delete(w.key===null?A:w.key),g=o(w,g,A),L===null?_=w:L.sibling=w,L=w);return t&&C.forEach(function(T){return e(p,T)}),he&&Tn(p,A),_}function b(p,g,v,y){if(v==null)throw Error(R(151));for(var _=null,L=null,C=g,A=g=0,w=null,k=v.next();C!==null&&!k.done;A++,k=v.next()){C.index>A?(w=C,C=null):w=C.sibling;var T=f(p,C,k.value,y);if(T===null){C===null&&(C=w);break}t&&C&&T.alternate===null&&e(p,C),g=o(T,g,A),L===null?_=T:L.sibling=T,L=T,C=w}if(k.done)return a(p,C),he&&Tn(p,A),_;if(C===null){for(;!k.done;A++,k=v.next())k=d(p,k.value,y),k!==null&&(g=o(k,g,A),L===null?_=k:L.sibling=k,L=k);return he&&Tn(p,A),_}for(C=n(C);!k.done;A++,k=v.next())k=m(C,p,A,k.value,y),k!==null&&(t&&k.alternate!==null&&C.delete(k.key===null?A:k.key),g=o(k,g,A),L===null?_=k:L.sibling=k,L=k);return t&&C.forEach(function(D){return e(p,D)}),he&&Tn(p,A),_}function x(p,g,v,y){if(typeof v=="object"&&v!==null&&v.type===Ai&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Lc:e:{for(var _=v.key;g!==null;){if(g.key===_){if(_=v.type,_===Ai){if(g.tag===7){a(p,g.sibling),y=r(g,v.props.children),y.return=p,p=y;break e}}else if(g.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===xr&&_o(_)===g.type){a(p,g.sibling),y=r(g,v.props),al(y,v),y.return=p,p=y;break e}a(p,g);break}else e(p,g);g=g.sibling}v.type===Ai?(y=ko(v.props.children,p.mode,y,v.key),y.return=p,p=y):(y=Zc(v.type,v.key,v.props,null,p.mode,y),al(y,v),y.return=p,p=y)}return i(p);case sl:e:{for(_=v.key;g!==null;){if(g.key===_)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){a(p,g.sibling),y=r(g,v.children||[]),y.return=p,p=y;break e}else{a(p,g);break}else e(p,g);g=g.sibling}y=Eh(v,p.mode,y),y.return=p,p=y}return i(p);case xr:return v=_o(v),x(p,g,v,y)}if(ll(v))return S(p,g,v,y);if(el(v)){if(_=el(v),typeof _!="function")throw Error(R(150));return v=_.call(v),b(p,g,v,y)}if(typeof v.then=="function")return x(p,g,Oc(v),y);if(v.$$typeof===Mn)return x(p,g,Dc(p,v),y);Bc(p,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,g!==null&&g.tag===6?(a(p,g.sibling),y=r(g,v),y.return=p,p=y):(a(p,g),y=Ah(v,p.mode,y),y.return=p,p=y),i(p)):a(p,g)}return function(p,g,v,y){try{Rl=0;var _=x(p,g,v,y);return Vi=null,_}catch(C){if(C===ss||C===Hd)throw C;var L=sa(29,C,null,p.mode);return L.lanes=y,L.return=p,L}}}var Mo=KC(!0),QC=KC(!1),br=!1;function dg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ym(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 Mr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Dr(t,e,a){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,(ye&2)!==0){var r=n.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),n.pending=e,e=cd(t),$C(t,null,a),e}return Nd(t,n,e,a),cd(t)}function gl(t,e,a){if(e=e.updateQueue,e!==null&&(e=e.shared,(a&4194048)!==0)){var n=e.lanes;n&=t.pendingLanes,a|=n,e.lanes=a,gC(t,a)}}function Rh(t,e){var a=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var r=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?r=o=i:o=o.next=i,a=a.next}while(a!==null);o===null?r=o=e:o=o.next=e}else r=o=e;a={baseState:n.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:n.shared,callbacks:n.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=e:t.next=e,a.lastBaseUpdate=e}var xm=!1;function vl(){if(xm){var t=$i;if(t!==null)throw t}}function yl(t,e,a,n){xm=!1;var r=t.updateQueue;br=!1;var o=r.firstBaseUpdate,i=r.lastBaseUpdate,s=r.shared.pending;if(s!==null){r.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=r.baseState;i=0,c=u=l=null,s=o;do{var f=s.lane&-536870913,m=f!==s.lane;if(m?(pe&f)===f:(n&f)===f){f!==0&&f===Yi&&(xm=!0),c!==null&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var S=t,b=s;f=e;var x=a;switch(b.tag){case 1:if(S=b.payload,typeof S=="function"){d=S.call(x,d,f);break e}d=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=b.payload,f=typeof S=="function"?S.call(x,d,f):S,f==null)break e;d=Ue({},d,f);break e;case 2:br=!0}}f=s.callback,f!==null&&(t.flags|=64,m&&(t.flags|=8192),m=r.callbacks,m===null?r.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=m,l=d):c=c.next=m,i|=f;if(s=s.next,s===null){if(s=r.shared.pending,s===null)break;m=s,s=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);c===null&&(l=d),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=c,o===null&&(r.shared.lanes=0),qr|=i,t.lanes=i,t.memoizedState=d}}function JC(t,e){if(typeof t!="function")throw Error(R(191,t));t.call(e)}function e_(t,e){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)JC(a[t],e)}var Ki=fn(null),hd=fn(0);function uS(t,e){t=qn,De(hd,t),De(Ki,e),qn=t|e.baseLanes}function bm(){De(hd,qn),De(Ki,Ki.current)}function fg(){qn=hd.current,gt(Ki),gt(hd)}var ha=fn(null),Ea=null;function Cr(t){var e=t.alternate;De(Je,Je.current&1),De(ha,t),Ea===null&&(e===null||Ki.current!==null||e.memoizedState!==null)&&(Ea=t)}function Sm(t){De(Je,Je.current),De(ha,t),Ea===null&&(Ea=t)}function t_(t){t.tag===22?(De(Je,Je.current),De(ha,t),Ea===null&&(Ea=t)):_r(t)}function _r(){De(Je,Je.current),De(ha,ha.current)}function ia(t){gt(ha),Ea===t&&(Ea=null),gt(Je)}var Je=fn(0);function md(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Um(a)||zm(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 Hn=0,ie=null,ke=null,at=null,gd=!1,ji=!1,Do=!1,vd=0,Ml=0,Gi=null,pM=0;function Ye(){throw Error(R(321))}function pg(t,e){if(e===null)return!1;for(var a=0;a<e.length&&a<t.length;a++)if(!pa(t[a],e[a]))return!1;return!0}function hg(t,e,a,n,r,o){return Hn=o,ie=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ee.H=t===null||t.memoizedState===null?M_:Lg,Do=!1,o=a(n,r),Do=!1,ji&&(o=n_(e,a,n,r)),a_(t),o}function a_(t){ee.H=Dl;var e=ke!==null&&ke.next!==null;if(Hn=0,at=ke=ie=null,gd=!1,Ml=0,Gi=null,e)throw Error(R(300));t===null||ot||(t=t.dependencies,t!==null&&fd(t)&&(ot=!0))}function n_(t,e,a,n){ie=t;var r=0;do{if(ji&&(Gi=null),Ml=0,ji=!1,25<=r)throw Error(R(301));if(r+=1,at=ke=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=D_,o=e(a,n)}while(ji);return o}function hM(){var t=ee.H,e=t.useState()[0];return e=typeof e.then=="function"?Gl(e):e,t=t.useState()[0],(ke!==null?ke.memoizedState:null)!==t&&(ie.flags|=1024),e}function mg(){var t=vd!==0;return vd=0,t}function gg(t,e,a){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a}function vg(t){if(gd){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}gd=!1}Hn=0,at=ke=ie=null,ji=!1,Ml=vd=0,Gi=null}function Ft(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?ie.memoizedState=at=t:at=at.next=t,at}function et(){if(ke===null){var t=ie.alternate;t=t!==null?t.memoizedState:null}else t=ke.next;var e=at===null?ie.memoizedState:at.next;if(e!==null)at=e,ke=t;else{if(t===null)throw ie.alternate===null?Error(R(467)):Error(R(310));ke=t,t={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},at===null?ie.memoizedState=at=t:at=at.next=t}return at}function Ud(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gl(t){var e=Ml;return Ml+=1,Gi===null&&(Gi=[]),t=YC(Gi,t,e),e=ie,(at===null?e.memoizedState:at.next)===null&&(e=e.alternate,ee.H=e===null||e.memoizedState===null?M_:Lg),t}function zd(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Gl(t);if(t.$$typeof===Mn)return Ct(t)}throw Error(R(438,String(t)))}function yg(t){var e=null,a=ie.updateQueue;if(a!==null&&(e=a.memoCache),e==null){var n=ie.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(e={data:n.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),a===null&&(a=Ud(),ie.updateQueue=a),a.memoCache=e,a=e.data[e.index],a===void 0)for(a=e.data[e.index]=Array(t),n=0;n<t;n++)a[n]=JT;return e.index++,a}function Un(t,e){return typeof e=="function"?e(t):e}function Xc(t){var e=et();return xg(e,ke,t)}function xg(t,e,a){var n=t.queue;if(n===null)throw Error(R(311));n.lastRenderedReducer=a;var r=t.baseQueue,o=n.pending;if(o!==null){if(r!==null){var i=r.next;r.next=o.next,o.next=i}e.baseQueue=r=o,n.pending=null}if(o=t.baseState,r===null)t.memoizedState=o;else{e=r.next;var s=i=null,l=null,u=e,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(pe&d)===d:(Hn&d)===d){var f=u.revertLane;if(f===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===Yi&&(c=!0);else if((Hn&f)===f){u=u.next,f===Yi&&(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|=f,qr|=f;d=u.action,Do&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else f={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=f,i=o):l=l.next=f,ie.lanes|=d,qr|=d;u=u.next}while(u!==null&&u!==e);if(l===null?i=o:l.next=s,!pa(o,t.memoizedState)&&(ot=!0,c&&(a=$i,a!==null)))throw a;t.memoizedState=o,t.baseState=i,t.baseQueue=l,n.lastRenderedState=o}return r===null&&(n.lanes=0),[t.memoizedState,n.dispatch]}function Mh(t){var e=et(),a=e.queue;if(a===null)throw Error(R(311));a.lastRenderedReducer=t;var n=a.dispatch,r=a.pending,o=e.memoizedState;if(r!==null){a.pending=null;var i=r=r.next;do o=t(o,i.action),i=i.next;while(i!==r);pa(o,e.memoizedState)||(ot=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),a.lastRenderedState=o}return[o,n]}function r_(t,e,a){var n=ie,r=et(),o=he;if(o){if(a===void 0)throw Error(R(407));a=a()}else a=e();var i=!pa((ke||r).memoizedState,a);if(i&&(r.memoizedState=a,ot=!0),r=r.queue,bg(s_.bind(null,n,r,t),[t]),r.getSnapshot!==e||i||at!==null&&at.memoizedState.tag&1){if(n.flags|=2048,Qi(9,{destroy:void 0},i_.bind(null,n,r,a,e),null),Ee===null)throw Error(R(349));o||(Hn&127)!==0||o_(n,e,a)}return a}function o_(t,e,a){t.flags|=16384,t={getSnapshot:e,value:a},e=ie.updateQueue,e===null?(e=Ud(),ie.updateQueue=e,e.stores=[t]):(a=e.stores,a===null?e.stores=[t]:a.push(t))}function i_(t,e,a,n){e.value=a,e.getSnapshot=n,l_(e)&&u_(t)}function s_(t,e,a){return a(function(){l_(e)&&u_(t)})}function l_(t){var e=t.getSnapshot;t=t.value;try{var a=e();return!pa(t,a)}catch{return!0}}function u_(t){var e=No(t,2);e!==null&&Xt(e,t,2)}function Cm(t){var e=Ft();if(typeof t=="function"){var a=t;if(t=a(),Do){Lr(!0);try{a()}finally{Lr(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Un,lastRenderedState:t},e}function c_(t,e,a,n){return t.baseState=a,xg(t,ke,typeof n=="function"?n:Un)}function mM(t,e,a,n,r){if($d(t))throw Error(R(485));if(t=e.action,t!==null){var o={payload:r,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,n(o),a=e.pending,a===null?(o.next=e.pending=o,d_(e,o)):(o.next=a.next,e.pending=a.next=o)}}function d_(t,e){var a=e.action,n=e.payload,r=t.state;if(e.isTransition){var o=ee.T,i={};ee.T=i;try{var s=a(r,n),l=ee.S;l!==null&&l(i,s),cS(t,e,s)}catch(u){_m(t,e,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),ee.T=o}}else try{o=a(r,n),cS(t,e,o)}catch(u){_m(t,e,u)}}function cS(t,e,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){dS(t,e,n)},function(n){return _m(t,e,n)}):dS(t,e,a)}function dS(t,e,a){e.status="fulfilled",e.value=a,f_(e),t.state=a,e=t.pending,e!==null&&(a=e.next,a===e?t.pending=null:(a=a.next,e.next=a,d_(t,a)))}function _m(t,e,a){var n=t.pending;if(t.pending=null,n!==null){n=n.next;do e.status="rejected",e.reason=a,f_(e),e=e.next;while(e!==n)}t.action=null}function f_(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function p_(t,e){return e}function fS(t,e){if(he){var a=Ee.formState;if(a!==null){e:{var n=ie;if(he){if(He){t:{for(var r=He,o=Aa;r.nodeType!==8;){if(!o){r=null;break t}if(r=Ta(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){He=Ta(r.nextSibling),n=r.data==="F!";break e}}Ur(n)}n=!1}n&&(e=a[0])}}return a=Ft(),a.memoizedState=a.baseState=e,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:p_,lastRenderedState:e},a.queue=n,a=E_.bind(null,ie,n),n.dispatch=a,n=Cm(!1),o=wg.bind(null,ie,!1,n.queue),n=Ft(),r={state:e,dispatch:null,action:t,pending:null},n.queue=r,a=mM.bind(null,ie,r,o,a),r.dispatch=a,n.memoizedState=t,[e,a,!1]}function pS(t){var e=et();return h_(e,ke,t)}function h_(t,e,a){if(e=xg(t,e,p_)[0],t=Xc(Un)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var n=Gl(e)}catch(i){throw i===ss?Hd:i}else n=e;e=et();var r=e.queue,o=r.dispatch;return a!==e.memoizedState&&(ie.flags|=2048,Qi(9,{destroy:void 0},gM.bind(null,r,a),null)),[n,o,t]}function gM(t,e){t.action=e}function hS(t){var e=et(),a=ke;if(a!==null)return h_(e,a,t);et(),e=e.memoizedState,a=et();var n=a.queue.dispatch;return a.memoizedState=t,[e,n,!1]}function Qi(t,e,a,n){return t={tag:t,create:a,deps:n,inst:e,next:null},e=ie.updateQueue,e===null&&(e=Ud(),ie.updateQueue=e),a=e.lastEffect,a===null?e.lastEffect=t.next=t:(n=a.next,a.next=t,t.next=n,e.lastEffect=t),t}function m_(){return et().memoizedState}function Yc(t,e,a,n){var r=Ft();ie.flags|=t,r.memoizedState=Qi(1|e,{destroy:void 0},a,n===void 0?null:n)}function qd(t,e,a,n){var r=et();n=n===void 0?null:n;var o=r.memoizedState.inst;ke!==null&&n!==null&&pg(n,ke.memoizedState.deps)?r.memoizedState=Qi(e,o,a,n):(ie.flags|=t,r.memoizedState=Qi(1|e,o,a,n))}function mS(t,e){Yc(8390656,8,t,e)}function bg(t,e){qd(2048,8,t,e)}function vM(t){ie.flags|=4;var e=ie.updateQueue;if(e===null)e=Ud(),ie.updateQueue=e,e.events=[t];else{var a=e.events;a===null?e.events=[t]:a.push(t)}}function g_(t){var e=et().memoizedState;return vM({ref:e,nextImpl:t}),function(){if((ye&2)!==0)throw Error(R(440));return e.impl.apply(void 0,arguments)}}function v_(t,e){return qd(4,2,t,e)}function y_(t,e){return qd(4,4,t,e)}function x_(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 b_(t,e,a){a=a!=null?a.concat([t]):null,qd(4,4,x_.bind(null,e,t),a)}function Sg(){}function S_(t,e){var a=et();e=e===void 0?null:e;var n=a.memoizedState;return e!==null&&pg(e,n[1])?n[0]:(a.memoizedState=[t,e],t)}function C_(t,e){var a=et();e=e===void 0?null:e;var n=a.memoizedState;if(e!==null&&pg(e,n[1]))return n[0];if(n=t(),Do){Lr(!0);try{t()}finally{Lr(!1)}}return a.memoizedState=[n,e],n}function Cg(t,e,a){return a===void 0||(Hn&1073741824)!==0&&(pe&261930)===0?t.memoizedState=e:(t.memoizedState=a,t=cw(),ie.lanes|=t,qr|=t,a)}function __(t,e,a,n){return pa(a,e)?a:Ki.current!==null?(t=Cg(t,a,n),pa(t,e)||(ot=!0),t):(Hn&42)===0||(Hn&1073741824)!==0&&(pe&261930)===0?(ot=!0,t.memoizedState=a):(t=cw(),ie.lanes|=t,qr|=t,e)}function w_(t,e,a,n,r){var o=xe.p;xe.p=o!==0&&8>o?o:8;var i=ee.T,s={};ee.T=s,wg(t,!1,e,a);try{var l=r(),u=ee.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=fM(l,n);xl(t,e,c,fa(t))}else xl(t,e,n,fa(t))}catch(d){xl(t,e,{then:function(){},status:"rejected",reason:d},fa())}finally{xe.p=o,i!==null&&s.types!==null&&(i.types=s.types),ee.T=i}}function yM(){}function wm(t,e,a,n){if(t.tag!==5)throw Error(R(476));var r=L_(t).queue;w_(t,r,e,Lo,a===null?yM:function(){return k_(t),a(n)})}function L_(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Lo,baseState:Lo,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Un,lastRenderedState:Lo},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Un,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function k_(t){var e=L_(t);e.next===null&&(e=t.alternate.memoizedState),xl(t,e.next.queue,{},fa())}function _g(){return Ct(Pl)}function I_(){return et().memoizedState}function A_(){return et().memoizedState}function xM(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=fa();t=Mr(a);var n=Dr(e,t,a);n!==null&&(Xt(n,e,a),gl(n,e,a)),e={cache:lg()},t.payload=e;return}e=e.return}}function bM(t,e,a){var n=fa();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},$d(t)?T_(e,a):(a=rg(t,e,a,n),a!==null&&(Xt(a,t,n),R_(a,e,n)))}function E_(t,e,a){var n=fa();xl(t,e,a,n)}function xl(t,e,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if($d(t))T_(e,r);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(r.hasEagerState=!0,r.eagerState=s,pa(s,i))return Nd(t,e,r,0),Ee===null&&Fd(),!1}catch{}if(a=rg(t,e,r,n),a!==null)return Xt(a,t,n),R_(a,e,n),!0}return!1}function wg(t,e,a,n){if(n={lane:2,revertLane:Dg(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},$d(t)){if(e)throw Error(R(479))}else e=rg(t,a,n,2),e!==null&&Xt(e,t,2)}function $d(t){var e=t.alternate;return t===ie||e!==null&&e===ie}function T_(t,e){ji=gd=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function R_(t,e,a){if((a&4194048)!==0){var n=e.lanes;n&=t.pendingLanes,a|=n,e.lanes=a,gC(t,a)}}var Dl={readContext:Ct,use:zd,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye};Dl.useEffectEvent=Ye;var M_={readContext:Ct,use:zd,useCallback:function(t,e){return Ft().memoizedState=[t,e===void 0?null:e],t},useContext:Ct,useEffect:mS,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,Yc(4194308,4,x_.bind(null,e,t),a)},useLayoutEffect:function(t,e){return Yc(4194308,4,t,e)},useInsertionEffect:function(t,e){Yc(4,2,t,e)},useMemo:function(t,e){var a=Ft();e=e===void 0?null:e;var n=t();if(Do){Lr(!0);try{t()}finally{Lr(!1)}}return a.memoizedState=[n,e],n},useReducer:function(t,e,a){var n=Ft();if(a!==void 0){var r=a(e);if(Do){Lr(!0);try{a(e)}finally{Lr(!1)}}}else r=e;return n.memoizedState=n.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},n.queue=t,t=t.dispatch=bM.bind(null,ie,t),[n.memoizedState,t]},useRef:function(t){var e=Ft();return t={current:t},e.memoizedState=t},useState:function(t){t=Cm(t);var e=t.queue,a=E_.bind(null,ie,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:Sg,useDeferredValue:function(t,e){var a=Ft();return Cg(a,t,e)},useTransition:function(){var t=Cm(!1);return t=w_.bind(null,ie,t.queue,!0,!1),Ft().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var n=ie,r=Ft();if(he){if(a===void 0)throw Error(R(407));a=a()}else{if(a=e(),Ee===null)throw Error(R(349));(pe&127)!==0||o_(n,e,a)}r.memoizedState=a;var o={value:a,getSnapshot:e};return r.queue=o,mS(s_.bind(null,n,o,t),[t]),n.flags|=2048,Qi(9,{destroy:void 0},i_.bind(null,n,o,a,e),null),a},useId:function(){var t=Ft(),e=Ee.identifierPrefix;if(he){var a=un,n=ln;a=(n&~(1<<32-da(n)-1)).toString(32)+a,e="_"+e+"R_"+a,a=vd++,0<a&&(e+="H"+a.toString(32)),e+="_"}else a=pM++,e="_"+e+"r_"+a.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:_g,useFormState:fS,useActionState:fS,useOptimistic:function(t){var e=Ft();e.memoizedState=e.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=a,e=wg.bind(null,ie,!0,a),a.dispatch=e,[t,e]},useMemoCache:yg,useCacheRefresh:function(){return Ft().memoizedState=xM.bind(null,ie)},useEffectEvent:function(t){var e=Ft(),a={impl:t};return e.memoizedState=a,function(){if((ye&2)!==0)throw Error(R(440));return a.impl.apply(void 0,arguments)}}},Lg={readContext:Ct,use:zd,useCallback:S_,useContext:Ct,useEffect:bg,useImperativeHandle:b_,useInsertionEffect:v_,useLayoutEffect:y_,useMemo:C_,useReducer:Xc,useRef:m_,useState:function(){return Xc(Un)},useDebugValue:Sg,useDeferredValue:function(t,e){var a=et();return __(a,ke.memoizedState,t,e)},useTransition:function(){var t=Xc(Un)[0],e=et().memoizedState;return[typeof t=="boolean"?t:Gl(t),e]},useSyncExternalStore:r_,useId:I_,useHostTransitionStatus:_g,useFormState:pS,useActionState:pS,useOptimistic:function(t,e){var a=et();return c_(a,ke,t,e)},useMemoCache:yg,useCacheRefresh:A_};Lg.useEffectEvent=g_;var D_={readContext:Ct,use:zd,useCallback:S_,useContext:Ct,useEffect:bg,useImperativeHandle:b_,useInsertionEffect:v_,useLayoutEffect:y_,useMemo:C_,useReducer:Mh,useRef:m_,useState:function(){return Mh(Un)},useDebugValue:Sg,useDeferredValue:function(t,e){var a=et();return ke===null?Cg(a,t,e):__(a,ke.memoizedState,t,e)},useTransition:function(){var t=Mh(Un)[0],e=et().memoizedState;return[typeof t=="boolean"?t:Gl(t),e]},useSyncExternalStore:r_,useId:I_,useHostTransitionStatus:_g,useFormState:hS,useActionState:hS,useOptimistic:function(t,e){var a=et();return ke!==null?c_(a,ke,t,e):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:yg,useCacheRefresh:A_};D_.useEffectEvent=g_;function Dh(t,e,a,n){e=t.memoizedState,a=a(n,e),a=a==null?e:Ue({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Lm={enqueueSetState:function(t,e,a){t=t._reactInternals;var n=fa(),r=Mr(n);r.payload=e,a!=null&&(r.callback=a),e=Dr(t,r,n),e!==null&&(Xt(e,t,n),gl(e,t,n))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var n=fa(),r=Mr(n);r.tag=1,r.payload=e,a!=null&&(r.callback=a),e=Dr(t,r,n),e!==null&&(Xt(e,t,n),gl(e,t,n))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=fa(),n=Mr(a);n.tag=2,e!=null&&(n.callback=e),e=Dr(t,n,a),e!==null&&(Xt(e,t,a),gl(e,t,a))}};function gS(t,e,a,n,r,o,i){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,o,i):e.prototype&&e.prototype.isPureReactComponent?!Al(a,n)||!Al(r,o):!0}function vS(t,e,a,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(a,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(a,n),e.state!==t&&Lm.enqueueReplaceState(e,e.state,null)}function Oo(t,e){var a=e;if("ref"in e){a={};for(var n in e)n!=="ref"&&(a[n]=e[n])}if(t=t.defaultProps){a===e&&(a=Ue({},a));for(var r in t)a[r]===void 0&&(a[r]=t[r])}return a}function O_(t){ud(t)}function B_(t){console.error(t)}function P_(t){ud(t)}function yd(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(n){setTimeout(function(){throw n})}}function yS(t,e,a){try{var n=t.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function km(t,e,a){return a=Mr(a),a.tag=3,a.payload={element:null},a.callback=function(){yd(t,e)},a}function F_(t){return t=Mr(t),t.tag=3,t}function N_(t,e,a,n){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var o=n.value;t.payload=function(){return r(o)},t.callback=function(){yS(e,a,n)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(t.callback=function(){yS(e,a,n),typeof r!="function"&&(Or===null?Or=new Set([this]):Or.add(this));var s=n.stack;this.componentDidCatch(n.value,{componentStack:s!==null?s:""})})}function SM(t,e,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(e=a.alternate,e!==null&&is(e,a,r,!0),a=ha.current,a!==null){switch(a.tag){case 31:case 13:return Ea===null?_d():a.alternate===null&&Ke===0&&(Ke=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===pd?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([n]):e.add(n),Vh(t,n,r)),!1;case 22:return a.flags|=65536,n===pd?a.flags|=16384:(e=a.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=e):(a=e.retryQueue,a===null?e.retryQueue=new Set([n]):a.add(n)),Vh(t,n,r)),!1}throw Error(R(435,a.tag))}return Vh(t,n,r),_d(),!1}if(he)return e=ha.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,n!==pm&&(t=Error(R(422),{cause:n}),Tl(Ia(t,a)))):(n!==pm&&(e=Error(R(423),{cause:n}),Tl(Ia(e,a))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,n=Ia(n,a),r=km(t.stateNode,n,r),Rh(t,r),Ke!==4&&(Ke=2)),!1;var o=Error(R(520),{cause:n});if(o=Ia(o,a),Cl===null?Cl=[o]:Cl.push(o),Ke!==4&&(Ke=2),e===null)return!0;n=Ia(n,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=r&-r,a.lanes|=t,t=km(a.stateNode,n,t),Rh(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"&&(Or===null||!Or.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=F_(r),N_(r,t,a,n),Rh(a,r),!1}a=a.return}while(a!==null);return!1}var kg=Error(R(461)),ot=!1;function xt(t,e,a,n){e.child=t===null?QC(e,null,a,n):Mo(e,t.child,a,n)}function xS(t,e,a,n,r){a=a.render;var o=e.ref;if("ref"in n){var i={};for(var s in n)s!=="ref"&&(i[s]=n[s])}else i=n;return Ro(e),n=hg(t,e,a,i,o,r),s=mg(),t!==null&&!ot?(gg(t,e,r),zn(t,e,r)):(he&&s&&ig(e),e.flags|=1,xt(t,e,n,r),e.child)}function bS(t,e,a,n,r){if(t===null){var o=a.type;return typeof o=="function"&&!og(o)&&o.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=o,H_(t,e,o,n,r)):(t=Zc(a.type,null,n,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!Ig(t,r)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:Al,a(i,n)&&t.ref===e.ref)return zn(t,e,r)}return e.flags|=1,t=Bn(o,n),t.ref=e.ref,t.return=e,e.child=t}function H_(t,e,a,n,r){if(t!==null){var o=t.memoizedProps;if(Al(o,n)&&t.ref===e.ref)if(ot=!1,e.pendingProps=n=o,Ig(t,r))(t.flags&131072)!==0&&(ot=!0);else return e.lanes=t.lanes,zn(t,e,r)}return Im(t,e,a,n,r)}function U_(t,e,a,n){var r=n.children,o=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((e.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,t!==null){for(n=e.child=t.child,r=0;n!==null;)r=r|n.lanes|n.childLanes,n=n.sibling;n=r&~o}else n=0,e.child=null;return SS(t,e,o,a,n)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Wc(e,o!==null?o.cachePool:null),o!==null?uS(e,o):bm(),t_(e);else return n=e.lanes=536870912,SS(t,e,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(Wc(e,o.cachePool),uS(e,o),_r(e),e.memoizedState=null):(t!==null&&Wc(e,null),bm(),_r(e));return xt(t,e,r,a),e.child}function cl(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function SS(t,e,a,n,r){var o=ug();return o=o===null?null:{parent:rt._currentValue,pool:o},e.memoizedState={baseLanes:a,cachePool:o},t!==null&&Wc(e,null),bm(),t_(e),t!==null&&is(t,e,n,!0),e.childLanes=r,null}function Kc(t,e){return e=xd({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function CS(t,e,a){return Mo(e,t.child,null,a),t=Kc(e,e.pendingProps),t.flags|=2,ia(e),e.memoizedState=null,t}function CM(t,e,a){var n=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(he){if(n.mode==="hidden")return t=Kc(e,n),e.lanes=536870912,cl(null,t);if(Sm(e),(t=He)?(t=Mw(t,Aa),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Hr!==null?{id:ln,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=jC(t),a.return=e,e.child=a,St=e,He=null)):t=null,t===null)throw Ur(e);return e.lanes=536870912,null}return Kc(e,n)}var o=t.memoizedState;if(o!==null){var i=o.dehydrated;if(Sm(e),r)if(e.flags&256)e.flags&=-257,e=CS(t,e,a);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(R(558));else if(ot||is(t,e,a,!1),r=(a&t.childLanes)!==0,ot||r){if(n=Ee,n!==null&&(i=vC(n,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,No(t,i),Xt(n,t,i),kg;_d(),e=CS(t,e,a)}else t=o.treeContext,He=Ta(i.nextSibling),St=e,he=!0,Rr=null,Aa=!1,t!==null&&ZC(e,t),e=Kc(e,n),e.flags|=4096;return e}return t=Bn(t.child,{mode:n.mode,children:n.children}),t.ref=e.ref,e.child=t,t.return=e,t}function Qc(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(R(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function Im(t,e,a,n,r){return Ro(e),a=hg(t,e,a,n,void 0,r),n=mg(),t!==null&&!ot?(gg(t,e,r),zn(t,e,r)):(he&&n&&ig(e),e.flags|=1,xt(t,e,a,r),e.child)}function _S(t,e,a,n,r,o){return Ro(e),e.updateQueue=null,a=n_(e,n,a,r),a_(t),n=mg(),t!==null&&!ot?(gg(t,e,o),zn(t,e,o)):(he&&n&&ig(e),e.flags|=1,xt(t,e,a,o),e.child)}function wS(t,e,a,n,r){if(Ro(e),e.stateNode===null){var o=Pi,i=a.contextType;typeof i=="object"&&i!==null&&(o=Ct(i)),o=new a(n,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Lm,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=n,o.state=e.memoizedState,o.refs={},dg(e),i=a.contextType,o.context=typeof i=="object"&&i!==null?Ct(i):Pi,o.state=e.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(Dh(e,a,i,n),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&&Lm.enqueueReplaceState(o,o.state,null),yl(e,n,o,r),vl(),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!0}else if(t===null){o=e.stateNode;var s=e.memoizedProps,l=Oo(a,s);o.props=l;var u=o.context,c=a.contextType;i=Pi,typeof c=="object"&&c!==null&&(i=Ct(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)&&vS(e,o,n,i),br=!1;var f=e.memoizedState;o.state=f,yl(e,n,o,r),vl(),u=e.memoizedState,s||f!==u||br?(typeof d=="function"&&(Dh(e,a,d,n),u=e.memoizedState),(l=br||gS(e,a,l,n,f,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=n,e.memoizedState=u),o.props=n,o.state=u,o.context=i,n=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,ym(t,e),i=e.memoizedProps,c=Oo(a,i),o.props=c,d=e.pendingProps,f=o.context,u=a.contextType,l=Pi,typeof u=="object"&&u!==null&&(l=Ct(u)),s=a.getDerivedStateFromProps,(u=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||f!==l)&&vS(e,o,n,l),br=!1,f=e.memoizedState,o.state=f,yl(e,n,o,r),vl();var m=e.memoizedState;i!==d||f!==m||br||t!==null&&t.dependencies!==null&&fd(t.dependencies)?(typeof s=="function"&&(Dh(e,a,s,n),m=e.memoizedState),(c=br||gS(e,a,c,n,f,m,l)||t!==null&&t.dependencies!==null&&fd(t.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,m,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=m),o.props=n,o.state=m,o.context=l,n=c):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),n=!1)}return o=n,Qc(t,e),n=(e.flags&128)!==0,o||n?(o=e.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:o.render(),e.flags|=1,t!==null&&n?(e.child=Mo(e,t.child,null,r),e.child=Mo(e,null,a,r)):xt(t,e,a,r),e.memoizedState=o.state,t=e.child):t=zn(t,e,r),t}function LS(t,e,a,n){return To(),e.flags|=256,xt(t,e,a,n),e.child}var Oh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bh(t){return{baseLanes:t,cachePool:XC()}}function Ph(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=la),t}function z_(t,e,a){var n=e.pendingProps,r=!1,o=(e.flags&128)!==0,i;if((i=o)||(i=t!==null&&t.memoizedState===null?!1:(Je.current&2)!==0),i&&(r=!0,e.flags&=-129),i=(e.flags&32)!==0,e.flags&=-33,t===null){if(he){if(r?Cr(e):_r(e),(t=He)?(t=Mw(t,Aa),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Hr!==null?{id:ln,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=jC(t),a.return=e,e.child=a,St=e,He=null)):t=null,t===null)throw Ur(e);return zm(t)?e.lanes=32:e.lanes=536870912,null}var s=n.children;return n=n.fallback,r?(_r(e),r=e.mode,s=xd({mode:"hidden",children:s},r),n=ko(n,r,a,null),s.return=e,n.return=e,s.sibling=n,e.child=s,n=e.child,n.memoizedState=Bh(a),n.childLanes=Ph(t,i,a),e.memoizedState=Oh,cl(null,n)):(Cr(e),Am(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(Cr(e),e.flags&=-257,e=Fh(t,e,a)):e.memoizedState!==null?(_r(e),e.child=t.child,e.flags|=128,e=null):(_r(e),s=n.fallback,r=e.mode,n=xd({mode:"visible",children:n.children},r),s=ko(s,r,a,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,Mo(e,t.child,null,a),n=e.child,n.memoizedState=Bh(a),n.childLanes=Ph(t,i,a),e.memoizedState=Oh,e=cl(null,n));else if(Cr(e),zm(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var u=i.dgst;i=u,n=Error(R(419)),n.stack="",n.digest=i,Tl({value:n,source:null,stack:null}),e=Fh(t,e,a)}else if(ot||is(t,e,a,!1),i=(a&t.childLanes)!==0,ot||i){if(i=Ee,i!==null&&(n=vC(i,a),n!==0&&n!==l.retryLane))throw l.retryLane=n,No(t,n),Xt(i,t,n),kg;Um(s)||_d(),e=Fh(t,e,a)}else Um(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,He=Ta(s.nextSibling),St=e,he=!0,Rr=null,Aa=!1,t!==null&&ZC(e,t),e=Am(e,n.children),e.flags|=4096);return e}return r?(_r(e),s=n.fallback,r=e.mode,l=t.child,u=l.sibling,n=Bn(l,{mode:"hidden",children:n.children}),n.subtreeFlags=l.subtreeFlags&65011712,u!==null?s=Bn(u,s):(s=ko(s,r,a,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,cl(null,n),n=e.child,s=t.child.memoizedState,s===null?s=Bh(a):(r=s.cachePool,r!==null?(l=rt._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=XC(),s={baseLanes:s.baseLanes|a,cachePool:r}),n.memoizedState=s,n.childLanes=Ph(t,i,a),e.memoizedState=Oh,cl(t.child,n)):(Cr(e),a=t.child,t=a.sibling,a=Bn(a,{mode:"visible",children:n.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 Am(t,e){return e=xd({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function xd(t,e){return t=sa(22,t,null,e),t.lanes=0,t}function Fh(t,e,a){return Mo(e,t.child,null,a),t=Am(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function kS(t,e,a){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),mm(t.return,e,a)}function Nh(t,e,a,n,r,o){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:r,treeForkCount:o}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=a,i.tailMode=r,i.treeForkCount=o)}function q_(t,e,a){var n=e.pendingProps,r=n.revealOrder,o=n.tail;n=n.children;var i=Je.current,s=(i&2)!==0;if(s?(i=i&1|2,e.flags|=128):i&=1,De(Je,i),xt(t,e,n,a),n=he?El:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&kS(t,a,e);else if(t.tag===19)kS(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(r){case"forwards":for(a=e.child,r=null;a!==null;)t=a.alternate,t!==null&&md(t)===null&&(r=a),a=a.sibling;a=r,a===null?(r=e.child,e.child=null):(r=a.sibling,a.sibling=null),Nh(e,!1,r,a,o,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&md(t)===null){e.child=r;break}t=r.sibling,r.sibling=a,a=r,r=t}Nh(e,!0,a,null,o,n);break;case"together":Nh(e,!1,null,null,void 0,n);break;default:e.memoizedState=null}return e.child}function zn(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),qr|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(is(t,e,a,!1),(a&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(R(153));if(e.child!==null){for(t=e.child,a=Bn(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=Bn(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function Ig(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&fd(t)))}function _M(t,e,a){switch(e.tag){case 3:od(e,e.stateNode.containerInfo),Sr(e,rt,t.memoizedState.cache),To();break;case 27:case 5:am(e);break;case 4:od(e,e.stateNode.containerInfo);break;case 10:Sr(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Sm(e),null;break;case 13:var n=e.memoizedState;if(n!==null)return n.dehydrated!==null?(Cr(e),e.flags|=128,null):(a&e.child.childLanes)!==0?z_(t,e,a):(Cr(e),t=zn(t,e,a),t!==null?t.sibling:null);Cr(e);break;case 19:var r=(t.flags&128)!==0;if(n=(a&e.childLanes)!==0,n||(is(t,e,a,!1),n=(a&e.childLanes)!==0),r){if(n)return q_(t,e,a);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),De(Je,Je.current),n)break;return null;case 22:return e.lanes=0,U_(t,e,a,e.pendingProps);case 24:Sr(e,rt,t.memoizedState.cache)}return zn(t,e,a)}function $_(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)ot=!0;else{if(!Ig(t,a)&&(e.flags&128)===0)return ot=!1,_M(t,e,a);ot=(t.flags&131072)!==0}else ot=!1,he&&(e.flags&1048576)!==0&&GC(e,El,e.index);switch(e.lanes=0,e.tag){case 16:e:{var n=e.pendingProps;if(t=_o(e.elementType),e.type=t,typeof t=="function")og(t)?(n=Oo(t,n),e.tag=1,e=wS(null,e,t,n,a)):(e.tag=0,e=Im(null,e,t,n,a));else{if(t!=null){var r=t.$$typeof;if(r===jm){e.tag=11,e=xS(null,e,t,n,a);break e}else if(r===Gm){e.tag=14,e=bS(null,e,t,n,a);break e}}throw e=em(t)||t,Error(R(306,e,""))}}return e;case 0:return Im(t,e,e.type,e.pendingProps,a);case 1:return n=e.type,r=Oo(n,e.pendingProps),wS(t,e,n,r,a);case 3:e:{if(od(e,e.stateNode.containerInfo),t===null)throw Error(R(387));n=e.pendingProps;var o=e.memoizedState;r=o.element,ym(t,e),yl(e,n,null,a);var i=e.memoizedState;if(n=i.cache,Sr(e,rt,n),n!==o.cache&&gm(e,[rt],a,!0),vl(),n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){e=LS(t,e,n,a);break e}else if(n!==r){r=Ia(Error(R(424)),e),Tl(r),e=LS(t,e,n,a);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,He=Ta(t.firstChild),St=e,he=!0,Rr=null,Aa=!0,a=QC(e,null,n,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(To(),n===r){e=zn(t,e,a);break e}xt(t,e,n,a)}e=e.child}return e;case 26:return Qc(t,e),t===null?(a=WS(e.type,null,e.pendingProps,null))?e.memoizedState=a:he||(a=e.type,t=e.pendingProps,n=Id(Tr.current).createElement(a),n[bt]=e,n[Yt]=t,_t(n,a,t),mt(n),e.stateNode=n):e.memoizedState=WS(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return am(e),t===null&&he&&(n=e.stateNode=Dw(e.type,e.pendingProps,Tr.current),St=e,Aa=!0,r=He,Vr(e.type)?(qm=r,He=Ta(n.firstChild)):He=r),xt(t,e,e.pendingProps.children,a),Qc(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&he&&((r=n=He)&&(n=KM(n,e.type,e.pendingProps,Aa),n!==null?(e.stateNode=n,St=e,He=Ta(n.firstChild),Aa=!1,r=!0):r=!1),r||Ur(e)),am(e),r=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,n=o.children,Nm(r,o)?n=null:i!==null&&Nm(r,i)&&(e.flags|=32),e.memoizedState!==null&&(r=hg(t,e,hM,null,null,a),Pl._currentValue=r),Qc(t,e),xt(t,e,n,a),e.child;case 6:return t===null&&he&&((t=a=He)&&(a=QM(a,e.pendingProps,Aa),a!==null?(e.stateNode=a,St=e,He=null,t=!0):t=!1),t||Ur(e)),null;case 13:return z_(t,e,a);case 4:return od(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Mo(e,null,n,a):xt(t,e,n,a),e.child;case 11:return xS(t,e,e.type,e.pendingProps,a);case 7:return xt(t,e,e.pendingProps,a),e.child;case 8:return xt(t,e,e.pendingProps.children,a),e.child;case 12:return xt(t,e,e.pendingProps.children,a),e.child;case 10:return n=e.pendingProps,Sr(e,e.type,n.value),xt(t,e,n.children,a),e.child;case 9:return r=e.type._context,n=e.pendingProps.children,Ro(e),r=Ct(r),n=n(r),e.flags|=1,xt(t,e,n,a),e.child;case 14:return bS(t,e,e.type,e.pendingProps,a);case 15:return H_(t,e,e.type,e.pendingProps,a);case 19:return q_(t,e,a);case 31:return CM(t,e,a);case 22:return U_(t,e,a,e.pendingProps);case 24:return Ro(e),n=Ct(rt),t===null?(r=ug(),r===null&&(r=Ee,o=lg(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),e.memoizedState={parent:n,cache:r},dg(e),Sr(e,rt,r)):((t.lanes&a)!==0&&(ym(t,e),yl(e,null,null,a),vl()),r=t.memoizedState,o=e.memoizedState,r.parent!==n?(r={parent:n,cache:n},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),Sr(e,rt,n)):(n=o.cache,Sr(e,rt,n),n!==r.cache&&gm(e,[rt],a,!0))),xt(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(R(156,e.tag))}function kn(t){t.flags|=4}function Hh(t,e,a,n,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(pw())t.flags|=8192;else throw Ao=pd,cg}else t.flags&=-16777217}function IS(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Pw(e))if(pw())t.flags|=8192;else throw Ao=pd,cg}function Pc(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?hC():536870912,t.lanes|=e,Ji|=e)}function nl(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 n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function Ne(t){var e=t.alternate!==null&&t.alternate.child===t.child,a=0,n=0;if(e)for(var r=t.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags&65011712,n|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=n,t.childLanes=a,e}function wM(t,e,a){var n=e.pendingProps;switch(sg(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 a=e.stateNode,n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Pn(rt),Zi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(wi(e)?kn(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Th())),Ne(e),null;case 26:var r=e.type,o=e.memoizedState;return t===null?(kn(e),o!==null?(Ne(e),IS(e,o)):(Ne(e),Hh(e,r,null,n,a))):o?o!==t.memoizedState?(kn(e),Ne(e),IS(e,o)):(Ne(e),e.flags&=-16777217):(t=t.memoizedProps,t!==n&&kn(e),Ne(e),Hh(e,r,t,n,a)),null;case 27:if(id(e),a=Tr.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==n&&kn(e);else{if(!n){if(e.stateNode===null)throw Error(R(166));return Ne(e),null}t=dn.current,wi(e)?aS(e,t):(t=Dw(r,n,a),e.stateNode=t,kn(e))}return Ne(e),null;case 5:if(id(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==n&&kn(e);else{if(!n){if(e.stateNode===null)throw Error(R(166));return Ne(e),null}if(o=dn.current,wi(e))aS(e,o);else{var i=Id(Tr.current);switch(o){case 1:o=i.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=i.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":o=i.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof n.is=="string"?i.createElement("select",{is:n.is}):i.createElement("select"),n.multiple?o.multiple=!0:n.size&&(o.size=n.size);break;default:o=typeof n.is=="string"?i.createElement(r,{is:n.is}):i.createElement(r)}}o[bt]=e,o[Yt]=n;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(_t(o,r,n),r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&kn(e)}}return Ne(e),Hh(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,a),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==n&&kn(e);else{if(typeof n!="string"&&e.stateNode===null)throw Error(R(166));if(t=Tr.current,wi(e)){if(t=e.stateNode,a=e.memoizedProps,n=null,r=St,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}t[bt]=e,t=!!(t.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Ew(t.nodeValue,a)),t||Ur(e,!0)}else t=Id(t).createTextNode(n),t[bt]=e,e.stateNode=t}return Ne(e),null;case 31:if(a=e.memoizedState,t===null||t.memoizedState!==null){if(n=wi(e),a!==null){if(t===null){if(!n)throw Error(R(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(R(557));t[bt]=e}else To(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ne(e),t=!1}else a=Th(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return e.flags&256?(ia(e),e):(ia(e),null);if((e.flags&128)!==0)throw Error(R(558))}return Ne(e),null;case 13:if(n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=wi(e),n!==null&&n.dehydrated!==null){if(t===null){if(!r)throw Error(R(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(R(317));r[bt]=e}else To(),(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?(ia(e),e):(ia(e),null)}return ia(e),(e.flags&128)!==0?(e.lanes=a,e):(a=n!==null,t=t!==null&&t.memoizedState!==null,a&&(n=e.child,r=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(r=n.alternate.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048)),a!==t&&a&&(e.child.flags|=8192),Pc(e,e.updateQueue),Ne(e),null);case 4:return Zi(),t===null&&Og(e.stateNode.containerInfo),Ne(e),null;case 10:return Pn(e.type),Ne(e),null;case 19:if(gt(Je),n=e.memoizedState,n===null)return Ne(e),null;if(r=(e.flags&128)!==0,o=n.rendering,o===null)if(r)nl(n,!1);else{if(Ke!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=md(t),o!==null){for(e.flags|=128,nl(n,!1),t=o.updateQueue,e.updateQueue=t,Pc(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)VC(a,t),a=a.sibling;return De(Je,Je.current&1|2),he&&Tn(e,n.treeForkCount),e.child}t=t.sibling}n.tail!==null&&ua()>Sd&&(e.flags|=128,r=!0,nl(n,!1),e.lanes=4194304)}else{if(!r)if(t=md(o),t!==null){if(e.flags|=128,r=!0,t=t.updateQueue,e.updateQueue=t,Pc(e,t),nl(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!he)return Ne(e),null}else 2*ua()-n.renderingStartTime>Sd&&a!==536870912&&(e.flags|=128,r=!0,nl(n,!1),e.lanes=4194304);n.isBackwards?(o.sibling=e.child,e.child=o):(t=n.last,t!==null?t.sibling=o:e.child=o,n.last=o)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=ua(),t.sibling=null,a=Je.current,De(Je,r?a&1|2:a&1),he&&Tn(e,n.treeForkCount),t):(Ne(e),null);case 22:case 23:return ia(e),fg(),n=e.memoizedState!==null,t!==null?t.memoizedState!==null!==n&&(e.flags|=8192):n&&(e.flags|=8192),n?(a&536870912)!==0&&(e.flags&128)===0&&(Ne(e),e.subtreeFlags&6&&(e.flags|=8192)):Ne(e),a=e.updateQueue,a!==null&&Pc(e,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==a&&(e.flags|=2048),t!==null&>(Io),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),Pn(rt),Ne(e),null;case 25:return null;case 30:return null}throw Error(R(156,e.tag))}function LM(t,e){switch(sg(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Pn(rt),Zi(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return id(e),null;case 31:if(e.memoizedState!==null){if(ia(e),e.alternate===null)throw Error(R(340));To()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(ia(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(R(340));To()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return gt(Je),null;case 4:return Zi(),null;case 10:return Pn(e.type),null;case 22:case 23:return ia(e),fg(),t!==null&>(Io),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Pn(rt),null;case 25:return null;default:return null}}function V_(t,e){switch(sg(e),e.tag){case 3:Pn(rt),Zi();break;case 26:case 27:case 5:id(e);break;case 4:Zi();break;case 31:e.memoizedState!==null&&ia(e);break;case 13:ia(e);break;case 19:gt(Je);break;case 10:Pn(e.type);break;case 22:case 23:ia(e),fg(),t!==null&>(Io);break;case 24:Pn(rt)}}function Zl(t,e){try{var a=e.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var r=n.next;a=r;do{if((a.tag&t)===t){n=void 0;var o=a.create,i=a.inst;n=o(),i.destroy=n}a=a.next}while(a!==r)}}catch(s){Ce(e,e.return,s)}}function zr(t,e,a){try{var n=e.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&t)===t){var i=n.inst,s=i.destroy;if(s!==void 0){i.destroy=void 0,r=e;var l=a,u=s;try{u()}catch(c){Ce(r,l,c)}}}n=n.next}while(n!==o)}}catch(c){Ce(e,e.return,c)}}function j_(t){var e=t.updateQueue;if(e!==null){var a=t.stateNode;try{e_(e,a)}catch(n){Ce(t,t.return,n)}}}function G_(t,e,a){a.props=Oo(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(n){Ce(t,e,n)}}function bl(t,e){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var n=t.stateNode;break;case 30:n=t.stateNode;break;default:n=t.stateNode}typeof a=="function"?t.refCleanup=a(n):a.current=n}}catch(r){Ce(t,e,r)}}function cn(t,e){var a=t.ref,n=t.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){Ce(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){Ce(t,e,r)}else a.current=null}function Z_(t){var e=t.type,a=t.memoizedProps,n=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(r){Ce(t,t.return,r)}}function Uh(t,e,a){try{var n=t.stateNode;jM(n,t.type,a,e),n[Yt]=e}catch(r){Ce(t,t.return,r)}}function W_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Vr(t.type)||t.tag===4}function zh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||W_(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&&Vr(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 Em(t,e,a){var n=t.tag;if(n===5||n===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=Dn));else if(n!==4&&(n===27&&Vr(t.type)&&(a=t.stateNode,e=null),t=t.child,t!==null))for(Em(t,e,a),t=t.sibling;t!==null;)Em(t,e,a),t=t.sibling}function bd(t,e,a){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?a.insertBefore(t,e):a.appendChild(t);else if(n!==4&&(n===27&&Vr(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(bd(t,e,a),t=t.sibling;t!==null;)bd(t,e,a),t=t.sibling}function X_(t){var e=t.stateNode,a=t.memoizedProps;try{for(var n=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);_t(e,n,a),e[bt]=t,e[Yt]=a}catch(o){Ce(t,t.return,o)}}var Rn=!1,nt=!1,qh=!1,AS=typeof WeakSet=="function"?WeakSet:Set,ht=null;function kM(t,e){if(t=t.containerInfo,Pm=Rd,t=PC(t),ag(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var i=0,s=-1,l=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var m;d!==a||r!==0&&d.nodeType!==3||(s=i+r),d!==o||n!==0&&d.nodeType!==3||(l=i+n),d.nodeType===3&&(i+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===t)break t;if(f===a&&++u===r&&(s=i),f===o&&++c===n&&(l=i),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}a=s===-1||l===-1?null:{start:s,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(Fm={focusedElem:t,selectionRange:a},Rd=!1,ht=e;ht!==null;)if(e=ht,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ht=t;else for(;ht!==null;){switch(e=ht,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++)r=t[a],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&o!==null){t=void 0,a=e,r=o.memoizedProps,o=o.memoizedState,n=a.stateNode;try{var S=Oo(a.type,r);t=n.getSnapshotBeforeUpdate(S,o),n.__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)Hm(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Hm(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(R(163))}if(t=e.sibling,t!==null){t.return=e.return,ht=t;break}ht=e.return}}function Y_(t,e,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:An(t,a),n&4&&Zl(5,a);break;case 1:if(An(t,a),n&4)if(t=a.stateNode,e===null)try{t.componentDidMount()}catch(i){Ce(a,a.return,i)}else{var r=Oo(a.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(i){Ce(a,a.return,i)}}n&64&&j_(a),n&512&&bl(a,a.return);break;case 3:if(An(t,a),n&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{e_(t,e)}catch(i){Ce(a,a.return,i)}}break;case 27:e===null&&n&4&&X_(a);case 26:case 5:An(t,a),e===null&&n&4&&Z_(a),n&512&&bl(a,a.return);break;case 12:An(t,a);break;case 31:An(t,a),n&4&&J_(t,a);break;case 13:An(t,a),n&4&&ew(t,a),n&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=BM.bind(null,a),JM(t,a))));break;case 22:if(n=a.memoizedState!==null||Rn,!n){e=e!==null&&e.memoizedState!==null||nt,r=Rn;var o=nt;Rn=n,(nt=e)&&!o?En(t,a,(a.subtreeFlags&8772)!==0):An(t,a),Rn=r,nt=o}break;case 30:break;default:An(t,a)}}function K_(t){var e=t.alternate;e!==null&&(t.alternate=null,K_(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Ym(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 $e=null,Zt=!1;function In(t,e,a){for(a=a.child;a!==null;)Q_(t,e,a),a=a.sibling}function Q_(t,e,a){if(ca&&typeof ca.onCommitFiberUnmount=="function")try{ca.onCommitFiberUnmount(Ul,a)}catch{}switch(a.tag){case 26:nt||cn(a,e),In(t,e,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:nt||cn(a,e);var n=$e,r=Zt;Vr(a.type)&&($e=a.stateNode,Zt=!1),In(t,e,a),wl(a.stateNode),$e=n,Zt=r;break;case 5:nt||cn(a,e);case 6:if(n=$e,r=Zt,$e=null,In(t,e,a),$e=n,Zt=r,$e!==null)if(Zt)try{($e.nodeType===9?$e.body:$e.nodeName==="HTML"?$e.ownerDocument.body:$e).removeChild(a.stateNode)}catch(o){Ce(a,e,o)}else try{$e.removeChild(a.stateNode)}catch(o){Ce(a,e,o)}break;case 18:$e!==null&&(Zt?(t=$e,$S(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ns(t)):$S($e,a.stateNode));break;case 4:n=$e,r=Zt,$e=a.stateNode.containerInfo,Zt=!0,In(t,e,a),$e=n,Zt=r;break;case 0:case 11:case 14:case 15:zr(2,a,e),nt||zr(4,a,e),In(t,e,a);break;case 1:nt||(cn(a,e),n=a.stateNode,typeof n.componentWillUnmount=="function"&&G_(a,e,n)),In(t,e,a);break;case 21:In(t,e,a);break;case 22:nt=(n=nt)||a.memoizedState!==null,In(t,e,a),nt=n;break;default:In(t,e,a)}}function J_(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ns(t)}catch(a){Ce(e,e.return,a)}}}function ew(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ns(t)}catch(a){Ce(e,e.return,a)}}function IM(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new AS),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new AS),e;default:throw Error(R(435,t.tag))}}function Fc(t,e){var a=IM(t);e.forEach(function(n){if(!a.has(n)){a.add(n);var r=PM.bind(null,t,n);n.then(r,r)}})}function jt(t,e){var a=e.deletions;if(a!==null)for(var n=0;n<a.length;n++){var r=a[n],o=t,i=e,s=i;e:for(;s!==null;){switch(s.tag){case 27:if(Vr(s.type)){$e=s.stateNode,Zt=!1;break e}break;case 5:$e=s.stateNode,Zt=!1;break e;case 3:case 4:$e=s.stateNode.containerInfo,Zt=!0;break e}s=s.return}if($e===null)throw Error(R(160));Q_(o,i,r),$e=null,Zt=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)tw(e,t),e=e.sibling}var Va=null;function tw(t,e){var a=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:jt(e,t),Gt(t),n&4&&(zr(3,t,t.return),Zl(3,t),zr(5,t,t.return));break;case 1:jt(e,t),Gt(t),n&512&&(nt||a===null||cn(a,a.return)),n&64&&Rn&&(t=t.updateQueue,t!==null&&(n=t.callbacks,n!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var r=Va;if(jt(e,t),Gt(t),n&512&&(nt||a===null||cn(a,a.return)),n&4){var o=a!==null?a.memoizedState:null;if(n=t.memoizedState,a===null)if(n===null)if(t.stateNode===null){e:{n=t.type,a=t.memoizedProps,r=r.ownerDocument||r;t:switch(n){case"title":o=r.getElementsByTagName("title")[0],(!o||o[$l]||o[bt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(n),r.head.insertBefore(o,r.querySelector("head > title"))),_t(o,n,a),o[bt]=t,mt(o),n=o;break e;case"link":var i=YS("link","href",r).get(n+(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=r.createElement(n),_t(o,n,a),r.head.appendChild(o);break;case"meta":if(i=YS("meta","content",r).get(n+(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=r.createElement(n),_t(o,n,a),r.head.appendChild(o);break;default:throw Error(R(468,n))}o[bt]=t,mt(o),n=o}t.stateNode=n}else KS(r,t.type,t.stateNode);else t.stateNode=XS(r,n,t.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?KS(r,t.type,t.stateNode):XS(r,n,t.memoizedProps)):n===null&&t.stateNode!==null&&Uh(t,t.memoizedProps,a.memoizedProps)}break;case 27:jt(e,t),Gt(t),n&512&&(nt||a===null||cn(a,a.return)),a!==null&&n&4&&Uh(t,t.memoizedProps,a.memoizedProps);break;case 5:if(jt(e,t),Gt(t),n&512&&(nt||a===null||cn(a,a.return)),t.flags&32){r=t.stateNode;try{Xi(r,"")}catch(S){Ce(t,t.return,S)}}n&4&&t.stateNode!=null&&(r=t.memoizedProps,Uh(t,r,a!==null?a.memoizedProps:r)),n&1024&&(qh=!0);break;case 6:if(jt(e,t),Gt(t),n&4){if(t.stateNode===null)throw Error(R(162));n=t.memoizedProps,a=t.stateNode;try{a.nodeValue=n}catch(S){Ce(t,t.return,S)}}break;case 3:if(td=null,r=Va,Va=Ad(e.containerInfo),jt(e,t),Va=r,Gt(t),n&4&&a!==null&&a.memoizedState.isDehydrated)try{ns(e.containerInfo)}catch(S){Ce(t,t.return,S)}qh&&(qh=!1,aw(t));break;case 4:n=Va,Va=Ad(t.stateNode.containerInfo),jt(e,t),Gt(t),Va=n;break;case 12:jt(e,t),Gt(t);break;case 31:jt(e,t),Gt(t),n&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Fc(t,n)));break;case 13:jt(e,t),Gt(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Vd=ua()),n&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Fc(t,n)));break;case 22:r=t.memoizedState!==null;var l=a!==null&&a.memoizedState!==null,u=Rn,c=nt;if(Rn=u||r,nt=c||l,jt(e,t),nt=c,Rn=u,Gt(t),n&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(a===null||l||Rn||nt||wo(t)),a=null,e=t;;){if(e.tag===5||e.tag===26){if(a===null){l=a=e;try{if(o=l.stateNode,r)i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{s=l.stateNode;var d=l.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(S){Ce(l,l.return,S)}}}else if(e.tag===6){if(a===null){l=e;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(S){Ce(l,l.return,S)}}}else if(e.tag===18){if(a===null){l=e;try{var m=l.stateNode;r?VS(m,!0):VS(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}n&4&&(n=t.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,Fc(t,a))));break;case 19:jt(e,t),Gt(t),n&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Fc(t,n)));break;case 30:break;case 21:break;default:jt(e,t),Gt(t)}}function Gt(t){var e=t.flags;if(e&2){try{for(var a,n=t.return;n!==null;){if(W_(n)){a=n;break}n=n.return}if(a==null)throw Error(R(160));switch(a.tag){case 27:var r=a.stateNode,o=zh(t);bd(t,o,r);break;case 5:var i=a.stateNode;a.flags&32&&(Xi(i,""),a.flags&=-33);var s=zh(t);bd(t,s,i);break;case 3:case 4:var l=a.stateNode.containerInfo,u=zh(t);Em(t,u,l);break;default:throw Error(R(161))}}catch(c){Ce(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function aw(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;aw(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function An(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Y_(t,e.alternate,e),e=e.sibling}function wo(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:zr(4,e,e.return),wo(e);break;case 1:cn(e,e.return);var a=e.stateNode;typeof a.componentWillUnmount=="function"&&G_(e,e.return,a),wo(e);break;case 27:wl(e.stateNode);case 26:case 5:cn(e,e.return),wo(e);break;case 22:e.memoizedState===null&&wo(e);break;case 30:wo(e);break;default:wo(e)}t=t.sibling}}function En(t,e,a){for(a=a&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var n=e.alternate,r=t,o=e,i=o.flags;switch(o.tag){case 0:case 11:case 15:En(r,o,a),Zl(4,o);break;case 1:if(En(r,o,a),n=o,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){Ce(n,n.return,u)}if(n=o,r=n.updateQueue,r!==null){var s=n.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)JC(l[r],s)}catch(u){Ce(n,n.return,u)}}a&&i&64&&j_(o),bl(o,o.return);break;case 27:X_(o);case 26:case 5:En(r,o,a),a&&n===null&&i&4&&Z_(o),bl(o,o.return);break;case 12:En(r,o,a);break;case 31:En(r,o,a),a&&i&4&&J_(r,o);break;case 13:En(r,o,a),a&&i&4&&ew(r,o);break;case 22:o.memoizedState===null&&En(r,o,a),bl(o,o.return);break;case 30:break;default:En(r,o,a)}e=e.sibling}}function Ag(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&&jl(a))}function Eg(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&jl(t))}function $a(t,e,a,n){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)nw(t,e,a,n),e=e.sibling}function nw(t,e,a,n){var r=e.flags;switch(e.tag){case 0:case 11:case 15:$a(t,e,a,n),r&2048&&Zl(9,e);break;case 1:$a(t,e,a,n);break;case 3:$a(t,e,a,n),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&jl(t)));break;case 12:if(r&2048){$a(t,e,a,n),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 $a(t,e,a,n);break;case 31:$a(t,e,a,n);break;case 13:$a(t,e,a,n);break;case 23:break;case 22:o=e.stateNode,i=e.alternate,e.memoizedState!==null?o._visibility&2?$a(t,e,a,n):Sl(t,e):o._visibility&2?$a(t,e,a,n):(o._visibility|=2,ki(t,e,a,n,(e.subtreeFlags&10256)!==0||!1)),r&2048&&Ag(i,e);break;case 24:$a(t,e,a,n),r&2048&&Eg(e.alternate,e);break;default:$a(t,e,a,n)}}function ki(t,e,a,n,r){for(r=r&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var o=t,i=e,s=a,l=n,u=i.flags;switch(i.tag){case 0:case 11:case 15:ki(o,i,s,l,r),Zl(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?ki(o,i,s,l,r):Sl(o,i):(c._visibility|=2,ki(o,i,s,l,r)),r&&u&2048&&Ag(i.alternate,i);break;case 24:ki(o,i,s,l,r),r&&u&2048&&Eg(i.alternate,i);break;default:ki(o,i,s,l,r)}e=e.sibling}}function Sl(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var a=t,n=e,r=n.flags;switch(n.tag){case 22:Sl(a,n),r&2048&&Ag(n.alternate,n);break;case 24:Sl(a,n),r&2048&&Eg(n.alternate,n);break;default:Sl(a,n)}e=e.sibling}}var dl=8192;function Li(t,e,a){if(t.subtreeFlags&dl)for(t=t.child;t!==null;)rw(t,e,a),t=t.sibling}function rw(t,e,a){switch(t.tag){case 26:Li(t,e,a),t.flags&dl&&t.memoizedState!==null&&d2(a,Va,t.memoizedState,t.memoizedProps);break;case 5:Li(t,e,a);break;case 3:case 4:var n=Va;Va=Ad(t.stateNode.containerInfo),Li(t,e,a),Va=n;break;case 22:t.memoizedState===null&&(n=t.alternate,n!==null&&n.memoizedState!==null?(n=dl,dl=16777216,Li(t,e,a),dl=n):Li(t,e,a));break;default:Li(t,e,a)}}function ow(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 rl(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var n=e[a];ht=n,sw(n,t)}ow(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)iw(t),t=t.sibling}function iw(t){switch(t.tag){case 0:case 11:case 15:rl(t),t.flags&2048&&zr(9,t,t.return);break;case 3:rl(t);break;case 12:rl(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Jc(t)):rl(t);break;default:rl(t)}}function Jc(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var n=e[a];ht=n,sw(n,t)}ow(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:zr(8,e,e.return),Jc(e);break;case 22:a=e.stateNode,a._visibility&2&&(a._visibility&=-3,Jc(e));break;default:Jc(e)}t=t.sibling}}function sw(t,e){for(;ht!==null;){var a=ht;switch(a.tag){case 0:case 11:case 15:zr(8,a,e);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:jl(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,ht=n;else e:for(a=t;ht!==null;){n=ht;var r=n.sibling,o=n.return;if(K_(n),n===a){ht=null;break e}if(r!==null){r.return=o,ht=r;break e}ht=o}}}var AM={getCacheForType:function(t){var e=Ct(rt),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a},cacheSignal:function(){return Ct(rt).controller.signal}},EM=typeof WeakMap=="function"?WeakMap:Map,ye=0,Ee=null,ce=null,pe=0,Se=0,oa=null,Ir=!1,ls=!1,Tg=!1,qn=0,Ke=0,qr=0,Eo=0,Rg=0,la=0,Ji=0,Cl=null,Wt=null,Tm=!1,Vd=0,lw=0,Sd=1/0,Cd=null,Or=null,st=0,Br=null,es=null,Fn=0,Rm=0,Mm=null,uw=null,_l=0,Dm=null;function fa(){return(ye&2)!==0&&pe!==0?pe&-pe:ee.T!==null?Dg():yC()}function cw(){if(la===0)if((pe&536870912)===0||he){var t=Ic;Ic<<=1,(Ic&3932160)===0&&(Ic=262144),la=t}else la=536870912;return t=ha.current,t!==null&&(t.flags|=32),la}function Xt(t,e,a){(t===Ee&&(Se===2||Se===9)||t.cancelPendingCommit!==null)&&(ts(t,0),Ar(t,pe,la,!1)),ql(t,a),((ye&2)===0||t!==Ee)&&(t===Ee&&((ye&2)===0&&(Eo|=a),Ke===4&&Ar(t,pe,la,!1)),pn(t))}function dw(t,e,a){if((ye&6)!==0)throw Error(R(327));var n=!a&&(e&127)===0&&(e&t.expiredLanes)===0||zl(t,e),r=n?MM(t,e):$h(t,e,!0),o=n;do{if(r===0){ls&&!n&&Ar(t,e,0,!1);break}else{if(a=t.current.alternate,o&&!TM(a)){r=$h(t,e,!1),o=!1;continue}if(r===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;r=Cl;var l=s.current.memoizedState.isDehydrated;if(l&&(ts(s,i).flags|=256),i=$h(s,i,!1),i!==2){if(Tg&&!l){s.errorRecoveryDisabledLanes|=o,Eo|=o,r=4;break e}o=Wt,Wt=r,o!==null&&(Wt===null?Wt=o:Wt.push.apply(Wt,o))}r=i}if(o=!1,r!==2)continue}}if(r===1){ts(t,0),Ar(t,e,0,!0);break}e:{switch(n=t,o=r,o){case 0:case 1:throw Error(R(345));case 4:if((e&4194048)!==e)break;case 6:Ar(n,e,la,!Ir);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(R(329))}if((e&62914560)===e&&(r=Vd+300-ua(),10<r)){if(Ar(n,e,la,!Ir),Dd(n,0,!0)!==0)break e;Fn=e,n.timeoutHandle=Rw(ES.bind(null,n,a,Wt,Cd,Tm,e,la,Eo,Ji,Ir,o,"Throttled",-0,0),r);break e}ES(n,a,Wt,Cd,Tm,e,la,Eo,Ji,Ir,o,null,-0,0)}}break}while(!0);pn(t)}function ES(t,e,a,n,r,o,i,s,l,u,c,d,f,m){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:Dn},rw(e,o,d);var S=(o&62914560)===o?Vd-ua():(o&4194048)===o?lw-ua():0;if(S=f2(d,S),S!==null){Fn=o,t.cancelPendingCommit=S(RS.bind(null,t,e,o,a,n,r,i,s,l,c,d,null,f,m)),Ar(t,o,i,!u);return}}RS(t,e,o,a,n,r,i,s,l)}function TM(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 n=0;n<a.length;n++){var r=a[n],o=r.getSnapshot;r=r.value;try{if(!pa(o(),r))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 Ar(t,e,a,n){e&=~Rg,e&=~Eo,t.suspendedLanes|=e,t.pingedLanes&=~e,n&&(t.warmLanes|=e),n=t.expirationTimes;for(var r=e;0<r;){var o=31-da(r),i=1<<o;n[o]=-1,r&=~i}a!==0&&mC(t,a,e)}function jd(){return(ye&6)===0?(Wl(0,!1),!1):!0}function Mg(){if(ce!==null){if(Se===0)var t=ce.return;else t=ce,On=Ho=null,vg(t),Vi=null,Rl=0,t=ce;for(;t!==null;)V_(t.alternate,t),t=t.return;ce=null}}function ts(t,e){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,WM(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Fn=0,Mg(),Ee=t,ce=a=Bn(t.current,null),pe=e,Se=0,oa=null,Ir=!1,ls=zl(t,e),Tg=!1,Ji=la=Rg=Eo=qr=Ke=0,Wt=Cl=null,Tm=!1,(e&8)!==0&&(e|=e&32);var n=t.entangledLanes;if(n!==0)for(t=t.entanglements,n&=e;0<n;){var r=31-da(n),o=1<<r;e|=t[r],n&=~o}return qn=e,Fd(),a}function fw(t,e){ie=null,ee.H=Dl,e===ss||e===Hd?(e=sS(),Se=3):e===cg?(e=sS(),Se=4):Se=e===kg?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,oa=e,ce===null&&(Ke=1,yd(t,Ia(e,t.current)))}function pw(){var t=ha.current;return t===null?!0:(pe&4194048)===pe?Ea===null:(pe&62914560)===pe||(pe&536870912)!==0?t===Ea:!1}function hw(){var t=ee.H;return ee.H=Dl,t===null?Dl:t}function mw(){var t=ee.A;return ee.A=AM,t}function _d(){Ke=4,Ir||(pe&4194048)!==pe&&ha.current!==null||(ls=!0),(qr&134217727)===0&&(Eo&134217727)===0||Ee===null||Ar(Ee,pe,la,!1)}function $h(t,e,a){var n=ye;ye|=2;var r=hw(),o=mw();(Ee!==t||pe!==e)&&(Cd=null,ts(t,e)),e=!1;var i=Ke;e:do try{if(Se!==0&&ce!==null){var s=ce,l=oa;switch(Se){case 8:Mg(),i=6;break e;case 3:case 2:case 9:case 6:ha.current===null&&(e=!0);var u=Se;if(Se=0,oa=null,Hi(t,s,l,u),a&&ls){i=0;break e}break;default:u=Se,Se=0,oa=null,Hi(t,s,l,u)}}RM(),i=Ke;break}catch(c){fw(t,c)}while(!0);return e&&t.shellSuspendCounter++,On=Ho=null,ye=n,ee.H=r,ee.A=o,ce===null&&(Ee=null,pe=0,Fd()),i}function RM(){for(;ce!==null;)gw(ce)}function MM(t,e){var a=ye;ye|=2;var n=hw(),r=mw();Ee!==t||pe!==e?(Cd=null,Sd=ua()+500,ts(t,e)):ls=zl(t,e);e:do try{if(Se!==0&&ce!==null){e=ce;var o=oa;t:switch(Se){case 1:Se=0,oa=null,Hi(t,e,o,1);break;case 2:case 9:if(iS(o)){Se=0,oa=null,TS(e);break}e=function(){Se!==2&&Se!==9||Ee!==t||(Se=7),pn(t)},o.then(e,e);break e;case 3:Se=7;break e;case 4:Se=5;break e;case 7:iS(o)?(Se=0,oa=null,TS(e)):(Se=0,oa=null,Hi(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?Pw(i):s.stateNode.complete){Se=0,oa=null;var l=s.sibling;if(l!==null)ce=l;else{var u=s.return;u!==null?(ce=u,Gd(u)):ce=null}break t}}Se=0,oa=null,Hi(t,e,o,5);break;case 6:Se=0,oa=null,Hi(t,e,o,6);break;case 8:Mg(),Ke=6;break e;default:throw Error(R(462))}}DM();break}catch(c){fw(t,c)}while(!0);return On=Ho=null,ee.H=n,ee.A=r,ye=a,ce!==null?0:(Ee=null,pe=0,Fd(),Ke)}function DM(){for(;ce!==null&&!aR();)gw(ce)}function gw(t){var e=$_(t.alternate,t,qn);t.memoizedProps=t.pendingProps,e===null?Gd(t):ce=e}function TS(t){var e=t,a=e.alternate;switch(e.tag){case 15:case 0:e=_S(a,e,e.pendingProps,e.type,void 0,pe);break;case 11:e=_S(a,e,e.pendingProps,e.type.render,e.ref,pe);break;case 5:vg(e);default:V_(a,e),e=ce=VC(e,qn),e=$_(a,e,qn)}t.memoizedProps=t.pendingProps,e===null?Gd(t):ce=e}function Hi(t,e,a,n){On=Ho=null,vg(e),Vi=null,Rl=0;var r=e.return;try{if(SM(t,r,e,a,pe)){Ke=1,yd(t,Ia(a,t.current)),ce=null;return}}catch(o){if(r!==null)throw ce=r,o;Ke=1,yd(t,Ia(a,t.current)),ce=null;return}e.flags&32768?(he||n===1?t=!0:ls||(pe&536870912)!==0?t=!1:(Ir=t=!0,(n===2||n===9||n===3||n===6)&&(n=ha.current,n!==null&&n.tag===13&&(n.flags|=16384))),vw(e,t)):Gd(e)}function Gd(t){var e=t;do{if((e.flags&32768)!==0){vw(e,Ir);return}t=e.return;var a=wM(e.alternate,e,qn);if(a!==null){ce=a;return}if(e=e.sibling,e!==null){ce=e;return}ce=e=t}while(e!==null);Ke===0&&(Ke=5)}function vw(t,e){do{var a=LM(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);Ke=6,ce=null}function RS(t,e,a,n,r,o,i,s,l){t.cancelPendingCommit=null;do Zd();while(st!==0);if((ye&6)!==0)throw Error(R(327));if(e!==null){if(e===t.current)throw Error(R(177));if(o=e.lanes|e.childLanes,o|=ng,fR(t,a,o,i,s,l),t===Ee&&(ce=Ee=null,pe=0),es=e,Br=t,Fn=a,Rm=o,Mm=r,uw=n,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,FM(sd,function(){return Cw(),null})):(t.callbackNode=null,t.callbackPriority=0),n=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||n){n=ee.T,ee.T=null,r=xe.p,xe.p=2,i=ye,ye|=4;try{kM(t,e,a)}finally{ye=i,xe.p=r,ee.T=n}}st=1,yw(),xw(),bw()}}function yw(){if(st===1){st=0;var t=Br,e=es,a=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||a){a=ee.T,ee.T=null;var n=xe.p;xe.p=2;var r=ye;ye|=4;try{tw(e,t);var o=Fm,i=PC(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(i!==s&&s&&s.ownerDocument&&BC(s.ownerDocument.documentElement,s)){if(l!==null&&ag(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,f=d&&d.defaultView||window;if(f.getSelection){var m=f.getSelection(),S=s.textContent.length,b=Math.min(l.start,S),x=l.end===void 0?b:Math.min(l.end,S);!m.extend&&b>x&&(i=x,x=b,b=i);var p=J0(s,b),g=J0(s,x);if(p&&g&&(m.rangeCount!==1||m.anchorNode!==p.node||m.anchorOffset!==p.offset||m.focusNode!==g.node||m.focusOffset!==g.offset)){var v=d.createRange();v.setStart(p.node,p.offset),m.removeAllRanges(),b>x?(m.addRange(v),m.extend(g.node,g.offset)):(v.setEnd(g.node,g.offset),m.addRange(v))}}}}for(d=[],m=s;m=m.parentNode;)m.nodeType===1&&d.push({element:m,left:m.scrollLeft,top:m.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}}Rd=!!Pm,Fm=Pm=null}finally{ye=r,xe.p=n,ee.T=a}}t.current=e,st=2}}function xw(){if(st===2){st=0;var t=Br,e=es,a=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||a){a=ee.T,ee.T=null;var n=xe.p;xe.p=2;var r=ye;ye|=4;try{Y_(t,e.alternate,e)}finally{ye=r,xe.p=n,ee.T=a}}st=3}}function bw(){if(st===4||st===3){st=0,nR();var t=Br,e=es,a=Fn,n=uw;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?st=5:(st=0,es=Br=null,Sw(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Or=null),Xm(a),e=e.stateNode,ca&&typeof ca.onCommitFiberRoot=="function")try{ca.onCommitFiberRoot(Ul,e,void 0,(e.current.flags&128)===128)}catch{}if(n!==null){e=ee.T,r=xe.p,xe.p=2,ee.T=null;try{for(var o=t.onRecoverableError,i=0;i<n.length;i++){var s=n[i];o(s.value,{componentStack:s.stack})}}finally{ee.T=e,xe.p=r}}(Fn&3)!==0&&Zd(),pn(t),r=t.pendingLanes,(a&261930)!==0&&(r&42)!==0?t===Dm?_l++:(_l=0,Dm=t):_l=0,Wl(0,!1)}}function Sw(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,jl(e)))}function Zd(){return yw(),xw(),bw(),Cw()}function Cw(){if(st!==5)return!1;var t=Br,e=Rm;Rm=0;var a=Xm(Fn),n=ee.T,r=xe.p;try{xe.p=32>a?32:a,ee.T=null,a=Mm,Mm=null;var o=Br,i=Fn;if(st=0,es=Br=null,Fn=0,(ye&6)!==0)throw Error(R(331));var s=ye;if(ye|=4,iw(o.current),nw(o,o.current,i,a),ye=s,Wl(0,!1),ca&&typeof ca.onPostCommitFiberRoot=="function")try{ca.onPostCommitFiberRoot(Ul,o)}catch{}return!0}finally{xe.p=r,ee.T=n,Sw(t,e)}}function MS(t,e,a){e=Ia(a,e),e=km(t.stateNode,e,2),t=Dr(t,e,2),t!==null&&(ql(t,2),pn(t))}function Ce(t,e,a){if(t.tag===3)MS(t,t,a);else for(;e!==null;){if(e.tag===3){MS(e,t,a);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Or===null||!Or.has(n))){t=Ia(a,t),a=F_(2),n=Dr(e,a,2),n!==null&&(N_(a,n,e,t),ql(n,2),pn(n));break}}e=e.return}}function Vh(t,e,a){var n=t.pingCache;if(n===null){n=t.pingCache=new EM;var r=new Set;n.set(e,r)}else r=n.get(e),r===void 0&&(r=new Set,n.set(e,r));r.has(a)||(Tg=!0,r.add(a),t=OM.bind(null,t,e,a),e.then(t,t))}function OM(t,e,a){var n=t.pingCache;n!==null&&n.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Ee===t&&(pe&a)===a&&(Ke===4||Ke===3&&(pe&62914560)===pe&&300>ua()-Vd?(ye&2)===0&&ts(t,0):Rg|=a,Ji===pe&&(Ji=0)),pn(t)}function _w(t,e){e===0&&(e=hC()),t=No(t,e),t!==null&&(ql(t,e),pn(t))}function BM(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),_w(t,a)}function PM(t,e){var a=0;switch(t.tag){case 31:case 13:var n=t.stateNode,r=t.memoizedState;r!==null&&(a=r.retryLane);break;case 19:n=t.stateNode;break;case 22:n=t.stateNode._retryCache;break;default:throw Error(R(314))}n!==null&&n.delete(e),_w(t,a)}function FM(t,e){return Zm(t,e)}var wd=null,Ii=null,Om=!1,Ld=!1,jh=!1,Er=0;function pn(t){t!==Ii&&t.next===null&&(Ii===null?wd=Ii=t:Ii=Ii.next=t),Ld=!0,Om||(Om=!0,HM())}function Wl(t,e){if(!jh&&Ld){jh=!0;do for(var a=!1,n=wd;n!==null;){if(!e)if(t!==0){var r=n.pendingLanes;if(r===0)var o=0;else{var i=n.suspendedLanes,s=n.pingedLanes;o=(1<<31-da(42|t)+1)-1,o&=r&~(i&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,DS(n,o))}else o=pe,o=Dd(n,n===Ee?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||zl(n,o)||(a=!0,DS(n,o));n=n.next}while(a);jh=!1}}function NM(){ww()}function ww(){Ld=Om=!1;var t=0;Er!==0&&ZM()&&(t=Er);for(var e=ua(),a=null,n=wd;n!==null;){var r=n.next,o=Lw(n,e);o===0?(n.next=null,a===null?wd=r:a.next=r,r===null&&(Ii=a)):(a=n,(t!==0||(o&3)!==0)&&(Ld=!0)),n=r}st!==0&&st!==5||Wl(t,!1),Er!==0&&(Er=0)}function Lw(t,e){for(var a=t.suspendedLanes,n=t.pingedLanes,r=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var i=31-da(o),s=1<<i,l=r[i];l===-1?((s&a)===0||(s&n)!==0)&&(r[i]=dR(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Ee,a=pe,a=Dd(t,t===e?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),n=t.callbackNode,a===0||t===e&&(Se===2||Se===9)||t.cancelPendingCommit!==null)return n!==null&&n!==null&&bh(n),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||zl(t,a)){if(e=a&-a,e===t.callbackPriority)return e;switch(n!==null&&bh(n),Xm(a)){case 2:case 8:a=fC;break;case 32:a=sd;break;case 268435456:a=pC;break;default:a=sd}return n=kw.bind(null,t),a=Zm(a,n),t.callbackPriority=e,t.callbackNode=a,e}return n!==null&&n!==null&&bh(n),t.callbackPriority=2,t.callbackNode=null,2}function kw(t,e){if(st!==0&&st!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Zd()&&t.callbackNode!==a)return null;var n=pe;return n=Dd(t,t===Ee?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),n===0?null:(dw(t,n,e),Lw(t,ua()),t.callbackNode!=null&&t.callbackNode===a?kw.bind(null,t):null)}function DS(t,e){if(Zd())return null;dw(t,e,!0)}function HM(){XM(function(){(ye&6)!==0?Zm(dC,NM):ww()})}function Dg(){if(Er===0){var t=Yi;t===0&&(t=kc,kc<<=1,(kc&261888)===0&&(kc=256)),Er=t}return Er}function OS(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Vc(""+t)}function BS(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 UM(t,e,a,n,r){if(e==="submit"&&a&&a.stateNode===r){var o=OS((r[Yt]||null).action),i=n.submitter;i&&(e=(e=i[Yt]||null)?OS(e.formAction):i.getAttribute("formAction"),e!==null&&(o=e,i=null));var s=new Od("action","action",null,n,r);t.push({event:s,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Er!==0){var l=i?BS(r,i):new FormData(r);wm(a,{pending:!0,data:l,method:r.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=i?BS(r,i):new FormData(r),wm(a,{pending:!0,data:l,method:r.method,action:o},o,l))},currentTarget:r}]})}}for(Nc=0;Nc<fm.length;Nc++)Hc=fm[Nc],PS=Hc.toLowerCase(),FS=Hc[0].toUpperCase()+Hc.slice(1),ja(PS,"on"+FS);var Hc,PS,FS,Nc;ja(NC,"onAnimationEnd");ja(HC,"onAnimationIteration");ja(UC,"onAnimationStart");ja("dblclick","onDoubleClick");ja("focusin","onFocus");ja("focusout","onBlur");ja(rM,"onTransitionRun");ja(oM,"onTransitionStart");ja(iM,"onTransitionCancel");ja(zC,"onTransitionEnd");Wi("onMouseEnter",["mouseout","mouseover"]);Wi("onMouseLeave",["mouseout","mouseover"]);Wi("onPointerEnter",["pointerout","pointerover"]);Wi("onPointerLeave",["pointerout","pointerover"]);Bo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ol="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(" "),zM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ol));function Iw(t,e){e=(e&4)!==0;for(var a=0;a<t.length;a++){var n=t[a],r=n.event;n=n.listeners;e:{var o=void 0;if(e)for(var i=n.length-1;0<=i;i--){var s=n[i],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=u;try{o(r)}catch(c){ud(c)}r.currentTarget=null,o=l}else for(i=0;i<n.length;i++){if(s=n[i],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=u;try{o(r)}catch(c){ud(c)}r.currentTarget=null,o=l}}}}function ue(t,e){var a=e[rm];a===void 0&&(a=e[rm]=new Set);var n=t+"__bubble";a.has(n)||(Aw(e,t,2,!1),a.add(n))}function Gh(t,e,a){var n=0;e&&(n|=4),Aw(a,t,n,e)}var Uc="_reactListening"+Math.random().toString(36).slice(2);function Og(t){if(!t[Uc]){t[Uc]=!0,xC.forEach(function(a){a!=="selectionchange"&&(zM.has(a)||Gh(a,!1,t),Gh(a,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Uc]||(e[Uc]=!0,Gh("selectionchange",!1,e))}}function Aw(t,e,a,n){switch(zw(e)){case 2:var r=m2;break;case 8:r=g2;break;default:r=Ng}a=r.bind(null,e,a,t),r=void 0,!um||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),n?r!==void 0?t.addEventListener(e,a,{capture:!0,passive:r}):t.addEventListener(e,a,!0):r!==void 0?t.addEventListener(e,a,{passive:r}):t.addEventListener(e,a,!1)}function Zh(t,e,a,n,r){var o=n;if((e&1)===0&&(e&2)===0&&n!==null)e:for(;;){if(n===null)return;var i=n.tag;if(i===3||i===4){var s=n.stateNode.containerInfo;if(s===r)break;if(i===4)for(i=n.return;i!==null;){var l=i.tag;if((l===3||l===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;s!==null;){if(i=Ti(s),i===null)return;if(l=i.tag,l===5||l===6||l===26||l===27){n=o=i;continue e}s=s.parentNode}}n=n.return}IC(function(){var u=o,c=Qm(a),d=[];e:{var f=qC.get(t);if(f!==void 0){var m=Od,S=t;switch(t){case"keypress":if(Gc(a)===0)break e;case"keydown":case"keyup":m=PR;break;case"focusin":S="focus",m=Lh;break;case"focusout":S="blur",m=Lh;break;case"beforeblur":case"afterblur":m=Lh;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":m=V0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=wR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=HR;break;case NC:case HC:case UC:m=IR;break;case zC:m=zR;break;case"scroll":case"scrollend":m=CR;break;case"wheel":m=$R;break;case"copy":case"cut":case"paste":m=ER;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=G0;break;case"toggle":case"beforetoggle":m=jR}var b=(e&4)!==0,x=!b&&(t==="scroll"||t==="scrollend"),p=b?f!==null?f+"Capture":null:f;b=[];for(var g=u,v;g!==null;){var y=g;if(v=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||v===null||p===null||(y=kl(g,p),y!=null&&b.push(Bl(g,y,v))),x)break;g=g.return}0<b.length&&(f=new m(f,S,null,a,c),d.push({event:f,listeners:b}))}}if((e&7)===0){e:{if(f=t==="mouseover"||t==="pointerover",m=t==="mouseout"||t==="pointerout",f&&a!==lm&&(S=a.relatedTarget||a.fromElement)&&(Ti(S)||S[rs]))break e;if((m||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,m?(S=a.relatedTarget||a.toElement,m=u,S=S?Ti(S):null,S!==null&&(x=Hl(S),b=S.tag,S!==x||b!==5&&b!==27&&b!==6)&&(S=null)):(m=null,S=u),m!==S)){if(b=V0,y="onMouseLeave",p="onMouseEnter",g="mouse",(t==="pointerout"||t==="pointerover")&&(b=G0,y="onPointerLeave",p="onPointerEnter",g="pointer"),x=m==null?f:ul(m),v=S==null?f:ul(S),f=new b(y,g+"leave",m,a,c),f.target=x,f.relatedTarget=v,y=null,Ti(c)===u&&(b=new b(p,g+"enter",S,a,c),b.target=v,b.relatedTarget=x,y=b),x=y,m&&S)t:{for(b=qM,p=m,g=S,v=0,y=p;y;y=b(y))v++;y=0;for(var _=g;_;_=b(_))y++;for(;0<v-y;)p=b(p),v--;for(;0<y-v;)g=b(g),y--;for(;v--;){if(p===g||g!==null&&p===g.alternate){b=p;break t}p=b(p),g=b(g)}b=null}else b=null;m!==null&&NS(d,f,m,b,!1),S!==null&&x!==null&&NS(d,x,S,b,!0)}}e:{if(f=u?ul(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var L=Y0;else if(X0(f))if(DC)L=tM;else{L=JR;var C=QR}else m=f.nodeName,!m||m.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Km(u.elementType)&&(L=Y0):L=eM;if(L&&(L=L(t,u))){MC(d,L,a,c);break e}C&&C(t,f,u),t==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&sm(f,"number",f.value)}switch(C=u?ul(u):window,t){case"focusin":(X0(C)||C.contentEditable==="true")&&(Di=C,cm=u,hl=null);break;case"focusout":hl=cm=Di=null;break;case"mousedown":dm=!0;break;case"contextmenu":case"mouseup":case"dragend":dm=!1,eS(d,a,c);break;case"selectionchange":if(nM)break;case"keydown":case"keyup":eS(d,a,c)}var A;if(tg)e:{switch(t){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else Mi?TC(t,a)&&(w="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(w="onCompositionStart");w&&(EC&&a.locale!=="ko"&&(Mi||w!=="onCompositionStart"?w==="onCompositionEnd"&&Mi&&(A=AC()):(kr=c,Jm="value"in kr?kr.value:kr.textContent,Mi=!0)),C=kd(u,w),0<C.length&&(w=new j0(w,t,null,a,c),d.push({event:w,listeners:C}),A?w.data=A:(A=RC(a),A!==null&&(w.data=A)))),(A=ZR?WR(t,a):XR(t,a))&&(w=kd(u,"onBeforeInput"),0<w.length&&(C=new j0("onBeforeInput","beforeinput",null,a,c),d.push({event:C,listeners:w}),C.data=A)),UM(d,t,u,a,c)}Iw(d,e)})}function Bl(t,e,a){return{instance:t,listener:e,currentTarget:a}}function kd(t,e){for(var a=e+"Capture",n=[];t!==null;){var r=t,o=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=kl(t,a),r!=null&&n.unshift(Bl(t,r,o)),r=kl(t,e),r!=null&&n.push(Bl(t,r,o))),t.tag===3)return n;t=t.return}return[]}function qM(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function NS(t,e,a,n,r){for(var o=e._reactName,i=[];a!==null&&a!==n;){var s=a,l=s.alternate,u=s.stateNode;if(s=s.tag,l!==null&&l===n)break;s!==5&&s!==26&&s!==27||u===null||(l=u,r?(u=kl(a,o),u!=null&&i.unshift(Bl(a,u,l))):r||(u=kl(a,o),u!=null&&i.push(Bl(a,u,l)))),a=a.return}i.length!==0&&t.push({event:e,listeners:i})}var $M=/\r\n?/g,VM=/\u0000|\uFFFD/g;function HS(t){return(typeof t=="string"?t:""+t).replace($M,`
|
|
9
|
-
`).replace(VM,"")}function Ew(t,e){return e=HS(e),HS(t)===e}function Le(t,e,a,n,r,o){switch(a){case"children":typeof n=="string"?e==="body"||e==="textarea"&&n===""||Xi(t,n):(typeof n=="number"||typeof n=="bigint")&&e!=="body"&&Xi(t,""+n);break;case"className":Ec(t,"class",n);break;case"tabIndex":Ec(t,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Ec(t,a,n);break;case"style":kC(t,n,o);break;case"data":if(e!=="object"){Ec(t,"data",n);break}case"src":case"href":if(n===""&&(e!=="a"||a!=="href")){t.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){t.removeAttribute(a);break}n=Vc(""+n),t.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="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"&&Le(t,e,"name",r.name,r,null),Le(t,e,"formEncType",r.formEncType,r,null),Le(t,e,"formMethod",r.formMethod,r,null),Le(t,e,"formTarget",r.formTarget,r,null)):(Le(t,e,"encType",r.encType,r,null),Le(t,e,"method",r.method,r,null),Le(t,e,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){t.removeAttribute(a);break}n=Vc(""+n),t.setAttribute(a,n);break;case"onClick":n!=null&&(t.onclick=Dn);break;case"onScroll":n!=null&&ue("scroll",t);break;case"onScrollEnd":n!=null&&ue("scrollend",t);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(R(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(R(60));t.innerHTML=a}}break;case"multiple":t.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":t.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){t.removeAttribute("xlink:href");break}a=Vc(""+n),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":n!=null&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(a,""+n):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":n&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":n===!0?t.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(a,n):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?t.setAttribute(a,n):t.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?t.removeAttribute(a):t.setAttribute(a,n);break;case"popover":ue("beforetoggle",t),ue("toggle",t),$c(t,"popover",n);break;case"xlinkActuate":Ln(t,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Ln(t,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Ln(t,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Ln(t,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Ln(t,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Ln(t,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":$c(t,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=bR.get(a)||a,$c(t,a,n))}}function Bm(t,e,a,n,r,o){switch(a){case"style":kC(t,n,o);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(R(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(R(60));t.innerHTML=a}}break;case"children":typeof n=="string"?Xi(t,n):(typeof n=="number"||typeof n=="bigint")&&Xi(t,""+n);break;case"onScroll":n!=null&&ue("scroll",t);break;case"onScrollEnd":n!=null&&ue("scrollend",t);break;case"onClick":n!=null&&(t.onclick=Dn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bC.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),e=a.slice(2,r?a.length-7:void 0),o=t[Yt]||null,o=o!=null?o[a]:null,typeof o=="function"&&t.removeEventListener(e,o,r),typeof n=="function")){typeof o!="function"&&o!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(e,n,r);break e}a in t?t[a]=n:n===!0?t.setAttribute(a,""):$c(t,a,n)}}}function _t(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 n=!1,r=!1,o;for(o in a)if(a.hasOwnProperty(o)){var i=a[o];if(i!=null)switch(o){case"src":n=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(R(137,e));default:Le(t,e,o,i,a,null)}}r&&Le(t,e,"srcSet",a.srcSet,a,null),n&&Le(t,e,"src",a.src,a,null);return;case"input":ue("invalid",t);var s=o=i=r=null,l=null,u=null;for(n in a)if(a.hasOwnProperty(n)){var c=a[n];if(c!=null)switch(n){case"name":r=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(R(137,e));break;default:Le(t,e,n,c,a,null)}}_C(t,o,s,l,u,i,r,!1);return;case"select":ue("invalid",t),n=i=o=null;for(r in a)if(a.hasOwnProperty(r)&&(s=a[r],s!=null))switch(r){case"value":o=s;break;case"defaultValue":i=s;break;case"multiple":n=s;default:Le(t,e,r,s,a,null)}e=o,a=i,t.multiple=!!n,e!=null?zi(t,!!n,e,!1):a!=null&&zi(t,!!n,a,!0);return;case"textarea":ue("invalid",t),o=r=n=null;for(i in a)if(a.hasOwnProperty(i)&&(s=a[i],s!=null))switch(i){case"value":n=s;break;case"defaultValue":r=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(R(91));break;default:Le(t,e,i,s,a,null)}LC(t,n,r,o);return;case"option":for(l in a)a.hasOwnProperty(l)&&(n=a[l],n!=null)&&(l==="selected"?t.selected=n&&typeof n!="function"&&typeof n!="symbol":Le(t,e,l,n,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(n=0;n<Ol.length;n++)ue(Ol[n],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)&&(n=a[u],n!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(R(137,e));default:Le(t,e,u,n,a,null)}return;default:if(Km(e)){for(c in a)a.hasOwnProperty(c)&&(n=a[c],n!==void 0&&Bm(t,e,c,n,a,void 0));return}}for(s in a)a.hasOwnProperty(s)&&(n=a[s],n!=null&&Le(t,e,s,n,a,null))}function jM(t,e,a,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,i=null,s=null,l=null,u=null,c=null;for(m in a){var d=a[m];if(a.hasOwnProperty(m)&&d!=null)switch(m){case"checked":break;case"value":break;case"defaultValue":l=d;default:n.hasOwnProperty(m)||Le(t,e,m,null,n,d)}}for(var f in n){var m=n[f];if(d=a[f],n.hasOwnProperty(f)&&(m!=null||d!=null))switch(f){case"type":o=m;break;case"name":r=m;break;case"checked":u=m;break;case"defaultChecked":c=m;break;case"value":i=m;break;case"defaultValue":s=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(R(137,e));break;default:m!==d&&Le(t,e,f,m,n,d)}}im(t,i,s,l,u,c,o,r);return;case"select":m=i=s=f=null;for(o in a)if(l=a[o],a.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":m=l;default:n.hasOwnProperty(o)||Le(t,e,o,null,n,l)}for(r in n)if(o=n[r],l=a[r],n.hasOwnProperty(r)&&(o!=null||l!=null))switch(r){case"value":f=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:o!==l&&Le(t,e,r,o,n,l)}e=s,a=i,n=m,f!=null?zi(t,!!a,f,!1):!!n!=!!a&&(e!=null?zi(t,!!a,e,!0):zi(t,!!a,a?[]:"",!1));return;case"textarea":m=f=null;for(s in a)if(r=a[s],a.hasOwnProperty(s)&&r!=null&&!n.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:Le(t,e,s,null,n,r)}for(i in n)if(r=n[i],o=a[i],n.hasOwnProperty(i)&&(r!=null||o!=null))switch(i){case"value":f=r;break;case"defaultValue":m=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(R(91));break;default:r!==o&&Le(t,e,i,r,n,o)}wC(t,f,m);return;case"option":for(var S in a)f=a[S],a.hasOwnProperty(S)&&f!=null&&!n.hasOwnProperty(S)&&(S==="selected"?t.selected=!1:Le(t,e,S,null,n,f));for(l in n)f=n[l],m=a[l],n.hasOwnProperty(l)&&f!==m&&(f!=null||m!=null)&&(l==="selected"?t.selected=f&&typeof f!="function"&&typeof f!="symbol":Le(t,e,l,f,n,m));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)f=a[b],a.hasOwnProperty(b)&&f!=null&&!n.hasOwnProperty(b)&&Le(t,e,b,null,n,f);for(u in n)if(f=n[u],m=a[u],n.hasOwnProperty(u)&&f!==m&&(f!=null||m!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(R(137,e));break;default:Le(t,e,u,f,n,m)}return;default:if(Km(e)){for(var x in a)f=a[x],a.hasOwnProperty(x)&&f!==void 0&&!n.hasOwnProperty(x)&&Bm(t,e,x,void 0,n,f);for(c in n)f=n[c],m=a[c],!n.hasOwnProperty(c)||f===m||f===void 0&&m===void 0||Bm(t,e,c,f,n,m);return}}for(var p in a)f=a[p],a.hasOwnProperty(p)&&f!=null&&!n.hasOwnProperty(p)&&Le(t,e,p,null,n,f);for(d in n)f=n[d],m=a[d],!n.hasOwnProperty(d)||f===m||f==null&&m==null||Le(t,e,d,f,n,m)}function US(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function GM(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var r=a[n],o=r.transferSize,i=r.initiatorType,s=r.duration;if(o&&s&&US(i)){for(i=0,s=r.responseEnd,n+=1;n<a.length;n++){var l=a[n],u=l.startTime;if(u>s)break;var c=l.transferSize,d=l.initiatorType;c&&US(d)&&(l=l.responseEnd,i+=c*(l<s?1:(s-u)/(l-u)))}if(--n,e+=8*(o+i)/(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 Pm=null,Fm=null;function Id(t){return t.nodeType===9?t:t.ownerDocument}function zS(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 Tw(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 Nm(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 Wh=null;function ZM(){var t=window.event;return t&&t.type==="popstate"?t===Wh?!1:(Wh=t,!0):(Wh=null,!1)}var Rw=typeof setTimeout=="function"?setTimeout:void 0,WM=typeof clearTimeout=="function"?clearTimeout:void 0,qS=typeof Promise=="function"?Promise:void 0,XM=typeof queueMicrotask=="function"?queueMicrotask:typeof qS<"u"?function(t){return qS.resolve(null).then(t).catch(YM)}:Rw;function YM(t){setTimeout(function(){throw t})}function Vr(t){return t==="head"}function $S(t,e){var a=e,n=0;do{var r=a.nextSibling;if(t.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"||a==="/&"){if(n===0){t.removeChild(r),ns(e);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")wl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,wl(a);for(var o=a.firstChild;o;){var i=o.nextSibling,s=o.nodeName;o[$l]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&wl(t.ownerDocument.body);a=r}while(a);ns(e)}function VS(t,e){var a=t;t=0;do{var n=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||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=n}while(a)}function Hm(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":Hm(a),Ym(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function KM(t,e,a,n){for(;t.nodeType===1;){var r=a;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!n&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(n){if(!t[$l])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!==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(o=t.getAttribute("src"),(o!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===o)return t}else return t;if(t=Ta(t.nextSibling),t===null)break}return null}function QM(t,e,a){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Ta(t.nextSibling),t===null))return null;return t}function Mw(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=Ta(t.nextSibling),t===null))return null;return t}function Um(t){return t.data==="$?"||t.data==="$~"}function zm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function JM(t,e){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||a.readyState!=="loading")e();else{var n=function(){e(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),t._reactRetry=n}}function Ta(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 qm=null;function jS(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(e===0)return Ta(t.nextSibling);e--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||e++}t=t.nextSibling}return null}function GS(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 Dw(t,e,a){switch(e=Id(a),t){case"html":if(t=e.documentElement,!t)throw Error(R(452));return t;case"head":if(t=e.head,!t)throw Error(R(453));return t;case"body":if(t=e.body,!t)throw Error(R(454));return t;default:throw Error(R(451))}}function wl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Ym(t)}var Ra=new Map,ZS=new Set;function Ad(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var $n=xe.d;xe.d={f:e2,r:t2,D:a2,C:n2,L:r2,m:o2,X:s2,S:i2,M:l2};function e2(){var t=$n.f(),e=jd();return t||e}function t2(t){var e=os(t);e!==null&&e.tag===5&&e.type==="form"?k_(e):$n.r(t)}var us=typeof document>"u"?null:document;function Ow(t,e,a){var n=us;if(n&&typeof e=="string"&&e){var r=ka(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),ZS.has(r)||(ZS.add(r),t={rel:t,crossOrigin:a,href:e},n.querySelector(r)===null&&(e=n.createElement("link"),_t(e,"link",t),mt(e),n.head.appendChild(e)))}}function a2(t){$n.D(t),Ow("dns-prefetch",t,null)}function n2(t,e){$n.C(t,e),Ow("preconnect",t,e)}function r2(t,e,a){$n.L(t,e,a);var n=us;if(n&&t&&e){var r='link[rel="preload"][as="'+ka(e)+'"]';e==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+ka(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+ka(a.imageSizes)+'"]')):r+='[href="'+ka(t)+'"]';var o=r;switch(e){case"style":o=as(t);break;case"script":o=cs(t)}Ra.has(o)||(t=Ue({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),Ra.set(o,t),n.querySelector(r)!==null||e==="style"&&n.querySelector(Xl(o))||e==="script"&&n.querySelector(Yl(o))||(e=n.createElement("link"),_t(e,"link",t),mt(e),n.head.appendChild(e)))}}function o2(t,e){$n.m(t,e);var a=us;if(a&&t){var n=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+ka(n)+'"][href="'+ka(t)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=cs(t)}if(!Ra.has(o)&&(t=Ue({rel:"modulepreload",href:t},e),Ra.set(o,t),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Yl(o)))return}n=a.createElement("link"),_t(n,"link",t),mt(n),a.head.appendChild(n)}}}function i2(t,e,a){$n.S(t,e,a);var n=us;if(n&&t){var r=Ui(n).hoistableStyles,o=as(t);e=e||"default";var i=r.get(o);if(!i){var s={loading:0,preload:null};if(i=n.querySelector(Xl(o)))s.loading=5;else{t=Ue({rel:"stylesheet",href:t,"data-precedence":e},a),(a=Ra.get(o))&&Bg(t,a);var l=i=n.createElement("link");mt(l),_t(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,ed(i,e,n)}i={type:"stylesheet",instance:i,count:1,state:s},r.set(o,i)}}}function s2(t,e){$n.X(t,e);var a=us;if(a&&t){var n=Ui(a).hoistableScripts,r=cs(t),o=n.get(r);o||(o=a.querySelector(Yl(r)),o||(t=Ue({src:t,async:!0},e),(e=Ra.get(r))&&Pg(t,e),o=a.createElement("script"),mt(o),_t(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function l2(t,e){$n.M(t,e);var a=us;if(a&&t){var n=Ui(a).hoistableScripts,r=cs(t),o=n.get(r);o||(o=a.querySelector(Yl(r)),o||(t=Ue({src:t,async:!0,type:"module"},e),(e=Ra.get(r))&&Pg(t,e),o=a.createElement("script"),mt(o),_t(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function WS(t,e,a,n){var r=(r=Tr.current)?Ad(r):null;if(!r)throw Error(R(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=as(a.href),a=Ui(r).hoistableStyles,n=a.get(e),n||(n={type:"style",instance:null,count:0,state:null},a.set(e,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=as(a.href);var o=Ui(r).hoistableStyles,i=o.get(t);if(i||(r=r.ownerDocument||r,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(t,i),(o=r.querySelector(Xl(t)))&&!o._p&&(i.instance=o,i.state.loading=5),Ra.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},Ra.set(t,a),o||u2(r,t,a,i.state))),e&&n===null)throw Error(R(528,""));return i}if(e&&n!==null)throw Error(R(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=cs(a),a=Ui(r).hoistableScripts,n=a.get(e),n||(n={type:"script",instance:null,count:0,state:null},a.set(e,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(R(444,t))}}function as(t){return'href="'+ka(t)+'"'}function Xl(t){return'link[rel="stylesheet"]['+t+"]"}function Bw(t){return Ue({},t,{"data-precedence":t.precedence,precedence:null})}function u2(t,e,a,n){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?n.loading=1:(e=t.createElement("link"),n.preload=e,e.addEventListener("load",function(){return n.loading|=1}),e.addEventListener("error",function(){return n.loading|=2}),_t(e,"link",a),mt(e),t.head.appendChild(e))}function cs(t){return'[src="'+ka(t)+'"]'}function Yl(t){return"script[async]"+t}function XS(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+ka(a.href)+'"]');if(n)return e.instance=n,mt(n),n;var r=Ue({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(t.ownerDocument||t).createElement("style"),mt(n),_t(n,"style",r),ed(n,a.precedence,t),e.instance=n;case"stylesheet":r=as(a.href);var o=t.querySelector(Xl(r));if(o)return e.state.loading|=4,e.instance=o,mt(o),o;n=Bw(a),(r=Ra.get(r))&&Bg(n,r),o=(t.ownerDocument||t).createElement("link"),mt(o);var i=o;return i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),_t(o,"link",n),e.state.loading|=4,ed(o,a.precedence,t),e.instance=o;case"script":return o=cs(a.src),(r=t.querySelector(Yl(o)))?(e.instance=r,mt(r),r):(n=a,(r=Ra.get(o))&&(n=Ue({},a),Pg(n,r)),t=t.ownerDocument||t,r=t.createElement("script"),mt(r),_t(r,"link",n),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(R(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(n=e.instance,e.state.loading|=4,ed(n,a.precedence,t));return e.instance}function ed(t,e,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=n.length?n[n.length-1]:null,o=r,i=0;i<n.length;i++){var s=n[i];if(s.dataset.precedence===e)o=s;else if(o!==r)break}o?o.parentNode.insertBefore(t,o.nextSibling):(e=a.nodeType===9?a.head:a,e.insertBefore(t,e.firstChild))}function Bg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Pg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var td=null;function YS(t,e,a){if(td===null){var n=new Map,r=td=new Map;r.set(a,n)}else r=td,n=r.get(a),n||(n=new Map,r.set(a,n));if(n.has(t))return n;for(n.set(t,null),a=a.getElementsByTagName(t),r=0;r<a.length;r++){var o=a[r];if(!(o[$l]||o[bt]||t==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(e)||"";i=t+i;var s=n.get(i);s?s.push(o):n.set(i,[o])}}return n}function KS(t,e,a){t=t.ownerDocument||t,t.head.insertBefore(a,e==="title"?t.querySelector("head > title"):null)}function c2(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 Pw(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function d2(t,e,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var r=as(n.href),o=e.querySelector(Xl(r));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Ed.bind(t),e.then(t,t)),a.state.loading|=4,a.instance=o,mt(o);return}o=e.ownerDocument||e,n=Bw(n),(r=Ra.get(r))&&Bg(n,r),o=o.createElement("link"),mt(o);var i=o;i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),_t(o,"link",n),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=Ed.bind(t),e.addEventListener("load",a),e.addEventListener("error",a))}}var Xh=0;function f2(t,e){return t.stylesheets&&t.count===0&&ad(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var n=setTimeout(function(){if(t.stylesheets&&ad(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&Xh===0&&(Xh=62500*GM());var r=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&ad(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>Xh?50:800)+e);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function Ed(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Td=null;function ad(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Td=new Map,e.forEach(p2,t),Td=null,Ed.call(t))}function p2(t,e){if(!(e.state.loading&4)){var a=Td.get(t);if(a)var n=a.get(null);else{a=new Map,Td.set(t,a);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var i=r[o];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(a.set(i.dataset.precedence,i),n=i)}n&&a.set(null,n)}r=e.instance,i=r.getAttribute("data-precedence"),o=a.get(i)||n,o===n&&a.set(null,r),a.set(i,r),this.count++,n=Ed.bind(this),r.addEventListener("load",n),r.addEventListener("error",n),o?o.parentNode.insertBefore(r,o.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var Pl={$$typeof:Mn,Provider:null,Consumer:null,_currentValue:Lo,_currentValue2:Lo,_threadCount:0};function h2(t,e,a,n,r,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=Sh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sh(0),this.hiddenUpdates=Sh(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function Fw(t,e,a,n,r,o,i,s,l,u,c,d){return t=new h2(t,e,a,i,l,u,c,d,s),e=1,o===!0&&(e|=24),o=sa(3,null,null,e),t.current=o,o.stateNode=t,e=lg(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:e},dg(o),t}function Nw(t){return t?(t=Pi,t):Pi}function Hw(t,e,a,n,r,o){r=Nw(r),n.context===null?n.context=r:n.pendingContext=r,n=Mr(e),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=Dr(t,n,e),a!==null&&(Xt(a,t,e),gl(a,t,e))}function QS(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<e?a:e}}function Fg(t,e){QS(t,e),(t=t.alternate)&&QS(t,e)}function Uw(t){if(t.tag===13||t.tag===31){var e=No(t,67108864);e!==null&&Xt(e,t,67108864),Fg(t,67108864)}}function JS(t){if(t.tag===13||t.tag===31){var e=fa();e=Wm(e);var a=No(t,e);a!==null&&Xt(a,t,e),Fg(t,e)}}var Rd=!0;function m2(t,e,a,n){var r=ee.T;ee.T=null;var o=xe.p;try{xe.p=2,Ng(t,e,a,n)}finally{xe.p=o,ee.T=r}}function g2(t,e,a,n){var r=ee.T;ee.T=null;var o=xe.p;try{xe.p=8,Ng(t,e,a,n)}finally{xe.p=o,ee.T=r}}function Ng(t,e,a,n){if(Rd){var r=$m(n);if(r===null)Zh(t,e,n,Md,a),eC(t,n);else if(y2(r,t,e,a,n))n.stopPropagation();else if(eC(t,n),e&4&&-1<v2.indexOf(t)){for(;r!==null;){var o=os(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=Co(o.pendingLanes);if(i!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var l=1<<31-da(i);s.entanglements[1]|=l,i&=~l}pn(o),(ye&6)===0&&(Sd=ua()+500,Wl(0,!1))}}break;case 31:case 13:s=No(o,2),s!==null&&Xt(s,o,2),jd(),Fg(o,2)}if(o=$m(n),o===null&&Zh(t,e,n,Md,a),o===r)break;r=o}r!==null&&n.stopPropagation()}else Zh(t,e,n,null,a)}}function $m(t){return t=Qm(t),Hg(t)}var Md=null;function Hg(t){if(Md=null,t=Ti(t),t!==null){var e=Hl(t);if(e===null)t=null;else{var a=e.tag;if(a===13){if(t=iC(e),t!==null)return t;t=null}else if(a===31){if(t=sC(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 Md=t,null}function zw(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(rR()){case dC:return 2;case fC:return 8;case sd:case oR:return 32;case pC:return 268435456;default:return 32}default:return 32}}var Vm=!1,Pr=null,Fr=null,Nr=null,Fl=new Map,Nl=new Map,wr=[],v2="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 eC(t,e){switch(t){case"focusin":case"focusout":Pr=null;break;case"dragenter":case"dragleave":Fr=null;break;case"mouseover":case"mouseout":Nr=null;break;case"pointerover":case"pointerout":Fl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nl.delete(e.pointerId)}}function ol(t,e,a,n,r,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:a,eventSystemFlags:n,nativeEvent:o,targetContainers:[r]},e!==null&&(e=os(e),e!==null&&Uw(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function y2(t,e,a,n,r){switch(e){case"focusin":return Pr=ol(Pr,t,e,a,n,r),!0;case"dragenter":return Fr=ol(Fr,t,e,a,n,r),!0;case"mouseover":return Nr=ol(Nr,t,e,a,n,r),!0;case"pointerover":var o=r.pointerId;return Fl.set(o,ol(Fl.get(o)||null,t,e,a,n,r)),!0;case"gotpointercapture":return o=r.pointerId,Nl.set(o,ol(Nl.get(o)||null,t,e,a,n,r)),!0}return!1}function qw(t){var e=Ti(t.target);if(e!==null){var a=Hl(e);if(a!==null){if(e=a.tag,e===13){if(e=iC(a),e!==null){t.blockedOn=e,F0(t.priority,function(){JS(a)});return}}else if(e===31){if(e=sC(a),e!==null){t.blockedOn=e,F0(t.priority,function(){JS(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 nd(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var a=$m(t.nativeEvent);if(a===null){a=t.nativeEvent;var n=new a.constructor(a.type,a);lm=n,a.target.dispatchEvent(n),lm=null}else return e=os(a),e!==null&&Uw(e),t.blockedOn=a,!1;e.shift()}return!0}function tC(t,e,a){nd(t)&&a.delete(e)}function x2(){Vm=!1,Pr!==null&&nd(Pr)&&(Pr=null),Fr!==null&&nd(Fr)&&(Fr=null),Nr!==null&&nd(Nr)&&(Nr=null),Fl.forEach(tC),Nl.forEach(tC)}function zc(t,e){t.blockedOn===e&&(t.blockedOn=null,Vm||(Vm=!0,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,x2)))}var qc=null;function aC(t){qc!==t&&(qc=t,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,function(){qc===t&&(qc=null);for(var e=0;e<t.length;e+=3){var a=t[e],n=t[e+1],r=t[e+2];if(typeof n!="function"){if(Hg(n||a)===null)continue;break}var o=os(a);o!==null&&(t.splice(e,3),e-=3,wm(o,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function ns(t){function e(l){return zc(l,t)}Pr!==null&&zc(Pr,t),Fr!==null&&zc(Fr,t),Nr!==null&&zc(Nr,t),Fl.forEach(e),Nl.forEach(e);for(var a=0;a<wr.length;a++){var n=wr[a];n.blockedOn===t&&(n.blockedOn=null)}for(;0<wr.length&&(a=wr[0],a.blockedOn===null);)qw(a),a.blockedOn===null&&wr.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var r=a[n],o=a[n+1],i=r[Yt]||null;if(typeof o=="function")i||aC(a);else if(i){var s=null;if(o&&o.hasAttribute("formAction")){if(r=o,i=o[Yt]||null)s=i.formAction;else if(Hg(r)!==null)continue}else s=i.action;typeof s=="function"?a[n+1]=s:(a.splice(n,3),n-=3),aC(a)}}}function $w(){function t(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(i){return r=i})},focusReset:"manual",scroll:"manual"})}function e(){r!==null&&(r(),r=null),n||setTimeout(a,20)}function a(){if(!n&&!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 n=!1,r=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null)}}}function Ug(t){this._internalRoot=t}Wd.prototype.render=Ug.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(R(409));var a=e.current,n=fa();Hw(a,n,t,e,null,null)};Wd.prototype.unmount=Ug.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Hw(t.current,2,null,t,null,null),jd(),e[rs]=null}};function Wd(t){this._internalRoot=t}Wd.prototype.unstable_scheduleHydration=function(t){if(t){var e=yC();t={blockedOn:null,target:t,priority:e};for(var a=0;a<wr.length&&e!==0&&e<wr[a].priority;a++);wr.splice(a,0,t),a===0&&qw(t)}};var nC=rC.version;if(nC!=="19.2.4")throw Error(R(527,nC,"19.2.4"));xe.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(R(188)):(t=Object.keys(t).join(","),Error(R(268,t)));return t=KT(e),t=t!==null?lC(t):null,t=t===null?null:t.stateNode,t};var b2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:ee,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(il=__REACT_DEVTOOLS_GLOBAL_HOOK__,!il.isDisabled&&il.supportsFiber))try{Ul=il.inject(b2),ca=il}catch{}var il;Xd.createRoot=function(t,e){if(!oC(t))throw Error(R(299));var a=!1,n="",r=O_,o=B_,i=P_;return e!=null&&(e.unstable_strictMode===!0&&(a=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(o=e.onCaughtError),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Fw(t,1,!1,null,null,a,n,null,r,o,i,$w),t[rs]=e.current,Og(t),new Ug(e)};Xd.hydrateRoot=function(t,e,a){if(!oC(t))throw Error(R(299));var n=!1,r="",o=O_,i=B_,s=P_,l=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(r=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=Fw(t,1,!0,e,a??null,n,r,l,o,i,s,$w),e.context=Nw(null),a=e.current,n=fa(),n=Wm(n),r=Mr(n),r.callback=null,Dr(a,r,n),a=n,e.current.lanes=a,ql(e,a),pn(e),t[rs]=e.current,Og(t),new Wd(e)};Xd.version="19.2.4"});var Uo=rn((F3,Gw)=>{"use strict";function jw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(jw)}catch(t){console.error(t)}}jw(),Gw.exports=Vw()});var qL=rn(hf=>{"use strict";var mD=Symbol.for("react.transitional.element"),gD=Symbol.for("react.fragment");function zL(t,e,a){var n=null;if(a!==void 0&&(n=""+a),e.key!==void 0&&(n=""+e.key),"key"in e){a={};for(var r in e)r!=="key"&&(a[r]=e[r])}else a=e;return e=a.ref,{$$typeof:mD,type:t,key:n,ref:e!==void 0?e:null,props:a}}hf.Fragment=gD;hf.jsx=zL;hf.jsxs=zL});var Oe=rn((eU,$L)=>{"use strict";$L.exports=qL()});var bT=K(Xe(),1),Kp=K(Ys(),1),A3=K(Uo(),1);function Zw(t,e,a,n){let r=n?.maxRetries??3,o=n?.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 f of d)for(let m of f.removedNodes)if(m===t){if(s>=r){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 S2=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function zg(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 n=a.content,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let i=r.currentNode,s=i.tagName.toLowerCase();if(!S2.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"),m=(u==="href"||u==="src"||u==="formaction")&&(c.startsWith("javascript:")||c.startsWith("vbscript:")||c.startsWith("data:text/html"));(d||m)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var Ww=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 n=zg(t.html),r="data-syntro-insert-label",o=t.label;if(o){let d=CSS.escape(o),m=(a.parentElement??a).querySelector(`[${r}="${d}"]`);m&&m.remove()}let i=document.createElement("div");i.setAttribute("data-syntro-action-id",e.generateId()),o&&i.setAttribute(r,o),i.innerHTML=n;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:f}=t.deepLink;l=()=>{let m=window.SynOS?.handle;m&&(m.open(),m.runtime?.events?.publish("notification.deep_link",{tileId:d,itemId:f}))},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=Zw(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(f=>{d.setAttribute(f.name,f.value)}),i.replaceWith(d)}else i.remove()},updateFn:d=>{"html"in d&&typeof d.html=="string"&&(i.innerHTML=zg(d.html))}}},Xw=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 n=a.textContent??"";return a.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{a.textContent=n},updateFn:r=>{"text"in r&&typeof r.text=="string"&&(a.textContent=r.text)}}},Yw=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 n=t.attr.toLowerCase();if(n.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);if(n==="href"||n==="src"||n==="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)}}},Kw=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 n=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:()=>{n||a.classList.remove(t.className)}}},Qw=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 n=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:()=>{n&&a.classList.add(t.className)}}},Jw=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 n=new Map;for(let r of Object.keys(t.styles)){let o=a.style.getPropertyValue(r);n.set(r,o)}for(let[r,o]of Object.entries(t.styles))a.style.setProperty(r,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[r,o]of n)o?a.style.setProperty(r,o):a.style.removeProperty(r)},updateFn:r=>{if("styles"in r&&typeof r.styles=="object"&&r.styles)for(let[o,i]of Object.entries(r.styles))a.style.setProperty(o,i)}}},qg=[{kind:"content:insertHtml",executor:Ww},{kind:"content:setText",executor:Xw},{kind:"content:setAttr",executor:Yw},{kind:"content:addClass",executor:Kw},{kind:"content:removeClass",executor:Qw},{kind:"content:setStyle",executor:Jw}],$g={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:qg};var C2={light:50,medium:100,heavy:200},_2=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],eL={init(t,e,a){let n=C2[a.intensity],r=a.colors.length>0?a.colors:_2,o=[];for(let i=0;i<n;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:r[Math.floor(Math.random()*r.length)],opacity:1,shape:Math.random()>.5?"rect":"circle"});return o},update(t,e,a){let n=!1;for(let r of t)r.vy+=.15,r.vx*=.99,r.x+=r.vx,r.y+=r.vy,r.rotation+=r.rotationSpeed,r.y>0&&r.opacity>0&&r.y>500&&(r.opacity-=.02,r.opacity<0&&(r.opacity=0)),r.opacity>.01&&(n=!0);return n},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 w2={light:20,medium:40,heavy:80},L2="\u{1F389}",tL={init(t,e,a){let n=w2[a.intensity],r=typeof a.props?.emoji=="string"?a.props.emoji:L2,o=[];for(let i=0;i<n;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:r,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 n=!1;for(let r of t){r.y+=r.vy;let o=r.data?.wobblePhase??0,i=r.data?.wobbleAmp??1,s=r.data?.originX??r.x;r.x=s+Math.sin(a*.003+o)*i*20,r.y>600&&(r.opacity-=.02,r.opacity<0&&(r.opacity=0)),r.opacity>.01&&(n=!0)}return n},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 k2={light:20,medium:40,heavy:80},I2={light:3,medium:4,heavy:5},aL={init(t,e,a){let n=k2[a.intensity],r=I2[a.intensity],o=a.colors.length>0?a.colors:["#ff4444","#44ff44","#4444ff"],i=[];for(let s=0;s<r;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<n;d++){let f=Math.PI*2*d/n+(Math.random()-.5)*.3,m=Math.random()*3+2;i.push({x:l,y:u,vx:Math.cos(f)*m,vy:Math.sin(f)*m,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 n=!1;for(let r of t)r.vx*=.97,r.vy*=.97,r.vy+=.03,r.x+=r.vx,r.y+=r.vy,r.opacity-=.008,r.opacity<0&&(r.opacity=0),r.opacity>.01&&(n=!0);return n},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},nL={init(t,e,a){let n=A2[a.intensity],r=a.colors.length>0?a.colors:["#ffd700","#ffffff","#fffacd"],o=[];for(let i=0;i<n;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:r[Math.floor(Math.random()*r.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 n=!1;for(let r of t){r.x+=r.vx,r.y+=r.vy,r.rotation+=r.rotationSpeed,r.data&&(r.data.baseOpacity=(r.data.baseOpacity??1)-.001,r.data.baseOpacity<0&&(r.data.baseOpacity=0));let o=r.data?.phase??0,i=r.data?.baseOpacity??1;if(i<=.01)r.opacity=0;else{let s=Math.sin(a*.005+o)*.4+.6;r.opacity=i*s}r.opacity>.01&&(n=!0)}return n},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 n=a.size;t.beginPath(),t.moveTo(0,-n),t.lineTo(n*.3,-n*.3),t.lineTo(n,0),t.lineTo(n*.3,n*.3),t.lineTo(0,n),t.lineTo(-n*.3,n*.3),t.lineTo(-n,0),t.lineTo(-n*.3,-n*.3),t.closePath(),t.fill(),t.restore()}}};var Yd=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,n){this.container=e,this.effect=a,this.duration=n.duration;let r=document.createElement("canvas");r.setAttribute("data-syntro-celebrate",""),Object.assign(r.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let o=window.devicePixelRatio||1,i=window.innerWidth,s=window.innerHeight;r.width=i*o,r.height=s*o,r.style.width=`${i}px`,r.style.height=`${s}px`;let l=r.getContext("2d");l&&(l.scale(o,o),this.canvas=r,this.ctx=l,e.appendChild(r),this.particles=a.init(i,s,n),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,n=e-this.lastFrame;if(this.lastFrame=e,a>=this.duration){this.stop();return}let r=this.canvas.width/(window.devicePixelRatio||1),o=this.canvas.height/(window.devicePixelRatio||1);if(this.ctx.clearRect(0,0,r,o),!this.effect.update(this.particles,n,a)){this.stop();return}this.effect.render(this.ctx,this.particles),this.rafId=requestAnimationFrame(this.tick)}};var E2=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"];function T2(t,e){return[t,e,`${t}cc`,`${e}cc`,"#ffffff",`${t}80`]}function R2(t){try{let e=getComputedStyle(t),a=e.getPropertyValue("--sc-color-primary")?.trim(),n=e.getPropertyValue("--sc-color-primary-hover")?.trim();if(a?.startsWith("#")&&a.length>=7)return T2(a,n||a)}catch{}return null}var rL=new Map([["confetti",eL],["fireworks",aL],["sparkles",nL],["emoji-rain",tL]]),oL=async(t,e)=>{let a=rL.get(t.effect);if(!a)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...rL.keys()].join(", ")}`),{cleanup:()=>{}};let n=t.colors??R2(e.overlayRoot)??E2,r={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:n,props:t.props},o=new Yd;return o.start(e.overlayRoot,a,r),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{o.stop()}}};var jg="syntro_active_tour",Kd=new Map;function M2(t){try{let e=localStorage.getItem(jg);if(!e)return null;let a=JSON.parse(e);return a.tourId!==t?null:a}catch{return null}}function Vg(t){try{localStorage.setItem(jg,JSON.stringify(t))}catch{}}function D2(){try{localStorage.removeItem(jg)}catch{}}function Kl(){return window.location.pathname}function O2(t){if(!t.route)return!0;let e=Kl();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var Gg=async(t,e)=>{let{tourId:a,steps:n,startStep:r,autoStart:o=!0}=t;if(n.length===0)throw new Error(`Tour "${a}" has no steps`);if(Kd.has(a))return{cleanup:async()=>{let v=Kd.get(a);v&&await v.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let i=M2(a),s=!!i;if(!s&&!o)return{cleanup:()=>{}};i||(i={tourId:a,currentStepId:r||n[0].id,startedAt:Date.now()},Vg(i));let l=n.findIndex(v=>v.id===i.currentStepId);if(l===-1){let v=r||n[0].id;l=n.findIndex(y=>y.id===v),l===-1&&(l=0),i.currentStepId=n[l].id,Vg(i)}let u=n[l];if(!O2(u))return e.publishEvent("tour.waiting_for_route",{tourId:a,stepId:u.id,expectedRoute:u.route,currentRoute:Kl()}),{cleanup:()=>{}};let c=!1,d=null,f=null,m=null,S=async()=>{f&&(f(),f=null),d?.isApplied()&&(await d.revert(),d=null)},b=async v=>{if(c)return;if(await S(),v==="end"){D2(),e.publishEvent("tour.completed",{tourId:a,totalSteps:n.length}),c=!0;return}let y=n.find(_=>_.id===v);if(!y){console.error(`[Tour] Step "${v}" not found`);return}if(i.currentStepId=v,Vg(i),e.publishEvent("tour.step_changed",{tourId:a,previousStepId:u.id,nextStepId:v}),y.route&&y.route!==Kl()){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:n.findIndex(y=>y.id===v.id),totalSteps:n.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){f=e.subscribeEvent("action.modal_cta_clicked",L=>{let C=L?.actionId;if(C&&v.onAction){let A=v.onAction[C];A&&b(A)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",L=>{let C=L?.actionId;if(C&&v.onAction){let A=v.onAction[C];A&&b(A)}}),_=f;f=()=>{_(),y()}}}};m=(()=>{let v=Kl(),y=()=>{let C=Kl();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),L=history.replaceState.bind(history);return history.pushState=(...C)=>{_(...C),queueMicrotask(y)},history.replaceState=(...C)=>{L(...C),queueMicrotask(y)},()=>{window.removeEventListener("popstate",y),history.pushState=_,history.replaceState=L}})(),s?e.publishEvent("tour.resumed",{tourId:a,stepId:i.currentStepId}):e.publishEvent("tour.started",{tourId:a,totalSteps:n.length,startStepId:i.currentStepId}),await x(u);let g=async()=>{c=!0,Kd.delete(a),await S(),m&&m(),e.publishEvent("tour.paused",{tourId:a,stepId:i.currentStepId})};return Kd.set(a,{cleanup:g}),{cleanup:g}};var Ga={white:"#ffffff",black:"#000000"},re={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"},Te={0:"#07230a",1:"#0e4514",2:"#16681e",3:"#1d8a28",4:"#24ad32",5:"#4fbd5a",6:"#7acd82",7:"#a5deab",8:"#d0eed3",9:"#e5f6e7"},wt={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},Ve={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},ma={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"},Nt={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},Jl={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var ga={primary:I[10],secondary:I[9],tertiary:I[8]},t4={primary:I[2],secondary:I[0]},Zg={primary:I[4],secondary:I[3]},Qd={primary:{text:Ga.white,icon:Ga.white,border:re[3],backgroundDefault:re[3],backgroundHover:re[2]},neutral:{text:I[10],textHover:Ga.white,icon:I[10],iconHover:Ga.white,border:I[4],background:I[2]},link:{text:Ga.white,icon:Ga.white,hover:re[5]},error:{text:Ve[5],hover:Ve[6]},success:{text:Te[5],hover:Te[6]}},a4={slateGrey:{content:I[10],pillOutline:I[10],borderPrimary:I[5],borderSecondary:I[5],background:I[3]},brand:{content:re[9],pillOutline:re[9],borderPrimary:re[6],borderSecondary:re[6],background:re[0]},red:{content:Ve[8],pillOutline:Ve[4],borderPrimary:Ve[2],borderSecondary:Ve[2],background:Ve[0]},yellow:{content:wt[8],pillOutline:wt[4],borderPrimary:wt[2],borderSecondary:wt[2],background:wt[0]},green:{content:Te[8],pillOutline:Te[4],borderPrimary:Te[2],borderSecondary:Te[2],background:Te[0]},purple:{content:Nt[8],pillOutline:Nt[4],borderPrimary:Nt[2],borderSecondary:Nt[2],background:Nt[0]},blue:{content:ma[8],pillOutline:ma[4],borderPrimary:ma[2],borderSecondary:ma[2],background:ma[0]},orange:{content:Ql[8],pillOutline:Ql[4],borderPrimary:Ql[2],borderSecondary:Ql[2],background:Ql[0]},pink:{content:Jl[8],pillOutline:Jl[4],borderPrimary:Jl[2],borderSecondary:Jl[2],background:Jl[0]}},n4={green:{content:Te[8],border:Te[2],background:Te[0]},yellow:{content:wt[8],border:wt[2],background:wt[0]},red:{content:Ve[8],border:Ve[2],background:Ve[0]}},r4={green:{content:Te[1],background:Te[9]},yellow:{content:wt[1],background:wt[9]},red:{content:Ve[1],background:Ve[9]}},o4={content:I[10],border:I[4],background:"#1c2124"},i4={backgroundDefault:I[2],backgroundHover:I[1],selected:I[3]},s4={background:I[2],icon:I[10],borderDefault:I[4],borderSelected:re[3],textLabel:I[9],textPlaceholder:I[8],textHint:I[8]},l4={backgroundDefault:I[2],backgroundDisabled:I[0],textLabel:I[9],textPlaceholder:I[8],textHint:I[8],textError:Ve[5],iconDefault:I[9],iconPlaceholder:I[10],iconError:Ve[5],borderDefault:I[4],borderSelected:re[3],borderError:Ve[5]},u4={handleDefault:Ga.white,handleDisabled:I[10],off:{backgroundDefault:I[4],backgroundHover:I[5],backgroundDisabled:I[4]},on:{backgroundDefault:Te[3],backgroundHover:Te[2],backgroundDisabled:I[4]}},c4={off:{backgroundDefault:"#00000000",backgroundHover:I[5],backgroundDisabled:I[2],border:I[6]},on:{backgroundDefault:Te[0],backgroundHover:Te[1],backgroundDisabled:I[2],border:Te[3]}},d4={content:I[10],background:I[4]},f4={background:I[4],active:Te[3]},p4={background:I[1],content:I[9],border:I[4]},h4={backgroundDefault:I[1],backgroundHover:I[3],backgroundActive:I[4],border:I[4],contentPrimary:I[10],contentSecondary:I[9],contentTertiary:I[8]},m4={background:I[1],content:I[9],border:I[4]},g4={activeBackground:I[3],activeContent:re[5],inactiveContent:I[9],border:I[4]},v4={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]}},y4={textPrimaryDefault:I[10],textPrimaryHover:I[10],textSecondaryDefault:I[8],textSecondaryHover:I[9],iconPrimary:I[10],iconSecondary:I[8]},x4={background:Te[1],active:Te[5]},b4={textDefault:I[10],textSelected:Ga.white,textDisabled:I[7],backgroundDefault:I[2],backgroundMiddle:I[3],backgroundSelected:re[3],border:I[4]},S4=I[9];var iL=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function sL(t,e,a){let n=a?.paddingPx??12,r=a?.radiusPx??12,o=Math.min(Math.max(a?.scrimOpacity??.55,0),1),i=a?.ringColor??`var(--syntro-ring, ${ma[5]})`,s=a?.blocking??!1,l=a?.onClickOutside??!0,u=a?.onEsc??!0,c=getComputedStyle(document.documentElement),d=c.getPropertyValue("--syntro-spotlight-backdrop").trim(),f=c.getPropertyValue("--syntro-ring").trim(),m=document.createElement("div");m.className="syntro-spotlight-scrim";let S=s||l;Object.assign(m.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(m),requestAnimationFrame(()=>m.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 ${i||f||ma[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(!iL)for(let w=0;w<4;w++){let k=document.createElement("div");k.style.position="fixed",k.style.background="inherit",x.push(k),m.appendChild(k)}let p=w=>{m.style.clipPath=w,m.style.webkitClipPath=w},g=()=>{if(!t.isConnected){A.destroy();return}let w=t.getBoundingClientRect(),k=w.left-n,T=w.top-n,D=w.width+n*2,M=w.height+n*2;if(Object.assign(b.style,{left:`${k}px`,top:`${T}px`,width:`${D}px`,height:`${M}px`}),iL){let P=window.innerWidth,F=window.innerHeight,U=Math.min(r,D/2,M/2),V=`M 0 0 L ${P} 0 L ${P} ${F} L 0 ${F} Z`,N=`M ${k+U} ${T} A ${U} ${U} 0 0 0 ${k} ${T+U} L ${k} ${T+M-U} A ${U} ${U} 0 0 0 ${k+U} ${T+M} L ${k+D-U} ${T+M} A ${U} ${U} 0 0 0 ${k+D} ${T+M-U} L ${k+D} ${T+U} A ${U} ${U} 0 0 0 ${k+D-U} ${T} L ${k+U} ${T} Z`;p(`path('${V} ${N}')`)}else{let[P,F,U,V]=x;Object.assign(P.style,{left:"0px",top:"0px",width:"100vw",height:`${T}px`}),Object.assign(U.style,{left:"0px",top:`${T+M}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(T+M))}px`}),Object.assign(V.style,{left:"0px",top:`${T}px`,width:`${k}px`,height:`${M}px`}),Object.assign(F.style,{left:`${k+D}px`,top:`${T}px`,width:`${Math.max(0,window.innerWidth-(k+D))}px`,height:`${M}px`})}},v=new ResizeObserver(()=>requestAnimationFrame(g));v.observe(t);let y=()=>requestAnimationFrame(g),_=()=>requestAnimationFrame(g);window.addEventListener("scroll",y,!0),window.addEventListener("resize",_);let L=w=>{w.key==="Escape"&&u&&(a?.onDismiss?.(),A.destroy())};u&&window.addEventListener("keydown",L);let C=w=>{s?(w.preventDefault(),w.stopPropagation()):l&&(a?.onDismiss?.(),A.destroy())};m.addEventListener("click",C);let A={destroy(){v.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",_),u&&window.removeEventListener("keydown",L),m.removeEventListener("click",C),m.style.pointerEvents="none",m.style.opacity="0",setTimeout(()=>{m.remove(),b.remove()},220)}};return g(),A}var B2=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function va(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 n=a.content,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let i=r.currentNode,s=i.tagName.toLowerCase();if(!B2.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"),f=(u==="href"||u==="src")&&c.startsWith("javascript:");(d||f)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var zo={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)"},Wg=async(t,e)=>{let{content:a,size:n="md",blocking:r=!1,scrim:o,dismiss:i,ctaButtons:s}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
|
|
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{Xh=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Io(a):""}function y2(t,e){switch(t.tag){case 26:case 27:case 5:return Io(t.type);case 16:return Io("Lazy");case 13:return t.child!==e&&e!==null?Io("Suspense Fallback"):Io("Suspense");case 19:return Io("SuspenseList");case 0:case 15:return Kh(t.type,!1);case 11:return Kh(t.type.render,!1);case 1:return Kh(t.type,!0);case 31:return Io("Activity");default:return""}}function PS(t){try{var e="",a=null;do e+=y2(t,a),a=t,t=t.return;while(t);return e}catch(r){return`
|
|
7
|
+
Error generating stack: `+r.message+`
|
|
8
|
+
`+r.stack}}var Dm=Object.prototype.hasOwnProperty,wg=yt.unstable_scheduleCallback,Yh=yt.unstable_cancelCallback,x2=yt.unstable_shouldYield,b2=yt.unstable_requestPaint,ma=yt.unstable_now,S2=yt.unstable_getCurrentPriorityLevel,dC=yt.unstable_ImmediatePriority,fC=yt.unstable_UserBlockingPriority,Md=yt.unstable_NormalPriority,_2=yt.unstable_LowPriority,pC=yt.unstable_IdlePriority,C2=yt.log,w2=yt.unstable_setDisableYieldValue,Kl=null,ga=null;function Mn(t){if(typeof C2=="function"&&w2(t),ga&&typeof ga.setStrictMode=="function")try{ga.setStrictMode(Kl,t)}catch{}}var va=Math.clz32?Math.clz32:I2,L2=Math.log,k2=Math.LN2;function I2(t){return t>>>=0,t===0?32:31-(L2(t)/k2|0)|0}var Yc=256,Qc=262144,Jc=4194304;function Ao(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 nf(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=Ao(r):(i&=s,i!==0?n=Ao(i):a||(a=s&~t,a!==0&&(n=Ao(a))))):(s=r&~o,s!==0?n=Ao(s):i!==0?n=Ao(i):a||(a=r&~t,a!==0&&(n=Ao(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 Yl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function A2(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 hC(){var t=Jc;return Jc<<=1,(Jc&62914560)===0&&(Jc=4194304),t}function Qh(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function Ql(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function E2(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-va(a),d=1<<c;s[c]=0,l[c]=-1;var f=u[c];if(f!==null)for(u[c]=null,c=0;c<f.length;c++){var h=f[c];h!==null&&(h.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-va(e);t.entangledLanes|=e,t.entanglements[r]=t.entanglements[r]|1073741824|a&261930}function gC(t,e){var a=t.entangledLanes|=e;for(t=t.entanglements;a;){var r=31-va(a),n=1<<r;n&e|t[r]&e&&(t[r]|=e),a&=~n}}function vC(t,e){var a=e&-e;return a=(a&42)!==0?1:Lg(a),(a&(t.suspendedLanes|e))!==0?0:a}function Lg(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 kg(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function yC(){var t=_e.p;return t!==0?t:(t=window.event,t===void 0?32:zL(t.type))}function NS(t,e){var a=_e.p;try{return _e.p=t,e()}finally{_e.p=a}}var Kn=Math.random().toString(36).slice(2),It="__reactFiber$"+Kn,aa="__reactProps$"+Kn,fs="__reactContainer$"+Kn,Bm="__reactEvents$"+Kn,T2="__reactListeners$"+Kn,R2="__reactHandles$"+Kn,FS="__reactResources$"+Kn,Jl="__reactMarker$"+Kn;function Ig(t){delete t[It],delete t[aa],delete t[Bm],delete t[T2],delete t[R2]}function Fi(t){var e=t[It];if(e)return e;for(var a=t.parentNode;a;){if(e=a[fs]||a[It]){if(a=e.alternate,e.child!==null||a!==null&&a.child!==null)for(t=G_(t);t!==null;){if(a=t[It])return a;t=G_(t)}return e}t=a,a=t.parentNode}return null}function ps(t){if(t=t[It]||t[fs]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function xl(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(O(33))}function Zi(t){var e=t[FS];return e||(e=t[FS]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function _t(t){t[Jl]=!0}var xC=new Set,bC={};function zo(t,e){as(t,e),as(t+"Capture",e)}function as(t,e){for(bC[t]=e,t=0;t<e.length;t++)xC.add(e[t])}var M2=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]*$"),HS={},US={};function O2(t){return Dm.call(US,t)?!0:Dm.call(HS,t)?!1:M2.test(t)?US[t]=!0:(HS[t]=!0,!1)}function hd(t,e,a){if(O2(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 ed(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 Rr(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 Ta(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function SC(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function D2(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 Pm(t){if(!t._valueTracker){var e=SC(t)?"checked":"value";t._valueTracker=D2(t,e,""+t[e])}}function _C(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),r="";return t&&(r=SC(t)?t.checked?"true":"false":t.value),t=r,t!==a?(e.setValue(t),!0):!1}function Od(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 B2=/[\n"\\]/g;function Oa(t){return t.replace(B2,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Nm(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=""+Ta(e)):t.value!==""+Ta(e)&&(t.value=""+Ta(e)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),e!=null?Fm(t,i,Ta(e)):a!=null?Fm(t,i,Ta(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=""+Ta(s):t.removeAttribute("name")}function CC(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)){Pm(t);return}a=a!=null?""+Ta(a):"",e=e!=null?""+Ta(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),Pm(t)}function Fm(t,e,a){e==="number"&&Od(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Xi(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=""+Ta(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 wC(t,e,a){if(e!=null&&(e=""+Ta(e),e!==t.value&&(t.value=e),a==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=a!=null?""+Ta(a):""}function LC(t,e,a,r){if(e==null){if(r!=null){if(a!=null)throw Error(O(92));if(yl(r)){if(1<r.length)throw Error(O(93));r=r[0]}a=r}a==null&&(a=""),e=a}a=Ta(e),t.defaultValue=a,r=t.textContent,r===a&&r!==""&&r!==null&&(t.value=r),Pm(t)}function rs(t,e){if(e){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=e;return}}t.textContent=e}var P2=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 zS(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||P2.has(e)?e==="float"?t.cssFloat=a:t[e]=(""+a).trim():t[e]=a+"px"}function kC(t,e,a){if(e!=null&&typeof e!="object")throw Error(O(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&&zS(t,n,r)}else for(var o in e)e.hasOwnProperty(o)&&zS(t,o,e[o])}function Ag(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 N2=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"]]),F2=/^[\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 md(t){return F2.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Hr(){}var Hm=null;function Eg(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Hi=null,Ki=null;function qS(t){var e=ps(t);if(e&&(t=e.stateNode)){var a=t[aa]||null;e:switch(t=e.stateNode,e.type){case"input":if(Nm(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="'+Oa(""+e)+'"][type="radio"]'),e=0;e<a.length;e++){var r=a[e];if(r!==t&&r.form===t.form){var n=r[aa]||null;if(!n)throw Error(O(90));Nm(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&&_C(r)}break e;case"textarea":wC(t,a.value,a.defaultValue);break e;case"select":e=a.value,e!=null&&Xi(t,!!a.multiple,e,!1)}}}var Jh=!1;function IC(t,e,a){if(Jh)return t(e,a);Jh=!0;try{var r=t(e);return r}finally{if(Jh=!1,(Hi!==null||Ki!==null)&&(vf(),Hi&&(e=Hi,t=Ki,Ki=Hi=null,qS(e),t)))for(e=0;e<t.length;e++)qS(t[e])}}function Pl(t,e){var a=t.stateNode;if(a===null)return null;var r=a[aa]||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(O(231,e,typeof a));return a}var $r=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Um=!1;if($r)try{Ri={},Object.defineProperty(Ri,"passive",{get:function(){Um=!0}}),window.addEventListener("test",Ri,Ri),window.removeEventListener("test",Ri,Ri)}catch{Um=!1}var Ri,On=null,Tg=null,gd=null;function AC(){if(gd)return gd;var t,e=Tg,a=e.length,r,n="value"in On?On.value:On.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 gd=n.slice(t,1<r?1-r:void 0)}function vd(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 td(){return!0}function VS(){return!1}function ra(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)?td:VS,this.isPropagationStopped=VS,this}return Ve(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=td)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=td)},persist:function(){},isPersistent:td}),e}var qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},of=ra(qo),eu=Ve({},qo,{view:0,detail:0}),H2=ra(eu),em,tm,dl,sf=Ve({},eu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rg,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!==dl&&(dl&&t.type==="mousemove"?(em=t.screenX-dl.screenX,tm=t.screenY-dl.screenY):tm=em=0,dl=t),em)},movementY:function(t){return"movementY"in t?t.movementY:tm}}),$S=ra(sf),U2=Ve({},sf,{dataTransfer:0}),z2=ra(U2),q2=Ve({},eu,{relatedTarget:0}),am=ra(q2),V2=Ve({},qo,{animationName:0,elapsedTime:0,pseudoElement:0}),$2=ra(V2),j2=Ve({},qo,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),G2=ra(j2),W2=Ve({},qo,{data:0}),jS=ra(W2),Z2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X2={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"},K2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y2(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=K2[t])?!!e[t]:!1}function Rg(){return Y2}var Q2=Ve({},eu,{key:function(t){if(t.key){var e=Z2[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=vd(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?X2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rg,charCode:function(t){return t.type==="keypress"?vd(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?vd(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),J2=ra(Q2),eM=Ve({},sf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),GS=ra(eM),tM=Ve({},eu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rg}),aM=ra(tM),rM=Ve({},qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),nM=ra(rM),oM=Ve({},sf,{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}),iM=ra(oM),sM=Ve({},qo,{newState:0,oldState:0}),lM=ra(sM),uM=[9,13,27,32],Mg=$r&&"CompositionEvent"in window,_l=null;$r&&"documentMode"in document&&(_l=document.documentMode);var cM=$r&&"TextEvent"in window&&!_l,EC=$r&&(!Mg||_l&&8<_l&&11>=_l),WS=" ",ZS=!1;function TC(t,e){switch(t){case"keyup":return uM.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function RC(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ui=!1;function dM(t,e){switch(t){case"compositionend":return RC(e);case"keypress":return e.which!==32?null:(ZS=!0,WS);case"textInput":return t=e.data,t===WS&&ZS?null:t;default:return null}}function fM(t,e){if(Ui)return t==="compositionend"||!Mg&&TC(t,e)?(t=AC(),gd=Tg=On=null,Ui=!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 EC&&e.locale!=="ko"?null:e.data;default:return null}}var pM={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 XS(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!pM[t.type]:e==="textarea"}function MC(t,e,a,r){Hi?Ki?Ki.push(r):Ki=[r]:Hi=r,e=Yd(e,"onChange"),0<e.length&&(a=new of("onChange","change",null,a,r),t.push({event:a,listeners:e}))}var Cl=null,Nl=null;function hM(t){IL(t,0)}function lf(t){var e=xl(t);if(_C(e))return t}function KS(t,e){if(t==="change")return e}var OC=!1;$r&&($r?(rd="oninput"in document,rd||(rm=document.createElement("div"),rm.setAttribute("oninput","return;"),rd=typeof rm.oninput=="function"),ad=rd):ad=!1,OC=ad&&(!document.documentMode||9<document.documentMode));var ad,rd,rm;function YS(){Cl&&(Cl.detachEvent("onpropertychange",DC),Nl=Cl=null)}function DC(t){if(t.propertyName==="value"&&lf(Nl)){var e=[];MC(e,Nl,t,Eg(t)),IC(hM,e)}}function mM(t,e,a){t==="focusin"?(YS(),Cl=e,Nl=a,Cl.attachEvent("onpropertychange",DC)):t==="focusout"&&YS()}function gM(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return lf(Nl)}function vM(t,e){if(t==="click")return lf(e)}function yM(t,e){if(t==="input"||t==="change")return lf(e)}function xM(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var xa=typeof Object.is=="function"?Object.is:xM;function Fl(t,e){if(xa(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(!Dm.call(e,n)||!xa(t[n],e[n]))return!1}return!0}function QS(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function JS(t,e){var a=QS(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=QS(a)}}function BC(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?BC(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function PC(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Od(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=Od(t.document)}return e}function Og(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 bM=$r&&"documentMode"in document&&11>=document.documentMode,zi=null,zm=null,wl=null,qm=!1;function e_(t,e,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;qm||zi==null||zi!==Od(r)||(r=zi,"selectionStart"in r&&Og(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}),wl&&Fl(wl,r)||(wl=r,r=Yd(zm,"onSelect"),0<r.length&&(e=new of("onSelect","select",null,e,a),t.push({event:e,listeners:r}),e.target=zi)))}function ko(t,e){var a={};return a[t.toLowerCase()]=e.toLowerCase(),a["Webkit"+t]="webkit"+e,a["Moz"+t]="moz"+e,a}var qi={animationend:ko("Animation","AnimationEnd"),animationiteration:ko("Animation","AnimationIteration"),animationstart:ko("Animation","AnimationStart"),transitionrun:ko("Transition","TransitionRun"),transitionstart:ko("Transition","TransitionStart"),transitioncancel:ko("Transition","TransitionCancel"),transitionend:ko("Transition","TransitionEnd")},nm={},NC={};$r&&(NC=document.createElement("div").style,"AnimationEvent"in window||(delete qi.animationend.animation,delete qi.animationiteration.animation,delete qi.animationstart.animation),"TransitionEvent"in window||delete qi.transitionend.transition);function Vo(t){if(nm[t])return nm[t];if(!qi[t])return t;var e=qi[t],a;for(a in e)if(e.hasOwnProperty(a)&&a in NC)return nm[t]=e[a];return t}var FC=Vo("animationend"),HC=Vo("animationiteration"),UC=Vo("animationstart"),SM=Vo("transitionrun"),_M=Vo("transitionstart"),CM=Vo("transitioncancel"),zC=Vo("transitionend"),qC=new Map,Vm="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(" ");Vm.push("scrollEnd");function Ya(t,e){qC.set(t,e),zo(e,[t])}var Dd=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)},Ea=[],Vi=0,Dg=0;function uf(){for(var t=Vi,e=Dg=Vi=0;e<t;){var a=Ea[e];Ea[e++]=null;var r=Ea[e];Ea[e++]=null;var n=Ea[e];Ea[e++]=null;var o=Ea[e];if(Ea[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&&VC(a,n,o)}}function cf(t,e,a,r){Ea[Vi++]=t,Ea[Vi++]=e,Ea[Vi++]=a,Ea[Vi++]=r,Dg|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function Bg(t,e,a,r){return cf(t,e,a,r),Bd(t)}function $o(t,e){return cf(t,null,null,e),Bd(t)}function VC(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-va(a),t=o.hiddenUpdates,r=t[n],r===null?t[n]=[e]:r.push(e),e.lane=a|536870912),o):null}function Bd(t){if(50<Ol)throw Ol=0,cg=null,Error(O(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var $i={};function wM(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 pa(t,e,a,r){return new wM(t,e,a,r)}function Pg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function zr(t,e){var a=t.alternate;return a===null?(a=pa(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 $C(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 yd(t,e,a,r,n,o){var i=0;if(r=t,typeof t=="function")Pg(t)&&(i=1);else if(typeof t=="string")i=IO(t,a,yr.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Tm:return t=pa(31,a,e,n),t.elementType=Tm,t.lanes=o,t;case Pi:return Mo(a.children,n,o,e);case uC:i=8,n|=24;break;case Im:return t=pa(12,a,e,n|2),t.elementType=Im,t.lanes=o,t;case Am:return t=pa(13,a,e,n),t.elementType=Am,t.lanes=o,t;case Em:return t=pa(19,a,e,n),t.elementType=Em,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Fr:i=10;break e;case cC:i=9;break e;case _g:i=11;break e;case Cg:i=14;break e;case kn:i=16,r=null;break e}i=29,a=Error(O(130,t===null?"null":typeof t,"")),r=null}return e=pa(i,a,e,n),e.elementType=t,e.type=r,e.lanes=o,e}function Mo(t,e,a,r){return t=pa(7,t,r,e),t.lanes=a,t}function om(t,e,a){return t=pa(6,t,null,e),t.lanes=a,t}function jC(t){var e=pa(18,null,null,0);return e.stateNode=t,e}function im(t,e,a){return e=pa(4,t.children!==null?t.children:[],t.key,e),e.lanes=a,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var t_=new WeakMap;function Da(t,e){if(typeof t=="object"&&t!==null){var a=t_.get(t);return a!==void 0?a:(e={value:t,source:e,stack:PS(e)},t_.set(t,e),e)}return{value:t,source:e,stack:PS(e)}}var ji=[],Gi=0,Pd=null,Hl=0,Ra=[],Ma=0,Gn=null,mr=1,gr="";function Pr(t,e){ji[Gi++]=Hl,ji[Gi++]=Pd,Pd=t,Hl=e}function GC(t,e,a){Ra[Ma++]=mr,Ra[Ma++]=gr,Ra[Ma++]=Gn,Gn=t;var r=mr;t=gr;var n=32-va(r)-1;r&=~(1<<n),a+=1;var o=32-va(e)+n;if(30<o){var i=n-n%5;o=(r&(1<<i)-1).toString(32),r>>=i,n-=i,mr=1<<32-va(e)+n|a<<n|r,gr=o+t}else mr=1<<o|a<<n|r,gr=t}function Ng(t){t.return!==null&&(Pr(t,1),GC(t,1,0))}function Fg(t){for(;t===Pd;)Pd=ji[--Gi],ji[Gi]=null,Hl=ji[--Gi],ji[Gi]=null;for(;t===Gn;)Gn=Ra[--Ma],Ra[Ma]=null,gr=Ra[--Ma],Ra[Ma]=null,mr=Ra[--Ma],Ra[Ma]=null}function WC(t,e){Ra[Ma++]=mr,Ra[Ma++]=gr,Ra[Ma++]=Gn,mr=e.id,gr=e.overflow,Gn=t}var At=null,qe=null,ve=!1,Fn=null,Ba=!1,$m=Error(O(519));function Wn(t){var e=Error(O(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ul(Da(e,t)),$m}function a_(t){var e=t.stateNode,a=t.type,r=t.memoizedProps;switch(e[It]=t,e[aa]=r,a){case"dialog":de("cancel",e),de("close",e);break;case"iframe":case"object":case"embed":de("load",e);break;case"video":case"audio":for(a=0;a<$l.length;a++)de($l[a],e);break;case"source":de("error",e);break;case"img":case"image":case"link":de("error",e),de("load",e);break;case"details":de("toggle",e);break;case"input":de("invalid",e),CC(e,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":de("invalid",e);break;case"textarea":de("invalid",e),LC(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||EL(e.textContent,a)?(r.popover!=null&&(de("beforetoggle",e),de("toggle",e)),r.onScroll!=null&&de("scroll",e),r.onScrollEnd!=null&&de("scrollend",e),r.onClick!=null&&(e.onclick=Hr),e=!0):e=!1,e||Wn(t,!0)}function r_(t){for(At=t.return;At;)switch(At.tag){case 5:case 31:case 13:Ba=!1;return;case 27:case 3:Ba=!0;return;default:At=At.return}}function Mi(t){if(t!==At)return!1;if(!ve)return r_(t),ve=!0,!1;var e=t.tag,a;if((a=e!==3&&e!==27)&&((a=e===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||mg(t.type,t.memoizedProps)),a=!a),a&&qe&&Wn(t),r_(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(317));qe=j_(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(317));qe=j_(t)}else e===27?(e=qe,Yn(t.type)?(t=xg,xg=null,qe=t):qe=e):qe=At?Na(t.stateNode.nextSibling):null;return!0}function Po(){qe=At=null,ve=!1}function sm(){var t=Fn;return t!==null&&(ea===null?ea=t:ea.push.apply(ea,t),Fn=null),t}function Ul(t){Fn===null?Fn=[t]:Fn.push(t)}var jm=xr(null),jo=null,Ur=null;function An(t,e,a){Ne(jm,e._currentValue),e._currentValue=a}function qr(t){t._currentValue=jm.current,Ct(jm)}function Gm(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 Wm(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),Gm(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(O(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),Gm(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 hs(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(O(387));if(i=i.memoizedProps,i!==null){var s=n.type;xa(n.pendingProps.value,i.value)||(t!==null?t.push(s):t=[s])}}else if(n===Ed.current){if(i=n.alternate,i===null)throw Error(O(387));i.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(t!==null?t.push(Gl):t=[Gl])}n=n.return}t!==null&&Wm(e,t,a,r),e.flags|=262144}function Nd(t){for(t=t.firstContext;t!==null;){if(!xa(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function No(t){jo=t,Ur=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Et(t){return ZC(jo,t)}function nd(t,e){return jo===null&&No(t),ZC(t,e)}function ZC(t,e){var a=e._currentValue;if(e={context:e,memoizedValue:a,next:null},Ur===null){if(t===null)throw Error(O(308));Ur=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Ur=Ur.next=e;return a}var LM=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()})}},kM=yt.unstable_scheduleCallback,IM=yt.unstable_NormalPriority,ft={$$typeof:Fr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hg(){return{controller:new LM,data:new Map,refCount:0}}function tu(t){t.refCount--,t.refCount===0&&kM(IM,function(){t.controller.abort()})}var Ll=null,Zm=0,ns=0,Yi=null;function AM(t,e){if(Ll===null){var a=Ll=[];Zm=0,ns=cv(),Yi={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Zm++,e.then(n_,n_),e}function n_(){if(--Zm===0&&Ll!==null){Yi!==null&&(Yi.status="fulfilled");var t=Ll;Ll=null,ns=0,Yi=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function EM(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 o_=ae.S;ae.S=function(t,e){lL=ma(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&AM(t,e),o_!==null&&o_(t,e)};var Oo=xr(null);function Ug(){var t=Oo.current;return t!==null?t:Oe.pooledCache}function xd(t,e){e===null?Ne(Oo,Oo.current):Ne(Oo,e.pool)}function XC(){var t=Ug();return t===null?null:{parent:ft._currentValue,pool:t}}var ms=Error(O(460)),zg=Error(O(474)),df=Error(O(542)),Fd={then:function(){}};function i_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function KC(t,e,a){switch(a=t[a],a===void 0?t.push(e):a!==e&&(e.then(Hr,Hr),e=a),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,l_(t),t;default:if(typeof e.status=="string")e.then(Hr,Hr);else{if(t=Oe,t!==null&&100<t.shellSuspendCounter)throw Error(O(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,l_(t),t}throw Do=e,ms}}function Eo(t){try{var e=t._init;return e(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Do=a,ms):a}}var Do=null;function s_(){if(Do===null)throw Error(O(459));var t=Do;return Do=null,t}function l_(t){if(t===ms||t===df)throw Error(O(483))}var Qi=null,zl=0;function od(t){var e=zl;return zl+=1,Qi===null&&(Qi=[]),KC(Qi,t,e)}function fl(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function id(t,e){throw e.$$typeof===m2?Error(O(525)):(t=Object.prototype.toString.call(e),Error(O(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function YC(t){function e(g,m){if(t){var y=g.deletions;y===null?(g.deletions=[m],g.flags|=16):y.push(m)}}function a(g,m){if(!t)return null;for(;m!==null;)e(g,m),m=m.sibling;return null}function r(g){for(var m=new Map;g!==null;)g.key!==null?m.set(g.key,g):m.set(g.index,g),g=g.sibling;return m}function n(g,m){return g=zr(g,m),g.index=0,g.sibling=null,g}function o(g,m,y){return g.index=y,t?(y=g.alternate,y!==null?(y=y.index,y<m?(g.flags|=67108866,m):y):(g.flags|=67108866,m)):(g.flags|=1048576,m)}function i(g){return t&&g.alternate===null&&(g.flags|=67108866),g}function s(g,m,y,v){return m===null||m.tag!==6?(m=om(y,g.mode,v),m.return=g,m):(m=n(m,y),m.return=g,m)}function l(g,m,y,v){var C=y.type;return C===Pi?c(g,m,y.props.children,v,y.key):m!==null&&(m.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===kn&&Eo(C)===m.type)?(m=n(m,y.props),fl(m,y),m.return=g,m):(m=yd(y.type,y.key,y.props,null,g.mode,v),fl(m,y),m.return=g,m)}function u(g,m,y,v){return m===null||m.tag!==4||m.stateNode.containerInfo!==y.containerInfo||m.stateNode.implementation!==y.implementation?(m=im(y,g.mode,v),m.return=g,m):(m=n(m,y.children||[]),m.return=g,m)}function c(g,m,y,v,C){return m===null||m.tag!==7?(m=Mo(y,g.mode,v,C),m.return=g,m):(m=n(m,y),m.return=g,m)}function d(g,m,y){if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return m=om(""+m,g.mode,y),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Kc:return y=yd(m.type,m.key,m.props,null,g.mode,y),fl(y,m),y.return=g,y;case vl:return m=im(m,g.mode,y),m.return=g,m;case kn:return m=Eo(m),d(g,m,y)}if(yl(m)||cl(m))return m=Mo(m,g.mode,y,null),m.return=g,m;if(typeof m.then=="function")return d(g,od(m),y);if(m.$$typeof===Fr)return d(g,nd(g,m),y);id(g,m)}return null}function f(g,m,y,v){var C=m!==null?m.key:null;if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return C!==null?null:s(g,m,""+y,v);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Kc:return y.key===C?l(g,m,y,v):null;case vl:return y.key===C?u(g,m,y,v):null;case kn:return y=Eo(y),f(g,m,y,v)}if(yl(y)||cl(y))return C!==null?null:c(g,m,y,v,null);if(typeof y.then=="function")return f(g,m,od(y),v);if(y.$$typeof===Fr)return f(g,m,nd(g,y),v);id(g,y)}return null}function h(g,m,y,v,C){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return g=g.get(y)||null,s(m,g,""+v,C);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Kc:return g=g.get(v.key===null?y:v.key)||null,l(m,g,v,C);case vl:return g=g.get(v.key===null?y:v.key)||null,u(m,g,v,C);case kn:return v=Eo(v),h(g,m,y,v,C)}if(yl(v)||cl(v))return g=g.get(y)||null,c(m,g,v,C,null);if(typeof v.then=="function")return h(g,m,y,od(v),C);if(v.$$typeof===Fr)return h(g,m,y,nd(m,v),C);id(m,v)}return null}function S(g,m,y,v){for(var C=null,w=null,_=m,L=m=0,I=null;_!==null&&L<y.length;L++){_.index>L?(I=_,_=null):I=_.sibling;var A=f(g,_,y[L],v);if(A===null){_===null&&(_=I);break}t&&_&&A.alternate===null&&e(g,_),m=o(A,m,L),w===null?C=A:w.sibling=A,w=A,_=I}if(L===y.length)return a(g,_),ve&&Pr(g,L),C;if(_===null){for(;L<y.length;L++)_=d(g,y[L],v),_!==null&&(m=o(_,m,L),w===null?C=_:w.sibling=_,w=_);return ve&&Pr(g,L),C}for(_=r(_);L<y.length;L++)I=h(_,g,L,y[L],v),I!==null&&(t&&I.alternate!==null&&_.delete(I.key===null?L:I.key),m=o(I,m,L),w===null?C=I:w.sibling=I,w=I);return t&&_.forEach(function(T){return e(g,T)}),ve&&Pr(g,L),C}function x(g,m,y,v){if(y==null)throw Error(O(151));for(var C=null,w=null,_=m,L=m=0,I=null,A=y.next();_!==null&&!A.done;L++,A=y.next()){_.index>L?(I=_,_=null):I=_.sibling;var T=f(g,_,A.value,v);if(T===null){_===null&&(_=I);break}t&&_&&T.alternate===null&&e(g,_),m=o(T,m,L),w===null?C=T:w.sibling=T,w=T,_=I}if(A.done)return a(g,_),ve&&Pr(g,L),C;if(_===null){for(;!A.done;L++,A=y.next())A=d(g,A.value,v),A!==null&&(m=o(A,m,L),w===null?C=A:w.sibling=A,w=A);return ve&&Pr(g,L),C}for(_=r(_);!A.done;L++,A=y.next())A=h(_,g,L,A.value,v),A!==null&&(t&&A.alternate!==null&&_.delete(A.key===null?L:A.key),m=o(A,m,L),w===null?C=A:w.sibling=A,w=A);return t&&_.forEach(function(N){return e(g,N)}),ve&&Pr(g,L),C}function b(g,m,y,v){if(typeof y=="object"&&y!==null&&y.type===Pi&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Kc:e:{for(var C=y.key;m!==null;){if(m.key===C){if(C=y.type,C===Pi){if(m.tag===7){a(g,m.sibling),v=n(m,y.props.children),v.return=g,g=v;break e}}else if(m.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===kn&&Eo(C)===m.type){a(g,m.sibling),v=n(m,y.props),fl(v,y),v.return=g,g=v;break e}a(g,m);break}else e(g,m);m=m.sibling}y.type===Pi?(v=Mo(y.props.children,g.mode,v,y.key),v.return=g,g=v):(v=yd(y.type,y.key,y.props,null,g.mode,v),fl(v,y),v.return=g,g=v)}return i(g);case vl:e:{for(C=y.key;m!==null;){if(m.key===C)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){a(g,m.sibling),v=n(m,y.children||[]),v.return=g,g=v;break e}else{a(g,m);break}else e(g,m);m=m.sibling}v=im(y,g.mode,v),v.return=g,g=v}return i(g);case kn:return y=Eo(y),b(g,m,y,v)}if(yl(y))return S(g,m,y,v);if(cl(y)){if(C=cl(y),typeof C!="function")throw Error(O(150));return y=C.call(y),x(g,m,y,v)}if(typeof y.then=="function")return b(g,m,od(y),v);if(y.$$typeof===Fr)return b(g,m,nd(g,y),v);id(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,m!==null&&m.tag===6?(a(g,m.sibling),v=n(m,y),v.return=g,g=v):(a(g,m),v=om(y,g.mode,v),v.return=g,g=v),i(g)):a(g,m)}return function(g,m,y,v){try{zl=0;var C=b(g,m,y,v);return Qi=null,C}catch(_){if(_===ms||_===df)throw _;var w=pa(29,_,null,g.mode);return w.lanes=v,w.return=g,w}}}var Fo=YC(!0),QC=YC(!1),In=!1;function qg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xm(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 Hn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Un(t,e,a){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(Se&2)!==0){var n=r.pending;return n===null?e.next=e:(e.next=n.next,n.next=e),r.pending=e,e=Bd(t),VC(t,null,a),e}return cf(t,r,e,a),Bd(t)}function kl(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,gC(t,a)}}function lm(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 Km=!1;function Il(){if(Km){var t=Yi;if(t!==null)throw t}}function Al(t,e,a,r){Km=!1;var n=t.updateQueue;In=!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 f=s.lane&-536870913,h=f!==s.lane;if(h?(me&f)===f:(r&f)===f){f!==0&&f===ns&&(Km=!0),c!==null&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var S=t,x=s;f=e;var b=a;switch(x.tag){case 1:if(S=x.payload,typeof S=="function"){d=S.call(b,d,f);break e}d=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=x.payload,f=typeof S=="function"?S.call(b,d,f):S,f==null)break e;d=Ve({},d,f);break e;case 2:In=!0}}f=s.callback,f!==null&&(t.flags|=64,h&&(t.flags|=8192),h=n.callbacks,h===null?n.callbacks=[f]:h.push(f))}else h={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,i|=f;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;h=s,s=h.next,h.next=null,n.lastBaseUpdate=h,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),Xn|=i,t.lanes=i,t.memoizedState=d}}function JC(t,e){if(typeof t!="function")throw Error(O(191,t));t.call(e)}function ew(t,e){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)JC(a[t],e)}var os=xr(null),Hd=xr(0);function u_(t,e){t=Zr,Ne(Hd,t),Ne(os,e),Zr=t|e.baseLanes}function Ym(){Ne(Hd,Zr),Ne(os,os.current)}function Vg(){Zr=Hd.current,Ct(os),Ct(Hd)}var ba=xr(null),Pa=null;function En(t){var e=t.alternate;Ne(ot,ot.current&1),Ne(ba,t),Pa===null&&(e===null||os.current!==null||e.memoizedState!==null)&&(Pa=t)}function Qm(t){Ne(ot,ot.current),Ne(ba,t),Pa===null&&(Pa=t)}function tw(t){t.tag===22?(Ne(ot,ot.current),Ne(ba,t),Pa===null&&(Pa=t)):Tn(t)}function Tn(){Ne(ot,ot.current),Ne(ba,ba.current)}function fa(t){Ct(ba),Pa===t&&(Pa=null),Ct(ot)}var ot=xr(0);function Ud(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||vg(a)||yg(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 jr=0,ie=null,Ae=null,ct=null,zd=!1,Ji=!1,Ho=!1,qd=0,ql=0,es=null,TM=0;function at(){throw Error(O(321))}function $g(t,e){if(e===null)return!1;for(var a=0;a<e.length&&a<t.length;a++)if(!xa(t[a],e[a]))return!1;return!0}function jg(t,e,a,r,n,o){return jr=o,ie=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ae.H=t===null||t.memoizedState===null?Mw:av,Ho=!1,o=a(r,n),Ho=!1,Ji&&(o=rw(e,a,r,n)),aw(t),o}function aw(t){ae.H=Vl;var e=Ae!==null&&Ae.next!==null;if(jr=0,ct=Ae=ie=null,zd=!1,ql=0,es=null,e)throw Error(O(300));t===null||pt||(t=t.dependencies,t!==null&&Nd(t)&&(pt=!0))}function rw(t,e,a,r){ie=t;var n=0;do{if(Ji&&(es=null),ql=0,Ji=!1,25<=n)throw Error(O(301));if(n+=1,ct=Ae=null,t.updateQueue!=null){var o=t.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ae.H=Ow,o=e(a,r)}while(Ji);return o}function RM(){var t=ae.H,e=t.useState()[0];return e=typeof e.then=="function"?au(e):e,t=t.useState()[0],(Ae!==null?Ae.memoizedState:null)!==t&&(ie.flags|=1024),e}function Gg(){var t=qd!==0;return qd=0,t}function Wg(t,e,a){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a}function Zg(t){if(zd){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}zd=!1}jr=0,ct=Ae=ie=null,Ji=!1,ql=qd=0,es=null}function jt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?ie.memoizedState=ct=t:ct=ct.next=t,ct}function it(){if(Ae===null){var t=ie.alternate;t=t!==null?t.memoizedState:null}else t=Ae.next;var e=ct===null?ie.memoizedState:ct.next;if(e!==null)ct=e,Ae=t;else{if(t===null)throw ie.alternate===null?Error(O(467)):Error(O(310));Ae=t,t={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},ct===null?ie.memoizedState=ct=t:ct=ct.next=t}return ct}function ff(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function au(t){var e=ql;return ql+=1,es===null&&(es=[]),t=KC(es,t,e),e=ie,(ct===null?e.memoizedState:ct.next)===null&&(e=e.alternate,ae.H=e===null||e.memoizedState===null?Mw:av),t}function pf(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return au(t);if(t.$$typeof===Fr)return Et(t)}throw Error(O(438,String(t)))}function Xg(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=ff(),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]=g2;return e.index++,a}function Gr(t,e){return typeof e=="function"?e(t):e}function bd(t){var e=it();return Kg(e,Ae,t)}function Kg(t,e,a){var r=t.queue;if(r===null)throw Error(O(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?(me&d)===d:(jr&d)===d){var f=u.revertLane;if(f===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===ns&&(c=!0);else if((jr&f)===f){u=u.next,f===ns&&(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|=f,Xn|=f;d=u.action,Ho&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else f={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=f,i=o):l=l.next=f,ie.lanes|=d,Xn|=d;u=u.next}while(u!==null&&u!==e);if(l===null?i=o:l.next=s,!xa(o,t.memoizedState)&&(pt=!0,c&&(a=Yi,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 um(t){var e=it(),a=e.queue;if(a===null)throw Error(O(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);xa(o,e.memoizedState)||(pt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),a.lastRenderedState=o}return[o,r]}function nw(t,e,a){var r=ie,n=it(),o=ve;if(o){if(a===void 0)throw Error(O(407));a=a()}else a=e();var i=!xa((Ae||n).memoizedState,a);if(i&&(n.memoizedState=a,pt=!0),n=n.queue,Yg(sw.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||ct!==null&&ct.memoizedState.tag&1){if(r.flags|=2048,is(9,{destroy:void 0},iw.bind(null,r,n,a,e),null),Oe===null)throw Error(O(349));o||(jr&127)!==0||ow(r,e,a)}return a}function ow(t,e,a){t.flags|=16384,t={getSnapshot:e,value:a},e=ie.updateQueue,e===null?(e=ff(),ie.updateQueue=e,e.stores=[t]):(a=e.stores,a===null?e.stores=[t]:a.push(t))}function iw(t,e,a,r){e.value=a,e.getSnapshot=r,lw(e)&&uw(t)}function sw(t,e,a){return a(function(){lw(e)&&uw(t)})}function lw(t){var e=t.getSnapshot;t=t.value;try{var a=e();return!xa(t,a)}catch{return!0}}function uw(t){var e=$o(t,2);e!==null&&ta(e,t,2)}function Jm(t){var e=jt();if(typeof t=="function"){var a=t;if(t=a(),Ho){Mn(!0);try{a()}finally{Mn(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gr,lastRenderedState:t},e}function cw(t,e,a,r){return t.baseState=a,Kg(t,Ae,typeof r=="function"?r:Gr)}function MM(t,e,a,r,n){if(mf(t))throw Error(O(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)}};ae.T!==null?a(!0):o.isTransition=!1,r(o),a=e.pending,a===null?(o.next=e.pending=o,dw(e,o)):(o.next=a.next,e.pending=a.next=o)}}function dw(t,e){var a=e.action,r=e.payload,n=t.state;if(e.isTransition){var o=ae.T,i={};ae.T=i;try{var s=a(n,r),l=ae.S;l!==null&&l(i,s),c_(t,e,s)}catch(u){eg(t,e,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),ae.T=o}}else try{o=a(n,r),c_(t,e,o)}catch(u){eg(t,e,u)}}function c_(t,e,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){d_(t,e,r)},function(r){return eg(t,e,r)}):d_(t,e,a)}function d_(t,e,a){e.status="fulfilled",e.value=a,fw(e),t.state=a,e=t.pending,e!==null&&(a=e.next,a===e?t.pending=null:(a=a.next,e.next=a,dw(t,a)))}function eg(t,e,a){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do e.status="rejected",e.reason=a,fw(e),e=e.next;while(e!==r)}t.action=null}function fw(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function pw(t,e){return e}function f_(t,e){if(ve){var a=Oe.formState;if(a!==null){e:{var r=ie;if(ve){if(qe){t:{for(var n=qe,o=Ba;n.nodeType!==8;){if(!o){n=null;break t}if(n=Na(n.nextSibling),n===null){n=null;break t}}o=n.data,n=o==="F!"||o==="F"?n:null}if(n){qe=Na(n.nextSibling),r=n.data==="F!";break e}}Wn(r)}r=!1}r&&(e=a[0])}}return a=jt(),a.memoizedState=a.baseState=e,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pw,lastRenderedState:e},a.queue=r,a=Ew.bind(null,ie,r),r.dispatch=a,r=Jm(!1),o=tv.bind(null,ie,!1,r.queue),r=jt(),n={state:e,dispatch:null,action:t,pending:null},r.queue=n,a=MM.bind(null,ie,n,o,a),n.dispatch=a,r.memoizedState=t,[e,a,!1]}function p_(t){var e=it();return hw(e,Ae,t)}function hw(t,e,a){if(e=Kg(t,e,pw)[0],t=bd(Gr)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var r=au(e)}catch(i){throw i===ms?df:i}else r=e;e=it();var n=e.queue,o=n.dispatch;return a!==e.memoizedState&&(ie.flags|=2048,is(9,{destroy:void 0},OM.bind(null,n,a),null)),[r,o,t]}function OM(t,e){t.action=e}function h_(t){var e=it(),a=Ae;if(a!==null)return hw(e,a,t);it(),e=e.memoizedState,a=it();var r=a.queue.dispatch;return a.memoizedState=t,[e,r,!1]}function is(t,e,a,r){return t={tag:t,create:a,deps:r,inst:e,next:null},e=ie.updateQueue,e===null&&(e=ff(),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 mw(){return it().memoizedState}function Sd(t,e,a,r){var n=jt();ie.flags|=t,n.memoizedState=is(1|e,{destroy:void 0},a,r===void 0?null:r)}function hf(t,e,a,r){var n=it();r=r===void 0?null:r;var o=n.memoizedState.inst;Ae!==null&&r!==null&&$g(r,Ae.memoizedState.deps)?n.memoizedState=is(e,o,a,r):(ie.flags|=t,n.memoizedState=is(1|e,o,a,r))}function m_(t,e){Sd(8390656,8,t,e)}function Yg(t,e){hf(2048,8,t,e)}function DM(t){ie.flags|=4;var e=ie.updateQueue;if(e===null)e=ff(),ie.updateQueue=e,e.events=[t];else{var a=e.events;a===null?e.events=[t]:a.push(t)}}function gw(t){var e=it().memoizedState;return DM({ref:e,nextImpl:t}),function(){if((Se&2)!==0)throw Error(O(440));return e.impl.apply(void 0,arguments)}}function vw(t,e){return hf(4,2,t,e)}function yw(t,e){return hf(4,4,t,e)}function xw(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 bw(t,e,a){a=a!=null?a.concat([t]):null,hf(4,4,xw.bind(null,e,t),a)}function Qg(){}function Sw(t,e){var a=it();e=e===void 0?null:e;var r=a.memoizedState;return e!==null&&$g(e,r[1])?r[0]:(a.memoizedState=[t,e],t)}function _w(t,e){var a=it();e=e===void 0?null:e;var r=a.memoizedState;if(e!==null&&$g(e,r[1]))return r[0];if(r=t(),Ho){Mn(!0);try{t()}finally{Mn(!1)}}return a.memoizedState=[r,e],r}function Jg(t,e,a){return a===void 0||(jr&1073741824)!==0&&(me&261930)===0?t.memoizedState=e:(t.memoizedState=a,t=cL(),ie.lanes|=t,Xn|=t,a)}function Cw(t,e,a,r){return xa(a,e)?a:os.current!==null?(t=Jg(t,a,r),xa(t,e)||(pt=!0),t):(jr&42)===0||(jr&1073741824)!==0&&(me&261930)===0?(pt=!0,t.memoizedState=a):(t=cL(),ie.lanes|=t,Xn|=t,e)}function ww(t,e,a,r,n){var o=_e.p;_e.p=o!==0&&8>o?o:8;var i=ae.T,s={};ae.T=s,tv(t,!1,e,a);try{var l=n(),u=ae.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=EM(l,r);El(t,e,c,ya(t))}else El(t,e,r,ya(t))}catch(d){El(t,e,{then:function(){},status:"rejected",reason:d},ya())}finally{_e.p=o,i!==null&&s.types!==null&&(i.types=s.types),ae.T=i}}function BM(){}function tg(t,e,a,r){if(t.tag!==5)throw Error(O(476));var n=Lw(t).queue;ww(t,n,e,Ro,a===null?BM:function(){return kw(t),a(r)})}function Lw(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Ro,baseState:Ro,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gr,lastRenderedState:Ro},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gr,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function kw(t){var e=Lw(t);e.next===null&&(e=t.alternate.memoizedState),El(t,e.next.queue,{},ya())}function ev(){return Et(Gl)}function Iw(){return it().memoizedState}function Aw(){return it().memoizedState}function PM(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=ya();t=Hn(a);var r=Un(e,t,a);r!==null&&(ta(r,e,a),kl(r,e,a)),e={cache:Hg()},t.payload=e;return}e=e.return}}function NM(t,e,a){var r=ya();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},mf(t)?Tw(e,a):(a=Bg(t,e,a,r),a!==null&&(ta(a,t,r),Rw(a,e,r)))}function Ew(t,e,a){var r=ya();El(t,e,a,r)}function El(t,e,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(mf(t))Tw(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,xa(s,i))return cf(t,e,n,0),Oe===null&&uf(),!1}catch{}if(a=Bg(t,e,n,r),a!==null)return ta(a,t,r),Rw(a,e,r),!0}return!1}function tv(t,e,a,r){if(r={lane:2,revertLane:cv(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},mf(t)){if(e)throw Error(O(479))}else e=Bg(t,a,r,2),e!==null&&ta(e,t,2)}function mf(t){var e=t.alternate;return t===ie||e!==null&&e===ie}function Tw(t,e){Ji=zd=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function Rw(t,e,a){if((a&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,a|=r,e.lanes=a,gC(t,a)}}var Vl={readContext:Et,use:pf,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};Vl.useEffectEvent=at;var Mw={readContext:Et,use:pf,useCallback:function(t,e){return jt().memoizedState=[t,e===void 0?null:e],t},useContext:Et,useEffect:m_,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,Sd(4194308,4,xw.bind(null,e,t),a)},useLayoutEffect:function(t,e){return Sd(4194308,4,t,e)},useInsertionEffect:function(t,e){Sd(4,2,t,e)},useMemo:function(t,e){var a=jt();e=e===void 0?null:e;var r=t();if(Ho){Mn(!0);try{t()}finally{Mn(!1)}}return a.memoizedState=[r,e],r},useReducer:function(t,e,a){var r=jt();if(a!==void 0){var n=a(e);if(Ho){Mn(!0);try{a(e)}finally{Mn(!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=NM.bind(null,ie,t),[r.memoizedState,t]},useRef:function(t){var e=jt();return t={current:t},e.memoizedState=t},useState:function(t){t=Jm(t);var e=t.queue,a=Ew.bind(null,ie,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:Qg,useDeferredValue:function(t,e){var a=jt();return Jg(a,t,e)},useTransition:function(){var t=Jm(!1);return t=ww.bind(null,ie,t.queue,!0,!1),jt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var r=ie,n=jt();if(ve){if(a===void 0)throw Error(O(407));a=a()}else{if(a=e(),Oe===null)throw Error(O(349));(me&127)!==0||ow(r,e,a)}n.memoizedState=a;var o={value:a,getSnapshot:e};return n.queue=o,m_(sw.bind(null,r,o,t),[t]),r.flags|=2048,is(9,{destroy:void 0},iw.bind(null,r,o,a,e),null),a},useId:function(){var t=jt(),e=Oe.identifierPrefix;if(ve){var a=gr,r=mr;a=(r&~(1<<32-va(r)-1)).toString(32)+a,e="_"+e+"R_"+a,a=qd++,0<a&&(e+="H"+a.toString(32)),e+="_"}else a=TM++,e="_"+e+"r_"+a.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:ev,useFormState:f_,useActionState:f_,useOptimistic:function(t){var e=jt();e.memoizedState=e.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=a,e=tv.bind(null,ie,!0,a),a.dispatch=e,[t,e]},useMemoCache:Xg,useCacheRefresh:function(){return jt().memoizedState=PM.bind(null,ie)},useEffectEvent:function(t){var e=jt(),a={impl:t};return e.memoizedState=a,function(){if((Se&2)!==0)throw Error(O(440));return a.impl.apply(void 0,arguments)}}},av={readContext:Et,use:pf,useCallback:Sw,useContext:Et,useEffect:Yg,useImperativeHandle:bw,useInsertionEffect:vw,useLayoutEffect:yw,useMemo:_w,useReducer:bd,useRef:mw,useState:function(){return bd(Gr)},useDebugValue:Qg,useDeferredValue:function(t,e){var a=it();return Cw(a,Ae.memoizedState,t,e)},useTransition:function(){var t=bd(Gr)[0],e=it().memoizedState;return[typeof t=="boolean"?t:au(t),e]},useSyncExternalStore:nw,useId:Iw,useHostTransitionStatus:ev,useFormState:p_,useActionState:p_,useOptimistic:function(t,e){var a=it();return cw(a,Ae,t,e)},useMemoCache:Xg,useCacheRefresh:Aw};av.useEffectEvent=gw;var Ow={readContext:Et,use:pf,useCallback:Sw,useContext:Et,useEffect:Yg,useImperativeHandle:bw,useInsertionEffect:vw,useLayoutEffect:yw,useMemo:_w,useReducer:um,useRef:mw,useState:function(){return um(Gr)},useDebugValue:Qg,useDeferredValue:function(t,e){var a=it();return Ae===null?Jg(a,t,e):Cw(a,Ae.memoizedState,t,e)},useTransition:function(){var t=um(Gr)[0],e=it().memoizedState;return[typeof t=="boolean"?t:au(t),e]},useSyncExternalStore:nw,useId:Iw,useHostTransitionStatus:ev,useFormState:h_,useActionState:h_,useOptimistic:function(t,e){var a=it();return Ae!==null?cw(a,Ae,t,e):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Xg,useCacheRefresh:Aw};Ow.useEffectEvent=gw;function cm(t,e,a,r){e=t.memoizedState,a=a(r,e),a=a==null?e:Ve({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var ag={enqueueSetState:function(t,e,a){t=t._reactInternals;var r=ya(),n=Hn(r);n.payload=e,a!=null&&(n.callback=a),e=Un(t,n,r),e!==null&&(ta(e,t,r),kl(e,t,r))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var r=ya(),n=Hn(r);n.tag=1,n.payload=e,a!=null&&(n.callback=a),e=Un(t,n,r),e!==null&&(ta(e,t,r),kl(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=ya(),r=Hn(a);r.tag=2,e!=null&&(r.callback=e),e=Un(t,r,a),e!==null&&(ta(e,t,a),kl(e,t,a))}};function g_(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?!Fl(a,r)||!Fl(n,o):!0}function v_(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&&ag.enqueueReplaceState(e,e.state,null)}function Uo(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=Ve({},a));for(var n in t)a[n]===void 0&&(a[n]=t[n])}return a}function Dw(t){Dd(t)}function Bw(t){console.error(t)}function Pw(t){Dd(t)}function Vd(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function y_(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 rg(t,e,a){return a=Hn(a),a.tag=3,a.payload={element:null},a.callback=function(){Vd(t,e)},a}function Nw(t){return t=Hn(t),t.tag=3,t}function Fw(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(){y_(e,a,r)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(t.callback=function(){y_(e,a,r),typeof n!="function"&&(zn===null?zn=new Set([this]):zn.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function FM(t,e,a,r,n){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(e=a.alternate,e!==null&&hs(e,a,n,!0),a=ba.current,a!==null){switch(a.tag){case 31:case 13:return Pa===null?Zd():a.alternate===null&&rt===0&&(rt=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===Fd?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([r]):e.add(r),Sm(t,r,n)),!1;case 22:return a.flags|=65536,r===Fd?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)),Sm(t,r,n)),!1}throw Error(O(435,a.tag))}return Sm(t,r,n),Zd(),!1}if(ve)return e=ba.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=n,r!==$m&&(t=Error(O(422),{cause:r}),Ul(Da(t,a)))):(r!==$m&&(e=Error(O(423),{cause:r}),Ul(Da(e,a))),t=t.current.alternate,t.flags|=65536,n&=-n,t.lanes|=n,r=Da(r,a),n=rg(t.stateNode,r,n),lm(t,n),rt!==4&&(rt=2)),!1;var o=Error(O(520),{cause:r});if(o=Da(o,a),Ml===null?Ml=[o]:Ml.push(o),rt!==4&&(rt=2),e===null)return!0;r=Da(r,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=n&-n,a.lanes|=t,t=rg(a.stateNode,r,t),lm(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"&&(zn===null||!zn.has(o))))return a.flags|=65536,n&=-n,a.lanes|=n,n=Nw(n),Fw(n,t,a,r),lm(a,n),!1}a=a.return}while(a!==null);return!1}var rv=Error(O(461)),pt=!1;function kt(t,e,a,r){e.child=t===null?QC(e,null,a,r):Fo(e,t.child,a,r)}function x_(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 No(e),r=jg(t,e,a,i,o,n),s=Gg(),t!==null&&!pt?(Wg(t,e,n),Wr(t,e,n)):(ve&&s&&Ng(e),e.flags|=1,kt(t,e,r,n),e.child)}function b_(t,e,a,r,n){if(t===null){var o=a.type;return typeof o=="function"&&!Pg(o)&&o.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=o,Hw(t,e,o,r,n)):(t=yd(a.type,null,r,e,e.mode,n),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!nv(t,n)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:Fl,a(i,r)&&t.ref===e.ref)return Wr(t,e,n)}return e.flags|=1,t=zr(o,r),t.ref=e.ref,t.return=e,e.child=t}function Hw(t,e,a,r,n){if(t!==null){var o=t.memoizedProps;if(Fl(o,r)&&t.ref===e.ref)if(pt=!1,e.pendingProps=r=o,nv(t,n))(t.flags&131072)!==0&&(pt=!0);else return e.lanes=t.lanes,Wr(t,e,n)}return ng(t,e,a,r,n)}function Uw(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 S_(t,e,o,a,r)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&xd(e,o!==null?o.cachePool:null),o!==null?u_(e,o):Ym(),tw(e);else return r=e.lanes=536870912,S_(t,e,o!==null?o.baseLanes|a:a,a,r)}else o!==null?(xd(e,o.cachePool),u_(e,o),Tn(e),e.memoizedState=null):(t!==null&&xd(e,null),Ym(),Tn(e));return kt(t,e,n,a),e.child}function bl(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function S_(t,e,a,r,n){var o=Ug();return o=o===null?null:{parent:ft._currentValue,pool:o},e.memoizedState={baseLanes:a,cachePool:o},t!==null&&xd(e,null),Ym(),tw(e),t!==null&&hs(t,e,r,!0),e.childLanes=n,null}function _d(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 __(t,e,a){return Fo(e,t.child,null,a),t=_d(e,e.pendingProps),t.flags|=2,fa(e),e.memoizedState=null,t}function HM(t,e,a){var r=e.pendingProps,n=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(ve){if(r.mode==="hidden")return t=_d(e,r),e.lanes=536870912,bl(null,t);if(Qm(e),(t=qe)?(t=ML(t,Ba),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Gn!==null?{id:mr,overflow:gr}:null,retryLane:536870912,hydrationErrors:null},a=jC(t),a.return=e,e.child=a,At=e,qe=null)):t=null,t===null)throw Wn(e);return e.lanes=536870912,null}return _d(e,r)}var o=t.memoizedState;if(o!==null){var i=o.dehydrated;if(Qm(e),n)if(e.flags&256)e.flags&=-257,e=__(t,e,a);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(O(558));else if(pt||hs(t,e,a,!1),n=(a&t.childLanes)!==0,pt||n){if(r=Oe,r!==null&&(i=vC(r,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,$o(t,i),ta(r,t,i),rv;Zd(),e=__(t,e,a)}else t=o.treeContext,qe=Na(i.nextSibling),At=e,ve=!0,Fn=null,Ba=!1,t!==null&&WC(e,t),e=_d(e,r),e.flags|=4096;return e}return t=zr(t.child,{mode:r.mode,children:r.children}),t.ref=e.ref,e.child=t,t.return=e,t}function Cd(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(O(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function ng(t,e,a,r,n){return No(e),a=jg(t,e,a,r,void 0,n),r=Gg(),t!==null&&!pt?(Wg(t,e,n),Wr(t,e,n)):(ve&&r&&Ng(e),e.flags|=1,kt(t,e,a,n),e.child)}function C_(t,e,a,r,n,o){return No(e),e.updateQueue=null,a=rw(e,r,a,n),aw(t),r=Gg(),t!==null&&!pt?(Wg(t,e,o),Wr(t,e,o)):(ve&&r&&Ng(e),e.flags|=1,kt(t,e,a,o),e.child)}function w_(t,e,a,r,n){if(No(e),e.stateNode===null){var o=$i,i=a.contextType;typeof i=="object"&&i!==null&&(o=Et(i)),o=new a(r,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=ag,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=r,o.state=e.memoizedState,o.refs={},qg(e),i=a.contextType,o.context=typeof i=="object"&&i!==null?Et(i):$i,o.state=e.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(cm(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&&ag.enqueueReplaceState(o,o.state,null),Al(e,r,o,n),Il(),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=Uo(a,s);o.props=l;var u=o.context,c=a.contextType;i=$i,typeof c=="object"&&c!==null&&(i=Et(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)&&v_(e,o,r,i),In=!1;var f=e.memoizedState;o.state=f,Al(e,r,o,n),Il(),u=e.memoizedState,s||f!==u||In?(typeof d=="function"&&(cm(e,a,d,r),u=e.memoizedState),(l=In||g_(e,a,l,r,f,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,Xm(t,e),i=e.memoizedProps,c=Uo(a,i),o.props=c,d=e.pendingProps,f=o.context,u=a.contextType,l=$i,typeof u=="object"&&u!==null&&(l=Et(u)),s=a.getDerivedStateFromProps,(u=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||f!==l)&&v_(e,o,r,l),In=!1,f=e.memoizedState,o.state=f,Al(e,r,o,n),Il();var h=e.memoizedState;i!==d||f!==h||In||t!==null&&t.dependencies!==null&&Nd(t.dependencies)?(typeof s=="function"&&(cm(e,a,s,r),h=e.memoizedState),(c=In||g_(e,a,c,r,f,h,l)||t!==null&&t.dependencies!==null&&Nd(t.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,h,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,h,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=h),o.props=r,o.state=h,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return o=r,Cd(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=Fo(e,t.child,null,n),e.child=Fo(e,null,a,n)):kt(t,e,a,n),e.memoizedState=o.state,t=e.child):t=Wr(t,e,n),t}function L_(t,e,a,r){return Po(),e.flags|=256,kt(t,e,a,r),e.child}var dm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fm(t){return{baseLanes:t,cachePool:XC()}}function pm(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=ha),t}function zw(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:(ot.current&2)!==0),i&&(n=!0,e.flags&=-129),i=(e.flags&32)!==0,e.flags&=-33,t===null){if(ve){if(n?En(e):Tn(e),(t=qe)?(t=ML(t,Ba),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Gn!==null?{id:mr,overflow:gr}:null,retryLane:536870912,hydrationErrors:null},a=jC(t),a.return=e,e.child=a,At=e,qe=null)):t=null,t===null)throw Wn(e);return yg(t)?e.lanes=32:e.lanes=536870912,null}var s=r.children;return r=r.fallback,n?(Tn(e),n=e.mode,s=$d({mode:"hidden",children:s},n),r=Mo(r,n,a,null),s.return=e,r.return=e,s.sibling=r,e.child=s,r=e.child,r.memoizedState=fm(a),r.childLanes=pm(t,i,a),e.memoizedState=dm,bl(null,r)):(En(e),og(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(En(e),e.flags&=-257,e=hm(t,e,a)):e.memoizedState!==null?(Tn(e),e.child=t.child,e.flags|=128,e=null):(Tn(e),s=r.fallback,n=e.mode,r=$d({mode:"visible",children:r.children},n),s=Mo(s,n,a,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,Fo(e,t.child,null,a),r=e.child,r.memoizedState=fm(a),r.childLanes=pm(t,i,a),e.memoizedState=dm,e=bl(null,r));else if(En(e),yg(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var u=i.dgst;i=u,r=Error(O(419)),r.stack="",r.digest=i,Ul({value:r,source:null,stack:null}),e=hm(t,e,a)}else if(pt||hs(t,e,a,!1),i=(a&t.childLanes)!==0,pt||i){if(i=Oe,i!==null&&(r=vC(i,a),r!==0&&r!==l.retryLane))throw l.retryLane=r,$o(t,r),ta(i,t,r),rv;vg(s)||Zd(),e=hm(t,e,a)}else vg(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,qe=Na(s.nextSibling),At=e,ve=!0,Fn=null,Ba=!1,t!==null&&WC(e,t),e=og(e,r.children),e.flags|=4096);return e}return n?(Tn(e),s=r.fallback,n=e.mode,l=t.child,u=l.sibling,r=zr(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u!==null?s=zr(u,s):(s=Mo(s,n,a,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,bl(null,r),r=e.child,s=t.child.memoizedState,s===null?s=fm(a):(n=s.cachePool,n!==null?(l=ft._currentValue,n=n.parent!==l?{parent:l,pool:l}:n):n=XC(),s={baseLanes:s.baseLanes|a,cachePool:n}),r.memoizedState=s,r.childLanes=pm(t,i,a),e.memoizedState=dm,bl(t.child,r)):(En(e),a=t.child,t=a.sibling,a=zr(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 og(t,e){return e=$d({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function $d(t,e){return t=pa(22,t,null,e),t.lanes=0,t}function hm(t,e,a){return Fo(e,t.child,null,a),t=og(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function k_(t,e,a){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Gm(t.return,e,a)}function mm(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 qw(t,e,a){var r=e.pendingProps,n=r.revealOrder,o=r.tail;r=r.children;var i=ot.current,s=(i&2)!==0;if(s?(i=i&1|2,e.flags|=128):i&=1,Ne(ot,i),kt(t,e,r,a),r=ve?Hl:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&k_(t,a,e);else if(t.tag===19)k_(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&&Ud(t)===null&&(n=a),a=a.sibling;a=n,a===null?(n=e.child,e.child=null):(n=a.sibling,a.sibling=null),mm(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&&Ud(t)===null){e.child=n;break}t=n.sibling,n.sibling=a,a=n,n=t}mm(e,!0,a,null,o,r);break;case"together":mm(e,!1,null,null,void 0,r);break;default:e.memoizedState=null}return e.child}function Wr(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),Xn|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(hs(t,e,a,!1),(a&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,a=zr(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=zr(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function nv(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&Nd(t)))}function UM(t,e,a){switch(e.tag){case 3:Td(e,e.stateNode.containerInfo),An(e,ft,t.memoizedState.cache),Po();break;case 27:case 5:Om(e);break;case 4:Td(e,e.stateNode.containerInfo);break;case 10:An(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Qm(e),null;break;case 13:var r=e.memoizedState;if(r!==null)return r.dehydrated!==null?(En(e),e.flags|=128,null):(a&e.child.childLanes)!==0?zw(t,e,a):(En(e),t=Wr(t,e,a),t!==null?t.sibling:null);En(e);break;case 19:var n=(t.flags&128)!==0;if(r=(a&e.childLanes)!==0,r||(hs(t,e,a,!1),r=(a&e.childLanes)!==0),n){if(r)return qw(t,e,a);e.flags|=128}if(n=e.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Ne(ot,ot.current),r)break;return null;case 22:return e.lanes=0,Uw(t,e,a,e.pendingProps);case 24:An(e,ft,t.memoizedState.cache)}return Wr(t,e,a)}function Vw(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)pt=!0;else{if(!nv(t,a)&&(e.flags&128)===0)return pt=!1,UM(t,e,a);pt=(t.flags&131072)!==0}else pt=!1,ve&&(e.flags&1048576)!==0&&GC(e,Hl,e.index);switch(e.lanes=0,e.tag){case 16:e:{var r=e.pendingProps;if(t=Eo(e.elementType),e.type=t,typeof t=="function")Pg(t)?(r=Uo(t,r),e.tag=1,e=w_(null,e,t,r,a)):(e.tag=0,e=ng(null,e,t,r,a));else{if(t!=null){var n=t.$$typeof;if(n===_g){e.tag=11,e=x_(null,e,t,r,a);break e}else if(n===Cg){e.tag=14,e=b_(null,e,t,r,a);break e}}throw e=Rm(t)||t,Error(O(306,e,""))}}return e;case 0:return ng(t,e,e.type,e.pendingProps,a);case 1:return r=e.type,n=Uo(r,e.pendingProps),w_(t,e,r,n,a);case 3:e:{if(Td(e,e.stateNode.containerInfo),t===null)throw Error(O(387));r=e.pendingProps;var o=e.memoizedState;n=o.element,Xm(t,e),Al(e,r,null,a);var i=e.memoizedState;if(r=i.cache,An(e,ft,r),r!==o.cache&&Wm(e,[ft],a,!0),Il(),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=L_(t,e,r,a);break e}else if(r!==n){n=Da(Error(O(424)),e),Ul(n),e=L_(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,qe=Na(t.firstChild),At=e,ve=!0,Fn=null,Ba=!0,a=QC(e,null,r,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Po(),r===n){e=Wr(t,e,a);break e}kt(t,e,r,a)}e=e.child}return e;case 26:return Cd(t,e),t===null?(a=Z_(e.type,null,e.pendingProps,null))?e.memoizedState=a:ve||(a=e.type,t=e.pendingProps,r=Qd(Nn.current).createElement(a),r[It]=e,r[aa]=t,Tt(r,a,t),_t(r),e.stateNode=r):e.memoizedState=Z_(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Om(e),t===null&&ve&&(r=e.stateNode=OL(e.type,e.pendingProps,Nn.current),At=e,Ba=!0,n=qe,Yn(e.type)?(xg=n,qe=Na(r.firstChild)):qe=n),kt(t,e,e.pendingProps.children,a),Cd(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&ve&&((n=r=qe)&&(r=hO(r,e.type,e.pendingProps,Ba),r!==null?(e.stateNode=r,At=e,qe=Na(r.firstChild),Ba=!1,n=!0):n=!1),n||Wn(e)),Om(e),n=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,r=o.children,mg(n,o)?r=null:i!==null&&mg(n,i)&&(e.flags|=32),e.memoizedState!==null&&(n=jg(t,e,RM,null,null,a),Gl._currentValue=n),Cd(t,e),kt(t,e,r,a),e.child;case 6:return t===null&&ve&&((t=a=qe)&&(a=mO(a,e.pendingProps,Ba),a!==null?(e.stateNode=a,At=e,qe=null,t=!0):t=!1),t||Wn(e)),null;case 13:return zw(t,e,a);case 4:return Td(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Fo(e,null,r,a):kt(t,e,r,a),e.child;case 11:return x_(t,e,e.type,e.pendingProps,a);case 7:return kt(t,e,e.pendingProps,a),e.child;case 8:return kt(t,e,e.pendingProps.children,a),e.child;case 12:return kt(t,e,e.pendingProps.children,a),e.child;case 10:return r=e.pendingProps,An(e,e.type,r.value),kt(t,e,r.children,a),e.child;case 9:return n=e.type._context,r=e.pendingProps.children,No(e),n=Et(n),r=r(n),e.flags|=1,kt(t,e,r,a),e.child;case 14:return b_(t,e,e.type,e.pendingProps,a);case 15:return Hw(t,e,e.type,e.pendingProps,a);case 19:return qw(t,e,a);case 31:return HM(t,e,a);case 22:return Uw(t,e,a,e.pendingProps);case 24:return No(e),r=Et(ft),t===null?(n=Ug(),n===null&&(n=Oe,o=Hg(),n.pooledCache=o,o.refCount++,o!==null&&(n.pooledCacheLanes|=a),n=o),e.memoizedState={parent:r,cache:n},qg(e),An(e,ft,n)):((t.lanes&a)!==0&&(Xm(t,e),Al(e,null,null,a),Il()),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),An(e,ft,r)):(r=o.cache,An(e,ft,r),r!==n.cache&&Wm(e,[ft],a,!0))),kt(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(O(156,e.tag))}function Mr(t){t.flags|=4}function gm(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(pL())t.flags|=8192;else throw Do=Fd,zg}else t.flags&=-16777217}function I_(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!PL(e))if(pL())t.flags|=8192;else throw Do=Fd,zg}function sd(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?hC():536870912,t.lanes|=e,ss|=e)}function pl(t,e){if(!ve)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 ze(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 zM(t,e,a){var r=e.pendingProps;switch(Fg(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ze(e),null;case 1:return ze(e),null;case 3:return a=e.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),qr(ft),ts(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Mi(e)?Mr(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,sm())),ze(e),null;case 26:var n=e.type,o=e.memoizedState;return t===null?(Mr(e),o!==null?(ze(e),I_(e,o)):(ze(e),gm(e,n,null,r,a))):o?o!==t.memoizedState?(Mr(e),ze(e),I_(e,o)):(ze(e),e.flags&=-16777217):(t=t.memoizedProps,t!==r&&Mr(e),ze(e),gm(e,n,t,r,a)),null;case 27:if(Rd(e),a=Nn.current,n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&Mr(e);else{if(!r){if(e.stateNode===null)throw Error(O(166));return ze(e),null}t=yr.current,Mi(e)?a_(e,t):(t=OL(n,r,a),e.stateNode=t,Mr(e))}return ze(e),null;case 5:if(Rd(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&Mr(e);else{if(!r){if(e.stateNode===null)throw Error(O(166));return ze(e),null}if(o=yr.current,Mi(e))a_(e,o);else{var i=Qd(Nn.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[It]=e,o[aa]=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(Tt(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&&Mr(e)}}return ze(e),gm(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,a),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==r&&Mr(e);else{if(typeof r!="string"&&e.stateNode===null)throw Error(O(166));if(t=Nn.current,Mi(e)){if(t=e.stateNode,a=e.memoizedProps,r=null,n=At,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}t[It]=e,t=!!(t.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||EL(t.nodeValue,a)),t||Wn(e,!0)}else t=Qd(t).createTextNode(r),t[It]=e,e.stateNode=t}return ze(e),null;case 31:if(a=e.memoizedState,t===null||t.memoizedState!==null){if(r=Mi(e),a!==null){if(t===null){if(!r)throw Error(O(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(557));t[It]=e}else Po(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;ze(e),t=!1}else a=sm(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return e.flags&256?(fa(e),e):(fa(e),null);if((e.flags&128)!==0)throw Error(O(558))}return ze(e),null;case 13:if(r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=Mi(e),r!==null&&r.dehydrated!==null){if(t===null){if(!n)throw Error(O(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(O(317));n[It]=e}else Po(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;ze(e),n=!1}else n=sm(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),n=!0;if(!n)return e.flags&256?(fa(e),e):(fa(e),null)}return fa(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),sd(e,e.updateQueue),ze(e),null);case 4:return ts(),t===null&&dv(e.stateNode.containerInfo),ze(e),null;case 10:return qr(e.type),ze(e),null;case 19:if(Ct(ot),r=e.memoizedState,r===null)return ze(e),null;if(n=(e.flags&128)!==0,o=r.rendering,o===null)if(n)pl(r,!1);else{if(rt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=Ud(t),o!==null){for(e.flags|=128,pl(r,!1),t=o.updateQueue,e.updateQueue=t,sd(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)$C(a,t),a=a.sibling;return Ne(ot,ot.current&1|2),ve&&Pr(e,r.treeForkCount),e.child}t=t.sibling}r.tail!==null&&ma()>Gd&&(e.flags|=128,n=!0,pl(r,!1),e.lanes=4194304)}else{if(!n)if(t=Ud(o),t!==null){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,sd(e,t),pl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!ve)return ze(e),null}else 2*ma()-r.renderingStartTime>Gd&&a!==536870912&&(e.flags|=128,n=!0,pl(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=ma(),t.sibling=null,a=ot.current,Ne(ot,n?a&1|2:a&1),ve&&Pr(e,r.treeForkCount),t):(ze(e),null);case 22:case 23:return fa(e),Vg(),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&&(ze(e),e.subtreeFlags&6&&(e.flags|=8192)):ze(e),a=e.updateQueue,a!==null&&sd(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&&Ct(Oo),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),qr(ft),ze(e),null;case 25:return null;case 30:return null}throw Error(O(156,e.tag))}function qM(t,e){switch(Fg(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return qr(ft),ts(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Rd(e),null;case 31:if(e.memoizedState!==null){if(fa(e),e.alternate===null)throw Error(O(340));Po()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(fa(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(O(340));Po()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ct(ot),null;case 4:return ts(),null;case 10:return qr(e.type),null;case 22:case 23:return fa(e),Vg(),t!==null&&Ct(Oo),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return qr(ft),null;case 25:return null;default:return null}}function $w(t,e){switch(Fg(e),e.tag){case 3:qr(ft),ts();break;case 26:case 27:case 5:Rd(e);break;case 4:ts();break;case 31:e.memoizedState!==null&&fa(e);break;case 13:fa(e);break;case 19:Ct(ot);break;case 10:qr(e.type);break;case 22:case 23:fa(e),Vg(),t!==null&&Ct(Oo);break;case 24:qr(ft)}}function ru(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){ke(e,e.return,s)}}function Zn(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){ke(n,l,c)}}}r=r.next}while(r!==o)}}catch(c){ke(e,e.return,c)}}function jw(t){var e=t.updateQueue;if(e!==null){var a=t.stateNode;try{ew(e,a)}catch(r){ke(t,t.return,r)}}}function Gw(t,e,a){a.props=Uo(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(r){ke(t,e,r)}}function Tl(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){ke(t,e,n)}}function vr(t,e){var a=t.ref,r=t.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(n){ke(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){ke(t,e,n)}else a.current=null}function Ww(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){ke(t,t.return,n)}}function vm(t,e,a){try{var r=t.stateNode;lO(r,t.type,a,e),r[aa]=e}catch(n){ke(t,t.return,n)}}function Zw(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Yn(t.type)||t.tag===4}function ym(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Zw(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&&Yn(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 ig(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=Hr));else if(r!==4&&(r===27&&Yn(t.type)&&(a=t.stateNode,e=null),t=t.child,t!==null))for(ig(t,e,a),t=t.sibling;t!==null;)ig(t,e,a),t=t.sibling}function jd(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&&Yn(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(jd(t,e,a),t=t.sibling;t!==null;)jd(t,e,a),t=t.sibling}function Xw(t){var e=t.stateNode,a=t.memoizedProps;try{for(var r=t.type,n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Tt(e,r,a),e[It]=t,e[aa]=a}catch(o){ke(t,t.return,o)}}var Nr=!1,dt=!1,xm=!1,A_=typeof WeakSet=="function"?WeakSet:Set,St=null;function VM(t,e){if(t=t.containerInfo,pg=af,t=PC(t),Og(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,f=null;t:for(;;){for(var h;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),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===a&&++u===n&&(s=i),f===o&&++c===r&&(l=i),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}a=s===-1||l===-1?null:{start:s,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(hg={focusedElem:t,selectionRange:a},af=!1,St=e;St!==null;)if(e=St,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,St=t;else for(;St!==null;){switch(e=St,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=Uo(a.type,n);t=r.getSnapshotBeforeUpdate(S,o),r.__reactInternalSnapshotBeforeUpdate=t}catch(x){ke(a,a.return,x)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,a=t.nodeType,a===9)gg(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":gg(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,St=t;break}St=e.return}}function Kw(t,e,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Dr(t,a),r&4&&ru(5,a);break;case 1:if(Dr(t,a),r&4)if(t=a.stateNode,e===null)try{t.componentDidMount()}catch(i){ke(a,a.return,i)}else{var n=Uo(a.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(n,e,t.__reactInternalSnapshotBeforeUpdate)}catch(i){ke(a,a.return,i)}}r&64&&jw(a),r&512&&Tl(a,a.return);break;case 3:if(Dr(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{ew(t,e)}catch(i){ke(a,a.return,i)}}break;case 27:e===null&&r&4&&Xw(a);case 26:case 5:Dr(t,a),e===null&&r&4&&Ww(a),r&512&&Tl(a,a.return);break;case 12:Dr(t,a);break;case 31:Dr(t,a),r&4&&Jw(t,a);break;case 13:Dr(t,a),r&4&&eL(t,a),r&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=QM.bind(null,a),gO(t,a))));break;case 22:if(r=a.memoizedState!==null||Nr,!r){e=e!==null&&e.memoizedState!==null||dt,n=Nr;var o=dt;Nr=r,(dt=e)&&!o?Br(t,a,(a.subtreeFlags&8772)!==0):Dr(t,a),Nr=n,dt=o}break;case 30:break;default:Dr(t,a)}}function Yw(t){var e=t.alternate;e!==null&&(t.alternate=null,Yw(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Ig(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,Jt=!1;function Or(t,e,a){for(a=a.child;a!==null;)Qw(t,e,a),a=a.sibling}function Qw(t,e,a){if(ga&&typeof ga.onCommitFiberUnmount=="function")try{ga.onCommitFiberUnmount(Kl,a)}catch{}switch(a.tag){case 26:dt||vr(a,e),Or(t,e,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:dt||vr(a,e);var r=Ze,n=Jt;Yn(a.type)&&(Ze=a.stateNode,Jt=!1),Or(t,e,a),Dl(a.stateNode),Ze=r,Jt=n;break;case 5:dt||vr(a,e);case 6:if(r=Ze,n=Jt,Ze=null,Or(t,e,a),Ze=r,Jt=n,Ze!==null)if(Jt)try{(Ze.nodeType===9?Ze.body:Ze.nodeName==="HTML"?Ze.ownerDocument.body:Ze).removeChild(a.stateNode)}catch(o){ke(a,e,o)}else try{Ze.removeChild(a.stateNode)}catch(o){ke(a,e,o)}break;case 18:Ze!==null&&(Jt?(t=Ze,V_(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ds(t)):V_(Ze,a.stateNode));break;case 4:r=Ze,n=Jt,Ze=a.stateNode.containerInfo,Jt=!0,Or(t,e,a),Ze=r,Jt=n;break;case 0:case 11:case 14:case 15:Zn(2,a,e),dt||Zn(4,a,e),Or(t,e,a);break;case 1:dt||(vr(a,e),r=a.stateNode,typeof r.componentWillUnmount=="function"&&Gw(a,e,r)),Or(t,e,a);break;case 21:Or(t,e,a);break;case 22:dt=(r=dt)||a.memoizedState!==null,Or(t,e,a),dt=r;break;default:Or(t,e,a)}}function Jw(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ds(t)}catch(a){ke(e,e.return,a)}}}function eL(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ds(t)}catch(a){ke(e,e.return,a)}}function $M(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new A_),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new A_),e;default:throw Error(O(435,t.tag))}}function ld(t,e){var a=$M(t);e.forEach(function(r){if(!a.has(r)){a.add(r);var n=JM.bind(null,t,r);r.then(n,n)}})}function Yt(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(Yn(s.type)){Ze=s.stateNode,Jt=!1;break e}break;case 5:Ze=s.stateNode,Jt=!1;break e;case 3:case 4:Ze=s.stateNode.containerInfo,Jt=!0;break e}s=s.return}if(Ze===null)throw Error(O(160));Qw(o,i,n),Ze=null,Jt=!1,o=n.alternate,o!==null&&(o.return=null),n.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)tL(e,t),e=e.sibling}var Ka=null;function tL(t,e){var a=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Yt(e,t),Qt(t),r&4&&(Zn(3,t,t.return),ru(3,t),Zn(5,t,t.return));break;case 1:Yt(e,t),Qt(t),r&512&&(dt||a===null||vr(a,a.return)),r&64&&Nr&&(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=Ka;if(Yt(e,t),Qt(t),r&512&&(dt||a===null||vr(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[Jl]||o[It]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=n.createElement(r),n.head.insertBefore(o,n.querySelector("head > title"))),Tt(o,r,a),o[It]=t,_t(o),r=o;break e;case"link":var i=K_("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),Tt(o,r,a),n.head.appendChild(o);break;case"meta":if(i=K_("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),Tt(o,r,a),n.head.appendChild(o);break;default:throw Error(O(468,r))}o[It]=t,_t(o),r=o}t.stateNode=r}else Y_(n,t.type,t.stateNode);else t.stateNode=X_(n,r,t.memoizedProps);else o!==r?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,r===null?Y_(n,t.type,t.stateNode):X_(n,r,t.memoizedProps)):r===null&&t.stateNode!==null&&vm(t,t.memoizedProps,a.memoizedProps)}break;case 27:Yt(e,t),Qt(t),r&512&&(dt||a===null||vr(a,a.return)),a!==null&&r&4&&vm(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Yt(e,t),Qt(t),r&512&&(dt||a===null||vr(a,a.return)),t.flags&32){n=t.stateNode;try{rs(n,"")}catch(S){ke(t,t.return,S)}}r&4&&t.stateNode!=null&&(n=t.memoizedProps,vm(t,n,a!==null?a.memoizedProps:n)),r&1024&&(xm=!0);break;case 6:if(Yt(e,t),Qt(t),r&4){if(t.stateNode===null)throw Error(O(162));r=t.memoizedProps,a=t.stateNode;try{a.nodeValue=r}catch(S){ke(t,t.return,S)}}break;case 3:if(kd=null,n=Ka,Ka=Jd(e.containerInfo),Yt(e,t),Ka=n,Qt(t),r&4&&a!==null&&a.memoizedState.isDehydrated)try{ds(e.containerInfo)}catch(S){ke(t,t.return,S)}xm&&(xm=!1,aL(t));break;case 4:r=Ka,Ka=Jd(t.stateNode.containerInfo),Yt(e,t),Qt(t),Ka=r;break;case 12:Yt(e,t),Qt(t);break;case 31:Yt(e,t),Qt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,ld(t,r)));break;case 13:Yt(e,t),Qt(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(gf=ma()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,ld(t,r)));break;case 22:n=t.memoizedState!==null;var l=a!==null&&a.memoizedState!==null,u=Nr,c=dt;if(Nr=u||n,dt=c||l,Yt(e,t),dt=c,Nr=u,Qt(t),r&8192)e:for(e=t.stateNode,e._visibility=n?e._visibility&-2:e._visibility|1,n&&(a===null||l||Nr||dt||To(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,f=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(S){ke(l,l.return,S)}}}else if(e.tag===6){if(a===null){l=e;try{l.stateNode.nodeValue=n?"":l.memoizedProps}catch(S){ke(l,l.return,S)}}}else if(e.tag===18){if(a===null){l=e;try{var h=l.stateNode;n?$_(h,!0):$_(l.stateNode,!1)}catch(S){ke(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,ld(t,a))));break;case 19:Yt(e,t),Qt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,ld(t,r)));break;case 30:break;case 21:break;default:Yt(e,t),Qt(t)}}function Qt(t){var e=t.flags;if(e&2){try{for(var a,r=t.return;r!==null;){if(Zw(r)){a=r;break}r=r.return}if(a==null)throw Error(O(160));switch(a.tag){case 27:var n=a.stateNode,o=ym(t);jd(t,o,n);break;case 5:var i=a.stateNode;a.flags&32&&(rs(i,""),a.flags&=-33);var s=ym(t);jd(t,s,i);break;case 3:case 4:var l=a.stateNode.containerInfo,u=ym(t);ig(t,u,l);break;default:throw Error(O(161))}}catch(c){ke(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function aL(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;aL(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Dr(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Kw(t,e.alternate,e),e=e.sibling}function To(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Zn(4,e,e.return),To(e);break;case 1:vr(e,e.return);var a=e.stateNode;typeof a.componentWillUnmount=="function"&&Gw(e,e.return,a),To(e);break;case 27:Dl(e.stateNode);case 26:case 5:vr(e,e.return),To(e);break;case 22:e.memoizedState===null&&To(e);break;case 30:To(e);break;default:To(e)}t=t.sibling}}function Br(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:Br(n,o,a),ru(4,o);break;case 1:if(Br(n,o,a),r=o,n=r.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(u){ke(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++)JC(l[n],s)}catch(u){ke(r,r.return,u)}}a&&i&64&&jw(o),Tl(o,o.return);break;case 27:Xw(o);case 26:case 5:Br(n,o,a),a&&r===null&&i&4&&Ww(o),Tl(o,o.return);break;case 12:Br(n,o,a);break;case 31:Br(n,o,a),a&&i&4&&Jw(n,o);break;case 13:Br(n,o,a),a&&i&4&&eL(n,o);break;case 22:o.memoizedState===null&&Br(n,o,a),Tl(o,o.return);break;case 30:break;default:Br(n,o,a)}e=e.sibling}}function ov(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&&tu(a))}function iv(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&tu(t))}function Xa(t,e,a,r){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)rL(t,e,a,r),e=e.sibling}function rL(t,e,a,r){var n=e.flags;switch(e.tag){case 0:case 11:case 15:Xa(t,e,a,r),n&2048&&ru(9,e);break;case 1:Xa(t,e,a,r);break;case 3:Xa(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&&tu(t)));break;case 12:if(n&2048){Xa(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){ke(e,e.return,l)}}else Xa(t,e,a,r);break;case 31:Xa(t,e,a,r);break;case 13:Xa(t,e,a,r);break;case 23:break;case 22:o=e.stateNode,i=e.alternate,e.memoizedState!==null?o._visibility&2?Xa(t,e,a,r):Rl(t,e):o._visibility&2?Xa(t,e,a,r):(o._visibility|=2,Di(t,e,a,r,(e.subtreeFlags&10256)!==0||!1)),n&2048&&ov(i,e);break;case 24:Xa(t,e,a,r),n&2048&&iv(e.alternate,e);break;default:Xa(t,e,a,r)}}function Di(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:Di(o,i,s,l,n),ru(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?Di(o,i,s,l,n):Rl(o,i):(c._visibility|=2,Di(o,i,s,l,n)),n&&u&2048&&ov(i.alternate,i);break;case 24:Di(o,i,s,l,n),n&&u&2048&&iv(i.alternate,i);break;default:Di(o,i,s,l,n)}e=e.sibling}}function Rl(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:Rl(a,r),n&2048&&ov(r.alternate,r);break;case 24:Rl(a,r),n&2048&&iv(r.alternate,r);break;default:Rl(a,r)}e=e.sibling}}var Sl=8192;function Oi(t,e,a){if(t.subtreeFlags&Sl)for(t=t.child;t!==null;)nL(t,e,a),t=t.sibling}function nL(t,e,a){switch(t.tag){case 26:Oi(t,e,a),t.flags&Sl&&t.memoizedState!==null&&AO(a,Ka,t.memoizedState,t.memoizedProps);break;case 5:Oi(t,e,a);break;case 3:case 4:var r=Ka;Ka=Jd(t.stateNode.containerInfo),Oi(t,e,a),Ka=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=Sl,Sl=16777216,Oi(t,e,a),Sl=r):Oi(t,e,a));break;default:Oi(t,e,a)}}function oL(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 hl(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];St=r,sL(r,t)}oL(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)iL(t),t=t.sibling}function iL(t){switch(t.tag){case 0:case 11:case 15:hl(t),t.flags&2048&&Zn(9,t,t.return);break;case 3:hl(t);break;case 12:hl(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,wd(t)):hl(t);break;default:hl(t)}}function wd(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];St=r,sL(r,t)}oL(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Zn(8,e,e.return),wd(e);break;case 22:a=e.stateNode,a._visibility&2&&(a._visibility&=-3,wd(e));break;default:wd(e)}t=t.sibling}}function sL(t,e){for(;St!==null;){var a=St;switch(a.tag){case 0:case 11:case 15:Zn(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:tu(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,St=r;else e:for(a=t;St!==null;){r=St;var n=r.sibling,o=r.return;if(Yw(r),r===a){St=null;break e}if(n!==null){n.return=o,St=n;break e}St=o}}}var jM={getCacheForType:function(t){var e=Et(ft),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a},cacheSignal:function(){return Et(ft).controller.signal}},GM=typeof WeakMap=="function"?WeakMap:Map,Se=0,Oe=null,fe=null,me=0,Le=0,da=null,Dn=!1,gs=!1,sv=!1,Zr=0,rt=0,Xn=0,Bo=0,lv=0,ha=0,ss=0,Ml=null,ea=null,sg=!1,gf=0,lL=0,Gd=1/0,Wd=null,zn=null,vt=0,qn=null,ls=null,Vr=0,lg=0,ug=null,uL=null,Ol=0,cg=null;function ya(){return(Se&2)!==0&&me!==0?me&-me:ae.T!==null?cv():yC()}function cL(){if(ha===0)if((me&536870912)===0||ve){var t=Qc;Qc<<=1,(Qc&3932160)===0&&(Qc=262144),ha=t}else ha=536870912;return t=ba.current,t!==null&&(t.flags|=32),ha}function ta(t,e,a){(t===Oe&&(Le===2||Le===9)||t.cancelPendingCommit!==null)&&(us(t,0),Bn(t,me,ha,!1)),Ql(t,a),((Se&2)===0||t!==Oe)&&(t===Oe&&((Se&2)===0&&(Bo|=a),rt===4&&Bn(t,me,ha,!1)),br(t))}function dL(t,e,a){if((Se&6)!==0)throw Error(O(327));var r=!a&&(e&127)===0&&(e&t.expiredLanes)===0||Yl(t,e),n=r?XM(t,e):bm(t,e,!0),o=r;do{if(n===0){gs&&!r&&Bn(t,e,0,!1);break}else{if(a=t.current.alternate,o&&!WM(a)){n=bm(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=Ml;var l=s.current.memoizedState.isDehydrated;if(l&&(us(s,i).flags|=256),i=bm(s,i,!1),i!==2){if(sv&&!l){s.errorRecoveryDisabledLanes|=o,Bo|=o,n=4;break e}o=ea,ea=n,o!==null&&(ea===null?ea=o:ea.push.apply(ea,o))}n=i}if(o=!1,n!==2)continue}}if(n===1){us(t,0),Bn(t,e,0,!0);break}e:{switch(r=t,o=n,o){case 0:case 1:throw Error(O(345));case 4:if((e&4194048)!==e)break;case 6:Bn(r,e,ha,!Dn);break e;case 2:ea=null;break;case 3:case 5:break;default:throw Error(O(329))}if((e&62914560)===e&&(n=gf+300-ma(),10<n)){if(Bn(r,e,ha,!Dn),nf(r,0,!0)!==0)break e;Vr=e,r.timeoutHandle=RL(E_.bind(null,r,a,ea,Wd,sg,e,ha,Bo,ss,Dn,o,"Throttled",-0,0),n);break e}E_(r,a,ea,Wd,sg,e,ha,Bo,ss,Dn,o,null,-0,0)}}break}while(!0);br(t)}function E_(t,e,a,r,n,o,i,s,l,u,c,d,f,h){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:Hr},nL(e,o,d);var S=(o&62914560)===o?gf-ma():(o&4194048)===o?lL-ma():0;if(S=EO(d,S),S!==null){Vr=o,t.cancelPendingCommit=S(R_.bind(null,t,e,o,a,r,n,i,s,l,c,d,null,f,h)),Bn(t,o,i,!u);return}}R_(t,e,o,a,r,n,i,s,l)}function WM(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(!xa(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 Bn(t,e,a,r){e&=~lv,e&=~Bo,t.suspendedLanes|=e,t.pingedLanes&=~e,r&&(t.warmLanes|=e),r=t.expirationTimes;for(var n=e;0<n;){var o=31-va(n),i=1<<o;r[o]=-1,n&=~i}a!==0&&mC(t,a,e)}function vf(){return(Se&6)===0?(nu(0,!1),!1):!0}function uv(){if(fe!==null){if(Le===0)var t=fe.return;else t=fe,Ur=jo=null,Zg(t),Qi=null,zl=0,t=fe;for(;t!==null;)$w(t.alternate,t),t=t.return;fe=null}}function us(t,e){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,dO(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Vr=0,uv(),Oe=t,fe=a=zr(t.current,null),me=e,Le=0,da=null,Dn=!1,gs=Yl(t,e),sv=!1,ss=ha=lv=Bo=Xn=rt=0,ea=Ml=null,sg=!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-va(r),o=1<<n;e|=t[n],r&=~o}return Zr=e,uf(),a}function fL(t,e){ie=null,ae.H=Vl,e===ms||e===df?(e=s_(),Le=3):e===zg?(e=s_(),Le=4):Le=e===rv?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,da=e,fe===null&&(rt=1,Vd(t,Da(e,t.current)))}function pL(){var t=ba.current;return t===null?!0:(me&4194048)===me?Pa===null:(me&62914560)===me||(me&536870912)!==0?t===Pa:!1}function hL(){var t=ae.H;return ae.H=Vl,t===null?Vl:t}function mL(){var t=ae.A;return ae.A=jM,t}function Zd(){rt=4,Dn||(me&4194048)!==me&&ba.current!==null||(gs=!0),(Xn&134217727)===0&&(Bo&134217727)===0||Oe===null||Bn(Oe,me,ha,!1)}function bm(t,e,a){var r=Se;Se|=2;var n=hL(),o=mL();(Oe!==t||me!==e)&&(Wd=null,us(t,e)),e=!1;var i=rt;e:do try{if(Le!==0&&fe!==null){var s=fe,l=da;switch(Le){case 8:uv(),i=6;break e;case 3:case 2:case 9:case 6:ba.current===null&&(e=!0);var u=Le;if(Le=0,da=null,Wi(t,s,l,u),a&&gs){i=0;break e}break;default:u=Le,Le=0,da=null,Wi(t,s,l,u)}}ZM(),i=rt;break}catch(c){fL(t,c)}while(!0);return e&&t.shellSuspendCounter++,Ur=jo=null,Se=r,ae.H=n,ae.A=o,fe===null&&(Oe=null,me=0,uf()),i}function ZM(){for(;fe!==null;)gL(fe)}function XM(t,e){var a=Se;Se|=2;var r=hL(),n=mL();Oe!==t||me!==e?(Wd=null,Gd=ma()+500,us(t,e)):gs=Yl(t,e);e:do try{if(Le!==0&&fe!==null){e=fe;var o=da;t:switch(Le){case 1:Le=0,da=null,Wi(t,e,o,1);break;case 2:case 9:if(i_(o)){Le=0,da=null,T_(e);break}e=function(){Le!==2&&Le!==9||Oe!==t||(Le=7),br(t)},o.then(e,e);break e;case 3:Le=7;break e;case 4:Le=5;break e;case 7:i_(o)?(Le=0,da=null,T_(e)):(Le=0,da=null,Wi(t,e,o,7));break;case 5:var i=null;switch(fe.tag){case 26:i=fe.memoizedState;case 5:case 27:var s=fe;if(i?PL(i):s.stateNode.complete){Le=0,da=null;var l=s.sibling;if(l!==null)fe=l;else{var u=s.return;u!==null?(fe=u,yf(u)):fe=null}break t}}Le=0,da=null,Wi(t,e,o,5);break;case 6:Le=0,da=null,Wi(t,e,o,6);break;case 8:uv(),rt=6;break e;default:throw Error(O(462))}}KM();break}catch(c){fL(t,c)}while(!0);return Ur=jo=null,ae.H=r,ae.A=n,Se=a,fe!==null?0:(Oe=null,me=0,uf(),rt)}function KM(){for(;fe!==null&&!x2();)gL(fe)}function gL(t){var e=Vw(t.alternate,t,Zr);t.memoizedProps=t.pendingProps,e===null?yf(t):fe=e}function T_(t){var e=t,a=e.alternate;switch(e.tag){case 15:case 0:e=C_(a,e,e.pendingProps,e.type,void 0,me);break;case 11:e=C_(a,e,e.pendingProps,e.type.render,e.ref,me);break;case 5:Zg(e);default:$w(a,e),e=fe=$C(e,Zr),e=Vw(a,e,Zr)}t.memoizedProps=t.pendingProps,e===null?yf(t):fe=e}function Wi(t,e,a,r){Ur=jo=null,Zg(e),Qi=null,zl=0;var n=e.return;try{if(FM(t,n,e,a,me)){rt=1,Vd(t,Da(a,t.current)),fe=null;return}}catch(o){if(n!==null)throw fe=n,o;rt=1,Vd(t,Da(a,t.current)),fe=null;return}e.flags&32768?(ve||r===1?t=!0:gs||(me&536870912)!==0?t=!1:(Dn=t=!0,(r===2||r===9||r===3||r===6)&&(r=ba.current,r!==null&&r.tag===13&&(r.flags|=16384))),vL(e,t)):yf(e)}function yf(t){var e=t;do{if((e.flags&32768)!==0){vL(e,Dn);return}t=e.return;var a=zM(e.alternate,e,Zr);if(a!==null){fe=a;return}if(e=e.sibling,e!==null){fe=e;return}fe=e=t}while(e!==null);rt===0&&(rt=5)}function vL(t,e){do{var a=qM(t.alternate,t);if(a!==null){a.flags&=32767,fe=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!e&&(t=t.sibling,t!==null)){fe=t;return}fe=t=a}while(t!==null);rt=6,fe=null}function R_(t,e,a,r,n,o,i,s,l){t.cancelPendingCommit=null;do xf();while(vt!==0);if((Se&6)!==0)throw Error(O(327));if(e!==null){if(e===t.current)throw Error(O(177));if(o=e.lanes|e.childLanes,o|=Dg,E2(t,a,o,i,s,l),t===Oe&&(fe=Oe=null,me=0),ls=e,qn=t,Vr=a,lg=o,ug=n,uL=r,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,eO(Md,function(){return _L(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||r){r=ae.T,ae.T=null,n=_e.p,_e.p=2,i=Se,Se|=4;try{VM(t,e,a)}finally{Se=i,_e.p=n,ae.T=r}}vt=1,yL(),xL(),bL()}}function yL(){if(vt===1){vt=0;var t=qn,e=ls,a=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||a){a=ae.T,ae.T=null;var r=_e.p;_e.p=2;var n=Se;Se|=4;try{tL(e,t);var o=hg,i=PC(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(i!==s&&s&&s.ownerDocument&&BC(s.ownerDocument.documentElement,s)){if(l!==null&&Og(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,f=d&&d.defaultView||window;if(f.getSelection){var h=f.getSelection(),S=s.textContent.length,x=Math.min(l.start,S),b=l.end===void 0?x:Math.min(l.end,S);!h.extend&&x>b&&(i=b,b=x,x=i);var g=JS(s,x),m=JS(s,b);if(g&&m&&(h.rangeCount!==1||h.anchorNode!==g.node||h.anchorOffset!==g.offset||h.focusNode!==m.node||h.focusOffset!==m.offset)){var y=d.createRange();y.setStart(g.node,g.offset),h.removeAllRanges(),x>b?(h.addRange(y),h.extend(m.node,m.offset)):(y.setEnd(m.node,m.offset),h.addRange(y))}}}}for(d=[],h=s;h=h.parentNode;)h.nodeType===1&&d.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<d.length;s++){var v=d[s];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}af=!!pg,hg=pg=null}finally{Se=n,_e.p=r,ae.T=a}}t.current=e,vt=2}}function xL(){if(vt===2){vt=0;var t=qn,e=ls,a=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||a){a=ae.T,ae.T=null;var r=_e.p;_e.p=2;var n=Se;Se|=4;try{Kw(t,e.alternate,e)}finally{Se=n,_e.p=r,ae.T=a}}vt=3}}function bL(){if(vt===4||vt===3){vt=0,b2();var t=qn,e=ls,a=Vr,r=uL;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?vt=5:(vt=0,ls=qn=null,SL(t,t.pendingLanes));var n=t.pendingLanes;if(n===0&&(zn=null),kg(a),e=e.stateNode,ga&&typeof ga.onCommitFiberRoot=="function")try{ga.onCommitFiberRoot(Kl,e,void 0,(e.current.flags&128)===128)}catch{}if(r!==null){e=ae.T,n=_e.p,_e.p=2,ae.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{ae.T=e,_e.p=n}}(Vr&3)!==0&&xf(),br(t),n=t.pendingLanes,(a&261930)!==0&&(n&42)!==0?t===cg?Ol++:(Ol=0,cg=t):Ol=0,nu(0,!1)}}function SL(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,tu(e)))}function xf(){return yL(),xL(),bL(),_L()}function _L(){if(vt!==5)return!1;var t=qn,e=lg;lg=0;var a=kg(Vr),r=ae.T,n=_e.p;try{_e.p=32>a?32:a,ae.T=null,a=ug,ug=null;var o=qn,i=Vr;if(vt=0,ls=qn=null,Vr=0,(Se&6)!==0)throw Error(O(331));var s=Se;if(Se|=4,iL(o.current),rL(o,o.current,i,a),Se=s,nu(0,!1),ga&&typeof ga.onPostCommitFiberRoot=="function")try{ga.onPostCommitFiberRoot(Kl,o)}catch{}return!0}finally{_e.p=n,ae.T=r,SL(t,e)}}function M_(t,e,a){e=Da(a,e),e=rg(t.stateNode,e,2),t=Un(t,e,2),t!==null&&(Ql(t,2),br(t))}function ke(t,e,a){if(t.tag===3)M_(t,t,a);else for(;e!==null;){if(e.tag===3){M_(e,t,a);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(zn===null||!zn.has(r))){t=Da(a,t),a=Nw(2),r=Un(e,a,2),r!==null&&(Fw(a,r,e,t),Ql(r,2),br(r));break}}e=e.return}}function Sm(t,e,a){var r=t.pingCache;if(r===null){r=t.pingCache=new GM;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)||(sv=!0,n.add(a),t=YM.bind(null,t,e,a),e.then(t,t))}function YM(t,e,a){var r=t.pingCache;r!==null&&r.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Oe===t&&(me&a)===a&&(rt===4||rt===3&&(me&62914560)===me&&300>ma()-gf?(Se&2)===0&&us(t,0):lv|=a,ss===me&&(ss=0)),br(t)}function CL(t,e){e===0&&(e=hC()),t=$o(t,e),t!==null&&(Ql(t,e),br(t))}function QM(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),CL(t,a)}function JM(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(O(314))}r!==null&&r.delete(e),CL(t,a)}function eO(t,e){return wg(t,e)}var Xd=null,Bi=null,dg=!1,Kd=!1,_m=!1,Pn=0;function br(t){t!==Bi&&t.next===null&&(Bi===null?Xd=Bi=t:Bi=Bi.next=t),Kd=!0,dg||(dg=!0,aO())}function nu(t,e){if(!_m&&Kd){_m=!0;do for(var a=!1,r=Xd;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-va(42|t)+1)-1,o&=n&~(i&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,O_(r,o))}else o=me,o=nf(r,r===Oe?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(o&3)===0||Yl(r,o)||(a=!0,O_(r,o));r=r.next}while(a);_m=!1}}function tO(){wL()}function wL(){Kd=dg=!1;var t=0;Pn!==0&&cO()&&(t=Pn);for(var e=ma(),a=null,r=Xd;r!==null;){var n=r.next,o=LL(r,e);o===0?(r.next=null,a===null?Xd=n:a.next=n,n===null&&(Bi=a)):(a=r,(t!==0||(o&3)!==0)&&(Kd=!0)),r=n}vt!==0&&vt!==5||nu(t,!1),Pn!==0&&(Pn=0)}function LL(t,e){for(var a=t.suspendedLanes,r=t.pingedLanes,n=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var i=31-va(o),s=1<<i,l=n[i];l===-1?((s&a)===0||(s&r)!==0)&&(n[i]=A2(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Oe,a=me,a=nf(t,t===e?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,a===0||t===e&&(Le===2||Le===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&Yh(r),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Yl(t,a)){if(e=a&-a,e===t.callbackPriority)return e;switch(r!==null&&Yh(r),kg(a)){case 2:case 8:a=fC;break;case 32:a=Md;break;case 268435456:a=pC;break;default:a=Md}return r=kL.bind(null,t),a=wg(a,r),t.callbackPriority=e,t.callbackNode=a,e}return r!==null&&r!==null&&Yh(r),t.callbackPriority=2,t.callbackNode=null,2}function kL(t,e){if(vt!==0&&vt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(xf()&&t.callbackNode!==a)return null;var r=me;return r=nf(t,t===Oe?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(dL(t,r,e),LL(t,ma()),t.callbackNode!=null&&t.callbackNode===a?kL.bind(null,t):null)}function O_(t,e){if(xf())return null;dL(t,e,!0)}function aO(){fO(function(){(Se&6)!==0?wg(dC,tO):wL()})}function cv(){if(Pn===0){var t=ns;t===0&&(t=Yc,Yc<<=1,(Yc&261888)===0&&(Yc=256)),Pn=t}return Pn}function D_(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:md(""+t)}function B_(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 rO(t,e,a,r,n){if(e==="submit"&&a&&a.stateNode===n){var o=D_((n[aa]||null).action),i=r.submitter;i&&(e=(e=i[aa]||null)?D_(e.formAction):i.getAttribute("formAction"),e!==null&&(o=e,i=null));var s=new of("action","action",null,r,n);t.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Pn!==0){var l=i?B_(n,i):new FormData(n);tg(a,{pending:!0,data:l,method:n.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=i?B_(n,i):new FormData(n),tg(a,{pending:!0,data:l,method:n.method,action:o},o,l))},currentTarget:n}]})}}for(ud=0;ud<Vm.length;ud++)cd=Vm[ud],P_=cd.toLowerCase(),N_=cd[0].toUpperCase()+cd.slice(1),Ya(P_,"on"+N_);var cd,P_,N_,ud;Ya(FC,"onAnimationEnd");Ya(HC,"onAnimationIteration");Ya(UC,"onAnimationStart");Ya("dblclick","onDoubleClick");Ya("focusin","onFocus");Ya("focusout","onBlur");Ya(SM,"onTransitionRun");Ya(_M,"onTransitionStart");Ya(CM,"onTransitionCancel");Ya(zC,"onTransitionEnd");as("onMouseEnter",["mouseout","mouseover"]);as("onMouseLeave",["mouseout","mouseover"]);as("onPointerEnter",["pointerout","pointerover"]);as("onPointerLeave",["pointerout","pointerover"]);zo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));zo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));zo("onBeforeInput",["compositionend","keypress","textInput","paste"]);zo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));zo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));zo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $l="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(" "),nO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($l));function IL(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){Dd(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){Dd(c)}n.currentTarget=null,o=l}}}}function de(t,e){var a=e[Bm];a===void 0&&(a=e[Bm]=new Set);var r=t+"__bubble";a.has(r)||(AL(e,t,2,!1),a.add(r))}function Cm(t,e,a){var r=0;e&&(r|=4),AL(a,t,r,e)}var dd="_reactListening"+Math.random().toString(36).slice(2);function dv(t){if(!t[dd]){t[dd]=!0,xC.forEach(function(a){a!=="selectionchange"&&(nO.has(a)||Cm(a,!1,t),Cm(a,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[dd]||(e[dd]=!0,Cm("selectionchange",!1,e))}}function AL(t,e,a,r){switch(zL(e)){case 2:var n=MO;break;case 8:n=OO;break;default:n=mv}a=n.bind(null,e,a,t),n=void 0,!Um||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 wm(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=Fi(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}IC(function(){var u=o,c=Eg(a),d=[];e:{var f=qC.get(t);if(f!==void 0){var h=of,S=t;switch(t){case"keypress":if(vd(a)===0)break e;case"keydown":case"keyup":h=J2;break;case"focusin":S="focus",h=am;break;case"focusout":S="blur",h=am;break;case"beforeblur":case"afterblur":h=am;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":h=$S;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=z2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=aM;break;case FC:case HC:case UC:h=$2;break;case zC:h=nM;break;case"scroll":case"scrollend":h=H2;break;case"wheel":h=iM;break;case"copy":case"cut":case"paste":h=G2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=GS;break;case"toggle":case"beforetoggle":h=lM}var x=(e&4)!==0,b=!x&&(t==="scroll"||t==="scrollend"),g=x?f!==null?f+"Capture":null:f;x=[];for(var m=u,y;m!==null;){var v=m;if(y=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||y===null||g===null||(v=Pl(m,g),v!=null&&x.push(jl(m,v,y))),b)break;m=m.return}0<x.length&&(f=new h(f,S,null,a,c),d.push({event:f,listeners:x}))}}if((e&7)===0){e:{if(f=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",f&&a!==Hm&&(S=a.relatedTarget||a.fromElement)&&(Fi(S)||S[fs]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(S=a.relatedTarget||a.toElement,h=u,S=S?Fi(S):null,S!==null&&(b=Xl(S),x=S.tag,S!==b||x!==5&&x!==27&&x!==6)&&(S=null)):(h=null,S=u),h!==S)){if(x=$S,v="onMouseLeave",g="onMouseEnter",m="mouse",(t==="pointerout"||t==="pointerover")&&(x=GS,v="onPointerLeave",g="onPointerEnter",m="pointer"),b=h==null?f:xl(h),y=S==null?f:xl(S),f=new x(v,m+"leave",h,a,c),f.target=b,f.relatedTarget=y,v=null,Fi(c)===u&&(x=new x(g,m+"enter",S,a,c),x.target=y,x.relatedTarget=b,v=x),b=v,h&&S)t:{for(x=oO,g=h,m=S,y=0,v=g;v;v=x(v))y++;v=0;for(var C=m;C;C=x(C))v++;for(;0<y-v;)g=x(g),y--;for(;0<v-y;)m=x(m),v--;for(;y--;){if(g===m||m!==null&&g===m.alternate){x=g;break t}g=x(g),m=x(m)}x=null}else x=null;h!==null&&F_(d,f,h,x,!1),S!==null&&b!==null&&F_(d,b,S,x,!0)}}e:{if(f=u?xl(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var w=KS;else if(XS(f))if(OC)w=yM;else{w=gM;var _=mM}else h=f.nodeName,!h||h.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Ag(u.elementType)&&(w=KS):w=vM;if(w&&(w=w(t,u))){MC(d,w,a,c);break e}_&&_(t,f,u),t==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&Fm(f,"number",f.value)}switch(_=u?xl(u):window,t){case"focusin":(XS(_)||_.contentEditable==="true")&&(zi=_,zm=u,wl=null);break;case"focusout":wl=zm=zi=null;break;case"mousedown":qm=!0;break;case"contextmenu":case"mouseup":case"dragend":qm=!1,e_(d,a,c);break;case"selectionchange":if(bM)break;case"keydown":case"keyup":e_(d,a,c)}var L;if(Mg)e:{switch(t){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else Ui?TC(t,a)&&(I="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(I="onCompositionStart");I&&(EC&&a.locale!=="ko"&&(Ui||I!=="onCompositionStart"?I==="onCompositionEnd"&&Ui&&(L=AC()):(On=c,Tg="value"in On?On.value:On.textContent,Ui=!0)),_=Yd(u,I),0<_.length&&(I=new jS(I,t,null,a,c),d.push({event:I,listeners:_}),L?I.data=L:(L=RC(a),L!==null&&(I.data=L)))),(L=cM?dM(t,a):fM(t,a))&&(I=Yd(u,"onBeforeInput"),0<I.length&&(_=new jS("onBeforeInput","beforeinput",null,a,c),d.push({event:_,listeners:I}),_.data=L)),rO(d,t,u,a,c)}IL(d,e)})}function jl(t,e,a){return{instance:t,listener:e,currentTarget:a}}function Yd(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=Pl(t,a),n!=null&&r.unshift(jl(t,n,o)),n=Pl(t,e),n!=null&&r.push(jl(t,n,o))),t.tag===3)return r;t=t.return}return[]}function oO(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function F_(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=Pl(a,o),u!=null&&i.unshift(jl(a,u,l))):n||(u=Pl(a,o),u!=null&&i.push(jl(a,u,l)))),a=a.return}i.length!==0&&t.push({event:e,listeners:i})}var iO=/\r\n?/g,sO=/\u0000|\uFFFD/g;function H_(t){return(typeof t=="string"?t:""+t).replace(iO,`
|
|
9
|
+
`).replace(sO,"")}function EL(t,e){return e=H_(e),H_(t)===e}function Ie(t,e,a,r,n,o){switch(a){case"children":typeof r=="string"?e==="body"||e==="textarea"&&r===""||rs(t,r):(typeof r=="number"||typeof r=="bigint")&&e!=="body"&&rs(t,""+r);break;case"className":ed(t,"class",r);break;case"tabIndex":ed(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":ed(t,a,r);break;case"style":kC(t,r,o);break;case"data":if(e!=="object"){ed(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=md(""+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"&&Ie(t,e,"name",n.name,n,null),Ie(t,e,"formEncType",n.formEncType,n,null),Ie(t,e,"formMethod",n.formMethod,n,null),Ie(t,e,"formTarget",n.formTarget,n,null)):(Ie(t,e,"encType",n.encType,n,null),Ie(t,e,"method",n.method,n,null),Ie(t,e,"target",n.target,n,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=md(""+r),t.setAttribute(a,r);break;case"onClick":r!=null&&(t.onclick=Hr);break;case"onScroll":r!=null&&de("scroll",t);break;case"onScrollEnd":r!=null&&de("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(O(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(O(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=md(""+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":de("beforetoggle",t),de("toggle",t),hd(t,"popover",r);break;case"xlinkActuate":Rr(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Rr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Rr(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Rr(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Rr(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Rr(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Rr(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Rr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Rr(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":hd(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=N2.get(a)||a,hd(t,a,r))}}function fg(t,e,a,r,n,o){switch(a){case"style":kC(t,r,o);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(O(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(O(60));t.innerHTML=a}}break;case"children":typeof r=="string"?rs(t,r):(typeof r=="number"||typeof r=="bigint")&&rs(t,""+r);break;case"onScroll":r!=null&&de("scroll",t);break;case"onScrollEnd":r!=null&&de("scrollend",t);break;case"onClick":r!=null&&(t.onclick=Hr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bC.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[aa]||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,""):hd(t,a,r)}}}function Tt(t,e,a){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":de("error",t),de("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(O(137,e));default:Ie(t,e,o,i,a,null)}}n&&Ie(t,e,"srcSet",a.srcSet,a,null),r&&Ie(t,e,"src",a.src,a,null);return;case"input":de("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(O(137,e));break;default:Ie(t,e,r,c,a,null)}}CC(t,o,s,l,u,i,n,!1);return;case"select":de("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:Ie(t,e,n,s,a,null)}e=o,a=i,t.multiple=!!r,e!=null?Xi(t,!!r,e,!1):a!=null&&Xi(t,!!r,a,!0);return;case"textarea":de("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(O(91));break;default:Ie(t,e,i,s,a,null)}LC(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":Ie(t,e,l,r,a,null));return;case"dialog":de("beforetoggle",t),de("toggle",t),de("cancel",t),de("close",t);break;case"iframe":case"object":de("load",t);break;case"video":case"audio":for(r=0;r<$l.length;r++)de($l[r],t);break;case"image":de("error",t),de("load",t);break;case"details":de("toggle",t);break;case"embed":case"source":case"link":de("error",t),de("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(O(137,e));default:Ie(t,e,u,r,a,null)}return;default:if(Ag(e)){for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!==void 0&&fg(t,e,c,r,a,void 0));return}}for(s in a)a.hasOwnProperty(s)&&(r=a[s],r!=null&&Ie(t,e,s,r,a,null))}function lO(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(h in a){var d=a[h];if(a.hasOwnProperty(h)&&d!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":l=d;default:r.hasOwnProperty(h)||Ie(t,e,h,null,r,d)}}for(var f in r){var h=r[f];if(d=a[f],r.hasOwnProperty(f)&&(h!=null||d!=null))switch(f){case"type":o=h;break;case"name":n=h;break;case"checked":u=h;break;case"defaultChecked":c=h;break;case"value":i=h;break;case"defaultValue":s=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(O(137,e));break;default:h!==d&&Ie(t,e,f,h,r,d)}}Nm(t,i,s,l,u,c,o,n);return;case"select":h=i=s=f=null;for(o in a)if(l=a[o],a.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":h=l;default:r.hasOwnProperty(o)||Ie(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":f=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:o!==l&&Ie(t,e,n,o,r,l)}e=s,a=i,r=h,f!=null?Xi(t,!!a,f,!1):!!r!=!!a&&(e!=null?Xi(t,!!a,e,!0):Xi(t,!!a,a?[]:"",!1));return;case"textarea":h=f=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:Ie(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":f=n;break;case"defaultValue":h=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(O(91));break;default:n!==o&&Ie(t,e,i,n,r,o)}wC(t,f,h);return;case"option":for(var S in a)f=a[S],a.hasOwnProperty(S)&&f!=null&&!r.hasOwnProperty(S)&&(S==="selected"?t.selected=!1:Ie(t,e,S,null,r,f));for(l in r)f=r[l],h=a[l],r.hasOwnProperty(l)&&f!==h&&(f!=null||h!=null)&&(l==="selected"?t.selected=f&&typeof f!="function"&&typeof f!="symbol":Ie(t,e,l,f,r,h));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 x in a)f=a[x],a.hasOwnProperty(x)&&f!=null&&!r.hasOwnProperty(x)&&Ie(t,e,x,null,r,f);for(u in r)if(f=r[u],h=a[u],r.hasOwnProperty(u)&&f!==h&&(f!=null||h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(O(137,e));break;default:Ie(t,e,u,f,r,h)}return;default:if(Ag(e)){for(var b in a)f=a[b],a.hasOwnProperty(b)&&f!==void 0&&!r.hasOwnProperty(b)&&fg(t,e,b,void 0,r,f);for(c in r)f=r[c],h=a[c],!r.hasOwnProperty(c)||f===h||f===void 0&&h===void 0||fg(t,e,c,f,r,h);return}}for(var g in a)f=a[g],a.hasOwnProperty(g)&&f!=null&&!r.hasOwnProperty(g)&&Ie(t,e,g,null,r,f);for(d in r)f=r[d],h=a[d],!r.hasOwnProperty(d)||f===h||f==null&&h==null||Ie(t,e,d,f,r,h)}function U_(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uO(){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&&U_(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&&U_(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 pg=null,hg=null;function Qd(t){return t.nodeType===9?t:t.ownerDocument}function z_(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 TL(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 mg(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 Lm=null;function cO(){var t=window.event;return t&&t.type==="popstate"?t===Lm?!1:(Lm=t,!0):(Lm=null,!1)}var RL=typeof setTimeout=="function"?setTimeout:void 0,dO=typeof clearTimeout=="function"?clearTimeout:void 0,q_=typeof Promise=="function"?Promise:void 0,fO=typeof queueMicrotask=="function"?queueMicrotask:typeof q_<"u"?function(t){return q_.resolve(null).then(t).catch(pO)}:RL;function pO(t){setTimeout(function(){throw t})}function Yn(t){return t==="head"}function V_(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),ds(e);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")Dl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Dl(a);for(var o=a.firstChild;o;){var i=o.nextSibling,s=o.nodeName;o[Jl]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&Dl(t.ownerDocument.body);a=n}while(a);ds(e)}function $_(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 gg(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":gg(a),Ig(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function hO(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[Jl])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=Na(t.nextSibling),t===null)break}return null}function mO(t,e,a){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Na(t.nextSibling),t===null))return null;return t}function ML(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=Na(t.nextSibling),t===null))return null;return t}function vg(t){return t.data==="$?"||t.data==="$~"}function yg(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function gO(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 Na(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 xg=null;function j_(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(e===0)return Na(t.nextSibling);e--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||e++}t=t.nextSibling}return null}function G_(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 OL(t,e,a){switch(e=Qd(a),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 Dl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Ig(t)}var Fa=new Map,W_=new Set;function Jd(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Xr=_e.d;_e.d={f:vO,r:yO,D:xO,C:bO,L:SO,m:_O,X:wO,S:CO,M:LO};function vO(){var t=Xr.f(),e=vf();return t||e}function yO(t){var e=ps(t);e!==null&&e.tag===5&&e.type==="form"?kw(e):Xr.r(t)}var vs=typeof document>"u"?null:document;function DL(t,e,a){var r=vs;if(r&&typeof e=="string"&&e){var n=Oa(e);n='link[rel="'+t+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),W_.has(n)||(W_.add(n),t={rel:t,crossOrigin:a,href:e},r.querySelector(n)===null&&(e=r.createElement("link"),Tt(e,"link",t),_t(e),r.head.appendChild(e)))}}function xO(t){Xr.D(t),DL("dns-prefetch",t,null)}function bO(t,e){Xr.C(t,e),DL("preconnect",t,e)}function SO(t,e,a){Xr.L(t,e,a);var r=vs;if(r&&t&&e){var n='link[rel="preload"][as="'+Oa(e)+'"]';e==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+Oa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+Oa(a.imageSizes)+'"]')):n+='[href="'+Oa(t)+'"]';var o=n;switch(e){case"style":o=cs(t);break;case"script":o=ys(t)}Fa.has(o)||(t=Ve({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),Fa.set(o,t),r.querySelector(n)!==null||e==="style"&&r.querySelector(ou(o))||e==="script"&&r.querySelector(iu(o))||(e=r.createElement("link"),Tt(e,"link",t),_t(e),r.head.appendChild(e)))}}function _O(t,e){Xr.m(t,e);var a=vs;if(a&&t){var r=e&&typeof e.as=="string"?e.as:"script",n='link[rel="modulepreload"][as="'+Oa(r)+'"][href="'+Oa(t)+'"]',o=n;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ys(t)}if(!Fa.has(o)&&(t=Ve({rel:"modulepreload",href:t},e),Fa.set(o,t),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(iu(o)))return}r=a.createElement("link"),Tt(r,"link",t),_t(r),a.head.appendChild(r)}}}function CO(t,e,a){Xr.S(t,e,a);var r=vs;if(r&&t){var n=Zi(r).hoistableStyles,o=cs(t);e=e||"default";var i=n.get(o);if(!i){var s={loading:0,preload:null};if(i=r.querySelector(ou(o)))s.loading=5;else{t=Ve({rel:"stylesheet",href:t,"data-precedence":e},a),(a=Fa.get(o))&&fv(t,a);var l=i=r.createElement("link");_t(l),Tt(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,Ld(i,e,r)}i={type:"stylesheet",instance:i,count:1,state:s},n.set(o,i)}}}function wO(t,e){Xr.X(t,e);var a=vs;if(a&&t){var r=Zi(a).hoistableScripts,n=ys(t),o=r.get(n);o||(o=a.querySelector(iu(n)),o||(t=Ve({src:t,async:!0},e),(e=Fa.get(n))&&pv(t,e),o=a.createElement("script"),_t(o),Tt(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function LO(t,e){Xr.M(t,e);var a=vs;if(a&&t){var r=Zi(a).hoistableScripts,n=ys(t),o=r.get(n);o||(o=a.querySelector(iu(n)),o||(t=Ve({src:t,async:!0,type:"module"},e),(e=Fa.get(n))&&pv(t,e),o=a.createElement("script"),_t(o),Tt(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function Z_(t,e,a,r){var n=(n=Nn.current)?Jd(n):null;if(!n)throw Error(O(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=cs(a.href),a=Zi(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=cs(a.href);var o=Zi(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(ou(t)))&&!o._p&&(i.instance=o,i.state.loading=5),Fa.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},Fa.set(t,a),o||kO(n,t,a,i.state))),e&&r===null)throw Error(O(528,""));return i}if(e&&r!==null)throw Error(O(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=ys(a),a=Zi(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(O(444,t))}}function cs(t){return'href="'+Oa(t)+'"'}function ou(t){return'link[rel="stylesheet"]['+t+"]"}function BL(t){return Ve({},t,{"data-precedence":t.precedence,precedence:null})}function kO(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}),Tt(e,"link",a),_t(e),t.head.appendChild(e))}function ys(t){return'[src="'+Oa(t)+'"]'}function iu(t){return"script[async]"+t}function X_(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var r=t.querySelector('style[data-href~="'+Oa(a.href)+'"]');if(r)return e.instance=r,_t(r),r;var n=Ve({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),_t(r),Tt(r,"style",n),Ld(r,a.precedence,t),e.instance=r;case"stylesheet":n=cs(a.href);var o=t.querySelector(ou(n));if(o)return e.state.loading|=4,e.instance=o,_t(o),o;r=BL(a),(n=Fa.get(n))&&fv(r,n),o=(t.ownerDocument||t).createElement("link"),_t(o);var i=o;return i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),Tt(o,"link",r),e.state.loading|=4,Ld(o,a.precedence,t),e.instance=o;case"script":return o=ys(a.src),(n=t.querySelector(iu(o)))?(e.instance=n,_t(n),n):(r=a,(n=Fa.get(o))&&(r=Ve({},a),pv(r,n)),t=t.ownerDocument||t,n=t.createElement("script"),_t(n),Tt(n,"link",r),t.head.appendChild(n),e.instance=n);case"void":return null;default:throw Error(O(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(r=e.instance,e.state.loading|=4,Ld(r,a.precedence,t));return e.instance}function Ld(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 fv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function pv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var kd=null;function K_(t,e,a){if(kd===null){var r=new Map,n=kd=new Map;n.set(a,r)}else n=kd,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[Jl]||o[It]||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 Y_(t,e,a){t=t.ownerDocument||t,t.head.insertBefore(a,e==="title"?t.querySelector("head > title"):null)}function IO(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 PL(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function AO(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=cs(r.href),o=e.querySelector(ou(n));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=ef.bind(t),e.then(t,t)),a.state.loading|=4,a.instance=o,_t(o);return}o=e.ownerDocument||e,r=BL(r),(n=Fa.get(n))&&fv(r,n),o=o.createElement("link"),_t(o);var i=o;i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),Tt(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=ef.bind(t),e.addEventListener("load",a),e.addEventListener("error",a))}}var km=0;function EO(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&&km===0&&(km=62500*uO());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>km?50:800)+e);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function ef(){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 tf=null;function Id(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,tf=new Map,e.forEach(TO,t),tf=null,ef.call(t))}function TO(t,e){if(!(e.state.loading&4)){var a=tf.get(t);if(a)var r=a.get(null);else{a=new Map,tf.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=ef.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 Gl={$$typeof:Fr,Provider:null,Consumer:null,_currentValue:Ro,_currentValue2:Ro,_threadCount:0};function RO(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=Qh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qh(0),this.hiddenUpdates=Qh(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 NL(t,e,a,r,n,o,i,s,l,u,c,d){return t=new RO(t,e,a,i,l,u,c,d,s),e=1,o===!0&&(e|=24),o=pa(3,null,null,e),t.current=o,o.stateNode=t,e=Hg(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:r,isDehydrated:a,cache:e},qg(o),t}function FL(t){return t?(t=$i,t):$i}function HL(t,e,a,r,n,o){n=FL(n),r.context===null?r.context=n:r.pendingContext=n,r=Hn(e),r.payload={element:a},o=o===void 0?null:o,o!==null&&(r.callback=o),a=Un(t,r,e),a!==null&&(ta(a,t,e),kl(a,t,e))}function Q_(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<e?a:e}}function hv(t,e){Q_(t,e),(t=t.alternate)&&Q_(t,e)}function UL(t){if(t.tag===13||t.tag===31){var e=$o(t,67108864);e!==null&&ta(e,t,67108864),hv(t,67108864)}}function J_(t){if(t.tag===13||t.tag===31){var e=ya();e=Lg(e);var a=$o(t,e);a!==null&&ta(a,t,e),hv(t,e)}}var af=!0;function MO(t,e,a,r){var n=ae.T;ae.T=null;var o=_e.p;try{_e.p=2,mv(t,e,a,r)}finally{_e.p=o,ae.T=n}}function OO(t,e,a,r){var n=ae.T;ae.T=null;var o=_e.p;try{_e.p=8,mv(t,e,a,r)}finally{_e.p=o,ae.T=n}}function mv(t,e,a,r){if(af){var n=bg(r);if(n===null)wm(t,e,r,rf,a),eC(t,r);else if(BO(n,t,e,a,r))r.stopPropagation();else if(eC(t,r),e&4&&-1<DO.indexOf(t)){for(;n!==null;){var o=ps(n);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=Ao(o.pendingLanes);if(i!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var l=1<<31-va(i);s.entanglements[1]|=l,i&=~l}br(o),(Se&6)===0&&(Gd=ma()+500,nu(0,!1))}}break;case 31:case 13:s=$o(o,2),s!==null&&ta(s,o,2),vf(),hv(o,2)}if(o=bg(r),o===null&&wm(t,e,r,rf,a),o===n)break;n=o}n!==null&&r.stopPropagation()}else wm(t,e,r,null,a)}}function bg(t){return t=Eg(t),gv(t)}var rf=null;function gv(t){if(rf=null,t=Fi(t),t!==null){var e=Xl(t);if(e===null)t=null;else{var a=e.tag;if(a===13){if(t=iC(e),t!==null)return t;t=null}else if(a===31){if(t=sC(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 rf=t,null}function zL(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(S2()){case dC:return 2;case fC:return 8;case Md:case _2:return 32;case pC:return 268435456;default:return 32}default:return 32}}var Sg=!1,Vn=null,$n=null,jn=null,Wl=new Map,Zl=new Map,Rn=[],DO="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 eC(t,e){switch(t){case"focusin":case"focusout":Vn=null;break;case"dragenter":case"dragleave":$n=null;break;case"mouseover":case"mouseout":jn=null;break;case"pointerover":case"pointerout":Wl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zl.delete(e.pointerId)}}function ml(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=ps(e),e!==null&&UL(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,n!==null&&e.indexOf(n)===-1&&e.push(n),t)}function BO(t,e,a,r,n){switch(e){case"focusin":return Vn=ml(Vn,t,e,a,r,n),!0;case"dragenter":return $n=ml($n,t,e,a,r,n),!0;case"mouseover":return jn=ml(jn,t,e,a,r,n),!0;case"pointerover":var o=n.pointerId;return Wl.set(o,ml(Wl.get(o)||null,t,e,a,r,n)),!0;case"gotpointercapture":return o=n.pointerId,Zl.set(o,ml(Zl.get(o)||null,t,e,a,r,n)),!0}return!1}function qL(t){var e=Fi(t.target);if(e!==null){var a=Xl(e);if(a!==null){if(e=a.tag,e===13){if(e=iC(a),e!==null){t.blockedOn=e,NS(t.priority,function(){J_(a)});return}}else if(e===31){if(e=sC(a),e!==null){t.blockedOn=e,NS(t.priority,function(){J_(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 Ad(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var a=bg(t.nativeEvent);if(a===null){a=t.nativeEvent;var r=new a.constructor(a.type,a);Hm=r,a.target.dispatchEvent(r),Hm=null}else return e=ps(a),e!==null&&UL(e),t.blockedOn=a,!1;e.shift()}return!0}function tC(t,e,a){Ad(t)&&a.delete(e)}function PO(){Sg=!1,Vn!==null&&Ad(Vn)&&(Vn=null),$n!==null&&Ad($n)&&($n=null),jn!==null&&Ad(jn)&&(jn=null),Wl.forEach(tC),Zl.forEach(tC)}function fd(t,e){t.blockedOn===e&&(t.blockedOn=null,Sg||(Sg=!0,yt.unstable_scheduleCallback(yt.unstable_NormalPriority,PO)))}var pd=null;function aC(t){pd!==t&&(pd=t,yt.unstable_scheduleCallback(yt.unstable_NormalPriority,function(){pd===t&&(pd=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(gv(r||a)===null)continue;break}var o=ps(a);o!==null&&(t.splice(e,3),e-=3,tg(o,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function ds(t){function e(l){return fd(l,t)}Vn!==null&&fd(Vn,t),$n!==null&&fd($n,t),jn!==null&&fd(jn,t),Wl.forEach(e),Zl.forEach(e);for(var a=0;a<Rn.length;a++){var r=Rn[a];r.blockedOn===t&&(r.blockedOn=null)}for(;0<Rn.length&&(a=Rn[0],a.blockedOn===null);)qL(a),a.blockedOn===null&&Rn.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[aa]||null;if(typeof o=="function")i||aC(a);else if(i){var s=null;if(o&&o.hasAttribute("formAction")){if(n=o,i=o[aa]||null)s=i.formAction;else if(gv(n)!==null)continue}else s=i.action;typeof s=="function"?a[r+1]=s:(a.splice(r,3),r-=3),aC(a)}}}function VL(){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 vv(t){this._internalRoot=t}bf.prototype.render=vv.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(O(409));var a=e.current,r=ya();HL(a,r,t,e,null,null)};bf.prototype.unmount=vv.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;HL(t.current,2,null,t,null,null),vf(),e[fs]=null}};function bf(t){this._internalRoot=t}bf.prototype.unstable_scheduleHydration=function(t){if(t){var e=yC();t={blockedOn:null,target:t,priority:e};for(var a=0;a<Rn.length&&e!==0&&e<Rn[a].priority;a++);Rn.splice(a,0,t),a===0&&qL(t)}};var rC=nC.version;if(rC!=="19.2.1")throw Error(O(527,rC,"19.2.1"));_e.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=h2(e),t=t!==null?lC(t):null,t=t===null?null:t.stateNode,t};var NO={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:ae,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(gl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!gl.isDisabled&&gl.supportsFiber))try{Kl=gl.inject(NO),ga=gl}catch{}var gl;Sf.createRoot=function(t,e){if(!oC(t))throw Error(O(299));var a=!1,r="",n=Dw,o=Bw,i=Pw;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=NL(t,1,!1,null,null,a,r,null,n,o,i,VL),t[fs]=e.current,dv(t),new vv(e)};Sf.hydrateRoot=function(t,e,a){if(!oC(t))throw Error(O(299));var r=!1,n="",o=Dw,i=Bw,s=Pw,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=NL(t,1,!0,e,a??null,r,n,l,o,i,s,VL),e.context=FL(null),a=e.current,r=ya(),r=Lg(r),n=Hn(r),n.callback=null,Un(a,n,r),a=r,e.current.lanes=a,Ql(e,a),br(e),t[fs]=e.current,dv(t),new bf(e)};Sf.version="19.2.1"});var Go=fr((pU,GL)=>{"use strict";function jL(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(jL)}catch(t){console.error(t)}}jL(),GL.exports=$L()});var qk=fr(Hf=>{"use strict";var MD=Symbol.for("react.transitional.element"),OD=Symbol.for("react.fragment");function zk(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:MD,type:t,key:r,ref:e!==void 0?e:null,props:a}}Hf.Fragment=OD;Hf.jsx=zk;Hf.jsxs=zk});var Ee=fr((Tz,Vk)=>{"use strict";Vk.exports=qk()});var NR=Y(tt(),1),Eh=Y(il(),1),nU=Y(Go(),1);function WL(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 f of d)for(let h of f.removedNodes)if(h===t){if(s>=n){c.disconnect(),u=!0;return}l&&clearTimeout(l),l=setTimeout(()=>{if(!u){if(!e.isConnected){c.disconnect(),u=!0;return}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 FO=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button","svg","path","circle","line","polyline","polygon","rect","g"]);function yv(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=[];for(;n.nextNode();){let s=n.currentNode,l=s.tagName.toLowerCase();if(!FO.has(l)){o.push(s);continue}for(let u of Array.from(s.attributes)){let c=u.name.toLowerCase(),d=u.value.trim().toLowerCase(),f=c.startsWith("on"),S=(c==="href"||c==="src"||c==="formaction")&&(d.startsWith("javascript:")||d.startsWith("vbscript:")||d.startsWith("data:text/html"));(f||S)&&s.removeAttribute(u.name)}}let i=Array.from(r.querySelectorAll("svg"));for(let s of i)o.some(l=>s.contains(l)&&l.tagName.toLowerCase()==="script")&&o.push(s);for(let s of o){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return a.innerHTML}var ZL=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=yv(t.html),n="data-syntro-insert-label",o=t.label;if(o){let d=CSS.escape(o),h=(a.parentElement??a).querySelector(`[${n}="${d}"]`);h&&h.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:f}=t.deepLink;l=()=>{let h=window.SynOS?.handle;h&&(h.open(),h.runtime?.events?.publish("notification.deep_link",{tileId:d,itemId:f}))},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=WL(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(),!!i.isConnected)try{if(t.position==="replace"&&s!==null){let d=document.createElement(a.tagName);d.innerHTML=s,Array.from(a.attributes).forEach(f=>{d.setAttribute(f.name,f.value)}),i.replaceWith(d)}else i.remove()}catch{}},updateFn:d=>{"html"in d&&typeof d.html=="string"&&(i.innerHTML=yv(d.html))}}},XL=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.isConnected&&(a.textContent=r)},updateFn:n=>{"text"in n&&typeof n.text=="string"&&(a.textContent=n.text)}}},KL=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:()=>{a.isConnected&&(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)}}},YL=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:()=>{a.isConnected&&(r||a.classList.remove(t.className))}}},QL=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:()=>{a.isConnected&&r&&a.classList.add(t.className)}}},JL=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:()=>{if(a.isConnected)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)}}},xv=[{kind:"content:insertHtml",executor:ZL},{kind:"content:setText",executor:XL},{kind:"content:setAttr",executor:KL},{kind:"content:addClass",executor:YL},{kind:"content:removeClass",executor:QL},{kind:"content:setStyle",executor:JL}],bv={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:xv};var HO={light:50,medium:100,heavy:200},UO=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],ek={init(t,e,a){let r=HO[a.intensity],n=a.colors.length>0?a.colors:UO,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 zO={light:20,medium:40,heavy:80},qO="\u{1F389}",tk={init(t,e,a){let r=zO[a.intensity],n=typeof a.props?.emoji=="string"?a.props.emoji:qO,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 VO={light:20,medium:40,heavy:80},$O={light:3,medium:4,heavy:5},ak={init(t,e,a){let r=VO[a.intensity],n=$O[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 f=Math.PI*2*d/r+(Math.random()-.5)*.3,h=Math.random()*3+2;i.push({x:l,y:u,vx:Math.cos(f)*h,vy:Math.sin(f)*h,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 jO={light:30,medium:60,heavy:120},rk={init(t,e,a){let r=jO[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 _f=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){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;this.container=e,this.effect=a,this.duration=r.duration;let o=document.createElement("canvas");o.setAttribute("data-syntro-celebrate",""),Object.assign(o.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let i=window.devicePixelRatio||1,s=window.innerWidth,l=window.innerHeight;o.width=s*i,o.height=l*i,o.style.width=`${s}px`,o.style.height=`${l}px`;let u=o.getContext("2d");u&&(u.scale(i,i),this.canvas=o,this.ctx=u,e.appendChild(o),this.particles=a.init(s,l,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 GO=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"];function WO(t,e){return[t,e,`${t}cc`,`${e}cc`,"#ffffff",`${t}80`]}function ZO(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 WO(a,r||a)}catch{}return null}var nk=new Map([["confetti",ek],["fireworks",ak],["sparkles",rk],["emoji-rain",tk]]),ok=async(t,e)=>{let a=nk.get(t.effect);if(!a)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...nk.keys()].join(", ")}`),{cleanup:()=>{}};let r=t.colors??ZO(e.overlayRoot)??GO,n={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:r,props:t.props},o=new _f;return o.start(e.overlayRoot,a,n),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{o.stop()}}};var _v="syntro_active_tour",Cf=new Map;function XO(t){try{let e=localStorage.getItem(_v);if(!e)return null;let a=JSON.parse(e);return a.tourId!==t?null:a}catch{return null}}function Sv(t){try{localStorage.setItem(_v,JSON.stringify(t))}catch{}}function KO(){try{localStorage.removeItem(_v)}catch{}}function su(){return window.location.pathname}function YO(t){if(!t.route)return!0;let e=su();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var Cv=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(Cf.has(a))return{cleanup:async()=>{let y=Cf.get(a);y&&await y.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let i=XO(a),s=!!i;if(!s&&!o)return{cleanup:()=>{}};i||(i={tourId:a,currentStepId:n||r[0].id,startedAt:Date.now()},Sv(i));let l=r.findIndex(y=>y.id===i.currentStepId);if(l===-1){let y=n||r[0].id;l=r.findIndex(v=>v.id===y),l===-1&&(l=0),i.currentStepId=r[l].id,Sv(i)}let u=r[l];if(!YO(u))return e.publishEvent("tour.waiting_for_route",{tourId:a,stepId:u.id,expectedRoute:u.route,currentRoute:su()}),{cleanup:()=>{}};let c=!1,d=null,f=null,h=null,S=async()=>{f&&(f(),f=null),d?.isApplied()&&(await d.revert(),d=null)},x=async y=>{if(c)return;if(await S(),y==="end"){KO(),e.publishEvent("tour.completed",{tourId:a,totalSteps:r.length}),c=!0;return}let v=r.find(C=>C.id===y);if(!v){console.error(`[Tour] Step "${y}" not found`);return}if(i.currentStepId=y,Sv(i),e.publishEvent("tour.step_changed",{tourId:a,previousStepId:u.id,nextStepId:y}),v.route&&v.route!==su()){e.publishEvent("tour.awaiting_navigation",{tourId:a,stepId:y,targetRoute:v.route});return}await b(v)},b=async y=>{if(!c){e.publishEvent("tour.step_started",{tourId:a,stepId:y.id,stepIndex:r.findIndex(v=>v.id===y.id),totalSteps:r.length});try{d=await e.applyAction(y.action)}catch(v){console.error(`[Tour] Failed to execute step "${y.id}":`,v),e.publishEvent("tour.step_failed",{tourId:a,stepId:y.id,error:String(v)});return}if(y.onAction&&e.subscribeEvent){f=e.subscribeEvent("action.modal_cta_clicked",w=>{let _=w?.actionId;if(_&&y.onAction){let L=y.onAction[_];L&&x(L)}});let v=e.subscribeEvent("action.tooltip_cta_clicked",w=>{let _=w?.actionId;if(_&&y.onAction){let L=y.onAction[_];L&&x(L)}}),C=f;f=()=>{C(),v()}}}};h=(()=>{let y=su(),v=()=>{let _=su();_!==y&&(y=_,e.publishEvent("tour.route_changed",{tourId:a,newRoute:_}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>v());window.addEventListener("popstate",v);let C=history.pushState.bind(history),w=history.replaceState.bind(history);return history.pushState=(..._)=>{C(..._),queueMicrotask(v)},history.replaceState=(..._)=>{w(..._),queueMicrotask(v)},()=>{window.removeEventListener("popstate",v),history.pushState=C,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 b(u);let m=async()=>{c=!0,Cf.delete(a),await S(),h&&h(),e.publishEvent("tour.paused",{tourId:a,stepId:i.currentStepId})};return Cf.set(a,{cleanup:m}),{cleanup:m}};var Qa={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"},k={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"},De={0:"#07230a",1:"#0e4514",2:"#16681e",3:"#1d8a28",4:"#24ad32",5:"#4fbd5a",6:"#7acd82",7:"#a5deab",8:"#d0eed3",9:"#e5f6e7"},Rt={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},Xe={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},Sa={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},lu={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},wt={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},uu={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var _a={primary:k[10],secondary:k[9],tertiary:k[8]},RU={primary:k[2],secondary:k[0]},wv={primary:k[4],secondary:k[3]},wf={primary:{text:Qa.white,icon:Qa.white,border:ne[3],backgroundDefault:ne[3],backgroundHover:ne[2]},neutral:{text:k[10],textHover:Qa.white,icon:k[10],iconHover:Qa.white,border:k[4],background:k[2]},link:{text:Qa.white,icon:Qa.white,hover:ne[5]},error:{text:Xe[5],hover:Xe[6]},success:{text:De[5],hover:De[6]}},MU={slateGrey:{content:k[10],pillOutline:k[10],borderPrimary:k[5],borderSecondary:k[5],background:k[3]},brand:{content:ne[9],pillOutline:ne[9],borderPrimary:ne[6],borderSecondary:ne[6],background:ne[0]},red:{content:Xe[8],pillOutline:Xe[4],borderPrimary:Xe[2],borderSecondary:Xe[2],background:Xe[0]},yellow:{content:Rt[8],pillOutline:Rt[4],borderPrimary:Rt[2],borderSecondary:Rt[2],background:Rt[0]},green:{content:De[8],pillOutline:De[4],borderPrimary:De[2],borderSecondary:De[2],background:De[0]},purple:{content:wt[8],pillOutline:wt[4],borderPrimary:wt[2],borderSecondary:wt[2],background:wt[0]},blue:{content:Sa[8],pillOutline:Sa[4],borderPrimary:Sa[2],borderSecondary:Sa[2],background:Sa[0]},orange:{content:lu[8],pillOutline:lu[4],borderPrimary:lu[2],borderSecondary:lu[2],background:lu[0]},pink:{content:uu[8],pillOutline:uu[4],borderPrimary:uu[2],borderSecondary:uu[2],background:uu[0]}},OU={green:{content:De[8],border:De[2],background:De[0]},yellow:{content:Rt[8],border:Rt[2],background:Rt[0]},red:{content:Xe[8],border:Xe[2],background:Xe[0]}},DU={green:{content:De[1],background:De[9]},yellow:{content:Rt[1],background:Rt[9]},red:{content:Xe[1],background:Xe[9]}},BU={content:k[10],border:k[4],background:k[3]},PU={backgroundDefault:k[2],backgroundHover:k[1],selected:k[3]},NU={background:k[2],icon:k[10],borderDefault:k[4],borderSelected:ne[3],textLabel:k[9],textPlaceholder:k[8],textHint:k[8]},FU={backgroundDefault:k[2],backgroundDisabled:k[0],textLabel:k[9],textPlaceholder:k[8],textHint:k[8],textError:Xe[5],iconDefault:k[9],iconPlaceholder:k[10],iconError:Xe[5],borderDefault:k[4],borderSelected:ne[3],borderError:Xe[5]},HU={handleDefault:Qa.white,handleDisabled:k[10],off:{backgroundDefault:k[4],backgroundHover:k[5],backgroundDisabled:k[4]},on:{backgroundDefault:De[3],backgroundHover:De[2],backgroundDisabled:k[4]}},UU={off:{backgroundDefault:"#00000000",backgroundHover:k[5],backgroundDisabled:k[2],border:k[6]},on:{backgroundDefault:De[0],backgroundHover:De[1],backgroundDisabled:k[2],border:De[3]}},zU={content:k[10],background:k[4]},qU={background:k[4],active:De[3]},VU={background:k[1],content:k[9],border:k[4]},$U={backgroundDefault:k[1],backgroundHover:k[3],backgroundActive:k[4],border:k[4],contentPrimary:k[10],contentSecondary:k[9],contentTertiary:k[8]},jU={background:k[1],content:k[9],border:k[4]},GU={activeBackground:k[3],activeContent:ne[5],inactiveContent:k[9],border:k[4]},WU={header:{textDefault:k[9],textHover:k[8],backgroundDefault:k[1]},border:k[4],cell:{textPrimary:k[10],textSecondary:k[9],backgroundDefault:k[2],backgroundHover:k[1]}},ZU={textPrimaryDefault:k[10],textPrimaryHover:k[10],textSecondaryDefault:k[8],textSecondaryHover:k[9],iconPrimary:k[10],iconSecondary:k[8]},XU={background:De[1],active:De[5]},KU={textDefault:k[10],textSelected:Qa.white,textDisabled:k[7],backgroundDefault:k[2],backgroundMiddle:k[3],backgroundSelected:ne[3],border:k[4]},YU=k[9];var ik=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function sk(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, ${Sa[5]})`,s=a?.blocking??!1,l=a?.onClickOutside??!0,u=a?.onEsc??!0,c=getComputedStyle(document.documentElement),d=c.getPropertyValue("--syntro-spotlight-backdrop").trim(),f=c.getPropertyValue("--syntro-ring").trim(),h=document.createElement("div");h.className="syntro-spotlight-scrim";let S=s||l;Object.assign(h.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(h),requestAnimationFrame(()=>h.style.opacity="1");let x=document.createElement("div");x.className="syntro-spotlight-ring",Object.assign(x.style,{position:"fixed",pointerEvents:"none",borderRadius:`${n}px`,border:`2px solid ${i||f||Sa[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(x);let b=[];if(!ik)for(let I=0;I<4;I++){let A=document.createElement("div");A.style.position="fixed",A.style.background="inherit",b.push(A),h.appendChild(A)}let g=I=>{h.style.clipPath=I,h.style.webkitClipPath=I},m=()=>{if(!t.isConnected){L.destroy();return}let I=t.getBoundingClientRect(),A=I.left-r,T=I.top-r,N=I.width+r*2,B=I.height+r*2;if(Object.assign(x.style,{left:`${A}px`,top:`${T}px`,width:`${N}px`,height:`${B}px`}),ik){let F=window.innerWidth,H=window.innerHeight,R=Math.min(n,N/2,B/2),z=`M 0 0 L ${F} 0 L ${F} ${H} L 0 ${H} Z`,M=`M ${A+R} ${T} A ${R} ${R} 0 0 0 ${A} ${T+R} L ${A} ${T+B-R} A ${R} ${R} 0 0 0 ${A+R} ${T+B} L ${A+N-R} ${T+B} A ${R} ${R} 0 0 0 ${A+N} ${T+B-R} L ${A+N} ${T+R} A ${R} ${R} 0 0 0 ${A+N-R} ${T} L ${A+R} ${T} Z`;g(`path('${z} ${M}')`)}else{let[F,H,R,z]=b;Object.assign(F.style,{left:"0px",top:"0px",width:"100vw",height:`${T}px`}),Object.assign(R.style,{left:"0px",top:`${T+B}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(T+B))}px`}),Object.assign(z.style,{left:"0px",top:`${T}px`,width:`${A}px`,height:`${B}px`}),Object.assign(H.style,{left:`${A+N}px`,top:`${T}px`,width:`${Math.max(0,window.innerWidth-(A+N))}px`,height:`${B}px`})}},y=new ResizeObserver(()=>requestAnimationFrame(m));y.observe(t);let v=()=>requestAnimationFrame(m),C=()=>requestAnimationFrame(m);window.addEventListener("scroll",v,!0),window.addEventListener("resize",C);let w=I=>{I.key==="Escape"&&u&&(a?.onDismiss?.(),L.destroy())};u&&window.addEventListener("keydown",w);let _=I=>{s?(I.preventDefault(),I.stopPropagation()):l&&(a?.onDismiss?.(),L.destroy())};h.addEventListener("click",_);let L={destroy(){y.disconnect(),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",C),u&&window.removeEventListener("keydown",w),h.removeEventListener("click",_),h.style.pointerEvents="none",h.style.opacity="0",setTimeout(()=>{try{h.remove()}catch{}try{x.remove()}catch{}},220)}};return m(),L}var QO=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button","svg","path","circle","line","polyline","polygon","rect","g"]);function Ca(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(!QO.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"),f=(u==="href"||u==="src")&&c.startsWith("javascript:");(d||f)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var Wo={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)"},Lv=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
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 u=document.createElement("div");u.className=`syntro-modal syntro-modal-${
|
|
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: ${c[
|
|
21
|
+
max-width: ${c[r]};
|
|
22
22
|
width: 90%;
|
|
23
|
-
background: ${
|
|
24
|
-
border-radius: ${
|
|
23
|
+
background: ${Wo.bg};
|
|
24
|
+
border-radius: ${Wo.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 d="";if(a.title&&(d+=`<h2 class="syntro-modal-title" style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: ${
|
|
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: ${Wo.title};">${Ca(a.title)}</h2>`),d+=`<div class="syntro-modal-body" style="color: ${Wo.text}; line-height: 1.5;">${Ca(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,17 +36,17 @@ Error generating stack: `+n.message+`
|
|
|
36
36
|
border: none;
|
|
37
37
|
cursor: pointer;
|
|
38
38
|
padding: 4px;
|
|
39
|
-
color: ${
|
|
39
|
+
color: ${Wo.text};
|
|
40
40
|
opacity: 0.6;
|
|
41
41
|
" aria-label="Close">
|
|
42
42
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
|
|
43
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"/>
|
|
44
44
|
</svg>
|
|
45
45
|
</button>
|
|
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
|
|
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 C of s){let w=C.primary??!1;d+=`
|
|
47
47
|
<button
|
|
48
|
-
class="syntro-modal-btn ${
|
|
49
|
-
data-syntro-action="${
|
|
48
|
+
class="syntro-modal-btn ${w?"syntro-modal-btn-primary":""}"
|
|
49
|
+
data-syntro-action="${Ca(C.actionId)}"
|
|
50
50
|
style="
|
|
51
51
|
padding: 10px 20px;
|
|
52
52
|
border-radius: 8px;
|
|
@@ -54,12 +54,12 @@ Error generating stack: `+n.message+`
|
|
|
54
54
|
font-weight: 500;
|
|
55
55
|
cursor: pointer;
|
|
56
56
|
transition: background 150ms ease;
|
|
57
|
-
${
|
|
57
|
+
${w?`background: ${Wo.accent}; color: white; border: none;`:`background: transparent; color: ${Wo.accent}; border: 1px solid currentColor; opacity: 0.7;`}
|
|
58
58
|
"
|
|
59
59
|
>
|
|
60
|
-
${
|
|
60
|
+
${Ca(C.label)}
|
|
61
61
|
</button>
|
|
62
|
-
`}d+="</div>"}u.innerHTML=d,e.overlayRoot.appendChild(u);let f=null,m=u.querySelectorAll("[data-syntro-action]"),S=_=>{let C=_.currentTarget.getAttribute("data-syntro-action");C&&(f=C,e.publishEvent("action.modal_cta_clicked",{actionId:C}),y.destroy())};m.forEach(_=>_.addEventListener("click",S));let b=_=>{_.key==="Escape"&&i?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",b);let x=()=>{r||y.destroy()};l.addEventListener("click",x);let p=[];r&&Array.from(document.body.children).forEach(_=>{_!==e.overlayRoot&&_.getAttribute("inert")===null&&!_.querySelector("[data-syntro-editor-panel]")&&!_.hasAttribute("data-syntro-editor-panel")&&(_.setAttribute("inert",""),p.push(_))});let g;i?.timeoutMs&&(g=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:n,blocking:r});let y={destroy(){g&&clearTimeout(g),window.removeEventListener("keydown",b),l.removeEventListener("click",x),m.forEach(_=>_.removeEventListener("click",S)),p.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:f})}};return{cleanup:()=>{y.destroy()}}};var cL=["top","right","bottom","left"];var jr=Math.min,Vn=Math.max,tu=Math.round,au=Math.floor,Za=t=>({x:t,y:t}),P2={left:"right",right:"left",bottom:"top",top:"bottom"},F2={start:"end",end:"start"};function ef(t,e,a){return Vn(t,jr(e,a))}function qo(t,e){return typeof t=="function"?t(e):t}function Gr(t){return t.split("-")[0]}function ds(t){return t.split("-")[1]}function Xg(t){return t==="x"?"y":"x"}function tf(t){return t==="y"?"height":"width"}var N2=new Set(["top","bottom"]);function jn(t){return N2.has(Gr(t))?"y":"x"}function af(t){return Xg(jn(t))}function dL(t,e,a){a===void 0&&(a=!1);let n=ds(t),r=af(t),o=tf(r),i=r==="x"?n===(a?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(i=eu(i)),[i,eu(i)]}function fL(t){let e=eu(t);return[Jd(t),e,Jd(e)]}function Jd(t){return t.replace(/start|end/g,e=>F2[e])}var lL=["left","right"],uL=["right","left"],H2=["top","bottom"],U2=["bottom","top"];function z2(t,e,a){switch(t){case"top":case"bottom":return a?e?uL:lL:e?lL:uL;case"left":case"right":return e?H2:U2;default:return[]}}function pL(t,e,a,n){let r=ds(t),o=z2(Gr(t),a==="start",n);return r&&(o=o.map(i=>i+"-"+r),e&&(o=o.concat(o.map(Jd)))),o}function eu(t){return t.replace(/left|right|bottom|top/g,e=>P2[e])}function q2(t){return{top:0,right:0,bottom:0,left:0,...t}}function Yg(t){return typeof t!="number"?q2(t):{top:t,right:t,bottom:t,left:t}}function $o(t){let{x:e,y:a,width:n,height:r}=t;return{width:n,height:r,top:a,left:e,right:e+n,bottom:a+r,x:e,y:a}}function hL(t,e,a){let{reference:n,floating:r}=t,o=jn(e),i=af(e),s=tf(i),l=Gr(e),u=o==="y",c=n.x+n.width/2-r.width/2,d=n.y+n.height/2-r.height/2,f=n[s]/2-r[s]/2,m;switch(l){case"top":m={x:c,y:n.y-r.height};break;case"bottom":m={x:c,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-r.width,y:d};break;default:m={x:n.x,y:n.y}}switch(ds(e)){case"start":m[i]-=f*(a&&u?-1:1);break;case"end":m[i]+=f*(a&&u?-1:1);break}return m}async function vL(t,e){var a;e===void 0&&(e={});let{x:n,y:r,platform:o,rects:i,elements:s,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=qo(e,t),S=Yg(m),x=s[f?d==="floating"?"reference":"floating":d],p=$o(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})),g=d==="floating"?{x:n,y:r,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},_=$o(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:v,strategy:l}):g);return{top:(p.top-_.top+S.top)/y.y,bottom:(_.bottom-p.bottom+S.bottom)/y.y,left:(p.left-_.left+S.left)/y.x,right:(_.right-p.right+S.right)/y.x}}var yL=async(t,e,a)=>{let{placement:n="bottom",strategy:r="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:r}),{x:c,y:d}=hL(u,n,l),f=n,m={},S=0;for(let x=0;x<s.length;x++){var b;let{name:p,fn:g}=s[x],{x:v,y,data:_,reset:L}=await g({x:c,y:d,initialPlacement:n,placement:f,strategy:r,middlewareData:m,rects:u,platform:{...i,detectOverflow:(b=i.detectOverflow)!=null?b:vL},elements:{reference:t,floating:e}});c=v??c,d=y??d,m={...m,[p]:{...m[p],..._}},L&&S<=50&&(S++,typeof L=="object"&&(L.placement&&(f=L.placement),L.rects&&(u=L.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:r}):L.rects),{x:c,y:d}=hL(u,f,l)),x=-1)}return{x:c,y:d,placement:f,strategy:r,middlewareData:m}},xL=t=>({name:"arrow",options:t,async fn(e){let{x:a,y:n,placement:r,rects:o,platform:i,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=qo(t,e)||{};if(u==null)return{};let d=Yg(c),f={x:a,y:n},m=af(r),S=tf(m),b=await i.getDimensions(u),x=m==="y",p=x?"top":"left",g=x?"bottom":"right",v=x?"clientHeight":"clientWidth",y=o.reference[S]+o.reference[m]-f[m]-o.floating[S],_=f[m]-o.reference[m],L=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u)),C=L?L[v]:0;(!C||!await(i.isElement==null?void 0:i.isElement(L)))&&(C=s.floating[v]||o.floating[S]);let A=y/2-_/2,w=C/2-b[S]/2-1,k=jr(d[p],w),T=jr(d[g],w),D=k,M=C-b[S]-T,P=C/2-b[S]/2+A,F=ef(D,P,M),U=!l.arrow&&ds(r)!=null&&P!==F&&o.reference[S]/2-(P<D?k:T)-b[S]/2<0,V=U?P<D?P-D:P-M:0;return{[m]:f[m]+V,data:{[m]:F,centerOffset:P-F-V,...U&&{alignmentOffset:V}},reset:U}}});var bL=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var a,n;let{placement:r,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:b=!0,...x}=qo(t,e);if((a=o.arrow)!=null&&a.alignmentOffset)return{};let p=Gr(r),g=jn(s),v=Gr(s)===s,y=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=f||(v||!b?[eu(s)]:fL(s)),L=S!=="none";!f&&L&&_.push(...pL(s,b,S,y));let C=[s,..._],A=await l.detectOverflow(e,x),w=[],k=((n=o.flip)==null?void 0:n.overflows)||[];if(c&&w.push(A[p]),d){let P=dL(r,i,y);w.push(A[P[0]],A[P[1]])}if(k=[...k,{placement:r,overflows:w}],!w.every(P=>P<=0)){var T,D;let P=(((T=o.flip)==null?void 0:T.index)||0)+1,F=C[P];if(F&&(!(d==="alignment"?g!==jn(F):!1)||k.every(N=>jn(N.placement)===g?N.overflows[0]>0:!0)))return{data:{index:P,overflows:k},reset:{placement:F}};let U=(D=k.filter(V=>V.overflows[0]<=0).sort((V,N)=>V.overflows[1]-N.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(m){case"bestFit":{var M;let V=(M=k.filter(N=>{if(L){let X=jn(N.placement);return X===g||X==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(X=>X>0).reduce((X,ve)=>X+ve,0)]).sort((N,X)=>N[1]-X[1])[0])==null?void 0:M[0];V&&(U=V);break}case"initialPlacement":U=s;break}if(r!==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 gL(t){return cL.some(e=>t[e]>=0)}var SL=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:a,platform:n}=e,{strategy:r="referenceHidden",...o}=qo(t,e);switch(r){case"referenceHidden":{let i=await n.detectOverflow(e,{...o,elementContext:"reference"}),s=mL(i,a.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:gL(s)}}}case"escaped":{let i=await n.detectOverflow(e,{...o,altBoundary:!0}),s=mL(i,a.floating);return{data:{escapedOffsets:s,escaped:gL(s)}}}default:return{}}}}};var $2=new Set(["left","top"]);async function V2(t,e){let{placement:a,platform:n,elements:r}=t,o=await(n.isRTL==null?void 0:n.isRTL(r.floating)),i=Gr(a),s=ds(a),l=jn(a)==="y",u=$2.has(i)?-1:1,c=o&&l?-1:1,d=qo(e,t),{mainAxis:f,crossAxis:m,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"&&(m=s==="end"?S*-1:S),l?{x:m*c,y:f*u}:{x:f*u,y:m*c}}var CL=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var a,n;let{x:r,y:o,placement:i,middlewareData:s}=e,l=await V2(e,t);return i===((a=s.offset)==null?void 0:a.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:i}}}}},_L=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:a,y:n,placement:r,platform:o}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:p=>{let{x:g,y:v}=p;return{x:g,y:v}}},...u}=qo(t,e),c={x:a,y:n},d=await o.detectOverflow(e,u),f=jn(Gr(r)),m=Xg(f),S=c[m],b=c[f];if(i){let p=m==="y"?"top":"left",g=m==="y"?"bottom":"right",v=S+d[p],y=S-d[g];S=ef(v,S,y)}if(s){let p=f==="y"?"top":"left",g=f==="y"?"bottom":"right",v=b+d[p],y=b-d[g];b=ef(v,b,y)}let x=l.fn({...e,[m]:S,[f]:b});return{...x,data:{x:x.x-a,y:x.y-n,enabled:{[m]:i,[f]:s}}}}}};function nf(){return typeof window<"u"}function Vo(t){return LL(t)?(t.nodeName||"").toLowerCase():"#document"}function Qt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Wa(t){var e;return(e=(LL(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function LL(t){return nf()?t instanceof Node||t instanceof Qt(t).Node:!1}function Ma(t){return nf()?t instanceof Element||t instanceof Qt(t).Element:!1}function Xa(t){return nf()?t instanceof HTMLElement||t instanceof Qt(t).HTMLElement:!1}function wL(t){return!nf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qt(t).ShadowRoot}var j2=new Set(["inline","contents"]);function ps(t){let{overflow:e,overflowX:a,overflowY:n,display:r}=Da(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+a)&&!j2.has(r)}var G2=new Set(["table","td","th"]);function kL(t){return G2.has(Vo(t))}var Z2=[":popover-open",":modal"];function nu(t){return Z2.some(e=>{try{return t.matches(e)}catch{return!1}})}var W2=["transform","translate","scale","rotate","perspective"],X2=["transform","translate","scale","rotate","perspective","filter"],Y2=["paint","layout","strict","content"];function rf(t){let e=of(),a=Ma(t)?Da(t):t;return W2.some(n=>a[n]?a[n]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!e&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!e&&(a.filter?a.filter!=="none":!1)||X2.some(n=>(a.willChange||"").includes(n))||Y2.some(n=>(a.contain||"").includes(n))}function IL(t){let e=Gn(t);for(;Xa(e)&&!jo(e);){if(rf(e))return e;if(nu(e))return null;e=Gn(e)}return null}function of(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var K2=new Set(["html","body","#document"]);function jo(t){return K2.has(Vo(t))}function Da(t){return Qt(t).getComputedStyle(t)}function ru(t){return Ma(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Gn(t){if(Vo(t)==="html")return t;let e=t.assignedSlot||t.parentNode||wL(t)&&t.host||Wa(t);return wL(e)?e.host:e}function AL(t){let e=Gn(t);return jo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Xa(e)&&ps(e)?e:AL(e)}function fs(t,e,a){var n;e===void 0&&(e=[]),a===void 0&&(a=!0);let r=AL(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=Qt(r);if(o){let s=sf(i);return e.concat(i,i.visualViewport||[],ps(r)?r:[],s&&a?fs(s):[])}return e.concat(r,fs(r,[],a))}function sf(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ML(t){let e=Da(t),a=parseFloat(e.width)||0,n=parseFloat(e.height)||0,r=Xa(t),o=r?t.offsetWidth:a,i=r?t.offsetHeight:n,s=tu(a)!==o||tu(n)!==i;return s&&(a=o,n=i),{width:a,height:n,$:s}}function Qg(t){return Ma(t)?t:t.contextElement}function hs(t){let e=Qg(t);if(!Xa(e))return Za(1);let a=e.getBoundingClientRect(),{width:n,height:r,$:o}=ML(e),i=(o?tu(a.width):a.width)/n,s=(o?tu(a.height):a.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var Q2=Za(0);function DL(t){let e=Qt(t);return!of()||!e.visualViewport?Q2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function J2(t,e,a){return e===void 0&&(e=!1),!a||e&&a!==Qt(t)?!1:e}function Go(t,e,a,n){e===void 0&&(e=!1),a===void 0&&(a=!1);let r=t.getBoundingClientRect(),o=Qg(t),i=Za(1);e&&(n?Ma(n)&&(i=hs(n)):i=hs(t));let s=J2(o,a,n)?DL(o):Za(0),l=(r.left+s.x)/i.x,u=(r.top+s.y)/i.y,c=r.width/i.x,d=r.height/i.y;if(o){let f=Qt(o),m=n&&Ma(n)?Qt(n):n,S=f,b=sf(S);for(;b&&n&&m!==S;){let x=hs(b),p=b.getBoundingClientRect(),g=Da(b),v=p.left+(b.clientLeft+parseFloat(g.paddingLeft))*x.x,y=p.top+(b.clientTop+parseFloat(g.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=v,u+=y,S=Qt(b),b=sf(S)}}return $o({width:c,height:d,x:l,y:u})}function lf(t,e){let a=ru(t).scrollLeft;return e?e.left+a:Go(Wa(t)).left+a}function OL(t,e){let a=t.getBoundingClientRect(),n=a.left+e.scrollLeft-lf(t,a),r=a.top+e.scrollTop;return{x:n,y:r}}function eD(t){let{elements:e,rect:a,offsetParent:n,strategy:r}=t,o=r==="fixed",i=Wa(n),s=e?nu(e.floating):!1;if(n===i||s&&o)return a;let l={scrollLeft:0,scrollTop:0},u=Za(1),c=Za(0),d=Xa(n);if((d||!d&&!o)&&((Vo(n)!=="body"||ps(i))&&(l=ru(n)),Xa(n))){let m=Go(n);u=hs(n),c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}let f=i&&!d&&!o?OL(i,l):Za(0);return{width:a.width*u.x,height:a.height*u.y,x:a.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:a.y*u.y-l.scrollTop*u.y+c.y+f.y}}function tD(t){return Array.from(t.getClientRects())}function aD(t){let e=Wa(t),a=ru(t),n=t.ownerDocument.body,r=Vn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=Vn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-a.scrollLeft+lf(t),s=-a.scrollTop;return Da(n).direction==="rtl"&&(i+=Vn(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:i,y:s}}var EL=25;function nD(t,e){let a=Qt(t),n=Wa(t),r=a.visualViewport,o=n.clientWidth,i=n.clientHeight,s=0,l=0;if(r){o=r.width,i=r.height;let c=of();(!c||c&&e==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}let u=lf(n);if(u<=0){let c=n.ownerDocument,d=c.body,f=getComputedStyle(d),m=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,S=Math.abs(n.clientWidth-d.clientWidth-m);S<=EL&&(o-=S)}else u<=EL&&(o+=u);return{width:o,height:i,x:s,y:l}}var rD=new Set(["absolute","fixed"]);function oD(t,e){let a=Go(t,!0,e==="fixed"),n=a.top+t.clientTop,r=a.left+t.clientLeft,o=Xa(t)?hs(t):Za(1),i=t.clientWidth*o.x,s=t.clientHeight*o.y,l=r*o.x,u=n*o.y;return{width:i,height:s,x:l,y:u}}function TL(t,e,a){let n;if(e==="viewport")n=nD(t,a);else if(e==="document")n=aD(Wa(t));else if(Ma(e))n=oD(e,a);else{let r=DL(t);n={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return $o(n)}function BL(t,e){let a=Gn(t);return a===e||!Ma(a)||jo(a)?!1:Da(a).position==="fixed"||BL(a,e)}function iD(t,e){let a=e.get(t);if(a)return a;let n=fs(t,[],!1).filter(s=>Ma(s)&&Vo(s)!=="body"),r=null,o=Da(t).position==="fixed",i=o?Gn(t):t;for(;Ma(i)&&!jo(i);){let s=Da(i),l=rf(i);!l&&s.position==="fixed"&&(r=null),(o?!l&&!r:!l&&s.position==="static"&&!!r&&rD.has(r.position)||ps(i)&&!l&&BL(t,i))?n=n.filter(c=>c!==i):r=s,i=Gn(i)}return e.set(t,n),n}function sD(t){let{element:e,boundary:a,rootBoundary:n,strategy:r}=t,i=[...a==="clippingAncestors"?nu(e)?[]:iD(e,this._c):[].concat(a),n],s=i[0],l=i.reduce((u,c)=>{let d=TL(e,c,r);return u.top=Vn(d.top,u.top),u.right=jr(d.right,u.right),u.bottom=jr(d.bottom,u.bottom),u.left=Vn(d.left,u.left),u},TL(e,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function lD(t){let{width:e,height:a}=ML(t);return{width:e,height:a}}function uD(t,e,a){let n=Xa(e),r=Wa(e),o=a==="fixed",i=Go(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=Za(0);function u(){l.x=lf(r)}if(n||!n&&!o)if((Vo(e)!=="body"||ps(r))&&(s=ru(e)),n){let m=Go(e,!0,o,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else r&&u();o&&!n&&r&&u();let c=r&&!n&&!o?OL(r,s):Za(0),d=i.left+s.scrollLeft-l.x-c.x,f=i.top+s.scrollTop-l.y-c.y;return{x:d,y:f,width:i.width,height:i.height}}function Kg(t){return Da(t).position==="static"}function RL(t,e){if(!Xa(t)||Da(t).position==="fixed")return null;if(e)return e(t);let a=t.offsetParent;return Wa(t)===a&&(a=a.ownerDocument.body),a}function PL(t,e){let a=Qt(t);if(nu(t))return a;if(!Xa(t)){let r=Gn(t);for(;r&&!jo(r);){if(Ma(r)&&!Kg(r))return r;r=Gn(r)}return a}let n=RL(t,e);for(;n&&kL(n)&&Kg(n);)n=RL(n,e);return n&&jo(n)&&Kg(n)&&!rf(n)?a:n||IL(t)||a}var cD=async function(t){let e=this.getOffsetParent||PL,a=this.getDimensions,n=await a(t.floating);return{reference:uD(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function dD(t){return Da(t).direction==="rtl"}var fD={convertOffsetParentRelativeRectToViewportRelativeRect:eD,getDocumentElement:Wa,getClippingRect:sD,getOffsetParent:PL,getElementRects:cD,getClientRects:tD,getDimensions:lD,getScale:hs,isElement:Ma,isRTL:dD};function FL(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function pD(t,e){let a=null,n,r=Wa(t);function o(){var s;clearTimeout(n),(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:f,height:m}=u;if(s||e(),!f||!m)return;let S=au(d),b=au(r.clientWidth-(c+f)),x=au(r.clientHeight-(d+m)),p=au(c),v={rootMargin:-S+"px "+-b+"px "+-x+"px "+-p+"px",threshold:Vn(0,jr(1,l))||1},y=!0;function _(L){let C=L[0].intersectionRatio;if(C!==l){if(!y)return i();C?i(!1,C):n=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!FL(u,t.getBoundingClientRect())&&i(),y=!1}try{a=new IntersectionObserver(_,{...v,root:r.ownerDocument})}catch{a=new IntersectionObserver(_,v)}a.observe(t)}return i(!0),o}function uf(t,e,a,n){n===void 0&&(n={});let{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=Qg(t),c=r||o?[...u?fs(u):[],...fs(e)]:[];c.forEach(p=>{r&&p.addEventListener("scroll",a,{passive:!0}),o&&p.addEventListener("resize",a)});let d=u&&s?pD(u,a):null,f=-1,m=null;i&&(m=new ResizeObserver(p=>{let[g]=p;g&&g.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(e)})),a()}),u&&!l&&m.observe(u),m.observe(e));let S,b=l?Go(t):null;l&&x();function x(){let p=Go(t);b&&!FL(b,p)&&a(),b=p,S=requestAnimationFrame(x)}return a(),()=>{var p;c.forEach(g=>{r&&g.removeEventListener("scroll",a),o&&g.removeEventListener("resize",a)}),d?.(),(p=m)==null||p.disconnect(),m=null,l&&cancelAnimationFrame(S)}}var cf=CL;var df=_L,ff=bL;var NL=SL,HL=xL;var pf=(t,e,a)=>{let n=new Map,r={platform:fD,...a},o={...r.platform,_c:n};return yL(t,e,{...r,platform:o})};function hD(t){let e=t.getBoundingClientRect(),a=window.innerWidth,n=window.innerHeight;if(!(e.width>a*.8||e.height>n*.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,n),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 UL(t,e,a){let n=t.getBoundingClientRect();n.width>window.innerWidth*.8||n.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=va(a.html),!a.trigger||a.trigger==="immediate"){let p=document.createElement("button");p.className="syntro-tooltip-close",p.setAttribute("aria-label","Close"),p.textContent="\xD7",Object.assign(p.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"}),p.addEventListener("mouseenter",()=>{p.style.opacity="1"}),p.addEventListener("mouseleave",()=>{p.style.opacity="0.6"}),p.addEventListener("click",()=>x.destroy()),o.style.position="relative",o.appendChild(p)}let i=o.querySelectorAll("[data-syntro-action]"),s=p=>{let v=p.currentTarget.getAttribute("data-syntro-action");v&&a.onAction&&a.onAction(v)};i.forEach(p=>p.addEventListener("click",s));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let u=[cf(a.offsetPx??8),ff(),df({padding:8}),NL(),HL({element:l})],c=a.placement&&a.placement!=="auto"?a.placement:"top",d=uf(t,o,async()=>{if(!t.isConnected){x.destroy();return}let p=hD(t),g=await pf(p,o,{placement:c,strategy:"fixed",middleware:u}),{x:v,y,strategy:_,middlewareData:L,placement:C}=g;if(Object.assign(o.style,{left:`${v}px`,top:`${y}px`,position:_}),L.arrow){let{x:A,y:w}=L.arrow,k=C.split("-")[0],T={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:A!=null?`${A}px`:"",top:w!=null?`${w}px`:"",right:"",bottom:"",[T[k]]:"-4px"});let D={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${D[k]||"0deg"})`}}),f=p=>{p.key==="Escape"&&x.destroy()};window.addEventListener("keydown",f);let m=[];if(a.blocking){Array.from(document.body.children).forEach(g=>{g!==e&&g.getAttribute("inert")===null&&(g.setAttribute("inert",""),m.push(g.id||g.tagName))});let p=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(p.length>0){let g=p[0],v=p[p.length-1],y=_=>{_.key==="Tab"&&(_.shiftKey?document.activeElement===g&&(v.focus(),_.preventDefault()):document.activeElement===v&&(g.focus(),_.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>g.focus())}}let b=(()=>{if(a.trigger==="hover"){let p=null,g=()=>{p&&(clearTimeout(p),p=null),o.style.visibility="visible",o.style.opacity="1"},v=()=>{p=setTimeout(()=>{o.style.visibility="hidden",o.style.opacity="0",p=null},100)};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",g),t.addEventListener("mouseleave",v),o.addEventListener("mouseenter",g),o.addEventListener("mouseleave",v),t.addEventListener("focus",g),t.addEventListener("blur",v),()=>{p&&clearTimeout(p),t.removeEventListener("mouseenter",g),t.removeEventListener("mouseleave",v),o.removeEventListener("mouseenter",g),o.removeEventListener("mouseleave",v),t.removeEventListener("focus",g),t.removeEventListener("blur",v)}}if(a.trigger==="click"){let p=()=>{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",p),()=>t.removeEventListener("click",p)}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",f),i.forEach(p=>p.removeEventListener("click",s)),a.blocking&&Array.from(document.body.children).forEach(p=>{p!==e&&p.removeAttribute("inert")}),o.style.pointerEvents="none",o.style.opacity="0",setTimeout(()=>o.remove(),200)}};return x}var Jg=K(Oe(),1),Ze=K(Xe(),1),GL=K(Uo(),1);var je=K(Oe(),1);function vD({completed:t,total:e}){let a=e>0?Math.round(t/e*100):0;return(0,je.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,je.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 yD({step:t,isCompleted:e,isCurrent:a,tourId:n,onStepClick:r}){return(0,je.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:()=>r(n,t.id),children:[(0,je.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,je.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):a?(0,je.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,je.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,je.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function xD({workflow:t,expanded:e,onStepClick:a,onDismiss:n}){let r=t.completedSteps.length,o=t.steps.length;return(0,je.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,je.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,je.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,je.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,je.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:()=>n(t.tourId),"aria-label":`Dismiss ${t.meta.title}`,children:"\u2715"})]}),(0,je.jsxs)("div",{className:"se-mb-2",children:[(0,je.jsx)(vD,{completed:r,total:o}),(0,je.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[r," of ",o," steps"]})]}),(0,je.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(i=>(0,je.jsx)(yD,{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,je.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function VL({workflows:t,expanded:e,onStepClick:a,onDismiss:n}){return t.length===0?(0,je.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,je.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(r=>(0,je.jsx)(xD,{workflow:r,expanded:e,onStepClick:a,onDismiss:n},r.tourId))})}function jL(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 n=document.createElement("div");if(n.className="se-font-semibold",n.style.fontWeight="600",n.textContent=e.title,a.appendChild(n),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 r,o=setTimeout(()=>{a.style.opacity="0",r=setTimeout(()=>{a.remove()},300)},4e3);return()=>{clearTimeout(o),clearTimeout(r),a.remove()}}function bD(t){let e=new Map;for(let a of t){let n=a.action;if(n.kind==="core:tour"&&n.workflow&&n.tourId){let r=n.workflow,i=(n.steps||[]).map(s=>({id:s.id,title:r.stepTitles?.[s.id]||s.id}));e.set(n.tourId,{meta:r,steps:i})}}return e}function SD({runtime:t}){let[e,a]=(0,Ze.useState)(0),n=(0,Ze.useMemo)(()=>{let x=t?.actions?.getActive?.()||[];return bD(x)},[t,e]),r=(0,Ze.useRef)(n);r.current=n,(0,Ze.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>a(x=>x+1))},[t]);let o=(0,Ze.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),i=(0,Ze.useRef)(new Set),s=(0,Ze.useRef)([]),l=(0,Ze.useRef)(null),u=(0,Ze.useRef)({}),[c,d]=(0,Ze.useState)([]),f=(0,Ze.useRef)(!1);if(!f.current&&o){let x=o.get?.("notified")||[];for(let g of x)i.current.add(g);let p=o.get?.("completed")||{};u.current={...p},f.current=!0}(0,Ze.useEffect)(()=>{if(n.size===0)return;let x=o?.get?.("dismissed")||[],p=o?.get?.("completed")||{};d(g=>{let v=new Set(g.map(_=>_.tourId)),y=[];for(let[_,{meta:L,steps:C}]of n){if(v.has(_))continue;let A="active";x.includes(_)?A="dismissed":p[_]&&(A="completed"),y.push({tourId:_,meta:L,steps:C,currentStepId:null,completedSteps:[],status:A,completedAt:p[_]||void 0})}return y.length>0?[...g,...y]:g});for(let[g,{meta:v}]of n)if(!i.current.has(g)&&v.notification&&l.current&&!x.includes(g)&&!p[g]){i.current.add(g),o?.set?.("notified",[...i.current]);let y=jL(l.current,v.notification);s.current.push(y)}},[n,o]),(0,Ze.useEffect)(()=>{if(!t?.events?.subscribe)return;let x=t.events.subscribe({patterns:["^tour\\."]},p=>{let g=p.props?.tourId;if(!g)return;let v=r.current;if(!v.has(g)&&p.name==="tour.started"){a(y=>y+1);return}v.has(g)&&d(y=>y.map(L=>{if(L.tourId!==g)return L;switch(p.name){case"tour.started":{let C=p.props?.startStepId||L.steps[0]?.id||null;if(!i.current.has(g)){i.current.add(g),o?.set?.("notified",[...i.current]);let w=v.get(g);if(w?.meta.notification&&l.current){let k=jL(l.current,w.meta.notification);s.current.push(k)}}let A=y.filter(w=>w.status==="active"||w.tourId===g).map(w=>w.tourId);return A.includes(g)||A.push(g),o?.set?.("active",[...new Set(A)]),{...L,status:"active",currentStepId:C,completedSteps:L.status==="active"?L.completedSteps:[]}}case"tour.step_started":{let C=p.props?.stepId;return{...L,currentStepId:C||L.currentStepId}}case"tour.step_changed":{let C=p.props?.previousStepId,A=p.props?.nextStepId,w=C&&!L.completedSteps.includes(C)?[...L.completedSteps,C]:L.completedSteps;return{...L,currentStepId:A||L.currentStepId,completedSteps:w}}case"tour.completed":{let C=Date.now();return u.current[g]=C,o?.set?.("completed",{...u.current}),{...L,status:"completed",currentStepId:null,completedSteps:L.steps.map(A=>A.id),completedAt:C}}case"tour.paused":return L;default:return L}}))});return()=>{x();for(let p of s.current)p();s.current=[]}},[t,o]);let m=(0,Ze.useCallback)((x,p)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:x,stepId:p})},[t]),S=(0,Ze.useCallback)(x=>{d(p=>{let g=p.map(y=>y.tourId===x?{...y,status:"dismissed"}:y),v=g.filter(y=>y.status==="dismissed").map(y=>y.tourId);return o?.set?.("dismissed",v),g})},[o]),b=(0,Ze.useMemo)(()=>c.filter(x=>x.status==="active"),[c]);return(0,Jg.jsx)("div",{ref:l,children:(0,Jg.jsx)(VL,{workflows:b,onStepClick:m,onDismiss:S})})}var ZL={mount(t,e){let a=e?.runtime||null,n=(0,GL.createRoot)(t);return n.render(Ze.default.createElement(SD,{runtime:a})),()=>{n.unmount()}}};var WL=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:()=>{}};if(a.getAttribute("data-syntro-highlight-dismissed"))return{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 r=t.style?.color;if(!r)try{let i=getComputedStyle(e.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();i&&(r=i)}catch{}let o=sL(a,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:r,blocking:t.blocking??!1,onClickOutside:t.onClickOutside??!0,onEsc:t.onEsc??!0,onDismiss:()=>{a.setAttribute("data-syntro-highlight-dismissed","true")}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{o.destroy(),a.removeAttribute("data-syntro-highlight")}}},XL=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 n=t.duration??4e3;await new Promise(b=>requestAnimationFrame(b));let r=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(),p=b.getPropertyValue("--sc-color-primary-hover")?.trim();x?.startsWith("#")&&x.length>=7&&(i=r(x)),p?.startsWith("#")&&p.length>=7&&(s=r(p))}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:f}=i;if(s){let{r:b,g:x,b:p}=s;u.textContent=`
|
|
62
|
+
`}d+="</div>"}u.innerHTML=d,e.overlayRoot.appendChild(u);let f=null,h=u.querySelectorAll("[data-syntro-action]"),S=C=>{let _=C.currentTarget.getAttribute("data-syntro-action");_&&(f=_,e.publishEvent("action.modal_cta_clicked",{actionId:_}),v.destroy())};h.forEach(C=>C.addEventListener("click",S));let x=C=>{C.key==="Escape"&&i?.onEsc!==!1&&v.destroy()};window.addEventListener("keydown",x);let b=()=>{n||v.destroy()};l.addEventListener("click",b);let g=[];n&&Array.from(document.body.children).forEach(C=>{C!==e.overlayRoot&&C.getAttribute("inert")===null&&!C.querySelector("[data-syntro-editor-panel]")&&!C.hasAttribute("data-syntro-editor-panel")&&(C.setAttribute("inert",""),g.push(C))});let m;i?.timeoutMs&&(m=setTimeout(()=>{v.destroy()},i.timeoutMs));let y=u.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');y.length>0&&requestAnimationFrame(()=>y[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 v={destroy(){m&&clearTimeout(m),window.removeEventListener("keydown",x),l.removeEventListener("click",b),h.forEach(C=>C.removeEventListener("click",S)),g.forEach(C=>C.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(()=>{try{u.remove()}catch{}try{l.remove()}catch{}},200),e.publishEvent("action.modal_dismissed",{actionClicked:f})}};return{cleanup:()=>{v.destroy()}}};var ck=["top","right","bottom","left"];var Qn=Math.min,Kr=Math.max,du=Math.round,fu=Math.floor,Ja=t=>({x:t,y:t}),JO={left:"right",right:"left",bottom:"top",top:"bottom"},eD={start:"end",end:"start"};function kf(t,e,a){return Kr(t,Qn(e,a))}function Zo(t,e){return typeof t=="function"?t(e):t}function Jn(t){return t.split("-")[0]}function xs(t){return t.split("-")[1]}function kv(t){return t==="x"?"y":"x"}function If(t){return t==="y"?"height":"width"}var tD=new Set(["top","bottom"]);function Yr(t){return tD.has(Jn(t))?"y":"x"}function Af(t){return kv(Yr(t))}function dk(t,e,a){a===void 0&&(a=!1);let r=xs(t),n=Af(t),o=If(n),i=n==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(i=cu(i)),[i,cu(i)]}function fk(t){let e=cu(t);return[Lf(t),e,Lf(e)]}function Lf(t){return t.replace(/start|end/g,e=>eD[e])}var lk=["left","right"],uk=["right","left"],aD=["top","bottom"],rD=["bottom","top"];function nD(t,e,a){switch(t){case"top":case"bottom":return a?e?uk:lk:e?lk:uk;case"left":case"right":return e?aD:rD;default:return[]}}function pk(t,e,a,r){let n=xs(t),o=nD(Jn(t),a==="start",r);return n&&(o=o.map(i=>i+"-"+n),e&&(o=o.concat(o.map(Lf)))),o}function cu(t){return t.replace(/left|right|bottom|top/g,e=>JO[e])}function oD(t){return{top:0,right:0,bottom:0,left:0,...t}}function Iv(t){return typeof t!="number"?oD(t):{top:t,right:t,bottom:t,left:t}}function Xo(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 hk(t,e,a){let{reference:r,floating:n}=t,o=Yr(e),i=Af(e),s=If(i),l=Jn(e),u=o==="y",c=r.x+r.width/2-n.width/2,d=r.y+r.height/2-n.height/2,f=r[s]/2-n[s]/2,h;switch(l){case"top":h={x:c,y:r.y-n.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-n.width,y:d};break;default:h={x:r.x,y:r.y}}switch(xs(e)){case"start":h[i]-=f*(a&&u?-1:1);break;case"end":h[i]+=f*(a&&u?-1:1);break}return h}async function vk(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:f=!1,padding:h=0}=Zo(e,t),S=Iv(h),b=s[f?d==="floating"?"reference":"floating":d],g=Xo(await o.getClippingRect({element:(a=await(o.isElement==null?void 0:o.isElement(b)))==null||a?b:b.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,y=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),v=await(o.isElement==null?void 0:o.isElement(y))?await(o.getScale==null?void 0:o.getScale(y))||{x:1,y:1}:{x:1,y:1},C=Xo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:m,offsetParent:y,strategy:l}):m);return{top:(g.top-C.top+S.top)/v.y,bottom:(C.bottom-g.bottom+S.bottom)/v.y,left:(g.left-C.left+S.left)/v.x,right:(C.right-g.right+S.right)/v.x}}var yk=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}=hk(u,r,l),f=r,h={},S=0;for(let b=0;b<s.length;b++){var x;let{name:g,fn:m}=s[b],{x:y,y:v,data:C,reset:w}=await m({x:c,y:d,initialPlacement:r,placement:f,strategy:n,middlewareData:h,rects:u,platform:{...i,detectOverflow:(x=i.detectOverflow)!=null?x:vk},elements:{reference:t,floating:e}});c=y??c,d=v??d,h={...h,[g]:{...h[g],...C}},w&&S<=50&&(S++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:n}):w.rects),{x:c,y:d}=hk(u,f,l)),b=-1)}return{x:c,y:d,placement:f,strategy:n,middlewareData:h}},xk=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}=Zo(t,e)||{};if(u==null)return{};let d=Iv(c),f={x:a,y:r},h=Af(n),S=If(h),x=await i.getDimensions(u),b=h==="y",g=b?"top":"left",m=b?"bottom":"right",y=b?"clientHeight":"clientWidth",v=o.reference[S]+o.reference[h]-f[h]-o.floating[S],C=f[h]-o.reference[h],w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u)),_=w?w[y]:0;(!_||!await(i.isElement==null?void 0:i.isElement(w)))&&(_=s.floating[y]||o.floating[S]);let L=v/2-C/2,I=_/2-x[S]/2-1,A=Qn(d[g],I),T=Qn(d[m],I),N=A,B=_-x[S]-T,F=_/2-x[S]/2+L,H=kf(N,F,B),R=!l.arrow&&xs(n)!=null&&F!==H&&o.reference[S]/2-(F<N?A:T)-x[S]/2<0,z=R?F<N?F-N:F-B:0;return{[h]:f[h]+z,data:{[h]:H,centerOffset:F-H-z,...R&&{alignmentOffset:z}},reset:R}}});var bk=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:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:x=!0,...b}=Zo(t,e);if((a=o.arrow)!=null&&a.alignmentOffset)return{};let g=Jn(n),m=Yr(s),y=Jn(s)===s,v=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=f||(y||!x?[cu(s)]:fk(s)),w=S!=="none";!f&&w&&C.push(...pk(s,x,S,v));let _=[s,...C],L=await l.detectOverflow(e,b),I=[],A=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&I.push(L[g]),d){let F=dk(n,i,v);I.push(L[F[0]],L[F[1]])}if(A=[...A,{placement:n,overflows:I}],!I.every(F=>F<=0)){var T,N;let F=(((T=o.flip)==null?void 0:T.index)||0)+1,H=_[F];if(H&&(!(d==="alignment"?m!==Yr(H):!1)||A.every(M=>Yr(M.placement)===m?M.overflows[0]>0:!0)))return{data:{index:F,overflows:A},reset:{placement:H}};let R=(N=A.filter(z=>z.overflows[0]<=0).sort((z,M)=>z.overflows[1]-M.overflows[1])[0])==null?void 0:N.placement;if(!R)switch(h){case"bestFit":{var B;let z=(B=A.filter(M=>{if(w){let U=Yr(M.placement);return U===m||U==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(U=>U>0).reduce((U,ue)=>U+ue,0)]).sort((M,U)=>M[1]-U[1])[0])==null?void 0:B[0];z&&(R=z);break}case"initialPlacement":R=s;break}if(n!==R)return{reset:{placement:R}}}return{}}}};function mk(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function gk(t){return ck.some(e=>t[e]>=0)}var Sk=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:a,platform:r}=e,{strategy:n="referenceHidden",...o}=Zo(t,e);switch(n){case"referenceHidden":{let i=await r.detectOverflow(e,{...o,elementContext:"reference"}),s=mk(i,a.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:gk(s)}}}case"escaped":{let i=await r.detectOverflow(e,{...o,altBoundary:!0}),s=mk(i,a.floating);return{data:{escapedOffsets:s,escaped:gk(s)}}}default:return{}}}}};var iD=new Set(["left","top"]);async function sD(t,e){let{placement:a,platform:r,elements:n}=t,o=await(r.isRTL==null?void 0:r.isRTL(n.floating)),i=Jn(a),s=xs(a),l=Yr(a)==="y",u=iD.has(i)?-1:1,c=o&&l?-1:1,d=Zo(e,t),{mainAxis:f,crossAxis:h,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"&&(h=s==="end"?S*-1:S),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}var _k=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 sD(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}}}}},Ck=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:g=>{let{x:m,y}=g;return{x:m,y}}},...u}=Zo(t,e),c={x:a,y:r},d=await o.detectOverflow(e,u),f=Yr(Jn(n)),h=kv(f),S=c[h],x=c[f];if(i){let g=h==="y"?"top":"left",m=h==="y"?"bottom":"right",y=S+d[g],v=S-d[m];S=kf(y,S,v)}if(s){let g=f==="y"?"top":"left",m=f==="y"?"bottom":"right",y=x+d[g],v=x-d[m];x=kf(y,x,v)}let b=l.fn({...e,[h]:S,[f]:x});return{...b,data:{x:b.x-a,y:b.y-r,enabled:{[h]:i,[f]:s}}}}}};function Ef(){return typeof window<"u"}function Ko(t){return Lk(t)?(t.nodeName||"").toLowerCase():"#document"}function na(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function er(t){var e;return(e=(Lk(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Lk(t){return Ef()?t instanceof Node||t instanceof na(t).Node:!1}function Ha(t){return Ef()?t instanceof Element||t instanceof na(t).Element:!1}function tr(t){return Ef()?t instanceof HTMLElement||t instanceof na(t).HTMLElement:!1}function wk(t){return!Ef()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof na(t).ShadowRoot}var lD=new Set(["inline","contents"]);function Ss(t){let{overflow:e,overflowX:a,overflowY:r,display:n}=Ua(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+a)&&!lD.has(n)}var uD=new Set(["table","td","th"]);function kk(t){return uD.has(Ko(t))}var cD=[":popover-open",":modal"];function pu(t){return cD.some(e=>{try{return t.matches(e)}catch{return!1}})}var dD=["transform","translate","scale","rotate","perspective"],fD=["transform","translate","scale","rotate","perspective","filter"],pD=["paint","layout","strict","content"];function Tf(t){let e=Rf(),a=Ha(t)?Ua(t):t;return dD.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)||fD.some(r=>(a.willChange||"").includes(r))||pD.some(r=>(a.contain||"").includes(r))}function Ik(t){let e=Qr(t);for(;tr(e)&&!Yo(e);){if(Tf(e))return e;if(pu(e))return null;e=Qr(e)}return null}function Rf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var hD=new Set(["html","body","#document"]);function Yo(t){return hD.has(Ko(t))}function Ua(t){return na(t).getComputedStyle(t)}function hu(t){return Ha(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Qr(t){if(Ko(t)==="html")return t;let e=t.assignedSlot||t.parentNode||wk(t)&&t.host||er(t);return wk(e)?e.host:e}function Ak(t){let e=Qr(t);return Yo(e)?t.ownerDocument?t.ownerDocument.body:t.body:tr(e)&&Ss(e)?e:Ak(e)}function bs(t,e,a){var r;e===void 0&&(e=[]),a===void 0&&(a=!0);let n=Ak(t),o=n===((r=t.ownerDocument)==null?void 0:r.body),i=na(n);if(o){let s=Mf(i);return e.concat(i,i.visualViewport||[],Ss(n)?n:[],s&&a?bs(s):[])}return e.concat(n,bs(n,[],a))}function Mf(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Mk(t){let e=Ua(t),a=parseFloat(e.width)||0,r=parseFloat(e.height)||0,n=tr(t),o=n?t.offsetWidth:a,i=n?t.offsetHeight:r,s=du(a)!==o||du(r)!==i;return s&&(a=o,r=i),{width:a,height:r,$:s}}function Ev(t){return Ha(t)?t:t.contextElement}function _s(t){let e=Ev(t);if(!tr(e))return Ja(1);let a=e.getBoundingClientRect(),{width:r,height:n,$:o}=Mk(e),i=(o?du(a.width):a.width)/r,s=(o?du(a.height):a.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var mD=Ja(0);function Ok(t){let e=na(t);return!Rf()||!e.visualViewport?mD:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function gD(t,e,a){return e===void 0&&(e=!1),!a||e&&a!==na(t)?!1:e}function Qo(t,e,a,r){e===void 0&&(e=!1),a===void 0&&(a=!1);let n=t.getBoundingClientRect(),o=Ev(t),i=Ja(1);e&&(r?Ha(r)&&(i=_s(r)):i=_s(t));let s=gD(o,a,r)?Ok(o):Ja(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 f=na(o),h=r&&Ha(r)?na(r):r,S=f,x=Mf(S);for(;x&&r&&h!==S;){let b=_s(x),g=x.getBoundingClientRect(),m=Ua(x),y=g.left+(x.clientLeft+parseFloat(m.paddingLeft))*b.x,v=g.top+(x.clientTop+parseFloat(m.paddingTop))*b.y;l*=b.x,u*=b.y,c*=b.x,d*=b.y,l+=y,u+=v,S=na(x),x=Mf(S)}}return Xo({width:c,height:d,x:l,y:u})}function Of(t,e){let a=hu(t).scrollLeft;return e?e.left+a:Qo(er(t)).left+a}function Dk(t,e){let a=t.getBoundingClientRect(),r=a.left+e.scrollLeft-Of(t,a),n=a.top+e.scrollTop;return{x:r,y:n}}function vD(t){let{elements:e,rect:a,offsetParent:r,strategy:n}=t,o=n==="fixed",i=er(r),s=e?pu(e.floating):!1;if(r===i||s&&o)return a;let l={scrollLeft:0,scrollTop:0},u=Ja(1),c=Ja(0),d=tr(r);if((d||!d&&!o)&&((Ko(r)!=="body"||Ss(i))&&(l=hu(r)),tr(r))){let h=Qo(r);u=_s(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}let f=i&&!d&&!o?Dk(i,l):Ja(0);return{width:a.width*u.x,height:a.height*u.y,x:a.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:a.y*u.y-l.scrollTop*u.y+c.y+f.y}}function yD(t){return Array.from(t.getClientRects())}function xD(t){let e=er(t),a=hu(t),r=t.ownerDocument.body,n=Kr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Kr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),i=-a.scrollLeft+Of(t),s=-a.scrollTop;return Ua(r).direction==="rtl"&&(i+=Kr(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:i,y:s}}var Ek=25;function bD(t,e){let a=na(t),r=er(t),n=a.visualViewport,o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(n){o=n.width,i=n.height;let c=Rf();(!c||c&&e==="fixed")&&(s=n.offsetLeft,l=n.offsetTop)}let u=Of(r);if(u<=0){let c=r.ownerDocument,d=c.body,f=getComputedStyle(d),h=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,S=Math.abs(r.clientWidth-d.clientWidth-h);S<=Ek&&(o-=S)}else u<=Ek&&(o+=u);return{width:o,height:i,x:s,y:l}}var SD=new Set(["absolute","fixed"]);function _D(t,e){let a=Qo(t,!0,e==="fixed"),r=a.top+t.clientTop,n=a.left+t.clientLeft,o=tr(t)?_s(t):Ja(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 Tk(t,e,a){let r;if(e==="viewport")r=bD(t,a);else if(e==="document")r=xD(er(t));else if(Ha(e))r=_D(e,a);else{let n=Ok(t);r={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return Xo(r)}function Bk(t,e){let a=Qr(t);return a===e||!Ha(a)||Yo(a)?!1:Ua(a).position==="fixed"||Bk(a,e)}function CD(t,e){let a=e.get(t);if(a)return a;let r=bs(t,[],!1).filter(s=>Ha(s)&&Ko(s)!=="body"),n=null,o=Ua(t).position==="fixed",i=o?Qr(t):t;for(;Ha(i)&&!Yo(i);){let s=Ua(i),l=Tf(i);!l&&s.position==="fixed"&&(n=null),(o?!l&&!n:!l&&s.position==="static"&&!!n&&SD.has(n.position)||Ss(i)&&!l&&Bk(t,i))?r=r.filter(c=>c!==i):n=s,i=Qr(i)}return e.set(t,r),r}function wD(t){let{element:e,boundary:a,rootBoundary:r,strategy:n}=t,i=[...a==="clippingAncestors"?pu(e)?[]:CD(e,this._c):[].concat(a),r],s=i[0],l=i.reduce((u,c)=>{let d=Tk(e,c,n);return u.top=Kr(d.top,u.top),u.right=Qn(d.right,u.right),u.bottom=Qn(d.bottom,u.bottom),u.left=Kr(d.left,u.left),u},Tk(e,s,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function LD(t){let{width:e,height:a}=Mk(t);return{width:e,height:a}}function kD(t,e,a){let r=tr(e),n=er(e),o=a==="fixed",i=Qo(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=Ja(0);function u(){l.x=Of(n)}if(r||!r&&!o)if((Ko(e)!=="body"||Ss(n))&&(s=hu(e)),r){let h=Qo(e,!0,o,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else n&&u();o&&!r&&n&&u();let c=n&&!r&&!o?Dk(n,s):Ja(0),d=i.left+s.scrollLeft-l.x-c.x,f=i.top+s.scrollTop-l.y-c.y;return{x:d,y:f,width:i.width,height:i.height}}function Av(t){return Ua(t).position==="static"}function Rk(t,e){if(!tr(t)||Ua(t).position==="fixed")return null;if(e)return e(t);let a=t.offsetParent;return er(t)===a&&(a=a.ownerDocument.body),a}function Pk(t,e){let a=na(t);if(pu(t))return a;if(!tr(t)){let n=Qr(t);for(;n&&!Yo(n);){if(Ha(n)&&!Av(n))return n;n=Qr(n)}return a}let r=Rk(t,e);for(;r&&kk(r)&&Av(r);)r=Rk(r,e);return r&&Yo(r)&&Av(r)&&!Tf(r)?a:r||Ik(t)||a}var ID=async function(t){let e=this.getOffsetParent||Pk,a=this.getDimensions,r=await a(t.floating);return{reference:kD(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function AD(t){return Ua(t).direction==="rtl"}var ED={convertOffsetParentRelativeRectToViewportRelativeRect:vD,getDocumentElement:er,getClippingRect:wD,getOffsetParent:Pk,getElementRects:ID,getClientRects:yD,getDimensions:LD,getScale:_s,isElement:Ha,isRTL:AD};function Nk(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function TD(t,e){let a=null,r,n=er(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:f,height:h}=u;if(s||e(),!f||!h)return;let S=fu(d),x=fu(n.clientWidth-(c+f)),b=fu(n.clientHeight-(d+h)),g=fu(c),y={rootMargin:-S+"px "+-x+"px "+-b+"px "+-g+"px",threshold:Kr(0,Qn(1,l))||1},v=!0;function C(w){let _=w[0].intersectionRatio;if(_!==l){if(!v)return i();_?i(!1,_):r=setTimeout(()=>{i(!1,1e-7)},1e3)}_===1&&!Nk(u,t.getBoundingClientRect())&&i(),v=!1}try{a=new IntersectionObserver(C,{...y,root:n.ownerDocument})}catch{a=new IntersectionObserver(C,y)}a.observe(t)}return i(!0),o}function Df(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=Ev(t),c=n||o?[...u?bs(u):[],...bs(e)]:[];c.forEach(g=>{n&&g.addEventListener("scroll",a,{passive:!0}),o&&g.addEventListener("resize",a)});let d=u&&s?TD(u,a):null,f=-1,h=null;i&&(h=new ResizeObserver(g=>{let[m]=g;m&&m.target===u&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(e)})),a()}),u&&!l&&h.observe(u),h.observe(e));let S,x=l?Qo(t):null;l&&b();function b(){let g=Qo(t);x&&!Nk(x,g)&&a(),x=g,S=requestAnimationFrame(b)}return a(),()=>{var g;c.forEach(m=>{n&&m.removeEventListener("scroll",a),o&&m.removeEventListener("resize",a)}),d?.(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(S)}}var Bf=_k;var Pf=Ck,Nf=bk;var Fk=Sk,Hk=xk;var Ff=(t,e,a)=>{let r=new Map,n={platform:ED,...a},o={...n.platform,_c:r};return yk(t,e,{...n,platform:o})};function RD(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 Uk(t,e,a){if(!a.trigger||a.trigger==="immediate"){let x=t.getBoundingClientRect();x.width>window.innerWidth*.8||x.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}let r=document.createElement("div");if(r.className="syntro-tooltip",r.setAttribute("role","tooltip"),r.innerHTML=Ca(a.html),!a.trigger||a.trigger==="immediate"){let x=document.createElement("button");x.className="syntro-tooltip-close",x.setAttribute("aria-label","Close"),x.textContent="\xD7",Object.assign(x.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"}),x.addEventListener("mouseenter",()=>{x.style.opacity="1"}),x.addEventListener("mouseleave",()=>{x.style.opacity="0.6"}),x.addEventListener("click",()=>S.destroy()),r.style.position="relative",r.appendChild(x)}let n=r.querySelectorAll("[data-syntro-action]"),o=x=>{let g=x.currentTarget.getAttribute("data-syntro-action");g&&a.onAction&&a.onAction(g)};n.forEach(x=>x.addEventListener("click",o));let i=document.createElement("div");i.className="syntro-tooltip-arrow",r.appendChild(i),e.appendChild(r);let s=[Bf(a.offsetPx??8),Nf(),Pf({padding:8}),Fk(),Hk({element:i})],l=a.placement&&a.placement!=="auto"?a.placement:"top",u=Df(t,r,async()=>{if(!t.isConnected){S.destroy();return}let x=RD(t),b=await Ff(x,r,{placement:l,strategy:"fixed",middleware:s}),{x:g,y:m,strategy:y,middlewareData:v,placement:C}=b;if(Object.assign(r.style,{left:`${g}px`,top:`${m}px`,position:y}),v.arrow){let{x:w,y:_}=v.arrow,L=C.split("-")[0],I={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(i.style,{left:w!=null?`${w}px`:"",top:_!=null?`${_}px`:"",right:"",bottom:"",[I[L]]:"-4px"});let A={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};i.style.transform=`rotate(${A[L]||"0deg"})`}}),c=x=>{x.key==="Escape"&&S.destroy()};window.addEventListener("keydown",c);let d=[];if(a.blocking){Array.from(document.body.children).forEach(b=>{b!==e&&b.getAttribute("inert")===null&&(b.setAttribute("inert",""),d.push(b.id||b.tagName))});let x=Array.from(r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(x.length>0){let b=x[0],g=x[x.length-1],m=y=>{y.key==="Tab"&&(y.shiftKey?document.activeElement===b&&(g.focus(),y.preventDefault()):document.activeElement===g&&(b.focus(),y.preventDefault()))};r.addEventListener("keydown",m),requestAnimationFrame(()=>b.focus())}}let h=(()=>{if(a.trigger==="hover"){let x=null,b=()=>{x&&(clearTimeout(x),x=null),r.style.visibility="visible",r.style.opacity="1"},g=()=>{x=setTimeout(()=>{r.style.visibility="hidden",r.style.opacity="0",x=null},100)};return r.style.visibility="hidden",r.style.opacity="0",r.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",b),t.addEventListener("mouseleave",g),r.addEventListener("mouseenter",b),r.addEventListener("mouseleave",g),t.addEventListener("focus",b),t.addEventListener("blur",g),()=>{x&&clearTimeout(x),t.removeEventListener("mouseenter",b),t.removeEventListener("mouseleave",g),r.removeEventListener("mouseenter",b),r.removeEventListener("mouseleave",g),t.removeEventListener("focus",b),t.removeEventListener("blur",g)}}if(a.trigger==="click"){let x=()=>{r.style.visibility==="visible"?S.destroy():(r.style.visibility="visible",r.style.opacity="1")};return r.style.visibility="hidden",r.style.opacity="0",r.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",x),()=>t.removeEventListener("click",x)}return r.style.opacity="0",r.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{r.style.opacity="1"}),()=>{}})(),S={el:r,destroy(){u(),h(),window.removeEventListener("keydown",c),n.forEach(x=>x.removeEventListener("click",o)),a.blocking&&Array.from(document.body.children).forEach(x=>{x!==e&&x.removeAttribute("inert")}),r.style.pointerEvents="none",r.style.opacity="0",setTimeout(()=>{try{r.remove()}catch{}},200)}};return S}var Tv=Y(Ee(),1),Je=Y(tt(),1),Gk=Y(Go(),1);var Ke=Y(Ee(),1);function DD({completed:t,total:e}){let a=e>0?Math.round(t/e*100):0;return(0,Ke.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,Ke.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 BD({step:t,isCompleted:e,isCurrent:a,tourId:r,onStepClick:n}){return(0,Ke.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,Ke.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,Ke.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):a?(0,Ke.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,Ke.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,Ke.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function PD({workflow:t,expanded:e,onStepClick:a,onDismiss:r}){let n=t.completedSteps.length,o=t.steps.length;return(0,Ke.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,Ke.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,Ke.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,Ke.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,Ke.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,Ke.jsxs)("div",{className:"se-mb-2",children:[(0,Ke.jsx)(DD,{completed:n,total:o}),(0,Ke.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[n," of ",o," steps"]})]}),(0,Ke.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(i=>(0,Ke.jsx)(BD,{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,Ke.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function $k({workflows:t,expanded:e,onStepClick:a,onDismiss:r}){return t.length===0?(0,Ke.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,Ke.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(n=>(0,Ke.jsx)(PD,{workflow:n,expanded:e,onStepClick:a,onDismiss:r},n.tourId))})}function jk(t){let e=document.createElement("div");e.setAttribute("data-testid","workflow-toast"),e.className="se-fixed se-bottom-4 se-right-4 se-z-50",Object.assign(e.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 a=document.createElement("div");if(a.className="se-font-semibold",a.style.fontWeight="600",a.textContent=t.title,e.appendChild(a),t.body){let o=document.createElement("div");o.className="se-mt-1 se-text-sm",o.style.marginTop="4px",o.style.fontSize="13px",o.style.color="var(--se-color-text-secondary, #666)",o.textContent=t.body,e.appendChild(o)}document.body.appendChild(e);let r,n=setTimeout(()=>{e.style.opacity="0",r=setTimeout(()=>{e.remove()},300)},4e3);return()=>{clearTimeout(n),clearTimeout(r),e.remove()}}function ND(t){let e=new Map;for(let a of t){let r=a.action;if(r.kind==="overlays: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 FD({runtime:t}){let[e,a]=(0,Je.useState)(0),r=(0,Je.useMemo)(()=>{let b=t?.actions?.getActive?.()||[];return ND(b)},[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(b=>b+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)([]),f=(0,Je.useRef)(!1);if(!f.current&&o){let b=o.get?.("notified")||[];for(let m of b)i.current.add(m);let g=o.get?.("completed")||{};u.current={...g},f.current=!0}(0,Je.useEffect)(()=>{if(r.size===0)return;let b=o?.get?.("dismissed")||[],g=o?.get?.("completed")||{};d(m=>{let y=new Set(m.map(C=>C.tourId)),v=[];for(let[C,{meta:w,steps:_}]of r){if(y.has(C))continue;let L="active";b.includes(C)?L="dismissed":g[C]&&(L="completed"),v.push({tourId:C,meta:w,steps:_,currentStepId:null,completedSteps:[],status:L,completedAt:g[C]||void 0})}return v.length>0?[...m,...v]:m});for(let[m,{meta:y}]of r)if(!i.current.has(m)&&y.notification&&!b.includes(m)&&!g[m]){i.current.add(m),o?.set?.("notified",[...i.current]);let v=jk(y.notification);s.current.push(v)}},[r,o]),(0,Je.useEffect)(()=>{if(!t?.events?.subscribe)return;let b=t.events.subscribe({patterns:["^tour\\."]},g=>{let m=g.props?.tourId;if(!m)return;let y=n.current;if(!y.has(m)&&g.name==="tour.started"){a(v=>v+1);return}y.has(m)&&d(v=>v.map(w=>{if(w.tourId!==m)return w;switch(g.name){case"tour.started":{let _=g.props?.startStepId||w.steps[0]?.id||null;if(!i.current.has(m)){i.current.add(m),o?.set?.("notified",[...i.current]);let I=y.get(m);if(I?.meta.notification){let A=jk(I.meta.notification);s.current.push(A)}}let L=v.filter(I=>I.status==="active"||I.tourId===m).map(I=>I.tourId);return L.includes(m)||L.push(m),o?.set?.("active",[...new Set(L)]),{...w,status:"active",currentStepId:_,completedSteps:w.status==="active"?w.completedSteps:[]}}case"tour.step_started":{let _=g.props?.stepId;return{...w,currentStepId:_||w.currentStepId}}case"tour.step_changed":{let _=g.props?.previousStepId,L=g.props?.nextStepId,I=_&&!w.completedSteps.includes(_)?[...w.completedSteps,_]:w.completedSteps;return{...w,currentStepId:L||w.currentStepId,completedSteps:I}}case"tour.completed":{let _=Date.now();return u.current[m]=_,o?.set?.("completed",{...u.current}),{...w,status:"completed",currentStepId:null,completedSteps:w.steps.map(L=>L.id),completedAt:_}}case"tour.paused":return w;default:return w}}))});return()=>{b();for(let g of s.current)g();s.current=[]}},[t,o]);let h=(0,Je.useCallback)((b,g)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:b,stepId:g})},[t]),S=(0,Je.useCallback)(b=>{d(g=>{let m=g.map(v=>v.tourId===b?{...v,status:"dismissed"}:v),y=m.filter(v=>v.status==="dismissed").map(v=>v.tourId);return o?.set?.("dismissed",y),m})},[o]),x=(0,Je.useMemo)(()=>c.filter(b=>b.status==="active"),[c]);return(0,Tv.jsx)("div",{ref:l,children:(0,Tv.jsx)($k,{workflows:x,onStepClick:h,onDismiss:S})})}var Wk={mount(t,e){let a=e?.runtime||null,r=(0,Gk.createRoot)(t);return r.render(Je.default.createElement(FD,{runtime:a})),()=>{r.unmount()}}};var Zk=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:()=>{}};if(a.getAttribute("data-syntro-highlight-dismissed"))return{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=sk(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,onDismiss:()=>{a.setAttribute("data-syntro-highlight-dismissed","true")}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{o.destroy(),a.removeAttribute("data-syntro-highlight"),a.removeAttribute("data-syntro-highlight-dismissed")}}},Xk=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(x=>requestAnimationFrame(x));let n=x=>({r:parseInt(x.slice(1,3),16),g:parseInt(x.slice(3,5),16),b:parseInt(x.slice(5,7),16)}),i={r:79,g:70,b:229},s=null;try{let x=getComputedStyle(e.overlayRoot),b=x.getPropertyValue("--sc-color-primary")?.trim(),g=x.getPropertyValue("--sc-color-primary-hover")?.trim();b?.startsWith("#")&&b.length>=7&&(i=n(b)),g?.startsWith("#")&&g.length>=7&&(s=n(g))}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:f}=i;if(s){let{r:x,g:b,b:g}=s;u.textContent=`
|
|
63
63
|
@keyframes syntro-pulse-anim {
|
|
64
64
|
0%, 100% {
|
|
65
65
|
box-shadow: 0 0 0 0 rgba(${c}, ${d}, ${f}, 0.35);
|
|
@@ -68,10 +68,10 @@ Error generating stack: `+n.message+`
|
|
|
68
68
|
box-shadow: 0 0 0 12px rgba(${c}, ${d}, ${f}, 0);
|
|
69
69
|
}
|
|
70
70
|
50% {
|
|
71
|
-
box-shadow: 0 0 0 0 rgba(${
|
|
71
|
+
box-shadow: 0 0 0 0 rgba(${x}, ${b}, ${g}, 0.35);
|
|
72
72
|
}
|
|
73
73
|
75% {
|
|
74
|
-
box-shadow: 0 0 0 12px rgba(${
|
|
74
|
+
box-shadow: 0 0 0 12px rgba(${x}, ${b}, ${g}, 0);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
`}else u.textContent=`
|
|
@@ -83,105 +83,89 @@ Error generating stack: `+n.message+`
|
|
|
83
83
|
box-shadow: 0 0 0 12px rgba(${c}, ${d}, ${f}, 0);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
`;document.head.appendChild(u);let
|
|
86
|
+
`;document.head.appendChild(u);let h=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=h,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.isConnected&&(a.style.animation=h,a.removeAttribute("data-syntro-pulse"))}}},Kk=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:()=>{try{n.remove()}catch{}a.isConnected&&i!==void 0&&(a.style.position=i)},updateFn:s=>{"content"in s&&typeof s.content=="string"&&(n.textContent=s.content)}}},Yk=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">${Ca(r.title)}</div>`),n+=`<div class="syntro-tt-body">${Ca(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+=`
|
|
87
87
|
<button
|
|
88
88
|
class="syntro-tt-btn ${s?"syntro-tt-btn-primary":""}"
|
|
89
|
-
data-syntro-action="${
|
|
89
|
+
data-syntro-action="${Ca(i.actionId)}"
|
|
90
90
|
>
|
|
91
|
-
${
|
|
91
|
+
${Ca(i.label)}
|
|
92
92
|
</button>
|
|
93
|
-
`}
|
|
93
|
+
`}n+="</div>"}else r.cta&&(n+=`<div class="syntro-tt-actions">
|
|
94
94
|
<button class="syntro-tt-btn syntro-tt-btn-primary" data-syntro-action="cta">
|
|
95
|
-
${
|
|
95
|
+
${Ca(r.cta.label)}
|
|
96
96
|
</button>
|
|
97
|
-
</div>`);let o=
|
|
97
|
+
</div>`);let o=Uk(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()}}},Rv=[{kind:"overlays:highlight",executor:Zk},{kind:"overlays:pulse",executor:Xk},{kind:"overlays:badge",executor:Kk},{kind:"overlays:tooltip",executor:Yk},{kind:"overlays:modal",executor:Lv},{kind:"overlays:tour",executor:Cv},{kind:"overlays:celebrate",executor:ok}],Mv={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, celebrations, visual overlays, and workflow tracking",executors:Rv,widgets:[{id:"adaptive-overlays:workflow-tracker",component:Wk,metadata:{name:"Workflow Tracker",icon:"\u{1F4CB}",description:"Tracks multi-step workflow progress across tours"}}]};function Ov(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 f=a.surfaces.mount(u,c,{...d,adaptiveId:e});return{unmount:()=>f.unmount(),update:h=>f.update(h)}},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 Dv(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var HD=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","overlays:tour"]),UD=new Set(["adaptive-chatbot","adaptive-content","adaptive-faq","adaptive-gamification","adaptive-nav","adaptive-overlays"]),zD={faq:"adaptive-faq",nav:"adaptive-nav",gamification:"adaptive-gamification",chatbot:"adaptive-chatbot"};function Qk(t){return zD[t]??t}function Jk(t){return HD.has(t)}function e1(t){if(Jk(t))return null;let e=t.indexOf(":");return e===-1?null:Qk(t.slice(0,e))}function Bv(t){let e=t.indexOf(":");return e===-1?null:Qk(t.slice(0,e))}function Pv(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(x){return`${e}/adaptives/${x}/index.js`}async function c(x){if(a.has(x))return{appId:x,success:!0,manifest:a.get(x)?.manifest};if(l.has(x))return l.get(x);if(i.has(x))return i.get(x);let b=(async()=>{n?.(x);try{let g=u(x);if(s.has(g)){let C=a.get(x);if(C)return o?.(x,!0),{appId:x,success:!0,manifest:C.manifest}}let m=new Promise((C,w)=>{setTimeout(()=>w(new Error(`Timeout loading app: ${x}`)),r)}),y=d(g,x);await Promise.race([y,m]),s.add(g);let v=a.get(x);if(!v)throw new Error(`App ${x} did not register after loading`);return o?.(x,!0),{appId:x,success:!0,manifest:v.manifest}}catch(g){let m=g instanceof Error?g.message:String(g);o?.(x,!1,m);let y={appId:x,success:!1,error:m};return l.set(x,y),y}finally{i.delete(x)}})();return i.set(x,b),b}async function d(x,b){if(typeof window<"u"){try{let g=await import(x);g.manifest?a.register(g.manifest):g.default?.manifest?a.register(g.default.manifest):g.default&&a.register(g.default);return}catch{}return new Promise((g,m)=>{let y=document.createElement("script");y.src=x,y.async=!0,y.onload=()=>{a.get(b)?g():m(new Error(`App ${b} did not self-register`))},y.onerror=()=>{m(new Error(`Failed to load app script: ${x}`))},document.head.appendChild(y)})}throw new Error("Dynamic app loading not supported in SSR")}function f(x){let b=new Set;if(x.apps)for(let g of x.apps)b.add(g);if(x.actions)for(let g of x.actions){let m=e1(g.kind);if(m&&b.add(m),g.kind==="core:mountWidget"){let y=g.widget?.widgetId;if(y){let v=Bv(y);v&&b.add(v)}}}if(x.tiles){for(let g of x.tiles)if(g.widget){let m=Bv(g.widget);m&&b.add(m)}}for(let g of UD)b.delete(g);return Array.from(b)}async function h(x){let b=f(x);return b.length===0?[]:await Promise.all(b.map(m=>c(m)))}async function S(x){return Promise.all(x.map(b=>c(b)))}return{loadApp:c,loadAppsForConfig:h,preloadApps:S,getRequiredApps:f,getAppUrl:u}}var Uf=class{constructor(){D(this,"apps",new Map);D(this,"eventListeners",new Set);D(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=Ov({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)}Dv(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()}},mu=new Uf;var rr=Y(Ee(),1);var Jo=Y(tt(),1),Fv=Y(Go(),1);var Jr=Y(tt(),1);var t1=/```json\s*\n([\s\S]*?)```/g;function a1(t){let e=[],a=t,r=[],n;for(t1.lastIndex=0;(n=t1.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,`
|
|
98
98
|
|
|
99
|
-
`).trim(),{displayText:a,actions:e}}var
|
|
100
|
-
<div style="padding: 16px; font-family: system-ui; color: ${
|
|
101
|
-
<p style="margin: 0 0 8px; color: ${
|
|
102
|
-
<p style="margin: 0; font-size: 12px; color: ${
|
|
99
|
+
`).trim(),{displayText:a,actions:e}}var gu=class extends Error{constructor(e){super(e),this.name="AuthError"}};function qD(){let t=document.cookie.match(/stytch_session_jwt=([^;]*)/);if(!t||!t[1])throw new gu("No authentication token found");let e=localStorage.getItem("syntrologie_workspace_id");if(!e)throw new gu("No workspace ID found");return{Authorization:`Bearer ${t[1]}`,"X-Workspace-Id":e}}async function r1(t,e){let a=qD(),r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...a},body:JSON.stringify(e)});if(!r.ok)throw r.status===401?new gu("Session expired or unauthorized"):new Error(`Chat request failed: ${r.status} ${r.statusText}`);return r.json()}var VD=0;function Nv(){return`msg-${Date.now()}-${++VD}`}function n1(t){let{backendUrl:e,tileId:a,runtime:r,greeting:n,maxHistory:o=20,mlflowRunId:i,config:s}=t,[l,u]=(0,Jr.useState)(()=>n?[{id:Nv(),role:"assistant",text:n,timestamp:Date.now()}]:[]),[c,d]=(0,Jr.useState)(!1),[f,h]=(0,Jr.useState)(null),S=(0,Jr.useRef)(null),x=(0,Jr.useCallback)(async g=>{let m=g.trim();if(!m)return;h(null);let y={id:Nv(),role:"user",text:m,timestamp:Date.now()};u(v=>[...v,y]),d(!0);try{let C=[...l,y].slice(-o).map(A=>({role:A.role,content:A.text})),w=await r1(e,{message:m,history:C,mlflow_run_id:i,current_config:s}),{displayText:_,actions:L}=a1(w.response),I={id:Nv(),role:"assistant",text:_,timestamp:Date.now()};u(A=>[...A,I]),L.length>0&&(S.current?.isApplied()&&await S.current.revertAll(),S.current=await r.actions.applyBatch(L),r.events.publish("chatbot.actions_applied",{count:L.length,kinds:L.map(A=>A.kind),tileId:a}))}catch(v){let C=v instanceof Error?v.message:"An unexpected error occurred";h(C)}finally{d(!1)}},[e,l,o,i,s,r,a]),b=(0,Jr.useCallback)(()=>{u([]),h(null),S.current?.isApplied()&&(S.current.revertAll(),S.current=null),sessionStorage.removeItem(`syntro:chatbot:history:${a}`)},[a]);return{messages:l,isLoading:c,error:f,sendMessage:x,clearMessages:b}}var ar={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:wt[4],color:Qa.white,borderBottomRightRadius:"4px"},assistantMessage:{alignSelf:"flex-start",backgroundColor:"rgba(255, 255, 255, 0.08)",color:k[10],borderBottomLeftRadius:"4px"},loadingDots:{alignSelf:"flex-start",padding:"8px 16px",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:"12px",color:k[8],fontSize:"13px"},errorBanner:{padding:"8px 12px",backgroundColor:"rgba(239, 68, 68, 0.1)",color:Xe[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:k[12],fontSize:"14px",outline:"none",fontFamily:"inherit"},sendButton:{padding:"8px 16px",borderRadius:"8px",border:"none",backgroundColor:wt[4],color:Qa.white,fontWeight:600,fontSize:"13px",cursor:"pointer",whiteSpace:"nowrap"},sendButtonDisabled:{opacity:.5,cursor:"not-allowed"}};function $D({message:t}){let e=t.role==="user",a={...ar.messageBubble,...e?ar.userMessage:ar.assistantMessage};return(0,rr.jsx)("div",{style:a,children:t.text})}function jD({config:t,runtime:e,tileId:a}){let{messages:r,isLoading:n,error:o,sendMessage:i,clearMessages:s}=n1({backendUrl:t.backendUrl,tileId:a,runtime:e,greeting:t.greeting,maxHistory:t.maxHistory,mlflowRunId:t.mlflowRunId}),l=(0,Jo.useRef)(null),u=(0,Jo.useRef)(null);(0,Jo.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[]);let c=d=>{d.preventDefault();let f=u.current;if(!f||!f.value.trim()||n)return;let h=f.value;f.value="",i(h)};return(0,rr.jsxs)("div",{style:ar.container,"data-testid":"chat-assistant",children:[(0,rr.jsxs)("div",{ref:l,style:ar.messageList,children:[r.map(d=>(0,rr.jsx)($D,{message:d},d.id)),n&&(0,rr.jsx)("div",{style:ar.loadingDots,children:"Thinking..."})]}),o&&(0,rr.jsx)("div",{style:ar.errorBanner,children:o}),(0,rr.jsxs)("form",{onSubmit:c,style:ar.inputForm,children:[(0,rr.jsx)("input",{ref:u,style:ar.input,placeholder:"Ask anything...",disabled:n,"data-testid":"chat-input"}),(0,rr.jsx)("button",{type:"submit",disabled:n,style:{...ar.sendButton,...n?ar.sendButtonDisabled:{}},"data-testid":"chat-send",children:"Send"})]})]})}var o1={mount(t,e){let{config:a,runtime:r,tileId:n="chatbot-widget"}=e||{};if(a&&r&&typeof Fv.createRoot=="function"){let o=(0,Fv.createRoot)(t);return o.render(Jo.default.createElement(jD,{config:a,runtime:r,tileId:n})),()=>{o.unmount()}}return!a||!r?(t.innerHTML=`<div style="padding: 16px; color: ${k[8]};">Chat widget requires config and runtime.</div>`,()=>{t.innerHTML=""}):(t.innerHTML=`
|
|
100
|
+
<div style="padding: 16px; font-family: system-ui; color: ${k[10]};">
|
|
101
|
+
<p style="margin: 0 0 8px; color: ${k[8]};">${a.greeting||"Hi! How can I help?"}</p>
|
|
102
|
+
<p style="margin: 0; font-size: 12px; color: ${k[7]};">Chat widget mounted. Awaiting React renderer.</p>
|
|
103
103
|
</div>
|
|
104
|
-
`,()=>{t.innerHTML=""})}};var
|
|
105
|
-
]`).replace("lheading",
|
|
106
|
-
`).map(o=>{let i=o.match(a.other.beginningSpace);if(i===null)return o;let[s]=i;return s.length>=
|
|
107
|
-
`)}var
|
|
108
|
-
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let a=e[0],
|
|
109
|
-
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let a=
|
|
104
|
+
`,()=>{t.innerHTML=""})}};var i1={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:o1,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function s1(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 GD(t,e,a){let r=s1(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 WD(t,e,a){let r=s1(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 ZD(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 l1=[{kind:"faq:scroll_to",executor:GD},{kind:"faq:toggle_item",executor:WD},{kind:"faq:update",executor:ZD}];var $e=Y(Ee(),1);function qv(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ai=qv();function m1(t){ai=t}var ei={exec:()=>null};function xe(t,e=""){let a=typeof t=="string"?t:t.source,r={replace:(n,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(Gt.caret,"$1"),a=a.replace(n,i),r},getRegex:()=>new RegExp(a,e)};return r}var XD=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Gt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},KD=/^(?:[ \t]*(?:\n|$))+/,YD=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,QD=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,bu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,JD=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vv=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,g1=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,v1=xe(g1).replace(/bull/g,Vv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),eB=xe(g1).replace(/bull/g,Vv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$v=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,tB=/^[^\n]+/,jv=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,aB=xe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",jv).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rB=xe(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vv).getRegex(),Gf="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Gv=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,nB=xe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Gv).replace("tag",Gf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),y1=xe($v).replace("hr",bu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Gf).getRegex(),oB=xe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",y1).getRegex(),Wv={blockquote:oB,code:YD,def:aB,fences:QD,heading:JD,hr:bu,html:nB,lheading:v1,list:rB,newline:KD,paragraph:y1,table:ei,text:tB},u1=xe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",bu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Gf).getRegex(),iB={...Wv,lheading:eB,table:u1,paragraph:xe($v).replace("hr",bu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",u1).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Gf).getRegex()},sB={...Wv,html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Gv).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ei,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xe($v).replace("hr",bu).replace("heading",` *#{1,6} *[^
|
|
105
|
+
]`).replace("lheading",v1).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},lB=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,uB=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,x1=/^( {2,}|\\)\n(?!\s*$)/,cB=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Wf=/[\p{P}\p{S}]/u,Zv=/[\s\p{P}\p{S}]/u,b1=/[^\s\p{P}\p{S}]/u,dB=xe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zv).getRegex(),S1=/(?!~)[\p{P}\p{S}]/u,fB=/(?!~)[\s\p{P}\p{S}]/u,pB=/(?:[^\s\p{P}\p{S}]|~)/u,_1=/(?![*_])[\p{P}\p{S}]/u,hB=/(?![*_])[\s\p{P}\p{S}]/u,mB=/(?:[^\s\p{P}\p{S}]|[*_])/u,gB=xe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",XD?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),C1=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,vB=xe(C1,"u").replace(/punct/g,Wf).getRegex(),yB=xe(C1,"u").replace(/punct/g,S1).getRegex(),w1="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xB=xe(w1,"gu").replace(/notPunctSpace/g,b1).replace(/punctSpace/g,Zv).replace(/punct/g,Wf).getRegex(),bB=xe(w1,"gu").replace(/notPunctSpace/g,pB).replace(/punctSpace/g,fB).replace(/punct/g,S1).getRegex(),SB=xe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,b1).replace(/punctSpace/g,Zv).replace(/punct/g,Wf).getRegex(),_B=xe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,_1).getRegex(),CB="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",wB=xe(CB,"gu").replace(/notPunctSpace/g,mB).replace(/punctSpace/g,hB).replace(/punct/g,_1).getRegex(),LB=xe(/\\(punct)/,"gu").replace(/punct/g,Wf).getRegex(),kB=xe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),IB=xe(Gv).replace("(?:-->|$)","-->").getRegex(),AB=xe("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",IB).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Vf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,EB=xe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Vf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),L1=xe(/^!?\[(label)\]\[(ref)\]/).replace("label",Vf).replace("ref",jv).getRegex(),k1=xe(/^!?\[(ref)\](?:\[\])?/).replace("ref",jv).getRegex(),TB=xe("reflink|nolink(?!\\()","g").replace("reflink",L1).replace("nolink",k1).getRegex(),c1=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Xv={_backpedal:ei,anyPunctuation:LB,autolink:kB,blockSkip:gB,br:x1,code:uB,del:ei,delLDelim:ei,delRDelim:ei,emStrongLDelim:vB,emStrongRDelimAst:xB,emStrongRDelimUnd:SB,escape:lB,link:EB,nolink:k1,punctuation:dB,reflink:L1,reflinkSearch:TB,tag:AB,text:cB,url:ei},RB={...Xv,link:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Vf).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Vf).getRegex()},Hv={...Xv,emStrongRDelimAst:bB,emStrongLDelim:yB,delLDelim:_B,delRDelim:wB,url:xe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",c1).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:xe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",c1).getRegex()},MB={...Hv,br:xe(x1).replace("{2,}","*").getRegex(),text:xe(Hv.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},zf={normal:Wv,gfm:iB,pedantic:sB},vu={normal:Xv,gfm:Hv,breaks:MB,pedantic:RB},OB={"&":"&","<":"<",">":">",'"':""","'":"'"},d1=t=>OB[t];function Sr(t,e){if(e){if(Gt.escapeTest.test(t))return t.replace(Gt.escapeReplace,d1)}else if(Gt.escapeTestNoEncode.test(t))return t.replace(Gt.escapeReplaceNoEncode,d1);return t}function f1(t){try{t=encodeURI(t).replace(Gt.percentDecode,"%")}catch{return null}return t}function p1(t,e){let a=t.replace(Gt.findPipe,(o,i,s)=>{let l=!1,u=i;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),r=a.split(Gt.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(Gt.slashPipe,"|");return r}function yu(t,e,a){let r=t.length;if(r===0)return"";let n=0;for(;n<r;){let o=t.charAt(r-n-1);if(o===e&&!a)n++;else if(o!==e&&a)n++;else break}return t.slice(0,r-n)}function DB(t,e){if(t.indexOf(e[1])===-1)return-1;let a=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])a++;else if(t[r]===e[1]&&(a--,a<0))return r;return a>0?-2:-1}function BB(t,e=0){let a=e,r="";for(let n of t)if(n===" "){let o=4-a%4;r+=" ".repeat(o),a+=o}else r+=n,a++;return r}function h1(t,e,a,r,n){let o=e.href,i=e.title||null,s=t[1].replace(n.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:a,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,l}function PB(t,e,a){let r=t.match(a.other.indentCodeCompensation);if(r===null)return e;let n=r[1];return e.split(`
|
|
106
|
+
`).map(o=>{let i=o.match(a.other.beginningSpace);if(i===null)return o;let[s]=i;return s.length>=n.length?o.slice(n.length):o}).join(`
|
|
107
|
+
`)}var $f=class{constructor(t){D(this,"options");D(this,"rules");D(this,"lexer");this.options=t||ai}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let a=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?a:yu(a,`
|
|
108
|
+
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let a=e[0],r=PB(a,e[3]||"",this.rules);return{type:"code",raw:a,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let a=e[2].trim();if(this.rules.other.endingHash.test(a)){let r=yu(a,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(a=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:a,tokens:this.lexer.inline(a)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:yu(e[0],`
|
|
109
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let a=yu(e[0],`
|
|
110
110
|
`).split(`
|
|
111
|
-
`),
|
|
111
|
+
`),r="",n="",o=[];for(;a.length>0;){let i=!1,s=[],l;for(l=0;l<a.length;l++)if(this.rules.other.blockquoteStart.test(a[l]))s.push(a[l]),i=!0;else if(!i)s.push(a[l]);else break;a=a.slice(l);let u=s.join(`
|
|
112
112
|
`),c=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
113
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");
|
|
114
|
-
${u}`:u,
|
|
115
|
-
${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,o,!0),this.lexer.state.top=d,a.length===0)break;let f=o.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let
|
|
113
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
114
|
+
${u}`:u,n=n?`${n}
|
|
115
|
+
${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,o,!0),this.lexer.state.top=d,a.length===0)break;let f=o.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let h=f,S=h.raw+`
|
|
116
116
|
`+a.join(`
|
|
117
|
-
`),
|
|
117
|
+
`),x=this.blockquote(S);o[o.length-1]=x,r=r.substring(0,r.length-h.raw.length)+x.raw,n=n.substring(0,n.length-h.text.length)+x.text;break}else if(f?.type==="list"){let h=f,S=h.raw+`
|
|
118
118
|
`+a.join(`
|
|
119
|
-
`),
|
|
120
|
-
`);continue}}return{type:"blockquote",raw:
|
|
121
|
-
`,1)[0]
|
|
122
|
-
`,1)[0],
|
|
123
|
-
`,t=t.substring(f.length+1),l=!0),!l){let
|
|
124
|
-
`,1)[0],
|
|
125
|
-
`+
|
|
126
|
-
`+f}
|
|
127
|
-
`,t=t.substring(
|
|
128
|
-
`):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(a.length===
|
|
129
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:a,tokens:this.lexer.inline(a)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let a=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;let o=
|
|
130
|
-
`),this.blockTokens(e,this.tokens);for(let a=0;a<this.inlineQueue.length;a++){let
|
|
131
|
-
`:a.push(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
`+
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
`+
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
119
|
+
`),x=this.list(S);o[o.length-1]=x,r=r.substring(0,r.length-f.raw.length)+x.raw,n=n.substring(0,n.length-h.raw.length)+x.raw,a=S.substring(o.at(-1).raw.length).split(`
|
|
120
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:o,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let a=e[1].trim(),r=a.length>1,n={type:"list",raw:"",ordered:r,start:r?+a.slice(0,-1):"",loose:!1,items:[]};a=r?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=r?a:"[*+-]");let o=this.rules.other.listItemRegex(a),i=!1;for(;t;){let l=!1,u="",c="";if(!(e=o.exec(t))||this.rules.block.hr.test(t))break;u=e[0],t=t.substring(u.length);let d=BB(e[2].split(`
|
|
121
|
+
`,1)[0],e[1].length),f=t.split(`
|
|
122
|
+
`,1)[0],h=!d.trim(),S=0;if(this.options.pedantic?(S=2,c=d.trimStart()):h?S=e[1].length+1:(S=d.search(this.rules.other.nonSpaceChar),S=S>4?1:S,c=d.slice(S),S+=e[1].length),h&&this.rules.other.blankLine.test(f)&&(u+=f+`
|
|
123
|
+
`,t=t.substring(f.length+1),l=!0),!l){let x=this.rules.other.nextBulletRegex(S),b=this.rules.other.hrRegex(S),g=this.rules.other.fencesBeginRegex(S),m=this.rules.other.headingBeginRegex(S),y=this.rules.other.htmlBeginRegex(S),v=this.rules.other.blockquoteBeginRegex(S);for(;t;){let C=t.split(`
|
|
124
|
+
`,1)[0],w;if(f=C,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),w=f):w=f.replace(this.rules.other.tabCharGlobal," "),g.test(f)||m.test(f)||y.test(f)||v.test(f)||x.test(f)||b.test(f))break;if(w.search(this.rules.other.nonSpaceChar)>=S||!f.trim())c+=`
|
|
125
|
+
`+w.slice(S);else{if(h||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||g.test(d)||m.test(d)||b.test(d))break;c+=`
|
|
126
|
+
`+f}h=!f.trim(),u+=C+`
|
|
127
|
+
`,t=t.substring(C.length+1),d=w.slice(S)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(i=!0)),n.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),n.raw+=u}let s=n.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let l of n.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(l.raw);if(u){let c={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};l.checked=c.checked,n.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!n.loose){let u=l.tokens.filter(d=>d.type==="space"),c=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));n.loose=c}}if(n.loose)for(let l of n.items){l.loose=!0;for(let u of l.tokens)u.type==="text"&&(u.type="paragraph")}return n}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let a=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:a,raw:e[0],href:r,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let a=p1(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
128
|
+
`):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(a.length===r.length){for(let i of r)this.rules.other.tableAlignRight.test(i)?o.align.push("right"):this.rules.other.tableAlignCenter.test(i)?o.align.push("center"):this.rules.other.tableAlignLeft.test(i)?o.align.push("left"):o.align.push(null);for(let i=0;i<a.length;i++)o.header.push({text:a[i],tokens:this.lexer.inline(a[i]),header:!0,align:o.align[i]});for(let i of n)o.rows.push(p1(i,o.header.length).map((s,l)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:o.align[l]})));return o}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let a=e[1].charAt(e[1].length-1)===`
|
|
129
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:a,tokens:this.lexer.inline(a)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let a=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;let o=yu(a.slice(0,-1),"\\");if((a.length-o.length)%2===0)return}else{let o=DB(e[2],"()");if(o===-2)return;if(o>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let r=e[2],n="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],n=o[3])}else n=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(a)?r=r.slice(1):r=r.slice(1,-1)),h1(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let a;if((a=this.rules.inline.reflink.exec(t))||(a=this.rules.inline.nolink.exec(t))){let r=(a[2]||a[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[r.toLowerCase()];if(!n){let o=a[0].charAt(0);return{type:"text",raw:o,text:o}}return h1(a,n,a[0],this.lexer,this.rules)}}emStrong(t,e,a=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||r[3]&&a.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!a||this.rules.inline.punctuation.exec(a))){let n=[...r[0]].length-1,o,i,s=n,l=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+n);(r=u.exec(e))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=[...o].length,r[3]||r[4]){s+=i;continue}else if((r[5]||r[6])&&n%3&&!((n+i)%3)){l+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+l);let c=[...r[0]][0].length,d=t.slice(0,n+r.index+c+i);if(Math.min(n,i)%2){let h=d.slice(1,-1);return{type:"em",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let a=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(a),n=this.rules.other.startingSpaceChar.test(a)&&this.rules.other.endingSpaceChar.test(a);return r&&n&&(a=a.substring(1,a.length-1)),{type:"codespan",raw:e[0],text:a}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,a=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!a||this.rules.inline.punctuation.exec(a))){let n=[...r[0]].length-1,o,i,s=n,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+n);(r=l.exec(e))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o||(i=[...o].length,i!==n))continue;if(r[3]||r[4]){s+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s);let u=[...r[0]][0].length,c=t.slice(0,n+r.index+u+i),d=c.slice(n,-n);return{type:"del",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let a,r;return e[2]==="@"?(a=e[1],r="mailto:"+a):(a=e[1],r=a),{type:"link",raw:e[0],text:a,href:r,tokens:[{type:"text",raw:a,text:a}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let a,r;if(e[2]==="@")a=e[0],r="mailto:"+a;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);a=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:a,href:r,tokens:[{type:"text",raw:a,text:a}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let a=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:a}}}},nr=class Uv{constructor(e){D(this,"tokens");D(this,"options");D(this,"state");D(this,"inlineQueue");D(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ai,this.options.tokenizer=this.options.tokenizer||new $f,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let a={other:Gt,block:zf.normal,inline:vu.normal};this.options.pedantic?(a.block=zf.pedantic,a.inline=vu.pedantic):this.options.gfm&&(a.block=zf.gfm,this.options.breaks?a.inline=vu.breaks:a.inline=vu.gfm),this.tokenizer.rules=a}static get rules(){return{block:zf,inline:vu}}static lex(e,a){return new Uv(a).lex(e)}static lexInline(e,a){return new Uv(a).inlineTokens(e)}lex(e){e=e.replace(Gt.carriageReturn,`
|
|
130
|
+
`),this.blockTokens(e,this.tokens);for(let a=0;a<this.inlineQueue.length;a++){let r=this.inlineQueue[a];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,a=[],r=!1){for(this.options.pedantic&&(e=e.replace(Gt.tabCharGlobal," ").replace(Gt.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(i=>(n=i.call({lexer:this},e,a))?(e=e.substring(n.raw.length),a.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let i=a.at(-1);n.raw.length===1&&i!==void 0?i.raw+=`
|
|
131
|
+
`:a.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let i=a.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
132
|
+
`)?"":`
|
|
133
|
+
`)+n.raw,i.text+=`
|
|
134
|
+
`+n.text,this.inlineQueue.at(-1).src=i.text):a.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),a.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),a.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),a.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),a.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),a.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),a.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let i=a.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
135
|
+
`)?"":`
|
|
136
|
+
`)+n.raw,i.text+=`
|
|
137
|
+
`+n.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},a.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),a.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),a.push(n);continue}let o=e;if(this.options.extensions?.startBlock){let i=1/0,s=e.slice(1),l;this.options.extensions.startBlock.forEach(u=>{l=u.call({lexer:this},s),typeof l=="number"&&l>=0&&(i=Math.min(i,l))}),i<1/0&&i>=0&&(o=e.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o))){let i=a.at(-1);r&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
|
|
138
|
+
`)?"":`
|
|
139
|
+
`)+n.raw,i.text+=`
|
|
140
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):a.push(n),r=o.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let i=a.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
141
|
+
`)?"":`
|
|
142
|
+
`)+n.raw,i.text+=`
|
|
143
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):a.push(n);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,a}inline(e,a=[]){return this.inlineQueue.push({src:e,tokens:a}),a}inlineTokens(e,a=[]){let r=e,n=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)l.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,n.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)o=n[2]?n[2].length:0,r=r.slice(0,n.index+o)+"["+"a".repeat(n[0].length-o-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let i=!1,s="";for(;e;){i||(s=""),i=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,a))?(e=e.substring(l.raw.length),a.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=a.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):a.push(l);continue}if(l=this.tokenizer.emStrong(e,r,s)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.del(e,r,s)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),a.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),a.push(l);continue}let u=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),f;this.options.extensions.startInline.forEach(h=>{f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(u=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(u)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(s=l.raw.slice(-1)),i=!0;let c=a.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):a.push(l);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return a}},jf=class{constructor(t){D(this,"options");D(this,"parser");this.options=t||ai}space(t){return""}code({text:t,lang:e,escaped:a}){let r=(e||"").match(Gt.notSpaceStart)?.[0],n=t.replace(Gt.endingNewline,"")+`
|
|
144
|
+
`;return r?'<pre><code class="language-'+Sr(r)+'">'+(a?n:Sr(n,!0))+`</code></pre>
|
|
145
|
+
`:"<pre><code>"+(a?n:Sr(n,!0))+`</code></pre>
|
|
142
146
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
143
147
|
${this.parser.parse(t)}</blockquote>
|
|
144
|
-
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
148
|
+
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
145
149
|
`}hr(t){return`<hr>
|
|
146
|
-
`}list(t){let e=t.ordered,a=t.start,
|
|
147
|
-
`+
|
|
148
|
-
`}listitem(t){
|
|
149
|
-
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
150
|
-
`}table(t){let e="",a="";for(let
|
|
150
|
+
`}list(t){let e=t.ordered,a=t.start,r="";for(let i=0;i<t.items.length;i++){let s=t.items[i];r+=this.listitem(s)}let n=e?"ol":"ul",o=e&&a!==1?' start="'+a+'"':"";return"<"+n+o+`>
|
|
151
|
+
`+r+"</"+n+`>
|
|
152
|
+
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
153
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
154
|
+
`}table(t){let e="",a="";for(let n=0;n<t.header.length;n++)a+=this.tablecell(t.header[n]);e+=this.tablerow({text:a});let r="";for(let n=0;n<t.rows.length;n++){let o=t.rows[n];a="";for(let i=0;i<o.length;i++)a+=this.tablecell(o[i]);r+=this.tablerow({text:a})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
151
155
|
<thead>
|
|
152
156
|
`+e+`</thead>
|
|
153
|
-
`+
|
|
157
|
+
`+r+`</table>
|
|
154
158
|
`}tablerow({text:t}){return`<tr>
|
|
155
159
|
${t}</tr>
|
|
156
160
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),a=t.header?"th":"td";return(t.align?`<${a} align="${t.align}">`:`<${a}>`)+e+`</${a}>
|
|
157
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${
|
|
158
|
-
`+this.renderer.text(s);a?n+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):n+=l;continue}default:{let s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(e,a=this.renderer){let n="";for(let r=0;r<e.length;r++){let o=e[r];if(this.options.extensions?.renderers?.[o.type]){let s=this.options.extensions.renderers[o.type].call({parser:this},o);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=s||"";continue}}let i=o;switch(i.type){case"escape":{n+=a.text(i);break}case"html":{n+=a.html(i);break}case"link":{n+=a.link(i);break}case"image":{n+=a.image(i);break}case"strong":{n+=a.strong(i);break}case"em":{n+=a.em(i);break}case"codespan":{n+=a.codespan(i);break}case"br":{n+=a.br(i);break}case"del":{n+=a.del(i);break}case"text":{n+=a.text(i);break}default:{let s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}},lv,vf=(lv=class{constructor(t){B(this,"options");B(this,"block");this.options=t||Xo}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Wn.lex:Wn.lexInline}provideParser(){return this.block?Xn.parse:Xn.parseInline}},B(lv,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),lv),Sv=class{constructor(...t){B(this,"defaults",fv());B(this,"options",this.setOptions);B(this,"parse",this.parseMarkdown(!0));B(this,"parseInline",this.parseMarkdown(!1));B(this,"Parser",Xn);B(this,"Renderer",bf);B(this,"TextRenderer",bv);B(this,"Lexer",Wn);B(this,"Tokenizer",xf);B(this,"Hooks",vf);this.use(...t)}walkTokens(t,e){let a=[];for(let n of t)switch(a=a.concat(e.call(this,n)),n.type){case"table":{let r=n;for(let o of r.header)a=a.concat(this.walkTokens(o.tokens,e));for(let o of r.rows)for(let i of o)a=a.concat(this.walkTokens(i.tokens,e));break}case"list":{let r=n;a=a.concat(this.walkTokens(r.items,e));break}default:{let r=n;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(o=>{let i=r[o].flat(1/0);a=a.concat(this.walkTokens(i,e))}):r.tokens&&(a=a.concat(this.walkTokens(r.tokens,e)))}}return a}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(a=>{let n={...a};if(n.async=this.defaults.async||n.async||!1,a.extensions&&(a.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let o=e.renderers[r.name];o?e.renderers[r.name]=function(...i){let s=r.renderer.apply(this,i);return s===!1&&(s=o.apply(this,i)),s}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=e[r.level];o?o.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),n.extensions=e),a.renderer){let r=this.defaults.renderer||new bf(this.defaults);for(let o in a.renderer){if(!(o in r))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let i=o,s=a.renderer[i],l=r[i];r[i]=(...u)=>{let c=s.apply(r,u);return c===!1&&(c=l.apply(r,u)),c||""}}n.renderer=r}if(a.tokenizer){let r=this.defaults.tokenizer||new xf(this.defaults);for(let o in a.tokenizer){if(!(o in r))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let i=o,s=a.tokenizer[i],l=r[i];r[i]=(...u)=>{let c=s.apply(r,u);return c===!1&&(c=l.apply(r,u)),c}}n.tokenizer=r}if(a.hooks){let r=this.defaults.hooks||new vf;for(let o in a.hooks){if(!(o in r))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let i=o,s=a.hooks[i],l=r[i];vf.passThroughHooks.has(o)?r[i]=u=>{if(this.defaults.async)return Promise.resolve(s.call(r,u)).then(d=>l.call(r,d));let c=s.call(r,u);return l.call(r,c)}:r[i]=(...u)=>{let c=s.apply(r,u);return c===!1&&(c=l.apply(r,u)),c}}n.hooks=r}if(a.walkTokens){let r=this.defaults.walkTokens,o=a.walkTokens;n.walkTokens=function(i){let s=[];return s.push(o.call(this,i)),r&&(s=s.concat(r.call(this,i))),s}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Wn.lex(t,e??this.defaults)}parser(t,e){return Xn.parse(t,e??this.defaults)}parseMarkdown(t){return(a,n)=>{let r={...n},o={...this.defaults,...r},i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof a>"u"||a===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof a!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(a)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=t);let s=o.hooks?o.hooks.provideLexer():t?Wn.lex:Wn.lexInline,l=o.hooks?o.hooks.provideParser():t?Xn.parse:Xn.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(a):a).then(u=>s(u,o)).then(u=>o.hooks?o.hooks.processAllTokens(u):u).then(u=>o.walkTokens?Promise.all(this.walkTokens(u,o.walkTokens)).then(()=>u):u).then(u=>l(u,o)).then(u=>o.hooks?o.hooks.postprocess(u):u).catch(i);try{o.hooks&&(a=o.hooks.preprocess(a));let u=s(a,o);o.hooks&&(u=o.hooks.processAllTokens(u)),o.walkTokens&&this.walkTokens(u,o.walkTokens);let c=l(u,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(u){return i(u)}}}onError(t,e){return a=>{if(a.message+=`
|
|
159
|
-
Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+hn(a.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(a);throw a}}},Wo=new Sv;function Ie(t,e){return Wo.parse(t,e)}Ie.options=Ie.setOptions=function(t){return Wo.setOptions(t),Ie.defaults=Wo.defaults,hk(Ie.defaults),Ie};Ie.getDefaults=fv;Ie.defaults=Xo;Ie.use=function(...t){return Wo.use(...t),Ie.defaults=Wo.defaults,hk(Ie.defaults),Ie};Ie.walkTokens=function(t,e){return Wo.walkTokens(t,e)};Ie.parseInline=Wo.parseInline;Ie.Parser=Xn;Ie.parser=Xn.parse;Ie.Renderer=bf;Ie.TextRenderer=bv;Ie.Lexer=Wn;Ie.lexer=Wn.lex;Ie.Tokenizer=xf;Ie.Hooks=vf;Ie.parse=Ie;var OU=Ie.options,BU=Ie.setOptions,PU=Ie.use,FU=Ie.walkTokens,NU=Ie.parseInline;var HU=Xn.parse,UU=Wn.lex;var Re=K(Xe(),1),Cv=K(Uo(),1),fO=new Sv({async:!1,gfm:!0,breaks:!0});function Lk(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function pO(t){if(typeof t=="string")return(0,ze.jsx)("p",{style:{margin:0},children:t});if(t.type==="rich")return(0,ze.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}});let e=fO.parse(t.content);return(0,ze.jsx)("div",{style:{margin:0},"data-faq-markdown":"",dangerouslySetInnerHTML:{__html:e}})}function hO(t){return t?t===!0?{style:"thumbs"}:t:null}function mO(t){return t.prompt||"Was this helpful?"}var Rt={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"}},ms={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:Nt[8],color:Nt[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:Nt[0],color:Nt[6]},categoryHeader:{color:I[8]},emptyState:{color:I[7]},feedbackPrompt:{color:I[8]}}};function gO({item:t,isExpanded:e,isHighlighted:a,isLast:n,onToggle:r,theme:o,feedbackConfig:i,feedbackValue:s,onFeedback:l}){let[u,c]=(0,Re.useState)(!1),d=ms[o],{question:f,answer:m}=t.config,S={...Rt.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"}:{},...n?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},b={...Rt.question,...d.question,...u?d.questionHover:{}},x={...Rt.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},p={...Rt.answer,...d.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},g={...Rt.feedback,...d.feedbackPrompt};return(0,ze.jsxs)("div",{style:S,"data-faq-item-id":t.config.id,children:[(0,ze.jsxs)("button",{type:"button",style:b,onClick:r,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-expanded":e,children:[(0,ze.jsx)("span",{children:f}),(0,ze.jsx)("span",{style:x,children:"\u203A"})]}),(0,ze.jsxs)("div",{style:p,"aria-hidden":!e,children:[pO(m),e&&i&&(0,ze.jsxs)("div",{style:g,children:[(0,ze.jsx)("span",{children:mO(i)}),(0,ze.jsx)("button",{type:"button",style:{...Rt.feedbackButton,...s==="up"?Rt.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>l(t.config.id,f,"up"),children:"\u{1F44D}"}),(0,ze.jsx)("button",{type:"button",style:{...Rt.feedbackButton,...s==="down"?Rt.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>l(t.config.id,f,"down"),children:"\u{1F44E}"})]})]})]})}function vO({config:t,runtime:e,instanceId:a}){let[n,r]=(0,Re.useReducer)(T=>T+1,0),[o,i]=(0,Re.useState)(new Set),[s,l]=(0,Re.useState)(null),[u,c]=(0,Re.useState)(""),[d,f]=(0,Re.useState)(new Map),m=(0,Re.useMemo)(()=>hO(t.feedback),[t.feedback]);(0,Re.useEffect)(()=>e.context.subscribe(()=>{r()}),[e.context]),(0,Re.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{r()})},[e.accumulator]),(0,Re.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(P=>{let F=P.props?.actionId;return typeof F=="string"&&F.startsWith("faq:open:")}).pop();if(M&&Date.now()-M.ts<1e4){let P=M.props.actionId.replace("faq:open:","");i(new Set([P])),requestAnimationFrame(()=>{let F=document.querySelector(`[data-faq-item-id="${P}"]`);F&&F.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},D=>{let M=D.props?.actionId;if(typeof M!="string"||!M.startsWith("faq:open:"))return;let P=M.replace("faq:open:","");i(new Set([P])),requestAnimationFrame(()=>{let F=document.querySelector(`[data-faq-item-id="${P}"]`);F&&F.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]),(0,Re.useEffect)(()=>{if(!e.events.subscribe)return;let T=M=>{let P=M.props?.tileId,F=M.props?.itemId;P===a&&F&&(i(new Set([F])),l(F),setTimeout(()=>l(null),1500),requestAnimationFrame(()=>{let U=document.querySelector(`[data-faq-item-id="${F}"]`);U&&U.scrollIntoView({behavior:"smooth",block:"center"})}))};if(e.events.getRecent){let P=e.events.getRecent({names:["notification.deep_link"]},5).filter(F=>F.props?.tileId===a&&F.props?.itemId).pop();P&&Date.now()-P.ts<1e4&&T(P)}return e.events.subscribe({names:["notification.deep_link"]},T)},[e,a]);let S=(0,Re.useMemo)(()=>t.actions.filter(T=>T.triggerWhen?e.evaluateSync(T.triggerWhen).value:!0),[t.actions,e,n]),b=(0,Re.useMemo)(()=>t.ordering==="priority"?[...S].sort((T,D)=>(D.config.priority??0)-(T.config.priority??0)):S,[S,t.ordering]),x=(0,Re.useMemo)(()=>{if(!t.searchable||!u.trim())return b;let T=u.toLowerCase();return b.filter(D=>D.config.question.toLowerCase().includes(T)||Lk(D.config.answer).toLowerCase().includes(T)||D.config.category?.toLowerCase().includes(T))},[b,u,t.searchable]),p=(0,Re.useMemo)(()=>{let T=new Map;for(let D of x){let M=D.config.category;T.has(M)||T.set(M,[]),T.get(M).push(D)}return T},[x]),g=(0,Re.useMemo)(()=>x.some(T=>T.config.category),[x]),v=(0,Re.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),y=(0,Re.useCallback)(T=>{i(D=>{let M=new Set(D);return t.expandBehavior==="single"?D.has(T)?new Set:new Set([T]):(D.has(T)?M.delete(T):M.add(T),M)}),e.events.publish("faq:toggled",{instanceId:a,questionId:T,expanded:!o.has(T),timestamp:Date.now()})},[t.expandBehavior,e.events,a,o]),_=(0,Re.useCallback)((T,D,M)=>{f(P=>{let F=new Map(P);return F.set(T,M),F}),e.events.publish("faq:feedback",{itemId:T,question:D,value:M})},[e.events]),L={...Rt.container,...ms[v].container},C={...Rt.searchInput,...ms[v].searchInput},A={...Rt.emptyState,...ms[v].emptyState},w={...Rt.categoryHeader,...ms[v].categoryHeader},k=T=>T.map((D,M)=>(0,ze.jsx)(gO,{item:D,isExpanded:o.has(D.config.id),isHighlighted:s===D.config.id,isLast:M===T.length-1,onToggle:()=>y(D.config.id),theme:v,feedbackConfig:m,feedbackValue:d.get(D.config.id),onFeedback:_},D.config.id));return S.length===0?(0,ze.jsx)("div",{style:L,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:(0,ze.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,ze.jsxs)("div",{style:L,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,ze.jsxs)("div",{style:Rt.searchWrapper,children:[(0,ze.jsx)("style",{children:`[data-adaptive-id="${a}"] input::placeholder { color: var(--sc-content-search-color, inherit); opacity: 0.7; }`}),(0,ze.jsx)("input",{type:"text",placeholder:"Search questions...",value:u,onChange:T=>c(T.target.value),style:C})]}),(0,ze.jsx)("div",{style:Rt.accordion,children:g?Array.from(p.entries()).map(([T,D])=>(0,ze.jsxs)(Re.default.Fragment,{children:[T&&(0,ze.jsx)("div",{style:w,"data-category-header":T,children:T}),k(D)]},T??"__ungrouped")):k(x)}),t.searchable&&x.length===0&&u&&(0,ze.jsxs)("div",{style:{...Rt.noResults,...ms[v].emptyState},children:['No questions found matching "',u,'"']})]})}var kk={mount(t,e){let{runtime:a,instanceId:n="faq-widget",...r}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(a&&typeof Cv.createRoot=="function"){let i=(0,Cv.createRoot)(t);return i.render(Re.default.createElement(vO,{config:r,runtime:a,instanceId:n})),()=>{i.unmount()}}let o=r.actions||[];return t.innerHTML=`
|
|
160
|
-
<div style="font-family: system-ui; max-width: 800px;">
|
|
161
|
-
${o.map(i=>`
|
|
162
|
-
<div style="margin-bottom: 8px; padding: 16px; background: ${I[12]}; border-radius: 8px;">
|
|
163
|
-
<strong>${i.config.question}</strong>
|
|
164
|
-
<p style="margin-top: 8px; color: ${I[6]};">${Lk(i.config.answer)}</p>
|
|
165
|
-
</div>
|
|
166
|
-
`).join("")}
|
|
167
|
-
</div>
|
|
168
|
-
`,()=>{t.innerHTML=""}}};var Ik={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:lk,widgets:[{id:"adaptive-faq:accordion",component:kk,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 yO=async(t,e)=>{let{badgeId:a}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:a,awardedAt:Date.now()}),{cleanup:()=>{}}},xO=async(t,e)=>{let{points:a,reason:n}=t;return e.publishEvent("gamification.points_added",{points:a,reason:n,timestamp:Date.now()}),{cleanup:()=>{}}},bO={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},SO=[{kind:"gamification:awardBadge",executor:yO},{kind:"gamification:addPoints",executor:xO}],CO=[bO],Ak={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:SO,eventHandlers:CO};var Lt=K(Oe(),1);var ut=K(Xe(),1),_v=K(Uo(),1);function _f(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Qa={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"}},wf={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 _O({item:t,isExpanded:e,isLast:a,onToggle:n,onNavigate:r,theme:o}){let[i,s]=(0,ut.useState)(!1),l=wf[o],{title:u,description:c,href:d,icon:f,external:m}=t.config,S={...Qa.item,...l.item,...e?l.itemExpanded:{},...a?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},b={...Qa.header,...l.header,...i?l.headerHover:{}},x={...Qa.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},p={...Qa.body,...l.body,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},g=v=>{v.preventDefault(),v.stopPropagation(),d&&r(d,m??!1)};return(0,Lt.jsxs)("div",{style:S,"data-nav-tip-id":t.config.id,children:[(0,Lt.jsxs)("button",{type:"button",style:b,onClick:n,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),"aria-expanded":e,children:[f&&(0,Lt.jsx)("span",{style:Qa.icon,children:f}),(0,Lt.jsx)("span",{children:u}),(0,Lt.jsx)("span",{style:x,children:"\u203A"})]}),(0,Lt.jsxs)("div",{style:p,"aria-hidden":!e,children:[(0,Lt.jsx)("p",{style:Qa.description,children:c}),d&&(0,Lt.jsxs)("a",{href:d,onClick:g,style:{...Qa.linkButton,...l.linkButton},target:m?"_blank":void 0,rel:m?"noopener noreferrer":void 0,children:["Go ",m?"\u2197":"\u2192"]})]})]})}function wO({config:t,runtime:e,instanceId:a}){let[n,r]=(0,ut.useReducer)(p=>p+1,0),[o,i]=(0,ut.useState)(new Set);(0,ut.useEffect)(()=>e.context.subscribe(()=>{r()}),[e.context]),(0,ut.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{r()})},[e.accumulator]);let s=(0,ut.useMemo)(()=>t.actions.filter(p=>{if(!p.triggerWhen)return!0;try{return e.evaluateSync(p.triggerWhen).value}catch{return!1}}),[t.actions,e,n]),l=(0,ut.useMemo)(()=>{let p=new Map;for(let g of s){let v=g.config.category;p.has(v)||p.set(v,[]),p.get(v).push(g)}return p},[s]),u=(0,ut.useMemo)(()=>s.some(p=>p.config.category),[s]),c=(0,ut.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),d=(0,ut.useCallback)(p=>{i(g=>{let v=g.has(p),y;if(t.expandBehavior==="single"){for(let _ of g)_!==p&&e.events.publish("nav:toggled",{instanceId:a,tipId:_,expanded:!1,timestamp:Date.now()});y=v?new Set:new Set([p])}else y=new Set(g),v?y.delete(p):y.add(p);return e.events.publish("nav:toggled",{instanceId:a,tipId:p,expanded:!v,timestamp:Date.now()}),y})},[t.expandBehavior,e.events,a]),f=(0,ut.useCallback)((p,g)=>{let v=p.trim().toLowerCase();if(!(v.startsWith("javascript:")||v.startsWith("data:")))if(e.events.publish("nav:tip_clicked",{instanceId:a,href:p,external:g,timestamp:Date.now()}),g)window.open(p,"_blank","noopener,noreferrer");else{let y=new URL(p,window.location.origin);y.search=window.location.search,window.location.href=y.toString()}},[e.events,a]),m={...Qa.container,...wf[c].container},S={...Qa.categoryHeader,...wf[c].categoryHeader},b={...Qa.emptyState,...wf[c].emptyState},x=p=>p.map((g,v)=>(0,Lt.jsx)(_O,{item:g,isExpanded:o.has(g.config.id),isLast:v===p.length-1,onToggle:()=>d(g.config.id),onNavigate:f,theme:c},g.config.id));return s.length===0?(0,Lt.jsx)("div",{style:m,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,Lt.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,Lt.jsx)("div",{style:m,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,Lt.jsx)("div",{style:Qa.accordion,children:u?Array.from(l.entries()).map(([p,g])=>(0,Lt.jsxs)(ut.default.Fragment,{children:[p&&(0,Lt.jsx)("div",{style:S,"data-category-header":p,children:p}),x(g)]},p??"__ungrouped")):x(s)})})}var Ek={mount(t,e){let{runtime:a,instanceId:n="nav-widget",...r}=e||{expandBehavior:"single",theme:"auto",actions:[]};if(a&&typeof _v.createRoot=="function"){let i=(0,_v.createRoot)(t);return i.render(ut.default.createElement(wO,{config:r,runtime:a,instanceId:n})),()=>{i.unmount()}}let o=r.actions||[];return t.innerHTML=`
|
|
169
|
-
<div style="font-family: system-ui; max-width: 100%;">
|
|
170
|
-
${o.map(i=>`
|
|
171
|
-
<div style="margin-bottom: 4px; padding: 12px 16px; background: ${I[12]}; border-radius: 8px;">
|
|
172
|
-
${i.config.icon?`<span>${_f(i.config.icon)}</span> `:""}<strong>${_f(i.config.title)}</strong>
|
|
173
|
-
<p style="margin-top: 8px; color: ${I[6]}; font-size: 13px;">${_f(i.config.description)}</p>
|
|
174
|
-
${i.config.href?`<a href="${_f(i.config.href)}" style="color: ${Nt[2]}; font-size: 13px;">Go →</a>`:""}
|
|
175
|
-
</div>
|
|
176
|
-
`).join("")}
|
|
177
|
-
</div>
|
|
178
|
-
`,()=>{t.innerHTML=""}}};var LO=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 kO(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}var IO=async(t,e)=>{let a=t.url.trim();if(a.toLowerCase().startsWith("javascript:"))throw new Error("javascript: URLs are not allowed");let n=t.target??"_self";return e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:navigate",url:t.url,target:n}),n==="_blank"?window.open(a,"_blank","noopener,noreferrer"):!t.forceFullNavigation&&kO(a)?(window.history.pushState(null,"",a),window.dispatchEvent(new PopStateEvent("popstate"))):window.location.href=a,{cleanup:()=>{}}},AO=[{kind:"navigation:scrollTo",executor:LO},{kind:"navigation:navigate",executor:IO}],Tk={id:"adaptive-nav",version:"2.0.0",name:"Navigation Tips",description:"Navigation actions and accordion-based tips with per-item conditional visibility",executors:AO,widgets:[{id:"adaptive-nav:tips",component:Ek,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 EO=[ik,$g,Ik,Ak,Tk,tv],TO=EO.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 Rk(t){let e=0;for(let a of TO)t.has(a.id)||(t.register(a),e++);console.log("[Syntro Runtime] Registered",e,"built-in runtime modules")}var Mk={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important",hostLoadingSelector:"",waitForHostReady:""};function Dk(t={}){let{timeout:e,className:a,style:n,hostLoadingSelector:r,waitForHostReady:o}={...Mk,...t};if(r&&document.querySelector(r))return()=>{};let i=document.createElement("style");i.textContent=`.${a} { ${n} }`,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 RO(t={}){let{className:e,style:a}={...Mk,...t};return`
|
|
161
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Sr(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:a}){let r=this.parser.parseInline(a),n=f1(t);if(n===null)return r;t=n;let o='<a href="'+t+'"';return e&&(o+=' title="'+Sr(e)+'"'),o+=">"+r+"</a>",o}image({href:t,title:e,text:a,tokens:r}){r&&(a=this.parser.parseInline(r,this.parser.textRenderer));let n=f1(t);if(n===null)return Sr(a);t=n;let o=`<img src="${t}" alt="${Sr(a)}"`;return e&&(o+=` title="${Sr(e)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Sr(t.text)}},Kv=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},or=class zv{constructor(e){D(this,"options");D(this,"renderer");D(this,"textRenderer");this.options=e||ai,this.options.renderer=this.options.renderer||new jf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Kv}static parse(e,a){return new zv(a).parse(e)}static parseInline(e,a){return new zv(a).parseInline(e)}parse(e){let a="";for(let r=0;r<e.length;r++){let n=e[r];if(this.options.extensions?.renderers?.[n.type]){let i=n,s=this.options.extensions.renderers[i.type].call({parser:this},i);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){a+=s||"";continue}}let o=n;switch(o.type){case"space":{a+=this.renderer.space(o);break}case"hr":{a+=this.renderer.hr(o);break}case"heading":{a+=this.renderer.heading(o);break}case"code":{a+=this.renderer.code(o);break}case"table":{a+=this.renderer.table(o);break}case"blockquote":{a+=this.renderer.blockquote(o);break}case"list":{a+=this.renderer.list(o);break}case"checkbox":{a+=this.renderer.checkbox(o);break}case"html":{a+=this.renderer.html(o);break}case"def":{a+=this.renderer.def(o);break}case"paragraph":{a+=this.renderer.paragraph(o);break}case"text":{a+=this.renderer.text(o);break}default:{let i='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return a}parseInline(e,a=this.renderer){let r="";for(let n=0;n<e.length;n++){let o=e[n];if(this.options.extensions?.renderers?.[o.type]){let s=this.options.extensions.renderers[o.type].call({parser:this},o);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){r+=s||"";continue}}let i=o;switch(i.type){case"escape":{r+=a.text(i);break}case"html":{r+=a.html(i);break}case"link":{r+=a.link(i);break}case"image":{r+=a.image(i);break}case"checkbox":{r+=a.checkbox(i);break}case"strong":{r+=a.strong(i);break}case"em":{r+=a.em(i);break}case"codespan":{r+=a.codespan(i);break}case"br":{r+=a.br(i);break}case"del":{r+=a.del(i);break}case"text":{r+=a.text(i);break}default:{let s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return r}},qf,xu=(qf=class{constructor(t){D(this,"options");D(this,"block");this.options=t||ai}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?nr.lex:nr.lexInline}provideParser(){return this.block?or.parse:or.parseInline}},D(qf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),D(qf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),qf),Yv=class{constructor(...t){D(this,"defaults",qv());D(this,"options",this.setOptions);D(this,"parse",this.parseMarkdown(!0));D(this,"parseInline",this.parseMarkdown(!1));D(this,"Parser",or);D(this,"Renderer",jf);D(this,"TextRenderer",Kv);D(this,"Lexer",nr);D(this,"Tokenizer",$f);D(this,"Hooks",xu);this.use(...t)}walkTokens(t,e){let a=[];for(let r of t)switch(a=a.concat(e.call(this,r)),r.type){case"table":{let n=r;for(let o of n.header)a=a.concat(this.walkTokens(o.tokens,e));for(let o of n.rows)for(let i of o)a=a.concat(this.walkTokens(i.tokens,e));break}case"list":{let n=r;a=a.concat(this.walkTokens(n.items,e));break}default:{let n=r;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(o=>{let i=n[o].flat(1/0);a=a.concat(this.walkTokens(i,e))}):n.tokens&&(a=a.concat(this.walkTokens(n.tokens,e)))}}return a}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(a=>{let r={...a};if(r.async=this.defaults.async||r.async||!1,a.extensions&&(a.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let o=e.renderers[n.name];o?e.renderers[n.name]=function(...i){let s=n.renderer.apply(this,i);return s===!1&&(s=o.apply(this,i)),s}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=e[n.level];o?o.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),r.extensions=e),a.renderer){let n=this.defaults.renderer||new jf(this.defaults);for(let o in a.renderer){if(!(o in n))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let i=o,s=a.renderer[i],l=n[i];n[i]=(...u)=>{let c=s.apply(n,u);return c===!1&&(c=l.apply(n,u)),c||""}}r.renderer=n}if(a.tokenizer){let n=this.defaults.tokenizer||new $f(this.defaults);for(let o in a.tokenizer){if(!(o in n))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let i=o,s=a.tokenizer[i],l=n[i];n[i]=(...u)=>{let c=s.apply(n,u);return c===!1&&(c=l.apply(n,u)),c}}r.tokenizer=n}if(a.hooks){let n=this.defaults.hooks||new xu;for(let o in a.hooks){if(!(o in n))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let i=o,s=a.hooks[i],l=n[i];xu.passThroughHooks.has(o)?n[i]=u=>{if(this.defaults.async&&xu.passThroughHooksRespectAsync.has(o))return(async()=>{let d=await s.call(n,u);return l.call(n,d)})();let c=s.call(n,u);return l.call(n,c)}:n[i]=(...u)=>{if(this.defaults.async)return(async()=>{let d=await s.apply(n,u);return d===!1&&(d=await l.apply(n,u)),d})();let c=s.apply(n,u);return c===!1&&(c=l.apply(n,u)),c}}r.hooks=n}if(a.walkTokens){let n=this.defaults.walkTokens,o=a.walkTokens;r.walkTokens=function(i){let s=[];return s.push(o.call(this,i)),n&&(s=s.concat(n.call(this,i))),s}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return nr.lex(t,e??this.defaults)}parser(t,e){return or.parse(t,e??this.defaults)}parseMarkdown(t){return(e,a)=>{let r={...a},n={...this.defaults,...r},o=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&r.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let i=n.hooks?await n.hooks.preprocess(e):e,s=await(n.hooks?await n.hooks.provideLexer():t?nr.lex:nr.lexInline)(i,n),l=n.hooks?await n.hooks.processAllTokens(s):s;n.walkTokens&&await Promise.all(this.walkTokens(l,n.walkTokens));let u=await(n.hooks?await n.hooks.provideParser():t?or.parse:or.parseInline)(l,n);return n.hooks?await n.hooks.postprocess(u):u})().catch(o);try{n.hooks&&(e=n.hooks.preprocess(e));let i=(n.hooks?n.hooks.provideLexer():t?nr.lex:nr.lexInline)(e,n);n.hooks&&(i=n.hooks.processAllTokens(i)),n.walkTokens&&this.walkTokens(i,n.walkTokens);let s=(n.hooks?n.hooks.provideParser():t?or.parse:or.parseInline)(i,n);return n.hooks&&(s=n.hooks.postprocess(s)),s}catch(i){return o(i)}}}onError(t,e){return a=>{if(a.message+=`
|
|
162
|
+
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Sr(a.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(a);throw a}}},ti=new Yv;function Te(t,e){return ti.parse(t,e)}Te.options=Te.setOptions=function(t){return ti.setOptions(t),Te.defaults=ti.defaults,m1(Te.defaults),Te};Te.getDefaults=qv;Te.defaults=ai;Te.use=function(...t){return ti.use(...t),Te.defaults=ti.defaults,m1(Te.defaults),Te};Te.walkTokens=function(t,e){return ti.walkTokens(t,e)};Te.parseInline=ti.parseInline;Te.Parser=or;Te.parser=or.parse;Te.Renderer=jf;Te.TextRenderer=Kv;Te.Lexer=nr;Te.lexer=nr.lex;Te.Tokenizer=$f;Te.Hooks=xu;Te.parse=Te;var c5=Te.options,d5=Te.setOptions,f5=Te.use,p5=Te.walkTokens,h5=Te.parseInline;var m5=or.parse,g5=nr.lex;var Be=Y(tt(),1),Qv=Y(Go(),1);var Mt={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"}},ri={light:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${k[11]}`},item:{backgroundColor:"var(--sc-content-background)",borderTop:"var(--sc-content-border)",borderRight:"var(--sc-content-border)",borderBottom:"var(--sc-content-border)",borderLeft:"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:wt[8],color:wt[2]},categoryHeader:{color:k[7]},emptyState:{color:k[8]},feedbackPrompt:{color:k[7]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${k[5]}`},item:{backgroundColor:"var(--sc-content-background)",borderTop:"var(--sc-content-border)",borderRight:"var(--sc-content-border)",borderBottom:"var(--sc-content-border)",borderLeft:"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:wt[0],color:wt[6]},categoryHeader:{color:k[8]},emptyState:{color:k[7]},feedbackPrompt:{color:k[8]}}};var I1=new Yv({async:!1,gfm:!0,breaks:!0});function NB(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function FB(t){if(typeof t=="string"){let a=I1.parse(t);return(0,$e.jsx)("div",{style:{margin:0},"data-faq-markdown":"",dangerouslySetInnerHTML:{__html:a}})}if(t.type==="rich")return(0,$e.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}});let e=I1.parse(t.content);return(0,$e.jsx)("div",{style:{margin:0},"data-faq-markdown":"",dangerouslySetInnerHTML:{__html:e}})}function HB(t){return t?t===!0?{style:"thumbs"}:t:null}function UB(t){return t.prompt||"Was this helpful?"}function zB({item:t,isExpanded:e,isHighlighted:a,isLast:r,onToggle:n,theme:o,feedbackConfig:i,feedbackValue:s,onFeedback:l}){let[u,c]=(0,Be.useState)(!1),d=ri[o],{question:f,answer:h}=t.config,S={...Mt.item,...d.item,...e?d.itemExpanded:{},...a?{boxShadow:`0 0 0 2px ${wt[4]}, 0 0 12px rgba(106, 89, 206, 0.4)`,transition:"box-shadow 0.3s ease"}:{},...r?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},x={...Mt.question,...d.question,...u?d.questionHover:{}},b={...Mt.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},g={...Mt.answer,...d.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},m={...Mt.feedback,...d.feedbackPrompt};return(0,$e.jsxs)("div",{style:S,"data-faq-item-id":t.config.id,children:[(0,$e.jsxs)("button",{type:"button",style:x,onClick:n,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-expanded":e,children:[(0,$e.jsx)("span",{children:f}),(0,$e.jsx)("span",{style:b,children:"\u203A"})]}),(0,$e.jsxs)("div",{style:g,"aria-hidden":!e,children:[FB(h),e&&i&&(0,$e.jsxs)("div",{style:m,children:[(0,$e.jsx)("span",{children:UB(i)}),(0,$e.jsx)("button",{type:"button",style:{...Mt.feedbackButton,...s==="up"?Mt.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>l(t.config.id,f,"up"),children:"\u{1F44D}"}),(0,$e.jsx)("button",{type:"button",style:{...Mt.feedbackButton,...s==="down"?Mt.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>l(t.config.id,f,"down"),children:"\u{1F44E}"})]})]})]})}function qB({config:t,runtime:e,instanceId:a}){let[r,n]=(0,Be.useReducer)(T=>T+1,0),[o,i]=(0,Be.useState)(new Set),[s,l]=(0,Be.useState)(null),[u,c]=(0,Be.useState)(""),[d,f]=(0,Be.useState)(new Map),h=(0,Be.useMemo)(()=>HB(t.feedback),[t.feedback]);(0,Be.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,Be.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]),(0,Be.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let B=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(F=>{let H=F.props?.actionId;return typeof H=="string"&&H.startsWith("faq:open:")}).pop();if(B&&Date.now()-B.ts<1e4){let F=B.props.actionId.replace("faq:open:","");i(new Set([F])),requestAnimationFrame(()=>{let H=document.querySelector(`[data-faq-item-id="${F}"]`);H&&H.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},N=>{let B=N.props?.actionId;if(typeof B!="string"||!B.startsWith("faq:open:"))return;let F=B.replace("faq:open:","");i(new Set([F])),requestAnimationFrame(()=>{let H=document.querySelector(`[data-faq-item-id="${F}"]`);H&&H.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]),(0,Be.useEffect)(()=>{if(!e.events.subscribe)return;let T=B=>{let F=B.props?.tileId,H=B.props?.itemId;F===a&&H&&(i(new Set([H])),l(H),setTimeout(()=>l(null),1500),requestAnimationFrame(()=>{let R=document.querySelector(`[data-faq-item-id="${H}"]`);R&&R.scrollIntoView({behavior:"smooth",block:"center"})}))};if(e.events.getRecent){let F=e.events.getRecent({names:["notification.deep_link"]},5).filter(H=>H.props?.tileId===a&&H.props?.itemId).pop();F&&Date.now()-F.ts<1e4&&T(F)}return e.events.subscribe({names:["notification.deep_link"]},T)},[e,a]);let S=(0,Be.useMemo)(()=>(t.actions??[]).filter(T=>T.triggerWhen?e.evaluateSync(T.triggerWhen).value:!0),[t.actions,e,r]),x=(0,Be.useMemo)(()=>t.ordering==="priority"?[...S].sort((T,N)=>(N.config.priority??0)-(T.config.priority??0)):S,[S,t.ordering]),b=(0,Be.useMemo)(()=>{if(!t.searchable||!u.trim())return x;let T=u.toLowerCase();return x.filter(N=>N.config.question.toLowerCase().includes(T)||NB(N.config.answer).toLowerCase().includes(T)||N.config.category?.toLowerCase().includes(T))},[x,u,t.searchable]),g=(0,Be.useMemo)(()=>{let T=new Map;for(let N of b){let B=N.config.category;T.has(B)||T.set(B,[]),T.get(B).push(N)}return T},[b]),m=(0,Be.useMemo)(()=>b.some(T=>T.config.category),[b]),y=(0,Be.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),v=(0,Be.useCallback)(T=>{i(N=>{let B=new Set(N);return t.expandBehavior==="single"?N.has(T)?new Set:new Set([T]):(N.has(T)?B.delete(T):B.add(T),B)}),e.events.publish("faq:toggled",{instanceId:a,questionId:T,expanded:!o.has(T),timestamp:Date.now()})},[t.expandBehavior,e.events,a,o]),C=(0,Be.useCallback)((T,N,B)=>{f(F=>{let H=new Map(F);return H.set(T,B),H}),e.events.publish("faq:feedback",{itemId:T,question:N,value:B})},[e.events]),w={...Mt.container,...ri[y].container},_={...Mt.searchInput,...ri[y].searchInput},L={...Mt.emptyState,...ri[y].emptyState},I={...Mt.categoryHeader,...ri[y].categoryHeader},A=T=>T.map((N,B)=>(0,$e.jsx)(zB,{item:N,isExpanded:o.has(N.config.id),isHighlighted:s===N.config.id,isLast:B===T.length-1,onToggle:()=>v(N.config.id),theme:y,feedbackConfig:h,feedbackValue:d.get(N.config.id),onFeedback:C},N.config.id));return S.length===0?(0,$e.jsx)("div",{style:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:(0,$e.jsx)("div",{style:L,children:"You're all set for now! We'll surface answers here when they're relevant to what you're doing."})}):(0,$e.jsxs)("div",{style:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,$e.jsxs)("div",{style:Mt.searchWrapper,children:[(0,$e.jsx)("style",{children:`[data-adaptive-id="${a}"] input::placeholder { color: var(--sc-content-search-color, inherit); opacity: 0.7; }`}),(0,$e.jsx)("input",{type:"text",placeholder:"Search questions...",value:u,onChange:T=>c(T.target.value),style:_})]}),(0,$e.jsx)("div",{style:Mt.accordion,children:m?Array.from(g.entries()).map(([T,N])=>(0,$e.jsxs)(Be.default.Fragment,{children:[T&&(0,$e.jsx)("div",{style:I,"data-category-header":T,children:T}),A(N)]},T??"__ungrouped")):A(b)}),t.searchable&&b.length===0&&u&&(0,$e.jsxs)("div",{style:{...Mt.noResults,...ri[y].emptyState},children:['No questions found matching "',u,'"']})]})}var A1={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 o=(0,Qv.createRoot)(t);return o.render(Be.default.createElement(qB,{config:n,runtime:a,instanceId:r})),()=>{o.unmount()}}}};var E1={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:l1,widgets:[{id:"adaptive-faq:accordion",component:A1,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 VB=async(t,e)=>{let{badgeId:a}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:a,awardedAt:Date.now()}),{cleanup:()=>{}}},$B=async(t,e)=>{let{points:a,reason:r}=t;return e.publishEvent("gamification.points_added",{points:a,reason:r,timestamp:Date.now()}),{cleanup:()=>{}}},jB={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},GB=[{kind:"gamification:awardBadge",executor:VB},{kind:"gamification:addPoints",executor:$B}],WB=[jB],T1={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:GB,eventHandlers:WB};var Ot=Y(Ee(),1);var ht=Y(tt(),1),Jv=Y(Go(),1);var ZB={"\u{1F4B5}":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="12" x="2" y="6" rx="2"/><circle cx="12" cy="12" r="2"/><path d="M6 12h.01M18 12h.01"/></svg>',"\u{1F3DB}\uFE0F":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" x2="21" y1="22" y2="22"/><line x1="6" x2="6" y1="18" y2="11"/><line x1="10" x2="10" y1="18" y2="11"/><line x1="14" x2="14" y1="18" y2="11"/><line x1="18" x2="18" y1="18" y2="11"/><polygon points="12 2 20 7 4 7"/></svg>',"\u23ED\uFE0F":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 4 15 12 5 20 5 4"/><line x1="19" x2="19" y1="5" y2="19"/></svg>',"\u27A1\uFE0F":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>',"\u{1F4A1}":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/></svg>',"\u{1F4B0}":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="12" x="2" y="6" rx="2"/><circle cx="12" cy="12" r="2"/><path d="M6 12h.01M18 12h.01"/></svg>',"\u{1F4CB}":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><path d="M12 11h4"/><path d="M12 16h4"/><path d="M8 11h.01"/><path d="M8 16h.01"/></svg>',"\u2705":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/></svg>',"\u26A0\uFE0F":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>'};function XB(t){return ZB[t]??KB(t)}function KB(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var ir={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"}},Zf={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, ${wt[4]})`,color:"#ffffff"},categoryHeader:{color:k[7]},emptyState:{color:k[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, ${wt[4]})`,color:"#ffffff"},categoryHeader:{color:k[8]},emptyState:{color:k[7]}}};function R1(t){if(typeof window>"u")return!1;let e=window.location.pathname;return t.some(a=>{let r=a.split("?")[0].split("#")[0];return r.endsWith("/**")?e.startsWith(r.slice(0,-3)):e===r})}function YB(t){let e=[{boxShadow:"0 0 0 0 rgba(13, 148, 136, 0.5)"},{boxShadow:"0 0 0 8px rgba(13, 148, 136, 0)"}];t.animate(e,{duration:600,iterations:3,easing:"ease-out"})}function QB({item:t,isExpanded:e,isLast:a,onToggle:r,onNavigate:n,onFocusAnchor:o,theme:i}){let[s,l]=(0,ht.useState)(!1),u=Zf[i],{title:c,description:d,href:f,icon:h,external:S,anchor:x}=t.config,b={...ir.item,...u.item,...e?u.itemExpanded:{},...a?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},g={...ir.header,...u.header,...s?u.headerHover:{}},m={...ir.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},y={...ir.body,...u.body,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},v=x?Array.isArray(x.route)?x.route[0]:x.route:f,C=x?R1(Array.isArray(x.route)?x.route:[x.route]):v?R1([v]):!1,w=x?.selector&&x.selector!=="*",_=C&&w,L=!!v||_,I=T=>{T.preventDefault(),T.stopPropagation(),_&&x?o(x):v&&n(v,S??!1)},A=_?"Focus \u2192":S?"Go \u2197":"Go \u2192";return(0,Ot.jsxs)("div",{style:b,"data-nav-tip-id":t.config.id,children:[(0,Ot.jsxs)("button",{type:"button",style:g,onClick:r,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),"aria-expanded":e,children:[h&&(0,Ot.jsx)("span",{style:ir.icon,dangerouslySetInnerHTML:{__html:XB(h)}}),(0,Ot.jsx)("span",{children:c}),(0,Ot.jsx)("span",{style:m,children:"\u203A"})]}),(0,Ot.jsxs)("div",{style:y,"aria-hidden":!e,children:[(0,Ot.jsx)("p",{style:ir.description,children:d}),L&&(0,Ot.jsx)("a",{href:v||"#",onClick:I,style:{...ir.linkButton,...u.linkButton},target:S?"_blank":void 0,rel:S?"noopener noreferrer":void 0,children:A})]})]})}function JB({config:t,runtime:e,instanceId:a}){let[r,n]=(0,ht.useReducer)(m=>m+1,0),[o,i]=(0,ht.useState)(new Set);(0,ht.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,ht.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]);let s=(0,ht.useMemo)(()=>t.actions.filter(m=>{if(!m.triggerWhen)return!0;try{return e.evaluateSync(m.triggerWhen).value}catch{return!1}}),[t.actions,e,r]),l=(0,ht.useMemo)(()=>{let m=new Map;for(let y of s){let v=y.config.category;m.has(v)||m.set(v,[]),m.get(v).push(y)}return m},[s]),u=(0,ht.useMemo)(()=>s.some(m=>m.config.category),[s]),c=(0,ht.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),d=(0,ht.useCallback)(m=>{i(y=>{let v=y.has(m),C;if(t.expandBehavior==="single"){for(let w of y)w!==m&&e.events.publish("nav:toggled",{instanceId:a,tipId:w,expanded:!1,timestamp:Date.now()});C=v?new Set:new Set([m])}else C=new Set(y),v?C.delete(m):C.add(m);return e.events.publish("nav:toggled",{instanceId:a,tipId:m,expanded:!v,timestamp:Date.now()}),C})},[t.expandBehavior,e.events,a]),f=(0,ht.useCallback)((m,y)=>{let v=m.trim().toLowerCase();if(!(v.startsWith("javascript:")||v.startsWith("data:")))if(e.events.publish("nav:tip_clicked",{instanceId:a,href:m,external:y,timestamp:Date.now()}),y)window.open(m,"_blank","noopener,noreferrer");else{let C=new URL(m,window.location.origin);C.search=window.location.search,ey(C.toString())||(window.history.pushState(null,"",C.toString()),window.dispatchEvent(new PopStateEvent("popstate")))}},[e.events,a]),h=(0,ht.useCallback)(m=>{let y=document.querySelector(m.selector);y instanceof HTMLElement&&(e.events.publish("nav:tip_focused",{instanceId:a,selector:m.selector,route:m.route,timestamp:Date.now()}),y.scrollIntoView({behavior:"smooth",block:"center"}),YB(y),setTimeout(()=>y.focus(),400))},[e.events,a]),S={...ir.container,...Zf[c].container},x={...ir.categoryHeader,...Zf[c].categoryHeader},b={...ir.emptyState,...Zf[c].emptyState},g=m=>m.map((y,v)=>(0,Ot.jsx)(QB,{item:y,isExpanded:o.has(y.config.id),isLast:v===m.length-1,onToggle:()=>d(y.config.id),onNavigate:f,onFocusAnchor:h,theme:c},y.config.id));return s.length===0?(0,Ot.jsx)("div",{style:S,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,Ot.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,Ot.jsx)("div",{style:S,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,Ot.jsx)("div",{style:ir.accordion,children:u?Array.from(l.entries()).map(([m,y])=>(0,Ot.jsxs)(ht.default.Fragment,{children:[m&&(0,Ot.jsx)("div",{style:x,"data-category-header":m,children:m}),g(y)]},m??"__ungrouped")):g(s)})})}var M1={mount(t,e){let{runtime:a,instanceId:r="nav-widget",...n}=e||{expandBehavior:"single",theme:"auto",actions:[]};if(a&&typeof Jv.createRoot=="function"){let o=(0,Jv.createRoot)(t);return o.render(ht.default.createElement(JB,{config:n,runtime:a,instanceId:r})),()=>{o.unmount()}}}};var eP=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 ey(t){if(typeof window>"u")return!1;let e=window;try{let a=e.next?.router;if(a?.push)return a.push(t),!0}catch{}try{if(e.$nuxt?.$router?.push)return e.$nuxt.$router.push(t),!0}catch{}return e.ng||e.getAllAngularRootElements||document.querySelector("[ng-version]")||e.__SVELTEKIT_DATA__||document.body?.hasAttribute("data-sveltekit")||document.querySelector("[data-astro-transition-fallback]")?(window.location.href=t,!0):!1}function tP(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}var aP=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&&tP(a)?ey(a)||(window.history.pushState(null,"",a),window.dispatchEvent(new PopStateEvent("popstate"))):window.location.href=a,{cleanup:()=>{}}},rP=[{kind:"navigation:scrollTo",executor:eP},{kind:"navigation:navigate",executor:aP}],O1={id:"adaptive-nav",version:"2.0.0",name:"Navigation Tips",description:"Navigation actions and accordion-based tips with per-item conditional visibility",executors:rP,widgets:[{id:"adaptive-nav:tips",component:M1,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 nP=[i1,bv,E1,T1,O1,Mv],oP=nP.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 D1(t){let e=0;for(let a of oP)t.has(a.id)||(t.register(a),e++);console.log("[Syntro Runtime] Registered",e,"built-in runtime modules")}var B1={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important",hostLoadingSelector:"",waitForHostReady:""};function P1(t={}){let{timeout:e,className:a,style:r,hostLoadingSelector:n,waitForHostReady:o}={...B1,...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 iP(t={}){let{className:e,style:a}={...B1,...t};return`
|
|
179
163
|
(function() {
|
|
180
164
|
var s = document.createElement('style');
|
|
181
165
|
s.textContent = '.${e} { ${a} }';
|
|
182
166
|
document.head.appendChild(s);
|
|
183
167
|
document.documentElement.className += ' ${e}';
|
|
184
|
-
})();`}function
|
|
168
|
+
})();`}function Xf(t,e,a="merge"){return a==="first-match"?sP(t,e):lP(t,e)}function sP(t,e){for(let a of e){let r=t.getFeatureValue?.(a,null);if(!r||typeof r!="object")continue;let n=r,o=n.tiles&&n.tiles.length>0,i=n.actions&&n.actions.length>0;if(o||i)return N1([n])}return null}function lP(t,e){let a=[];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;(i||s)&&a.push(o)}return a.length===0?null:N1(a)}function N1(t){let e=[],a=[],r,n,o,i,s,l,u;for(let c of t)c.tiles&&e.push(...c.tiles),c.actions&&a.push(...c.actions),r??(r=c.fetchedAt),n??(n=c.schemaVersion),o??(o=c.configVersion),i??(i=c.canvasTitle),s??(s=c.theme),l??(l=c.launcher),u??(u=c.meta);return{tiles:e,actions:a,fetchedAt:r??new Date().toISOString(),...n&&{schemaVersion:n},...o&&{configVersion:o},...i&&{canvasTitle:i},...s&&{theme:s},...l&&{launcher:l},...u&&{meta:u}}}var ty=!1;function F1(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function ay(t){if(F1()){ty=!0;return}ty=t??!1}function uP(){return F1()?!0:ty}function X(t,e,a){uP()&&(a!==void 0?console.log(`[${t}]`,e,a):console.log(`[${t}]`,e))}function oa(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 ry="2.8.0-canary.90";var eo="2.0";var cP=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function dP(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):cP.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 fP(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var H1="syntro_config_cache",pP=1440*60*1e3;function U1(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function hP(t,e){if(U1())try{let a={config:t,timestamp:Date.now(),sdkVersion:e};localStorage.setItem(H1,JSON.stringify(a))}catch{}}function mP(t){if(!U1())return null;try{let e=localStorage.getItem(H1);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>pP?null:a.config}catch{return null}}var ny=({configUri:t,experiments:e,featureKey:a})=>{if(t)return t;if(e&&a){let r=e.getFeatureValue?.(a,null);if(r)return r}};function gP(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(t.getAllFeatures){let r=t.getAllFeatures();return a?Object.keys(r).filter(n=>n.startsWith(a)):Object.keys(r)}return[]}var Cs=({configUri:t,experiments:e,featureKey:a,credentials:r,configFeatureKey:n,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||e.getAllFeatures)){let c=gP(e,o,i);if(c.length>0){let d=Xf(e,c);if(d)return X("SmartCanvas Config","Resolved config from variant flags",d),d}}let l=ny({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(!dP(l))throw new Error(`SmartCanvas: config URI not allowed: ${l}`);let u=r??(fP(l)?"include":"omit");try{let c=await fetch(l,{credentials:u,headers:{"X-SDK-Version":ry,"X-SDK-Schema-Version":eo}});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&&hP(d,s),d}catch(c){if(s){let d=mP(s);if(d)return X("SmartCanvas Config","Serving config from offline cache"),d}throw c}};var vP=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function z1(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 oa("Syntro Runtime",`Failed to decode ${t}:`,r),null}}var ws,Ls;function _u(){if(ws==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.token)ws={token:t.token,api_base:t.apiBase||""},console.log(`[DIAG] getEditorSource: from __SYNTRO_EDITOR_PARAMS__ (token=${ws.token.slice(0,15)}...)`);else{let e=z1("editor_source");e&&(ws=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 ws??null}function Yf(){if(Ls==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.mode)Ls={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=${Ls.mode})`);else{let e=z1("editor_conf");e&&(Ls=e),console.log(`[DIAG] getEditorConf: from URL param \u2192 ${e?`mode=${e.mode}`:"NULL"}`)}}return Ls??null}function yP(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?(oa("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1):vP.some(n=>n.startsWith(".")?e.hostname.endsWith(n)||e.hostname===n.slice(1):e.hostname===n)?(X("Syntro Runtime","\u2713 Editor URL validated"),!0):(oa("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return oa("Syntro Runtime",`\u274C Invalid editor URL: ${t}`,e),!1}}var Qf=()=>{let t=Yf();return!_u()?.token||!t?.mode?null:t.mode};function xP(){return _u()?.token??null}function bP(){return _u()?.api_base??null}var Su=null,q1=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(Su)return X("Syntro Runtime","Editor SDK load already in progress, waiting..."),Su;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=bP(),n=(a?`${a}/api/editor/sdk/editor-sdk.js`:null)||e.editorUrl;if(!n){oa("Syntro Runtime","\u274C No editor SDK URL available (no api_base, no editorUrl option)"),X("Syntro Runtime","================================");return}let o=xP();if(!o){oa("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)}...`}),!yP(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..."),Su=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","================================"),Su=null,l(c)},document.head.appendChild(u),X("Syntro Runtime","Script tag appended to <head>")}),Su};var SP=new Set(["tag_name","$el_text"]);function _P(t){return SP.has(t)||t.startsWith("attr__")}function V1(t,e){return t.equals!==void 0?e===t.equals:t.contains!==void 0?typeof e=="string"&&e.includes(t.contains):!1}function CP(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(_P(n)){let i=r.props?.elements;if(!i||!i.some(l=>V1(o,l[n])))return!1}else if(!V1(o,r.props?.[n]))return!1}return!0}}function $1(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?CP(n):()=>!0,i=typeof r.withinMs=="number";e.register(r.key,o,i)}}function Jf(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"&&$1(i.triggerWhen,e)}if(a)for(let r of a){let n=r;n.triggerWhen?.type==="rules"&&$1(n.triggerWhen,e)}}var _r=null;function G1(t){_r&&_r!==t?t.appendChild(_r):_r=t;let e=t.getRootNode();e instanceof ShadowRoot&&wP(e)}function W1(){return _r||(_r=document.createElement("div"),_r.id="syntro-overlays",Object.assign(_r.style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),document.body.appendChild(_r)),_r}var j1=!1;function wP(t){if(j1)return;let e=`
|
|
185
169
|
:host {
|
|
186
170
|
--syntro-surface: var(--sc-overlay-background, #0f1318);
|
|
187
171
|
--syntro-fg: var(--sc-overlay-text-color, #cbd0d7);
|
|
@@ -443,7 +427,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error
|
|
|
443
427
|
.syntro-modal-btn-primary:hover {
|
|
444
428
|
background: var(--syntro-accent-hover, #d44844);
|
|
445
429
|
}
|
|
446
|
-
`,a=document.createElement("style");a.setAttribute("data-syntro","base-overlay"),a.textContent=e,t.appendChild(a),zk=!0}var f1=K(Uo(),1);var Av=class{constructor(e){B(this,"state");B(this,"listeners",new Set);let a=e?.open??!1;if(e?.open===void 0)try{let n=sessionStorage?.getItem("syntro:editor:panel-open");n!==null&&(a=JSON.parse(n))}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)}},Vk=t=>new Av(t);var Tf=K(Xe(),1),Zk=K(Oe(),1),jk=(0,Tf.createContext)(null);function Gk({shadowRoot:t,portalRoot:e,overlayContainer:a,children:n}){return(0,Zk.jsx)(jk.Provider,{value:{shadowRoot:t,portalRoot:e,overlayContainer:a},children:n})}function xs(){let t=(0,Tf.useContext)(jk);if(!t)throw new Error("useShadowRoot() called outside ShadowRootProvider");return t}var zt=K(Xe(),1);var ct=K(Xe(),1),Wv=K(Ys(),1);var _e={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"},bs="1.0.0";function Ja(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:bs}}function WO(t){return Ja(_e.CANVAS_OPENED,{surface:t})}function XO(t){return Ja(_e.CANVAS_CLOSED,{surface:t})}function YO(t,e){return Ja(_e.TILE_VIEWED,{tileId:t,surface:e})}function KO(t,e){return Ja(_e.TILE_EXPANDED,{tileId:t,surface:e})}function QO(t,e){return Ja(_e.TILE_COLLAPSED,{tileId:t,surface:e})}function JO(t,e,a){return Ja(_e.TILE_ACTION,{tileId:t,actionId:e,surface:a})}function eB(t,e){return Ja(_e.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function tB(t,e){return Ja(_e.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function aB(t,e,a){return Ja(_e.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:a})}function nB(t,e,a){return Ja(_e.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:a})}function rB(t,e){let a=t.startsWith("canvas.")?t:`canvas.${t}`;return Ja(a,e)}var pu={canvasOpened:WO,canvasClosed:XO,tileViewed:YO,tileExpanded:KO,tileCollapsed:QO,tileAction:JO,overlayStarted:eB,overlayCompleted:tB,overlayDismissed:aB,overlayStepViewed:nB,custom:rB};var Oa=K(Oe(),1),Wk="syntro-toast-styles",oB=`
|
|
430
|
+
`,a=document.createElement("style");a.setAttribute("data-syntro","base-overlay"),a.textContent=e,t.appendChild(a),j1=!0}var _I=Y(Go(),1);var oy=class{constructor(e){D(this,"state");D(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)}},Z1=t=>new oy(t);var ep=Y(tt(),1),Y1=Y(Ee(),1),X1=(0,ep.createContext)(null);function K1({shadowRoot:t,portalRoot:e,overlayContainer:a,children:r}){return(0,Y1.jsx)(X1.Provider,{value:{shadowRoot:t,portalRoot:e,overlayContainer:a},children:r})}function ks(){let t=(0,ep.useContext)(X1);if(!t)throw new Error("useShadowRoot() called outside ShadowRootProvider");return t}var Ut=Y(tt(),1);var lt=Y(tt(),1),Iy=Y(il(),1);var st="1.0.0",je={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",UI_HESITATE:"ui.hesitate",UI_RAGE_CLICK:"ui.rage_click",UI_SCROLL_THRASH:"ui.scroll_thrash",UI_FOCUS_BOUNCE:"ui.focus_bounce",UI_IDLE:"ui.idle",UI_HOVER:"ui.hover"},Wt={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,Drag:12},Cu={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},iy={hesitationMs:3e3,hesitationRadiusPx:10,rageClickCount:3,rageClickWindowMs:1e3,rageClickRadiusPx:30,scrollThrashReversals:3,scrollThrashWindowMs:2e3,focusBounceMaxInputs:0,idleMs:5e3,hoverSampleMs:100};var tp=class{constructor(e,a){this.config=e,this.emit=a,this.focused=new Map}ingest(e){if(e.type!==3)return;let a=e.timestamp;if(e.data.source===Wt.MouseInteraction){let r=e.data.id??0;if(e.data.type===Cu.Focus)this.focused.set(r,{id:r,focusTs:a,inputCount:0});else if(e.data.type===Cu.Blur){let n=this.focused.get(r);n&&n.inputCount<=this.config.focusBounceMaxInputs&&this.emit({ts:a,name:je.UI_FOCUS_BOUNCE,source:"rrweb",schemaVersion:st,props:{elementId:r,duration_ms:a-n.focusTs}}),this.focused.delete(r)}}else if(e.data.source===Wt.Input){let r=e.data.id??0,n=this.focused.get(r);n&&n.inputCount++}}};var ap=class{constructor(e,a){this.config=e,this.emit=a,this.anchorX=0,this.anchorY=0,this.anchorTs=0,this.emitted=!1,this.hasPosition=!1}ingest(e){if(e.type!==3||e.data.source!==Wt.MouseMove)return;let a=e.data.positions;if(!a||a.length===0)return;let r=a[a.length-1],n=e.timestamp+(r.timeOffset??0);if(!this.hasPosition){this.anchorX=r.x,this.anchorY=r.y,this.anchorTs=n,this.hasPosition=!0,this.emitted=!1;return}let o=r.x-this.anchorX,i=r.y-this.anchorY;Math.sqrt(o*o+i*i)>this.config.hesitationRadiusPx&&(this.anchorX=r.x,this.anchorY=r.y,this.anchorTs=n,this.emitted=!1)}tick(e){if(!this.hasPosition||this.emitted)return;let a=e-this.anchorTs;a>=this.config.hesitationMs&&(this.emit({ts:e,name:je.UI_HESITATE,source:"rrweb",schemaVersion:st,props:{x:this.anchorX,y:this.anchorY,duration_ms:a}}),this.emitted=!0)}};var rp=class{constructor(e,a,r){this.config=e,this.emit=a,this.elementResolver=r,this.currentElement=null,this.hoverStartTs=null,this.lastX=0,this.lastY=0,this.lastSampleTs=-1/0}ingest(e){if(e.type!==3||e.data.source!==Wt.MouseMove)return;let a=e.data.positions;if(!a||a.length===0)return;let r=a[a.length-1];this.lastX=r.x,this.lastY=r.y}tick(e){if(!this.elementResolver||e-this.lastSampleTs<this.config.hoverSampleMs)return;this.lastSampleTs=e;let a=this.elementResolver(this.lastX,this.lastY),r=a?Q1(a):null,n=this.currentElement?Q1(this.currentElement):null;r!==n&&(this.currentElement&&this.hoverStartTs!==null&&this.emit({ts:e,name:je.UI_HOVER,source:"rrweb",schemaVersion:st,props:{x:this.lastX,y:this.lastY,duration_ms:e-this.hoverStartTs,element:this.currentElement}}),this.currentElement=a,this.hoverStartTs=e)}};function Q1(t){return`${t.tag_name??""}|${t.attr__id??""}|${(t.classes??[]).join(",")}`}var np=class{constructor(e,a){this.config=e,this.emit=a,this.lastActivityTs=null,this.emitted=!1}ingest(e){if(e.type!==3)return;let a=e.data.source;(a===Wt.MouseMove||a===Wt.MouseInteraction||a===Wt.Scroll)&&(this.lastActivityTs=e.timestamp,this.emitted=!1)}tick(e){this.lastActivityTs===null||this.emitted||e-this.lastActivityTs>=this.config.idleMs&&(this.emit({ts:e,name:je.UI_IDLE,source:"rrweb",schemaVersion:st,props:{idle_ms:e-this.lastActivityTs}}),this.emitted=!0)}};var op=class{constructor(e,a){this.config=e,this.emit=a,this.clicks=[]}ingest(e){if(e.type!==3||e.data.source!==Wt.MouseInteraction||e.data.type!==Cu.Click)return;let a=e.data.x??0,r=e.data.y??0,n=e.timestamp,o=n-this.config.rageClickWindowMs;this.clicks=this.clicks.filter(s=>s.ts>=o),this.clicks.push({ts:n,x:a,y:r});let i=this.clicks.filter(s=>{let l=s.x-a,u=s.y-r;return Math.sqrt(l*l+u*u)<=this.config.rageClickRadiusPx});i.length>=this.config.rageClickCount&&(this.emit({ts:n,name:je.UI_RAGE_CLICK,source:"rrweb",schemaVersion:st,props:{x:a,y:r,clickCount:i.length,duration_ms:n-i[0].ts}}),this.clicks=[])}};var ip=class{constructor(e,a){this.config=e,this.emit=a,this.lastY=null,this.lastDirection=null,this.reversals=[]}ingest(e){if(e.type!==3||e.data.source!==Wt.Scroll)return;let a=e.data.y??0,r=e.timestamp;if(this.lastY!==null){let n=a>this.lastY?"down":a<this.lastY?"up":this.lastDirection;if(n&&n!==this.lastDirection){let o=r-this.config.scrollThrashWindowMs;this.reversals=this.reversals.filter(i=>i>o),this.reversals.push(r),this.reversals.length>=this.config.scrollThrashReversals&&(this.emit({ts:r,name:je.UI_SCROLL_THRASH,source:"rrweb",schemaVersion:st,props:{reversals:this.reversals.length,duration_ms:r-this.reversals[0]}}),this.reversals=[])}this.lastDirection=n}this.lastY=a}};var J1={$click:je.UI_CLICK,$scroll:je.UI_SCROLL,$input:je.UI_INPUT,$change:je.UI_CHANGE,$submit:je.UI_SUBMIT,$pageview:je.NAV_PAGE_VIEW,$pageleave:je.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function LP(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(J1[e])return J1[e];if(e==="$autocapture"){let a=t.properties?.$tag_name,r=t.properties?.$event_type;return r==="submit"?je.UI_SUBMIT:r==="change"?je.UI_CHANGE:a==="input"||a==="textarea"?je.UI_INPUT:je.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}var eI=new Set(["a","button","input","select","textarea"]);function kP(t){if(t)return t.split(";").map(e=>{let a={},r=e.indexOf(":"),n=r>=0?e.slice(0,r):e,o=r>=0?e.slice(r+1):"",i=n.indexOf(".");i>=0?(a.tag_name=n.slice(0,i),a.attr__class=n.slice(i+1).replace(/\./g," ")):a.tag_name=n;let s=/([\w$]+)="([^"]*)"/g,l;for(;(l=s.exec(o))!==null;){let[,u,c]=l;u==="nth-child"||u==="nth-of-type"||(a[u]=c)}return a.text&&(a.$el_text=a.text,delete a.text),a})}function IP(t,e){if(e&&eI.has(e)||!t)return e;for(let a of t){let r=a.tag_name;if(r&&eI.has(r))return r}return e}function AP(t){let e={},a=t.properties||{},r=a.$elements??(typeof a.$elements_chain=="string"?kP(a.$elements_chain):void 0),n=a.$tag_name??r?.[0]?.tag_name,o=t.event==="$autocapture"||t.event==="$click";return e.tagName=o?IP(r,n):n,a.$el_text&&(e.elementText=a.$el_text),r&&(e.elements=r),o&&!r&&console.warn(`[PostHogNormalizer] $autocapture click has no element chain. PostHog may have changed wire format. Properties: $elements=${!!a.$elements}, $elements_chain=${typeof a.$elements_chain}`),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 wu(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:LP(t),source:"posthog",props:AP(t),schemaVersion:st}}function Lu(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 tI(t){return(e,a)=>{if(typeof e!="string")return;let r={event:e,properties:a,timestamp:Date.now()};if(Lu(r)){let n=wu(r);t(n)}}}function sy(t){let e={...iy,...t?.config},a=[];function r(d){for(let f of a)f(d)}let n=new ap(e,r),o=new op(e,r),i=new ip(e,r),s=new tp(e,r),l=new np(e,r),u=new rp(e,r,t?.elementResolver),c=[];return{ingest(d){if(d.kind==="posthog"){let{kind:f,...h}=d;Lu(h)&&r(wu(h))}else d.kind==="rrweb"&&(n.ingest(d),o.ingest(d),i.ingest(d),s.ingest(d),l.ingest(d),u.ingest(d))},onEvent(d){a.push(d)},tick(d){n.tick(d),l.tick(d),u.tick(d)},enrichClickAttributes(d,f){c.push({ts:d,elements:f});let h=d-500;for(;c.length>0&&c[0].ts<h;)c.shift()}}}var Dt={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"};function sr(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:st}}function EP(t){return sr(Dt.CANVAS_OPENED,{surface:t})}function TP(t){return sr(Dt.CANVAS_CLOSED,{surface:t})}function RP(t,e){return sr(Dt.TILE_VIEWED,{tileId:t,surface:e})}function MP(t,e){return sr(Dt.TILE_EXPANDED,{tileId:t,surface:e})}function OP(t,e){return sr(Dt.TILE_COLLAPSED,{tileId:t,surface:e})}function DP(t,e,a){return sr(Dt.TILE_ACTION,{tileId:t,actionId:e,surface:a})}function BP(t,e){return sr(Dt.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function PP(t,e){return sr(Dt.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function NP(t,e,a){return sr(Dt.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:a})}function FP(t,e,a){return sr(Dt.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:a})}function HP(t,e){let a=t.startsWith("canvas.")?t:`canvas.${t}`;return sr(a,e)}var ku={canvasOpened:EP,canvasClosed:TP,tileViewed:RP,tileExpanded:MP,tileCollapsed:OP,tileAction:DP,overlayStarted:BP,overlayCompleted:PP,overlayDismissed:NP,overlayStepViewed:FP,custom:HP};var lp=Y(tt());var sp=(...t)=>t.filter((e,a,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===a).join(" ").trim();var aI=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var rI=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,a,r)=>r?r.toUpperCase():a.toLowerCase());var ly=t=>{let e=rI(t);return e.charAt(0).toUpperCase()+e.slice(1)};var Iu=Y(tt());var nI={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 oI=t=>{for(let e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};var iI=(0,Iu.forwardRef)(({color:t="currentColor",size:e=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:n="",children:o,iconNode:i,...s},l)=>(0,Iu.createElement)("svg",{ref:l,...nI,width:e,height:e,stroke:t,strokeWidth:r?Number(a)*24/Number(e):a,className:sp("lucide",n),...!o&&!oI(s)&&{"aria-hidden":"true"},...s},[...i.map(([u,c])=>(0,Iu.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var ce=(t,e)=>{let a=(0,lp.forwardRef)(({className:r,...n},o)=>(0,lp.createElement)(iI,{ref:o,iconNode:e,className:sp(`lucide-${aI(ly(t))}`,`lucide-${t}`,r),...n}));return a.displayName=ly(t),a};var UP=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Au=ce("arrow-right",UP);var zP=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]],Is=ce("banknote",zP);var qP=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Eu=ce("bell",qP);var VP=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Tu=ce("book-open",VP);var $P=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],to=ce("circle-check-big",$P);var jP=[["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"}]],lr=ce("circle-question-mark",jP);var GP=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],Ru=ce("clipboard-list",GP);var WP=[["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"}]],Mu=ce("compass",WP);var ZP=[["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"}]],Ou=ce("file-text",ZP);var XP=[["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"}]],Du=ce("gamepad-2",XP);var KP=[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z",key:"1m329m"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]],Bu=ce("landmark",KP);var YP=[["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"}]],ao=ce("layers",YP);var QP=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Pu=ce("lightbulb",QP);var JP=[["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"}]],Nu=ce("message-circle",JP);var eN=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],Fu=ce("skip-forward",eN);var tN=[["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"}]],ro=ce("sparkles",tN);var aN=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Hu=ce("timer",aN);var rN=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],no=ce("triangle-alert",rN);var nN=[["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"}]],Uu=ce("trophy",nN);var uy=Y(Ee(),1),oN={"\u2753":lr,"\u{1F9ED}":Mu,"\u{1F4DD}":Ou,"\u{1F3AF}":ao,"\u{1F3C6}":Uu,"\u2728":ro,"\u{1F4AC}":Nu,"\u{1F3AE}":Du,"\u{1F4A1}":Pu,"\u{1F4B0}":Is,"\u{1F4CB}":Ru,"\u2705":to,"\u26A0\uFE0F":no,"\u{1F4B5}":Is,"\u{1F3DB}\uFE0F":Bu,"\u23ED\uFE0F":Fu,"\u27A1\uFE0F":Au,"\u23F1\uFE0F":Hu,"\u{1F4D6}":Tu,"\u{1F514}":Eu};function up({emoji:t,size:e=14,color:a="currentColor"}){let r=oN[t];return r?(0,uy.jsx)(r,{size:e,color:a}):(0,uy.jsx)("span",{children:t})}var wa=Y(Ee(),1),sI="syntro-toast-styles",iN=`
|
|
447
431
|
@keyframes syntro-toast-slide-in {
|
|
448
432
|
from { opacity: 0; transform: translateY(12px); }
|
|
449
433
|
to { opacity: 1; transform: translateY(0); }
|
|
@@ -461,21 +445,21 @@ Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error
|
|
|
461
445
|
.syntro-toast-progress.paused {
|
|
462
446
|
animation-play-state: paused;
|
|
463
447
|
}
|
|
464
|
-
`;function iB(t){if(t.querySelector(`#${Wk}`))return;let e=document.createElement("style");e.id=Wk,e.textContent=oB,t.appendChild(e)}function Ev({notifications:t,onDismiss:e,onClickNotification:a,position:n}){let{shadowRoot:r}=xs();return iB(r),t.length===0?null:(0,Oa.jsx)("div",{"data-testid":"notification-toast-stack",style:{position:"fixed",bottom:"6rem",[n==="right"?"right":"left"]:"2.5rem",display:"flex",flexDirection:"column",gap:"8px",zIndex:2147483648,pointerEvents:"auto",width:"280px"},children:t.map(o=>(0,Oa.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,Oa.jsxs)("div",{onClick:()=>a(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,Oa.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,Oa.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Oa.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,Oa.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,Oa.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,Oa.jsx)("div",{style:{height:"2px",background:"rgba(0, 0, 0, 0.08)"},children:(0,Oa.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var en=K(Xe(),1);var Tv=3,Rv=8e3,Mv=3e4;var sB=0;function Rf(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(a,n)=>!e||!(n in e)?a:String(e[n]))}function lB(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function Dv(t,e){for(let a of e){let n=a.notifications;if(!(!n||n.length===0))for(let r of n){if(!lB(t.name,r.on))continue;let o=Date.now(),i=r.ttl??8e3;return{notification:{id:`notif-${++sB}-${o}`,title:Rf(r.title,t.props),body:r.body?Rf(r.body,t.props):void 0,icon:r.icon,tileId:a.id,itemId:r.deepLink?.itemId?Rf(r.deepLink.itemId,t.props):void 0,expiresAt:o+i,createdAt:o,ttl:i},rule:r}}}return null}function Ov(t,e){let[a,n]=(0,en.useState)([]),r=(0,en.useRef)(new Map),o=(0,en.useRef)(new Map),i=(0,en.useCallback)(u=>{t?.publish(_e.NOTIFICATION_DISMISSED,{notificationId:u.id,tileId:u.tileId,itemId:u.itemId})},[t]),s=(0,en.useCallback)(u=>{let c=setTimeout(()=>{n(d=>d.filter(f=>f.id!==u.id)),o.current.delete(u.id),i(u)},u.ttl);o.current.set(u.id,c)},[i]),l=(0,en.useCallback)(u=>{n(d=>{let f=d.find(m=>m.id===u);return f&&i(f),d.filter(m=>m.id!==u)});let c=o.current.get(u);c&&(clearTimeout(c),o.current.delete(u))},[i]);return(0,en.useEffect)(()=>{if(!t)return;let u=t.subscribe(c=>{let d=Dv(c,e);if(!d)return;let{notification:f,rule:m}=d,S=f.itemId?`${f.tileId}:${c.name}:${f.itemId}`:`${f.tileId}:${c.name}`,b=r.current.get(S),x=Date.now(),p=m.cooldown??3e4;b!==void 0&&x-b<p||(r.current.set(S,x),n(g=>{if(f.itemId&&g.some(_=>_.tileId===f.tileId&&_.itemId===f.itemId))return g;let v=[...g,f];if(v.length>3){let y=v.shift(),_=o.current.get(y.id);_&&(clearTimeout(_),o.current.delete(y.id))}return v}),t.publish(_e.NOTIFICATION_SHOWN,{notificationId:f.id,tileId:f.tileId,itemId:f.itemId,title:f.title}),s(f))});return()=>{u();for(let c of o.current.values())clearTimeout(c);o.current.clear()}},[t,e,s]),{notifications:a,dismiss:l}}var Mf=K(Xe(),1);function uB(t,e){let a=[];for(let n of t){let r=n.widget.split(":")[0],i=e.get(r)?.manifest.runtime?.notifyWatchers;i&&a.push(...i(n.props??{}))}return a}function Bv(t,e,a){let n=(0,Mf.useRef)(new Map);(0,Mf.useEffect)(()=>{if(!t?.events||!a)return;let r=uB(e,a);if(r.length===0)return;let o=t.state.ns("notified");for(let s of r)if(!n.current.has(s.id)){let l=t.evaluateSync(s.strategy);n.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 r){let l=t.evaluateSync(s.strategy),u=n.current.get(s.id)??!1;n.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 Jt=K(Xe(),1),Xk=K(Oe(),1),Pv=(0,Jt.createContext)({runtime:null,context:null});function Fv({runtime:t,children:e}){let[a,n]=(0,Jt.useState)(t?t.context.get():null);(0,Jt.useEffect)(()=>t?(n(t.context.get()),t.context.subscribe(i=>{n(i)})):void 0,[t]);let r=(0,Jt.useMemo)(()=>({runtime:t,context:a}),[t,a]);return(0,Xk.jsx)(Pv.Provider,{value:r,children:e})}function Yn(){let{runtime:t}=(0,Jt.useContext)(Pv);return t}function Df(){let{context:t}=(0,Jt.useContext)(Pv);return t}function Nv(){return Df()?.page??null}function cB(){return Df()?.session??null}function dB(){return Df()?.viewport??null}function fB(t,e,a=[]){let n=Yn();(0,Jt.useEffect)(()=>n?t?n.events.subscribe(t,e):n.events.subscribe(e):void 0,[n,...a,e,t])}function pB(){return Yn()?.state??null}function hB(t,e){let a=Yn(),[n,r]=(0,Jt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Jt.useEffect)(()=>{if(!a||!t){r({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return a.evaluate(t).then(i=>{o||r({value:i.value,isFallback:i.isFallback,isLoading:!1})}),()=>{o=!0}},[a,t,e]),n}function ae(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var mB={colorPrimary:re[3],colorPrimaryHover:re[4],colorPrimaryMuted:re[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:ga.primary,colorTextSecondary:ga.secondary,colorTextMuted:ga.tertiary,colorTextInverse:I[1],colorBorder:Zg.primary,colorBorderSubtle:Zg.secondary,colorSuccess:Te[4],colorSuccessMuted:Te[0],colorWarning:wt[4],colorWarningMuted:wt[0],colorError:Ve[4],colorErrorMuted:Ve[0],colorInfo:ma[4],colorInfoMuted:ma[0],colorNotification:re[4],colorNotificationMuted:ae(re[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"},gB={colorPrimary:re[3],colorPrimaryHover:re[2],colorPrimaryMuted:ae(re[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:Te[4],colorSuccessMuted:ae(Te[4],.12),colorWarning:wt[4],colorWarningMuted:ae(wt[4],.12),colorError:Ve[4],colorErrorMuted:ae(Ve[4],.12),colorInfo:ma[4],colorInfoMuted:ae(ma[4],.12),colorNotification:re[3],colorNotificationMuted:ae(re[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 vB(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var Hv={mode:"dark",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:re[3],colorPrimaryHover:re[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:Qd.primary.backgroundDefault,backgroundHover:Qd.primary.backgroundHover,color:Qd.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:ga.primary,textColor:ga.secondary,iconBackground:`linear-gradient(135deg, ${re[3]} 0%, ${re[3]}cc 100%)`,iconShadow:`0 2px 8px ${re[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:ae(I[1],.6),textColor:ga.primary,titleColor:ga.primary,arrowColor:ae(I[1],.6),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${re[3]}`},notification:{background:ae(I[0],.95),textColor:ga.primary,textSecondaryColor:ga.secondary,border:`1px solid ${I[5]}`,borderRadius:"12px",successColor:Te[4],warningColor:wt[4],errorColor:Ve[4],iconBackground:ae(re[3],.15),progressGradient:`linear-gradient(90deg, ${re[3]}, ${re[4]})`},content:{background:ae(I[3],.8),backgroundHover:ae(I[5],.6),border:`1px solid ${ae(I[5],.5)}`,borderRadius:"8px",textColor:ga.primary,textSecondaryColor:ga.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:ga.primary,chevronColor:"currentColor"}},Uv={mode:"light",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:re[3],colorPrimaryHover:re[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:re[3],backgroundHover:re[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, ${re[3]} 0%, ${re[3]}cc 100%)`,iconShadow:`0 2px 8px ${re[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 ${re[3]}`},notification:{background:ae(I[12],.95),textColor:I[1],textSecondaryColor:I[6],border:`1px solid ${ae(I[0],.12)}`,borderRadius:"12px",successColor:Te[4],warningColor:wt[4],errorColor:Ve[4],iconBackground:ae(re[3],.1),progressGradient:`linear-gradient(90deg, ${re[3]}, ${re[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 zv(t){let e=t.mode==="light"?Uv:Hv;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 qv(t,e){let a=e.mode??t.mode??"dark",n=a==="light"?Uv:Hv;return{mode:a,fontFamily:e.fontFamily??t.fontFamily??n.fontFamily,colorPrimary:e.colorPrimary??t.colorPrimary??n.colorPrimary,colorPrimaryHover:e.colorPrimaryHover??t.colorPrimaryHover??n.colorPrimaryHover,borderRadius:e.borderRadius??t.borderRadius??n.borderRadius,canvas:{...n.canvas,...t.canvas,...e.canvas},launcher:{...n.launcher,...t.launcher,...e.launcher},tile:{...n.tile,...t.tile,...e.tile},overlay:{...n.overlay,...t.overlay,...e.overlay},notification:{...n.notification,...t.notification,...e.notification},content:{...n.content,...t.content,...e.content}}}var yB=["canvas","launcher","tile","overlay","notification","content"];function $v(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 yB){let n=t[a];if(n)for(let[r,o]of Object.entries(n))o!==void 0&&(e[`--sc-${a}-${vB(r)}`]=o)}return e}var Kn=K(Xe(),1);var Kk=K(Oe(),1),Yk=(0,Kn.createContext)(null);function Vv({children:t,themeConfig:e,workspaceTheme:a,shadowRoot:n}){let r=(0,Kn.useMemo)(()=>a?qv(a,e??{}):zv(e??{}),[e,a]),o=(0,Kn.useMemo)(()=>$v(r),[r]);(0,Kn.useEffect)(()=>{if(!n)return;let s=n.querySelector("#sc-theme-vars");s||(s=document.createElement("style"),s.id="sc-theme-vars",n.insertBefore(s,n.firstChild));let l=Object.entries(o).map(([u,c])=>` ${u}: ${c};`).join(`
|
|
448
|
+
`;function sN(t){if(t.querySelector(`#${sI}`))return;let e=document.createElement("style");e.id=sI,e.textContent=iN,t.appendChild(e)}function cy({notifications:t,onDismiss:e,onClickNotification:a,position:r}){let{shadowRoot:n}=ks();return sN(n),t.length===0?null:(0,wa.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,wa.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,wa.jsxs)("div",{onClick:()=>a(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,wa.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:(0,wa.jsx)(up,{emoji:o.icon??"\u{1F514}",size:14})}),(0,wa.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,wa.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,wa.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,wa.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,wa.jsx)("div",{style:{height:"2px",background:"rgba(0, 0, 0, 0.08)"},children:(0,wa.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var ur=Y(tt(),1);var dy=3,fy=8e3,py=3e4;var lN=0;function cp(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(a,r)=>!e||!(r in e)?a:String(e[r]))}function uN(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function hy(t,e){for(let a of e){let r=a.notifications;if(!(!r||r.length===0))for(let n of r){if(!uN(t.name,n.on))continue;let o=Date.now(),i=n.ttl??8e3;return{notification:{id:`notif-${++lN}-${o}`,title:cp(n.title,t.props),body:n.body?cp(n.body,t.props):void 0,icon:n.icon,tileId:a.id,itemId:n.deepLink?.itemId?cp(n.deepLink.itemId,t.props):void 0,expiresAt:o+i,createdAt:o,ttl:i},rule:n}}}return null}function my(t,e){let[a,r]=(0,ur.useState)([]),n=(0,ur.useRef)(new Map),o=(0,ur.useRef)(new Map),i=(0,ur.useCallback)(u=>{t?.publish(Dt.NOTIFICATION_DISMISSED,{notificationId:u.id,tileId:u.tileId,itemId:u.itemId})},[t]),s=(0,ur.useCallback)(u=>{let c=setTimeout(()=>{r(d=>d.filter(f=>f.id!==u.id)),o.current.delete(u.id),i(u)},u.ttl);o.current.set(u.id,c)},[i]),l=(0,ur.useCallback)(u=>{r(d=>{let f=d.find(h=>h.id===u);return f&&i(f),d.filter(h=>h.id!==u)});let c=o.current.get(u);c&&(clearTimeout(c),o.current.delete(u))},[i]);return(0,ur.useEffect)(()=>{if(!t)return;let u=t.subscribe(c=>{let d=hy(c,e);if(!d)return;let{notification:f,rule:h}=d,S=f.itemId?`${f.tileId}:${c.name}:${f.itemId}`:`${f.tileId}:${c.name}`,x=n.current.get(S),b=Date.now(),g=h.cooldown??3e4;x!==void 0&&b-x<g||(n.current.set(S,b),r(m=>{if(f.itemId&&m.some(C=>C.tileId===f.tileId&&C.itemId===f.itemId))return m;let y=[...m,f];if(y.length>3){let v=y.shift(),C=o.current.get(v.id);C&&(clearTimeout(C),o.current.delete(v.id))}return y}),t.publish(Dt.NOTIFICATION_SHOWN,{notificationId:f.id,tileId:f.tileId,itemId:f.itemId,title:f.title}),s(f))});return()=>{u();for(let c of o.current.values())clearTimeout(c);o.current.clear()}},[t,e,s]),{notifications:a,dismiss:l}}var dp=Y(tt(),1);function cN(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 gy(t,e,a){let r=(0,dp.useRef)(new Map);(0,dp.useEffect)(()=>{if(!t?.events||!a)return;let n=cN(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 ia=Y(tt(),1),lI=Y(Ee(),1),vy=(0,ia.createContext)({runtime:null,context:null});function yy({runtime:t,children:e}){let[a,r]=(0,ia.useState)(t?t.context.get():null);(0,ia.useEffect)(()=>t?(r(t.context.get()),t.context.subscribe(i=>{r(i)})):void 0,[t]);let n=(0,ia.useMemo)(()=>({runtime:t,context:a}),[t,a]);return(0,lI.jsx)(vy.Provider,{value:n,children:e})}function en(){let{runtime:t}=(0,ia.useContext)(vy);return t}function fp(){let{context:t}=(0,ia.useContext)(vy);return t}function xy(){return fp()?.page??null}function dN(){return fp()?.session??null}function fN(){return fp()?.viewport??null}function pN(t,e,a=[]){let r=en();(0,ia.useEffect)(()=>r?t?r.events.subscribe(t,e):r.events.subscribe(e):void 0,[r,...a,e,t])}function hN(){return en()?.state??null}function mN(t,e){let a=en(),[r,n]=(0,ia.useState)({value:e,isFallback:!0,isLoading:!0});return(0,ia.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 re(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var gN={colorPrimary:ne[3],colorPrimaryHover:ne[4],colorPrimaryMuted:ne[0],colorBackground:re(k[1],.95),colorBackgroundElevated:re(k[3],.95),colorBackgroundSubtle:re(k[0],.2),colorSurface:re(k[4],.8),colorSurfaceHover:re(k[5],.8),colorText:_a.primary,colorTextSecondary:_a.secondary,colorTextMuted:_a.tertiary,colorTextInverse:k[1],colorBorder:wv.primary,colorBorderSubtle:wv.secondary,colorSuccess:De[4],colorSuccessMuted:De[0],colorWarning:Rt[4],colorWarningMuted:Rt[0],colorError:Xe[4],colorErrorMuted:Xe[0],colorInfo:Sa[4],colorInfoMuted:Sa[0],colorNotification:ne[4],colorNotificationMuted:re(ne[4],.4),glassBackground:re(k[1],.6),glassBackgroundHover:re(k[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"},vN={colorPrimary:ne[3],colorPrimaryHover:ne[2],colorPrimaryMuted:re(ne[5],.1),colorBackground:re(k[12],.95),colorBackgroundElevated:re(k[11],.95),colorBackgroundSubtle:re(k[0],.02),colorSurface:re(k[11],.6),colorSurfaceHover:re(k[10],.6),colorText:k[1],colorTextSecondary:k[6],colorTextMuted:k[8],colorTextInverse:k[12],colorBorder:re(k[0],.12),colorBorderSubtle:re(k[0],.06),colorSuccess:De[4],colorSuccessMuted:re(De[4],.12),colorWarning:Rt[4],colorWarningMuted:re(Rt[4],.12),colorError:Xe[4],colorErrorMuted:re(Xe[4],.12),colorInfo:Sa[4],colorInfoMuted:re(Sa[4],.12),colorNotification:ne[3],colorNotificationMuted:re(ne[3],.4),glassBackground:re(k[12],.7),glassBackgroundHover:re(k[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 yN(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var by={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:re(k[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:wf.primary.backgroundDefault,backgroundHover:wf.primary.backgroundHover,color:wf.primary.icon,size:"56px",shadow:`0 8px 32px ${re(k[0],.6)}`,borderRadius:"9999px"},tile:{background:re(k[1],.6),backgroundHover:re(k[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:_a.primary,textColor:_a.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:re(k[1],.6),textColor:_a.primary,titleColor:_a.primary,arrowColor:re(k[1],.6),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:re(k[0],.95),textColor:_a.primary,textSecondaryColor:_a.secondary,border:`1px solid ${k[5]}`,borderRadius:"12px",successColor:De[4],warningColor:Rt[4],errorColor:Xe[4],iconBackground:re(ne[3],.15),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[4]})`},content:{background:re(k[3],.8),backgroundHover:re(k[5],.6),border:`1px solid ${re(k[5],.5)}`,borderRadius:"8px",textColor:_a.primary,textSecondaryColor:_a.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:re(k[3],.8),searchColor:_a.primary,chevronColor:"currentColor"}},Sy={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:re(k[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:re(k[12],.7),backgroundHover:re(k[12],.8),border:"1px solid rgba(0, 0, 0, 0.06)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.12)",titleColor:k[1],textColor:k[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:re(k[12],.7),textColor:k[1],titleColor:k[1],arrowColor:re(k[12],.7),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:re(k[12],.95),textColor:k[1],textSecondaryColor:k[6],border:`1px solid ${re(k[0],.12)}`,borderRadius:"12px",successColor:De[4],warningColor:Rt[4],errorColor:Xe[4],iconBackground:re(ne[3],.1),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[2]})`},content:{background:re(k[12],.8),backgroundHover:re(k[11],.6),border:`1px solid ${k[11]}`,borderRadius:"8px",textColor:k[1],textSecondaryColor:k[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:k[12],searchColor:k[1],chevronColor:"currentColor"}};function _y(t){let e=t.mode==="light"?Sy:by;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 Cy(t,e){let a=e.mode??t.mode??"dark",r=a==="light"?Sy:by;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 xN=["canvas","launcher","tile","overlay","notification","content"];function wy(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 xN){let r=t[a];if(r)for(let[n,o]of Object.entries(r))o!==void 0&&(e[`--sc-${a}-${yN(n)}`]=o)}return e}var tn=Y(tt(),1);var cI=Y(Ee(),1),uI=(0,tn.createContext)(null);function Ly({children:t,themeConfig:e,workspaceTheme:a,shadowRoot:r}){let n=(0,tn.useMemo)(()=>a?Cy(a,e??{}):_y(e??{}),[e,a]),o=(0,tn.useMemo)(()=>wy(n),[n]);(0,tn.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(`
|
|
465
449
|
`);s.textContent=`:host {
|
|
466
450
|
${l}
|
|
467
|
-
}`},[
|
|
451
|
+
}`},[r,o]);let i={config:n,mode:n.mode,cssVariables:o};return(0,cI.jsx)(uI.Provider,{value:i,children:t})}function ky(){let t=(0,tn.useContext)(uI);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}var Ge=Y(tt(),1);var fI=Y(Ee(),1);function dI({emoji:t,size:e=18,color:a="currentColor"}){return(0,fI.jsx)(up,{emoji:t,size:e,color:a})}var sa=Y(Ee(),1);function bN({widgetId:t,props:e}){let a=en(),r=(0,Ge.useRef)(null),n=(0,Ge.useRef)(null),o=a?.widgets,i=o?.has(t)??!1,s=(0,Ge.useRef)(e);s.current=e;let[,l]=(0,Ge.useReducer)(d=>d+1,0);(0,Ge.useEffect)(()=>{if(!(!o||i))return o.subscribe(d=>{d.type==="registered"&&d.widgetId===t&&l()})},[o,t,i]),(0,Ge.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 f=o.mount(t,d,s.current);return n.current=f,()=>{f.unmount(),n.current=null}},[o,t,i]);let u=JSON.stringify(e),c=(0,Ge.useRef)(u);return(0,Ge.useEffect)(()=>{c.current!==u&&(c.current=u,n.current?.update(s.current))},[u]),o?.has(t)?(0,sa.jsx)("div",{ref:r}):(0,sa.jsxs)("div",{style:{padding:"0.75rem",fontSize:"0.8rem",color:"var(--sc-tile-text-color)",fontStyle:"italic"},children:["Widget not available: ",t]})}var SN=[":toggled",":clicked",":feedback",":navigate",":expanded",":collapsed",":dismissed",":submitted",":interacted",":tip_clicked",":tip_focused"];function zu({config:t,surface:e,telemetry:a,style:r}){let{title:n,subtitle:o,widget:i,props:s,icon:l}=t,[,u]=(0,Ge.useState)(0),c=(0,Ge.useRef)(null),d=en();(0,Ge.useEffect)(()=>{d&&u(w=>w+1)},[d]),(0,Ge.useEffect)(()=>{let w=typeof window<"u"?window.SynOS?.interventionTracker:null;if(!c.current||!w)return;let _=new IntersectionObserver(([L])=>{L.isIntersecting&&(w.trackSeen(t.id,t.widget??"unknown"),_.disconnect())},{threshold:.5});return _.observe(c.current),()=>_.disconnect()},[t.id,t.widget]),(0,Ge.useEffect)(()=>{let w=typeof window<"u"?window.SynOS?.interventionTracker:null;if(!(!d?.events||!w))return d.events.subscribe(_=>{SN.some(L=>_.name?.includes(L))&&_.props?.instanceId===t.id&&w.trackInteracted(t.id,t.widget??"unknown",_.name)})},[d?.events,t.id,t.widget]);let f=(0,Ge.useMemo)(()=>d?.widgets?.getRegistration?.(i),[d?.widgets,i]),h=(0,Ge.useMemo)(()=>l||(f?.metadata?.icon??"+"),[l,f]),S=(0,Ge.useMemo)(()=>o||f?.metadata?.subtitle,[o,f]),[x,b]=(0,Ge.useState)(!1),g=(0,Ge.useCallback)(()=>b(!0),[]),m=(0,Ge.useCallback)(()=>b(!1),[]),y={display:"flex",flexDirection:"column",borderRadius:"var(--sc-tile-border-radius)",background:x?"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:x?"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"},C={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return(0,sa.jsxs)("article",{ref:c,"data-shadow-canvas-id":`tile-${t.id}`,style:y,onMouseEnter:g,onMouseLeave:m,children:[(0,sa.jsxs)("div",{style:v,children:[(0,sa.jsx)("div",{style:C,children:(0,sa.jsx)(dI,{emoji:h,size:S?36:24})}),(0,sa.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,sa.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}),S&&(0,sa.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:S})]})]}),(0,sa.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,sa.jsx)("div",{style:{paddingTop:"var(--sc-tile-gap, 0.25rem)"},children:(0,sa.jsx)(bN,{widgetId:i,props:{...s,instanceId:t.id}})})})]})}var be=Y(Ee(),1),pI="syntro-launcher-styles";function _N(t,e){if(t.querySelector(`#${pI}`))return;let a=document.createElement("style");a.id=pI,a.textContent=e,t.appendChild(a)}function hI({isOpen:t,onToggle:e,telemetry:a,launcherLabel:r="Adaptives",launcherAnimate:n=!1,launcherAnimationStyle:o="pulse",notificationCount:i,footerSlot:s,tiles:l,isLoading:u,error:c,canvasTitle:d,displayMode:f="standard"}){let[h,S]=(0,lt.useState)(!1),[x,b]=(0,lt.useState)(null),g=(0,lt.useRef)(null),m=en(),{shadowRoot:y,portalRoot:v}=ks(),{config:C}=ky(),{notifications:w,dismiss:_}=my(m?.events??null,l);gy(m,l,m?.apps);let L=(0,lt.useCallback)(G=>{m&&m.events.publish(Dt.NOTIFICATION_CLICKED,{notificationId:G.id,tileId:G.tileId,itemId:G.itemId}),t||e(),m&&G.tileId&&m.events.publish(Dt.NOTIFICATION_DEEP_LINK,{tileId:G.tileId,itemId:G.itemId}),_(G.id)},[m,t,e,_]),I=(0,lt.useMemo)(()=>`
|
|
468
452
|
@keyframes syntro-launcher-pulse {
|
|
469
453
|
0%, 100% {
|
|
470
|
-
box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 0 ${
|
|
454
|
+
box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 0 ${C.colorPrimary}66;
|
|
471
455
|
}
|
|
472
456
|
50% {
|
|
473
|
-
box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 8px ${
|
|
457
|
+
box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 8px ${C.colorPrimary}00;
|
|
474
458
|
}
|
|
475
459
|
}
|
|
476
460
|
@keyframes syntro-launcher-glow {
|
|
477
461
|
0%, 100% { border-color: rgba(255,255,255,0.1); }
|
|
478
|
-
50% { border-color: ${
|
|
462
|
+
50% { border-color: ${C.colorPrimaryHover}99; }
|
|
479
463
|
}
|
|
480
464
|
.syntro-launcher-animate {
|
|
481
465
|
animation: syntro-launcher-pulse 2s ease-in-out infinite, syntro-launcher-glow 2s ease-in-out infinite;
|
|
@@ -486,8 +470,8 @@ ${l}
|
|
|
486
470
|
75%, 100% { transform: scale(2.2); opacity: 0; }
|
|
487
471
|
}
|
|
488
472
|
@keyframes syntro-badge-glow {
|
|
489
|
-
0%, 100% { box-shadow: 0 0 8px 2px ${
|
|
490
|
-
50% { box-shadow: 0 0 20px 6px ${
|
|
473
|
+
0%, 100% { box-shadow: 0 0 8px 2px ${C.colorPrimaryHover}4d; }
|
|
474
|
+
50% { box-shadow: 0 0 20px 6px ${C.colorPrimaryHover}80; }
|
|
491
475
|
}
|
|
492
476
|
@keyframes syntro-badge-bounce {
|
|
493
477
|
0%, 100% { transform: translateY(0); }
|
|
@@ -497,7 +481,7 @@ ${l}
|
|
|
497
481
|
.syntro-badge-ping { animation: syntro-badge-ping 1.5s cubic-bezier(0,0,0.2,1) infinite; }
|
|
498
482
|
.syntro-badge-glow { animation: syntro-badge-glow 2s ease-in-out infinite; }
|
|
499
483
|
.syntro-badge-bounce { animation: syntro-badge-bounce 2s ease-in-out infinite; }
|
|
500
|
-
`,[L.colorPrimary,L.colorPrimaryHover]);(0,ct.useEffect)(()=>{t&&u.forEach(G=>{if(a?.trackRectangleViewed(G.id,"overlay"),v){let ne=pu.tileViewed(G.id,"overlay");v.events.publish(ne.name,ne.props,ne.source)}})},[a,v,t,u]),(0,ct.useEffect)(()=>{b(!0),EB(y,k)},[y,k]);let T=(0,ct.useCallback)(()=>{let G=!t;if(G?a?.trackCanvasOpened("overlay"):a?.trackCanvasClosed("overlay"),v){let ne=G?pu.canvasOpened("overlay"):pu.canvasClosed("overlay");v.events.publish(ne.name,ne.props,ne.source)}e()},[t,a,v,e]),D=(0,ct.useCallback)(G=>{let ne=G.currentTarget.getBoundingClientRect();g.current={startX:G.clientX,startY:G.clientY,startElX:ne.left,startElY:ne.top,dragged:!1},G.currentTarget.setPointerCapture(G.pointerId)},[]),M=(0,ct.useCallback)(G=>{let ne=g.current;if(!ne)return;let Et=G.clientX-ne.startX,hr=G.clientY-ne.startY;(Math.abs(Et)>5||Math.abs(hr)>5)&&(ne.dragged=!0),ne.dragged&&p({x:ne.startElX+Et,y:ne.startElY+hr})},[]),P=(0,ct.useCallback)(G=>{let ne=g.current;g.current=null,ne&&!ne.dragged&&T()},[T]),F=m==="focused",U=L.canvas.position==="right",V=L.canvas.layout==="push",N=L.canvas.border??"none",X=(0,ct.useRef)(null),ve=2147483600;(0,ct.useEffect)(()=>{if(!V)return;let G=document.documentElement,ne=U?"marginRight":"marginLeft",Et=L.canvas.transitionDuration??"300ms",hr=L.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)",Qp=G.style.transition;if(G.style.transition=`${ne} ${Et} ${hr}`,t){let Jp=X.current?.offsetWidth??380;G.style[ne]=`${Jp}px`}else G.style[ne]="0px";return()=>{G.style[ne]="",G.style.transition=Qp}},[V,t,U,L.canvas.transitionDuration,L.canvas.transitionEasing]),(0,ct.useEffect)(()=>{if(!V||!t)return;let G=X.current;if(!G)return;let ne=U?"marginRight":"marginLeft",Et=new ResizeObserver(([hr])=>{document.documentElement.style[ne]=`${hr.contentRect.width}px`});return Et.observe(G),()=>Et.disconnect()},[V,t,U]);let qa={display:"flex",flexDirection:"column",width:F?"40vw":L.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:(()=>{let G=L.canvas.transitionDuration??"300ms",ne=L.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)";return t?`transform ${G} ${ne}, opacity ${G} ease-out`:`transform ${G} ${ne}, opacity ${G} ease-in`})(),color:"var(--sc-overlay-text-color)",background:"var(--sc-canvas-background)",...(()=>{let G=L.canvas.blur??"blur(24px)",ne=F&&G!=="none"?`${G} saturate(1.2)`:G;return{backdropFilter:ne,WebkitBackdropFilter:ne}})(),...(()=>{if(F||N&&N!=="none")return{};let G=L.canvas.transitionFade??"6%",ne=U?`linear-gradient(to right, transparent, black ${G})`:`linear-gradient(to left, transparent, black ${G})`;return{maskImage:ne,WebkitMaskImage:ne}})(),border:N,borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":U?"translateX(120%)":"translateX(-120%)"},Vt=(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:X,"data-shadow-canvas-id":"overlay-container",style:qa,children:[F&&f&&(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:f})}),(0,ge.jsx)("div",{style:{flex:1,overflowY:"auto",padding:F?"0":"1rem"},children:c?(0,ge.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:F?"1rem":"0"},children:"Loading..."}):d?(0,ge.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:F?"1rem":"0"},children:["Failed to load: ",d]}):F?u.length>0?(0,ge.jsx)(bu,{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(G=>(0,ge.jsx)(bu,{config:G,surface:"overlay",telemetry:a,style:{width:"100%"}},G.id))})}),l]}),(0,ge.jsx)("div",{onClick:T,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return S?(0,ge.jsxs)(ge.Fragment,{children:[(0,Wv.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)(Ev,{notifications:C,onDismiss:A,onClickNotification:w,position:L.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:g.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:g.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:D,onPointerMove:M,onPointerUp:P,onMouseEnter:G=>{g.current?.dragged||(G.currentTarget.style.backgroundColor=L.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:G=>{g.current?.dragged||(G.currentTarget.style.backgroundColor=L.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"})]}):r?(0,ge.jsx)("img",{src:r,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:`${L.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:L.colorPrimaryHover,color:"#ffffff",fontSize:11,fontWeight:700},children:C.length>99?"99+":C.length})]})]})]}),_),(0,Wv.createPortal)(Vt,_)]}):null}var Ut=K(Xe(),1);var i1=t=>[...t].sort((e,a)=>(a.priority??0)-(e.priority??0));function s1({fetcher:t,experiments:e,runtime:a,pageUrl:n,pollIntervalMs:r}){let[o,i]=(0,Ut.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Ut.useRef)("[]"),l=(0,Ut.useRef)(null),u=(0,Ut.useCallback)(async()=>{let d=l.current;if(!d||!a)return;let f=d.tiles||[];f=await a.filterTiles(f),e&&(f=f.filter(m=>e.shouldRenderRectangle(m))),i(m=>({...m,tiles:i1(f)}))},[a,e]),c=(0,Ut.useCallback)(async()=>{try{i(x=>({...x,isLoading:!0,error:void 0}));let d=await t();Y("SmartCanvas Config","Raw config response",d),l.current=d;let f=d.tiles||[];a?(f=await a.filterTiles(f),e&&(f=f.filter(x=>e.shouldRenderRectangle(x)))):e&&(f=f.filter(x=>e.shouldRenderRectangle(x))),Y("SmartCanvas Config",`Tile count after filtering: ${f.length}`);let m=d.actions||[],S=JSON.stringify(m),b=S!==s.current;b&&(s.current=S),i(x=>({tiles:i1(f),actions:b?m:x.actions,isLoading:!1,fetchedAt:d.fetchedAt,canvasTitle:d.canvasTitle,configVersion:d.configVersion,theme:d.theme,launcher:d.launcher}))}catch(d){let f=d instanceof Error?d.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",f,d),i(m=>({...m,isLoading:!1,error:f}))}},[e,t,a]);return(0,Ut.useEffect)(()=>{if(c(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>c())},[c,e,n]),(0,Ut.useEffect)(()=>{if(a?.accumulator)return a.accumulator.subscribe(()=>{u()})},[a,u]),(0,Ut.useEffect)(()=>{if(a?.context)return a.context.subscribe(()=>{u()})},[a,u]),(0,Ut.useEffect)(()=>{if(!r)return;let d=setInterval(()=>{c()},r);return()=>clearInterval(d)},[c,r]),(0,Ut.useMemo)(()=>o,[o])}var Ss=K(Oe(),1);function u1({controller:t,fetcher:e,configUri:a,configUriFeatureKey:n="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:f="smart-canvas-overlay-uri",overlayFetchCredentials:m="include",footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:p,workspaceTheme:g}){return u?(0,Ss.jsx)(Fv,{runtime:u,children:(0,Ss.jsx)(l1,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:n,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:f,overlayFetchCredentials:m,footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:p,workspaceTheme:g})}):(0,Ss.jsx)(l1,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:n,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:f,overlayFetchCredentials:m,footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:p,workspaceTheme:g})}function l1({controller:t,fetcher:e,configUri:a,configUriFeatureKey:n="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:f="smart-canvas-overlay-uri",overlayFetchCredentials:m="include",footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:p,workspaceTheme:g}){let[v,y]=(0,zt.useState)(t.getState().open),_=Nv(),[L,C]=(0,zt.useState)(()=>typeof window<"u"?window.location.href:"/"),A=_?.url??L;(0,zt.useEffect)(()=>{if(u||typeof window>"u")return;let V=()=>C(window.location.href);window.addEventListener("popstate",V),window.addEventListener("hashchange",V);let N=history.pushState,X=history.replaceState;return history.pushState=function(...ve){N.apply(this,ve),queueMicrotask(V)},history.replaceState=function(...ve){X.apply(this,ve),queueMicrotask(V)},()=>{window.removeEventListener("popstate",V),window.removeEventListener("hashchange",V),history.pushState=N,history.replaceState=X}},[u]);let w=(0,zt.useMemo)(()=>e||gs({configUri:a,experiments:s,featureKey:n,configFeatureKey:r,credentials:o}),[e,a,s,n,r,o]),k=s1({fetcher:w,experiments:s,runtime:u,pageUrl:A}),T=k.tiles.length>0&&!k.error;(0,zt.useEffect)(()=>t.subscribe(V=>y(V.open)),[t]),(0,zt.useEffect)(()=>{!k.isLoading&&!T&&t.getState().open&&t.setOpen(!1)},[t,T,k.isLoading]);let D=(0,zt.useRef)(p??null),M=(0,zt.useRef)(!!p),P=(0,zt.useRef)(0);(0,zt.useEffect)(()=>{if(!u?.actions)return;if(M.current){k.actions.length>0&&(M.current=!1);return}let V=++P.current,N=()=>V!==P.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(!N()&&k.actions.length>0)try{let ve=await u.actions.applyBatch(k.actions);N()?await ve.revertAll():D.current=ve}catch(ve){N()||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,k.actions,A]),(0,zt.useEffect)(()=>{if(u)return u.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[u,t]);let{shadowRoot:F}=xs(),U=k.theme;return(0,Ss.jsx)(Vv,{themeConfig:U,workspaceTheme:g,shadowRoot:F,children:!k.isLoading&&!T?null:(0,Ss.jsx)(o1,{tiles:k.tiles,isLoading:k.isLoading,error:k.error,canvasTitle:k.canvasTitle,telemetry:l,launcherLabel:b??k.launcher?.label,launcherIcon:k.launcher?.icon,launcherAnimate:k.launcher?.animate,launcherAnimationStyle:k.launcher?.animationStyle,notificationCount:k.launcher?.notificationCount??k.tiles.length,footerSlot:S,isOpen:v,onToggle:()=>t.toggle(),displayMode:k.displayMode})})}var Yv=K(Oe(),1),c1="smart-canvas",d1=`
|
|
484
|
+
`,[C.colorPrimary,C.colorPrimaryHover]);(0,lt.useEffect)(()=>{t&&l.forEach(G=>{if(a?.trackRectangleViewed(G.id,"overlay"),m){let te=ku.tileViewed(G.id,"overlay");m.events.publish(te.name,te.props,te.source)}})},[a,m,t,l]),(0,lt.useEffect)(()=>{S(!0),_N(y,I)},[y,I]);let A=(0,lt.useCallback)(()=>{let G=!t;if(G?a?.trackCanvasOpened("overlay"):a?.trackCanvasClosed("overlay"),m){let te=G?ku.canvasOpened("overlay"):ku.canvasClosed("overlay");m.events.publish(te.name,te.props,te.source)}e()},[t,a,m,e]);(0,lt.useEffect)(()=>{if(!t)return;let G=te=>{let Qe=te.composedPath();M.current&&!Qe.includes(M.current)&&U.current&&!Qe.includes(U.current)&&A()};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[t,A]);let T=(0,lt.useCallback)(G=>{let te=G.currentTarget.getBoundingClientRect();g.current={startX:G.clientX,startY:G.clientY,startElX:te.left,startElY:te.top,dragged:!1},G.currentTarget.setPointerCapture(G.pointerId)},[]),N=(0,lt.useCallback)(G=>{let te=g.current;if(!te)return;let Qe=G.clientX-te.startX,Me=G.clientY-te.startY;(Math.abs(Qe)>5||Math.abs(Me)>5)&&(te.dragged=!0),te.dragged&&b({x:te.startElX+Qe,y:te.startElY+Me})},[]),B=(0,lt.useCallback)(G=>{let te=g.current;g.current=null,te&&!te.dragged&&A()},[A]),F=f==="focused",H=C.canvas.position==="right",R=C.canvas.layout==="push",z=C.canvas.border??"none",M=(0,lt.useRef)(null),U=(0,lt.useRef)(null),ue=2147483600;(0,lt.useEffect)(()=>{if(!R)return;let G=document.documentElement,te=H?"marginRight":"marginLeft",Qe=C.canvas.transitionDuration??"300ms",Me=C.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)",nl=G.style.transition;if(G.style.transition=`${te} ${Qe} ${Me}`,t){let Th=M.current?.offsetWidth??380;G.style[te]=`${Th}px`}else G.style[te]="0px";return()=>{G.style[te]="",G.style.transition=nl}},[R,t,H,C.canvas.transitionDuration,C.canvas.transitionEasing]),(0,lt.useEffect)(()=>{if(!R||!t)return;let G=M.current;if(!G)return;let te=H?"marginRight":"marginLeft",Qe=new ResizeObserver(([Me])=>{document.documentElement.style[te]=`${Me.contentRect.width}px`});return Qe.observe(G),()=>Qe.disconnect()},[R,t,H]);let Re={display:"flex",flexDirection:"column",width:F?"40vw":C.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:(()=>{let G=C.canvas.transitionDuration??"300ms",te=C.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)";return t?`transform ${G} ${te}, opacity ${G} ease-out`:`transform ${G} ${te}, opacity ${G} ease-in`})(),color:"var(--sc-overlay-text-color)",background:"var(--sc-canvas-background)",...(()=>{let G=C.canvas.blur??"blur(24px)",te=F&&G!=="none"?`${G} saturate(1.2)`:G;return{backdropFilter:te,WebkitBackdropFilter:te}})(),...(()=>{if(F||z&&z!=="none")return{};let G=C.canvas.transitionFade??"6%",te=H?`linear-gradient(to right, transparent, black ${G})`:`linear-gradient(to left, transparent, black ${G})`;return{maskImage:te,WebkitMaskImage:te}})(),border:z,borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":H?"translateX(120%)":"translateX(-120%)"},gt=(0,be.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:ue},children:(0,be.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:H?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,be.jsxs)("div",{ref:M,"data-shadow-canvas-id":"overlay-container",style:Re,children:[F&&d&&(0,be.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,be.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"var(--sc-notification-text-secondary-color)"},children:d})}),(0,be.jsx)("div",{style:{flex:1,overflowY:"auto",padding:F?"0":"1rem"},children:u?(0,be.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:F?"1rem":"0"},children:"Loading..."}):c?(0,be.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:F?"1rem":"0"},children:["Failed to load: ",c]}):F?l.length>0?(0,be.jsx)(zu,{config:l[0],surface:"overlay",telemetry:a,style:{width:"100%",height:"100%"}}):null:(0,be.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:l.map(G=>(0,be.jsx)(zu,{config:G,surface:"overlay",telemetry:a,style:{width:"100%"}},G.id))})}),s]}),(0,be.jsx)("div",{style:{flex:"1 1 auto"}})]})});return h?(0,be.jsxs)(be.Fragment,{children:[(0,Iy.createPortal)((0,be.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:ue+47},children:[(0,be.jsx)(cy,{notifications:w,onDismiss:_,onClickNotification:L,position:C.canvas.position??"right"}),(0,be.jsxs)("button",{ref:U,type:"button","aria-label":"Toggle shadow canvas",className:n&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",...x?{top:x.y,left:x.x}:{bottom:"2.5rem",right:H?"2.5rem":void 0,left:H?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:g.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:g.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:T,onPointerMove:N,onPointerUp:B,onMouseEnter:G=>{g.current?.dragged||(G.currentTarget.style.backgroundColor=C.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:G=>{g.current?.dragged||(G.currentTarget.style.backgroundColor=C.launcher.background??"var(--sc-launcher-background)")},children:[t?(0,be.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,be.jsx)("path",{d:"M18 6L6 18"}),(0,be.jsx)("path",{d:"M6 6l12 12"})]}):C.launcher?.icon?(0,be.jsx)("img",{src:C.launcher.icon,alt:"","aria-hidden":"true",style:{width:"60%",height:"60%",objectFit:"contain",pointerEvents:"none"}}):(0,be.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,be.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,be.jsx)("path",{d:"M5 3v4"}),(0,be.jsx)("path",{d:"M3 5h4"}),(0,be.jsx)("path",{d:"M19 17v4"}),(0,be.jsx)("path",{d:"M17 19h4"})]}),!t&&w.length>0&&(0,be.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,be.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${C.colorPrimaryHover}66`}}),(0,be.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,be.jsx)("span",{className:"syntro-badge-bounce",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"9999px",background:C.colorPrimaryHover,color:"#ffffff",fontSize:11,fontWeight:700},children:w.length>99?"99+":w.length})]})]})]}),v),(0,Iy.createPortal)(gt,v)]}):null}var Zt=Y(tt(),1);var mI=t=>[...t].sort((e,a)=>(a.priority??0)-(e.priority??0));function gI(t){let e=typeof window<"u"?window.SynOS?.interventionTracker:null;if(e)for(let a of t)e.trackTriggered(a.id,a.widget??"unknown")}function vI({fetcher:t,experiments:e,runtime:a,pageUrl:r,pollIntervalMs:n}){let[o,i]=(0,Zt.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Zt.useRef)("[]"),l=(0,Zt.useRef)(null),u=(0,Zt.useCallback)(async()=>{let d=l.current;if(!d||!a)return;let f=d.tiles||[];f=await a.filterTiles(f),e&&(f=f.filter(h=>e.shouldRenderRectangle(h))),gI(f),i(h=>({...h,tiles:mI(f)}))},[a,e]),c=(0,Zt.useCallback)(async()=>{try{i(b=>({...b,isLoading:!0,error:void 0}));let d=await t();X("SmartCanvas Config","Raw config response",d),l.current=d;let f=d.tiles||[];a?(f=await a.filterTiles(f),e&&(f=f.filter(b=>e.shouldRenderRectangle(b)))):e&&(f=f.filter(b=>e.shouldRenderRectangle(b))),gI(f),X("SmartCanvas Config",`Tile count after filtering: ${f.length}`);let h=d.actions||[],S=JSON.stringify(h),x=S!==s.current;x&&(s.current=S),i(b=>({tiles:mI(f),actions:x?h:b.actions,isLoading:!1,fetchedAt:d.fetchedAt,canvasTitle:d.canvasTitle,configVersion:d.configVersion,theme:d.theme,launcher:d.launcher}))}catch(d){let f=d instanceof Error?d.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",f,d),i(h=>({...h,isLoading:!1,error:f}))}},[e,t,a]);return(0,Zt.useEffect)(()=>{if(c(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>c())},[c,e,r]),(0,Zt.useEffect)(()=>{if(a?.accumulator)return a.accumulator.subscribe(()=>{u()})},[a,u]),(0,Zt.useEffect)(()=>{if(a?.context)return a.context.subscribe(()=>{u()})},[a,u]),(0,Zt.useEffect)(()=>{if(!n)return;let d=setInterval(()=>{c()},n);return()=>clearInterval(d)},[c,n]),(0,Zt.useMemo)(()=>o,[o])}var As=Y(Ee(),1);function xI({controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:f="smart-canvas-overlay-uri",overlayFetchCredentials:h="include",footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:g,workspaceTheme:m}){return u?(0,As.jsx)(yy,{runtime:u,children:(0,As.jsx)(yI,{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:f,overlayFetchCredentials:h,footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:g,workspaceTheme:m})}):(0,As.jsx)(yI,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:f,overlayFetchCredentials:h,footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:g,workspaceTheme:m})}function yI({controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:f="smart-canvas-overlay-uri",overlayFetchCredentials:h="include",footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:g,workspaceTheme:m}){let[y,v]=(0,Ut.useState)(t.getState().open),C=xy(),[w,_]=(0,Ut.useState)(()=>typeof window<"u"?window.location.href:"/"),L=C?.url??w;(0,Ut.useEffect)(()=>{if(u||typeof window>"u")return;let M=()=>_(window.location.href);return window.addEventListener("popstate",M),window.addEventListener("hashchange",M),()=>{window.removeEventListener("popstate",M),window.removeEventListener("hashchange",M)}},[u]);let I=(0,Ut.useMemo)(()=>e||Cs({configUri:a,experiments:s,featureKey:r,configFeatureKey:n,credentials:o}),[e,a,s,r,n,o]),A=vI({fetcher:I,experiments:s,runtime:u,pageUrl:L}),T=A.tiles.length>0&&!A.error;(0,Ut.useEffect)(()=>t.subscribe(M=>v(M.open)),[t]),(0,Ut.useEffect)(()=>{!A.isLoading&&!T&&t.getState().open&&t.setOpen(!1)},[t,T,A.isLoading]);let N=(0,Ut.useRef)(g??null),B=(0,Ut.useRef)(!!g),F=(0,Ut.useRef)(0),H=(0,Ut.useRef)(null);(0,Ut.useEffect)(()=>{if(!u?.actions)return;if(B.current){A.actions.length>0&&(B.current=!1);return}let M=++F.current,U=()=>M!==F.current;return(async()=>{if(H.current){try{await H.current}catch(Re){console.error("[SmartCanvasApp] Pending revert failed:",Re)}H.current=null}if(N.current){try{await N.current.revertAll()}catch(Re){console.error("[SmartCanvasApp] Failed to revert actions:",Re)}N.current=null}if(!U()&&A.actions.length>0)try{let Re=await u.actions.applyBatch(A.actions);U()?await Re.revertAll():N.current=Re}catch(Re){U()||console.error("[SmartCanvasApp] Failed to apply actions:",Re)}})(),()=>{N.current&&(H.current=N.current.revertAll().catch(Re=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",Re)}),N.current=null)}},[u,A.actions,L]),(0,Ut.useEffect)(()=>{if(u)return u.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[u,t]);let{shadowRoot:R}=ks(),z=A.theme;return(0,As.jsx)(Ly,{themeConfig:z,workspaceTheme:m,shadowRoot:R,children:!A.isLoading&&!T?null:(0,As.jsx)(hI,{tiles:A.tiles,isLoading:A.isLoading,error:A.error,canvasTitle:A.canvasTitle,telemetry:l,launcherLabel:x??A.launcher?.label,launcherAnimate:A.launcher?.animate,launcherAnimationStyle:A.launcher?.animationStyle,notificationCount:A.launcher?.notificationCount??A.tiles.length,footerSlot:S,isOpen:y,onToggle:()=>t.toggle(),displayMode:A.displayMode})})}var Ey=Y(Ee(),1),bI="smart-canvas",SI=`
|
|
501
485
|
:host {
|
|
502
486
|
font: inherit;
|
|
503
487
|
color: inherit;
|
|
@@ -511,12 +495,12 @@ ${l}
|
|
|
511
495
|
*, *::before, *::after {
|
|
512
496
|
box-sizing: border-box;
|
|
513
497
|
}
|
|
514
|
-
`,Ba,Yr,Kr,Qn,Jn,Qr,er,Xv=class extends HTMLElement{constructor(){super();gr(this,Ba);gr(this,Yr);gr(this,Kr);gr(this,Qn);gr(this,Jn);gr(this,Qr,null);gr(this,er,null);on(this,Ba,this.attachShadow({mode:"open",delegatesFocus:!0})),on(this,Yr,document.createElement("div")),me(this,Yr).setAttribute("part","mount"),me(this,Ba).appendChild(me(this,Yr)),on(this,Kr,document.createElement("div")),me(this,Kr).id="portalRoot",me(this,Ba).appendChild(me(this,Kr)),on(this,Qn,document.createElement("div")),me(this,Qn).id="overlayContainer",Object.assign(me(this,Qn).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),me(this,Ba).appendChild(me(this,Qn)),on(this,Jn,Vk()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){me(this,Qr)?.unmount(),on(this,Qr,null)}getMountNode(){return me(this,Yr)}getController(){return me(this,Jn)}getPortalRoot(){return me(this,Kr)}getOverlayContainer(){return me(this,Qn)}getShadowRoot(){return me(this,Ba)}open(){me(this,Jn).setOpen(!0)}close(){me(this,Jn).setOpen(!1)}toggle(){me(this,Jn).toggle()}setOverrideFetcher(a){me(this,er)&&(on(this,er,{...me(this,er),fetcher:a}),this.render())}mountReactApp(a){on(this,er,a),this.render()}render(){!this.isConnected||!me(this,er)||(me(this,Qr)||on(this,Qr,(0,f1.createRoot)(me(this,Yr))),me(this,Qr).render((0,Yv.jsx)(Gk,{shadowRoot:me(this,Ba),portalRoot:me(this,Kr),overlayContainer:me(this,Qn),children:(0,Yv.jsx)(u1,{...me(this,er),controller:me(this,Jn),canvasHost:this})})))}applyBaseStyles(){if(me(this,Ba).adoptedStyleSheets!==void 0){let a=new CSSStyleSheet;a.replaceSync(d1),me(this,Ba).adoptedStyleSheets=[a]}else{let a=document.createElement("style");a.textContent=d1,me(this,Ba).appendChild(a)}}};Ba=new WeakMap,Yr=new WeakMap,Kr=new WeakMap,Qn=new WeakMap,Jn=new WeakMap,Qr=new WeakMap,er=new WeakMap;var p1=()=>{typeof window>"u"||customElements.get(c1)||customElements.define(c1,Xv)};var Kv=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=Dk(x)}let a=null,n=null,r=null,{runtime:o}=t;async function i(x){!o?.actions||x.length===0||(r?.isApplied()&&await r.revertAll(),r=await o.actions.applyBatch(x))}async function s(){r?.isApplied()&&(await r.revertAll(),r=null)}if(t.fetcher)try{n=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((p,g)=>`[${g}] ${p.kind}${p.anchorId?` anchor="${p.anchorId.selector}"`:""}${p.label?` "${p.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&&Ef(x.tiles,o.accumulator,x.actions)}catch(x){console.error("[SmartCanvas] Error fetching/applying initial config:",x)}e&&e();let l=Af();p1();let u=document.createElement("smart-canvas");if(qk(u.getOverlayContainer()),t.tokens)for(let[x,p]of Object.entries(t.tokens))u.style.setProperty(x,p);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`),Nk(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,f=t.integrations?.telemetry,m=t.fetcher??gs({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});n||(n=m);let S={fetcher:m,pollIntervalMs:t.pollIntervalMs,experiments:d,telemetry:f,runtime:o,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,initialBatchHandle:r,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[p,g]of Object.entries(x))u.style.setProperty(p,g)},getConfig:async()=>{if(n)try{let x=await n();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=>{n=x,u.setOverrideFetcher(x),o?.accumulator&&x().then(p=>{p?.tiles&&Ef(p.tiles,o.accumulator,p.actions)}).catch(()=>{})},registerTelemetryProperties:x=>{f?.register?.(x)},getSessionId:()=>f?.getSessionId?.(),startSessionRecording:()=>{f?.startSessionRecording?.()},track:(x,p)=>f?.track?(f.track(x,p),!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 Kv(t)}});var eo=K(Xe(),1);var Jr=K(Oe(),1);function w5({tiles:t,intervalMs:e=7e3,telemetry:a}){let[n,r]=(0,eo.useState)(0),o=(0,eo.useMemo)(()=>[...t].sort((i,s)=>(i.priority??0)-(s.priority??0)),[t]);return(0,eo.useEffect)(()=>{a?.trackCanvasOpened("wheel")},[a]),(0,eo.useEffect)(()=>{if(o.length<=1)return;let i=setInterval(()=>{r(s=>(s+1)%o.length)},e);return()=>clearInterval(i)},[o,e]),(0,eo.useEffect)(()=>{let i=o[n];i&&a?.trackRectangleViewed(i.id,"wheel")},[n,o,a]),o.length?(0,Jr.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,Jr.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${n*100}%)`,width:`${o.length*100}%`},children:o.map(i=>(0,Jr.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,Jr.jsx)(bu,{config:i,surface:"wheel",telemetry:a})},i.id))}),(0,Jr.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((i,s)=>(0,Jr.jsx)("button",{type:"button",style:{height:"0.5rem",width:"1.5rem",borderRadius:"9999px",background:s===n?"var(--sc-color-primary)":"var(--sc-tile-text-color)",border:"none",cursor:"pointer",padding:0},onClick:()=>r(s)},i.id))})]}):null}function Su(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function I5(t){let e=[],a=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let n=t;if(n.tiles||a.push("Config missing required field: tiles"),n.actions||a.push("Config missing required field: actions"),n.fetchedAt||a.push("Config missing required field: fetchedAt"),a.length>0)return{valid:!1,errors:a,warnings:e};let r=n.schemaVersion||"1.0",o=Su(r),i=Su(Zr);return o.major>i.major&&e.push(`Config schema v${r} is newer than SDK v${Zr}. Some features may not work. Update SDK to latest version.`),o.major<i.major||!n.schemaVersion?(e.push(`Config schema v${r} is older than SDK v${Zr}. Migrating config to current version.`),{valid:!0,warnings:e,errors:a,migratedConfig:TB(n,r)}):{valid:!0,warnings:e,errors:a}}function TB(t,e){let a={...t};return Su(e).major===1&&(a=RB(a)),a.schemaVersion=Zr,a}function RB(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 n={...a};return a.experiment&&delete n.experiment,n})),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 A5(t){if(!t||typeof t!="object")return!1;let e=t,a=e.schemaVersion||"1.0",n=Su(a),r=Su(Zr);return n.major<r.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 Qv(t){let e=2166136261,a=t.length;for(let n=0;n<a;n++)e^=t.charCodeAt(n),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function Cu(t,e,a){return a===2?Qv(Qv(t+e)+"")%1e4/1e4:a===1?Qv(e+t)%1e3/1e3:null}function MB(t){return t<=0?[]:new Array(t).fill(1/t)}function Pf(t,e){return t>=e[0]&&t<e[1]}function v1(t,e){let a=Cu("__"+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(Pf(t,e[a]))return a;return-1}function ey(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function Ff(t,e){if(!e.length)return!1;let a=!1,n=!1;for(let r=0;r<e.length;r++){let o=BB(t,e[r].type,e[r].pattern);if(e[r].include===!1){if(o)return!1}else a=!0,o&&(n=!0)}return n||!a}function DB(t,e,a){try{let n=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return a&&(n="\\/?"+n.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+n+"$","i").test(t)}catch{return!1}}function OB(t,e){try{let a=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),n=[[t.host,a.host,!1],[t.pathname,a.pathname,!0]];return a.hash&&n.push([t.hash,a.hash,!1]),a.searchParams.forEach((r,o)=>{n.push([t.searchParams.get(o)||"",r,!1])}),!n.some(r=>!DB(r[0],r[1],r[2]))}catch{return!1}}function BB(t,e,a){try{let n=new URL(t,"https://_");if(e==="regex"){let r=ey(a);return r?r.test(n.href)||r.test(n.href.substring(n.origin.length)):!1}else if(e==="simple")return OB(n,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 n=MB(t);a=a||n,a.length!==t&&(a=n);let r=a.reduce((i,s)=>s+i,0);(r<.99||r>1.01)&&(a=n);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 n=e.split("?")[1];if(!n)return null;let r=n.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return r.length>0&&r[0]>=0&&r[0]<a?r[0]:null}function S1(t){try{return t()}catch(e){return console.error(e),!1}}var Jv=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function Yo(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 n=await a.importKey("raw",Jv(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[r,o]=t.split("."),i=await a.decrypt({name:"AES-CBC",iv:Jv(r)},n,Jv(o));return new TextDecoder().decode(i)}catch{throw new Error("Failed to decrypt")}}function _u(t){return typeof t=="string"?t:JSON.stringify(t)}function xa(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,n;try{a=new URL(t),n=new URL(e)}catch(r){return console.error(`Unable to merge query strings: ${r}`),e}return a.searchParams.forEach((r,o)=>{n.searchParams.has(o)||n.searchParams.set(o,r)}),n.toString()}function h1(t){return typeof t=="object"&&t!==null}function Nf(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 Hf(t,e){return new Promise(a=>{let n=!1,r,o=i=>{n||(n=!0,r&&clearTimeout(r),a(i||null))};e&&(r=setTimeout(()=>o(),e)),t.then(i=>o(i)).catch(()=>o())})}var Dt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},gn=g1(),Cs={fetchFeaturesCall:({host:t,clientKey:e,headers:a})=>gn.fetch(`${t}/api/features/${e}`,{headers:a}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:a,headers:n})=>{let r={method:"POST",headers:{"Content-Type":"application/json",...n},body:JSON.stringify(a)};return gn.fetch(`${t}/api/eval/${e}`,r)},eventSourceCall:({host:t,clientKey:e,headers:a})=>a?new gn.EventSource(`${t}/sub/${e}`,{headers:a}):new gn.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let a=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),NB()):document.visibilityState==="hidden"&&(t=window.setTimeout(FB,Dt.idleStreamInterval))};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(gn.localStorage=globalThis.localStorage)}catch{}var _s=new Map,w1=!1,tr=new Map,Uf=new Map,ws=new Map,Ls=new Set;function k1(t){Object.assign(Dt,t),Dt.backgroundSync||iy()}async function I1({instance:t,timeout:e,skipCache:a,allowStale:n,backgroundSync:r}){return r||(Dt.backgroundSync=!1),HB({instance:t,allowStale:n,timeout:e,skipCache:a})}function PB(t){let e=wu(t),a=_s.get(e)||new Set;a.add(t),_s.set(e,a)}function A1(t){_s.forEach(e=>e.delete(t))}function FB(){ws.forEach(t=>{t&&(t.state="idle",ry(t))})}function NB(){ws.forEach(t=>{t&&t.state==="idle"&&oy(t)})}async function L1(){try{if(!gn.localStorage)return;await gn.localStorage.setItem(Dt.cacheKey,JSON.stringify(Array.from(tr.entries())))}catch{}}async function HB({instance:t,allowStale:e,timeout:a,skipCache:n}){let r=wu(t),o=ay(t),i=new Date,s=new Date(i.getTime()-Dt.maxAge+Dt.staleTTL);await UB();let l=!Dt.disableCache&&!n?tr.get(o):void 0;return l&&(e||l.staleAt>i)&&l.staleAt>s?(l.sse&&Ls.add(r),l.staleAt<i?ty(t):ny(t),{data:l.data,success:!0,source:"cache"}):await Hf(ty(t),a)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function wu(t){let[e,a]=t.getApiInfo();return`${e}||${a}`}function ay(t){let e=wu(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let a=t.getAttributes(),n=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),r={};n.forEach(s=>{r[s]=a[s]});let o=t.getForcedVariations(),i=t.getUrl();return`${e}||${JSON.stringify({ca:r,fv:o,url:i})}`}async function UB(){if(!w1){w1=!0;try{if(gn.localStorage){let t=await gn.localStorage.getItem(Dt.cacheKey);if(!Dt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([a,n])=>{tr.set(a,{...n,staleAt:new Date(n.staleAt)})}),E1()}}}catch{}if(!Dt.disableIdleStreams){let t=Cs.startIdleListener();t&&(Cs.stopIdleListener=t)}}}function E1(){let t=Array.from(tr.entries()).map(([a,n])=>({key:a,staleAt:n.staleAt.getTime()})).sort((a,n)=>a.staleAt-n.staleAt),e=Math.min(Math.max(0,tr.size-Dt.maxEntries),tr.size);for(let a=0;a<e;a++)tr.delete(t[a].key)}function T1(t,e,a){let n=a.dateUpdated||"",r=new Date(Date.now()+Dt.staleTTL),o=Dt.disableCache?void 0:tr.get(e);if(o&&n&&o.version===n){o.staleAt=r,L1();return}Dt.disableCache||(tr.set(e,{data:a,version:n,staleAt:r,sse:Ls.has(t)}),E1()),L1();let i=_s.get(t);i&&i.forEach(s=>zB(s,a))}async function zB(t,e){await t.setPayload(e||t.getPayload())}async function ty(t){let{apiHost:e,apiRequestHeaders:a}=t.getApiHosts(),n=t.getClientKey(),r="isRemoteEval"in t&&t.isRemoteEval(),o=wu(t),i=ay(t),s=Uf.get(i);return s||(s=(r?Cs.fetchRemoteEvalCall({host:e,clientKey:n,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:a}):Cs.fetchFeaturesCall({host:e,clientKey:n,headers:a})).then(u=>{if(!u.ok)throw new Error(`HTTP error: ${u.status}`);return u.headers.get("x-sse-support")==="enabled"&&Ls.add(o),u.json()}).then(u=>(T1(o,i,u),ny(t),Uf.delete(i),{data:u,success:!0,source:"network"})).catch(u=>(Uf.delete(i),{data:null,source:"error",success:!1,error:u})),Uf.set(i,s)),s}function ny(t,e=!1){let a=wu(t),n=ay(t),{streamingHost:r,streamingHostRequestHeaders:o}=t.getApiHosts(),i=t.getClientKey();if(e&&Ls.add(a),Dt.backgroundSync&&Ls.has(a)&&gn.EventSource){if(ws.has(a))return;let s={src:null,host:r,clientKey:i,headers:o,cb:l=>{try{if(l.type==="features-updated"){let u=_s.get(a);u&&u.forEach(c=>{ty(c)})}else if(l.type==="features"){let u=JSON.parse(l.data);T1(a,n,u)}s.errors=0}catch{R1(s)}},errors:0,state:"active"};ws.set(a,s),oy(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);ry(t),setTimeout(()=>{["idle","active"].includes(t.state)||oy(t)},Math.min(e,3e5))}}function ry(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function oy(t){t.src=Cs.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 qB(t,e){ry(t),ws.delete(e)}function iy(){Ls.clear(),ws.forEach(qB),_s.clear(),Cs.stopIdleListener()}function zf(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&ny(t,!0),PB(t)}}var $B=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,uy={revert:function(){}},jf=new Map,cy=new Set;function VB(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function Gf(t){var e=jf.get(t);return e||(e={element:t,attributes:{}},jf.set(t,e)),e}function Zf(t,e,a,n,r){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,r(i))}}),mutationRunner:r,setValue:n,getCurrentValue:a};return e==="position"&&t.parentNode?i.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):i.observer.observe(t,VB(e)),i}function Wf(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 jB(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),Wf(oP(e),t)}function GB(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(a){return a.mutate(e)}),Wf(Array.from(e).filter(Boolean).join(" "),t)}function ZB(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),Wf(e,t)}function WB(t){var e=t.parentSelector,a=t.insertBeforeSelector,n=document.querySelector(e);if(!n)return null;var r=a?document.querySelector(a):null;return a&&!r?null:{parentNode:n,insertBeforeNode:r}}function XB(t){var e=t.originalValue;t.mutations.forEach(function(a){var n=a.mutate(),r=WB(n);e=r||e}),Wf(e,t)}var YB=function(e){return e.innerHTML},KB=function(e,a){return e.innerHTML=a};function O1(t){var e=Gf(t);return e.html||(e.html=Zf(t,"html",YB,KB,jB)),e.html}var QB=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},JB=function(e,a){a.insertBeforeNode&&!a.parentNode.contains(a.insertBeforeNode)||a.parentNode.insertBefore(e,a.insertBeforeNode)};function B1(t){var e=Gf(t);return e.position||(e.position=Zf(t,"position",QB,JB,XB)),e.position}var eP=function(e,a){return a?e.className=a:e.removeAttribute("class")},tP=function(e){return e.className};function P1(t){var e=Gf(t);return e.classes||(e.classes=Zf(t,"class",tP,eP,GB)),e.classes}var aP=function(e){return function(a){var n;return(n=a.getAttribute(e))!=null?n:null}},nP=function(e){return function(a,n){return n!==null?a.setAttribute(e,n):a.removeAttribute(e)}};function F1(t,e){var a=Gf(t);return a.attributes[e]||(a.attributes[e]=Zf(t,e,aP(e),nP(e),ZB)),a.attributes[e]}function rP(t,e){var a=jf.get(t);if(a)if(e==="html"){var n,r;(n=a.html)==null||(r=n.observer)==null||r.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 qf;function oP(t){return qf||(qf=document.createElement("div")),qf.innerHTML=t,qf.innerHTML}function $f(t,e,a){if(a.isDirty){a.isDirty=!1;var n=a.virtualValue;a.mutations.length||rP(t,e),a.setValue(t,n)}}function iP(t,e){t.html&&$f(e,"html",t.html),t.classes&&$f(e,"class",t.classes),t.position&&$f(e,"position",t.position),Object.keys(t.attributes).forEach(function(a){$f(e,a,t.attributes[a])})}function M1(){jf.forEach(iP)}function sP(t,e){var a=null;t.kind==="html"?a=O1(e):t.kind==="class"?a=P1(e):t.kind==="attribute"?a=F1(e,t.attribute):t.kind==="position"&&(a=B1(e)),a&&(a.mutations.push(t),a.mutationRunner(a))}function lP(t,e){var a=null;if(t.kind==="html"?a=O1(e):t.kind==="class"?a=P1(e):t.kind==="attribute"?a=F1(e,t.attribute):t.kind==="position"&&(a=B1(e)),!!a){var n=a.mutations.indexOf(t);n!==-1&&a.mutations.splice(n,1),a.mutationRunner(a)}}function N1(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),a=document.querySelectorAll(t.selector);a.forEach(function(n){e.has(n)||(t.elements.add(n),sP(t,n))})}}function uP(t){t.elements.forEach(function(e){return lP(t,e)}),t.elements.clear(),cy.delete(t)}function D1(){cy.forEach(N1)}var sy;function cP(){typeof document>"u"||(sy||(sy=new MutationObserver(function(){D1()})),D1(),sy.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}cP();function Xf(t){return typeof document>"u"?uy:(cy.add(t),N1(t),{revert:function(){uP(t)}})}function ly(t,e){return Xf({kind:"html",elements:new Set,mutate:e,selector:t})}function H1(t,e){return Xf({kind:"position",elements:new Set,mutate:e,selector:t})}function Lu(t,e){return Xf({kind:"class",elements:new Set,mutate:e,selector:t})}function Vf(t,e,a){return $B.test(e)?e==="class"||e==="className"?Lu(t,function(n){var r=a(Array.from(n).join(" "));n.clear(),r&&r.split(/\s+/g).filter(Boolean).forEach(function(o){return n.add(o)})}):Xf({kind:"attribute",attribute:e,elements:new Set,mutate:a,selector:t}):uy}function dP(t){var e=t.selector,a=t.action,n=t.value,r=t.attribute,o=t.parentSelector,i=t.insertBeforeSelector;if(r==="html"){if(a==="append")return ly(e,function(s){return s+(n??"")});if(a==="set")return ly(e,function(){return n??""})}else if(r==="class"){if(a==="append")return Lu(e,function(s){n&&s.add(n)});if(a==="remove")return Lu(e,function(s){n&&s.delete(n)});if(a==="set")return Lu(e,function(s){s.clear(),n&&s.add(n)})}else if(r==="position"){if(a==="set"&&o)return H1(e,function(){return{insertBeforeSelector:i,parentSelector:o}})}else{if(a==="append")return Vf(e,r,function(s){return s!==null?s+(n??""):n??""});if(a==="set")return Vf(e,r,function(){return n??""});if(a==="remove")return Vf(e,r,function(){return null})}return uy}var fP={html:ly,classes:Lu,attribute:Vf,position:H1,declarative:dP},U1=fP;var dy={};function to(t,e,a){a=a||{};for(let[n,r]of Object.entries(e))switch(n){case"$or":if(!$1(t,r,a))return!1;break;case"$nor":if($1(t,r,a))return!1;break;case"$and":if(!vP(t,r,a))return!1;break;case"$not":if(to(t,r,a))return!1;break;default:if(!ku(r,pP(t,n),a))return!1}return!0}function pP(t,e){let a=e.split("."),n=t;for(let r=0;r<a.length;r++)if(n&&typeof n=="object"&&a[r]in n)n=n[a[r]];else return null;return n}function z1(t,e=!1){let a=`${t}${e?"/i":""}`;return dy[a]||(dy[a]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),dy[a]}function ku(t,e,a,n=!1){if(typeof t=="string")return n?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)||!V1(t))return JSON.stringify(e)===JSON.stringify(t);for(let r in t)if(!gP(r,e,t[r],a))return!1;return!0}function V1(t){let e=Object.keys(t);return e.length>0&&e.filter(a=>a[0]==="$").length===e.length}function hP(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 mP(t,e,a){if(!Array.isArray(t))return!1;let n=V1(e)?r=>ku(e,r,a):r=>to(r,e,a);for(let r=0;r<t.length;r++)if(t[r]&&n(t[r]))return!0;return!1}function ks(t,e,a=!1){if(a){let n=r=>typeof r=="string"?r.toLowerCase():r;return Array.isArray(t)?t.some(r=>e.some(o=>n(r)===n(o))):e.some(r=>n(t)===n(r))}return Array.isArray(t)?t.some(n=>e.includes(n)):e.includes(t)}function q1(t,e,a,n=!1){if(!Array.isArray(t))return!1;for(let r=0;r<e.length;r++){let o=!1;for(let i=0;i<t.length;i++)if(ku(e[r],t[i],a,n)){o=!0;break}if(!o)return!1}return!0}function gP(t,e,a,n){switch(t){case"$veq":return xa(e)===xa(a);case"$vne":return xa(e)!==xa(a);case"$vgt":return xa(e)>xa(a);case"$vgte":return xa(e)>=xa(a);case"$vlt":return xa(e)<xa(a);case"$vlte":return xa(e)<=xa(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)?ks(e,a):!1;case"$ini":return Array.isArray(a)?ks(e,a,!0):!1;case"$inGroup":return ks(e,n[a]||[]);case"$notInGroup":return!ks(e,n[a]||[]);case"$nin":return Array.isArray(a)?!ks(e,a):!1;case"$nini":return Array.isArray(a)?!ks(e,a,!0):!1;case"$not":return!ku(a,e,n);case"$size":return Array.isArray(e)?ku(a,e.length,n):!1;case"$elemMatch":return mP(e,a,n);case"$all":return Array.isArray(a)?q1(e,a,n):!1;case"$alli":return Array.isArray(a)?q1(e,a,n,!0):!1;case"$regex":try{return z1(a).test(e)}catch{return!1}case"$regexi":try{return z1(a,!0).test(e)}catch{return!1}case"$type":return hP(e)===a;default:return console.error("Unknown operator: "+t),!1}}function $1(t,e,a){if(!e.length)return!0;for(let n=0;n<e.length;n++)if(to(t,e[n],a))return!0;return!1}function vP(t,e,a){for(let n=0;n<e.length;n++)if(!to(t,e[n],a))return!1;return!0}var yP="Feature Evaluated",xP="Experiment Viewed";function bP(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((a,n)=>e.set(n,a)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((a,n)=>e.set(n,a)),e}function SP(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 Is(t){try{await t()}catch{}}function j1(t,e,a){if(t.user.trackedExperiments){let r=Qf(e,a);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:a,timestamp:Date.now().toString(),logType:"experiment"});let n=[];if(t.global.trackingCallback){let r=t.global.trackingCallback;n.push(Is(()=>r(e,a,t.user)))}if(t.user.trackingCallback){let r=t.user.trackingCallback;n.push(Is(()=>r(e,a)))}if(t.global.eventLogger){let r=t.global.eventLogger;n.push(Is(()=>r(xP,{experimentId:e.key,variationId:a.key,hashAttribute:a.hashAttribute,hashValue:a.hashValue},t.user)))}return n}function CP(t,e,a){if(t.user.trackedFeatureUsage){let n=JSON.stringify(a.value);if(t.user.trackedFeatureUsage[e]===n)return;t.user.trackedFeatureUsage[e]=n,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 n=t.global.onFeatureUsage;Is(()=>n(e,a,t.user))}if(t.user.onFeatureUsage){let n=t.user.onFeatureUsage;Is(()=>n(e,a))}if(t.global.eventLogger){let n=t.global.eventLogger;Is(()=>n(yP,{feature:e,source:a.source,value:a.value,ruleId:a.source==="defaultValue"?"$default":a.ruleId||"",variationId:a.experimentResult?a.experimentResult.key:""},t.user))}}function Yf(t,e){if(e.stack.evaluatedFeatures.has(t))return ao(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let a=bP(e);if(a.has(t))return ao(e,t,a.get(t),"override");if(!e.global.features||!e.global.features[t])return ao(e,t,null,"unknownFeature");let n=e.global.features[t];if(n.rules){let r=new Set(e.stack.evaluatedFeatures);e:for(let o of n.rules){if(o.parentConditions)for(let l of o.parentConditions){e.stack.evaluatedFeatures=new Set(r);let u=Yf(l.id,e);if(u.source==="cyclicPrerequisite")return ao(e,t,null,"cyclicPrerequisite");let c={value:u.value};if(!to(c,l.condition||{})){if(l.gate)return ao(e,t,null,"prerequisite");continue e}}if(o.filters&&W1(o.filters,e))continue;if("force"in o){if(o.condition&&!Z1(o.condition,e)||!_P(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})}),ao(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}=Kf(i,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(i,s),s.inExperiment&&!s.passthrough)return ao(e,t,s.value,"experiment",o.id,i,s)}}return ao(e,t,n.defaultValue===void 0?null:n.defaultValue,"defaultValue")}function Kf(t,e,a){let n=t.key,r=t.variations.length;if(r<2)return{result:Ge(a,t,-1,!1,e)};if(a.global.enabled===!1||a.user.enabled===!1)return{result:Ge(a,t,-1,!1,e)};if(t=wP(t,a),t.urlPatterns&&!Ff(a.user.url||"",t.urlPatterns))return{result:Ge(a,t,-1,!1,e)};let o=b1(n,a.user.url||"",r);if(o!==null)return{result:Ge(a,t,o,!1,e)};let i=SP(a);if(n in i){let x=i[n];return{result:Ge(a,t,x,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:Ge(a,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=Ko(a,t.hashAttribute,a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:Ge(a,t,-1,!1,e)};let u=-1,c=!1,d=!1;if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:x,versionIsBlocked:p}=IP({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=!!p}if(!c){if(t.filters){if(W1(t.filters,a))return{result:Ge(a,t,-1,!1,e)}}else if(t.namespace&&!v1(l,t.namespace))return{result:Ge(a,t,-1,!1,e)};if(t.include&&!S1(t.include))return{result:Ge(a,t,-1,!1,e)};if(t.condition&&!Z1(t.condition,a))return{result:Ge(a,t,-1,!1,e)};if(t.parentConditions){let x=new Set(a.stack.evaluatedFeatures);for(let p of t.parentConditions){a.stack.evaluatedFeatures=new Set(x);let g=Yf(p.id,a);if(g.source==="cyclicPrerequisite")return{result:Ge(a,t,-1,!1,e)};let v={value:g.value};if(!to(v,p.condition||{}))return{result:Ge(a,t,-1,!1,e)}}}if(t.groups&&!kP(t.groups,a))return{result:Ge(a,t,-1,!1,e)}}if(t.url&&!LP(t.url,a))return{result:Ge(a,t,-1,!1,e)};let f=Cu(t.seed||n,l,t.hashVersion||1);if(f===null)return{result:Ge(a,t,-1,!1,e)};if(!c){let x=t.ranges||x1(r,t.coverage===void 0?1:t.coverage,t.weights);u=y1(f,x)}if(d)return{result:Ge(a,t,-1,!1,e,void 0,!0)};if(u<0)return{result:Ge(a,t,-1,!1,e)};if("force"in t)return{result:Ge(a,t,t.force===void 0?-1:t.force,!1,e)};if(a.global.qaMode||a.user.qaMode)return{result:Ge(a,t,-1,!1,e)};if(t.status==="stopped")return{result:Ge(a,t,-1,!1,e)};let m=Ge(a,t,u,!0,e,f,c);if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:x,key:p,doc:g}=EP(a,s,_u(l),{[fy(t.key,t.bucketVersion)]:m.key});x&&(a.user.stickyBucketAssignmentDocs=a.user.stickyBucketAssignmentDocs||{},a.user.stickyBucketAssignmentDocs[p]=g,a.user.saveStickyBucketAssignmentDoc(g))}let S=j1(a,t,m);S.length===0&&a.global.saveDeferredTrack&&a.global.saveDeferredTrack({experiment:t,result:m});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:m,trackingCall:b}}function ao(t,e,a,n,r,o,i){let s={value:a,on:!!a,off:!a,source:n,ruleId:r||""};return o&&(s.experiment=o),i&&(s.experimentResult=i),n!=="override"&&CP(t,e,s),s}function G1(t){return{...t.user.attributes,...t.user.attributeOverrides}}function Z1(t,e){return to(G1(e),t,e.global.savedGroups||{})}function W1(t,e){return t.some(a=>{let{hashValue:n}=Ko(e,a.attribute);if(!n)return!0;let r=Cu(a.seed,n,a.hashVersion||2);return r===null?!0:!a.ranges.some(o=>Pf(r,o))})}function _P(t,e,a,n,r,o,i){if(!r&&o===void 0)return!0;if(!r&&o===0)return!1;let{hashValue:s}=Ko(t,a,n);if(!s)return!1;let l=Cu(e,s,i||1);return l===null?!1:r?Pf(l,r):o!==void 0?l<=o:!0}function Ge(t,e,a,n,r,o,i){let s=!0;(a<0||a>=e.variations.length)&&(a=0,s=!1);let{hashAttribute:l,hashValue:u}=Ko(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),c=e.meta?e.meta[a]:{},d={key:c.key||""+a,featureId:r,inExperiment:s,hashUsed:n,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 wP(t,e){let a=t.key,n=e.global.overrides;return n&&n[a]&&(t=Object.assign({},t,n[a]),typeof t.url=="string"&&(t.url=ey(t.url))),t}function Ko(t,e,a){let n=e||"id",r="",o=G1(t);return o[n]&&(r=o[n]),!r&&a&&(o[a]&&(r=o[a]),r&&(n=a)),{hashAttribute:n,hashValue:r}}function LP(t,e){let a=e.user.url;if(!a)return!1;let n=a.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(a)||t.test(n))}function kP(t,e){let a=e.global.groups||{};for(let n=0;n<t.length;n++)if(a[t[n]])return!0;return!1}function IP({ctx:t,expKey:e,expBucketVersion:a,expHashAttribute:n,expFallbackAttribute:r,expMinBucketVersion:o,expMeta:i}){a=a||0,o=o||0,n=n||"id",i=i||[];let s=fy(e,a),l=AP(t,n,r);if(o>0)for(let d=0;d<o;d++){let f=fy(e,d);if(l[f]!==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 fy(t,e){return e=e||0,`${t}__${e}`}function py(t,e){return`${t}||${e}`}function AP(t,e,a){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:n,hashValue:r}=Ko(t,e),o=py(n,_u(r)),{hashAttribute:i,hashValue:s}=Ko(t,a),l=s?py(i,_u(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 EP(t,e,a,n){let r=py(e,a),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[r]?t.user.stickyBucketAssignmentDocs[r].assignments||{}:{},i={...o,...n},s=JSON.stringify(o)!==JSON.stringify(i);return{key:r,doc:{attributeName:e,attributeValue:a,assignments:i},changed:s}}function TP(t,e){let a=new Set,n=e&&e.features?e.features:t.global.features||{},r=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(n).forEach(o=>{let i=n[o];if(i.rules)for(let s of i.rules)s.variations&&(a.add(s.hashAttribute||"id"),s.fallbackAttribute&&a.add(s.fallbackAttribute))}),r.map(o=>{a.add(o.hashAttribute||"id"),o.fallbackAttribute&&a.add(o.fallbackAttribute)}),Array.from(a)}async function X1(t,e,a){let n=hy(t,a);return e.getAllAssignments(n)}function hy(t,e){let a={};return TP(t,e).forEach(r=>{let{hashValue:o}=Ko(t,r);a[r]=_u(o)}),a}async function Y1(t,e,a){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await Yo(t.encryptedFeatures,e,a))}catch(n){console.error(n)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await Yo(t.encryptedExperiments,e,a))}catch(n){console.error(n)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await Yo(t.encryptedSavedGroups,e,a))}catch(n){console.error(n)}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 Qf(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var As=typeof window<"u"&&typeof document<"u",RP=C1(),Iu=class{constructor(e){if(e=e||{},this.version=RP,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=n=>a.saveAssignments(n)}if(e.plugins)for(let a of e.plugins)a(this);if(e.features&&(this.ready=!0),As&&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 n=this._options.stickyBucketAssignmentDocs[a];n&&this._options.stickyBucketService.saveAssignments(n).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,zf(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&k1(e.cacheSettings),e.payload)return await this.setPayload(e.payload),zf(this,e),{success:!0,source:"init"};{let{data:a,...n}=await this._refresh({...e,allowStale:!0});return zf(this,e),await this.setPayload(a||{}),n}}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:n,streaming:r}){if(!this._options.clientKey)throw new Error("Missing clientKey");return I1({instance:this,timeout:e,skipCache:a||this._options.disableCache,allowStale:n,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,a,n){let r=await Yo(e,a||this._options.decryptionKey,n);this.setFeatures(JSON.parse(r))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,a,n){let r=await Yo(e,a||this._options.decryptionKey,n);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(a=>{try{a()}catch(n){console.error(n)}}),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,A1(this),e.destroyAllStreams&&iy(),this.logs=[],As&&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}=Kf(e,null,this._getEvalContext());return this._onExperimentEval(e,a),a}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(n=>n.key===e).map(n=>this._runAutoExperiment(n)).filter(n=>n!==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 n=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!n)return null;let r=this._isAutoExperimentBlockedByContext(e),o,i;r?o=Ge(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:i}=Kf(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let s=JSON.stringify(o.value);if(!a&&o.inExperiment&&n&&n.valueHash===s)return o;if(n&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=Nf(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let u=e.persistQueryString?_1(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(Ff(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(As)Promise.all([...i?[Hf(i,this._options.maxNavigateDelay??1e3)]:[],new Promise(f=>window.setTimeout(f,this._options.navigateDelay??d))]).then(()=>{try{c(u)}catch(f){console.error(f)}});else try{c(u)}catch(f){console.error(f)}}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||[],n=new Set(a);this._activeAutoExperiments.forEach((r,o)=>{n.has(o)||(r.undo(),this._activeAutoExperiments.delete(o))});for(let r of a){let o=this._runAutoExperiment(r,e);if(o&&o.inExperiment&&Nf(r)==="redirect")break}}_onExperimentEval(e,a){let n=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:a}),this._subscriptions.size>0&&this._fireSubscriptions(e,a,n)}_fireSubscriptions(e,a,n){(!n||n.result.inExperiment!==a.inExperiment||n.result.variationId!==a.variationId)&&this._subscriptions.forEach(r=>{try{r(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 n=this.evalFeature(e).value;return n===null?a:n}feature(e){return this.evalFeature(e)}evalFeature(e){return Yf(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=>[Qf(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(n){console.error(n)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(Qf(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(As?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let a=Nf(e);if(a==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(n=>n.js))return!0}else if(a==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let n=new URL(this._getContextUrl());for(let r of e.variations){if(!r||!r.urlRedirect)continue;let o=new URL(r.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(o.protocol!==n.protocol||o.host!==n.host))return!0}}catch(n){return this.log("Error parsing current or redirect URL",{id:e.key,error:n}),!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}:As?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!As)return;let a=[];if(e.css){let n=document.createElement("style");n.innerHTML=e.css,document.head.appendChild(n),a.push(()=>n.remove())}if(e.js){let n=document.createElement("script");n.innerHTML=e.js,this._options.jsInjectionNonce&&(n.nonce=this._options.jsInjectionNonce),document.head.appendChild(n),a.push(()=>n.remove())}return e.domMutations&&e.domMutations.forEach(n=>{a.push(U1.declarative(n).revert)}),()=>{a.forEach(n=>n())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let a=this._getEvalContext(),n=await X1(a,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=n}}generateStickyBucketAssignmentDocsSync(e,a){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let n=this._getEvalContext(),r=hy(n,a);return e.getAllAssignmentsSync(r)}inDevMode(){return!!this._options.enableDevMode}};var MP="https://experiment.syntrologie.com",my=class{constructor(e={}){B(this,"gb");B(this,"featureListeners",new Set);if(e.client)this.gb=e.client;else{let a=e.onExperimentViewed?(n,r)=>{e.onExperimentViewed(n.key,r.variationId,typeof r.value=="string"?r.value:`variation_${r.variationId}`)}:void 0;this.gb=new Iu({...e,apiHost:e.apiHost??MP,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({...this.gb.getAttributes(),...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 n of Object.keys(e))a[n]=this.gb.getFeatureValue(n,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 gy(t={}){return new my(t)}var Q1="syntro_session_metrics",Jf=class{constructor(e={}){B(this,"metrics",new Map);B(this,"experiments");B(this,"attributePrefix");B(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,a=1){let r=(this.metrics.get(e)??0)+a;return this.metrics.set(e,r),this.saveToStorage(),this.updateExperimentAttributes(e,r),this.onMetricChange?.(e,r),r}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 n of e)a[`${this.attributePrefix}${n}`]=0,this.onMetricChange?.(n,0);this.experiments?.setAttributes?.(a)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,a){if(!this.experiments?.setAttributes)return;let n=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[n]:a})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[a,n]of this.metrics)e[`${this.attributePrefix}${a}`]=n;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[n,r]of Object.entries(a))this.metrics.set(n,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[a,n]of this.metrics)e[a]={count:n,lastUpdated:Date.now()};sessionStorage.setItem(Q1,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function vy(t={}){return new Jf(t)}var h={};AT(h,{BRAND:()=>rF,DIRTY:()=>Qo,EMPTY_PATH:()=>PP,INVALID:()=>Q,NEVER:()=>qF,OK:()=>Ot,ParseStatus:()=>kt,Schema:()=>le,ZodAny:()=>oo,ZodArray:()=>or,ZodBigInt:()=>ei,ZodBoolean:()=>ti,ZodBranded:()=>Eu,ZodCatch:()=>fi,ZodDate:()=>ai,ZodDefault:()=>di,ZodDiscriminatedUnion:()=>ap,ZodEffects:()=>Na,ZodEnum:()=>ui,ZodError:()=>ta,ZodFirstPartyTypeKind:()=>J,ZodFunction:()=>rp,ZodIntersection:()=>ii,ZodIssueCode:()=>O,ZodLazy:()=>si,ZodLiteral:()=>li,ZodMap:()=>Os,ZodNaN:()=>Ps,ZodNativeEnum:()=>ci,ZodNever:()=>an,ZodNull:()=>ri,ZodNullable:()=>xn,ZodNumber:()=>Jo,ZodObject:()=>aa,ZodOptional:()=>Pa,ZodParsedType:()=>j,ZodPipeline:()=>Tu,ZodPromise:()=>io,ZodReadonly:()=>pi,ZodRecord:()=>np,ZodSchema:()=>le,ZodSet:()=>Bs,ZodString:()=>ro,ZodSymbol:()=>Ms,ZodTransformer:()=>Na,ZodTuple:()=>yn,ZodType:()=>le,ZodUndefined:()=>ni,ZodUnion:()=>oi,ZodUnknown:()=>rr,ZodVoid:()=>Ds,addIssueToContext:()=>H,any:()=>pF,array:()=>vF,bigint:()=>lF,boolean:()=>uI,coerce:()=>zF,custom:()=>iI,date:()=>uF,datetimeRegex:()=>rI,defaultErrorMap:()=>ar,discriminatedUnion:()=>SF,effect:()=>DF,enum:()=>TF,function:()=>IF,getErrorMap:()=>Es,getParsedType:()=>vn,instanceof:()=>iF,intersection:()=>CF,isAborted:()=>ep,isAsync:()=>Ts,isDirty:()=>tp,isValid:()=>no,late:()=>oF,lazy:()=>AF,literal:()=>EF,makeIssue:()=>Au,map:()=>LF,nan:()=>sF,nativeEnum:()=>RF,never:()=>mF,null:()=>fF,nullable:()=>BF,number:()=>lI,object:()=>yF,objectUtil:()=>yy,oboolean:()=>UF,onumber:()=>HF,optional:()=>OF,ostring:()=>NF,pipeline:()=>FF,preprocess:()=>PF,promise:()=>MF,quotelessJson:()=>DP,record:()=>wF,set:()=>kF,setErrorMap:()=>BP,strictObject:()=>xF,string:()=>sI,symbol:()=>cF,transformer:()=>DF,tuple:()=>_F,undefined:()=>dF,union:()=>bF,unknown:()=>hF,util:()=>de,void:()=>gF});var de;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function a(r){throw new Error}t.assertNever=a,t.arrayToEnum=r=>{let o={};for(let i of r)o[i]=i;return o},t.getValidEnumValues=r=>{let o=t.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),i={};for(let s of o)i[s]=r[s];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&o.push(i);return o},t.find=(r,o)=>{for(let i of r)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,o=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(de||(de={}));var yy;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(yy||(yy={}));var j=de.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),vn=t=>{switch(typeof t){case"undefined":return j.undefined;case"string":return j.string;case"number":return Number.isNaN(t)?j.nan:j.number;case"boolean":return j.boolean;case"function":return j.function;case"bigint":return j.bigint;case"symbol":return j.symbol;case"object":return Array.isArray(t)?j.array:t===null?j.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?j.promise:typeof Map<"u"&&t instanceof Map?j.map:typeof Set<"u"&&t instanceof Set?j.set:typeof Date<"u"&&t instanceof Date?j.date:j.object;default:return j.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"]),DP=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ta=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};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},n={_errors:[]},r=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)n._errors.push(a(i));else{let s=n,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 r(this),n}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={},n=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];a[o]=a[o]||[],a[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:a}}get formErrors(){return this.flatten()}};ta.create=t=>new ta(t);var OP=(t,e)=>{let a;switch(t.code){case O.invalid_type:t.received===j.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}},ar=OP;var J1=ar;function BP(t){J1=t}function Es(){return J1}var Au=t=>{let{data:e,path:a,errorMaps:n,issueData:r}=t,o=[...a,...r.path||[]],i={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let s="",l=n.filter(u=>!!u).slice().reverse();for(let u of l)s=u(i,{data:e,defaultError:s}).message;return{...r,path:o,message:s}},PP=[];function H(t,e){let a=Es(),n=Au({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===ar?void 0:ar].filter(r=>!!r)});t.common.issues.push(n)}var kt=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 n=[];for(let r of a){if(r.status==="aborted")return Q;r.status==="dirty"&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,a){let n=[];for(let r of a){let o=await r.key,i=await r.value;n.push({key:o,value:i})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,a){let n={};for(let r of a){let{key:o,value:i}=r;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"||r.alwaysSet)&&(n[o.value]=i.value)}return{status:e.value,value:n}}},Q=Object.freeze({status:"aborted"}),Qo=t=>({status:"dirty",value:t}),Ot=t=>({status:"valid",value:t}),ep=t=>t.status==="aborted",tp=t=>t.status==="dirty",no=t=>t.status==="valid",Ts=t=>typeof Promise<"u"&&t instanceof Promise;var W;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(W||(W={}));var Fa=class{constructor(e,a,n,r){this._cachedPath=[],this.parent=e,this.data=a,this._path=n,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}},eI=(t,e)=>{if(no(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 ta(t.common.issues);return this._error=a,this._error}}};function se(t){if(!t)return{};let{errorMap:e,invalid_type_error:a,required_error:n,description:r}=t;if(e&&(a||n))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:(i,s)=>{let{message:l}=t;return i.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:l??a??s.defaultError}},description:r}}var le=class{get description(){return this._def.description}_getType(e){return vn(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:vn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new kt,ctx:{common:e.parent.common,data:e.data,parsedType:vn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let a=this._parse(e);if(Ts(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 n=this.safeParse(e,a);if(n.success)return n.data;throw n.error}safeParse(e,a){let n={common:{issues:[],async:a?.async??!1,contextualErrorMap:a?.errorMap},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vn(e)},r=this._parseSync({data:e,path:n.path,parent:n});return eI(n,r)}"~validate"(e){let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vn(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:a});return no(n)?{value:n.value}:{issues:a.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(n=>no(n)?{value:n.value}:{issues:a.common.issues})}async parseAsync(e,a){let n=await this.safeParseAsync(e,a);if(n.success)return n.data;throw n.error}async safeParseAsync(e,a){let n={common:{issues:[],contextualErrorMap:a?.errorMap,async:!0},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vn(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(Ts(r)?r:Promise.resolve(r));return eI(n,o)}refine(e,a){let n=r=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(r):a;return this._refinement((r,o)=>{let i=e(r),s=()=>o.addIssue({code:O.custom,...n(r)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(e,a){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof a=="function"?a(n,r):a),!1))}_refinement(e){return new Na({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 Pa.create(this,this._def)}nullable(){return xn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return or.create(this)}promise(){return io.create(this,this._def)}or(e){return oi.create([this,e],this._def)}and(e){return ii.create(this,e,this._def)}transform(e){return new Na({...se(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let a=typeof e=="function"?e:()=>e;return new di({...se(this._def),innerType:this,defaultValue:a,typeName:J.ZodDefault})}brand(){return new Eu({typeName:J.ZodBranded,type:this,...se(this._def)})}catch(e){let a=typeof e=="function"?e:()=>e;return new fi({...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 Tu.create(this,e)}readonly(){return pi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},FP=/^c[^\s-]{8,}$/i,NP=/^[0-9a-z]+$/,HP=/^[0-9A-HJKMNP-TV-Z]{26}$/i,UP=/^[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,zP=/^[a-z0-9_-]{21}$/i,qP=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$P=/^[-+]?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)?)??$/,VP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",xy,GP=/^(?:(?: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])$/,ZP=/^(?:(?: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])$/,WP=/^(([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]))$/,XP=/^(([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])$/,YP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,KP=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,aI="((\\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])))",QP=new RegExp(`^${aI}$`);function nI(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 JP(t){return new RegExp(`^${nI(t)}$`)}function rI(t){let e=`${aI}T${nI(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 eF(t,e){return!!((e==="v4"||!e)&&GP.test(t)||(e==="v6"||!e)&&WP.test(t))}function tF(t,e){if(!qP.test(t))return!1;try{let[a]=t.split(".");if(!a)return!1;let n=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function aF(t,e){return!!((e==="v4"||!e)&&ZP.test(t)||(e==="v6"||!e)&&XP.test(t))}var ro=class t extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==j.string){let o=this._getOrReturnCtx(e);return H(o,{code:O.invalid_type,expected:j.string,received:o.parsedType}),Q}let n=new kt,r;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let i=e.data.length>o.value,s=e.data.length<o.value;(i||s)&&(r=this._getOrReturnCtx(e,r),i?H(r,{code:O.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&H(r,{code:O.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")VP.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"email",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")xy||(xy=new RegExp(jP,"u")),xy.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"emoji",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")UP.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"uuid",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")zP.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"nanoid",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")FP.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"cuid",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")NP.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"cuid2",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")HP.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"ulid",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),H(r,{validation:"url",code:O.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"regex",code:O.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.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)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?rI(o).test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?QP.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?JP(o).test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?$P.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"duration",code:O.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?eF(e.data,o.version)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"ip",code:O.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?tF(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"jwt",code:O.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?aF(e.data,o.version)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"cidr",code:O.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?YP.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"base64",code:O.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?KP.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"base64url",code:O.invalid_string,message:o.message}),n.dirty()):de.assertNever(o);return{status:n.value,value:e.data}}_regex(e,a,n){return this.refinement(r=>e.test(r),{validation:a,code:O.invalid_string,...W.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...W.errToObj(e)})}url(e){return this._addCheck({kind:"url",...W.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...W.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...W.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...W.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...W.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...W.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...W.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...W.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...W.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...W.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...W.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...W.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,...W.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,...W.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...W.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...W.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a?.position,...W.errToObj(a?.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...W.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...W.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...W.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...W.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...W.errToObj(a)})}nonempty(e){return this.min(1,W.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}};ro.create=t=>new ro({checks:[],typeName:J.ZodString,coerce:t?.coerce??!1,...se(t)});function nF(t,e){let a=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=a>n?a:n,o=Number.parseInt(t.toFixed(r).replace(".","")),i=Number.parseInt(e.toFixed(r).replace(".",""));return o%i/10**r}var Jo=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)!==j.number){let o=this._getOrReturnCtx(e);return H(o,{code:O.invalid_type,expected:j.number,received:o.parsedType}),Q}let n,r=new kt;for(let o of this._def.checks)o.kind==="int"?de.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?nF(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.not_finite,message:o.message}),r.dirty()):de.assertNever(o);return{status:r.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,W.toString(a))}gt(e,a){return this.setLimit("min",e,!1,W.toString(a))}lte(e,a){return this.setLimit("max",e,!0,W.toString(a))}lt(e,a){return this.setLimit("max",e,!1,W.toString(a))}setLimit(e,a,n,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:n,message:W.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:W.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:W.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:W.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:W.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:W.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:W.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:W.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:W.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:W.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 n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(a===null||n.value>a)&&(a=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(a)&&Number.isFinite(e)}};Jo.create=t=>new Jo({checks:[],typeName:J.ZodNumber,coerce:t?.coerce||!1,...se(t)});var ei=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)!==j.bigint)return this._getInvalidInput(e);let n,r=new kt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):de.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let a=this._getOrReturnCtx(e);return H(a,{code:O.invalid_type,expected:j.bigint,received:a.parsedType}),Q}gte(e,a){return this.setLimit("min",e,!0,W.toString(a))}gt(e,a){return this.setLimit("min",e,!1,W.toString(a))}lte(e,a){return this.setLimit("max",e,!0,W.toString(a))}lt(e,a){return this.setLimit("max",e,!1,W.toString(a))}setLimit(e,a,n,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:n,message:W.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:W.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:W.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:W.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:W.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:W.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}};ei.create=t=>new ei({checks:[],typeName:J.ZodBigInt,coerce:t?.coerce??!1,...se(t)});var ti=class extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==j.boolean){let n=this._getOrReturnCtx(e);return H(n,{code:O.invalid_type,expected:j.boolean,received:n.parsedType}),Q}return Ot(e.data)}};ti.create=t=>new ti({typeName:J.ZodBoolean,coerce:t?.coerce||!1,...se(t)});var ai=class t extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==j.date){let o=this._getOrReturnCtx(e);return H(o,{code:O.invalid_type,expected:j.date,received:o.parsedType}),Q}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return H(o,{code:O.invalid_date}),Q}let n=new kt,r;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):de.assertNever(o);return{status:n.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:W.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:W.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}};ai.create=t=>new ai({checks:[],coerce:t?.coerce||!1,typeName:J.ZodDate,...se(t)});var Ms=class extends le{_parse(e){if(this._getType(e)!==j.symbol){let n=this._getOrReturnCtx(e);return H(n,{code:O.invalid_type,expected:j.symbol,received:n.parsedType}),Q}return Ot(e.data)}};Ms.create=t=>new Ms({typeName:J.ZodSymbol,...se(t)});var ni=class extends le{_parse(e){if(this._getType(e)!==j.undefined){let n=this._getOrReturnCtx(e);return H(n,{code:O.invalid_type,expected:j.undefined,received:n.parsedType}),Q}return Ot(e.data)}};ni.create=t=>new ni({typeName:J.ZodUndefined,...se(t)});var ri=class extends le{_parse(e){if(this._getType(e)!==j.null){let n=this._getOrReturnCtx(e);return H(n,{code:O.invalid_type,expected:j.null,received:n.parsedType}),Q}return Ot(e.data)}};ri.create=t=>new ri({typeName:J.ZodNull,...se(t)});var oo=class extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return Ot(e.data)}};oo.create=t=>new oo({typeName:J.ZodAny,...se(t)});var rr=class extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ot(e.data)}};rr.create=t=>new rr({typeName:J.ZodUnknown,...se(t)});var an=class extends le{_parse(e){let a=this._getOrReturnCtx(e);return H(a,{code:O.invalid_type,expected:j.never,received:a.parsedType}),Q}};an.create=t=>new an({typeName:J.ZodNever,...se(t)});var Ds=class extends le{_parse(e){if(this._getType(e)!==j.undefined){let n=this._getOrReturnCtx(e);return H(n,{code:O.invalid_type,expected:j.void,received:n.parsedType}),Q}return Ot(e.data)}};Ds.create=t=>new Ds({typeName:J.ZodVoid,...se(t)});var or=class t extends le{_parse(e){let{ctx:a,status:n}=this._processInputParams(e),r=this._def;if(a.parsedType!==j.array)return H(a,{code:O.invalid_type,expected:j.array,received:a.parsedType}),Q;if(r.exactLength!==null){let i=a.data.length>r.exactLength.value,s=a.data.length<r.exactLength.value;(i||s)&&(H(a,{code:i?O.too_big:O.too_small,minimum:s?r.exactLength.value:void 0,maximum:i?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&a.data.length<r.minLength.value&&(H(a,{code:O.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&a.data.length>r.maxLength.value&&(H(a,{code:O.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),a.common.async)return Promise.all([...a.data].map((i,s)=>r.type._parseAsync(new Fa(a,i,a.path,s)))).then(i=>kt.mergeArray(n,i));let o=[...a.data].map((i,s)=>r.type._parseSync(new Fa(a,i,a.path,s)));return kt.mergeArray(n,o)}get element(){return this._def.type}min(e,a){return new t({...this._def,minLength:{value:e,message:W.toString(a)}})}max(e,a){return new t({...this._def,maxLength:{value:e,message:W.toString(a)}})}length(e,a){return new t({...this._def,exactLength:{value:e,message:W.toString(a)}})}nonempty(e){return this.min(1,e)}};or.create=(t,e)=>new or({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...se(e)});function Rs(t){if(t instanceof aa){let e={};for(let a in t.shape){let n=t.shape[a];e[a]=Pa.create(Rs(n))}return new aa({...t._def,shape:()=>e})}else return t instanceof or?new or({...t._def,type:Rs(t.element)}):t instanceof Pa?Pa.create(Rs(t.unwrap())):t instanceof xn?xn.create(Rs(t.unwrap())):t instanceof yn?yn.create(t.items.map(e=>Rs(e))):t}var aa=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)!==j.object){let u=this._getOrReturnCtx(e);return H(u,{code:O.invalid_type,expected:j.object,received:u.parsedType}),Q}let{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof an&&this._def.unknownKeys==="strip"))for(let u in r.data)i.includes(u)||s.push(u);let l=[];for(let u of i){let c=o[u],d=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Fa(r,d,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof an){let u=this._def.unknownKeys;if(u==="passthrough")for(let c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:r.data[c]}});else if(u==="strict")s.length>0&&(H(r,{code:O.unrecognized_keys,keys:s}),n.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=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Fa(r,d,r.path,c)),alwaysSet:c in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let c of l){let d=await c.key,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>kt.mergeObjectSync(n,u)):kt.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return W.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(a,n)=>{let r=this._def.errorMap?.(a,n).message??n.defaultError;return a.code==="unrecognized_keys"?{message:W.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: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 n of de.objectKeys(e))e[n]&&this.shape[n]&&(a[n]=this.shape[n]);return new t({...this._def,shape:()=>a})}omit(e){let a={};for(let n of de.objectKeys(this.shape))e[n]||(a[n]=this.shape[n]);return new t({...this._def,shape:()=>a})}deepPartial(){return Rs(this)}partial(e){let a={};for(let n of de.objectKeys(this.shape)){let r=this.shape[n];e&&!e[n]?a[n]=r:a[n]=r.optional()}return new t({...this._def,shape:()=>a})}required(e){let a={};for(let n of de.objectKeys(this.shape))if(e&&!e[n])a[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Pa;)o=o._def.innerType;a[n]=o}return new t({...this._def,shape:()=>a})}keyof(){return oI(de.objectKeys(this.shape))}};aa.create=(t,e)=>new aa({shape:()=>t,unknownKeys:"strip",catchall:an.create(),typeName:J.ZodObject,...se(e)});aa.strictCreate=(t,e)=>new aa({shape:()=>t,unknownKeys:"strict",catchall:an.create(),typeName:J.ZodObject,...se(e)});aa.lazycreate=(t,e)=>new aa({shape:t,unknownKeys:"strip",catchall:an.create(),typeName:J.ZodObject,...se(e)});var oi=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),n=this._def.options;function r(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 ta(s.ctx.common.issues));return H(a,{code:O.invalid_union,unionErrors:i}),Q}if(a.common.async)return Promise.all(n.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(r);{let o,i=[];for(let l of n){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 ta(l));return H(a,{code:O.invalid_union,unionErrors:s}),Q}}get options(){return this._def.options}};oi.create=(t,e)=>new oi({options:t,typeName:J.ZodUnion,...se(e)});var nr=t=>t instanceof si?nr(t.schema):t instanceof Na?nr(t.innerType()):t instanceof li?[t.value]:t instanceof ui?t.options:t instanceof ci?de.objectValues(t.enum):t instanceof di?nr(t._def.innerType):t instanceof ni?[void 0]:t instanceof ri?[null]:t instanceof Pa?[void 0,...nr(t.unwrap())]:t instanceof xn?[null,...nr(t.unwrap())]:t instanceof Eu||t instanceof pi?nr(t.unwrap()):t instanceof fi?nr(t._def.innerType):[],ap=class t extends le{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==j.object)return H(a,{code:O.invalid_type,expected:j.object,received:a.parsedType}),Q;let n=this.discriminator,r=a.data[n],o=this.optionsMap.get(r);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}):(H(a,{code:O.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,a,n){let r=new Map;for(let o of a){let i=nr(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(r.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);r.set(s,o)}}return new t({typeName:J.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:r,...se(n)})}};function by(t,e){let a=vn(t),n=vn(e);if(t===e)return{valid:!0,data:t};if(a===j.object&&n===j.object){let r=de.objectKeys(e),o=de.objectKeys(t).filter(s=>r.indexOf(s)!==-1),i={...t,...e};for(let s of o){let l=by(t[s],e[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(a===j.array&&n===j.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let o=0;o<t.length;o++){let i=t[o],s=e[o],l=by(i,s);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return a===j.date&&n===j.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ii=class extends le{_parse(e){let{status:a,ctx:n}=this._processInputParams(e),r=(o,i)=>{if(ep(o)||ep(i))return Q;let s=by(o.value,i.value);return s.valid?((tp(o)||tp(i))&&a.dirty(),{status:a.value,value:s.data}):(H(n,{code:O.invalid_intersection_types}),Q)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>r(o,i)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ii.create=(t,e,a)=>new ii({left:t,right:e,typeName:J.ZodIntersection,...se(a)});var yn=class t extends le{_parse(e){let{status:a,ctx:n}=this._processInputParams(e);if(n.parsedType!==j.array)return H(n,{code:O.invalid_type,expected:j.array,received:n.parsedType}),Q;if(n.data.length<this._def.items.length)return H(n,{code:O.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&n.data.length>this._def.items.length&&(H(n,{code:O.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());let o=[...n.data].map((i,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Fa(n,i,n.path,s)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>kt.mergeArray(a,i)):kt.mergeArray(a,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};yn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yn({items:t,typeName:J.ZodTuple,rest:null,...se(e)})};var np=class t extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:n}=this._processInputParams(e);if(n.parsedType!==j.object)return H(n,{code:O.invalid_type,expected:j.object,received:n.parsedType}),Q;let r=[],o=this._def.keyType,i=this._def.valueType;for(let s in n.data)r.push({key:o._parse(new Fa(n,s,n.path,s)),value:i._parse(new Fa(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?kt.mergeObjectAsync(a,r):kt.mergeObjectSync(a,r)}get element(){return this._def.valueType}static create(e,a,n){return a instanceof le?new t({keyType:e,valueType:a,typeName:J.ZodRecord,...se(n)}):new t({keyType:ro.create(),valueType:e,typeName:J.ZodRecord,...se(a)})}},Os=class extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:n}=this._processInputParams(e);if(n.parsedType!==j.map)return H(n,{code:O.invalid_type,expected:j.map,received:n.parsedType}),Q;let r=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([s,l],u)=>({key:r._parse(new Fa(n,s,n.path,[u,"key"])),value:o._parse(new Fa(n,l,n.path,[u,"value"]))}));if(n.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}}}};Os.create=(t,e,a)=>new Os({valueType:e,keyType:t,typeName:J.ZodMap,...se(a)});var Bs=class t extends le{_parse(e){let{status:a,ctx:n}=this._processInputParams(e);if(n.parsedType!==j.set)return H(n,{code:O.invalid_type,expected:j.set,received:n.parsedType}),Q;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(H(n,{code:O.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),a.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(H(n,{code:O.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.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=[...n.data.values()].map((l,u)=>o._parse(new Fa(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>i(l)):i(s)}min(e,a){return new t({...this._def,minSize:{value:e,message:W.toString(a)}})}max(e,a){return new t({...this._def,maxSize:{value:e,message:W.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}};Bs.create=(t,e)=>new Bs({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...se(e)});var rp=class t extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==j.function)return H(a,{code:O.invalid_type,expected:j.function,received:a.parsedType}),Q;function n(s,l){return Au({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Es(),ar].filter(u=>!!u),issueData:{code:O.invalid_arguments,argumentsError:l}})}function r(s,l){return Au({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Es(),ar].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 io){let s=this;return Ot(async function(...l){let u=new ta([]),c=await s._def.args.parseAsync(l,o).catch(m=>{throw u.addIssue(n(l,m)),u}),d=await Reflect.apply(i,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(m=>{throw u.addIssue(r(d,m)),u})})}else{let s=this;return Ot(function(...l){let u=s._def.args.safeParse(l,o);if(!u.success)throw new ta([n(l,u.error)]);let c=Reflect.apply(i,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new ta([r(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:yn.create(e).rest(rr.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,n){return new t({args:e||yn.create([]).rest(rr.create()),returns:a||rr.create(),typeName:J.ZodFunction,...se(n)})}},si=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})}};si.create=(t,e)=>new si({getter:t,typeName:J.ZodLazy,...se(e)});var li=class extends le{_parse(e){if(e.data!==this._def.value){let a=this._getOrReturnCtx(e);return H(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}};li.create=(t,e)=>new li({value:t,typeName:J.ZodLiteral,...se(e)});function oI(t,e){return new ui({values:t,typeName:J.ZodEnum,...se(e)})}var ui=class t extends le{_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),n=this._def.values;return H(a,{expected:de.joinValues(n),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),n=this._def.values;return H(a,{received:a.data,code:O.invalid_enum_value,options:n}),Q}return Ot(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(n=>!e.includes(n)),{...this._def,...a})}};ui.create=oI;var ci=class extends le{_parse(e){let a=de.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==j.string&&n.parsedType!==j.number){let r=de.objectValues(a);return H(n,{expected:de.joinValues(r),received:n.parsedType,code:O.invalid_type}),Q}if(this._cache||(this._cache=new Set(de.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=de.objectValues(a);return H(n,{received:n.data,code:O.invalid_enum_value,options:r}),Q}return Ot(e.data)}get enum(){return this._def.values}};ci.create=(t,e)=>new ci({values:t,typeName:J.ZodNativeEnum,...se(e)});var io=class extends le{unwrap(){return this._def.type}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==j.promise&&a.common.async===!1)return H(a,{code:O.invalid_type,expected:j.promise,received:a.parsedType}),Q;let n=a.parsedType===j.promise?a.data:Promise.resolve(a.data);return Ot(n.then(r=>this._def.type.parseAsync(r,{path:a.path,errorMap:a.common.contextualErrorMap})))}};io.create=(t,e)=>new io({type:t,typeName:J.ZodPromise,...se(e)});var Na=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:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:i=>{H(n,i),i.fatal?a.abort():a.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let i=r.transform(n.data,o);if(n.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:n.path,parent:n});return l.status==="aborted"?Q:l.status==="dirty"?Qo(l.value):a.value==="dirty"?Qo(l.value):l});{if(a.value==="aborted")return Q;let s=this._def.schema._parseSync({data:i,path:n.path,parent:n});return s.status==="aborted"?Q:s.status==="dirty"?Qo(s.value):a.value==="dirty"?Qo(s.value):s}}if(r.type==="refinement"){let i=s=>{let l=r.refinement(s,o);if(n.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(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});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:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?Q:(s.status==="dirty"&&a.dirty(),i(s.value).then(()=>({status:a.value,value:s.value}))))}if(r.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!no(i))return Q;let s=r.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:n.data,path:n.path,parent:n}).then(i=>no(i)?Promise.resolve(r.transform(i.value,o)).then(s=>({status:a.value,value:s})):Q);de.assertNever(r)}};Na.create=(t,e,a)=>new Na({schema:t,typeName:J.ZodEffects,effect:e,...se(a)});Na.createWithPreprocess=(t,e,a)=>new Na({schema:e,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...se(a)});var Pa=class extends le{_parse(e){return this._getType(e)===j.undefined?Ot(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Pa.create=(t,e)=>new Pa({innerType:t,typeName:J.ZodOptional,...se(e)});var xn=class extends le{_parse(e){return this._getType(e)===j.null?Ot(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};xn.create=(t,e)=>new xn({innerType:t,typeName:J.ZodNullable,...se(e)});var di=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),n=a.data;return a.parsedType===j.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:a.path,parent:a})}removeDefault(){return this._def.innerType}};di.create=(t,e)=>new di({innerType:t,typeName:J.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...se(e)});var fi=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),n={...a,common:{...a.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ts(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ta(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ta(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};fi.create=(t,e)=>new fi({innerType:t,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...se(e)});var Ps=class extends le{_parse(e){if(this._getType(e)!==j.nan){let n=this._getOrReturnCtx(e);return H(n,{code:O.invalid_type,expected:j.nan,received:n.parsedType}),Q}return{status:"valid",value:e.data}}};Ps.create=t=>new Ps({typeName:J.ZodNaN,...se(t)});var rF=Symbol("zod_brand"),Eu=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),n=a.data;return this._def.type._parse({data:n,path:a.path,parent:a})}unwrap(){return this._def.type}},Tu=class t extends le{_parse(e){let{status:a,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Q:o.status==="dirty"?(a.dirty(),Qo(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?Q:r.status==="dirty"?(a.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,a){return new t({in:e,out:a,typeName:J.ZodPipeline})}},pi=class extends le{_parse(e){let a=this._def.innerType._parse(e),n=r=>(no(r)&&(r.value=Object.freeze(r.value)),r);return Ts(a)?a.then(r=>n(r)):n(a)}unwrap(){return this._def.innerType}};pi.create=(t,e)=>new pi({innerType:t,typeName:J.ZodReadonly,...se(e)});function tI(t,e){let a=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof a=="string"?{message:a}:a}function iI(t,e={},a){return t?oo.create().superRefine((n,r)=>{let o=t(n);if(o instanceof Promise)return o.then(i=>{if(!i){let s=tI(e,n),l=s.fatal??a??!0;r.addIssue({code:"custom",...s,fatal:l})}});if(!o){let i=tI(e,n),s=i.fatal??a??!0;r.addIssue({code:"custom",...i,fatal:s})}}):oo.create()}var oF={object:aa.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 iF=(t,e={message:`Input not instance of ${t.name}`})=>iI(a=>a instanceof t,e),sI=ro.create,lI=Jo.create,sF=Ps.create,lF=ei.create,uI=ti.create,uF=ai.create,cF=Ms.create,dF=ni.create,fF=ri.create,pF=oo.create,hF=rr.create,mF=an.create,gF=Ds.create,vF=or.create,yF=aa.create,xF=aa.strictCreate,bF=oi.create,SF=ap.create,CF=ii.create,_F=yn.create,wF=np.create,LF=Os.create,kF=Bs.create,IF=rp.create,AF=si.create,EF=li.create,TF=ui.create,RF=ci.create,MF=io.create,DF=Na.create,OF=Pa.create,BF=xn.create,PF=Na.createWithPreprocess,FF=Tu.create,NF=()=>sI().optional(),HF=()=>lI().optional(),UF=()=>uI().optional(),zF={string:(t=>ro.create({...t,coerce:!0})),number:(t=>Jo.create({...t,coerce:!0})),boolean:(t=>ti.create({...t,coerce:!0})),bigint:(t=>ei.create({...t,coerce:!0})),date:(t=>ai.create({...t,coerce:!0}))};var qF=Q;var cI=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()})]),$F=h.object({kind:h.literal("tooltip"),id:h.string(),anchor:cI,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()}),VF=h.object({kind:h.literal("highlight"),id:h.string(),anchor:cI,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()}),Sy=h.object({id:h.string(),version:h.number(),routes:h.array(h.string()).optional(),steps:h.array(h.union([$F,VF]))});function E6(t){return Sy.parse(t)}var D6=({configUri:t,experiments:e,featureKey:a="smart-canvas-overlay-uri",credentials:n="include"}={})=>async()=>{let r=Iv({configUri:t,experiments:e,featureKey:a});if(!r)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(r,{credentials:n});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let i=await o.json();return Sy.parse(i)};var op=K(Xe(),1),dI=K(Ys(),1);function B6({element:t,children:e}){let[a,n]=(0,op.useState)(null);return(0,op.useLayoutEffect)(()=>{if(!t){n(null);return}return n(t.getMountNode()),()=>n(null)},[t]),a?(0,dI.createPortal)(e,a):null}function jF(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let a=0;a<16;a++)e+=t[Math.floor(Math.random()*t.length)];return e}var Cy=class{constructor(){B(this,"sessionId");this.sessionId=jF(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,a){}trackAction(e,a,n){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,a,n){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}track(e,a){}};function _y(){return new Cy}var E=typeof window<"u"?window:void 0,At=typeof globalThis<"u"?globalThis:E;typeof self>"u"&&(At.self=At),typeof File>"u"&&(At.File=function(){});var sA=Array.prototype,fI=sA.forEach,pI=sA.indexOf,ba=At?.navigator,q=At?.document,ra=At?.location,Hy=At?.fetch,Uy=At!=null&&At.XMLHttpRequest&&"withCredentials"in new At.XMLHttpRequest?At.XMLHttpRequest:void 0,hI=At?.AbortController,na=ba?.userAgent,te=E??{},sr={DEBUG:!1,LIB_VERSION:"1.302.2"};function mI(t,e,a,n,r,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(n,r)}function gI(t){return function(){var e=this,a=arguments;return new Promise((function(n,r){var o=t.apply(e,a);function i(l){mI(o,n,r,i,s,"next",l)}function s(l){mI(o,n,r,i,s,"throw",l)}i(void 0)}))}}function Z(){return Z=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)({}).hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},Z.apply(null,arguments)}function lA(t,e){if(t==null)return{};var a={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;a[n]=t[n]}return a}var GF=["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"],vI=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var a=t.toLowerCase();return GF.concat(e).some((n=>{var r=n.toLowerCase();return a.indexOf(r)!==-1}))},ZF=["$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 Fp=function(t){return t.trim()},zy=function(t){return t.replace(/^\$/,"")},WF=Array.isArray,uA=Object.prototype,cA=uA.hasOwnProperty,Np=uA.toString,Me=WF||function(t){return Np.call(t)==="[object Array]"},po=t=>typeof t=="function",vt=t=>t===Object(t)&&!Me(t),Us=t=>{if(vt(t)){for(var e in t)if(cA.call(t,e))return!1;return!0}return!1},z=t=>t===void 0,dt=t=>Np.call(t)=="[object String]",qy=t=>dt(t)&&t.trim().length===0,dr=t=>t===null,Ae=t=>z(t)||dr(t),_n=t=>Np.call(t)=="[object Number]",ho=t=>Np.call(t)==="[object Boolean]",XF=t=>t instanceof FormData,YF=t=>fe(ZF,t);function $y(t){return t===null||typeof t!="object"}function gp(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function dA(t){return!z(Event)&&(function(e,a){try{return e instanceof a}catch{return!1}})(t,Event)}var KF=[!0,"true",1,"1","yes"],wy=t=>fe(KF,t),QF=[!1,"false",0,"0","no"];function bn(t,e,a,n,r){return e>a&&(n.warn("min cannot be greater than max."),e=a),_n(t)?t>a?(n.warn(" cannot be greater than max: "+a+". Using max value instead."),a):t<e?(n.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(n.warn(" must be a number. using max or fallback. max: "+a+", fallback: "+r),bn(r||a,e,a,n))}var Vy=class{constructor(e){this.t={},this.i=e.i,this.o=bn(e.bucketSize,0,100,e.h),this.m=bn(e.refillRate,0,this.o,e.h),this.S=bn(e.refillInterval,0,864e5,e.h)}$(e,a){var n=a-e.lastAccess,r=Math.floor(n/this.S);if(r>0){var o=r*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+r*this.S}}consumeRateLimit(e){var a,n=Date.now(),r=String(e),o=this.t[r];return o?this.$(o,n):(o={tokens:this.o,lastAccess:n},this.t[r]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((a=this.i)==null||a.call(this,e)),o.tokens===0)}stop(){this.t={}}},ip,yI,Ly,JF=t=>t instanceof Error;function eN(t){var e=globalThis._posthogChunkIds;if(e){var a=Object.keys(e);return Ly&&a.length===yI||(yI=a.length,Ly=a.reduce(((n,r)=>{ip||(ip={});var o=ip[r];if(o)n[o[0]]=o[1];else for(var i=t(r),s=i.length-1;s>=0;s--){var l=i[s],u=l?.filename,c=e[r];if(u&&c){n[u]=c,ip[r]=[u,c];break}}return n}),{})),Ly}}var jy=class{constructor(e,a,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=a,this.modifiers=n}buildFromUnknown(e,a){a===void 0&&(a={});var n=a&&a.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,a,0).apply(e),o=this.buildParsingContext(),i=this.parseStacktrace(r,o);return{$exception_list:this.convertToExceptionList(i,n),$exception_level:"error"}}modifyFrames(e){var a=this;return gI((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&Me(n.stacktrace.frames)&&(n.stacktrace.frames=yield a.applyModifiers(n.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 n,r;return e.cause!=null&&(n=this.parseStacktrace(e.cause,a)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),a.chunkIdMap)),Z({},e,{cause:n,stack:r})}applyChunkIds(e,a){return e.map((n=>(n.filename&&a&&(n.chunk_id=a[n.filename]),n)))}applyCoercers(e,a){for(var n of this.coercers)if(n.match(e))return n.coerce(e,a);return this.coerceFallback(a)}applyModifiers(e){var a=this;return gI((function*(){var n=e;for(var r of a.modifiers)n=yield r(n);return n}))()}convertToExceptionList(e,a){var n,r,o,i={type:e.type,value:e.value,mechanism:{type:(n=a.type)!==null&&n!==void 0?n:"generic",handled:(r=a.handled)===null||r===void 0||r,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,Z({},a,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:eN(this.stackParser)}}buildCoercingContext(e,a,n){n===void 0&&(n=0);var r=(o,i)=>{if(i<=4){var s=this.buildCoercingContext(e,a,i);return this.applyCoercers(o,s)}};return Z({},a,{syntheticException:n==0?a.syntheticException:void 0,mechanism:e,apply:o=>r(o,n),next:o=>r(o,n+1)})}},Vs="?";function Gy(t,e,a,n,r){var o={platform:t,filename:e,function:a==="<anonymous>"?Vs:a,in_app:!0};return z(n)||(o.lineno=n),z(r)||(o.colno=r),o}var fA=(t,e)=>{var a=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return a||n?[t.indexOf("@")!==-1?t.split("@")[0]:Vs,a?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},tN=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,aN=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,nN=/\((\S*)(?::(\d+))(?::(\d+))\)/,rN=(t,e)=>{var a=tN.exec(t);if(a){var[,n,r,o]=a;return Gy(e,n,Vs,+r,+o)}var i=aN.exec(t);if(i){if(i[2]&&i[2].indexOf("eval")===0){var s=nN.exec(i[2]);s&&(i[2]=s[1],i[3]=s[2],i[4]=s[3])}var[l,u]=fA(i[1]||Vs,i[2]);return Gy(e,u,l,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},oN=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,iN=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,sN=(t,e)=>{var a=oN.exec(t);if(a){if(a[3]&&a[3].indexOf(" > eval")>-1){var n=iN.exec(a[3]);n&&(a[1]=a[1]||"eval",a[3]=n[1],a[4]=n[2],a[5]="")}var r=a[3],o=a[1]||Vs;return[o,r]=fA(o,r),Gy(e,r,o,a[4]?+a[4]:void 0,a[5]?+a[5]:void 0)}},xI=/\(error: (.*)\)/,bI=50;function lN(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),n=1;n<e;n++)a[n-1]=arguments[n];return function(r,o){o===void 0&&(o=0);for(var i=[],s=r.split(`
|
|
515
|
-
`),l=o;l<s.length;l++){var u=s[l];if(!(u.length>1024)){var c=xI.test(u)?u.replace(xI,"$1"):u;if(!c.match(/\S*Error: /)){for(var d of a){var f=d(c,t);if(f){i.push(f);break}}if(i.length>=bI)break}}}return(function(m){if(!m.length)return[];var S=Array.from(m);return S.reverse(),S.slice(0,bI).map((b=>{return Z({},b,{filename:b.filename||(x=S,x[x.length-1]||{}).filename,function:b.function||Vs});var x}))})(i)}}var Zy=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,a){var n=dt(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?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 gp(e,"DOMException")}isDOMError(e){return gp(e,"DOMError")}},Wy=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 n=e.message;return n.error&&typeof n.error.message=="string"?String(n.error.message):String(n)}getStack(e){return e.stacktrace||e.stack||void 0}},Xy=class{constructor(){}match(e){return gp(e,"ErrorEvent")&&e.error!=null}coerce(e,a){var n,r=a.apply(e.error);return r||{type:"ErrorEvent",value:e.message,stack:(n=a.syntheticException)==null?void 0:n.stack,synthetic:!0}}},uN=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Yy=class{match(e){return typeof e=="string"}coerce(e,a){var n,[r,o]=this.getInfos(e);return{type:r??"Error",value:o??e,stack:(n=a.syntheticException)==null?void 0:n.stack,synthetic:!0}}getInfos(e){var a="Error",n=e,r=e.match(uN);return r&&(a=r[1],n=r[2]),[a,n]}},cN=["fatal","error","warning","log","info","debug"];function pA(t,e){e===void 0&&(e=40);var a=Object.keys(t);if(a.sort(),!a.length)return"[object has no keys]";for(var n=a.length;n>0;n--){var r=a.slice(0,n).join(", ");if(!(r.length>e))return n===a.length||r.length<=e?r:r.slice(0,e)+"..."}return""}var Ky=class{match(e){return typeof e=="object"&&e!==null}coerce(e,a){var n,r=this.getErrorPropertyFromObject(e);return r?a.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(n=a.syntheticException)==null?void 0:n.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return dA(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 n=this.getObjectClassName(e);return(n&&n!=="Object"?"'"+n+"'":"Object")+" captured as exception with keys: "+pA(e)}isSeverityLevel(e){return dt(e)&&!qy(e)&&cN.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=e[a];if(JF(n))return n}}getObjectClassName(e){try{var a=Object.getPrototypeOf(e);return a?a.constructor.name:void 0}catch{return}}},Qy=class{match(e){return dA(e)}coerce(e,a){var n,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+pA(e),stack:(n=a.syntheticException)==null?void 0:n.stack,synthetic:!0}}},Jy=class{match(e){return $y(e)}coerce(e,a){var n;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(n=a.syntheticException)==null?void 0:n.stack,synthetic:!0}}},ex=class{match(e){return gp(e,"PromiseRejectionEvent")}coerce(e,a){var n,r=this.getUnhandledRejectionReason(e);return $y(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(n=a.syntheticException)==null?void 0:n.stack,synthetic:!0}:a.apply(r)}getUnhandledRejectionReason(e){if($y(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}},hA=function(t,e){var{debugEnabled:a}=e===void 0?{}:e,n={k:function(r){if(E&&(sr.DEBUG||te.POSTHOG_DEBUG||a)&&!z(E.console)&&E.console){for(var o=("__rrweb_original__"in E.console[r])?E.console[r].__rrweb_original__:E.console[r],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 r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];n.k("log",...o)},warn:function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];n.k("warn",...o)},error:function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];n.k("error",...o)},critical:function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];console.error(t,...o)},uninitializedWarning:r=>{n.error("You must initialize PostHog before calling "+r)},createLogger:(r,o)=>hA(t+" "+r,o)};return n},$=hA("[PostHog.js]"),ft=$.createLogger,dN=ft("[ExternalScriptsLoader]"),SI=(t,e,a)=>{if(t.config.disable_external_dependency_loading)return dN.warn(e+" was requested but loading of external scripts is disabled."),a("Loading of external scripts is disabled");var n=q?.querySelectorAll("script");if(n){for(var r,o=function(){if(n[i].src===e){var l=n[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<n.length;i++)if(r=o())return r.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 n="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(n="/array/"+t.config.token+"/config.js"),e==="toolbar"){var r=3e5;n=n+"&t="+Math.floor(Date.now()/r)*r}var o=t.requestRouter.endpointFor("assets",n);SI(t,o,a)},te.__PosthogExtensions__.loadSiteApp=(t,e,a)=>{var n=t.requestRouter.endpointFor("api",e);SI(t,n,a)};var vp={};function mo(t,e,a){if(Me(t)){if(fI&&t.forEach===fI)t.forEach(e,a);else if("length"in t&&t.length===+t.length){for(var n=0,r=t.length;n<r;n++)if(n in t&&e.call(a,t[n],n)===vp)return}}}function Be(t,e,a){if(!Ae(t)){if(Me(t))return mo(t,e,a);if(XF(t)){for(var n of t.entries())if(e.call(a,n[1],n[0])===vp)return}else for(var r in t)if(cA.call(t,r)&&e.call(a,t[r],r)===vp)return}}var tt=function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),n=1;n<e;n++)a[n-1]=arguments[n];return mo(a,(function(r){for(var o in r)r[o]!==void 0&&(t[o]=r[o])})),t},Zs=function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),n=1;n<e;n++)a[n-1]=arguments[n];return mo(a,(function(r){mo(r,(function(o){t.push(o)}))})),t};function pp(t){for(var e=Object.keys(t),a=e.length,n=new Array(a);a--;)n[a]=[e[a],t[e[a]]];return n}var CI=function(t){try{return t()}catch{return}},fN=function(t){return function(){try{for(var e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];return t.apply(this,a)}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)}}},Xx=function(t){var e={};return Be(t,(function(a,n){(dt(a)&&a.length>0||_n(a))&&(e[n]=a)})),e};function pN(t,e){return a=t,n=o=>dt(o)&&!dr(e)?o.slice(0,e):o,r=new Set,(function o(i,s){return i!==Object(i)?n?n(i,s):i:r.has(i)?void 0:(r.add(i),Me(i)?(l=[],mo(i,(u=>{l.push(o(u))}))):(l={},Be(i,((u,c)=>{r.has(u)||(l[c]=o(u,c))}))),l);var l})(a);var a,n,r}var hN=["herokuapp.com","vercel.app","netlify.app"];function mN(t){var e=t?.hostname;if(!dt(e))return!1;var a=e.split(".").slice(-2).join(".");for(var n of hN)if(a===n)return!1;return!0}function mA(t,e){for(var a=0;a<t.length;a++)if(e(t[a]))return t[a]}function it(t,e,a,n){var{capture:r=!1,passive:o=!0}=n??{};t?.addEventListener(e,a,{capture:r,passive:o})}var gA="$people_distinct_id",Uu="__alias",zu="__timers",_I="$autocapture_disabled_server_side",tx="$heatmaps_enabled_server_side",wI="$exception_capture_enabled_server_side",ax="$error_tracking_suppression_rules",LI="$error_tracking_capture_extension_exceptions",kI="$web_vitals_enabled_server_side",vA="$dead_clicks_enabled_server_side",II="$web_vitals_allowed_metrics",ky="$session_recording_remote_config",yp="$sesid",yA="$session_is_sampled",zs="$enabled_feature_flags",qu="$early_access_features",nx="$feature_flag_details",$u="$stored_person_properties",gi="$stored_group_properties",rx="$surveys",sp="$surveys_activated",xp="$flag_call_reported",lr="$user_state",ox="$client_session_props",ix="$capture_rate_limit",sx="$initial_campaign_params",lx="$initial_referrer_info",bp="$initial_person_info",Sp="$epp",xA="__POSTHOG_TOOLBAR__",Ru="$posthog_cookieless",gN=[gA,Uu,"__cmpns",zu,"$session_recording_enabled_server_side",tx,yp,zs,ax,lr,qu,nx,gi,$u,rx,xp,ox,ix,sx,lx,Sp,bp];function AI(t){return t instanceof Element&&(t.id===xA||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Hp(t){return!!t&&t.nodeType===1}function go(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function bA(t){return!!t&&t.nodeType===3}function SA(t){return!!t&&t.nodeType===11}function Yx(t){return t?Fp(t).split(/\s+/):[]}function EI(t){var e=E?.location.href;return!!(e&&t&&t.some((a=>e.match(a))))}function Cp(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 Yx(e)}function CA(t){return Ae(t)?null:Fp(t).split(/(\s+)/).filter((e=>Yu(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ac(t){var e="";return ux(t)&&!IA(t)&&t.childNodes&&t.childNodes.length&&Be(t.childNodes,(function(a){var n;bA(a)&&a.textContent&&(e+=(n=CA(a.textContent))!==null&&n!==void 0?n:"")})),Fp(e)}function _A(t){return z(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Kx=["a","button","form","input","select","textarea","label"];function wA(t,e){if(z(e))return!0;var a,n=function(o){if(e.some((i=>o.matches(i))))return{v:!0}};for(var r of t)if(a=n(r))return a.v;return!1}function LA(t){var e=t.parentNode;return!(!e||!Hp(e))&&e}var vN=["next","previous","prev",">","<"],TI=10,RI=[".ph-no-rageclick",".ph-no-capture"];function yN(t,e){if(!E||Qx(t))return!1;var a,n,r;if(ho(e)?(a=!!e&&RI,n=void 0):(a=(r=e?.css_selector_ignorelist)!==null&&r!==void 0?r:RI,n=e?.content_ignorelist),a===!1)return!1;var{targetElementList:o}=kA(t,!1);return!(function(i,s){if(i===!1||z(i))return!1;var l;if(i===!0)l=vN;else{if(!Me(i))return!1;if(i.length>TI)return $.error("[PostHog] content_ignorelist array cannot exceed "+TI+" 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((f=>c.includes(f)||d.includes(f)))}))})(n,o.map((i=>{var s;return{safeText:ac(i).toLowerCase(),ariaLabel:((s=i.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!wA(o,a)}var Qx=t=>!t||go(t,"html")||!Hp(t),kA=(t,e)=>{if(!E||Qx(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var a=!1,n=[t],r=t;r.parentNode&&!go(r,"body");)if(SA(r.parentNode))n.push(r.parentNode.host),r=r.parentNode.host;else{var o=LA(r);if(!o)break;if(e||Kx.indexOf(o.tagName.toLowerCase())>-1)a=!0;else{var i=E.getComputedStyle(o);i&&i.getPropertyValue("cursor")==="pointer"&&(a=!0)}n.push(o),r=o}return{parentIsUsefulElement:a,targetElementList:n}};function xN(t,e,a,n,r){var o,i,s,l;if(a===void 0&&(a=void 0),!E||Qx(t)||(o=a)!=null&&o.url_allowlist&&!EI(a.url_allowlist)||(i=a)!=null&&i.url_ignorelist&&EI(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}=kA(t,n);if(!(function(S,b){var x=b?.element_allowlist;if(z(x))return!0;var p,g=function(y){if(x.some((_=>y.tagName.toLowerCase()===_)))return{v:!0}};for(var v of S)if(p=g(v))return p.v;return!1})(d,a)||!wA(d,(l=a)==null?void 0:l.css_selector_allowlist))return!1;var f=E.getComputedStyle(t);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var m=t.tagName.toLowerCase();switch(m){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 c?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Kx.indexOf(m)>-1||t.getAttribute("contenteditable")==="true")}}function ux(t){for(var e=t;e.parentNode&&!go(e,"body");e=e.parentNode){var a=Cp(e);if(fe(a,"ph-sensitive")||fe(a,"ph-no-capture"))return!1}if(fe(Cp(t),"ph-include"))return!0;var n=t.type||"";if(dt(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";return!(dt(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 IA(t){return!!(go(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||go(t,"select")||go(t,"textarea")||t.getAttribute("contenteditable")==="true")}var AA="(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})",bN=new RegExp("^(?:"+AA+")$"),SN=new RegExp(AA),EA="\\d{3}-?\\d{2}-?\\d{4}",CN=new RegExp("^("+EA+")$"),_N=new RegExp("("+EA+")");function Yu(t,e){return e===void 0&&(e=!0),!(Ae(t)||dt(t)&&(t=Fp(t),(e?bN:SN).test((t||"").replace(/[- ]/g,""))||(e?CN:_N).test(t)))}function TA(t){var e=ac(t);return Yu(e=(e+" "+RA(t)).trim())?e:""}function RA(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Be(t.childNodes,(function(a){var n;if(a&&((n=a.tagName)==null?void 0:n.toLowerCase())==="span")try{var r=ac(a);e=(e+" "+r).trim(),a.childNodes&&a.childNodes.length&&(e=(e+" "+RA(a)).trim())}catch(o){$.error("[AutoCapture]",o)}})),e}function wN(t){return(function(e){var a=e.map((n=>{var r,o,i="";if(n.tag_name&&(i+=n.tag_name),n.attr_class)for(var s of(n.attr_class.sort(),n.attr_class))i+="."+s.replace(/"/g,"");var l=Z({},n.text?{text:n.text}:{},{"nth-child":(r=n.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(o=n.nth_of_type)!==null&&o!==void 0?o:0},n.href?{href:n.href}:{},n.attr_id?{attr_id:n.attr_id}:{},n.attributes),u={};return pp(l).sort(((c,d)=>{var[f]=c,[m]=d;return f.localeCompare(m)})).forEach((c=>{var[d,f]=c;return u[MI(d.toString())]=MI(f.toString())})),i+=":",i+=pp(u).map((c=>{var[d,f]=c;return d+'="'+f+'"'})).join("")}));return a.join(";")})((function(e){return e.map((a=>{var n,r,o={text:(n=a.$el_text)==null?void 0:n.slice(0,400),tag_name:a.tag_name,href:(r=a.attr__href)==null?void 0:r.slice(0,2048),attr_class:LN(a),attr_id:a.attr__id,nth_child:a.nth_child,nth_of_type:a.nth_of_type,attributes:{}};return pp(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 MI(t){return t.replace(/"|\\"/g,'\\"')}function LN(t){var e=t.attr__class;return e?Me(e)?e:Yx(e):void 0}var _p=class{constructor(e){this.disabled=e===!1;var a=vt(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,n){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(a-r.y)<this.thresholdPx&&n-r.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:a,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:a,timestamp:n}];return!1}},Iy="$copy_autocapture",cr=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var wp=t=>{var e=q?.createElement("a");return z(e)?null:(e.href=t,e)},kN=function(t,e){var a,n;e===void 0&&(e="&");var r=[];return Be(t,(function(o,i){z(o)||z(i)||i==="undefined"||(a=encodeURIComponent((s=>s instanceof File)(o)?o.name:o.toString()),n=encodeURIComponent(i),r[r.length]=n+"="+a)})),r.join(e)},Lp=function(t,e){for(var a,n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<n.length;r++){var o=n[r].split("=");if(o[0]===e){a=o;break}}if(!Me(a)||a.length<2)return"";var i=a[1];try{i=decodeURIComponent(i)}catch{$.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},nc=function(t,e,a){if(!t||!e||!e.length)return t;for(var n=t.split("#"),r=n[0]||"",o=n[1],i=r.split("?"),s=i[1],l=i[0],u=(s||"").split("&"),c=[],d=0;d<u.length;d++){var f=u[d].split("=");Me(f)&&(e.includes(f[0])?c.push(f[0]+"="+a):c.push(u[d]))}var m=l;return s!=null&&(m+="?"+c.join("&")),o!=null&&(m+="#"+o),m},kp=function(t,e){var a=t.match(new RegExp(e+"=([^&]*)"));return a?a[1]:null},DI=ft("[AutoCapture]");function Ay(t,e){return e.length>t?e.slice(0,t)+"...":e}function IN(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Hp(e));return e}function AN(t,e,a,n){var r=t.tagName.toLowerCase(),o={tag_name:r};Kx.indexOf(r)>-1&&!a&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?o.$el_text=Ay(1024,TA(t)):o.$el_text=Ay(1024,ac(t)));var i=Cp(t);i.length>0&&(o.classes=i.filter((function(c){return c!==""}))),Be(t.attributes,(function(c){var d;if((!IA(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(n==null||!n.includes(c.name))&&!e&&Yu(c.value)&&(d=c.name,!dt(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var f=c.value;c.name==="class"&&(f=Yx(f).join(" ")),o["attr__"+c.name]=Ay(1024,f)}}));for(var s=1,l=1,u=t;u=IN(u);)s++,u.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function EN(t,e){for(var a,n,{e:r,maskAllElementAttributes:o,maskAllText:i,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!go(c,"body");)SA(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,f=[],m={},S=!1,b=!1;if(Be(u,(y=>{var _=ux(y);y.tagName.toLowerCase()==="a"&&(S=y.getAttribute("href"),S=_&&S&&Yu(S)&&S),fe(Cp(y),"ph-no-capture")&&(b=!0),f.push(AN(y,o,i,s));var L=(function(C){if(!ux(C))return{};var A={};return Be(C.attributes,(function(w){if(w.name&&w.name.indexOf("data-ph-capture-attribute")===0){var k=w.name.replace("data-ph-capture-attribute-",""),T=w.value;k&&T&&Yu(T)&&(A[k]=T)}})),A})(y);tt(m,L)})),b)return{props:{},explicitNoCapture:b};if(i||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?f[0].$el_text=TA(t):f[0].$el_text=ac(t)),S){var x,p;f[0].attr__href=S;var g=(x=wp(S))==null?void 0:x.host,v=E==null||(p=E.location)==null?void 0:p.host;g&&v&&g!==v&&(d=S)}return{props:tt({$event_type:r.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:wN(f)},(a=f[0])!=null&&a.$el_text?{$el_text:(n=f[0])==null?void 0:n.$el_text}:{},d&&r.type==="click"?{$external_click_url:d}:{},m)}}var cx=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new _p(e.config.rageclick),this.I=null}get F(){var e,a,n=vt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),n.url_ignorelist=(a=n.url_ignorelist)==null?void 0:a.map((r=>new RegExp(r))),n}C(){if(this.isBrowserSupported()){if(E&&q){var e=n=>{n=n||E?.event;try{this.M(n)}catch(r){DI.error("Failed to capture event",r)}};if(it(q,"submit",e,{capture:!0}),it(q,"change",e,{capture:!0}),it(q,"click",e,{capture:!0}),this.F.capture_copied_text){var a=n=>{n=n||E?.event,this.M(n,Iy)};it(q,"copy",a,{capture:!0}),it(q,"cut",a,{capture:!0})}}}else DI.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({[_I]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var a,n=[];return(a=this.I)==null||a.forEach((r=>{var o=q?.querySelectorAll(r);o?.forEach((i=>{e===i&&n.push(r)}))})),n}get isEnabled(){var e,a,n=(e=this.instance.persistence)==null?void 0:e.props[_I],r=this.T;if(dr(r)&&!ho(n)&&!this.instance.O())return!1;var o=(a=this.T)!==null&&a!==void 0?a:!!n;return!!this.instance.config.autocapture&&!o}M(e,a){if(a===void 0&&(a="$autocapture"),this.isEnabled){var n,r=_A(e);bA(r)&&(r=r.parentNode||null),a==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&yN(r,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=a===Iy;if(r&&xN(r,e,this.F,o,o?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:s}=EN(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&&(i.$element_selectors=l),a===Iy){var u,c=CA(E==null||(u=E.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 po(q?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return _n(t)&&isFinite(t)&&Math.floor(t)===t});var OI="0123456789abcdef",dx=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,a,n,r){if(!Number.isInteger(e)||!Number.isInteger(a)||!Number.isInteger(n)||!Number.isInteger(r)||e<0||a<0||n<0||r<0||e>0xffffffffffff||a>4095||n>1073741823||r>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|n>>>24,o[9]=n>>>16,o[10]=n>>>8,o[11]=n,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new t(o)}toString(){for(var e="",a=0;a<this.bytes.length;a++)e=e+OI.charAt(this.bytes[a]>>>4)+OI.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 n=this.bytes[a]-e.bytes[a];if(n!==0)return Math.sign(n)}return 0}},fx=class{constructor(){this.A=0,this.D=0,this.j=new px}generate(){var e=this.generateOrAbort();if(z(e)){this.A=0;var a=this.generateOrAbort();if(z(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 dx.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())}},BI,MA=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};E&&!z(E.crypto)&&crypto.getRandomValues&&(MA=t=>crypto.getRandomValues(t));var px=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(MA(this.N),this.U=0),this.N[this.U++]}},fo=()=>TN().toString(),TN=()=>(BI||(BI=new fx)).generate(),Mu="",RN=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function MN(t,e){if(e){var a=(function(r,o){if(o===void 0&&(o=q),Mu)return Mu;if(!o||["localhost","127.0.0.1"].includes(r))return"";for(var i=r.split("."),s=Math.min(i.length,8),l="dmn_chk_"+fo();!Mu&&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",Mu=u)}return Mu})(t);if(!a){var n=(r=>{var o=r.match(RN);return o?o[0]:""})(t);n!==a&&$.info("Warning: cookie subdomain discovery mismatch",n,a),a=n}return a?"; domain=."+a:""}return""}var Cn={H:()=>!!q,B:function(t){$.error("cookieStore error: "+t)},q:function(t){if(q){try{for(var e=t+"=",a=q.cookie.split(";").filter((o=>o.length)),n=0;n<a.length;n++){for(var r=a[n];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(Cn.q(t))||{}}catch{}return e},G:function(t,e,a,n,r){if(q)try{var o="",i="",s=MN(q.location.hostname,n);if(a){var l=new Date;l.setTime(l.getTime()+24*a*60*60*1e3),o="; expires="+l.toUTCString()}r&&(i="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+i;return u.length>3686.4&&$.warn("cookieStore warning: large cookie, len="+u.length),q.cookie=u,u}catch{return}},V:function(t,e){if(q!=null&&q.cookie)try{Cn.G(t,"",-1,e)}catch{return}}},Ey=null,We={H:function(){if(!dr(Ey))return Ey;var t=!0;if(z(E))t=!1;else try{var e="__mplssupport__";We.G(e,"xyz"),We.q(e)!=='"xyz"'&&(t=!1),We.V(e)}catch{t=!1}return t||$.error("localStorage unsupported; falling back to cookie store"),Ey=t,t},B:function(t){$.error("localStorage error: "+t)},q:function(t){try{return E?.localStorage.getItem(t)}catch(e){We.B(e)}return null},W:function(t){try{return JSON.parse(We.q(t))||{}}catch{}return null},G:function(t,e){try{E?.localStorage.setItem(t,JSON.stringify(e))}catch(a){We.B(a)}},V:function(t){try{E?.localStorage.removeItem(t)}catch(e){We.B(e)}}},DN=["distinct_id",yp,yA,Sp,bp],lp=Z({},We,{W:function(t){try{var e={};try{e=Cn.W(t)||{}}catch{}var a=tt(e,JSON.parse(We.q(t)||"{}"));return We.G(t,a),a}catch{}return null},G:function(t,e,a,n,r,o){try{We.G(t,e,void 0,void 0,o);var i={};DN.forEach((s=>{e[s]&&(i[s]=e[s])})),Object.keys(i).length&&Cn.G(t,i,a,n,r,o)}catch(s){We.B(s)}},V:function(t,e){try{E?.localStorage.removeItem(t),Cn.V(t,e)}catch(a){We.B(a)}}}),up={},ON={H:function(){return!0},B:function(t){$.error("memoryStorage error: "+t)},q:function(t){return up[t]||null},W:function(t){return up[t]||null},G:function(t,e){up[t]=e},V:function(t){delete up[t]}},hi=null,It={H:function(){if(!dr(hi))return hi;if(hi=!0,z(E))hi=!1;else try{var t="__support__";It.G(t,"xyz"),It.q(t)!=='"xyz"'&&(hi=!1),It.V(t)}catch{hi=!1}return hi},B:function(t){$.error("sessionStorage error: ",t)},q:function(t){try{return E?.sessionStorage.getItem(t)}catch(e){It.B(e)}return null},W:function(t){try{return JSON.parse(It.q(t))||null}catch{}return null},G:function(t,e){try{E?.sessionStorage.setItem(t,JSON.stringify(e))}catch(a){It.B(a)}},V:function(t){try{E?.sessionStorage.removeItem(t)}catch(e){It.B(e)}}},ur=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),hx=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?ur.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===ur.DENIED||this.consent===ur.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===ur.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:n}=this._instance.config;return n||(a?a+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return wy(e)?ur.GRANTED:fe(QF,e)?ur.DENIED:ur.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?We:Cn;var a=e==="localStorage"?Cn:We;a.q(this.X)&&(this.Z.q(this.X)||this.optInOut(wy(a.q(this.X))),a.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!mA([ba?.doNotTrack,ba?.msDoNotTrack,te.doNotTrack],(e=>wy(e)))}},cp=ft("[Dead Clicks]"),BN=()=>!0,PN=t=>{var e,a=!((e=t.instance.persistence)==null||!e.get_property(vA)),n=t.instance.config.capture_dead_clicks;return ho(n)?n:!!vt(n)||a},Ip=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,a,n){this.instance=e,this.isEnabled=a,this.onCapture=n,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[vA]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var a,n;(a=te.__PosthogExtensions__)!=null&&a.initDeadClicksAutocapture&&e(),(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",(r=>{r?cp.error("failed to load script",r):e()}))}et(){var e;if(q){if(!this.tt&&(e=te.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var a=vt(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),cp.info("starting...")}}else cp.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,cp.info("stopping..."))}},Du=ft("[ExceptionAutocapture]"),mx=class{constructor(e){var a,n,r;this.rt=()=>{var o;if(E&&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){Du.error("failed to start",u),this.lt()}}},this._instance=e,this.ut=!((a=this._instance.persistence)==null||!a.props[wI]),this.F=this.ht(),this.vt=new Vy({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:Du}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,a={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return vt(e)?a=Z({},a,e):(z(e)?this.ut:e)&&(a=Z({},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&&(Du.info("enabled"),this.it(this.rt))}it(e){var a,n;(a=te.__PosthogExtensions__)!=null&&a.errorWrappingFunctions&&e(),(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return Du.error("failed to load script",r);e()}))}lt(){var e,a,n;(e=this.st)==null||e.call(this),this.st=void 0,(a=this.nt)==null||a.call(this),this.nt=void 0,(n=this.ot)==null||n.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({[wI]:this.ut}),this.startIfEnabled()}captureException(e){var a,n,r=(a=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&a!==void 0?a:"Exception";this.vt.consumeRateLimit(r)?Du.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}};function PI(t,e,a){try{if(!(e in t))return()=>{};var n=t[e],r=a(n);return po(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=r,()=>{t[e]=n}}catch{return()=>{}}}var gx=class{constructor(e){var a;this._instance=e,this.dt=(E==null||(a=E.location)==null?void 0:a.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,a;if(E&&E.history){var n=this;(e=E.history.pushState)!=null&&e.__posthog_wrapped__||PI(E.history,"pushState",(r=>function(o,i,s){r.call(this,o,i,s),n.ft("pushState")})),(a=E.history.replaceState)!=null&&a.__posthog_wrapped__||PI(E.history,"replaceState",(r=>function(o,i,s){r.call(this,o,i,s),n.ft("replaceState")})),this.gt()}}ft(e){try{var a,n=E==null||(a=E.location)==null?void 0:a.pathname;if(!n)return;n!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=n}catch(r){$.error("Error capturing "+e+" pageview",r)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};it(E,"popstate",e),this.ct=()=>{E&&E.removeEventListener("popstate",e)}}}},Ty=ft("[SegmentIntegration]");function FN(t,e){var a=t.config.segment;if(!a)return e();(function(n,r){var o=n.config.segment;if(!o)return r();var i=l=>{var u=()=>l.anonymousId()||fo();n.config.get_device_id=u,l.id()&&(n.register({distinct_id:l.id(),$device_id:u()}),n.persistence.set_property(lr,"identified")),r()},s=o.user();"then"in s&&po(s.then)?s.then((l=>i(l))):i(s)})(t,(()=>{a.register((n=>{Promise&&Promise.resolve||Ty.warn("This browser does not have Promise support, and can not use the segment integration");var r=(o,i)=>{if(!i)return o;o.event.userId||o.event.anonymousId===n.get_distinct_id()||(Ty.info("No userId set, resetting PostHog"),n.reset()),o.event.userId&&o.event.userId!==n.get_distinct_id()&&(Ty.info("UserId set, identifying with PostHog"),n.identify(o.event.userId));var s=n.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=>r(o,o.event.event),page:o=>r(o,"$pageview"),identify:o=>r(o,"$identify"),screen:o=>r(o,"$screen")}})(t)).then((()=>{e()}))}))}var DA="posthog-js";function OA(t,e){var{organization:a,projectId:n,prefix:r,severityAllowList:o=["error"],sendExceptionsToPostHog:i=!0}=e===void 0?{}:e;return s=>{var l,u,c,d,f;if(!(o==="*"||o.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var m=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());s.tags["PostHog Person URL"]=m,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((p=>Z({},p,{stacktrace:p.stacktrace?Z({},p.stacktrace,{type:"raw",frames:(p.stacktrace.frames||[]).map((g=>Z({},g,{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:(f=S[0])==null?void 0:f.type,$sentry_tags:s.tags};return a&&n&&(x.$sentry_url=(r||"https://sentry.io/organizations/")+a+"/issues/?project="+n+"&query="+s.event_id),i&&t.exceptions.sendExceptionEvent(x),s}}var vx=class{constructor(e,a,n,r,o,i){this.name=DA,this.setupOnce=function(s){s(OA(e,{organization:a,projectId:n,prefix:r,severityAllowList:o,sendExceptionsToPostHog:i==null||i}))}}},NN=E!=null&&E.location?kp(E.location.hash,"__posthog")||kp(location.hash,"state"):null,FI="_postHogToolbarParams",NI=ft("[Toolbar]"),co=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(co||{}),yx=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:co.UNINITIALIZED}maybeLoadToolbar(e,a,n){if(e===void 0&&(e=void 0),a===void 0&&(a=void 0),n===void 0&&(n=void 0),!E||!q)return!1;e=e??E.location,n=n??E.history;try{if(!a){try{E.localStorage.setItem("test","test"),E.localStorage.removeItem("test")}catch{return!1}a=E?.localStorage}var r,o=NN||kp(e.hash,"__posthog")||kp(e.hash,"state"),i=o?CI((()=>JSON.parse(atob(decodeURIComponent(o)))))||CI((()=>JSON.parse(decodeURIComponent(o)))):null;return i&&i.action==="ph_authorize"?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?e.hash=i.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(a.getItem(FI)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}bt(e){var a=te.ph_load_toolbar||te.ph_load_editor;!Ae(a)&&po(a)?a(e,this.instance):NI.warn("No toolbar load function found")}loadToolbar(e){var a=!(q==null||!q.getElementById(xA));if(!E||a)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=Z({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(E.localStorage.setItem(FI,JSON.stringify(Z({},r,{source:void 0}))),this.yt()===co.LOADED)this.bt(r);else if(this.yt()===co.UNINITIALIZED){var o;this._t(co.LOADING),(o=te.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return NI.error("[Toolbar] Failed to load",i),void this._t(co.UNINITIALIZED);this._t(co.LOADED),this.bt(r)})),it(E,"turbolinks:load",(()=>{this._t(co.UNINITIALIZED),this.loadToolbar(r)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,a,n){return e===void 0&&(e=void 0),a===void 0&&(a=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,a,n)}},HN=ft("[TracingHeaders]"),xx=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var a,n;z(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)),z(this.St)&&((n=te.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var a,n;(a=te.__PosthogExtensions__)!=null&&a.tracingHeadersPatchFns&&e(),(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return HN.error("failed to load script",r);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)}},Ha="Mobile",Ap="iOS",Sn="Android",Ku="Tablet",BA=Sn+" "+Ku,PA="iPad",FA="Apple",NA=FA+" Watch",Qu="Safari",js="BlackBerry",HA="Samsung",UA=HA+"Browser",zA=HA+" Internet",vi="Chrome",UN=vi+" OS",qA=vi+" "+Ap,Jx="Internet Explorer",$A=Jx+" "+Ha,eb="Opera",zN=eb+" Mini",tb="Edge",VA="Microsoft "+tb,qs="Firefox",jA=qs+" "+Ap,Ju="Nintendo",ec="PlayStation",$s="Xbox",GA=Sn+" "+Ha,ZA=Ha+" "+Qu,Vu="Windows",bx=Vu+" Phone",HI="Nokia",Sx="Ouya",WA="Generic",qN=WA+" "+Ha.toLowerCase(),XA=WA+" "+Ku.toLowerCase(),Cx="Konqueror",qt="(\\d+(\\.\\d+)?)",Ry=new RegExp("Version/"+qt),$N=new RegExp($s,"i"),VN=new RegExp(ec+" \\w+","i"),jN=new RegExp(Ju+" \\w+","i"),ab=new RegExp(js+"|PlayBook|BB10","i"),GN={"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"},ZN=(t,e)=>e&&fe(e,FA)||(function(a){return fe(a,Qu)&&!fe(a,vi)&&!fe(a,Sn)})(t),YA=function(t,e){return e=e||"",fe(t," OPR/")&&fe(t,"Mini")?zN:fe(t," OPR/")?eb:ab.test(t)?js:fe(t,"IE"+Ha)||fe(t,"WPDesktop")?$A:fe(t,UA)?zA:fe(t,tb)||fe(t,"Edg/")?VA:fe(t,"FBIOS")?"Facebook "+Ha:fe(t,"UCWEB")||fe(t,"UCBrowser")?"UC Browser":fe(t,"CriOS")?qA:fe(t,"CrMo")||fe(t,vi)?vi:fe(t,Sn)&&fe(t,Qu)?GA:fe(t,"FxiOS")?jA:fe(t.toLowerCase(),Cx.toLowerCase())?Cx:ZN(t,e)?fe(t,Ha)?ZA:Qu:fe(t,qs)?qs:fe(t,"MSIE")||fe(t,"Trident/")?Jx:fe(t,"Gecko")?qs:""},WN={[$A]:[new RegExp("rv:"+qt)],[VA]:[new RegExp(tb+"?\\/"+qt)],[vi]:[new RegExp("("+vi+"|CrMo)\\/"+qt)],[qA]:[new RegExp("CriOS\\/"+qt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+qt)],[Qu]:[Ry],[ZA]:[Ry],[eb]:[new RegExp("(Opera|OPR)\\/"+qt)],[qs]:[new RegExp(qs+"\\/"+qt)],[jA]:[new RegExp("FxiOS\\/"+qt)],[Cx]:[new RegExp("Konqueror[:/]?"+qt,"i")],[js]:[new RegExp(js+" "+qt),Ry],[GA]:[new RegExp("android\\s"+qt,"i")],[zA]:[new RegExp(UA+"\\/"+qt)],[Jx]:[new RegExp("(rv:|MSIE )"+qt)],Mozilla:[new RegExp("rv:"+qt)]},XN=function(t,e){var a=YA(t,e),n=WN[a];if(z(n))return null;for(var r=0;r<n.length;r++){var o=n[r],i=t.match(o);if(i)return parseFloat(i[i.length-2])}return null},UI=[[new RegExp($s+"; "+$s+" (.*?)[);]","i"),t=>[$s,t&&t[1]||""]],[new RegExp(Ju,"i"),[Ju,""]],[new RegExp(ec,"i"),[ec,""]],[ab,[js,""]],[new RegExp(Vu,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[bx,""];if(new RegExp(Ha).test(e)&&!/IEMobile\b/.test(e))return[Vu+" "+Ha,""];var a=/Windows NT ([0-9.]+)/i.exec(e);if(a&&a[1]){var n=a[1],r=GN[n]||"";return/arm/i.test(e)&&(r="RT"),[Vu,r]}return[Vu,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Ap,e.join(".")]}return[Ap,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=z(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Sn+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Sn+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Sn,e.join(".")]}return[Sn,""]}],[/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/,[UN,""]],[/Linux|debian/i,["Linux",""]]],zI=function(t){return jN.test(t)?Ju:VN.test(t)?ec:$N.test(t)?$s:new RegExp(Sx,"i").test(t)?Sx:new RegExp("("+bx+"|WPDesktop)","i").test(t)?bx:/iPad/.test(t)?PA:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?NA:ab.test(t)?js:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(HI,"i").test(t)?HI:/(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(Ha).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)?Sn:BA:Sn:new RegExp("(pda|"+Ha+")","i").test(t)?qN:new RegExp(Ku,"i").test(t)&&!new RegExp(Ku+" pc","i").test(t)?XA:""},dp="https?://(.*)",Ws=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],YN=Zs(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Ws),rc="<masked>",KN=["li_fat_id"];function KA(t,e,a){if(!q)return{};var n,r=e?Zs([],Ws,a||[]):[],o=QA(nc(q.URL,r,rc),t),i=(n={},Be(KN,(function(s){var l=Cn.q(s);n[s]=l||null})),n);return tt(i,o)}function QA(t,e){var a=YN.concat(e||[]),n={};return Be(a,(function(r){var o=Lp(t,r);n[r]=o||null})),n}function JA(t){var e=(function(o){return o?o.search(dp+"google.([^/?]*)")===0?"google":o.search(dp+"bing.com")===0?"bing":o.search(dp+"yahoo.com")===0?"yahoo":o.search(dp+"duckduckgo.com")===0?"duckduckgo":null:null})(t),a=e!="yahoo"?"q":"p",n={};if(!dr(e)){n.$search_engine=e;var r=q?Lp(q.referrer,a):"";r.length&&(n.ph_keyword=r)}return n}function qI(){return navigator.language||navigator.userLanguage}function eE(){return q?.referrer||"$direct"}function tE(t,e){var a=t?Zs([],Ws,e||[]):[],n=ra?.href.substring(0,1e3);return{r:eE().substring(0,1e3),u:n?nc(n,a,rc):void 0}}function aE(t){var e,{r:a,u:n}=t,r={$referrer:a,$referring_domain:a==null?void 0:a=="$direct"?"$direct":(e=wp(a))==null?void 0:e.host};if(n){r.$current_url=n;var o=wp(n);r.$host=o?.host,r.$pathname=o?.pathname;var i=QA(n);tt(r,i)}if(a){var s=JA(a);tt(r,s)}return r}function nE(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function QN(){try{return new Date().getTimezoneOffset()}catch{return}}function JN(t,e){if(!na)return{};var a,n,r,o=t?Zs([],Ws,e||[]):[],[i,s]=(function(l){for(var u=0;u<UI.length;u++){var[c,d]=UI[u],f=c.exec(l),m=f&&(po(d)?d(f,l):d);if(m)return m}return["",""]})(na);return tt(Xx({$os:i,$os_version:s,$browser:YA(na,navigator.vendor),$device:zI(na),$device_type:(n=na,r=zI(n),r===PA||r===BA||r==="Kobo"||r==="Kindle Fire"||r===XA?Ku:r===Ju||r===$s||r===ec||r===Sx?"Console":r===NA?"Wearable":r?Ha:"Desktop"),$timezone:nE(),$timezone_offset:QN()}),{$current_url:nc(ra?.href,o,rc),$host:ra?.host,$pathname:ra?.pathname,$raw_user_agent:na.length>1e3?na.substring(0,997)+"...":na,$browser_version:XN(na,navigator.vendor),$browser_language:qI(),$browser_language_prefix:(a=qI(),typeof a=="string"?a.split("-")[0]:void 0),$screen_height:E?.screen.height,$screen_width:E?.screen.width,$viewport_height:E?.innerHeight,$viewport_width:E?.innerWidth,$lib:"web",$lib_version:sr.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var so=ft("[Web Vitals]"),$I=9e5,_x=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(((n,r)=>Z({},n,{["$web_vitals_"+r.name+"_event"]:Z({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=n=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(z(o))so.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Tt();z(i)||(Ae(n?.name)||Ae(n?.value)?so.error("Invalid metric received",n):this.Rt&&n.value>=this.Rt?so.error("Ignoring metric with value >= "+this.Rt,n):(this.N.url!==i&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),z(this.N.url)&&(this.N.url=i),this.N.firstMetricTimestamp=z(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.N.metrics.push(Z({},n,{$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 n,r,o,i,s=te.__PosthogExtensions__;z(s)||z(s.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:o,onINP:i}=s.postHogWebVitalsCallbacks),n&&r&&o&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(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):so.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((a=this._instance.persistence)==null||!a.props[kI]),this.startIfEnabled()}get allowedMetrics(){var e,a,n=vt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return z(n)?((a=this._instance.persistence)==null?void 0:a.props[II])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(vt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=vt(this._instance.config.capture_performance)&&_n(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:$I;return 0<e&&e<=6e4?$I:e}get isEnabled(){var e=ra?.protocol;if(e!=="http:"&&e!=="https:")return so.info("Web Vitals are disabled on non-http/https protocols"),!1;var a=vt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:ho(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return ho(a)?a:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(so.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var a=vt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=vt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[kI]:a}),this._instance.persistence.register({[II]:n})),this.Et=a,this.startIfEnabled()}it(e){var a,n;(a=te.__PosthogExtensions__)!=null&&a.postHogWebVitalsCallbacks&&e(),(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"web-vitals",(r=>{r?so.error("failed to load script",r):e()}))}Tt(){var e=E?E.location.href:void 0;if(e){var a=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,r=a?Zs([],Ws,n||[]):[];return nc(e,r,rc)}so.error("Could not determine current URL")}},eH=ft("[Heatmaps]");function VI(t){return vt(t)&&"clientX"in t&&"clientY"in t&&_n(t.clientX)&&_n(t.clientY)}var wx=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[tx]),this.rageclicks=new _p(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return vt(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 z(this.instance.config.capture_heatmaps)?z(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;eH.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({[tx]: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(){E&&q&&(this.jt=this.Dt.bind(this),it(E,"beforeunload",this.jt),this.Lt=e=>this.At(e||E?.event),it(q,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||E?.event),it(q,"mousemove",this.Nt,{capture:!0}),this.zt=new Ip(this.instance,BN,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),it(q,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;E&&q&&(this.jt&&E.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 n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),i=(function(s,l,u){for(var c=s;c&&Hp(c)&&!go(c,"body");){if(c===u)return!1;if(fe(l,E?.getComputedStyle(c).position))return!0;c=LA(c)}return!1})(_A(e),["fixed","sticky"],o);return{x:e.clientX+(i?0:r),y:e.clientY+(i?0:n),target_fixed:i,type:a}}At(e,a){var n;if(a===void 0&&(a="click"),!AI(e.target)&&VI(e)){var r=this.qt(e,a);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(Z({},r,{type:"rageclick"})),this.Wt(r)}}Ut(e){!AI(e.target)&&VI(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(E){var a=E.location.href,n=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,o=n?Zs([],Ws,r||[]):[],i=nc(a,o,rc);this.N=this.N||{},this.N[i]||(this.N[i]=[]),this.N[i].push(e)}}Dt(){this.N&&!Us(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},Lx=class{constructor(e){this._instance=e}doPageView(e,a){var n,r=this.Gt(e,a);return this.Vt={pathname:(n=E?.location.pathname)!==null&&n!==void 0?n:"",pageViewId:a,timestamp:e},this._instance.scrollManager.resetContext(),r}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 n=this.Vt;if(!n)return{$pageview_id:a};var r={$pageview_id:a,$prev_pageview_id:n.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(!(z(i)||z(s)||z(l)||z(u)||z(c)||z(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 f=i<=1?1:bn(s/i,0,1,$),m=i<=1?1:bn(l/i,0,1,$),S=u<=1?1:bn(c/u,0,1,$),b=u<=1?1:bn(d/u,0,1,$);r=tt(r,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:S,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:b})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}},Ua=Uint8Array,$t=Uint16Array,Gs=Uint32Array,nb=new Ua([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]),rb=new Ua([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]),jI=new Ua([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rE=function(t,e){for(var a=new $t(31),n=0;n<31;++n)a[n]=e+=1<<t[n-1];var r=new Gs(a[30]);for(n=1;n<30;++n)for(var o=a[n];o<a[n+1];++o)r[o]=o-a[n]<<5|n;return[a,r]},oE=rE(nb,2),tH=oE[0],kx=oE[1];tH[28]=258,kx[258]=28;for(Ix=rE(rb,0)[1],Ep=new $t(32768),Pe=0;Pe<32768;++Pe)lo=(43690&Pe)>>>1|(21845&Pe)<<1,lo=(61680&(lo=(52428&lo)>>>2|(13107&lo)<<2))>>>4|(3855&lo)<<4,Ep[Pe]=((65280&lo)>>>8|(255&lo)<<8)>>>1;var lo,Ix,Ep,Pe,Zu=function(t,e,a){for(var n=t.length,r=0,o=new $t(e);r<n;++r)++o[t[r]-1];var i,s=new $t(e);for(r=0;r<e;++r)s[r]=s[r-1]+o[r-1]<<1;if(a){i=new $t(1<<e);var l=15-e;for(r=0;r<n;++r)if(t[r])for(var u=r<<4|t[r],c=e-t[r],d=s[t[r]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)i[Ep[d]>>>l]=u}else for(i=new $t(n),r=0;r<n;++r)i[r]=Ep[s[t[r]-1]++]>>>15-t[r];return i},yi=new Ua(288);for(Pe=0;Pe<144;++Pe)yi[Pe]=8;for(Pe=144;Pe<256;++Pe)yi[Pe]=9;for(Pe=256;Pe<280;++Pe)yi[Pe]=7;for(Pe=280;Pe<288;++Pe)yi[Pe]=8;var Tp=new Ua(32);for(Pe=0;Pe<32;++Pe)Tp[Pe]=5;var aH=Zu(yi,9,0),nH=Zu(Tp,5,0),iE=function(t){return(t/8>>0)+(7&t&&1)},sE=function(t,e,a){(a==null||a>t.length)&&(a=t.length);var n=new(t instanceof $t?$t:t instanceof Gs?Gs:Ua)(a-e);return n.set(t.subarray(e,a)),n},ir=function(t,e,a){a<<=7&e;var n=e/8>>0;t[n]|=a,t[n+1]|=a>>>8},Ou=function(t,e,a){a<<=7&e;var n=e/8>>0;t[n]|=a,t[n+1]|=a>>>8,t[n+2]|=a>>>16},My=function(t,e){for(var a=[],n=0;n<t.length;++n)t[n]&&a.push({s:n,f:t[n]});var r=a.length,o=a.slice();if(!r)return[new Ua(0),0];if(r==1){var i=new Ua(a[0].s+1);return i[a[0].s]=1,[i,1]}a.sort((function(_,L){return _.f-L.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!=r-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 f=o[0].s;for(n=1;n<r;++n)o[n].s>f&&(f=o[n].s);var m=new $t(f+1),S=Ax(a[c-1],m,0);if(S>e){n=0;var b=0,x=S-e,p=1<<x;for(o.sort((function(_,L){return m[L.s]-m[_.s]||_.f-L.f}));n<r;++n){var g=o[n].s;if(!(m[g]>e))break;b+=p-(1<<S-m[g]),m[g]=e}for(b>>>=x;b>0;){var v=o[n].s;m[v]<e?b-=1<<e-m[v]++-1:++n}for(;n>=0&&b;--n){var y=o[n].s;m[y]==e&&(--m[y],++b)}S=e}return[new Ua(m),S]},Ax=function(t,e,a){return t.s==-1?Math.max(Ax(t.l,e,a+1),Ax(t.r,e,a+1)):e[t.s]=a},GI=function(t){for(var e=t.length;e&&!t[--e];);for(var a=new $t(++e),n=0,r=t[0],o=1,i=function(l){a[n++]=l},s=1;s<=e;++s)if(t[s]==r&&s!=e)++o;else{if(!r&&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(r),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(r);o=1,r=t[s]}return[a.subarray(0,n),e]},Bu=function(t,e){for(var a=0,n=0;n<e.length;++n)a+=t[n]*e[n];return a},Ex=function(t,e,a){var n=a.length,r=iE(e+2);t[r]=255&n,t[r+1]=n>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var o=0;o<n;++o)t[r+o+4]=a[o];return 8*(r+4+n)},ZI=function(t,e,a,n,r,o,i,s,l,u,c){ir(e,c++,a),++r[256];for(var d=My(r,15),f=d[0],m=d[1],S=My(o,15),b=S[0],x=S[1],p=GI(f),g=p[0],v=p[1],y=GI(b),_=y[0],L=y[1],C=new $t(19),A=0;A<g.length;++A)C[31&g[A]]++;for(A=0;A<_.length;++A)C[31&_[A]]++;for(var w=My(C,7),k=w[0],T=w[1],D=19;D>4&&!k[jI[D-1]];--D);var M,P,F,U,V=u+5<<3,N=Bu(r,yi)+Bu(o,Tp)+i,X=Bu(r,f)+Bu(o,b)+i+14+3*D+Bu(C,k)+(2*C[16]+3*C[17]+7*C[18]);if(V<=N&&V<=X)return Ex(e,c,t.subarray(l,l+u));if(ir(e,c,1+(X<N)),c+=2,X<N){M=Zu(f,m,0),P=f,F=Zu(b,x,0),U=b;var ve=Zu(k,T,0);for(ir(e,c,v-257),ir(e,c+5,L-1),ir(e,c+10,D-4),c+=14,A=0;A<D;++A)ir(e,c+3*A,k[jI[A]]);c+=3*D;for(var qa=[g,_],pt=0;pt<2;++pt){var Vt=qa[pt];for(A=0;A<Vt.length;++A){var G=31&Vt[A];ir(e,c,ve[G]),c+=k[G],G>15&&(ir(e,c,Vt[A]>>>5&127),c+=Vt[A]>>>12)}}}else M=aH,P=yi,F=nH,U=Tp;for(A=0;A<s;++A)if(n[A]>255){G=n[A]>>>18&31,Ou(e,c,M[G+257]),c+=P[G+257],G>7&&(ir(e,c,n[A]>>>23&31),c+=nb[G]);var ne=31&n[A];Ou(e,c,F[ne]),c+=U[ne],ne>3&&(Ou(e,c,n[A]>>>5&8191),c+=rb[ne])}else Ou(e,c,M[n[A]]),c+=P[n[A]];return Ou(e,c,M[256]),c+P[256]},rH=new Gs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oH=(function(){for(var t=new Gs(256),e=0;e<256;++e){for(var a=e,n=9;--n;)a=(1&a&&3988292384)^a>>>1;t[e]=a}return t})(),iH=function(t,e,a,n,r){return(function(o,i,s,l,u,c){var d=o.length,f=new Ua(l+d+5*(1+Math.floor(d/7e3))+u),m=f.subarray(l,f.length-u),S=0;if(!i||d<8)for(var b=0;b<=d;b+=65535){var x=b+65535;x<d?S=Ex(m,S,o.subarray(b,x)):(m[b]=c,S=Ex(m,S,o.subarray(b,d)))}else{for(var p=rH[i-1],g=p>>>13,v=8191&p,y=(1<<s)-1,_=new $t(32768),L=new $t(y+1),C=Math.ceil(s/3),A=2*C,w=function(th){return(o[th]^o[th+1]<<C^o[th+2]<<A)&y},k=new Gs(25e3),T=new $t(288),D=new $t(32),M=0,P=0,F=(b=0,0),U=0,V=0;b<d;++b){var N=w(b),X=32767&b,ve=L[N];if(_[X]=ve,L[N]=X,U<=b){var qa=d-b;if((M>7e3||F>24576)&&qa>423){S=ZI(o,m,0,k,T,D,P,F,V,b-V,S),F=M=P=0,V=b;for(var pt=0;pt<286;++pt)T[pt]=0;for(pt=0;pt<30;++pt)D[pt]=0}var Vt=2,G=0,ne=v,Et=X-ve&32767;if(qa>2&&N==w(b-Et))for(var hr=Math.min(g,qa)-1,Qp=Math.min(32767,b),Jp=Math.min(258,qa);Et<=Qp&&--ne&&X!=ve;){if(o[b+Vt]==o[b+Vt-Et]){for(var mr=0;mr<Jp&&o[b+mr]==o[b+mr-Et];++mr);if(mr>Vt){if(Vt=mr,G=Et,mr>hr)break;var ST=Math.min(Et,mr-2),Jb=0;for(pt=0;pt<ST;++pt){var eh=b-Et+pt+32768&32767,e0=eh-_[eh]+32768&32767;e0>Jb&&(Jb=e0,ve=eh)}}}Et+=(X=ve)-(ve=_[X])+32768&32767}if(G){k[F++]=268435456|kx[Vt]<<18|Ix[G];var t0=31&kx[Vt],a0=31&Ix[G];P+=nb[t0]+rb[a0],++T[257+t0],++D[a0],U=b+Vt,++M}else k[F++]=o[b],++T[o[b]]}}S=ZI(o,m,c,k,T,D,P,F,V,b-V,S)}return sE(f,0,l+iE(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,n,!0)},Dy=function(t,e,a){for(;a;++e)t[e]=a,a>>>=8};function sH(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=oH[255&u^l[c]]^u>>>8;s=u},d:function(){return 4294967295^s}}})(),n=t.length;a.p(t);var r,o=iH(t,e,10+((r=e).filename&&r.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&&Dy(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),Dy(o,i-8,a.d()),Dy(o,i-4,n),o}var lH=function(t){var e,a,n,r,o="";for(e=a=0,n=(t=(t+"").replace(/\r\n/g,`
|
|
498
|
+
`,za,oo,io,an,rn,so,nn,Ay=class extends HTMLElement{constructor(){super();Cn(this,za);Cn(this,oo);Cn(this,io);Cn(this,an);Cn(this,rn);Cn(this,so,null);Cn(this,nn,null);pr(this,za,this.attachShadow({mode:"open",delegatesFocus:!0})),pr(this,oo,document.createElement("div")),ye(this,oo).setAttribute("part","mount"),ye(this,za).appendChild(ye(this,oo)),pr(this,io,document.createElement("div")),ye(this,io).id="portalRoot",ye(this,za).appendChild(ye(this,io)),pr(this,an,document.createElement("div")),ye(this,an).id="overlayContainer",Object.assign(ye(this,an).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),ye(this,za).appendChild(ye(this,an)),pr(this,rn,Z1()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){ye(this,so)?.unmount(),pr(this,so,null)}getMountNode(){return ye(this,oo)}getController(){return ye(this,rn)}getPortalRoot(){return ye(this,io)}getOverlayContainer(){return ye(this,an)}getShadowRoot(){return ye(this,za)}open(){ye(this,rn).setOpen(!0)}close(){ye(this,rn).setOpen(!1)}toggle(){ye(this,rn).toggle()}setOverrideFetcher(a){ye(this,nn)&&(pr(this,nn,{...ye(this,nn),fetcher:a}),this.render())}mountReactApp(a){pr(this,nn,a),this.render()}render(){!this.isConnected||!ye(this,nn)||(ye(this,so)||pr(this,so,(0,_I.createRoot)(ye(this,oo))),ye(this,so).render((0,Ey.jsx)(K1,{shadowRoot:ye(this,za),portalRoot:ye(this,io),overlayContainer:ye(this,an),children:(0,Ey.jsx)(xI,{...ye(this,nn),controller:ye(this,rn),canvasHost:this})})))}applyBaseStyles(){if(ye(this,za).adoptedStyleSheets!==void 0){let a=new CSSStyleSheet;a.replaceSync(SI),ye(this,za).adoptedStyleSheets=[a]}else{let a=document.createElement("style");a.textContent=SI,ye(this,za).appendChild(a)}}};za=new WeakMap,oo=new WeakMap,io=new WeakMap,an=new WeakMap,rn=new WeakMap,so=new WeakMap,nn=new WeakMap;var CI=()=>{typeof window>"u"||customElements.get(bI)||customElements.define(bI,Ay)};var Ty=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 b=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=P1(b)}let a=null,r=null,n=null,{runtime:o}=t;async function i(b){!o?.actions||b.length===0||(n?.isApplied()&&await n.revertAll(),n=await o.actions.applyBatch(b))}async function s(){n?.isApplied()&&(await n.revertAll(),n=null)}if(t.fetcher)try{r=t.fetcher,console.log("[SmartCanvas] Fetching initial config...");let b=await t.fetcher();a=b,console.log("[SmartCanvas] Config fetched:",`tiles=${b.tiles?.length??0},`,`actions=${b.actions?.length??0},`,`theme=${b.theme?.mode??"default"}`),b.actions?.length&&console.log("[SmartCanvas] Actions to apply:",b.actions.map((g,m)=>`[${m}] ${g.kind}${g.anchorId?` anchor="${g.anchorId.selector}"`:""}${g.label?` "${g.label}"`:""}`).join(", ")),b.actions&&b.actions.length>0&&o?.actions&&(await i(b.actions),console.log("[SmartCanvas] Initial actions applied successfully")),b.tiles&&o?.accumulator&&Jf(b.tiles,o.accumulator,b.actions)}catch(b){console.error("[SmartCanvas] Error fetching/applying initial config:",b)}e&&e();let l=Qf();CI();let u=document.createElement("smart-canvas");if(G1(u.getOverlayContainer()),t.tokens)for(let[b,g]of Object.entries(t.tokens))u.style.setProperty(b,g);let c=()=>{let b=t.target??document.body;b&&b.appendChild(u)};document.body?c():document.addEventListener("DOMContentLoaded",c,{once:!0}),l&&(console.log(`[SmartCanvas] Loading editor SDK for ${l} mode`),q1(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,f=t.integrations?.telemetry,h=t.fetcher??Cs({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});r||(r=h);let S={fetcher:h,pollIntervalMs:t.pollIntervalMs,experiments:d,telemetry:f,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 x={el:u,open:()=>u.open(),close:()=>u.close(),destroy:()=>{s(),u.remove()},setTokens:b=>{for(let[g,m]of Object.entries(b))u.style.setProperty(g,m)},getConfig:async()=>{if(r)try{let b=await r();return a=b,b}catch(b){console.error("[SmartCanvas] Error fetching config:",b)}return a??{tiles:[],actions:[],fetchedAt:""}},setEnabled:async b=>{b?a&&await i(a.actions):await s()},setOverrideFetcher:b=>{r=b,u.setOverrideFetcher(b),o?.accumulator&&b().then(g=>{g?.tiles&&Jf(g.tiles,o.accumulator,g.actions)}).catch(()=>{})},registerTelemetryProperties:b=>{f?.register?.(b)},getSessionId:()=>f?.getSessionId?.(),startSessionRecording:()=>{f?.startSessionRecording?.()},track:(b,g)=>f?.track?(f.track(b,g),!0):!1,runtime:o};if(typeof window<"u"){let b=window.SynOS;b&&(b.handle=x)}return x};typeof window<"u"&&(window.SmartCanvas={async create(t){return Ty(t)}});var uo=Y(tt(),1);var lo=Y(Ee(),1);function h$({tiles:t,intervalMs:e=7e3,telemetry:a}){let[r,n]=(0,uo.useState)(0),o=(0,uo.useMemo)(()=>[...t].sort((i,s)=>(i.priority??0)-(s.priority??0)),[t]);return(0,uo.useEffect)(()=>{a?.trackCanvasOpened("wheel")},[a]),(0,uo.useEffect)(()=>{if(o.length<=1)return;let i=setInterval(()=>{n(s=>(s+1)%o.length)},e);return()=>clearInterval(i)},[o,e]),(0,uo.useEffect)(()=>{let i=o[r];i&&a?.trackRectangleViewed(i.id,"wheel")},[r,o,a]),o.length?(0,lo.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,lo.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${r*100}%)`,width:`${o.length*100}%`},children:o.map(i=>(0,lo.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,lo.jsx)(zu,{config:i,surface:"wheel",telemetry:a})},i.id))}),(0,lo.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((i,s)=>(0,lo.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 qu(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function v$(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=qu(n),i=qu(eo);return o.major>i.major&&e.push(`Config schema v${n} is newer than SDK v${eo}. 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${eo}. Migrating config to current version.`),{valid:!0,warnings:e,errors:a,migratedConfig:CN(r,n)}):{valid:!0,warnings:e,errors:a}}function CN(t,e){let a={...t};return qu(e).major===1&&(a=wN(a)),a.schemaVersion=eo,a}function wN(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 y$(t){if(!t||typeof t!="object")return!1;let e=t,a=e.schemaVersion||"1.0",r=qu(a),n=qu(eo);return r.major<n.major||!e.schemaVersion}var LI={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function kI(){return LI}function Ry(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 Vu(t,e,a){return a===2?Ry(Ry(t+e)+"")%1e4/1e4:a===1?Ry(e+t)%1e3/1e3:null}function LN(t){return t<=0?[]:new Array(t).fill(1/t)}function pp(t,e){return t>=e[0]&&t<e[1]}function II(t,e){let a=Vu("__"+e[0],t,1);return a===null?!1:a>=e[1]&&a<e[2]}function AI(t,e){for(let a=0;a<e.length;a++)if(pp(t,e[a]))return a;return-1}function Oy(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function hp(t,e){if(!e.length)return!1;let a=!1,r=!1;for(let n=0;n<e.length;n++){let o=AN(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 kN(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 IN(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=>!kN(n[0],n[1],n[2]))}catch{return!1}}function AN(t,e,a){try{let r=new URL(t,"https://_");if(e==="regex"){let n=Oy(a);return n?n.test(r.href)||n.test(r.href.substring(r.origin.length)):!1}else if(e==="simple")return IN(r,a);return!1}catch{return!1}}function EI(t,e,a){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let r=LN(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 TI(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 RI(t){try{return t()}catch(e){return console.error(e),!1}}var My=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function ni(t,e,a){if(e=e||"",a=a||globalThis.crypto&&globalThis.crypto.subtle||LI.SubtleCrypto,!a)throw new Error("No SubtleCrypto implementation found");try{let r=await a.importKey("raw",My(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[n,o]=t.split("."),i=await a.decrypt({name:"AES-CBC",iv:My(n)},r,My(o));return new TextDecoder().decode(i)}catch{throw new Error("Failed to decrypt")}}function $u(t){return typeof t=="string"?t:JSON.stringify(t)}function La(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 MI(){let t;try{t="1.6.4"}catch{t=""}return t}function OI(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 wI(t){return typeof t=="object"&&t!==null}function mp(t){return t.urlPatterns&&t.variations.some(e=>wI(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>wI(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function gp(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 zt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},Cr=kI(),Es={fetchFeaturesCall:({host:t,clientKey:e,headers:a})=>Cr.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 Cr.fetch(`${t}/api/eval/${e}`,n)},eventSourceCall:({host:t,clientKey:e,headers:a})=>a?new Cr.EventSource(`${t}/sub/${e}`,{headers:a}):new Cr.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let a=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),RN()):document.visibilityState==="hidden"&&(t=window.setTimeout(TN,zt.idleStreamInterval))};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(Cr.localStorage=globalThis.localStorage)}catch{}var Ts=new Map,DI=!1,on=new Map,vp=new Map,Rs=new Map,Ms=new Set;function PI(t){Object.assign(zt,t),zt.backgroundSync||Hy()}async function NI({instance:t,timeout:e,skipCache:a,allowStale:r,backgroundSync:n}){return n||(zt.backgroundSync=!1),MN({instance:t,allowStale:r,timeout:e,skipCache:a})}function EN(t){let e=ju(t),a=Ts.get(e)||new Set;a.add(t),Ts.set(e,a)}function FI(t){Ts.forEach(e=>e.delete(t))}function TN(){Rs.forEach(t=>{t&&(t.state="idle",Ny(t))})}function RN(){Rs.forEach(t=>{t&&t.state==="idle"&&Fy(t)})}async function BI(){try{if(!Cr.localStorage)return;await Cr.localStorage.setItem(zt.cacheKey,JSON.stringify(Array.from(on.entries())))}catch{}}async function MN({instance:t,allowStale:e,timeout:a,skipCache:r}){let n=ju(t),o=By(t),i=new Date,s=new Date(i.getTime()-zt.maxAge+zt.staleTTL);await ON();let l=!zt.disableCache&&!r?on.get(o):void 0;return l&&(e||l.staleAt>i)&&l.staleAt>s?(l.sse&&Ms.add(n),l.staleAt<i?Dy(t):Py(t),{data:l.data,success:!0,source:"cache"}):await gp(Dy(t),a)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function ju(t){let[e,a]=t.getApiInfo();return`${e}||${a}`}function By(t){let e=ju(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 ON(){if(!DI){DI=!0;try{if(Cr.localStorage){let t=await Cr.localStorage.getItem(zt.cacheKey);if(!zt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([a,r])=>{on.set(a,{...r,staleAt:new Date(r.staleAt)})}),HI()}}}catch{}if(!zt.disableIdleStreams){let t=Es.startIdleListener();t&&(Es.stopIdleListener=t)}}}function HI(){let t=Array.from(on.entries()).map(([a,r])=>({key:a,staleAt:r.staleAt.getTime()})).sort((a,r)=>a.staleAt-r.staleAt),e=Math.min(Math.max(0,on.size-zt.maxEntries),on.size);for(let a=0;a<e;a++)on.delete(t[a].key)}function UI(t,e,a){let r=a.dateUpdated||"",n=new Date(Date.now()+zt.staleTTL),o=zt.disableCache?void 0:on.get(e);if(o&&r&&o.version===r){o.staleAt=n,BI();return}zt.disableCache||(on.set(e,{data:a,version:r,staleAt:n,sse:Ms.has(t)}),HI()),BI();let i=Ts.get(t);i&&i.forEach(s=>DN(s,a))}async function DN(t,e){await t.setPayload(e||t.getPayload())}async function Dy(t){let{apiHost:e,apiRequestHeaders:a}=t.getApiHosts(),r=t.getClientKey(),n="isRemoteEval"in t&&t.isRemoteEval(),o=ju(t),i=By(t),s=vp.get(i);return s||(s=(n?Es.fetchRemoteEvalCall({host:e,clientKey:r,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:a}):Es.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"&&Ms.add(o),u.json()}).then(u=>(UI(o,i,u),Py(t),vp.delete(i),{data:u,success:!0,source:"network"})).catch(u=>(vp.delete(i),{data:null,source:"error",success:!1,error:u})),vp.set(i,s)),s}function Py(t,e=!1){let a=ju(t),r=By(t),{streamingHost:n,streamingHostRequestHeaders:o}=t.getApiHosts(),i=t.getClientKey();if(e&&Ms.add(a),zt.backgroundSync&&Ms.has(a)&&Cr.EventSource){if(Rs.has(a))return;let s={src:null,host:n,clientKey:i,headers:o,cb:l=>{try{if(l.type==="features-updated"){let u=Ts.get(a);u&&u.forEach(c=>{Dy(c)})}else if(l.type==="features"){let u=JSON.parse(l.data);UI(a,r,u)}s.errors=0}catch{zI(s)}},errors:0,state:"active"};Rs.set(a,s),Fy(s)}}function zI(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);Ny(t),setTimeout(()=>{["idle","active"].includes(t.state)||Fy(t)},Math.min(e,3e5))}}function Ny(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function Fy(t){t.src=Es.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=()=>zI(t),t.src.onopen=()=>{t.errors=0}}function BN(t,e){Ny(t),Rs.delete(e)}function Hy(){Ms.clear(),Rs.forEach(BN),Ts.clear(),Es.stopIdleListener()}function yp(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&Py(t,!0),EN(t)}}var PN=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,qy={revert:function(){}},_p=new Map,Vy=new Set;function NN(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function Cp(t){var e=_p.get(t);return e||(e={element:t,attributes:{}},_p.set(t,e)),e}function wp(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,NN(e)),i}function Lp(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,qI()):t!==a&&(e.isDirty=!0,qI())}function FN(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),Lp(QN(e),t)}function HN(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(a){return a.mutate(e)}),Lp(Array.from(e).filter(Boolean).join(" "),t)}function UN(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),Lp(e,t)}function zN(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 qN(t){var e=t.originalValue;t.mutations.forEach(function(a){var r=a.mutate(),n=zN(r);e=n||e}),Lp(e,t)}var VN=function(e){return e.innerHTML},$N=function(e,a){return e.innerHTML=a};function $I(t){var e=Cp(t);return e.html||(e.html=wp(t,"html",VN,$N,FN)),e.html}var jN=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},GN=function(e,a){a.insertBeforeNode&&!a.parentNode.contains(a.insertBeforeNode)||a.parentNode.insertBefore(e,a.insertBeforeNode)};function jI(t){var e=Cp(t);return e.position||(e.position=wp(t,"position",jN,GN,qN)),e.position}var WN=function(e,a){return a?e.className=a:e.removeAttribute("class")},ZN=function(e){return e.className};function GI(t){var e=Cp(t);return e.classes||(e.classes=wp(t,"class",ZN,WN,HN)),e.classes}var XN=function(e){return function(a){var r;return(r=a.getAttribute(e))!=null?r:null}},KN=function(e){return function(a,r){return r!==null?a.setAttribute(e,r):a.removeAttribute(e)}};function WI(t,e){var a=Cp(t);return a.attributes[e]||(a.attributes[e]=wp(t,e,XN(e),KN(e),UN)),a.attributes[e]}function YN(t,e){var a=_p.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 xp;function QN(t){return xp||(xp=document.createElement("div")),xp.innerHTML=t,xp.innerHTML}function bp(t,e,a){if(a.isDirty){a.isDirty=!1;var r=a.virtualValue;a.mutations.length||YN(t,e),a.setValue(t,r)}}function JN(t,e){t.html&&bp(e,"html",t.html),t.classes&&bp(e,"class",t.classes),t.position&&bp(e,"position",t.position),Object.keys(t.attributes).forEach(function(a){bp(e,a,t.attributes[a])})}function qI(){_p.forEach(JN)}function eF(t,e){var a=null;t.kind==="html"?a=$I(e):t.kind==="class"?a=GI(e):t.kind==="attribute"?a=WI(e,t.attribute):t.kind==="position"&&(a=jI(e)),a&&(a.mutations.push(t),a.mutationRunner(a))}function tF(t,e){var a=null;if(t.kind==="html"?a=$I(e):t.kind==="class"?a=GI(e):t.kind==="attribute"?a=WI(e,t.attribute):t.kind==="position"&&(a=jI(e)),!!a){var r=a.mutations.indexOf(t);r!==-1&&a.mutations.splice(r,1),a.mutationRunner(a)}}function ZI(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),eF(t,r))})}}function aF(t){t.elements.forEach(function(e){return tF(t,e)}),t.elements.clear(),Vy.delete(t)}function VI(){Vy.forEach(ZI)}var Uy;function rF(){typeof document>"u"||(Uy||(Uy=new MutationObserver(function(){VI()})),VI(),Uy.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}rF();function kp(t){return typeof document>"u"?qy:(Vy.add(t),ZI(t),{revert:function(){aF(t)}})}function zy(t,e){return kp({kind:"html",elements:new Set,mutate:e,selector:t})}function XI(t,e){return kp({kind:"position",elements:new Set,mutate:e,selector:t})}function Gu(t,e){return kp({kind:"class",elements:new Set,mutate:e,selector:t})}function Sp(t,e,a){return PN.test(e)?e==="class"||e==="className"?Gu(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)})}):kp({kind:"attribute",attribute:e,elements:new Set,mutate:a,selector:t}):qy}function nF(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 zy(e,function(s){return s+(r??"")});if(a==="set")return zy(e,function(){return r??""})}else if(n==="class"){if(a==="append")return Gu(e,function(s){r&&s.add(r)});if(a==="remove")return Gu(e,function(s){r&&s.delete(r)});if(a==="set")return Gu(e,function(s){s.clear(),r&&s.add(r)})}else if(n==="position"){if(a==="set"&&o)return XI(e,function(){return{insertBeforeSelector:i,parentSelector:o}})}else{if(a==="append")return Sp(e,n,function(s){return s!==null?s+(r??""):r??""});if(a==="set")return Sp(e,n,function(){return r??""});if(a==="remove")return Sp(e,n,function(){return null})}return qy}var oF={html:zy,classes:Gu,attribute:Sp,position:XI,declarative:nF},KI=oF;var $y={};function co(t,e,a){a=a||{};for(let[r,n]of Object.entries(e))switch(r){case"$or":if(!JI(t,n,a))return!1;break;case"$nor":if(JI(t,n,a))return!1;break;case"$and":if(!cF(t,n,a))return!1;break;case"$not":if(co(t,n,a))return!1;break;default:if(!Wu(n,iF(t,r),a))return!1}return!0}function iF(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 YI(t,e=!1){let a=`${t}${e?"/i":""}`;return $y[a]||($y[a]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),$y[a]}function Wu(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)||!eA(t))return JSON.stringify(e)===JSON.stringify(t);for(let n in t)if(!uF(n,e,t[n],a))return!1;return!0}function eA(t){let e=Object.keys(t);return e.length>0&&e.filter(a=>a[0]==="$").length===e.length}function sF(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 lF(t,e,a){if(!Array.isArray(t))return!1;let r=eA(e)?n=>Wu(e,n,a):n=>co(n,e,a);for(let n=0;n<t.length;n++)if(t[n]&&r(t[n]))return!0;return!1}function Os(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 QI(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(Wu(e[n],t[i],a,r)){o=!0;break}if(!o)return!1}return!0}function uF(t,e,a,r){switch(t){case"$veq":return La(e)===La(a);case"$vne":return La(e)!==La(a);case"$vgt":return La(e)>La(a);case"$vgte":return La(e)>=La(a);case"$vlt":return La(e)<La(a);case"$vlte":return La(e)<=La(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)?Os(e,a):!1;case"$ini":return Array.isArray(a)?Os(e,a,!0):!1;case"$inGroup":return Os(e,r[a]||[]);case"$notInGroup":return!Os(e,r[a]||[]);case"$nin":return Array.isArray(a)?!Os(e,a):!1;case"$nini":return Array.isArray(a)?!Os(e,a,!0):!1;case"$not":return!Wu(a,e,r);case"$size":return Array.isArray(e)?Wu(a,e.length,r):!1;case"$elemMatch":return lF(e,a,r);case"$all":return Array.isArray(a)?QI(e,a,r):!1;case"$alli":return Array.isArray(a)?QI(e,a,r,!0):!1;case"$regex":try{return YI(a).test(e)}catch{return!1}case"$regexi":try{return YI(a,!0).test(e)}catch{return!1}case"$type":return sF(e)===a;default:return console.error("Unknown operator: "+t),!1}}function JI(t,e,a){if(!e.length)return!0;for(let r=0;r<e.length;r++)if(co(t,e[r],a))return!0;return!1}function cF(t,e,a){for(let r=0;r<e.length;r++)if(!co(t,e[r],a))return!1;return!0}var dF="Feature Evaluated",fF="Experiment Viewed";function pF(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 hF(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 Ds(t){try{await t()}catch{}}function tA(t,e,a){if(t.user.trackedExperiments){let n=Ep(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(Ds(()=>n(e,a,t.user)))}if(t.user.trackingCallback){let n=t.user.trackingCallback;r.push(Ds(()=>n(e,a)))}if(t.global.eventLogger){let n=t.global.eventLogger;r.push(Ds(()=>n(fF,{experimentId:e.key,variationId:a.key,hashAttribute:a.hashAttribute,hashValue:a.hashValue},t.user)))}return r}function mF(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;Ds(()=>r(e,a,t.user))}if(t.user.onFeatureUsage){let r=t.user.onFeatureUsage;Ds(()=>r(e,a))}if(t.global.eventLogger){let r=t.global.eventLogger;Ds(()=>r(dF,{feature:e,source:a.source,value:a.value,ruleId:a.source==="defaultValue"?"$default":a.ruleId||"",variationId:a.experimentResult?a.experimentResult.key:""},t.user))}}function Ip(t,e){if(e.stack.evaluatedFeatures.has(t))return fo(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let a=pF(e);if(a.has(t))return fo(e,t,a.get(t),"override");if(!e.global.features||!e.global.features[t])return fo(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=Ip(l.id,e);if(u.source==="cyclicPrerequisite")return fo(e,t,null,"cyclicPrerequisite");let c={value:u.value};if(!co(c,l.condition||{})){if(l.gate)return fo(e,t,null,"prerequisite");continue e}}if(o.filters&&nA(o.filters,e))continue;if("force"in o){if(o.condition&&!rA(o.condition,e)||!gF(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=>{!tA(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),fo(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}=Ap(i,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(i,s),s.inExperiment&&!s.passthrough)return fo(e,t,s.value,"experiment",o.id,i,s)}}return fo(e,t,r.defaultValue===void 0?null:r.defaultValue,"defaultValue")}function Ap(t,e,a){let r=t.key,n=t.variations.length;if(n<2)return{result:Ye(a,t,-1,!1,e)};if(a.global.enabled===!1||a.user.enabled===!1)return{result:Ye(a,t,-1,!1,e)};if(t=vF(t,a),t.urlPatterns&&!hp(a.user.url||"",t.urlPatterns))return{result:Ye(a,t,-1,!1,e)};let o=TI(r,a.user.url||"",n);if(o!==null)return{result:Ye(a,t,o,!1,e)};let i=hF(a);if(r in i){let b=i[r];return{result:Ye(a,t,b,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:Ye(a,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=oi(a,t.hashAttribute,a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:Ye(a,t,-1,!1,e)};let u=-1,c=!1,d=!1;if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:b,versionIsBlocked:g}=bF({ctx:a,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});c=b>=0,u=b,d=!!g}if(!c){if(t.filters){if(nA(t.filters,a))return{result:Ye(a,t,-1,!1,e)}}else if(t.namespace&&!II(l,t.namespace))return{result:Ye(a,t,-1,!1,e)};if(t.include&&!RI(t.include))return{result:Ye(a,t,-1,!1,e)};if(t.condition&&!rA(t.condition,a))return{result:Ye(a,t,-1,!1,e)};if(t.parentConditions){let b=new Set(a.stack.evaluatedFeatures);for(let g of t.parentConditions){a.stack.evaluatedFeatures=new Set(b);let m=Ip(g.id,a);if(m.source==="cyclicPrerequisite")return{result:Ye(a,t,-1,!1,e)};let y={value:m.value};if(!co(y,g.condition||{}))return{result:Ye(a,t,-1,!1,e)}}}if(t.groups&&!xF(t.groups,a))return{result:Ye(a,t,-1,!1,e)}}if(t.url&&!yF(t.url,a))return{result:Ye(a,t,-1,!1,e)};let f=Vu(t.seed||r,l,t.hashVersion||1);if(f===null)return{result:Ye(a,t,-1,!1,e)};if(!c){let b=t.ranges||EI(n,t.coverage===void 0?1:t.coverage,t.weights);u=AI(f,b)}if(d)return{result:Ye(a,t,-1,!1,e,void 0,!0)};if(u<0)return{result:Ye(a,t,-1,!1,e)};if("force"in t)return{result:Ye(a,t,t.force===void 0?-1:t.force,!1,e)};if(a.global.qaMode||a.user.qaMode)return{result:Ye(a,t,-1,!1,e)};if(t.status==="stopped")return{result:Ye(a,t,-1,!1,e)};let h=Ye(a,t,u,!0,e,f,c);if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:b,key:g,doc:m}=_F(a,s,$u(l),{[jy(t.key,t.bucketVersion)]:h.key});b&&(a.user.stickyBucketAssignmentDocs=a.user.stickyBucketAssignmentDocs||{},a.user.stickyBucketAssignmentDocs[g]=m,a.user.saveStickyBucketAssignmentDoc(m))}let S=tA(a,t,h);S.length===0&&a.global.saveDeferredTrack&&a.global.saveDeferredTrack({experiment:t,result:h});let x=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:h,trackingCall:x}}function fo(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"&&mF(t,e,s),s}function aA(t){return{...t.user.attributes,...t.user.attributeOverrides}}function rA(t,e){return co(aA(e),t,e.global.savedGroups||{})}function nA(t,e){return t.some(a=>{let{hashValue:r}=oi(e,a.attribute);if(!r)return!0;let n=Vu(a.seed,r,a.hashVersion||2);return n===null?!0:!a.ranges.some(o=>pp(n,o))})}function gF(t,e,a,r,n,o,i){if(!n&&o===void 0)return!0;if(!n&&o===0)return!1;let{hashValue:s}=oi(t,a,r);if(!s)return!1;let l=Vu(e,s,i||1);return l===null?!1:n?pp(l,n):o!==void 0?l<=o:!0}function Ye(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}=oi(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 vF(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=Oy(t.url))),t}function oi(t,e,a){let r=e||"id",n="",o=aA(t);return o[r]&&(n=o[r]),!n&&a&&(o[a]&&(n=o[a]),n&&(r=a)),{hashAttribute:r,hashValue:n}}function yF(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 xF(t,e){let a=e.global.groups||{};for(let r=0;r<t.length;r++)if(a[t[r]])return!0;return!1}function bF({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=jy(e,a),l=SF(t,r,n);if(o>0)for(let d=0;d<o;d++){let f=jy(e,d);if(l[f]!==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 jy(t,e){return e=e||0,`${t}__${e}`}function Gy(t,e){return`${t}||${e}`}function SF(t,e,a){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:r,hashValue:n}=oi(t,e),o=Gy(r,$u(n)),{hashAttribute:i,hashValue:s}=oi(t,a),l=s?Gy(i,$u(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 _F(t,e,a,r){let n=Gy(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 CF(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 oA(t,e,a){let r=Wy(t,a);return e.getAllAssignments(r)}function Wy(t,e){let a={};return CF(t,e).forEach(n=>{let{hashValue:o}=oi(t,n);a[n]=$u(o)}),a}async function iA(t,e,a){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await ni(t.encryptedFeatures,e,a))}catch(r){console.error(r)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await ni(t.encryptedExperiments,e,a))}catch(r){console.error(r)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await ni(t.encryptedSavedGroups,e,a))}catch(r){console.error(r)}delete t.encryptedSavedGroups}return t}function sA(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 Ep(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var Bs=typeof window<"u"&&typeof document<"u",wF=MI(),Zu=class{constructor(e){if(e=e||{},this.version=wF,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),Bs&&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 iA(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,yp(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&PI(e.cacheSettings),e.payload)return await this.setPayload(e.payload),yp(this,e),{success:!0,source:"init"};{let{data:a,...r}=await this._refresh({...e,allowStale:!0});return yp(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 sA(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 NI({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 ni(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 ni(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,FI(this),e.destroyAllStreams&&Hy(),this.logs=[],Bs&&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}=Ap(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=Ye(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:i}=Ap(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=mp(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let u=e.persistQueryString?OI(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(hp(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(Bs)Promise.all([...i?[gp(i,this._options.maxNavigateDelay??1e3)]:[],new Promise(f=>window.setTimeout(f,this._options.navigateDelay??d))]).then(()=>{try{c(u)}catch(f){console.error(f)}});else try{c(u)}catch(f){console.error(f)}}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&&mp(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 Ip(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=>[Ep(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(Ep(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(Bs?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let a=mp(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}:Bs?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!Bs)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(KI.declarative(r).revert)}),()=>{a.forEach(r=>r())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let a=this._getEvalContext(),r=await oA(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=Wy(r,a);return e.getAllAssignmentsSync(n)}inDevMode(){return!!this._options.enableDevMode}};var LF="https://experiment.syntrologie.com",Zy=class{constructor(e={}){D(this,"gb");D(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 Zu({...e,apiHost:e.apiHost??LF,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({...this.gb.getAttributes(),...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 Xy(t={}){return new Zy(t)}var lA="syntro_session_metrics",Tp=class{constructor(e={}){D(this,"metrics",new Map);D(this,"experiments");D(this,"attributePrefix");D(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(lA);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(lA,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function Ky(t={}){return new Tp(t)}var p={};jR(p,{BRAND:()=>YF,DIRTY:()=>ii,EMPTY_PATH:()=>EF,INVALID:()=>J,NEVER:()=>BH,OK:()=>qt,ParseStatus:()=>Bt,Schema:()=>le,ZodAny:()=>mo,ZodArray:()=>cn,ZodBigInt:()=>li,ZodBoolean:()=>ui,ZodBranded:()=>Ku,ZodCatch:()=>bi,ZodDate:()=>ci,ZodDefault:()=>xi,ZodDiscriminatedUnion:()=>Op,ZodEffects:()=>$a,ZodEnum:()=>vi,ZodError:()=>la,ZodFirstPartyTypeKind:()=>ee,ZodFunction:()=>Bp,ZodIntersection:()=>hi,ZodIssueCode:()=>P,ZodLazy:()=>mi,ZodLiteral:()=>gi,ZodMap:()=>zs,ZodNaN:()=>Vs,ZodNativeEnum:()=>yi,ZodNever:()=>cr,ZodNull:()=>fi,ZodNullable:()=>kr,ZodNumber:()=>si,ZodObject:()=>ua,ZodOptional:()=>qa,ZodParsedType:()=>Z,ZodPipeline:()=>Yu,ZodPromise:()=>go,ZodReadonly:()=>Si,ZodRecord:()=>Dp,ZodSchema:()=>le,ZodSet:()=>qs,ZodString:()=>ho,ZodSymbol:()=>Hs,ZodTransformer:()=>$a,ZodTuple:()=>Lr,ZodType:()=>le,ZodUndefined:()=>di,ZodUnion:()=>pi,ZodUnknown:()=>un,ZodVoid:()=>Us,addIssueToContext:()=>q,any:()=>iH,array:()=>cH,bigint:()=>tH,boolean:()=>xA,coerce:()=>DH,custom:()=>gA,date:()=>aH,datetimeRegex:()=>hA,defaultErrorMap:()=>sn,discriminatedUnion:()=>hH,effect:()=>kH,enum:()=>CH,function:()=>bH,getErrorMap:()=>Ps,getParsedType:()=>wr,instanceof:()=>JF,intersection:()=>mH,isAborted:()=>Rp,isAsync:()=>Ns,isDirty:()=>Mp,isValid:()=>po,late:()=>QF,lazy:()=>SH,literal:()=>_H,makeIssue:()=>Xu,map:()=>yH,nan:()=>eH,nativeEnum:()=>wH,never:()=>lH,null:()=>oH,nullable:()=>AH,number:()=>yA,object:()=>dH,objectUtil:()=>Yy,oboolean:()=>OH,onumber:()=>MH,optional:()=>IH,ostring:()=>RH,pipeline:()=>TH,preprocess:()=>EH,promise:()=>LH,quotelessJson:()=>kF,record:()=>vH,set:()=>xH,setErrorMap:()=>AF,strictObject:()=>fH,string:()=>vA,symbol:()=>rH,transformer:()=>kH,tuple:()=>gH,undefined:()=>nH,union:()=>pH,unknown:()=>sH,util:()=>pe,void:()=>uH});var pe;(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})(pe||(pe={}));var Yy;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Yy||(Yy={}));var Z=pe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wr=t=>{switch(typeof t){case"undefined":return Z.undefined;case"string":return Z.string;case"number":return Number.isNaN(t)?Z.nan:Z.number;case"boolean":return Z.boolean;case"function":return Z.function;case"bigint":return Z.bigint;case"symbol":return Z.symbol;case"object":return Array.isArray(t)?Z.array:t===null?Z.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Z.promise:typeof Map<"u"&&t instanceof Map?Z.map:typeof Set<"u"&&t instanceof Set?Z.set:typeof Date<"u"&&t instanceof Date?Z.date:Z.object;default:return Z.unknown}};var P=pe.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"]),kF=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),la=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,pe.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()}};la.create=t=>new la(t);var IF=(t,e)=>{let a;switch(t.code){case P.invalid_type:t.received===Z.undefined?a="Required":a=`Expected ${t.expected}, received ${t.received}`;break;case P.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,pe.jsonStringifyReplacer)}`;break;case P.unrecognized_keys:a=`Unrecognized key(s) in object: ${pe.joinValues(t.keys,", ")}`;break;case P.invalid_union:a="Invalid input";break;case P.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${pe.joinValues(t.options)}`;break;case P.invalid_enum_value:a=`Invalid enum value. Expected ${pe.joinValues(t.options)}, received '${t.received}'`;break;case P.invalid_arguments:a="Invalid function arguments";break;case P.invalid_return_type:a="Invalid function return type";break;case P.invalid_date:a="Invalid date";break;case P.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}"`:pe.assertNever(t.validation):t.validation!=="regex"?a=`Invalid ${t.validation}`:a="Invalid";break;case P.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 P.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 P.custom:a="Invalid input";break;case P.invalid_intersection_types:a="Intersection results could not be merged";break;case P.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case P.not_finite:a="Number must be finite";break;default:a=e.defaultError,pe.assertNever(t)}return{message:a}},sn=IF;var uA=sn;function AF(t){uA=t}function Ps(){return uA}var Xu=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}},EF=[];function q(t,e){let a=Ps(),r=Xu({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===sn?void 0:sn].filter(n=>!!n)});t.common.issues.push(r)}var Bt=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 J;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 J;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}}},J=Object.freeze({status:"aborted"}),ii=t=>({status:"dirty",value:t}),qt=t=>({status:"valid",value:t}),Rp=t=>t.status==="aborted",Mp=t=>t.status==="dirty",po=t=>t.status==="valid",Ns=t=>typeof Promise<"u"&&t instanceof Promise;var K;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(K||(K={}));var Va=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}},cA=(t,e)=>{if(po(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 la(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 wr(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Bt,ctx:{common:e.parent.common,data:e.data,parsedType:wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let a=this._parse(e);if(Ns(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:wr(e)},n=this._parseSync({data:e,path:r.path,parent:r});return cA(r,n)}"~validate"(e){let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wr(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:a});return po(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=>po(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:wr(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(Ns(n)?n:Promise.resolve(n));return cA(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:P.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 $a({schema:this,typeName:ee.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 qa.create(this,this._def)}nullable(){return kr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return cn.create(this)}promise(){return go.create(this,this._def)}or(e){return pi.create([this,e],this._def)}and(e){return hi.create(this,e,this._def)}transform(e){return new $a({...se(this._def),schema:this,typeName:ee.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let a=typeof e=="function"?e:()=>e;return new xi({...se(this._def),innerType:this,defaultValue:a,typeName:ee.ZodDefault})}brand(){return new Ku({typeName:ee.ZodBranded,type:this,...se(this._def)})}catch(e){let a=typeof e=="function"?e:()=>e;return new bi({...se(this._def),innerType:this,catchValue:a,typeName:ee.ZodCatch})}describe(e){let a=this.constructor;return new a({...this._def,description:e})}pipe(e){return Yu.create(this,e)}readonly(){return Si.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},TF=/^c[^\s-]{8,}$/i,RF=/^[0-9a-z]+$/,MF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,OF=/^[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,DF=/^[a-z0-9_-]{21}$/i,BF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,PF=/^[-+]?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)?)??$/,NF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,FF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Qy,HF=/^(?:(?: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])$/,UF=/^(?:(?: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])$/,zF=/^(([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]))$/,qF=/^(([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])$/,VF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$F=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,fA="((\\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])))",jF=new RegExp(`^${fA}$`);function pA(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 GF(t){return new RegExp(`^${pA(t)}$`)}function hA(t){let e=`${fA}T${pA(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 WF(t,e){return!!((e==="v4"||!e)&&HF.test(t)||(e==="v6"||!e)&&zF.test(t))}function ZF(t,e){if(!BF.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 XF(t,e){return!!((e==="v4"||!e)&&UF.test(t)||(e==="v6"||!e)&&qF.test(t))}var ho=class t extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Z.string){let o=this._getOrReturnCtx(e);return q(o,{code:P.invalid_type,expected:Z.string,received:o.parsedType}),J}let r=new Bt,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:P.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),q(n,{code:P.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?q(n,{code:P.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&q(n,{code:P.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")NF.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"email",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Qy||(Qy=new RegExp(FF,"u")),Qy.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"emoji",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")OF.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"uuid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")DF.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"nanoid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")TF.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"cuid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")RF.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"cuid2",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")MF.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"ulid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),q(n,{validation:"url",code:P.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),q(n,{validation:"regex",code:P.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),q(n,{code:P.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),q(n,{code:P.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),q(n,{code:P.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?hA(o).test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:P.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?jF.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:P.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?GF(o).test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:P.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?PF.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"duration",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?WF(e.data,o.version)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"ip",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?ZF(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"jwt",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?XF(e.data,o.version)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"cidr",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?VF.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"base64",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?$F.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"base64url",code:P.invalid_string,message:o.message}),r.dirty()):pe.assertNever(o);return{status:r.value,value:e.data}}_regex(e,a,r){return this.refinement(n=>e.test(n),{validation:a,code:P.invalid_string,...K.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...K.errToObj(e)})}url(e){return this._addCheck({kind:"url",...K.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...K.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...K.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...K.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...K.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...K.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...K.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...K.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...K.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...K.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...K.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...K.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,...K.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,...K.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...K.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...K.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a?.position,...K.errToObj(a?.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...K.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...K.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...K.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...K.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...K.errToObj(a)})}nonempty(e){return this.min(1,K.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}};ho.create=t=>new ho({checks:[],typeName:ee.ZodString,coerce:t?.coerce??!1,...se(t)});function KF(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 si=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)!==Z.number){let o=this._getOrReturnCtx(e);return q(o,{code:P.invalid_type,expected:Z.number,received:o.parsedType}),J}let r,n=new Bt;for(let o of this._def.checks)o.kind==="int"?pe.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),q(r,{code:P.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),q(r,{code:P.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),q(r,{code:P.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?KF(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),q(r,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),q(r,{code:P.not_finite,message:o.message}),n.dirty()):pe.assertNever(o);return{status:n.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,K.toString(a))}gt(e,a){return this.setLimit("min",e,!1,K.toString(a))}lte(e,a){return this.setLimit("max",e,!0,K.toString(a))}lt(e,a){return this.setLimit("max",e,!1,K.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:K.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:K.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:K.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:K.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:K.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:K.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:K.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"&&pe.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)}};si.create=t=>new si({checks:[],typeName:ee.ZodNumber,coerce:t?.coerce||!1,...se(t)});var li=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)!==Z.bigint)return this._getInvalidInput(e);let r,n=new Bt;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),q(r,{code:P.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),q(r,{code:P.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),q(r,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):pe.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let a=this._getOrReturnCtx(e);return q(a,{code:P.invalid_type,expected:Z.bigint,received:a.parsedType}),J}gte(e,a){return this.setLimit("min",e,!0,K.toString(a))}gt(e,a){return this.setLimit("min",e,!1,K.toString(a))}lte(e,a){return this.setLimit("max",e,!0,K.toString(a))}lt(e,a){return this.setLimit("max",e,!1,K.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:K.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:K.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:K.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:K.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}};li.create=t=>new li({checks:[],typeName:ee.ZodBigInt,coerce:t?.coerce??!1,...se(t)});var ui=class extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Z.boolean){let r=this._getOrReturnCtx(e);return q(r,{code:P.invalid_type,expected:Z.boolean,received:r.parsedType}),J}return qt(e.data)}};ui.create=t=>new ui({typeName:ee.ZodBoolean,coerce:t?.coerce||!1,...se(t)});var ci=class t extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Z.date){let o=this._getOrReturnCtx(e);return q(o,{code:P.invalid_type,expected:Z.date,received:o.parsedType}),J}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return q(o,{code:P.invalid_date}),J}let r=new Bt,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:P.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),q(n,{code:P.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):pe.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:K.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:K.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}};ci.create=t=>new ci({checks:[],coerce:t?.coerce||!1,typeName:ee.ZodDate,...se(t)});var Hs=class extends le{_parse(e){if(this._getType(e)!==Z.symbol){let r=this._getOrReturnCtx(e);return q(r,{code:P.invalid_type,expected:Z.symbol,received:r.parsedType}),J}return qt(e.data)}};Hs.create=t=>new Hs({typeName:ee.ZodSymbol,...se(t)});var di=class extends le{_parse(e){if(this._getType(e)!==Z.undefined){let r=this._getOrReturnCtx(e);return q(r,{code:P.invalid_type,expected:Z.undefined,received:r.parsedType}),J}return qt(e.data)}};di.create=t=>new di({typeName:ee.ZodUndefined,...se(t)});var fi=class extends le{_parse(e){if(this._getType(e)!==Z.null){let r=this._getOrReturnCtx(e);return q(r,{code:P.invalid_type,expected:Z.null,received:r.parsedType}),J}return qt(e.data)}};fi.create=t=>new fi({typeName:ee.ZodNull,...se(t)});var mo=class extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return qt(e.data)}};mo.create=t=>new mo({typeName:ee.ZodAny,...se(t)});var un=class extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return qt(e.data)}};un.create=t=>new un({typeName:ee.ZodUnknown,...se(t)});var cr=class extends le{_parse(e){let a=this._getOrReturnCtx(e);return q(a,{code:P.invalid_type,expected:Z.never,received:a.parsedType}),J}};cr.create=t=>new cr({typeName:ee.ZodNever,...se(t)});var Us=class extends le{_parse(e){if(this._getType(e)!==Z.undefined){let r=this._getOrReturnCtx(e);return q(r,{code:P.invalid_type,expected:Z.void,received:r.parsedType}),J}return qt(e.data)}};Us.create=t=>new Us({typeName:ee.ZodVoid,...se(t)});var cn=class t extends le{_parse(e){let{ctx:a,status:r}=this._processInputParams(e),n=this._def;if(a.parsedType!==Z.array)return q(a,{code:P.invalid_type,expected:Z.array,received:a.parsedType}),J;if(n.exactLength!==null){let i=a.data.length>n.exactLength.value,s=a.data.length<n.exactLength.value;(i||s)&&(q(a,{code:i?P.too_big:P.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&&(q(a,{code:P.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&&(q(a,{code:P.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 Va(a,i,a.path,s)))).then(i=>Bt.mergeArray(r,i));let o=[...a.data].map((i,s)=>n.type._parseSync(new Va(a,i,a.path,s)));return Bt.mergeArray(r,o)}get element(){return this._def.type}min(e,a){return new t({...this._def,minLength:{value:e,message:K.toString(a)}})}max(e,a){return new t({...this._def,maxLength:{value:e,message:K.toString(a)}})}length(e,a){return new t({...this._def,exactLength:{value:e,message:K.toString(a)}})}nonempty(e){return this.min(1,e)}};cn.create=(t,e)=>new cn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ee.ZodArray,...se(e)});function Fs(t){if(t instanceof ua){let e={};for(let a in t.shape){let r=t.shape[a];e[a]=qa.create(Fs(r))}return new ua({...t._def,shape:()=>e})}else return t instanceof cn?new cn({...t._def,type:Fs(t.element)}):t instanceof qa?qa.create(Fs(t.unwrap())):t instanceof kr?kr.create(Fs(t.unwrap())):t instanceof Lr?Lr.create(t.items.map(e=>Fs(e))):t}var ua=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=pe.objectKeys(e);return this._cached={shape:e,keys:a},this._cached}_parse(e){if(this._getType(e)!==Z.object){let u=this._getOrReturnCtx(e);return q(u,{code:P.invalid_type,expected:Z.object,received:u.parsedType}),J}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof cr&&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 Va(n,d,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof cr){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&&(q(n,{code:P.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 Va(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,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>Bt.mergeObjectSync(r,u)):Bt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return K.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:K.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:ee.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 pe.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 pe.objectKeys(this.shape))e[r]||(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}deepPartial(){return Fs(this)}partial(e){let a={};for(let r of pe.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 pe.objectKeys(this.shape))if(e&&!e[r])a[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof qa;)o=o._def.innerType;a[r]=o}return new t({...this._def,shape:()=>a})}keyof(){return mA(pe.objectKeys(this.shape))}};ua.create=(t,e)=>new ua({shape:()=>t,unknownKeys:"strip",catchall:cr.create(),typeName:ee.ZodObject,...se(e)});ua.strictCreate=(t,e)=>new ua({shape:()=>t,unknownKeys:"strict",catchall:cr.create(),typeName:ee.ZodObject,...se(e)});ua.lazycreate=(t,e)=>new ua({shape:t,unknownKeys:"strip",catchall:cr.create(),typeName:ee.ZodObject,...se(e)});var pi=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 la(s.ctx.common.issues));return q(a,{code:P.invalid_union,unionErrors:i}),J}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 la(l));return q(a,{code:P.invalid_union,unionErrors:s}),J}}get options(){return this._def.options}};pi.create=(t,e)=>new pi({options:t,typeName:ee.ZodUnion,...se(e)});var ln=t=>t instanceof mi?ln(t.schema):t instanceof $a?ln(t.innerType()):t instanceof gi?[t.value]:t instanceof vi?t.options:t instanceof yi?pe.objectValues(t.enum):t instanceof xi?ln(t._def.innerType):t instanceof di?[void 0]:t instanceof fi?[null]:t instanceof qa?[void 0,...ln(t.unwrap())]:t instanceof kr?[null,...ln(t.unwrap())]:t instanceof Ku||t instanceof Si?ln(t.unwrap()):t instanceof bi?ln(t._def.innerType):[],Op=class t extends le{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==Z.object)return q(a,{code:P.invalid_type,expected:Z.object,received:a.parsedType}),J;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}):(q(a,{code:P.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),J)}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=ln(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:ee.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:n,...se(r)})}};function Jy(t,e){let a=wr(t),r=wr(e);if(t===e)return{valid:!0,data:t};if(a===Z.object&&r===Z.object){let n=pe.objectKeys(e),o=pe.objectKeys(t).filter(s=>n.indexOf(s)!==-1),i={...t,...e};for(let s of o){let l=Jy(t[s],e[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(a===Z.array&&r===Z.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=Jy(i,s);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return a===Z.date&&r===Z.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var hi=class extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(Rp(o)||Rp(i))return J;let s=Jy(o.value,i.value);return s.valid?((Mp(o)||Mp(i))&&a.dirty(),{status:a.value,value:s.data}):(q(r,{code:P.invalid_intersection_types}),J)};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}))}};hi.create=(t,e,a)=>new hi({left:t,right:e,typeName:ee.ZodIntersection,...se(a)});var Lr=class t extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==Z.array)return q(r,{code:P.invalid_type,expected:Z.array,received:r.parsedType}),J;if(r.data.length<this._def.items.length)return q(r,{code:P.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J;!this._def.rest&&r.data.length>this._def.items.length&&(q(r,{code:P.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 Va(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>Bt.mergeArray(a,i)):Bt.mergeArray(a,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Lr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Lr({items:t,typeName:ee.ZodTuple,rest:null,...se(e)})};var Dp=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!==Z.object)return q(r,{code:P.invalid_type,expected:Z.object,received:r.parsedType}),J;let n=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)n.push({key:o._parse(new Va(r,s,r.path,s)),value:i._parse(new Va(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?Bt.mergeObjectAsync(a,n):Bt.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:ee.ZodRecord,...se(r)}):new t({keyType:ho.create(),valueType:e,typeName:ee.ZodRecord,...se(a)})}},zs=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!==Z.map)return q(r,{code:P.invalid_type,expected:Z.map,received:r.parsedType}),J;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,l],u)=>({key:n._parse(new Va(r,s,r.path,[u,"key"])),value:o._parse(new Va(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 J;(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 J;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}}}};zs.create=(t,e,a)=>new zs({valueType:e,keyType:t,typeName:ee.ZodMap,...se(a)});var qs=class t extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==Z.set)return q(r,{code:P.invalid_type,expected:Z.set,received:r.parsedType}),J;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(q(r,{code:P.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&&(q(r,{code:P.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 J;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 Va(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:K.toString(a)}})}max(e,a){return new t({...this._def,maxSize:{value:e,message:K.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}};qs.create=(t,e)=>new qs({valueType:t,minSize:null,maxSize:null,typeName:ee.ZodSet,...se(e)});var Bp=class t extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==Z.function)return q(a,{code:P.invalid_type,expected:Z.function,received:a.parsedType}),J;function r(s,l){return Xu({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Ps(),sn].filter(u=>!!u),issueData:{code:P.invalid_arguments,argumentsError:l}})}function n(s,l){return Xu({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Ps(),sn].filter(u=>!!u),issueData:{code:P.invalid_return_type,returnTypeError:l}})}let o={errorMap:a.common.contextualErrorMap},i=a.data;if(this._def.returns instanceof go){let s=this;return qt(async function(...l){let u=new la([]),c=await s._def.args.parseAsync(l,o).catch(h=>{throw u.addIssue(r(l,h)),u}),d=await Reflect.apply(i,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(h=>{throw u.addIssue(n(d,h)),u})})}else{let s=this;return qt(function(...l){let u=s._def.args.safeParse(l,o);if(!u.success)throw new la([r(l,u.error)]);let c=Reflect.apply(i,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new la([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:Lr.create(e).rest(un.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||Lr.create([]).rest(un.create()),returns:a||un.create(),typeName:ee.ZodFunction,...se(r)})}},mi=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})}};mi.create=(t,e)=>new mi({getter:t,typeName:ee.ZodLazy,...se(e)});var gi=class extends le{_parse(e){if(e.data!==this._def.value){let a=this._getOrReturnCtx(e);return q(a,{received:a.data,code:P.invalid_literal,expected:this._def.value}),J}return{status:"valid",value:e.data}}get value(){return this._def.value}};gi.create=(t,e)=>new gi({value:t,typeName:ee.ZodLiteral,...se(e)});function mA(t,e){return new vi({values:t,typeName:ee.ZodEnum,...se(e)})}var vi=class t extends le{_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),r=this._def.values;return q(a,{expected:pe.joinValues(r),received:a.parsedType,code:P.invalid_type}),J}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 q(a,{received:a.data,code:P.invalid_enum_value,options:r}),J}return qt(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})}};vi.create=mA;var yi=class extends le{_parse(e){let a=pe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Z.string&&r.parsedType!==Z.number){let n=pe.objectValues(a);return q(r,{expected:pe.joinValues(n),received:r.parsedType,code:P.invalid_type}),J}if(this._cache||(this._cache=new Set(pe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=pe.objectValues(a);return q(r,{received:r.data,code:P.invalid_enum_value,options:n}),J}return qt(e.data)}get enum(){return this._def.values}};yi.create=(t,e)=>new yi({values:t,typeName:ee.ZodNativeEnum,...se(e)});var go=class extends le{unwrap(){return this._def.type}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==Z.promise&&a.common.async===!1)return q(a,{code:P.invalid_type,expected:Z.promise,received:a.parsedType}),J;let r=a.parsedType===Z.promise?a.data:Promise.resolve(a.data);return qt(r.then(n=>this._def.type.parseAsync(n,{path:a.path,errorMap:a.common.contextualErrorMap})))}};go.create=(t,e)=>new go({type:t,typeName:ee.ZodPromise,...se(e)});var $a=class extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ee.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=>{q(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 J;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?J:l.status==="dirty"?ii(l.value):a.value==="dirty"?ii(l.value):l});{if(a.value==="aborted")return J;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?J:s.status==="dirty"?ii(s.value):a.value==="dirty"?ii(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"?J:(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"?J:(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(!po(i))return J;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=>po(i)?Promise.resolve(n.transform(i.value,o)).then(s=>({status:a.value,value:s})):J);pe.assertNever(n)}};$a.create=(t,e,a)=>new $a({schema:t,typeName:ee.ZodEffects,effect:e,...se(a)});$a.createWithPreprocess=(t,e,a)=>new $a({schema:e,effect:{type:"preprocess",transform:t},typeName:ee.ZodEffects,...se(a)});var qa=class extends le{_parse(e){return this._getType(e)===Z.undefined?qt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};qa.create=(t,e)=>new qa({innerType:t,typeName:ee.ZodOptional,...se(e)});var kr=class extends le{_parse(e){return this._getType(e)===Z.null?qt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};kr.create=(t,e)=>new kr({innerType:t,typeName:ee.ZodNullable,...se(e)});var xi=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return a.parsedType===Z.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:a.path,parent:a})}removeDefault(){return this._def.innerType}};xi.create=(t,e)=>new xi({innerType:t,typeName:ee.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...se(e)});var bi=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 Ns(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new la(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new la(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};bi.create=(t,e)=>new bi({innerType:t,typeName:ee.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...se(e)});var Vs=class extends le{_parse(e){if(this._getType(e)!==Z.nan){let r=this._getOrReturnCtx(e);return q(r,{code:P.invalid_type,expected:Z.nan,received:r.parsedType}),J}return{status:"valid",value:e.data}}};Vs.create=t=>new Vs({typeName:ee.ZodNaN,...se(t)});var YF=Symbol("zod_brand"),Ku=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}},Yu=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"?J:o.status==="dirty"?(a.dirty(),ii(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"?J: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:ee.ZodPipeline})}},Si=class extends le{_parse(e){let a=this._def.innerType._parse(e),r=n=>(po(n)&&(n.value=Object.freeze(n.value)),n);return Ns(a)?a.then(n=>r(n)):r(a)}unwrap(){return this._def.innerType}};Si.create=(t,e)=>new Si({innerType:t,typeName:ee.ZodReadonly,...se(e)});function dA(t,e){let a=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof a=="string"?{message:a}:a}function gA(t,e={},a){return t?mo.create().superRefine((r,n)=>{let o=t(r);if(o instanceof Promise)return o.then(i=>{if(!i){let s=dA(e,r),l=s.fatal??a??!0;n.addIssue({code:"custom",...s,fatal:l})}});if(!o){let i=dA(e,r),s=i.fatal??a??!0;n.addIssue({code:"custom",...i,fatal:s})}}):mo.create()}var QF={object:ua.lazycreate},ee;(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"})(ee||(ee={}));var JF=(t,e={message:`Input not instance of ${t.name}`})=>gA(a=>a instanceof t,e),vA=ho.create,yA=si.create,eH=Vs.create,tH=li.create,xA=ui.create,aH=ci.create,rH=Hs.create,nH=di.create,oH=fi.create,iH=mo.create,sH=un.create,lH=cr.create,uH=Us.create,cH=cn.create,dH=ua.create,fH=ua.strictCreate,pH=pi.create,hH=Op.create,mH=hi.create,gH=Lr.create,vH=Dp.create,yH=zs.create,xH=qs.create,bH=Bp.create,SH=mi.create,_H=gi.create,CH=vi.create,wH=yi.create,LH=go.create,kH=$a.create,IH=qa.create,AH=kr.create,EH=$a.createWithPreprocess,TH=Yu.create,RH=()=>vA().optional(),MH=()=>yA().optional(),OH=()=>xA().optional(),DH={string:(t=>ho.create({...t,coerce:!0})),number:(t=>si.create({...t,coerce:!0})),boolean:(t=>ui.create({...t,coerce:!0})),bigint:(t=>li.create({...t,coerce:!0})),date:(t=>ci.create({...t,coerce:!0}))};var BH=J;var bA=p.union([p.object({type:p.literal("data"),key:p.string(),value:p.string().optional()}),p.object({type:p.literal("css"),value:p.string()}),p.object({type:p.literal("aria"),role:p.string().optional(),label:p.string().optional()}),p.object({type:p.literal("shadow-css"),value:p.string()}),p.object({type:p.literal("ref"),el:p.any()})]),PH=p.object({kind:p.literal("tooltip"),id:p.string(),anchor:bA,content:p.object({title:p.string().optional(),body:p.string()}),placement:p.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:p.number().optional(),blocking:p.boolean().optional(),trigger:p.enum(["immediate","hover","click"]).optional(),dismiss:p.object({onEsc:p.boolean().optional(),closeButton:p.boolean().optional(),timeoutMs:p.number().optional()}).optional()}),NH=p.object({kind:p.literal("highlight"),id:p.string(),anchor:bA,copy:p.string().optional(),ring:p.object({paddingPx:p.number().optional(),radiusPx:p.number().optional()}).optional(),scrim:p.object({opacity:p.number().optional()}).optional(),ringColor:p.string().optional(),blocking:p.boolean().optional(),dismiss:p.object({onClickOutside:p.boolean().optional(),onEsc:p.boolean().optional(),timeoutMs:p.number().optional()}).optional()}),ex=p.object({id:p.string(),version:p.number(),routes:p.array(p.string()).optional(),steps:p.array(p.union([PH,NH]))});function x8(t){return ex.parse(t)}var C8=({configUri:t,experiments:e,featureKey:a="smart-canvas-overlay-uri",credentials:r="include"}={})=>async()=>{let n=ny({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 ex.parse(i)};var Pp=Y(tt(),1),SA=Y(il(),1);function L8({element:t,children:e}){let[a,r]=(0,Pp.useState)(null);return(0,Pp.useLayoutEffect)(()=>{if(!t){r(null);return}return r(t.getMountNode()),()=>r(null)},[t]),a?(0,SA.createPortal)(e,a):null}function FH(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let a=0;a<16;a++)e+=t[Math.floor(Math.random()*t.length)];return e}var tx=class{constructor(){D(this,"sessionId");this.sessionId=FH(),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 ax(){return new tx}var E=typeof window<"u"?window:void 0,Ft=typeof globalThis<"u"?globalThis:E;typeof self>"u"&&(Ft.self=Ft),typeof File>"u"&&(Ft.File=function(){});var vE=Array.prototype,_A=vE.forEach,CA=vE.indexOf,Ia=Ft?.navigator,V=Ft?.document,Nt=Ft?.location,bx=Ft?.fetch,Sx=Ft!=null&&Ft.XMLHttpRequest&&"withCredentials"in new Ft.XMLHttpRequest?Ft.XMLHttpRequest:void 0,wA=Ft?.AbortController,ca=Ia?.userAgent,Q=E??{},pn={DEBUG:!1,LIB_VERSION:"1.341.0"};function LA(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 Zs(t){return function(){var e=this,a=arguments;return new Promise((function(r,n){var o=t.apply(e,a);function i(l){LA(o,r,n,i,s,"next",l)}function s(l){LA(o,r,n,i,s,"throw",l)}i(void 0)}))}}function W(){return W=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},W.apply(null,arguments)}function yE(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 HH=["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"],kA=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var a=t.toLowerCase();return HH.concat(e).some((r=>{var n=r.toLowerCase();return a.indexOf(n)!==-1}))},UH=["$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 he(t,e){return t.indexOf(e)!==-1}var fh=function(t){return t.trim()},_x=function(t){return t.replace(/^\$/,"")},zH=Array.isArray,xE=Object.prototype,bE=xE.hasOwnProperty,ph=xE.toString,Ce=zH||function(t){return ph.call(t)==="[object Array]"},_o=t=>typeof t=="function",xt=t=>t===Object(t)&&!Ce(t),Xs=t=>{if(xt(t)){for(var e in t)if(bE.call(t,e))return!1;return!0}return!1},$=t=>t===void 0,bt=t=>ph.call(t)=="[object String]",Cx=t=>bt(t)&&t.trim().length===0,dr=t=>t===null,ge=t=>$(t)||dr(t),xn=t=>ph.call(t)=="[object Number]"&&t==t,Gs=t=>xn(t)&&t>0,yn=t=>ph.call(t)==="[object Boolean]",qH=t=>t instanceof FormData,VH=t=>he(UH,t);function wx(t){return t===null||typeof t!="object"}function $p(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function SE(t){return!$(Event)&&(function(e,a){try{return e instanceof a}catch{return!1}})(t,Event)}var $H=[!0,"true",1,"1","yes"],rx=t=>he($H,t),jH=[!1,"false",0,"0","no"];function Ar(t,e,a,r,n){return e>a&&(r.warn("min cannot be greater than max."),e=a),xn(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),Ar(n||a,e,a,r))}var Lx=class{constructor(e){this.t={},this.i=e.i,this.o=Ar(e.bucketSize,0,100,e.h),this.m=Ar(e.refillRate,0,this.o,e.h),this.$=Ar(e.refillInterval,0,864e5,e.h)}S(e,a){var r=a-e.lastAccess,n=Math.floor(r/this.$);if(n>0){var o=n*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+n*this.$}}consumeRateLimit(e){var a,r=Date.now(),n=String(e),o=this.t[n];return o?this.S(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={}}},ja="Mobile",jp="iOS",vn="Android",yc="Tablet",_E=vn+" "+yc,CE="iPad",wE="Apple",LE=wE+" Watch",xc="Safari",Js="BlackBerry",kE="Samsung",IE=kE+"Browser",AE=kE+" Internet",Li="Chrome",GH=Li+" OS",EE=Li+" "+jp,Ob="Internet Explorer",TE=Ob+" "+ja,Db="Opera",WH=Db+" Mini",Bb="Edge",RE="Microsoft "+Bb,Ys="Firefox",ME=Ys+" "+jp,bc="Nintendo",Sc="PlayStation",Qs="Xbox",OE=vn+" "+ja,DE=ja+" "+xc,sc="Windows",kx=sc+" Phone",IA="Nokia",Ix="Ouya",BE="Generic",ZH=BE+" "+ja.toLowerCase(),PE=BE+" "+yc.toLowerCase(),Ax="Konqueror",Xt="(\\d+(\\.\\d+)?)",nx=new RegExp("Version/"+Xt),XH=new RegExp(Qs,"i"),KH=new RegExp(Sc+" \\w+","i"),YH=new RegExp(bc+" \\w+","i"),Pb=new RegExp(Js+"|PlayBook|BB10","i"),QH={"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"},Np,AA,ox,JH=(t,e)=>e&&he(e,wE)||(function(a){return he(a,xc)&&!he(a,Li)&&!he(a,vn)})(t),NE=function(t,e){return e=e||"",he(t," OPR/")&&he(t,"Mini")?WH:he(t," OPR/")?Db:Pb.test(t)?Js:he(t,"IE"+ja)||he(t,"WPDesktop")?TE:he(t,IE)?AE:he(t,Bb)||he(t,"Edg/")?RE:he(t,"FBIOS")?"Facebook "+ja:he(t,"UCWEB")||he(t,"UCBrowser")?"UC Browser":he(t,"CriOS")?EE:he(t,"CrMo")||he(t,Li)?Li:he(t,vn)&&he(t,xc)?OE:he(t,"FxiOS")?ME:he(t.toLowerCase(),Ax.toLowerCase())?Ax:JH(t,e)?he(t,ja)?DE:xc:he(t,Ys)?Ys:he(t,"MSIE")||he(t,"Trident/")?Ob:he(t,"Gecko")?Ys:""},e3={[TE]:[new RegExp("rv:"+Xt)],[RE]:[new RegExp(Bb+"?\\/"+Xt)],[Li]:[new RegExp("("+Li+"|CrMo)\\/"+Xt)],[EE]:[new RegExp("CriOS\\/"+Xt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Xt)],[xc]:[nx],[DE]:[nx],[Db]:[new RegExp("(Opera|OPR)\\/"+Xt)],[Ys]:[new RegExp(Ys+"\\/"+Xt)],[ME]:[new RegExp("FxiOS\\/"+Xt)],[Ax]:[new RegExp("Konqueror[:/]?"+Xt,"i")],[Js]:[new RegExp(Js+" "+Xt),nx],[OE]:[new RegExp("android\\s"+Xt,"i")],[AE]:[new RegExp(IE+"\\/"+Xt)],[Ob]:[new RegExp("(rv:|MSIE )"+Xt)],Mozilla:[new RegExp("rv:"+Xt)]},t3=function(t,e){var a=NE(t,e),r=e3[a];if($(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},EA=[[new RegExp(Qs+"; "+Qs+" (.*?)[);]","i"),t=>[Qs,t&&t[1]||""]],[new RegExp(bc,"i"),[bc,""]],[new RegExp(Sc,"i"),[Sc,""]],[Pb,[Js,""]],[new RegExp(sc,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[kx,""];if(new RegExp(ja).test(e)&&!/IEMobile\b/.test(e))return[sc+" "+ja,""];var a=/Windows NT ([0-9.]+)/i.exec(e);if(a&&a[1]){var r=a[1],n=QH[r]||"";return/arm/i.test(e)&&(n="RT"),[sc,n]}return[sc,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[jp,e.join(".")]}return[jp,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=$(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+vn+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+vn+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[vn,e.join(".")]}return[vn,""]}],[/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/,[GH,""]],[/Linux|debian/i,["Linux",""]]],TA=function(t){return YH.test(t)?bc:KH.test(t)?Sc:XH.test(t)?Qs:new RegExp(Ix,"i").test(t)?Ix:new RegExp("("+kx+"|WPDesktop)","i").test(t)?kx:/iPad/.test(t)?CE:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?LE:Pb.test(t)?Js:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(IA,"i").test(t)?IA:/(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(ja).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)?vn:_E:new RegExp("(pda|"+ja+")","i").test(t)?ZH:new RegExp(yc,"i").test(t)&&!new RegExp(yc+" pc","i").test(t)?PE:""},a3=t=>t instanceof Error;function r3(t){var e=globalThis._posthogChunkIds;if(e){var a=Object.keys(e);return ox&&a.length===AA||(AA=a.length,ox=a.reduce(((r,n)=>{Np||(Np={});var o=Np[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,Np[n]=[u,c];break}}return r}),{})),ox}}var Ex=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 Zs((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&Ce(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)),W({},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 Zs((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,W({},a,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:r3(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 W({},a,{syntheticException:r==0?a.syntheticException:void 0,mechanism:e,apply:o=>n(o,r),next:o=>n(o,r+1)})}},el="?";function Tx(t,e,a,r,n){var o={platform:t,filename:e,function:a==="<anonymous>"?el:a,in_app:!0};return $(r)||(o.lineno=r),$(n)||(o.colno=n),o}var FE=(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]:el,a?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},n3=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,o3=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,i3=/\((\S*)(?::(\d+))(?::(\d+))\)/,s3=(t,e)=>{var a=n3.exec(t);if(a){var[,r,n,o]=a;return Tx(e,r,el,+n,+o)}var i=o3.exec(t);if(i){if(i[2]&&i[2].indexOf("eval")===0){var s=i3.exec(i[2]);s&&(i[2]=s[1],i[3]=s[2],i[4]=s[3])}var[l,u]=FE(i[1]||el,i[2]);return Tx(e,u,l,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},l3=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,u3=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,c3=(t,e)=>{var a=l3.exec(t);if(a){if(a[3]&&a[3].indexOf(" > eval")>-1){var r=u3.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]||el;return[o,n]=FE(o,n),Tx(e,n,o,a[4]?+a[4]:void 0,a[5]?+a[5]:void 0)}},RA=/\(error: (.*)\)/,MA=50;function d3(){return(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 function(n,o){o===void 0&&(o=0);for(var i=[],s=n.split(`
|
|
499
|
+
`),l=o;l<s.length;l++){var u=s[l];if(!(u.length>1024)){var c=RA.test(u)?u.replace(RA,"$1"):u;if(!c.match(/\S*Error: /)){for(var d of a){var f=d(c,t);if(f){i.push(f);break}}if(i.length>=MA)break}}}return(function(h){if(!h.length)return[];var S=Array.from(h);return S.reverse(),S.slice(0,MA).map((x=>{return W({},x,{filename:x.filename||(b=S,b[b.length-1]||{}).filename,function:x.function||el});var b}))})(i)}})("web:javascript",s3,c3)}var Rx=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,a){var r=bt(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 $p(e,"DOMException")}isDOMError(e){return $p(e,"DOMError")}},Mx=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}},Ox=class{constructor(){}match(e){return $p(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}}},f3=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Dx=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(f3);return n&&(a=n[1],r=n[2]),[a,r]}},p3=["fatal","error","warning","log","info","debug"];function HE(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 Bx=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 SE(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: "+HE(e)}isSeverityLevel(e){return bt(e)&&!Cx(e)&&p3.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var r=e[a];if(a3(r))return r}}getObjectClassName(e){try{var a=Object.getPrototypeOf(e);return a?a.constructor.name:void 0}catch{return}}},Px=class{match(e){return SE(e)}coerce(e,a){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+HE(e),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},Nx=class{match(e){return wx(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}}},Fx=class{match(e){return $p(e,"PromiseRejectionEvent")}coerce(e,a){var r,n=this.getUnhandledRejectionReason(e);return wx(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(wx(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}},UE=function(t,e){var{debugEnabled:a}=e===void 0?{}:e,r={k:function(n){if(E&&(pn.DEBUG||Q.POSTHOG_DEBUG||a)&&!$(E.console)&&E.console){for(var o=("__rrweb_original__"in E.console[n])?E.console[n].__rrweb_original__:E.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)=>UE(t+" "+n,o)};return r},j=UE("[PostHog.js]"),nt=j.createLogger,h3=nt("[ExternalScriptsLoader]"),OA=(t,e,a)=>{if(t.config.disable_external_dependency_loading)return h3.warn(e+" was requested but loading of external scripts is disabled."),a("Loading of external scripts is disabled");var r=V?.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(!V)return a("document not found");var l=V.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");if(t.config.external_scripts_inject_target==="head")V.head.appendChild(l);else{var u,c=V.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):V.body.appendChild(l)}};V!=null&&V.body?s():V?.addEventListener("DOMContentLoaded",s)};Q.__PosthogExtensions__=Q.__PosthogExtensions__||{},Q.__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);OA(t,o,a)},Q.__PosthogExtensions__.loadSiteApp=(t,e,a)=>{var r=t.requestRouter.endpointFor("api",e);OA(t,r,a)};var Gp={};function Co(t,e,a){if(Ce(t)){if(_A&&t.forEach===_A)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)===Gp)return}}}function Fe(t,e,a){if(!ge(t)){if(Ce(t))return Co(t,e,a);if(qH(t)){for(var r of t.entries())if(e.call(a,r[1],r[0])===Gp)return}else for(var n in t)if(bE.call(t,n)&&e.call(a,t[n],n)===Gp)return}}var ut=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 Co(a,(function(n){for(var o in n)n[o]!==void 0&&(t[o]=n[o])})),t},al=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 Co(a,(function(n){Co(n,(function(o){t.push(o)}))})),t};function qp(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 DA=function(t){try{return t()}catch{return}},m3=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){j.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),j.critical(n)}}},Nb=function(t){var e={};return Fe(t,(function(a,r){(bt(a)&&a.length>0||xn(a))&&(e[r]=a)})),e};function g3(t,e){return a=t,r=o=>bt(o)&&!dr(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),Ce(i)?(l=[],Co(i,(u=>{l.push(o(u))}))):(l={},Fe(i,((u,c)=>{n.has(u)||(l[c]=o(u,c))}))),l);var l})(a);var a,r,n}var v3=["herokuapp.com","vercel.app","netlify.app"];function y3(t){var e=t?.hostname;if(!bt(e))return!1;var a=e.split(".").slice(-2).join(".");for(var r of v3)if(a===r)return!1;return!0}function zE(t,e){for(var a=0;a<t.length;a++)if(e(t[a]))return t[a]}function mt(t,e,a,r){var{capture:n=!1,passive:o=!0}=r??{};t?.addEventListener(e,a,{capture:n,passive:o})}var qE="$people_distinct_id",lc="__alias",uc="__timers",BA="$autocapture_disabled_server_side",Hx="$heatmaps_enabled_server_side",PA="$exception_capture_enabled_server_side",Ux="$error_tracking_suppression_rules",NA="$error_tracking_capture_extension_exceptions",FA="$web_vitals_enabled_server_side",VE="$dead_clicks_enabled_server_side",HA="$product_tours_enabled_server_side",UA="$web_vitals_allowed_metrics",ix="$session_recording_remote_config",Wp="$sesid",$E="$session_is_sampled",Ks="$enabled_feature_flags",cc="$early_access_features",zx="$feature_flag_details",dc="$stored_person_properties",wi="$stored_group_properties",qx="$surveys",Zp="$flag_call_reported",hn="$user_state",Vx="$client_session_props",$x="$capture_rate_limit",jx="$initial_campaign_params",Gx="$initial_referrer_info",Xp="$initial_person_info",Kp="$epp",jE="__POSTHOG_TOOLBAR__",Qu="$posthog_cookieless",x3=[qE,lc,"__cmpns",uc,"$session_recording_enabled_server_side",Hx,Wp,Ks,Ux,hn,cc,zx,wi,dc,qx,Zp,Vx,$x,jx,Gx,Kp,Xp,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function zA(t){return t instanceof Element&&(t.id===jE||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function hh(t){return!!t&&t.nodeType===1}function wo(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function GE(t){return!!t&&t.nodeType===3}function WE(t){return!!t&&t.nodeType===11}function Fb(t){return t?fh(t).split(/\s+/):[]}function qA(t){var e=E?.location.href;return!!(e&&t&&t.some((a=>e.match(a))))}function Yp(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 Fb(e)}function ZE(t){return ge(t)?null:fh(t).split(/(\s+)/).filter((e=>_c(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function wc(t){var e="";return Wx(t)&&!JE(t)&&t.childNodes&&t.childNodes.length&&Fe(t.childNodes,(function(a){var r;GE(a)&&a.textContent&&(e+=(r=ZE(a.textContent))!==null&&r!==void 0?r:"")})),fh(e)}function XE(t){return $(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Hb=["a","button","form","input","select","textarea","label"];function KE(t,e){if($(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 YE(t){var e=t.parentNode;return!(!e||!hh(e))&&e}var b3=["next","previous","prev",">","<"],VA=10,$A=[".ph-no-rageclick",".ph-no-capture"];function S3(t,e){if(!E||Ub(t))return!1;var a,r,n;if(yn(e)?(a=!!e&&$A,r=void 0):(a=(n=e?.css_selector_ignorelist)!==null&&n!==void 0?n:$A,r=e?.content_ignorelist),a===!1)return!1;var{targetElementList:o}=QE(t,!1);return!(function(i,s){if(i===!1||$(i))return!1;var l;if(i===!0)l=b3;else{if(!Ce(i))return!1;if(i.length>VA)return j.error("[PostHog] content_ignorelist array cannot exceed "+VA+" 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((f=>c.includes(f)||d.includes(f)))}))})(r,o.map((i=>{var s;return{safeText:wc(i).toLowerCase(),ariaLabel:((s=i.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!KE(o,a)}var Ub=t=>!t||wo(t,"html")||!hh(t),QE=(t,e)=>{if(!E||Ub(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var a=!1,r=[t],n=t;n.parentNode&&!wo(n,"body");)if(WE(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=YE(n);if(!o)break;if(e||Hb.indexOf(o.tagName.toLowerCase())>-1)a=!0;else{var i=E.getComputedStyle(o);i&&i.getPropertyValue("cursor")==="pointer"&&(a=!0)}r.push(o),n=o}return{parentIsUsefulElement:a,targetElementList:r}};function _3(t,e,a,r,n){var o,i,s,l;if(a===void 0&&(a=void 0),!E||Ub(t)||(o=a)!=null&&o.url_allowlist&&!qA(a.url_allowlist)||(i=a)!=null&&i.url_ignorelist&&qA(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}=QE(t,r);if(!(function(S,x){var b=x?.element_allowlist;if($(b))return!0;var g,m=function(v){if(b.some((C=>v.tagName.toLowerCase()===C)))return{v:!0}};for(var y of S)if(g=m(y))return g.v;return!1})(d,a)||!KE(d,(l=a)==null?void 0:l.css_selector_allowlist))return!1;var f=E.getComputedStyle(t);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var h=t.tagName.toLowerCase();switch(h){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&&(Hb.indexOf(h)>-1||t.getAttribute("contenteditable")==="true")}}function Wx(t){for(var e=t;e.parentNode&&!wo(e,"body");e=e.parentNode){var a=Yp(e);if(he(a,"ph-sensitive")||he(a,"ph-no-capture"))return!1}if(he(Yp(t),"ph-include"))return!0;var r=t.type||"";if(bt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!(bt(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 JE(t){return!!(wo(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||wo(t,"select")||wo(t,"textarea")||t.getAttribute("contenteditable")==="true")}var eT="(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})",C3=new RegExp("^(?:"+eT+")$"),w3=new RegExp(eT),tT="\\d{3}-?\\d{2}-?\\d{4}",L3=new RegExp("^("+tT+")$"),k3=new RegExp("("+tT+")");function _c(t,e){return e===void 0&&(e=!0),!(ge(t)||bt(t)&&(t=fh(t),(e?C3:w3).test((t||"").replace(/[- ]/g,""))||(e?L3:k3).test(t)))}function aT(t){var e=wc(t);return _c(e=(e+" "+rT(t)).trim())?e:""}function rT(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Fe(t.childNodes,(function(a){var r;if(a&&((r=a.tagName)==null?void 0:r.toLowerCase())==="span")try{var n=wc(a);e=(e+" "+n).trim(),a.childNodes&&a.childNodes.length&&(e=(e+" "+rT(a)).trim())}catch(o){j.error("[AutoCapture]",o)}})),e}function I3(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=W({},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 qp(l).sort(((c,d)=>{var[f]=c,[h]=d;return f.localeCompare(h)})).forEach((c=>{var[d,f]=c;return u[jA(d.toString())]=jA(f.toString())})),i+=":",i+=qp(u).map((c=>{var[d,f]=c;return d+'="'+f+'"'})).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:A3(a),attr_id:a.attr__id,nth_child:a.nth_child,nth_of_type:a.nth_of_type,attributes:{}};return qp(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 jA(t){return t.replace(/"|\\"/g,'\\"')}function A3(t){var e=t.attr__class;return e?Ce(e)?e:Fb(e):void 0}var Qp=class{constructor(e){this.disabled=e===!1;var a=xt(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}},Jp=t=>{var e=V?.createElement("a");return $(e)?null:(e.href=t,e)},E3=function(t,e){var a,r;e===void 0&&(e="&");var n=[];return Fe(t,(function(o,i){$(o)||$(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)},eh=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(!Ce(a)||a.length<2)return"";var i=a[1];try{i=decodeURIComponent(i)}catch{j.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},Lc=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 f=u[d].split("=");Ce(f)&&(e.includes(f[0])?c.push(f[0]+"="+a):c.push(u[d]))}var h=l;return s!=null&&(h+="?"+c.join("&")),o!=null&&(h+="#"+o),h},th=function(t,e){var a=t.match(new RegExp(e+"=([^&]*)"));return a?a[1]:null},sx="$copy_autocapture",GA=nt("[AutoCapture]");function lx(t,e){return e.length>t?e.slice(0,t)+"...":e}function T3(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!hh(e));return e}function R3(t,e,a,r){var n=t.tagName.toLowerCase(),o={tag_name:n};Hb.indexOf(n)>-1&&!a&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?o.$el_text=lx(1024,aT(t)):o.$el_text=lx(1024,wc(t)));var i=Yp(t);i.length>0&&(o.classes=i.filter((function(c){return c!==""}))),Fe(t.attributes,(function(c){var d;if((!JE(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!e&&_c(c.value)&&(d=c.name,!bt(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var f=c.value;c.name==="class"&&(f=Fb(f).join(" ")),o["attr__"+c.name]=lx(1024,f)}}));for(var s=1,l=1,u=t;u=T3(u);)s++,u.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function M3(t,e){for(var a,r,{e:n,maskAllElementAttributes:o,maskAllText:i,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!wo(c,"body");)WE(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,f=[],h={},S=!1,x=!1;if(Fe(u,(v=>{var C=Wx(v);v.tagName.toLowerCase()==="a"&&(S=v.getAttribute("href"),S=C&&S&&_c(S)&&S),he(Yp(v),"ph-no-capture")&&(x=!0),f.push(R3(v,o,i,s));var w=(function(_){if(!Wx(_))return{};var L={};return Fe(_.attributes,(function(I){if(I.name&&I.name.indexOf("data-ph-capture-attribute")===0){var A=I.name.replace("data-ph-capture-attribute-",""),T=I.value;A&&T&&_c(T)&&(L[A]=T)}})),L})(v);ut(h,w)})),x)return{props:{},explicitNoCapture:x};if(i||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?f[0].$el_text=aT(t):f[0].$el_text=wc(t)),S){var b,g;f[0].attr__href=S;var m=(b=Jp(S))==null?void 0:b.host,y=E==null||(g=E.location)==null?void 0:g.host;m&&y&&m!==y&&(d=S)}return{props:ut({$event_type:n.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:I3(f)},(a=f[0])!=null&&a.$el_text?{$el_text:(r=f[0])==null?void 0:r.$el_text}:{},d&&n.type==="click"?{$external_click_url:d}:{},h)}}var Zx=class{constructor(e){this.P=!1,this.T=null,this.I=!1,this.instance=e,this.rageclicks=new Qp(e.config.rageclick),this.C=null}get R(){var e,a,r=xt(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}F(){if(this.isBrowserSupported()){if(E&&V){var e=r=>{r=r||E?.event;try{this.O(r)}catch(n){GA.error("Failed to capture event",n)}};if(mt(V,"submit",e,{capture:!0}),mt(V,"change",e,{capture:!0}),mt(V,"click",e,{capture:!0}),this.R.capture_copied_text){var a=r=>{r=r||E?.event,this.O(r,sx)};mt(V,"copy",a,{capture:!0}),mt(V,"cut",a,{capture:!0})}}}else GA.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.I=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[BA]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.C=e}getElementSelectors(e){var a,r=[];return(a=this.C)==null||a.forEach((n=>{var o=V?.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[BA],n=this.T;if(dr(n)&&!yn(r)&&!this.instance.M())return!1;var o=(a=this.T)!==null&&a!==void 0?a:!!r;return!!this.instance.config.autocapture&&!o}O(e,a){if(a===void 0&&(a="$autocapture"),this.isEnabled){var r,n=XE(e);GE(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())&&S3(n,this.instance.config.rageclick)&&this.O(e,"$rageclick");var o=a===sx;if(n&&_3(n,e,this.R,o,o?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:s}=M3(n,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.R.element_attribute_ignorelist,elementsChainAsString:this.I});if(s)return!1;var l=this.getElementSelectors(n);if(l&&l.length>0&&(i.$element_selectors=l),a===sx){var u,c=ZE(E==null||(u=E.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 _o(V?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return xn(t)&&isFinite(t)&&Math.floor(t)===t});var WA="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+WA.charAt(this.bytes[a]>>>4)+WA.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}},Kx=class{constructor(){this.A=0,this.j=0,this.D=new Yx}generate(){var e=this.generateOrAbort();if($(e)){this.A=0;var a=this.generateOrAbort();if($(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.j++,this.j>4398046511103&&(this.A++,this.L())}return Xx.fromFieldsV7(this.A,Math.trunc(this.j/Math.pow(2,30)),this.j&Math.pow(2,30)-1,this.D.nextUint32())}L(){this.j=1024*this.D.nextUint32()+(1023&this.D.nextUint32())}},ZA,nT=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};E&&!$(E.crypto)&&crypto.getRandomValues&&(nT=t=>crypto.getRandomValues(t));var Yx=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(nT(this.N),this.U=0),this.N[this.U++]}},So=()=>O3().toString(),O3=()=>(ZA||(ZA=new Kx)).generate(),Ju="",D3=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function B3(t,e){if(e){var a=(function(n,o){if(o===void 0&&(o=V),Ju)return Ju;if(!o||["localhost","127.0.0.1"].includes(n))return"";for(var i=n.split("."),s=Math.min(i.length,8),l="dmn_chk_"+So();!Ju&&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",Ju=u)}return Ju})(t);if(!a){var r=(n=>{var o=n.match(D3);return o?o[0]:""})(t);r!==a&&j.info("Warning: cookie subdomain discovery mismatch",r,a),a=r}return a?"; domain=."+a:""}return""}var Ir={H:()=>!!V,B:function(t){j.error("cookieStore error: "+t)},q:function(t){if(V){try{for(var e=t+"=",a=V.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(Ir.q(t))||{}}catch{}return e},G:function(t,e,a,r,n){if(V)try{var o="",i="",s=B3(V.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&&j.warn("cookieStore warning: large cookie, len="+u.length),V.cookie=u,u}catch{return}},V:function(t,e){if(V!=null&&V.cookie)try{Ir.G(t,"",-1,e)}catch{return}}},ux=null,et={H:function(){if(!dr(ux))return ux;var t=!0;if($(E))t=!1;else try{var e="__mplssupport__";et.G(e,"xyz"),et.q(e)!=='"xyz"'&&(t=!1),et.V(e)}catch{t=!1}return t||j.error("localStorage unsupported; falling back to cookie store"),ux=t,t},B:function(t){j.error("localStorage error: "+t)},q:function(t){try{return E?.localStorage.getItem(t)}catch(e){et.B(e)}return null},W:function(t){try{return JSON.parse(et.q(t))||{}}catch{}return null},G:function(t,e){try{E?.localStorage.setItem(t,JSON.stringify(e))}catch(a){et.B(a)}},V:function(t){try{E?.localStorage.removeItem(t)}catch(e){et.B(e)}}},P3=["$device_id","distinct_id",Wp,$E,Kp,Xp],Fp={},N3={H:function(){return!0},B:function(t){j.error("memoryStorage error: "+t)},q:function(t){return Fp[t]||null},W:function(t){return Fp[t]||null},G:function(t,e){Fp[t]=e},V:function(t){delete Fp[t]}},_i=null,Pt={H:function(){if(!dr(_i))return _i;if(_i=!0,$(E))_i=!1;else try{var t="__support__";Pt.G(t,"xyz"),Pt.q(t)!=='"xyz"'&&(_i=!1),Pt.V(t)}catch{_i=!1}return _i},B:function(t){j.error("sessionStorage error: ",t)},q:function(t){try{return E?.sessionStorage.getItem(t)}catch(e){Pt.B(e)}return null},W:function(t){try{return JSON.parse(Pt.q(t))||null}catch{}return null},G:function(t,e){try{E?.sessionStorage.setItem(t,JSON.stringify(e))}catch(a){Pt.B(a)}},V:function(t){try{E?.sessionStorage.removeItem(t)}catch(e){Pt.B(e)}}},mn=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),Qx=class{constructor(e){this._instance=e}get R(){return this._instance.config}get consent(){return this.J()?mn.DENIED:this.K}isOptedOut(){return this.R.cookieless_mode==="always"||this.consent===mn.DENIED||this.consent===mn.PENDING&&(this.R.opt_out_capturing_by_default||this.R.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===mn.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.R.cookie_expiration,this.R.cross_subdomain_cookie,this.R.secure_cookie)}reset(){this.Y.V(this.X,this.R.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 rx(e)?mn.GRANTED:he(jH,e)?mn.DENIED:mn.PENDING}get Y(){if(!this.Z){var e=this.R.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?et:Ir;var a=e==="localStorage"?Ir:et;a.q(this.X)&&(this.Z.q(this.X)||this.optInOut(rx(a.q(this.X))),a.V(this.X,this.R.cross_subdomain_cookie))}return this.Z}J(){return!!this.R.respect_dnt&&!!zE([Ia?.doNotTrack,Ia?.msDoNotTrack,Q.doNotTrack],(e=>rx(e)))}},Hp=nt("[Dead Clicks]"),F3=()=>!0,H3=t=>{var e,a=!((e=t.instance.persistence)==null||!e.get_property(VE)),r=t.instance.config.capture_dead_clicks;return yn(r)?r:!!xt(r)||a},ah=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({[VE]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var a,r;(a=Q.__PosthogExtensions__)!=null&&a.initDeadClicksAutocapture&&e(),(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(n=>{n?Hp.error("failed to load script",n):e()}))}et(){var e;if(V){if(!this.tt&&(e=Q.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var a=xt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};a.__onCapture=this.onCapture,this.tt=Q.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,a),this.tt.start(V),Hp.info("starting...")}}else Hp.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Hp.info("stopping..."))}},ec=nt("[ExceptionAutocapture]"),Jx=class{constructor(e){var a,r,n;this.rt=()=>{var o;if(E&&this.isEnabled&&(o=Q.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var i=Q.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=Q.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=Q.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.R.capture_unhandled_errors&&(this.st=i(this.captureException.bind(this))),!this.nt&&this.R.capture_unhandled_rejections&&(this.nt=s(this.captureException.bind(this))),!this.ot&&this.R.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(u){ec.error("failed to start",u),this.ut()}}},this._instance=e,this.ht=!((a=this._instance.persistence)==null||!a.props[PA]),this.dt=new Lx({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:ec}),this.R=this.vt(),this.startIfEnabledOrStop()}vt(){var e=this._instance.config.capture_exceptions,a={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return xt(e)?a=W({},a,e):($(e)?this.ht:e)&&(a=W({},a,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),a}get isEnabled(){return this.R.capture_console_errors||this.R.capture_unhandled_errors||this.R.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ec.info("enabled"),this.ut(),this.it(this.rt)):this.ut()}it(e){var a,r;(a=Q.__PosthogExtensions__)!=null&&a.errorWrappingFunctions&&e(),(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(n=>{if(n)return ec.error("failed to load script",n);e()}))}ut(){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.ht=!!a||!1,this._instance.persistence&&this._instance.persistence.register({[PA]:this.ht}),this.R=this.vt(),this.startIfEnabledOrStop()}onConfigChange(){this.R=this.vt()}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.dt.consumeRateLimit(n)?ec.info("Skipping exception capture because of client rate limiting.",{exception:n}):this._instance.exceptions.sendExceptionEvent(e)}};function XA(t,e,a){try{if(!(e in t))return()=>{};var r=t[e],n=a(r);return _o(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=r}}catch{return()=>{}}}var eb=class{constructor(e){var a;this._instance=e,this.ct=(E==null||(a=E.location)==null?void 0:a.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(j.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ft&&this.ft(),this.ft=void 0,j.info("History API monitoring stopped")}monitorHistoryChanges(){var e,a;if(E&&E.history){var r=this;(e=E.history.pushState)!=null&&e.__posthog_wrapped__||XA(E.history,"pushState",(n=>function(o,i,s){n.call(this,o,i,s),r._t("pushState")})),(a=E.history.replaceState)!=null&&a.__posthog_wrapped__||XA(E.history,"replaceState",(n=>function(o,i,s){n.call(this,o,i,s),r._t("replaceState")})),this.bt()}}_t(e){try{var a,r=E==null||(a=E.location)==null?void 0:a.pathname;if(!r)return;r!==this.ct&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ct=r}catch(n){j.error("Error capturing "+e+" pageview",n)}}bt(){if(!this.ft){var e=()=>{this._t("popstate")};mt(E,"popstate",e),this.ft=()=>{E&&E.removeEventListener("popstate",e)}}}},cx=nt("[SegmentIntegration]");function U3(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()||So();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(hn,"identified")),n()},s=o.user();"then"in s&&_o(s.then)?s.then(i):i(s)})(t,(()=>{a.register((r=>{Promise&&Promise.resolve||cx.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()||(cx.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(cx.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 oT="posthog-js";function iT(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,f;if(!(o==="*"||o.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var h=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());s.tags["PostHog Person URL"]=h,t.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var S=((l=s.exception)==null?void 0:l.values)||[],x=S.map((g=>W({},g,{stacktrace:g.stacktrace?W({},g.stacktrace,{type:"raw",frames:(g.stacktrace.frames||[]).map((m=>W({},m,{platform:"web:javascript"})))}):void 0}))),b={$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:x,$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:(f=S[0])==null?void 0:f.type,$sentry_tags:s.tags};return a&&r&&(b.$sentry_url=(n||"https://sentry.io/organizations/")+a+"/issues/?project="+r+"&query="+s.event_id),i&&t.exceptions.sendExceptionEvent(b),s}}var tb=class{constructor(e,a,r,n,o,i){this.name=oT,this.setupOnce=function(s){s(iT(e,{organization:a,projectId:r,prefix:n,severityAllowList:o,sendExceptionsToPostHog:i==null||i}))}}},z3=E!=null&&E.location?th(E.location.hash,"__posthog")||th(location.hash,"state"):null,KA="_postHogToolbarParams",YA=nt("[Toolbar]"),bo=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(bo||{}),ab=class{constructor(e){this.instance=e}yt(e){Q.ph_toolbar_state=e}wt(){var e;return(e=Q.ph_toolbar_state)!==null&&e!==void 0?e:bo.UNINITIALIZED}maybeLoadToolbar(e,a,r){if(e===void 0&&(e=void 0),a===void 0&&(a=void 0),r===void 0&&(r=void 0),!E||!V)return!1;e=e??E.location,r=r??E.history;try{if(!a){try{E.localStorage.setItem("test","test"),E.localStorage.removeItem("test")}catch{return!1}a=E?.localStorage}var n,o=z3||th(e.hash,"__posthog")||th(e.hash,"state"),i=o?DA((()=>JSON.parse(atob(decodeURIComponent(o)))))||DA((()=>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(KA)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token)&&(this.loadToolbar(n),!0)}catch{return!1}}xt(e){var a=Q.ph_load_toolbar||Q.ph_load_editor;!ge(a)&&_o(a)?a(e,this.instance):YA.warn("No toolbar load function found")}loadToolbar(e){var a=!(V==null||!V.getElementById(jE));if(!E||a)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=W({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(E.localStorage.setItem(KA,JSON.stringify(W({},n,{source:void 0}))),this.wt()===bo.LOADED)this.xt(n);else if(this.wt()===bo.UNINITIALIZED){var o;this.yt(bo.LOADING),(o=Q.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return YA.error("[Toolbar] Failed to load",i),void this.yt(bo.UNINITIALIZED);this.yt(bo.LOADED),this.xt(n)})),mt(E,"turbolinks:load",(()=>{this.yt(bo.UNINITIALIZED),this.loadToolbar(n)}))}return!0}Et(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)}},q3=nt("[TracingHeaders]"),rb=class{constructor(e){this.$t=void 0,this.St=void 0,this.rt=()=>{var a,r;$(this.$t)&&((a=Q.__PosthogExtensions__)==null||(a=a.tracingHeadersPatchFns)==null||a._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),$(this.St)&&((r=Q.__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=Q.__PosthogExtensions__)!=null&&a.tracingHeadersPatchFns&&e(),(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(n=>{if(n)return q3.error("failed to load script",n);e()}))}startIfEnabledOrStop(){var e,a;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.$t)==null||e.call(this),(a=this.St)==null||a.call(this),this.$t=void 0,this.St=void 0)}},Up="https?://(.*)",rl=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],V3=al(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],rl),kc="<masked>",$3=["li_fat_id"];function sT(t,e,a){if(!V)return{};var r,n=e?al([],rl,a||[]):[],o=lT(Lc(V.URL,n,kc),t),i=(r={},Fe($3,(function(s){var l=Ir.q(s);r[s]=l||null})),r);return ut(i,o)}function lT(t,e){var a=V3.concat(e||[]),r={};return Fe(a,(function(n){var o=eh(t,n);r[n]=o||null})),r}function uT(t){var e=(function(o){return o?o.search(Up+"google.([^/?]*)")===0?"google":o.search(Up+"bing.com")===0?"bing":o.search(Up+"yahoo.com")===0?"yahoo":o.search(Up+"duckduckgo.com")===0?"duckduckgo":null:null})(t),a=e!="yahoo"?"q":"p",r={};if(!dr(e)){r.$search_engine=e;var n=V?eh(V.referrer,a):"";n.length&&(r.ph_keyword=n)}return r}function QA(){return navigator.language||navigator.userLanguage}function cT(){return V?.referrer||"$direct"}function dT(t,e){var a=t?al([],rl,e||[]):[],r=Nt?.href.substring(0,1e3);return{r:cT().substring(0,1e3),u:r?Lc(r,a,kc):void 0}}function fT(t){var e,{r:a,u:r}=t,n={$referrer:a,$referring_domain:a==null?void 0:a=="$direct"?"$direct":(e=Jp(a))==null?void 0:e.host};if(r){n.$current_url=r;var o=Jp(r);n.$host=o?.host,n.$pathname=o?.pathname;var i=lT(r);ut(n,i)}if(a){var s=uT(a);ut(n,s)}return n}function pT(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function j3(){try{return new Date().getTimezoneOffset()}catch{return}}function G3(t,e){if(!ca)return{};var a,r,n,o=t?al([],rl,e||[]):[],[i,s]=(function(l){for(var u=0;u<EA.length;u++){var[c,d]=EA[u],f=c.exec(l),h=f&&(_o(d)?d(f,l):d);if(h)return h}return["",""]})(ca);return ut(Nb({$os:i,$os_version:s,$browser:NE(ca,navigator.vendor),$device:TA(ca),$device_type:(r=ca,n=TA(r),n===CE||n===_E||n==="Kobo"||n==="Kindle Fire"||n===PE?yc:n===bc||n===Qs||n===Sc||n===Ix?"Console":n===LE?"Wearable":n?ja:"Desktop"),$timezone:pT(),$timezone_offset:j3()}),{$current_url:Lc(Nt?.href,o,kc),$host:Nt?.host,$pathname:Nt?.pathname,$raw_user_agent:ca.length>1e3?ca.substring(0,997)+"...":ca,$browser_version:t3(ca,navigator.vendor),$browser_language:QA(),$browser_language_prefix:(a=QA(),typeof a=="string"?a.split("-")[0]:void 0),$screen_height:E?.screen.height,$screen_width:E?.screen.width,$viewport_height:E?.innerHeight,$viewport_width:E?.innerWidth,$lib:"web",$lib_version:pn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var vo=nt("[Web Vitals]"),JA=9e5,nb=class{constructor(e){var a;this.kt=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Pt=()=>{clearTimeout(this.Tt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((r,n)=>W({},r,{["$web_vitals_"+n.name+"_event"]:W({},n),["$web_vitals_"+n.name+"_value"]:n.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.It=r=>{var n,o=(n=this._instance.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0);if($(o))vo.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Ct();$(i)||(ge(r?.name)||ge(r?.value)?vo.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?vo.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==i&&(this.Pt(),this.Tt=setTimeout(this.Pt,this.flushToCaptureTimeoutMs)),$(this.N.url)&&(this.N.url=i),this.N.firstMetricTimestamp=$(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(W({},r,{$current_url:i,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Pt()))}},this.rt=()=>{if(!this.P){var r,n,o,i,s=Q.__PosthogExtensions__;$(s)||$(s.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:n,onFCP:o,onINP:i}=s.postHogWebVitalsCallbacks),r&&n&&o&&i?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.It.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this.It.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.It.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.It.bind(this)),this.P=!0):vo.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.kt=!((a=this._instance.persistence)==null||!a.props[FA]),this.startIfEnabled()}get allowedMetrics(){var e,a,r=xt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return ge(r)?((a=this._instance.persistence)==null?void 0:a.props[UA])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(xt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=xt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e!=null&&e}get Rt(){var e=xt(this._instance.config.capture_performance)&&xn(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:JA;return 0<e&&e<=6e4?JA:e}get isEnabled(){var e=Nt?.protocol;if(e!=="http:"&&e!=="https:")return vo.info("Web Vitals are disabled on non-http/https protocols"),!1;var a=xt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:yn(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return yn(a)?a:this.kt}startIfEnabled(){this.isEnabled&&!this.P&&(vo.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var a=xt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=xt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[FA]:a}),this._instance.persistence.register({[UA]:r})),this.kt=a,this.startIfEnabled()}it(e){var a,r;if((a=Q.__PosthogExtensions__)!=null&&a.postHogWebVitalsCallbacks)e();else{var n=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,n,(o=>{o?vo.error("failed to load script",o):e()}))}}Ct(){var e=E?E.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?al([],rl,r||[]):[];return Lc(e,n,kc)}vo.error("Could not determine current URL")}},W3=nt("[Heatmaps]");function eE(t){return xt(t)&&"clientX"in t&&"clientY"in t&&xn(t.clientX)&&xn(t.clientY)}var ob=class{constructor(e){var a;this.kt=!1,this.P=!1,this.Ft=null,this.instance=e,this.kt=!((a=this.instance.persistence)==null||!a.props[Hx]),this.rageclicks=new Qp(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return xt(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 ge(this.instance.config.capture_heatmaps)?ge(this.instance.config.enable_heatmaps)?this.kt:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;W3.info("starting..."),this.Ot(),this.Mt()}else{var e;clearInterval((e=this.Ft)!==null&&e!==void 0?e:void 0),this.At(),this.getAndClearBuffer()}}onRemoteConfig(e){var a=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Hx]:a}),this.kt=a,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}jt(e){this.Dt(e.originalEvent,"deadclick")}Mt(){this.Ft&&clearInterval(this.Ft),this.Ft=(function(e){return e?.visibilityState==="visible"})(V)?setInterval(this.Lt.bind(this),this.flushIntervalMilliseconds):null}Ot(){E&&V&&(this.Nt=this.Lt.bind(this),mt(E,"beforeunload",this.Nt),this.Ut=e=>this.Dt(e||E?.event),mt(V,"click",this.Ut,{capture:!0}),this.zt=e=>this.Ht(e||E?.event),mt(V,"mousemove",this.zt,{capture:!0}),this.Bt=new ah(this.instance,F3,this.jt.bind(this)),this.Bt.startIfEnabled(),this.qt=this.Mt.bind(this),mt(V,"visibilitychange",this.qt),this.P=!0)}At(){var e;E&&V&&(this.Nt&&E.removeEventListener("beforeunload",this.Nt),this.Ut&&V.removeEventListener("click",this.Ut,{capture:!0}),this.zt&&V.removeEventListener("mousemove",this.zt,{capture:!0}),this.qt&&V.removeEventListener("visibilitychange",this.qt),clearTimeout(this.Wt),(e=this.Bt)==null||e.stop(),this.P=!1)}Gt(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&&hh(c)&&!wo(c,"body");){if(c===u)return!1;if(he(l,E?.getComputedStyle(c).position))return!0;c=YE(c)}return!1})(XE(e),["fixed","sticky"],o);return{x:e.clientX+(i?0:n),y:e.clientY+(i?0:r),target_fixed:i,type:a}}Dt(e,a){var r;if(a===void 0&&(a="click"),!zA(e.target)&&eE(e)){var n=this.Gt(e,a);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Vt(W({},n,{type:"rageclick"})),this.Vt(n)}}Ht(e){!zA(e.target)&&eE(e)&&(clearTimeout(this.Wt),this.Wt=setTimeout((()=>{this.Vt(this.Gt(e,"mousemove"))}),500))}Vt(e){if(E){var a=E.location.href,r=this.instance.config.mask_personal_data_properties,n=this.instance.config.custom_personal_data_properties,o=r?al([],rl,n||[]):[],i=Lc(a,o,kc);this.N=this.N||{},this.N[i]||(this.N[i]=[]),this.N[i].push(e)}}Lt(){this.N&&!Xs(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},rh=class{constructor(e){this.Jt=(a,r,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength)&&(j.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:a,changeReason:n}),this.Kt=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Yt()}Yt(){var e;this.Xt=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Jt)}destroy(){var e;(e=this.Xt)==null||e.call(this),this.Xt=void 0}doPageView(e,a){var r,n=this.Qt(e,a);return this.Kt={pathname:(r=E?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:a,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var a;return this.Qt(e,(a=this.Kt)==null?void 0:a.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Kt)==null?void 0:e.pageViewId}}Qt(e,a){var r=this.Kt;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(!($(i)||$(s)||$(l)||$(u)||$(c)||$(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 f=i<=1?1:Ar(s/i,0,1,j),h=i<=1?1:Ar(l/i,0,1,j),S=u<=1?1:Ar(c/u,0,1,j),x=u<=1?1:Ar(d/u,0,1,j);n=ut(n,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:S,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:x})}}return r.pathname&&(n.$prev_pageview_pathname=r.pathname),r.timestamp&&(n.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),n}};var gn=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),Ga=Uint8Array,Kt=Uint16Array,tl=Uint32Array,zb=new Ga([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]),qb=new Ga([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]),tE=new Ga([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hT=function(t,e){for(var a=new Kt(31),r=0;r<31;++r)a[r]=e+=1<<t[r-1];var n=new tl(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]},mT=hT(zb,2),Z3=mT[0],ib=mT[1];Z3[28]=258,ib[258]=28;for(sb=hT(qb,0)[1],nh=new Kt(32768),He=0;He<32768;++He)yo=(43690&He)>>>1|(21845&He)<<1,yo=(61680&(yo=(52428&yo)>>>2|(13107&yo)<<2))>>>4|(3855&yo)<<4,nh[He]=((65280&yo)>>>8|(255&yo)<<8)>>>1;var yo,sb,nh,He,mc=function(t,e,a){for(var r=t.length,n=0,o=new Kt(e);n<r;++n)++o[t[n]-1];var i,s=new Kt(e);for(n=0;n<e;++n)s[n]=s[n-1]+o[n-1]<<1;if(a){i=new Kt(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,f=d|(1<<c)-1;d<=f;++d)i[nh[d]>>>l]=u}else for(i=new Kt(r),n=0;n<r;++n)i[n]=nh[s[t[n]-1]++]>>>15-t[n];return i},ki=new Ga(288);for(He=0;He<144;++He)ki[He]=8;for(He=144;He<256;++He)ki[He]=9;for(He=256;He<280;++He)ki[He]=7;for(He=280;He<288;++He)ki[He]=8;var oh=new Ga(32);for(He=0;He<32;++He)oh[He]=5;var X3=mc(ki,9,0),K3=mc(oh,5,0),gT=function(t){return(t/8>>0)+(7&t&&1)},vT=function(t,e,a){(a==null||a>t.length)&&(a=t.length);var r=new(t instanceof Kt?Kt:t instanceof tl?tl:Ga)(a-e);return r.set(t.subarray(e,a)),r},dn=function(t,e,a){a<<=7&e;var r=e/8>>0;t[r]|=a,t[r+1]|=a>>>8},tc=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},dx=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 Ga(0),0];if(n==1){var i=new Ga(a[0].s+1);return i[a[0].s]=1,[i,1]}a.sort((function(C,w){return C.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 f=o[0].s;for(r=1;r<n;++r)o[r].s>f&&(f=o[r].s);var h=new Kt(f+1),S=lb(a[c-1],h,0);if(S>e){r=0;var x=0,b=S-e,g=1<<b;for(o.sort((function(C,w){return h[w.s]-h[C.s]||C.f-w.f}));r<n;++r){var m=o[r].s;if(!(h[m]>e))break;x+=g-(1<<S-h[m]),h[m]=e}for(x>>>=b;x>0;){var y=o[r].s;h[y]<e?x-=1<<e-h[y]++-1:++r}for(;r>=0&&x;--r){var v=o[r].s;h[v]==e&&(--h[v],++x)}S=e}return[new Ga(h),S]},lb=function(t,e,a){return t.s==-1?Math.max(lb(t.l,e,a+1),lb(t.r,e,a+1)):e[t.s]=a},aE=function(t){for(var e=t.length;e&&!t[--e];);for(var a=new Kt(++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]},ac=function(t,e){for(var a=0,r=0;r<e.length;++r)a+=t[r]*e[r];return a},ub=function(t,e,a){var r=a.length,n=gT(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)},rE=function(t,e,a,r,n,o,i,s,l,u,c){dn(e,c++,a),++n[256];for(var d=dx(n,15),f=d[0],h=d[1],S=dx(o,15),x=S[0],b=S[1],g=aE(f),m=g[0],y=g[1],v=aE(x),C=v[0],w=v[1],_=new Kt(19),L=0;L<m.length;++L)_[31&m[L]]++;for(L=0;L<C.length;++L)_[31&C[L]]++;for(var I=dx(_,7),A=I[0],T=I[1],N=19;N>4&&!A[tE[N-1]];--N);var B,F,H,R,z=u+5<<3,M=ac(n,ki)+ac(o,oh)+i,U=ac(n,f)+ac(o,x)+i+14+3*N+ac(_,A)+(2*_[16]+3*_[17]+7*_[18]);if(z<=M&&z<=U)return ub(e,c,t.subarray(l,l+u));if(dn(e,c,1+(U<M)),c+=2,U<M){B=mc(f,h,0),F=f,H=mc(x,b,0),R=x;var ue=mc(A,T,0);for(dn(e,c,y-257),dn(e,c+5,w-1),dn(e,c+10,N-4),c+=14,L=0;L<N;++L)dn(e,c+3*L,A[tE[L]]);c+=3*N;for(var Re=[m,C],we=0;we<2;++we){var gt=Re[we];for(L=0;L<gt.length;++L){var G=31>[L];dn(e,c,ue[G]),c+=A[G],G>15&&(dn(e,c,gt[L]>>>5&127),c+=gt[L]>>>12)}}}else B=X3,F=ki,H=K3,R=oh;for(L=0;L<s;++L)if(r[L]>255){G=r[L]>>>18&31,tc(e,c,B[G+257]),c+=F[G+257],G>7&&(dn(e,c,r[L]>>>23&31),c+=zb[G]);var te=31&r[L];tc(e,c,H[te]),c+=R[te],te>3&&(tc(e,c,r[L]>>>5&8191),c+=qb[te])}else tc(e,c,B[r[L]]),c+=F[r[L]];return tc(e,c,B[256]),c+F[256]},Y3=new tl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Q3=(function(){for(var t=new tl(256),e=0;e<256;++e){for(var a=e,r=9;--r;)a=(1&a&&3988292384)^a>>>1;t[e]=a}return t})(),J3=function(t,e,a,r,n){return(function(o,i,s,l,u,c){var d=o.length,f=new Ga(l+d+5*(1+Math.floor(d/7e3))+u),h=f.subarray(l,f.length-u),S=0;if(!i||d<8)for(var x=0;x<=d;x+=65535){var b=x+65535;b<d?S=ub(h,S,o.subarray(x,b)):(h[x]=c,S=ub(h,S,o.subarray(x,d)))}else{for(var g=Y3[i-1],m=g>>>13,y=8191&g,v=(1<<s)-1,C=new Kt(32768),w=new Kt(v+1),_=Math.ceil(s/3),L=2*_,I=function(Mh){return(o[Mh]^o[Mh+1]<<_^o[Mh+2]<<L)&v},A=new tl(25e3),T=new Kt(288),N=new Kt(32),B=0,F=0,H=(x=0,0),R=0,z=0;x<d;++x){var M=I(x),U=32767&x,ue=w[M];if(C[U]=ue,w[M]=U,R<=x){var Re=d-x;if((B>7e3||H>24576)&&Re>423){S=rE(o,h,0,A,T,N,F,H,z,x-z,S),H=B=F=0,z=x;for(var we=0;we<286;++we)T[we]=0;for(we=0;we<30;++we)N[we]=0}var gt=2,G=0,te=y,Qe=U-ue&32767;if(Re>2&&M==I(x-Qe))for(var Me=Math.min(m,Re)-1,nl=Math.min(32767,x),Th=Math.min(258,Re);Qe<=nl&&--te&&U!=ue;){if(o[x+gt]==o[x+gt-Qe]){for(var _n=0;_n<Th&&o[x+_n]==o[x+_n-Qe];++_n);if(_n>gt){if(gt=_n,G=Qe,_n>Me)break;var FR=Math.min(Qe,_n-2),J0=0;for(we=0;we<FR;++we){var Rh=x-Qe+we+32768&32767,eS=Rh-C[Rh]+32768&32767;eS>J0&&(J0=eS,ue=Rh)}}}Qe+=(U=ue)-(ue=C[U])+32768&32767}if(G){A[H++]=268435456|ib[gt]<<18|sb[G];var tS=31&ib[gt],aS=31&sb[G];F+=zb[tS]+qb[aS],++T[257+tS],++N[aS],R=x+gt,++B}else A[H++]=o[x],++T[o[x]]}}S=rE(o,h,c,A,T,N,F,H,z,x-z,S)}return vT(f,0,l+gT(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)},fx=function(t,e,a){for(;a;++e)t[e]=a,a>>>=8};function e4(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=Q3[255&u^l[c]]^u>>>8;s=u},d:function(){return 4294967295^s}}})(),r=t.length;a.p(t);var n,o=J3(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&&fx(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),fx(o,i-8,a.d()),fx(o,i-4,r),o}var t4=function(t){var e,a,r,n,o="";for(e=a=0,r=(t=(t+"").replace(/\r\n/g,`
|
|
516
500
|
`).replace(/\r/g,`
|
|
517
|
-
`)).length,r=0;r<n;r++){var i=t.charCodeAt(r),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),dr(s)||(a>e&&(o+=t.substring(e,a)),o+=s,e=a=r+1)}return a>e&&(o+=t.substring(e,t.length)),o},uH=!!Uy||!!Hy,WI="text/plain",Rp=function(t,e,a){var n;a===void 0&&(a=!0);var[r,o]=t.split("?"),i=Z({},e),s=(n=o?.split("&").map((u=>{var c,[d,f]=u.split("="),m=a&&(c=i[d])!==null&&c!==void 0?c:f;return delete i[d],d+"="+m})))!==null&&n!==void 0?n:[],l=kN(i);return l&&s.push(l),r+"?"+s.join("&")},ju=(t,e)=>JSON.stringify(t,((a,n)=>typeof n=="bigint"?n.toString():n),e),Oy=t=>{var{data:e,compression:a}=t;if(e){if(a===cr.GZipJS){var n=sH((function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new Ua(l.length+(l.length>>>1)),f=0,m=function(p){d[f++]=p},S=0;S<c;++S){if(f+5>d.length){var b=new Ua(f+8+(c-S<<1));b.set(d),d=b}var x=l.charCodeAt(S);x<128||u?m(x):x<2048?(m(192|x>>>6),m(128|63&x)):x>55295&&x<57344?(m(240|(x=65536+(1047552&x)|1023&l.charCodeAt(++S))>>>18),m(128|x>>>12&63),m(128|x>>>6&63),m(128|63&x)):(m(224|x>>>12),m(128|x>>>6&63),m(128|63&x))}return sE(d,0,f)})(ju(e)),{mtime:0}),r=new Blob([n],{type:WI});return{contentType:WI,body:r,estimatedSize:r.size}}if(a===cr.Base64){var o=(function(l){var u,c,d,f,m,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b=0,x=0,p="",g=[];if(!l)return l;l=lH(l);do u=(m=l.charCodeAt(b++)<<16|l.charCodeAt(b++)<<8|l.charCodeAt(b++))>>18&63,c=m>>12&63,d=m>>6&63,f=63&m,g[x++]=S.charAt(u)+S.charAt(c)+S.charAt(d)+S.charAt(f);while(b<l.length);switch(p=g.join(""),l.length%3){case 1:p=p.slice(0,-2)+"==";break;case 2:p=p.slice(0,-1)+"="}return p})(ju(e)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:ju(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=ju(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},hp=[];Hy&&hp.push({transport:"fetch",method:t=>{var e,a,{contentType:n,body:r,estimatedSize:o}=(e=Oy(t))!==null&&e!==void 0?e:{},i=new Headers;Be(t.headers,(function(c,d){i.append(d,c)})),n&&i.append("Content-Type",n);var s=t.url,l=null;if(hI){var u=new hI;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),t.timeout)}}Hy(s,Z({method:t?.method||"GET",headers:i,keepalive:t.method==="POST"&&(o||0)<52428.8,body:r,signal:(a=l)==null?void 0:a.signal},t.fetchOptions)).then((c=>c.text().then((d=>{var f={statusCode:c.status,text:d};if(c.status===200)try{f.json=JSON.parse(d)}catch(m){$.error(m)}t.callback==null||t.callback(f)})))).catch((c=>{$.error(c),t.callback==null||t.callback({statusCode:0,text:c})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Uy&&hp.push({transport:"XHR",method:t=>{var e,a=new Uy;a.open(t.method||"GET",t.url,!0);var{contentType:n,body:r}=(e=Oy(t))!==null&&e!==void 0?e:{};Be(t.headers,(function(o,i){a.setRequestHeader(i,o)})),n&&a.setRequestHeader("Content-Type",n),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(r)}}),ba!=null&&ba.sendBeacon&&hp.push({transport:"sendBeacon",method:t=>{var e=Rp(t.url,{beacon:"1"});try{var a,{contentType:n,body:r}=(a=Oy(t))!==null&&a!==void 0?a:{},o=typeof r=="string"?new Blob([r],{type:n}):r;ba.sendBeacon(e,o)}catch{}}});var Mp=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 XI(t,e,a){return ju({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:a})}var lE={exact:(t,e)=>e.some((a=>t.some((n=>a===n)))),is_not:(t,e)=>e.every((a=>t.every((n=>a!==n)))),regex:(t,e)=>e.some((a=>t.some((n=>Mp(a,n))))),not_regex:(t,e)=>e.every((a=>t.every((n=>!Mp(a,n))))),icontains:(t,e)=>e.map(fp).some((a=>t.map(fp).some((n=>a.includes(n))))),not_icontains:(t,e)=>e.map(fp).every((a=>t.map(fp).every((n=>!a.includes(n)))))},fp=t=>t.toLowerCase();function uE(t,e){return!t||Object.entries(t).every((a=>{var[n,r]=a,o=e?.[n];if(z(o)||dr(o))return!1;var i=[String(o)],s=lE[r.operator];return!!s&&s(r.values,i)}))}var By=ft("[Error tracking]"),Tx=class{constructor(e){var a,n;this.Jt=[],this.Kt=new jy([new Zy,new ex,new Xy,new Wy,new Qy,new Ky,new Yy,new Jy],lN("web:javascript",rN,sN)),this._instance=e,this.Jt=(a=(n=this._instance.persistence)==null?void 0:n.get_property(ax))!==null&&a!==void 0?a:[]}onRemoteConfig(e){var a,n,r,o=(a=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&a!==void 0?a:[],i=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[ax]:this.Jt,[LI]:i})}get Yt(){var e,a=!!this._instance.get_property(LI),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??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 By.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(a))return void By.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(a))return void By.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(((n,r)=>{var{type:o,value:i}=r;return dt(o)&&o.length>0&&n.$exception_types.push(o),dt(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.Jt.some((n=>{var r=n.values.map((o=>{var i,s=lE[o.operator],l=Me(o.value)?o.value:[o.value],u=(i=a[o.key])!==null&&i!==void 0?i:[];return l.length>0&&s(l,u)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}Zt(e){return e.flatMap((a=>{var n,r;return(n=(r=a.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((a=>a.filename&&a.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var a,n,r,o,i=(a=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&a!==void 0?a:[],s=i[i.length-1];return(r=s==null||(o=s.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Xt(e){return!Ae(e)&&Me(e)}},nn=ft("[FeatureFlags]"),Pu=ft("[FeatureFlags]",{debugEnabled:!0}),Py="$active_feature_flags",Fs="$override_feature_flags",YI="$feature_flag_payloads",Fu="$override_feature_flag_payloads",KI="$feature_flag_request_id",QI="$feature_flag_evaluated_at",JI=t=>{var e={};for(var[a,n]of pp(t||{}))n&&(e[a]=n);return e},cH=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((a=>{var n;return[a,(n=e[a].variant)!==null&&n!==void 0?n:e[a].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((a=>e[a].enabled)).filter((a=>{var n;return(n=e[a].metadata)==null?void 0:n.payload})).map((a=>{var n;return[a,(n=e[a].metadata)==null?void 0:n.payload]})))):nn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},dH=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),Rx=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 n=a&&typeof a=="string"&&a.trim().length>0;return n||nn.error("Invalid evaluation environment found:",a,"Expected non-empty string"),n})):[]}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(nx),a=this._instance.get_property(Fs),n=this._instance.get_property(Fu);if(!n&&!a)return e||{};var r=tt({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(a||{})])];for(var i of o){var s,l,u=r[i],c=a?.[i],d=z(c)?(s=u?.enabled)!==null&&s!==void 0&&s:!!c,f=z(c)?u.variant:typeof c=="string"?c:void 0,m=n?.[i],S=Z({},u,{enabled:d,variant:d?f??u?.variant:void 0});d!==u?.enabled&&(S.original_enabled=u?.enabled),f!==u?.variant&&(S.original_variant=u?.variant),m&&(S.metadata=Z({},u?.metadata,{payload:m,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),r[i]=S}return this.ii||(nn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var e=this._instance.get_property(zs),a=this._instance.get_property(Fs);if(!a)return e||{};for(var n=tt({},e),r=Object.keys(a),o=0;o<r.length;o++)n[r[o]]=a[r[o]];return this.ii||(nn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:a,finalFlags:n}),this.ii=!0),n}getFlagPayloads(){var e=this._instance.get_property(YI),a=this._instance.get_property(Fu);if(!a)return e||{};for(var n=tt({},e||{}),r=Object.keys(a),o=0;o<r.length;o++)n[r[o]]=a[r[o]];return this.ii||(nn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:a,finalPayloads:n}),this.ii=!0),n}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 n={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:Z({},((a=this._instance.persistence)==null?void 0:a.get_initial_props())||{},this._instance.get_property($u)||{}),group_properties:this._instance.get_property(gi)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(n.disable_flags=!0),this.ui()&&(n.evaluation_environments=this.li());var r=this._instance.config.__preview_remote_config,o=r?"/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);r&&(n.timezone=nE()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:n,compression:this._instance.config.disable_compression?void 0:cr.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:{})),!n.disable_flags||this.ni)if(this.ai=!d,l.json&&(u=l.json.quotaLimited)!=null&&u.includes(dH.FeatureFlags))nn.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 f;n.disable_flags||this.receivedFeatureFlags((f=l.json)!==null&&f!==void 0?f:{},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 n=this.getFlagVariants()[e],r=""+n,o=this._instance.get_property(KI)||void 0,i=this._instance.get_property(QI)||void 0,s=this._instance.get_property(xp)||{};if((a.send_event||!("send_event"in a))&&(!(e in s)||!s[e].includes(r))){var l,u,c,d,f,m,S,b,x;Me(s[e])?s[e].push(r):s[e]=[r],(l=this._instance.persistence)==null||l.register({[xp]:s});var p=this.getFeatureFlagDetails(e),g={$feature_flag:e,$feature_flag_response:n,$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};z(p==null||(d=p.metadata)==null?void 0:d.version)||(g.$feature_flag_version=p.metadata.version);var v,y=(f=p==null||(m=p.reason)==null?void 0:m.description)!==null&&f!==void 0?f:p==null||(S=p.reason)==null?void 0:S.code;y&&(g.$feature_flag_reason=y),p!=null&&(b=p.metadata)!=null&&b.id&&(g.$feature_flag_id=p.metadata.id),z(p?.original_variant)&&z(p?.original_enabled)||(g.$feature_flag_original_response=z(p.original_variant)?p.original_enabled:p.original_variant),p!=null&&(x=p.metadata)!=null&&x.original_payload&&(g.$feature_flag_original_payload=p==null||(v=p.metadata)==null?void 0:v.original_payload),this._instance.capture("$feature_flag_called",g)}return n}nn.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 n=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:n};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:cr.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 n=this.getFeatureFlag(e,a);return z(n)?void 0:!!n}nn.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 n=this.getFlagVariants(),r=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=cH(i),f=d.flags,m=d.featureFlags,S=d.featureFlagPayloads;if(m){var b=i.requestId,x=i.evaluatedAt;if(Me(m)){nn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(m)for(var g=0;g<m.length;g++)p[m[g]]=!0;s&&s.register({[Py]:m,[zs]:p})}else{var v=m,y=S,_=f;i.errorsWhileComputingFlags&&(v=Z({},l,v),y=Z({},u,y),_=Z({},c,_)),s&&s.register(Z({[Py]:Object.keys(JI(v)),[zs]:v||{},[YI]:y||{},[nx]:_||{}},b?{[KI]:b}:{},x?{[QI]:x}:{}))}}})(e,this._instance.persistence,n,r,o),this.pi(a)}}override(e,a){a===void 0&&(a=!1),nn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:a})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return nn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Fs),this._instance.persistence.unregister(Fu),this.pi(),Pu.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var a,n=e;if(this.ii=!!((a=n.suppressWarning)!==null&&a!==void 0&&a),"flags"in n){if(n.flags===!1)this._instance.persistence.unregister(Fs),Pu.info("Flag overrides cleared");else if(n.flags){if(Me(n.flags)){for(var r={},o=0;o<n.flags.length;o++)r[n.flags[o]]=!0;this._instance.persistence.register({[Fs]:r})}else this._instance.persistence.register({[Fs]:n.flags});Pu.info("Flag overrides set",{flags:n.flags})}}return"payloads"in n&&(n.payloads===!1?(this._instance.persistence.unregister(Fu),Pu.info("Payload overrides cleared")):n.payloads&&(this._instance.persistence.register({[Fu]:n.payloads}),Pu.info("Payload overrides set",{payloads:n.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:a,flagVariants:n}=this.gi();e(a,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,a,n){var r,o=(this._instance.get_property(qu)||[]).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),n&&(s.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(i,!1);var l=Z({},this.getFlagVariants(),{[e]:a});(r=this._instance.persistence)==null||r.register({[Py]:Object.keys(JI(l)),[zs]:l}),this.pi()}getEarlyAccessFeatures(e,a,n){a===void 0&&(a=!1);var r=this._instance.get_property(qu),o=n?"&"+n.map((i=>"stage="+i)).join("&"):"";if(r&&!a)return e(r);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(qu),(l=this._instance.persistence)==null||l.register({[qu]:u}),e(u)}}})}gi(){var e=this.getFlags(),a=this.getFlagVariants();return{flags:e.filter((n=>a[n])),flagVariants:Object.keys(a).filter((n=>a[n])).reduce(((n,r)=>(n[r]=a[r],n)),{})}}pi(e){var{flags:a,flagVariants:n}=this.gi();this.featureFlagEventHandlers.forEach((r=>r(a,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0);var n=this._instance.get_property($u)||{};this._instance.register({[$u]:Z({},n,e)}),a&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister($u)}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0);var n=this._instance.get_property(gi)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=Z({},n[r],e[r]),delete e[r]})),this._instance.register({[gi]:Z({},n,e)}),a&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var a=this._instance.get_property(gi)||{};this._instance.register({[gi]:Z({},a,{[e]:{}})})}else this._instance.unregister(gi)}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}},fH=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Wu=class{constructor(e,a){this.F=e,this.props={},this.mi=!1,this.yi=(n=>{var r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&$.info("Persistence loaded",e.persistence,Z({},this.props)),this.update_config(e,e,a),this.save()}isDisabled(){return!!this.wi}bi(e){fH.indexOf(e.persistence.toLowerCase())===-1&&($.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var a=e.persistence.toLowerCase();return a==="localstorage"&&We.H()?We:a==="localstorage+cookie"&&lp.H()?lp:a==="sessionstorage"&&It.H()?It:a==="memory"?ON:a==="cookie"?Cn:lp.H()?lp:Cn}properties(){var e={};return Be(this.props,(function(a,n){if(n===zs&&vt(a))for(var r=Object.keys(a),o=0;o<r.length;o++)e["$feature/"+r[o]]=a[r[o]];else s=n,l=!1,(dr(i=gN)?l:pI&&i.indexOf===pI?i.indexOf(s)!=-1:(Be(i,(function(u){if(l||(l=u===s))return vp})),l))||(e[n]=a);var i,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=tt({},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,n){if(vt(e)){z(a)&&(a="None"),this.xi=z(n)?this.$i:n;var r=!1;if(Be(e,((o,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==a||(this.props[i]=o,r=!0)})),r)return this.save(),!0}return!1}register(e,a){if(vt(e)){this.xi=z(a)?this.$i:a;var n=!1;if(Be(e,((r,o)=>{e.hasOwnProperty(o)&&this.props[o]!==r&&(this.props[o]=r,n=!0)})),n)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=KA(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);Us(Xx(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=q?.referrer)?JA(e):{})}update_referrer_info(){var e;this.register_once({$referrer:eE(),$referring_domain:q!=null&&q.referrer&&((e=wp(q.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[sx]||this.props[lx]||this.register_once({[bp]:tE(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Be([lx,sx],(i=>{var s=this.props[i];s&&Be(s,(function(l,u){e["$initial_"+zy(u)]=l}))}));var a,n,r=this.props[bp];if(r){var o=(a=aE(r),n={},Be(a,(function(i,s){n["$initial_"+zy(s)]=i})),n);tt(e,o)}return e}safe_merge(e){return Be(this.props,(function(a,n){n in e||(e[n]=a)})),e}update_config(e,a,n){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==a.persistence){var r=this.bi(e),o=this.props;this.clear(),this.Y=r,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 n=this.props[zu]||{};n[e]=a,this.props[zu]=n,this.save()}remove_event_timer(e){var a=(this.props[zu]||{})[e];return z(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()}},Nu=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),H6=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),U6=(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})({}),z6=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),Fy=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),q6=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),$6=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),V6=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),mp=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),eA=(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})({}),cE=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),tc=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((n=>n!==a))}}emit(e,a){for(var n of this.ki[e]||[])n(a);for(var r of this.ki["*"]||[])r(e,a)}};function Ns(t,e,a){if(Ae(t))return!1;switch(a){case"exact":return t===e;case"contains":var n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(n,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var Mx=class{constructor(e){this.Pi=new tc,this.Ti=(a,n)=>this.Ri(a,n)&&this.Ii(a,n)&&this.Fi(a,n)&&this.Ci(a,n),this.Ri=(a,n)=>n==null||!n.event||a?.event===n?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!z((e=this._instance)==null?void 0:e.Ai)){var a;(a=this._instance)==null||a.Ai(((n,r)=>{this.on(n,r)}))}}register(e){var a,n;if(!z((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||"")}))})),(n=this._instance)!=null&&n.autocapture)){var r,o=new Set;e.forEach((i=>{var s;(s=i.steps)==null||s.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(r=this._instance)==null||r.autocapture.setElementSelectors(o)}}on(e,a){var n;a!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(a?.event))&&this.Oi&&((n=this.Oi)==null?void 0:n.size)>0&&this.Oi.forEach((r=>{this.Di(a,r)&&this.Pi.emit("actionCaptured",r.name)}))}ji(e){this.onAction("actionCaptured",(a=>e(a)))}Di(e,a){if(a?.steps==null)return!1;for(var n of a.steps)if(this.Ti(e,n))return!0;return!1}onAction(e,a){return this.Pi.on(e,a)}Ii(e,a){if(a!=null&&a.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!="string"||!Ns(r,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 n;if(a==null||!a.href)return!0;var r=this.zi(e);if(r.length>0)return r.some((s=>Ns(s.href,a.href,a.href_matching||"exact")));var o,i=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";return!!i&&Ns((o=i.match(/(?::|")href="(.*?)"/))?o[1]:"",a.href,a.href_matching||"exact")}Ni(e,a){var n;if(a==null||!a.text)return!0;var r=this.zi(e);if(r.length>0)return r.some((u=>Ns(u.text,a.text,a.text_matching||"exact")||Ns(u.$el_text,a.text,a.text_matching||"exact")));var o,i,s,l=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";return!!l&&(o=(function(u){for(var c,d=[],f=/(?::|")text="(.*?)"/g;!Ae(c=f.exec(u));)d.includes(c[1])||d.push(c[1]);return d})(l),i=a.text,s=a.text_matching||"exact",o.some((u=>Ns(u,i,s))))}Ui(e,a){var n,r;if(a==null||!a.selector)return!0;var o=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(o!=null&&o.includes(a.selector))return!0;var i=(e==null||(r=e.properties)==null?void 0:r.$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||uE(a.properties.reduce(((n,r)=>{var o=Me(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return n[r.key]={values:o,operator:r.operator||"exact"},n}),{}),e?.properties)}},we=ft("[Surveys]"),Dx="seenSurvey_",pH=(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},tA=t=>{var e=""+Dx+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Dx+t.id+"_"+t.current_iteration),e},hH=[Fy.Popover,Fy.Widget,Fy.API],mH={ignoreConditions:!1,ignoreDelay:!1,displayType:cE.Popover},Ox=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,a){return!!e&&uE(e.propertyFilters,a?.properties)}Gi(e,a){var n=new Map;return e.forEach((r=>{var o;(o=r.conditions)==null||(o=o[a])==null||(o=o.values)==null||o.forEach((i=>{if(i!=null&&i.name){var s=n.get(i.name)||[];s.push(r.id),n.set(i.name,s)}}))})),n}Vi(e,a,n){var r,o=(n===Nu.Activation?this.Hi:this.Bi).get(e),i=[];return(r=this._instance)==null||r.getSurveys((s=>{i=s.filter((l=>o?.includes(l.id)))})),i.filter((s=>{var l,u=(l=s.conditions)==null||(l=l[n])==null||(l=l.values)==null?void 0:l.find((c=>c.name===e));return this.Wi(u,a)}))}register(e){var a;z((a=this._instance)==null?void 0:a.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var a=e.filter((n=>{var r,o;return((r=n.conditions)==null?void 0:r.actions)&&((o=n.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));a.length!==0&&(this.Yi==null&&(this.Yi=new Mx(this._instance),this.Yi.init(),this.Yi.ji((n=>{this.onAction(n)}))),a.forEach((n=>{var r,o,i,s,l;n.conditions&&(r=n.conditions)!=null&&r.actions&&(o=n.conditions)!=null&&(o=o.actions)!=null&&o.values&&((i=n.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0&&((s=this.Yi)==null||s.register(n.conditions.actions.values),(l=n.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(n.id),this.qi.set(u.name,c||[n.id])}})))})))}Ji(e){var a,n=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})),r=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}));(n.length!==0||r.length!==0)&&((a=this._instance)==null||a.Ai(((o,i)=>{this.onEvent(o,i)})),this.Hi=this.Gi(e,Nu.Activation),this.Bi=this.Gi(e,Nu.Cancellation))}onEvent(e,a){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[sp])||[];if(mp.SHOWN===e&&a&&r.length>0){var o;we.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:a,existingActivatedSurveys:r});var i=a==null||(o=a.properties)==null?void 0:o.$survey_id;if(i){var s=r.indexOf(i);s>=0&&(r.splice(s,1),this.Xi(r))}}else{if(this.Bi.has(e)){var l=this.Vi(e,a,Nu.Cancellation);l.length>0&&(we.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((c=>c.id))}),l.forEach((c=>{var d,f=r.indexOf(c.id);f>=0&&r.splice(f,1),(d=this._instance)==null||d.cancelPendingSurvey(c.id)})),this.Xi(r))}if(this.Hi.has(e)){we.info("survey event name matched",{event:e,eventPayload:a,surveys:this.Hi.get(e)});var u=this.Vi(e,a,Nu.Activation);this.Xi(r.concat(u.map((c=>c.id))||[]))}}}onAction(e){var a,n=((a=this._instance)==null||(a=a.persistence)==null?void 0:a.props[sp])||[];this.qi.has(e)&&this.Xi(n.concat(this.qi.get(e)||[]))}Xi(e){var a;we.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}},Bx=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(Ae(a))return we.warn("Flags not loaded yet. Not loading surveys.");var n=Me(a);this.Zi=n?a.length>0:a,we.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],a=0;a<localStorage.length;a++){var n=localStorage.key(a);(n!=null&&n.startsWith(Dx)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)we.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)we.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())we.info("Not loading surveys in cookieless mode without consent.");else{var e=te?.__PosthogExtensions__;if(e){if(!z(this.Zi)||this._instance.config.advanced_enable_surveys){var a=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var n=e.generateSurveys;if(n)return void this.re(n,a);var r=e.loadExternalDependency;if(!r)return void this.se("PostHog loadExternalDependency extension not found.");r(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 we.error("PostHog Extensions not found.")}}re(e,a){this._surveyManager=e(this._instance,a),this._surveyEventReceiver=new Ox(this._instance),we.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,a){we.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 we.info("Disabled. Not loading surveys."),e([]);var n=this._instance.get_property(rx);if(n&&!a)return e(n,{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 o;this.te=!1;var i=r.statusCode;if(i!==200||!r.json){var s="Surveys API could not be loaded, status: "+i;return we.error(s),e([],{isLoaded:!1,error:s})}var l,u=r.json.surveys||[],c=u.filter((d=>(function(f){return!(!f.start_date||f.end_date)})(d)&&((function(f){var m;return!((m=f.conditions)==null||(m=m.events)==null||(m=m.values)==null||!m.length)})(d)||(function(f){var m;return!((m=f.conditions)==null||(m=m.actions)==null||(m=m.values)==null||!m.length)})(d))));return c.length>0&&((l=this._surveyEventReceiver)==null||l.register(c)),(o=this._instance.persistence)==null||o.register({[rx]:u}),e(u,{isLoaded:!0})}})}catch(r){throw this.te=!1,r}}ne(e){for(var a of this.ee)try{if(!e.isLoaded)return a([],e);this.getSurveys(a)}catch(n){we.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,a){if(a===void 0&&(a=!1),!Ae(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,a);we.warn("init was not called")}oe(e){var a=null;return this.getSurveys((n=>{var r;a=(r=n.find((o=>o.id===e)))!==null&&r!==void 0?r:null})),a}ae(e){if(Ae(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(Ae(this._surveyManager))return we.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 Ae(this._surveyManager)?(we.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((n=>{this.getSurveys((r=>{var o,i=(o=r.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(i){var s=this.ae(i);n({visible:s.eligible,disabledReason:s.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),a)}))}renderSurvey(e,a){var n;if(Ae(this._surveyManager))we.warn("init was not called");else{var r=typeof e=="string"?this.oe(e):e;if(r!=null&&r.id)if(hH.includes(r.type)){var o=q?.querySelector(a);if(o)return(n=r.appearance)!=null&&n.surveyPopupDelaySeconds?(we.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var i,s;we.info("Rendering survey "+r.id+" with delay of "+((i=r.appearance)==null?void 0:i.surveyPopupDelaySeconds)+" seconds"),(s=this._surveyManager)==null||s.renderSurvey(r,o),we.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,o);we.warn("Survey element not found")}else we.warn("Surveys of type "+r.type+" cannot be rendered in the app");else we.warn("Survey not found")}}displaySurvey(e,a){var n;if(Ae(this._surveyManager))we.warn("init was not called");else{var r=this.oe(e);if(r){var o=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&a.ignoreDelay&&(o=Z({},r,{appearance:Z({},r.appearance,{surveyPopupDelaySeconds:0})})),a.ignoreConditions===!1){var i=this.canRenderSurvey(r);if(!i.visible)return void we.warn("Survey is not eligible to be displayed: ",i.disabledReason)}a.displayType!==cE.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,a.selector)}else we.warn("Survey not found")}}cancelPendingSurvey(e){Ae(this._surveyManager)?we.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},aA=ft("[RateLimiter]"),Px=class{constructor(e){var a,n;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var o=r.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((i=>{aA.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void aA.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(((n=e.config.rate_limiting)==null?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var a,n,r;e===void 0&&(e=!1);var o=new Date().getTime(),i=(a=(n=this.instance.persistence)==null?void 0:n.get_property(ix))!==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,(r=this.instance.persistence)==null||r.set_property(ix,i),{isRateLimited:s,remainingTokens:i.tokens}}isServerRateLimited(e){var a=this.serverLimits[e||"events"]||!1;return a!==!1&&new Date().getTime()<a}},mi=ft("[RemoteConfig]"),Fx=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,n;(a=te.__PosthogExtensions__)!=null&&a.loadExternalDependency?(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(mi.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 mi.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void mi.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return mi.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){mi.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()):mi.info("__preview_remote_config is disabled. Logging config instead",e):mi.error("Failed to fetch remote config from PostHog.")}},Nx=3e3,Hx=class{constructor(e,a){this.he=!0,this.ve=[],this.de=bn(a?.flush_interval_ms||Nx,250,5e3,$.createLogger("flush interval"),Nx),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((n=>n.url.indexOf("/e")===0)),...a.filter((n=>n.url.indexOf("/e")!==0))].map((n=>{this.ce(Z({},n,{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(),n=function(){var o=a[r],i=new Date().getTime();o.data&&Me(o.data)&&Be(o.data,(s=>{s.offset=Math.abs(s.timestamp-i),delete s.timestamp})),e.ce(o)};for(var r in a)n()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return Be(this.ve,(a=>{var n,r=a,o=(r?r.batchKey:null)||r.url;z(e[o])&&(e[o]=Z({},r,{data:[]})),(n=e[o].data)==null||n.push(r.data)})),this.ve=[],e}},gH=["retriesPerformedSoFar"],Ux=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!z(E)&&"onLine"in E.navigator&&(this.be=E.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},it(E,"online",this.we),it(E,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:a}=e,n=lA(e,gH);_n(a)&&a>0&&(n.url=Rp(n.url,{retry_count:a})),this._instance.ci(Z({},n,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(a??0)<10?this.Se(Z({retriesPerformedSoFar:a},n)):n.callback==null||n.callback(r)}}))}Se(e){var a=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=a+1;var n=(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),r=Date.now()+n;this.ve.push({retryAt:r,requestOptions:e});var o="Enqueued failed request for retry in "+n;navigator.onLine||(o+=" (Browser is offline)"),$.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=[],n=this.ve.filter((o=>o.retryAt<e||(a.push(o),!1)));if(this.ve=a,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,z(E)||(this.we&&(E.removeEventListener("online",this.we),this.we=void 0),this.xe&&(E.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(Z({},e,{transport:"sendBeacon"}))}catch(a){$.error(a)}this.ve=[]}},zx=class{constructor(e){this.ke=()=>{var a,n,r,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,(n=this.Pe.maxScrollHeight)!==null&&n!==void 0?n:0),this.Pe.lastContentY=u,this.Pe.maxContentY=Math.max(u,(r=this.Pe.maxContentY)!==null&&r!==void 0?r: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(){it(E,"scroll",this.ke,{capture:!0}),it(E,"scrollend",this.ke,{capture:!0}),it(E,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return E?.document.documentElement;var e=Me(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var a of e){var n=E?.document.querySelector(a);if(n)return n}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return E&&(E.scrollY||E.pageYOffset||E.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return E&&(E.scrollX||E.pageXOffset||E.document.documentElement.scrollLeft)||0}},vH=t=>tE(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),Dp=class{constructor(e,a,n,r){this.Te=o=>{var i=this.Re();if(!i||i.sessionId!==o){var s={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[ox]:s})}},this._instance=e,this.Ce=a,this.Fe=n,this.Ie=r||vH,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[ox]}getSetOnceProps(){var e,a=(e=this.Re())==null?void 0:e.props;return a?"r"in a?aE(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 Be(Xx(this.getSetOnceProps()),((a,n)=>{n==="$current_url"&&(n="url"),e["$session_entry_"+zy(n)]=a})),e}},Ny=ft("[SessionId]"),Op=class{on(e,a){return this.Me.on(e,a)}constructor(e,a,n){var r;if(this.Oe=[],this.Ae=void 0,this.Me=new tc,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||fo,this.Ue=n||fo;var o=this.F.persistence_name||this.F.token,i=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*bn(i,60,36e3,Ny.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=It.W(this.He),l=It.W(this.Be);s&&!l?this.je=s:It.V(this.He),It.G(this.Be,!0)}if((r=this.F.bootstrap)!=null&&r.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){Ny.error("Invalid sessionID in bootstrap",c)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return z(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&&It.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&It.G(this.He,e))}Je(){return this.je?this.je:this.qe()?It.W(this.He):null}We(e,a,n){e===this.Le&&a===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=a,this.Le=e,this.Fe.register({[yp]:[a,e,n]}))}Ke(){var e=this.Fe.props[yp];return Me(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&&E&&(E.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&It.V(this.Be)},it(E,"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 n=a||new Date().getTime(),[r,o,i]=this.Ke(),s=this.Je(),l=_n(i)&&i>0&&Math.abs(n-i)>864e5,u=!1,c=!o,d=!c&&!e&&this.De(n,r);c||d||l?(o=this.Ne(),s=this.Ue(),Ny.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}}),i=n,u=!0):s||(s=this.Ue(),u=!0);var f=r===0||!e||l?n:r,m=i===0?new Date().getTime():i;return this.Ve(s),this.We(o,f,m),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:m,changeReason:u?{noSessionId:c,activityTimeout:d,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 a=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:a})}}),1.1*this.sessionTimeoutMs)}},yH=["$set_once","$set"],uo=ft("[SiteApps]"),qx=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 n=this.globalsForEvent(a);this.Xe.push(n),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,n,r,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[f,m]of Object.entries(d))u[f]={id:c[f],type:f,properties:m};var{$set_once:S,$set:b}=e;return{event:Z({},lA(e,yH),{properties:Z({},e.properties,b?{$set:Z({},(a=(n=e.properties)==null?void 0:n.$set)!==null&&a!==void 0?a:{},b)}:{},S?{$set_once:Z({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},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],n=()=>{var s;!a.errored&&this.Xe.length&&(uo.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))},r=!1,o=s=>{a.errored=!s,a.loaded=!0,uo.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&n()};try{var{processEvent:i}=e.init({posthog:this._instance,callback:s=>{o(s)}});i&&(a.processEvent=i),r=!0}catch(s){uo.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(r&&a.loaded)try{n()}catch(s){uo.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 n of e)this.setupSiteApp(n)}ir(e){if(Object.keys(this.apps).length!==0){var a=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(a)}catch(r){uo.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var a,n,r,o=this;if((a=this.siteAppLoaders)!=null&&a.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(u=>this.ir(u)))):void uo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Ze)==null||n.call(this),(r=e.siteApps)!=null&&r.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 uo.error("Error while initializing PostHog app with config id "+u,d)}))};for(var{id:s,url:l}of e.siteApps)i(s)}else uo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},dE=function(t,e){if(!t)return!1;var a=t.userAgent;if(a&&vI(a,e))return!0;try{var n=t?.userAgentData;if(n!=null&&n.brands&&n.brands.some((r=>vI(r?.brand,e))))return!0}catch{}return!!t.webdriver},Gu=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),nA="i.posthog.com",$x=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("."+nA,".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]=Gu.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Gu.EU:this.er[this.apiHost]=Gu.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===Gu.CUSTOM)return this.apiHost+a;var n=nA+a;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}},xH={icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!E&&Mp(e.href,t),not_regex:(t,e)=>!!E&&!Mp(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},Vx=class t{constructor(e){var a=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),a.getWebExperiments((r=>{t.rr("retrieved web experiments from the server"),a.sr=new Map,r.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);dt(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)}}))}),n)},this._instance=e,this._instance.onFeatureFlags((n=>{this.onFeatureFlags(n)}))}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(Ae(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((a=>{var n;if(this.sr&&(n=this.sr)!=null&&n.has(a)){var r,o=this._instance.getFeatureFlag(a),i=(r=this.sr)==null?void 0:r.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=Lp(e?.search,"__experiment_id"),n=Lp(e?.search,"__experiment_variant");a&&n&&(t.rr("previewing web experiments "+a+" && "+n),this.getWebExperiments((r=>{this.lr(parseInt(a),n,r)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,a,n){if(this._instance.config.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!a)return e(r);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,n){var r=n.filter((o=>o.id===e));r&&r.length>0&&(t.rr("Previewing web experiment ["+r[0].name+"] with variant ["+a+"]"),this.nr(r[0].name,a,r[0].variants[a].transforms))}static ar(e){return!Ae(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var a;if(Ae(e.conditions)||Ae((a=e.conditions)==null?void 0:a.url))return!0;var n,r,o,i=t.getWindowLocation();return!!i&&((n=e.conditions)==null||!n.url||xH[(r=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,i))}static getWindowLocation(){return E?.location}static hr(e){var a;if(Ae(e.conditions)||Ae((a=e.conditions)==null?void 0:a.utm))return!0;var n=KA();if(n.utm_source){var r,o,i,s,l,u,c,d,f=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==n.utm_campaign,m=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==n.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)==n.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)==n.utm_term;return f&&S&&b&&m}return!1}static rr(e){for(var a=arguments.length,n=new Array(a>1?a-1:0),r=1;r<a;r++)n[r-1]=arguments[r];$.info("[WebExperiments] "+e,n)}nr(e,a,n){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):a!=="control"?n.forEach((r=>{if(r.selector){var o;t.rr("applying transform of variant "+a+" for experiment "+e+" ",r);var i=(o=document)==null?void 0:o.querySelectorAll(r.selector);i?.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 ba&&this._instance?dE(ba,this._instance.config.custom_blocked_useragents):void 0}},bH=ft("[PostHog ExternalIntegrations]"),SH={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},jx=class{constructor(e){this._instance=e}it(e,a){var n;(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(r=>{if(r)return bH.error("failed to load script",r);a()}))}startIfEnabledOrStop(){var e=this,a=function(i){var s,l,u;!r||(s=te.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[i]||e.it(SH[i],(()=>{var c;(c=te.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[i])==null||c.start(e._instance)})),!r&&(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[n,r]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;a(n)}}},Gx="[SessionRecording]",Hu=ft(Gx),Bp=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 Hu.error("started without valid sessionManager"),new Error(Gx+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Gx+' cannot be used with cookieless_mode="always"')}get cr(){var e,a=!((e=this._instance.get_property(ky))==null||!e.enabled),n=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return E&&a&&n&&!r}startIfEnabledOrStop(e){var a;if(!this.cr||(a=this.vr)==null||!a.isStarted){var n=!z(Object.assign)&&!z(Array.from);this.cr&&n?(this.gr(e),Hu.info("starting")):this.stopRecording()}}gr(e){var a,n,r;this.cr&&(te!=null&&(a=te.__PosthogExtensions__)!=null&&(a=a.rrweb)!=null&&a.record&&(n=te.__PosthogExtensions__)!=null&&n.initSessionRecording?this._r(e):(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return Hu.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(yA)}br(e){if(this._instance.persistence){var a,n,r=this._instance.persistence,o=()=>{var i=e.sessionRecording===!1?void 0:e.sessionRecording,s=i?.sampleRate,l=Ae(s)?null:parseFloat(s);Ae(l)&&this.yr();var u=i?.minimumDurationMilliseconds;r.register({[ky]:Z({enabled:!!i},i,{networkPayloadCapture:Z({capturePerformance:e.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:z(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=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:Hu.info("skipping remote config with no sessionRecording",e)}log(e,a){var n;a===void 0&&(a="log"),(n=this.vr)!=null&&n.log?this.vr.log(e,a):Hu.warn("log called before recorder was ready")}get mr(){var e,a,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(ky);return(n==null||(a=n.scriptConfig)==null?void 0:a.script)||"lazy-recorder"}_r(e){var a,n;if((a=te.__PosthogExtensions__)==null||!a.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(n=te.__PosthogExtensions__)==null?void 0:n.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,n;this.vr||(n=this._instance.persistence)==null||n.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 n;return!((n=this.vr)==null||!n.tryAddCustomEvent(e,a))}},Xu={},Zx=()=>{},Hs="posthog",fE=!uH&&na?.indexOf("MSIE")===-1&&na?.indexOf("Mozilla")===-1,rA=t=>{var e;return Z({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:mN(q?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Zx,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:ra&&dt(ra?.search)&&ra.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:(E==null||(e=E.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 n="Bad HTTP status: "+a.statusCode+" "+a.text;$.error(n)},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:Nx},error_tracking:{},_onCapture:Zx,__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))},oA=t=>{var e={};z(t.process_person)||(e.person_profiles=t.process_person),z(t.xhr_headers)||(e.request_headers=t.xhr_headers),z(t.cookie_name)||(e.persistence_name=t.cookie_name),z(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),z(t.store_google)||(e.save_campaign_params=t.store_google),z(t.verbose)||(e.debug=t.verbose);var a=tt({},e,t);return Me(t.property_blacklist)&&(z(t.property_denylist)?a.property_denylist=t.property_blacklist:Me(t.property_denylist)?a.property_denylist=[...t.property_blacklist,...t.property_denylist]:$.error("Invalid value for property_denylist config: "+t.property_denylist)),a},Wx=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}},Pp=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 Wx,this.Sr=!1,this.version=sr.LIB_VERSION,this.Er=new tc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=rA(),this.SentryIntegration=vx,this.sentryIntegration=e=>(function(a,n){var r=OA(a,n);return{name:DA,processEvent:o=>r(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 Rx(this),this.toolbar=new yx(this),this.scrollManager=new zx(this),this.pageViewManager=new Lx(this),this.surveys=new Bx(this),this.experiments=new Vx(this),this.exceptions=new Tx(this),this.rateLimiter=new Px(this),this.requestRouter=new $x(this),this.consent=new hx(this),this.externalIntegrations=new jx(this),this.people={set:(e,a,n)=>{var r=dt(e)?{[e]:a}:e;this.setPersonProperties(r),n?.({})},set_once:(e,a,n)=>{var r=dt(e)?{[e]:a}:e;this.setPersonProperties(void 0,r),n?.({})}},this.on("eventCaptured",(e=>$.info('send "'+e?.event+'"',e)))}init(e,a,n){if(n&&n!==Hs){var r,o=(r=Xu[n])!==null&&r!==void 0?r:new t;return o._init(e,a,n),Xu[n]=o,Xu[Hs][n]=o,o}return this._init(e,a,n)}_init(e,a,n){var r;if(a===void 0&&(a={}),z(e)||qy(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={},a.debug=this.Rr(a.debug),this.Ir=a,this.Fr=[],a.person_profiles&&(this.Pr=a.person_profiles),this.set_config(tt({},rA(a.defaults),oA(a),{name:n,token:e})),this.config.on_xhr_error&&$.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=a.disable_compression?void 0:cr.GZipJS;var o=this.Cr();this.persistence=new Wu(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Wu(Z({},this.config,{persistence:"sessionStorage"}),o);var i=Z({},this.persistence.props),s=Z({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new Hx((g=>this.Or(g)),this.config.request_queue_config),this.Ar=new Ux(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 Op(this),this.sessionPropsManager=new Dp(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)),sr.DEBUG=sr.DEBUG||this.config.debug,sr.DEBUG&&$.info("Starting in debug mode",{this:this,config:a,thisC:Z({},this.config),p:i,s}),((r=a.bootstrap)==null?void 0:r.distinctID)!==void 0){var u,c,d=this.config.get_device_id(fo()),f=(u=a.bootstrap)!=null&&u.isIdentifiedID?d:a.bootstrap.distinctID;this.persistence.set_property(lr,(c=a.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:f})}if(this.jr()){var m,S,b=Object.keys(((m=a.bootstrap)==null?void 0:m.featureFlags)||{}).filter((g=>{var v;return!((v=a.bootstrap)==null||(v=v.featureFlags)==null||!v[g])})).reduce(((g,v)=>{var y;return g[v]=((y=a.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[v])||!1,g}),{}),x=Object.keys(((S=a.bootstrap)==null?void 0:S.featureFlagPayloads)||{}).filter((g=>b[g])).reduce(((g,v)=>{var y,_;return(y=a.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[v]&&(g[v]=(_=a.bootstrap)==null||(_=_.featureFlagPayloads)==null?void 0:_[v]),g}),{});this.featureFlags.receivedFeatureFlags({featureFlags:b,featureFlagPayloads:x})}if(l)this.register_once({distinct_id:Ru,$device_id:null},"");else if(!this.get_distinct_id()){var p=this.config.get_device_id(fo());this.register_once({distinct_id:p,$device_id:p},""),this.persistence.set_property(lr,"anonymous")}return it(E,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),a.segment?FN(this,(()=>this.Lr())):this.Lr(),po(this.config._onCapture)&&this.config._onCapture!==Zx&&($.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(g=>this.config._onCapture(g.event,g)))),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 a=performance.now();this.historyAutocapture=new gx(this),this.historyAutocapture.startIfEnabled();var n=[];n.push((()=>{new xx(this).startIfEnabledOrStop()})),n.push((()=>{var r;this.siteApps=new qx(this),(r=this.siteApps)==null||r.init()})),e||n.push((()=>{this.sessionRecording=new Bp(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||n.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),n.push((()=>{this.autocapture=new cx(this),this.autocapture.startIfEnabled()})),n.push((()=>{this.surveys.loadIfEnabled()})),n.push((()=>{this.heatmaps=new wx(this),this.heatmaps.startIfEnabled()})),n.push((()=>{this.webVitalsAutocapture=new _x(this)})),n.push((()=>{this.exceptionObserver=new mx(this),this.exceptionObserver.startIfEnabled()})),n.push((()=>{this.deadClicksAutocapture=new Ip(this,PN),this.deadClicksAutocapture.startIfEnabled()})),n.push((()=>{if(this.Nr){var r=this.Nr;this.Nr=void 0,this.fi(r)}})),this.Ur(n,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 n=e.shift();if(n)try{n()}catch(o){$.error("Error initializing extension:",o)}}var r=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:r}),this.config.__preview_deferred_init_extensions&&$.info("PostHog extensions initialized ("+r+"ms)")}fi(e){var a,n,r,o,i,s,l,u;if(!q||!q.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=fe(e.supportedCompression,cr.GZipJS)?cr.GZipJS:fe(e.supportedCompression,cr.Base64)?cr.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"}),(n=this.siteApps)==null||n.onRemoteConfig(e),(r=this.sessionRecording)==null||r.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){$.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new Fx(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()&&mo(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&&(fE?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Rp(e.url,{ip:this.config.ip?1:0}),e.headers=Z({},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 n,r,o,i=Z({},a);i.timeout=i.timeout||6e4,i.url=Rp(i.url,{_:new Date().getTime().toString(),ver:sr.LIB_VERSION,compression:i.compression});var s=(n=i.transport)!==null&&n!==void 0?n:"fetch",l=hp.filter((c=>!i.disableTransport||!c.transport||!i.disableTransport.includes(c.transport))),u=(r=(o=mA(l,(c=>c.transport===s)))==null?void 0:o.method)!==null&&r!==void 0?r:l[0].method;if(!u)throw new Error("No available transport method");u(i)})(Z({},e,{callback:a=>{var n,r;this.rateLimiter.checkForLimiting(a),a.statusCode>=400&&((n=(r=this.config).on_request_error)==null||n.call(r,a)),e.callback==null||e.callback(a)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var a,n=[],r=[],o=[];mo(e,(s=>{s&&(a=s[0],Me(a)?o.push(s):po(s)?s.call(this):Me(s)&&a==="alias"?n.push(s):Me(s)&&a.indexOf("capture")!==-1&&po(this[a])?o.push(s):r.push(s))}));var i=function(s,l){mo(s,(function(u){if(Me(u[0])){var c=l;Be(u,(function(d){c=c[d[0]].apply(c,d.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),l)};i(n,this),i(r,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,n){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!z(e)&&dt(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var i=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(i==null||!i.isRateLimited){a!=null&&a.$current_url&&!dt(a?.$current_url)&&($.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=n?.timestamp||s,u=fo(),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),n?.$set&&(c.$set=n?.$set);var d,f=this.qr(n?.$set_once);if(f&&(c.$set_once=f),(c=pN(c,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,z(n?.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s),e===mp.DISMISSED||e===mp.SENT){var m=a?.[eA.SURVEY_ID],S=a?.[eA.SURVEY_ITERATION];d={id:m,current_iteration:S},localStorage.getItem(tA(d))||localStorage.setItem(tA(d),"true"),c.$set=Z({},c.$set,{[pH({id:m,current_iteration:S},e===mp.SENT?"responded":"dismissed")]:!0})}var b=Z({},c.properties.$set,c.$set);if(Us(b)||this.setPersonPropertiesForFlags(b),!Ae(this.config.before_send)){var x=this.Wr(c);if(!x)return;c=x}this.Er.emit("eventCaptured",c);var p={method:"POST",url:(r=n?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:n?._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Or(p):this.Mr.enqueue(p),c}$.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",(a=>e(a.event,a)))}calculateEventProperties(e,a,n,r,o){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return a;var i=o?void 0:this.persistence.remove_event_timer(e),s=Z({},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=Z({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!dt(s.distinct_id)&&!_n(s.distinct_id)||qy(s.distinct_id))&&$.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,c=JN(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(o,n.getTime());s.$session_id=d,s.$window_id=f}this.sessionPropsManager&&tt(s,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&tt(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(m=this.Ar)==null?void 0:m.length}catch(p){s.$sdk_debug_error_capturing_properties=String(p)}if(this.requestRouter.region===Gu.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),u=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),s=tt(s,u),e==="$pageview"&&q&&(s.title=q.title),!z(i)){var S=n.getTime()-i;s.$duration=parseFloat((S/1e3).toFixed(3))}na&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=tt({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Me(this.config.property_denylist)?Be(this.config.property_denylist,(function(p){delete s[p]})):$.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 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 n=this.persistence.get_initial_props(),r=(a=this.sessionPropsManager)==null?void 0:a.getSetOnceProps(),o=tt({},n,r||{},e||{}),i=this.config.sanitize_properties;return i&&($.error("sanitize_properties is deprecated. Use before_send instead"),o=i(o,"$set_once")),this.Sr=!0,Us(o)?void 0:o}register(e,a){var n;(n=this.persistence)==null||n.register(e,a)}register_once(e,a,n){var r;(r=this.persistence)==null||r.register_once(e,a,n)}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,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,a,n)}getEarlyAccessFeatures(e,a,n){return a===void 0&&(a=!1),this.featureFlags.getEarlyAccessFeatures(e,a,n)}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,n;return(a=(n=this.sessionManager)==null?void 0:n.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=mH),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,n){if(!this.__loaded||!this.persistence)return $.uninitializedWarning("posthog.identify");if(_n(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!==Ru){if(this.Vr("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(Uu)&&(this.unregister(Uu),this.register({distinct_id:e}));var i=(this.persistence.get_property(lr)||"anonymous")==="anonymous";e!==r&&i?(this.persistence.set_property(lr,"identified"),this.setPersonPropertiesForFlags(Z({},n||{},a||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:a||{},$set_once:n||{}}),this.Tr=XI(e,a,n),this.featureFlags.setAnonymousDistinctId(r)):(a||n)&&this.setPersonProperties(a,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(xp))}}else $.critical('The string "'+Ru+'" 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,a){if((e||a)&&this.Vr("posthog.setPersonProperties")){var n=XI(this.get_distinct_id(),e,a);this.Tr!==n?(this.setPersonPropertiesForFlags(Z({},a||{},e||{})),this.capture("$set",{$set:e||{},$set_once:a||{}}),this.Tr=n):$.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,a,n){if(e&&a){if(this.Vr("posthog.group")){var r=this.getGroups();r[e]!==a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:Z({},r,{[e]:a})}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:a,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),r[e]===a||n||this.reloadFeatureFlags()}}else $.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,n,r,o;if($.info("reset"),!this.__loaded)return $.uninitializedWarning("posthog.reset");var i=this.get_property("$device_id");if(this.consent.reset(),(a=this.persistence)==null||a.clear(),(n=this.sessionPersistence)==null||n.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(lr,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Ru,$device_id:null},"");else{var s=this.config.get_device_id(fo());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:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+a);if(e!=null&&e.withTimestamp&&n){var o,i=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!n)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-i,0)}return r}alias(e,a){return e===this.get_property(gA)?($.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(z(a)&&(a=this.get_distinct_id()),e!==a?(this.Jr(Uu,e),this.capture("$create_alias",{alias:e,distinct_id:a})):($.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var a=Z({},this.config);if(vt(e)){var n,r,o,i,s;tt(this.config,oA(e));var l=this.Cr();(n=this.persistence)==null||n.update_config(this.config,a,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Wu(Z({},this.config,{persistence:"sessionStorage"}),l);var u=this.Rr(this.config.debug);ho(u)&&(this.config.debug=u),ho(this.config.debug)&&(this.config.debug?(sr.DEBUG=!0,We.H()&&We.G("ph_debug","true"),$.info("set_config",{config:e,oldConfig:a,newConfig:Z({},this.config)})):(sr.DEBUG=!1,We.H()&&We.V("ph_debug"))),(r=this.sessionRecording)==null||r.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,n={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(n).some(Boolean)){var r,o,i,s,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),n.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),n.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),n.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),n.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 n=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(Z({},r,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:Hs;return a!==Hs&&(a=Hs+"."+a),a}_isIdentified(){var e,a;return((e=this.persistence)==null?void 0:e.get_property(lr))==="identified"||((a=this.sessionPersistence)==null?void 0:a.get_property(lr))==="identified"}Gr(){var e,a;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Us(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Uu])&&((a=this.persistence)==null||(a=a.props)==null||!a[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(),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,n,r,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((n=this.persistence)==null||n.set_disabled(o)),((a=this.sessionPersistence)==null?void 0:a.wi)!==o&&((r=this.sessionPersistence)==null||r.set_disabled(o)),o}opt_in_capturing(e){var a;if(this.config.cookieless_mode!=="always"){var n,r;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(n=this.sessionManager)==null||n.destroy(),this.sessionManager=new Op(this),this.persistence&&(this.sessionPropsManager=new Dp(this,this.sessionManager,this.persistence)),this.sessionRecording=new Bp(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(),(z(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,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:Ru,$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())):$.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===ur.GRANTED?"granted":e===ur.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 ba?dE(ba,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),it(q,"visibilitychange",this.kr)))}debug(e){e===!1?(E?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(E?.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,n,r,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?($.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):(n="advanced_disable_decide",r=!1,o=$,i=(a="advanced_disable_flags")in(e=l)&&!z(e[a]),s=n in e&&!z(e[n]),i?e[a]:s?(o&&o.warn("Config field '"+n+"' is deprecated. Please use '"+a+"' instead. The old field will be removed in a future major version."),e[n]):r)}Wr(e){if(Ae(this.config.before_send))return e;var a=Me(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of a){if(n=r(n),Ae(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return YF(e.event)?$.warn(o+". This can cause unexpected behavior."):$.info(o),null}n.properties&&!Us(n.properties)||$.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return n}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,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:a,$ai_metric_value:String(n)})}Rr(e){var a=ho(e)&&!e,n=We.H()&&We.q("ph_debug")==="true";return!a&&(!!n||e)}};(function(t,e){for(var a=0;a<e.length;a++)t.prototype[e[a]]=fN(t.prototype[e[a]])})(Pp,["identify"]);var iA,pE=(iA=Xu[Hs]=new Pp,(function(){function t(){t.done||(t.done=!0,fE=!1,Be(Xu,(function(e){e._dom_loaded()})))}q!=null&&q.addEventListener?q.readyState==="complete"?t():it(q,"DOMContentLoaded",t,{capture:!1}):E&&$.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),iA);var ob=class{constructor(e={}){this.options=e;B(this,"client");B(this,"featureFlagsCallback");B(this,"captureCallback");B(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(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 a=e.enableFeatureFlags??!0,n=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=pE.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:r=>{if(a&&this.featureFlagsCallback){r.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&&r.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)})}},n)}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let a={};for(let[n,r]of Object.entries(e))n.startsWith("in_segment_")&&(a[n]=r===!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,n){this.track("shadow_canvas_action",{action:e,rectangleId:a,surface:n})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,a,n){let r=`$experiment_${e}`;this.register({[r]:n??`variation_${a}`,[`${r}_id`]:a}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:a,$experiment_variation_name:n??`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 ib(t={}){return new ob(t)}var sb=async(t,e)=>{let a=[];if(e.applyAction)for(let n of t.actions){let r=await e.applyAction(n);a.push(r)}return{cleanup:async()=>{for(let n=a.length-1;n>=0;n--)try{await a[n].revert()}catch{}}}},lb=async(t,e)=>{let a=[];if(e.applyAction){let n=t.actions.map(r=>e.applyAction(r));if(t.waitFor==="any"){let r=await Promise.race(n);a.push(r);let o=await Promise.allSettled(n);for(let i of o)i.status==="fulfilled"&&i.value!==r&&a.push(i.value)}else{let r=await Promise.all(n);a.push(...r)}}return{cleanup:async()=>{for(let n of a)try{await n.revert()}catch{}}}},ub=async(t,e)=>{let a,n,r=!1,o={cleanup:()=>{r=!0,n&&clearTimeout(n),a&&a()}};return t.event&&e.subscribeEvent?await new Promise(i=>{a=e.subscribeEvent(t.event,()=>{r||i()}),t.durationMs!==void 0&&(n=setTimeout(()=>{r||i()},t.durationMs))}):t.durationMs!==void 0&&await new Promise(i=>{n=setTimeout(()=>{r||i()},t.durationMs)}),o};var Up=class{constructor(){B(this,"executors",new Map);for(let{kind:e,executor:a}of qg)this.registerCore(e,a);for(let{kind:e,executor:a}of ev)this.registerCore(e,a);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",sb),this.registerCore("core:parallel",lb),this.registerCore("core:wait",ub)}registerCore(e,a,n){this.executors.set(e,{kind:e,executor:a,schema:n,source:"core",isBuiltIn:!0})}register(e,a,n,r="custom",o=!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:a,schema:n,source:r,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,n]of this.executors.entries())n.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:n}=e;if(!n||typeof n!="string")return a.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:a,warnings:[]};let r=this.executors.get(n);if(!r)return a.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${n}`,field:"kind"}),{valid:!1,errors:a,warnings:[]};if(r.schema){let o=r.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)}},fr=new Up;function CH(t){return fr.get(t)}function cb(t){return fr.has(t)}var _H=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),hE=5e4,mE=50;function yo(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:n}=t;if(!n||typeof n!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:a};if(!cb(n)&&n!=="core:mountWidget"){let r=fr.list();return console.error(`[ActionValidation] Unknown action kind: "${n}". Registered kinds (${r.length}): [${r.join(", ")}]. This usually means the app that provides "${n}" hasn't been activated yet, or the executor was never registered in ExecutorRegistry.`),e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${n}`,field:"kind"}),{valid:!1,errors:e,warnings:a}}switch(n){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":vo(t,e,a);break;case"overlays:badge":vo(t,e,a),wH(t,e,a);break;case"overlays:tooltip":vo(t,e,a),LH(t,e,a);break;case"overlays:modal":PH(t,e,a);break;case"content:insertHtml":vo(t,e,a),kH(t,e,a);break;case"content:setText":vo(t,e,a),IH(t,e,a);break;case"content:setAttr":vo(t,e,a),AH(t,e,a);break;case"content:addClass":case"content:removeClass":vo(t,e,a),EH(t,e,a);break;case"content:setStyle":vo(t,e,a),TH(t,e,a);break;case"core:mountWidget":RH(t,e,a);break;case"core:wait":MH(t,e,a);break;case"core:sequence":DH(t,e,a);break;case"core:parallel":OH(t,e,a);break;case"core:tour":FH(t,e,a);break;case"navigation:navigate":BH(t,e,a);break}return{valid:e.length===0,errors:e,warnings:a}}function vo(t,e,a){let n=t.anchorId;if(!n||typeof n!="object"){e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' object with a 'selector' string",field:"anchorId"});return}if(!n.selector||typeof n.selector!="string"?e.push({code:"MISSING_ANCHOR_SELECTOR",message:"anchorId requires a 'selector' string",field:"anchorId.selector"}):n.selector.length>200&&a.push({code:"LONG_ANCHOR_ID",message:"Anchor selector is unusually long",suggestion:"Consider using a shorter, more descriptive selector"}),n.route===void 0||n.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 r=Array.isArray(n.route)?n.route:[n.route];for(let o of r)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 wH(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 LH(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 kH(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>hE&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${hE}`,field:"html"});let n=["before","after","prepend","append","replace"];(!t.position||!n.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${n.join(", ")}`,field:"position"})}function IH(t,e,a){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function AH(t,e,a){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(_H.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 EH(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 TH(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 n=Object.keys(t.styles).length;n>mE&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${n}). Maximum is ${mE}`,field:"styles"});for(let[r,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${r}`,field:`styles.${r}`})}}function RH(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 MH(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 DH(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 n=0;n<t.actions.length;n++){let r=yo(t.actions[n]);for(let o of r.errors)e.push({...o,field:`actions[${n}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)a.push(o)}}function OH(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 n=0;n<t.actions.length;n++){let r=yo(t.actions[n]);for(let o of r.errors)e.push({...o,field:`actions[${n}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)a.push(o)}}function BH(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 n=t.url.trim().toLowerCase();n.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),n.startsWith("data:")&&a.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function PH(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 n=0;n<t.ctaButtons.length;n++){let r=t.ctaButtons[n];(!r.label||typeof r.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${n} requires 'label' property`,field:`ctaButtons[${n}].label`}),(!r.actionId||typeof r.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${n} requires 'actionId' property`,field:`ctaButtons[${n}].actionId`})}}function FH(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 n=new Set;for(let r=0;r<t.steps.length;r++){let o=t.steps[r];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${r} requires 'id' property`,field:`steps[${r}].id`}):(n.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${r}].id`}),n.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${r} requires 'action' property`,field:`steps[${r}].action`});else{let i=yo(o.action);for(let s of i.errors)e.push({...s,field:`steps[${r}].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 db(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 n=0;n<t.length;n++){let r=yo(t[n]);if(!r.valid){let o=t[n];console.error(`[ActionValidation] Action [${n}] failed validation:`,`kind="${o?.kind??"undefined"}"`,r.errors.map(i=>`${i.code}: ${i.message}`).join("; "),o)}for(let o of r.errors)e.push({...o,field:o.field?`[${n}].${o.field}`:`[${n}]`});for(let o of r.warnings)a.push({...o,suggestion:o.suggestion?`Action ${n}: ${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(n=>`${n.field??"?"}: ${n.message}`).join(" | ")),{valid:e.length===0,errors:e,warnings:a}}var NH=0;function fb(t){let{overlayRoot:e,eventBus:a,surfaces:n,anchorResolver:r,waitForAnchor:o,adaptiveId:i,executorRegistry:s=fr,subscribeNavigation:l,runtime:u}=t,c=new Map,d=new Map;function f(){return`action-${++NH}`}function m(C,A){a&&a.publish(C,A)}function S(){return{overlayRoot:e,resolveAnchor:r,waitForAnchor:o,generateId:f,publishEvent:m,adaptiveId:i,applyAction:g,subscribeEvent:a?(C,A)=>a.subscribe({names:[C]},w=>A(w.props)):void 0,subscribeNavigation:l}}async function b(C,A){if(!n)throw new Error("Surfaces provider required for core:mountWidget actions");let w=n.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:()=>{w.unmount()},updateFn:k=>{if("widget"in k&&k.widget){let T=k.widget;T.props&&w.update({type:"widget",widgetId:C.widget.widgetId,config:T.props})}}}}async function x(C,A){if(C.kind==="core:mountWidget")return b(C,A);let w=s.get(C.kind);if(!w){let k="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${C.kind}".`,`Registered: [${k}]`),new Error(`No executor for action kind: ${C.kind}`)}return w(C,A)}function p(C,A,w,k){if(!u)return;let T=[],D=async()=>{let M=c.get(C);if(!M)return;let F=u.evaluateSync(w).value;if(M.state==="applied"&&!F){try{await M.cleanup()}catch(U){console.error(`[ActionEngine] Error reverting conditional action ${C}:`,U)}M.state="deferred",M.cleanup=()=>{},M.updateFn=void 0,m("action.deferred",{id:C,kind:A.kind})}else if(M.state==="deferred"&&F)try{let U=S(),V=await x(A,U);M.state="applied",M.cleanup=V.cleanup,M.updateFn=V.updateFn,M.appliedTs=Date.now(),m("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),M.state="failed"}};u.context&&T.push(u.context.subscribe(D)),u.accumulator&&T.push(u.accumulator.subscribe(D)),d.set(C,T)}async function g(C){let A=yo(C);if(!A.valid){let F=A.errors.map(U=>U.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${C?.kind}":`,F,C),new Error(`Action validation failed: ${F}`)}let w=f(),k=C.triggerWhen;if(k&&u&&!u.evaluateSync(k).value){let U={id:w,action:C,adaptiveId:i,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};c.set(w,U);let V={id:w,action:C,async revert(){let N=c.get(w);if(!N)return;let X=d.get(w);if(X){for(let ve of X)ve();d.delete(w)}N.state="reverted",c.delete(w)},isApplied(){return c.get(w)?.state==="applied"},async update(N){let X=c.get(w);if(!X||X.state!=="applied")throw new Error("Cannot update action that is not applied");if(X.updateFn)await X.updateFn(N);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(w)?.state??"reverted"}};return p(w,C,k,V),V}let T=S(),D=await x(C,T),M={id:w,action:C,adaptiveId:i,appliedTs:Date.now(),state:"applied",cleanup:D.cleanup,updateFn:D.updateFn};c.set(w,M),m("action.applied",{id:w,kind:C.kind,anchorId:"anchorId"in C?C.anchorId:void 0});let P={id:w,action:C,async revert(){let F=c.get(w);if(!F||F.state!=="applied")return;let U=d.get(w);if(U){for(let V of U)V();d.delete(w)}try{await F.cleanup(),F.state="reverted",m("action.reverted",{id:w,kind:C.kind})}catch(V){throw F.state="failed",m("action.failed",{id:w,kind:C.kind,error:String(V)}),V}finally{c.delete(w)}},isApplied(){return c.get(w)?.state==="applied"},async update(F){let U=c.get(w);if(!U||U.state!=="applied")throw new Error("Cannot update action that is not applied");if(U.updateFn)await U.updateFn(F);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(w)?.state??"reverted"}};return k&&u&&p(w,C,k,P),P}async function v(C){console.log(`[ActionEngine] applyBatch: ${C.length} action(s)`,C.map(M=>M.kind).join(", "));let A=db(C);if(!A.valid){let M=A.errors.map(P=>P.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${C.length} action(s):`,M,`
|
|
518
|
-
Actions:`,
|
|
519
|
-
`)),new Error(`Batch validation failed: ${M}`)}let w=f(),k=[],T=[];try{for(let M of C){let P=await g(M);k.push(P),T.push(P)}}catch(M){console.error(`[ActionEngine] Batch apply FAILED at action ${T.length+1}/${C.length}.`,`Successfully applied: ${T.length}. Rolling back...`,M);for(let P of T)try{await P.revert()}catch{}throw M}return{id:w,handles:k,async revertAll(){for(let M=k.length-1;M>=0;M--)try{await k[M].revert()}catch(P){console.error(`[ActionEngine] Error reverting action ${k[M].id}:`,P)}},isApplied(){return k.every(M=>M.isApplied())}}}function y(C){return yo(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 L(){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:g,applyBatch:v,validate:y,getActive:_,destroy:L}}var HH=h.object({selector:h.string(),route:h.union([h.string(),h.array(h.string())])}).strict(),pb=h.object({type:h.literal("page_url"),url:h.string()}),hb=h.object({type:h.literal("route"),routeId:h.string()}),mb=h.object({type:h.literal("anchor_visible"),anchorId:h.string(),state:h.enum(["visible","present","absent"])}),gb=h.object({type:h.literal("event_occurred"),eventName:h.string(),withinMs:h.number().optional()}),vb=h.object({type:h.literal("state_equals"),key:h.string(),value:h.unknown()}),yb=h.object({type:h.literal("viewport"),minWidth:h.number().optional(),maxWidth:h.number().optional(),minHeight:h.number().optional(),maxHeight:h.number().optional()}),xb=h.object({type:h.literal("session_metric"),key:h.string(),operator:h.enum(["gte","lte","eq","gt","lt"]),threshold:h.number()}),bb=h.object({type:h.literal("dismissed"),key:h.string(),inverted:h.boolean().optional()}),Sb=h.object({type:h.literal("cooldown_active"),key:h.string(),inverted:h.boolean().optional()}),Cb=h.object({type:h.literal("frequency_limit"),key:h.string(),limit:h.number(),inverted:h.boolean().optional()}),oc=h.object({equals:h.union([h.string(),h.number(),h.boolean()]).optional(),contains:h.string().optional()}),ic=h.object({events:h.array(h.string()).min(1),match:h.record(h.string(),oc).optional()}),_b=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:ic.optional()}),xo=h.discriminatedUnion("type",[pb,hb,mb,gb,vb,yb,xb,bb,Sb,Cb,_b]),sc=h.object({conditions:h.array(xo),value:h.unknown()}),lc=h.object({type:h.literal("rules"),rules:h.array(sc),default:h.unknown()}),uc=h.object({type:h.literal("score"),field:h.string(),threshold:h.number(),above:h.unknown(),below:h.unknown()}),cc=h.object({type:h.literal("model"),modelId:h.string(),inputs:h.array(h.string()),outputMapping:h.record(h.string(),h.unknown()),default:h.unknown()}),dc=h.object({type:h.literal("external"),endpoint:h.string(),method:h.enum(["GET","POST"]).optional(),default:h.unknown(),timeoutMs:h.number().optional()}),fc=h.discriminatedUnion("type",[lc,uc,cc,dc]),zp=fc.nullable().optional(),UH=h.object({events:h.array(h.string()),urlContains:h.string().optional(),props:h.record(h.union([h.string(),h.number(),h.boolean()])).optional()}),zH=h.object({title:h.string().optional(),body:h.string().optional(),icon:h.string().optional()}).nullable().optional();var gE=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.")}),qp=h.object({routes:gE,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 y$(t){return xo.safeParse(t)}function x$(t){return fc.safeParse(t)}function b$(t){return qp.safeParse(t)}var S$=[{defName:"matchOp",schema:oc},{defName:"counterDef",schema:ic},{defName:"activationConfig",schema:qp},{defName:"routeFilter",schema:gE},{defName:"ruleStrategy",schema:lc},{defName:"scoreStrategy",schema:uc},{defName:"modelStrategy",schema:cc},{defName:"externalStrategy",schema:dc},{defName:"rule",schema:sc},{defName:"condition",schema:xo}];var wb=h.object({tileId:h.string(),itemId:h.string().optional()}).strict(),qH=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:wb.optional()}).strict(),$H=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:qp.optional(),notifications:h.array(qH).optional()}).strict(),VH=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()}),jH=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()}),GH=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()}),ZH=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()}),WH=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()}),XH=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()}),YH=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:VH.optional(),launcher:jH.optional(),tile:GH.optional(),overlay:ZH.optional(),notification:WH.optional(),content:XH.optional()}).strict(),KH=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(),k$=h.object({schemaVersion:h.string().optional(),fetchedAt:h.string().datetime(),configVersion:h.string().optional(),canvasTitle:h.string().optional(),tiles:h.array($H),actions:h.array(h.any()),theme:YH.optional(),launcher:KH.optional(),meta:h.object({verificationSteps:h.array(h.union([h.string(),h.object({text:h.string(),check:xo.optional()})])).optional()}).passthrough().optional()}).strict();var yt={triggerWhen:zp},za=h.object({selector:h.string(),route:h.union([h.string(),h.array(h.string())])}).strict(),vE=h.object({color:h.string().optional(),scrimOpacity:h.number().min(0).max(1).optional(),paddingPx:h.number().optional(),radiusPx:h.number().optional()}).strict(),yE=h.enum(["top-left","top-right","bottom-left","bottom-right"]),xE=h.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),kb=h.object({label:h.string(),actionId:h.string(),primary:h.boolean().optional()}).strict(),bE=h.object({title:h.string().optional(),body:h.string(),ctaButtons:h.array(kb).optional()}).strict(),SE=h.object({title:h.string().optional(),body:h.string()}).strict(),CE=h.enum(["before","after","prepend","append","replace"]),_E=h.enum(["immediate","hover","click"]),wE=h.object({widgetId:h.string(),props:h.record(h.unknown()).optional(),priority:h.number().optional()}).strict(),LE=h.object({id:h.string(),action:h.any(),route:h.string().optional(),onAction:h.record(h.string()).optional()}).passthrough(),kE=h.enum(["auto","smooth","instant"]),Lb=h.enum(["start","center","end","nearest"]),IE=h.object({kind:h.literal("content:setText"),anchorId:za,text:h.string(),label:h.string().optional()}).extend(yt).strict(),AE=h.object({kind:h.literal("content:setAttr"),anchorId:za,attr:h.string(),value:h.string(),label:h.string().optional()}).extend(yt).strict(),EE=h.object({kind:h.literal("content:addClass"),anchorId:za,className:h.string(),label:h.string().optional()}).extend(yt).strict(),TE=h.object({kind:h.literal("content:removeClass"),anchorId:za,className:h.string(),label:h.string().optional()}).extend(yt).strict(),RE=h.object({kind:h.literal("content:setStyle"),anchorId:za,styles:h.record(h.string()),label:h.string().optional()}).extend(yt).strict(),ME=h.object({kind:h.literal("content:insertHtml"),anchorId:za,html:h.string(),position:CE,deepLink:wb.optional(),label:h.string().optional()}).extend(yt).strict(),DE=h.object({kind:h.literal("overlays:highlight"),anchorId:za,style:vE.optional(),duration:h.number().optional(),label:h.string().optional()}).extend(yt).strict(),OE=h.object({kind:h.literal("overlays:pulse"),anchorId:za,duration:h.number().optional(),label:h.string().optional()}).extend(yt).strict(),BE=h.object({kind:h.literal("overlays:badge"),anchorId:za,content:h.string(),position:yE.optional(),label:h.string().optional()}).extend(yt).strict(),PE=h.object({kind:h.literal("overlays:tooltip"),anchorId:za,content:bE,trigger:_E.optional(),placement:xE.optional(),waitFor:h.string().optional(),label:h.string().optional()}).extend(yt).strict(),FE=h.object({kind:h.literal("overlays:modal"),content:SE,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(kb).optional(),waitFor:h.string().optional(),label:h.string().optional()}).extend(yt).strict(),NE=h.object({kind:h.literal("navigation:scrollTo"),anchorId:za,behavior:kE.optional(),block:Lb.optional(),inline:Lb.optional(),label:h.string().optional()}).extend(yt).strict(),HE=h.object({kind:h.literal("navigation:navigate"),url:h.string(),target:h.enum(["_self","_blank"]).optional(),label:h.string().optional()}).extend(yt).strict(),UE=h.object({kind:h.literal("core:mountWidget"),slot:h.string(),widget:wE,label:h.string().optional()}).extend(yt).strict(),zE=h.object({kind:h.literal("core:wait"),durationMs:h.number().min(0).optional(),event:h.string().optional(),label:h.string().optional()}).extend(yt).strict(),qE=h.object({kind:h.literal("core:sequence"),actions:h.array(h.any()),label:h.string().optional()}).extend(yt).strict(),$E=h.object({kind:h.literal("core:parallel"),actions:h.array(h.any()),waitFor:h.enum(["all","any"]).optional(),label:h.string().optional()}).extend(yt).strict(),VE=h.object({kind:h.literal("core:tour"),tourId:h.string(),steps:h.array(LE).min(1),startStep:h.string().optional(),autoStart:h.boolean().optional(),label:h.string().optional()}).extend(yt).passthrough(),QH=[{defName:"setText",schema:IE},{defName:"setAttr",schema:AE},{defName:"addClass",schema:EE},{defName:"removeClass",schema:TE},{defName:"setStyle",schema:RE},{defName:"insertHtml",schema:ME},{defName:"highlight",schema:DE},{defName:"pulse",schema:OE},{defName:"badge",schema:BE},{defName:"tooltip",schema:PE},{defName:"modal",schema:FE},{defName:"scrollTo",schema:NE},{defName:"navigate",schema:HE},{defName:"mountWidget",schema:UE},{defName:"wait",schema:zE},{defName:"sequence",schema:qE},{defName:"parallel",schema:$E},{defName:"tour",schema:VE}];function Ib(t){let e=t?.root??(typeof document<"u"?document.body:null),a=t?.defaultTimeoutMs??5e3,n=new Map,r=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,p]of n){let g=s(x);if(g){for(let v of p)clearTimeout(v.timer),v.resolve(g);n.delete(x)}}for(let[x,p]of r){let g=s(x);if(g){for(let v of p)v.cancelled||v.cb(g);r.delete(x)}}n.size===0&&r.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,p){let g=n.get(x);g&&(g.delete(p),g.size===0&&n.delete(x)),n.size===0&&r.size===0&&c()}function f(x,p){if(i)return Promise.reject(new Error("AnchorResolver destroyed"));let g=s(x);if(g)return Promise.resolve(g);let v=p??a;return new Promise((y,_)=>{let L={resolve:y,reject:_,timer:setTimeout(()=>{d(x,L),_(new Error(`waitFor("${x}") timed out after ${v}ms`))},v)},C=n.get(x);C||(C=new Set,n.set(x,C)),C.add(L),u()})}function m(x,p){if(i)return()=>{};let g=s(x);if(g)return p(g),()=>{};let v={cb:p,cancelled:!1},y=r.get(x);return y||(y=new Set,r.set(x,y)),y.add(v),u(),()=>{v.cancelled=!0;let _=r.get(x);_&&(_.delete(v),_.size===0&&r.delete(x)),n.size===0&&r.size===0&&c()}}function S(){let x=0;for(let p of n.values())x+=p.size;return x}function b(){i=!0,c();let x=new Error("AnchorResolver destroyed");for(let p of n.values())for(let g of p)clearTimeout(g.timer),g.reject(x);n.clear(),r.clear()}return{resolve:s,waitFor:f,onAppear:m,pendingCount:S,destroy:b}}function JH(){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 Ab(t,e){if(!e)return;let a;try{a=new URL(t).pathname}catch{a=t}if(e.exclude){for(let n of e.exclude)if(jE(a,n))return}if(e.include){for(let n of e.include)if(jE(a,n))return n;return}return a}function jE(t,e){let a=t.replace(/\/$/,"")||"/",n=e.replace(/\/$/,"")||"/";if(a===n)return!0;let r=n.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${r}$`).test(a)}var $p=class{constructor(e){B(this,"context");B(this,"previousContext");B(this,"listeners",new Set);B(this,"telemetry");B(this,"routes");B(this,"navigation");B(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=JH(),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=Ab(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=Ab(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)};window.addEventListener("resize",a),this.cleanupFns.push(()=>window.removeEventListener("resize",a));let n=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(n)}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,n=Ab(e,this.routes),r={url:e,title:a,routeId:n};(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 a={url:e,ts:Date.now()},n=[...this.context.session.pageHistory||[],a];n.length>50&&n.shift(),this.context.session.pageHistory=n}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 Eb(t){return new $p(t)}var e3=h.object({url:h.string(),routeId:h.string().optional(),title:h.string().optional(),locale:h.string().optional()}),t3=h.object({url:h.string(),ts:h.number()}),a3=h.object({sessionId:h.string(),startTs:h.number(),pageHistory:h.array(t3).optional()}),n3=h.object({width:h.number(),height:h.number()}),r3=h.object({x:h.number(),y:h.number(),w:h.number(),h:h.number()}),o3=h.object({anchorId:h.string(),present:h.boolean(),visible:h.boolean().optional(),boundingBox:r3.optional()}),i3=h.record(h.string(),h.union([h.number(),h.string(),h.boolean(),h.undefined()])),s3=h.object({page:e3,session:a3,viewport:n3,anchors:h.array(o3).optional(),augmented:i3.optional()});function $$(t){return s3.safeParse(t)}function GE(t,e){let{context:a,state:n,events:r}=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=a.anchors?.find(i=>i.anchorId===t.anchorId);switch(t.state){case"visible":return o?.visible===!0;case"present":return o?.present===!0;case"absent":return!o?.present;default:return!1}}case"event_occurred":{if(!r)return!1;let o=t.withinMs??6e4;return r.hasRecentEvent(t.eventName,o)}case"state_equals":return n?.getValue?n.getValue(t.key)===t.value:!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(!n)return!1;let o=n.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(!n)return t.inverted??!1;let o=n.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!n)return t.inverted??!1;let o=n.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!n)return t.inverted??!1;let i=n.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 ZE(t,e){let a=[];for(let n of t.conditions){let r=GE(n,e);if(a.push({condition:n,result:r}),!r)return{matched:!1,conditionResults:a}}return{matched:!0,conditionResults:a}}function Vp(t,e){for(let a=0;a<t.rules.length;a++){let n=t.rules[a],{matched:r,conditionResults:o}=ZE(n,e);if(r)return{value:n.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:a,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function jp(t,e){let{context:a}=e,n=a.augmented?.[t.field];return n===void 0||typeof n!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:n>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function WE(t,e){let{state:a,events:n,sessionMetrics:r,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=>r?.get(i)??0,getValue:i=>a.session.get(i)??a.user.get(i)}:void 0,events:n?{hasRecentEvent:(i,s)=>n.hasRecentEvent(i,s)}:void 0,accumulator:o?{getCount:(i,s)=>o.getCount(i,s)}:void 0}}async function XE(t,e,a={}){let n=WE(e,a);switch(t.type){case"rules":return Vp(t,n);case"score":return jp(t,n);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 YE(t,e,a={}){let n=WE(e,a);switch(t.type){case"rules":return Vp(t,n);case"score":return jp(t,n);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 Tb(t){return{evaluate:(e,a)=>XE(e,a,t),evaluateSync:(e,a)=>YE(e,a,t)}}function Rb(t){let{eventBus:e,stateStore:a}=t,n=new Map,r=new Set,o=null,i=a.ns("accumulator");function s(u){let c=!1;for(let d of n.values()){if(!d.predicate(u))continue;let f=i.get(d.stateKey)||{count:0};f.count++,d.needsTimestamps&&(f.timestamps||(f.timestamps=[]),f.timestamps.push(u.ts),f.timestamps.length>200&&(f.timestamps=f.timestamps.slice(-200))),i.set(d.stateKey,f),c=!0}if(c)for(let d of r)try{d()}catch(f){console.error("[EventAccumulator] Subscriber error:",f)}}function l(){o||n.size===0||(o=e.subscribe(s))}return{register(u,c,d=!1){let f=`ev:${u}`,m=n.get(f);if(m){d&&!m.needsTimestamps&&(m.needsTimestamps=!0);return}n.set(f,{stateKey:f,needsTimestamps:d,predicate:c}),l()},getCount(u,c){let d=`ev:${u}`,f=i.get(d);if(!f)return 0;if(c===void 0||!f.timestamps)return f.count;let m=Date.now()-c;return f.timestamps.filter(S=>S>=m).length},subscribe(u){return r.add(u),()=>{r.delete(u)}},destroy(){o&&(o(),o=null),n.clear(),r.clear()}}}function Mb(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(n=>{try{return new RegExp(n).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var Gp=class{constructor(e={}){B(this,"subscriptions",new Set);B(this,"history",[]);B(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,a){let n,r;typeof e=="function"?(n=void 0,r=e):(n=e,r=a);let o={filter:n,callback:r};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,a,n="canvas"){let r={ts:Date.now(),name:e,source:n,props:a,schemaVersion:bs};this.publishEvent(r)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let a of this.subscriptions)if(Mb(e,a.filter))try{a.callback(e)}catch(n){console.error("[EventBus] Subscriber error:",n)}}getRecent(e,a){let n=this.history;return e&&(n=n.filter(r=>Mb(r,e))),a&&a>0&&(n=n.slice(-a)),n}hasRecentEvent(e,a,n){let r=Date.now()-a;return this.history.some(o=>o.name===e&&o.ts>=r&&(n===void 0||o.source===n))}countRecentEvents(e,a){let n=this.history.filter(r=>Mb(r,e));if(a!==void 0){let r=Date.now()-a;n=n.filter(o=>o.ts>=r)}return n.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function pc(t={}){return new Gp(t)}var KE={$autocapture:"ui.click",$click:_e.UI_CLICK,$scroll:_e.UI_SCROLL,$input:_e.UI_INPUT,$change:_e.UI_CHANGE,$submit:_e.UI_SUBMIT,$pageview:_e.NAV_PAGE_VIEW,$pageleave:_e.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function l3(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(KE[e])return KE[e];if(e==="$autocapture"){let a=t.properties?.$tag_name,n=t.properties?.$event_type;return n==="submit"?_e.UI_SUBMIT:n==="change"?_e.UI_CHANGE:a==="input"||a==="textarea"?_e.UI_INPUT:_e.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function u3(t){let e={},a=t.properties||{},n=a.$elements;return a.$tag_name?e.tagName=a.$tag_name:n?.[0]?.tag_name&&(e.tagName=n[0].tag_name),a.$el_text&&(e.elementText=a.$el_text),n&&(e.elements=n),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 QE(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:l3(t),source:"posthog",props:u3(t),schemaVersion:bs}}function JE(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 Db(t){return(e,a)=>{if(typeof e!="string")return;let n={event:e,properties:a,timestamp:Date.now()};if(JE(n)){let r=QE(n);t(r)}}}var eT=h.enum(["posthog","canvas","derived"]),c3=h.object({ts:h.number(),name:h.string(),source:eT,props:h.record(h.string(),h.unknown()).optional(),schemaVersion:h.string()}),d3=h.object({names:h.array(h.string()).optional(),patterns:h.array(h.string()).optional(),sources:h.array(eT).optional()});function pV(t){return c3.safeParse(t)}function hV(t){return d3.safeParse(t)}var hc=class{constructor(){B(this,"listeners",new Set);B(this,"capturedPushState");B(this,"capturedReplaceState");B(this,"wasNative");B(this,"destroyed",!1);B(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 n of this.listeners)try{n(e,a)}catch{}}isNativeFunction(e){try{return Function.prototype.toString.call(e).includes("[native code]")}catch{return!1}}};var Ob="cooldown:";function tT(t){return{set(e,a){let n=Ob+e,r=Date.now()+a;t.set(n,r)},isActive(e){return this.remaining(e)>0},remaining(e){let a=Ob+e,n=t.get(a);if(n===void 0)return 0;let r=n-Date.now();return r<=0?(t.remove(a),0):r},clear(e){let a=Ob+e;t.remove(a)}}}var mc="dismissed:";function aT(t,e){return{mark(a,n=!1){let r=mc+a;(n?e:t).set(r,!0)},isDismissed(a){let n=mc+a;return t.has(n)||e.has(n)},clear(a){let n=mc+a;t.remove(n),e.remove(n)},clearAll(){for(let a of t.keys())a.startsWith(mc)&&t.remove(a);for(let a of e.keys())a.startsWith(mc)&&e.remove(a)}}}var Bb="freq:";function nT(t){function e(a){let n=Bb+a,r=t.get(n);if(r){if(r.resetAt&&Date.now()>=r.resetAt){t.remove(n);return}return r}}return{increment(a,n){let r=Bb+a,o=e(a),i=(o?.count??0)+1,s={count:i,resetAt:o?.resetAt??(n?Date.now()+n:void 0)};return t.set(r,s),i},count(a){return e(a)?.count??0},reset(a){let n=Bb+a;t.remove(n)},hasReachedLimit(a,n){return this.count(a)>=n}}}var f3="syntro";function Pb(t,e){let a=`${e}:`;return{get(n){if(t)try{let r=t.getItem(a+n);if(!r)return;let o=JSON.parse(r);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(a+n);return}return o.value}catch{return}},set(n,r,o){if(t)try{let i={value:r,expiresAt:o?Date.now()+o:void 0};t.setItem(a+n,JSON.stringify(i))}catch(i){console.warn("[StateStore] Failed to save:",i)}},remove(n){t&&t.removeItem(a+n)},has(n){return t?this.get(n)!==void 0:!1},keys(){if(!t)return[];let n=[];for(let r=0;r<t.length;r++){let o=t.key(r);o?.startsWith(a)&&n.push(o.slice(a.length))}return n},clear(){if(!t)return;let n=this.keys();for(let r of n)t.removeItem(a+r)}}}function gc(t){let e=new Map,a=`${t}:`;return{get(n){let r=e.get(a+n);if(r){if(r.expiresAt&&Date.now()>=r.expiresAt){e.delete(a+n);return}return r.value}},set(n,r,o){e.set(a+n,{value:r,expiresAt:o?Date.now()+o:void 0})},remove(n){e.delete(a+n)},has(n){return this.get(n)!==void 0},keys(){let n=[];for(let r of e.keys())r.startsWith(a)&&n.push(r.slice(a.length));return n},clear(){for(let n of e.keys())n.startsWith(a)&&e.delete(n)}}}var Zp=class{constructor(e={}){B(this,"session");B(this,"user");B(this,"dismissals");B(this,"cooldowns");B(this,"frequency");B(this,"namespace");B(this,"namespacedStorages",new Map);this.namespace=e.namespace??f3;let a=n=>typeof n=="object"&&n!==null&&typeof n.setItem=="function";typeof window<"u"?(this.session=a(window.sessionStorage)?Pb(window.sessionStorage,this.namespace):gc(this.namespace),this.user=a(window.localStorage)?Pb(window.localStorage,this.namespace):gc(this.namespace)):(this.session=gc(this.namespace),this.user=gc(this.namespace)),this.dismissals=aT(this.session,this.user),this.cooldowns=tT(this.user),this.frequency=nT(this.session)}ns(e){let a=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(a)){let n=typeof window<"u"&&typeof sessionStorage<"u"?Pb(sessionStorage,a):gc(a);this.namespacedStorages.set(a,n)}return this.namespacedStorages.get(a)}};function Fb(t={}){return new Zp(t)}function vc(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function Wp(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var rT={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"}},yc={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:[]},oT={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function Nb(t,e,a){let n=rT[e];Object.assign(t.style,n),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 Hb(t,e,a){let n=a.placement==="auto"?"bottom":a.placement,r=[cf(a.offset?{mainAxis:a.offset.y,crossAxis:a.offset.x}:8)];return a.flip!==!1&&r.push(ff()),a.shift!==!1&&r.push(df({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",uf(e,t,async()=>{let{x:i,y:s,strategy:l}=await pf(e,t,{placement:n,middleware:r});Object.assign(t.style,{position:l,left:`${i}px`,top:`${s}px`})})}function Ub(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 zb(t,e){return e==="none"||yc[e].length===0?null:t.animate(yc[e],oT)}function qb(t,e){if(e==="none"||yc[e].length===0)return Promise.resolve();let a=[...yc[e]].reverse(),n=t.animate(a,oT);return new Promise(r=>{n.onfinish=()=>r(),n.oncancel=()=>r()})}function $b(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 Vb(t){switch(vc(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 iT(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 n=a.content,r=document.createTreeWalker(n,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(;r.nextNode();){let s=r.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(),f=c.startsWith("on"),m=(c==="href"||c==="src")&&d.startsWith("javascript:");(f||m)&&s.removeAttribute(u.name)}}for(let s of i){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return a.innerHTML=(n.firstChild,a.innerHTML)}var p3=0;function jb(t){let{overlayRoot:e,eventBus:a,anchorResolver:n,defaultAnimation:r="fade",widgetRegistry:o}=t,i=new Map,s=new Map,l=new Map;function u(){return`mount-${++p3}`}function c(y,_){a&&a.publish(y,_)}function d(y){let _=l.get(y);if(_){let L=x(y);for(let C of _)try{C(L)}catch(A){console.error("[Surfaces] State callback error:",A)}}}let f=new Map;function m(y,_,L){switch(_.type){case"html":y.innerHTML=iT(_.content);return;case"widget":{if(o?.has(_.widgetId)){let C=o.mount(_.widgetId,y,_.config);return L&&f.set(L,C),()=>{C.unmount(),L&&f.delete(L)}}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,_,L){let C=u(),A=vc(y),w=L?.priority??0,k=L?.animation??r,T=L?.exclusive??!0,D=i.get(y);if(D&&T){if(D.options.priority>w)throw new Error(`Slot ${y} is occupied by higher priority content (${D.options.priority} > ${w})`);b(D)}let M=$b(y,C);M.style.zIndex=String(Vb(y));let P;if(A==="static")Nb(M,y,L?.constraints),e.appendChild(M);else if(A==="inline"){let N=Wp(y);if(!N)throw new Error(`Invalid inline slot: ${y}`);if(!n)throw new Error("Anchor resolver required for inline slots");let X=n({selector:N,route:"**"});if(!X)throw new Error(`Anchor not found for inline slot: ${N}`);P=Ub(M,X)}else if(A==="adjacent"){let N=Wp(y);if(!N)throw new Error(`Invalid adjacent slot: ${y}`);if(!n)throw new Error("Anchor resolver required for adjacent slots");let X=n({selector:N,route:"**"});if(!X)throw new Error(`Anchor not found for adjacent slot: ${N}`);e.appendChild(M),P=Hb(M,X,L?.position??{placement:"bottom"})}let F=m(M,_,C);zb(M,k);let U={id:C,slot:y,content:_,options:{priority:w,exclusive:T,animation:k,position:L?.position??{placement:"auto"},constraints:L?.constraints??{},adaptiveId:L?.adaptiveId,autoUnmountOnRouteChange:L?.autoUnmountOnRouteChange??!0},container:M,cleanup:()=>{P?.(),F?.()},mountedAt:Date.now()};return i.set(y,U),s.set(y,(s.get(y)??0)+1),c("surface.mounted",{slot:y,id:C,adaptiveId:L?.adaptiveId}),d(y),{id:C,update(N){let X=i.get(y);if(!X||X.id!==C)throw new Error("Mount no longer active");let ve=f.get(C);if(ve){if(N.type==="widget"){ve.update(N.config),X.content=N;return}ve.unmount(),f.delete(C)}X.container.innerHTML="";let qa=m(X.container,N,C);if(X.content=N,qa){let pt=X.cleanup;X.cleanup=()=>{pt?.(),qa()}}},setOptions(N){let X=i.get(y);if(!X||X.id!==C)throw new Error("Mount no longer active");N.priority!==void 0&&(X.options.priority=N.priority),N.animation!==void 0&&(X.options.animation=N.animation),N.constraints&&A==="static"&&(N.constraints.maxWidth&&(X.container.style.maxWidth=N.constraints.maxWidth),N.constraints.maxHeight&&(X.container.style.maxHeight=N.constraints.maxHeight),N.constraints.minWidth&&(X.container.style.minWidth=N.constraints.minWidth),N.constraints.minHeight&&(X.container.style.minHeight=N.constraints.minHeight)),d(y)},async unmount(){let N=i.get(y);!N||N.id!==C||await b(N)},isMounted(){return i.get(y)?.id===C},getContainer(){let N=i.get(y);return N?.id===C?N.container:null}}}async function b(y){await qb(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 p(y,_){let L=l.get(y);return L||(L=new Set,l.set(y,L)),L.add(_),()=>{L?.delete(_),L?.size===0&&l.delete(y)}}function g(y,_){let L=i.get(y);return L?_!==void 0?_>=L.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:p,canMount:g,destroy:v}}var Xp=class{constructor(){B(this,"widgets",new Map);B(this,"mountedWidgets",new Map);B(this,"mountIdCounter",0);B(this,"runtimeRef");B(this,"listeners",new Set)}bindRuntime(e){this.runtimeRef=e}register(e,a,n="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:a,source:n,metadata:r}),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,n]of this.widgets.entries())n.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,n){let r=this.widgets.get(e);if(!r)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={...n,runtime:this.runtimeRef},s=r.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(r.widget.update)r.widget.update(a,u);else{let c=this.mountedWidgets.get(o);if(c){c.cleanup?.(),a.innerHTML="";let d={...u,runtime:this.runtimeRef},f=r.widget.mount(a,d);c.cleanup=f??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(n){console.error("[WidgetRegistry] Listener error:",n)}}destroy(){for(let[e,a]of this.mountedWidgets.entries())a.cleanup?.(),a.container.innerHTML="";this.mountedWidgets.clear()}},Gb=new Xp;var lT="2.0.0";function h3(t,e){if(!e)return!0;let a;try{a=new URL(t).pathname}catch{a=t}let n=a.replace(/\/$/,"")||"/";if(e.exclude){for(let r of e.exclude)if(Zb(n,r))return!1}if(e.include&&e.include.length>0){for(let r of e.include)if(Zb(n,r))return!0;return!1}return!0}function Zb(t,e){let a=e.replace(/\/$/,"")||"/";if(t===a)return!0;let n=a.replace(/\*\*/g,"\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${n}$`).test(t)}function sT(t){let a=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(r=>Zb(a,r))}function Wb(t={}){let{telemetry:e,sessionMetrics:a,routes:n,mode:r="production",namespace:o}=t,i=t.widgets??Gb,s=t.executors??fr,l=t.apps??ou,u=new hc,c=Eb({telemetry:e,routes:n,navigation:u}),d=t.events??pc(),f=Fb({namespace:o}),m=Rb({eventBus:d,stateStore:f}),S=Tb({state:f,events:d,sessionMetrics:a,accumulator:m}),b=$k(),x=Ib(),p=C=>sT(C)?x.resolve(C.selector):null,g=async(C,A)=>{if(!sT(C))return null;try{return await x.waitFor(C.selector,A)}catch{return null}},v=jb({overlayRoot:b,eventBus:d,anchorResolver:p,widgetRegistry:i}),y=fb({overlayRoot:b,eventBus:d,surfaces:v,anchorResolver:p,waitForAnchor:g,executorRegistry:s,subscribeNavigation:C=>u.subscribe(C),runtime:{evaluateSync:C=>S.evaluateSync(C,c.get()),context:c,accumulator:m}}),_;if(a){a.increment("page_views");let C=typeof window<"u"?window.location.pathname:"/";_=u.subscribe((A,w)=>{if(w!=="replaceState")try{let k=new URL(A).pathname;k!==C&&(C=k,a.increment("page_views"))}catch{}})}let L={telemetry:e,context:c,events:d,state:f,sessionMetrics:a,actions:y,surfaces:v,widgets:i,executors:s,apps:l,accumulator:m,anchorResolver:x,navigation:u,version:lT,mode:r,async evaluate(C){return S.evaluate(C,c.get())},evaluateSync(C){return S.evaluateSync(C,c.get())},async filterTiles(C){let A=c.get().page.url,w=[];for(let k of C){let T=k.activation;if(!T){w.push(k);continue}if(h3(A,T.routes)){if(T.onlyIfPopulated){let D=k.props?.actions??[];if(D.length>0&&!D.some(P=>P.triggerWhen?S.evaluateSync(P.triggerWhen,c.get()).value:!0))continue}w.push(k)}}return w},setRoutes(C){c.setRoutes(C)},destroy(){l.unbind().catch(C=>{console.error("[Runtime] Error unbinding apps registry:",C)}),_?.(),x.destroy(),m.destroy(),u.destroy(),c.destroy(),y.destroy(),v.destroy()}};return l.bind(L),i.bindRuntime(L),L}var m3=h.object({value:h.unknown(),expiresAt:h.number().optional()}),g3=h.object({count:h.number(),resetAt:h.number().optional()});function v8(t){return m3.safeParse(t)}function y8(t){return g3.safeParse(t)}var uT={growthbook:t=>gy({...t,autoInit:!0})};function cT(t,e){let a=uT[t];if(!a)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(uT).join(", ")}`);return a(e)}var v3=["cdn.syntrologie.com","localhost","127.0.0.1"];function y3(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):v3.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 Xb=class{constructor(e){B(this,"name","cdn");B(this,"url");B(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!y3(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 n=await a.text();if(this.integrity){let l=await x3(n),u=this.integrity.replace("sha384-","");if(l!==u)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${u}, got ${l}`)}let r=JSON.parse(n),o=performance.now()-e,i=a.headers.get("cache-control"),s=a.headers.get("age");return{config:r,meta:{source:"cdn",fetchTimeMs:o,cached:i?.includes("public")??!1,cacheAge:s?parseInt(s,10):void 0}}}};async function x3(t){let a=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-384",a),r=new Uint8Array(n);return btoa(String.fromCharCode(...r))}function dT(t){return new Xb(t)}var b3="syntro_exp",S3="syntro_var",Yb=class{constructor(e){B(this,"name","experiments");B(this,"client");B(this,"featureKey");B(this,"manifestKey");B(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),o=r.get(b3),i=r.get(S3);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||this.client.getAllFeatures){let r=this.fetchMultiFlag();if(r){let o=performance.now()-e;return{config:r,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 n=performance.now()-e;return{config:a,meta:{source:"experiments",fetchTimeMs:n,cached:!0}}}fetchMultiFlag(){let e=this.getVariantFlagKeys();return!e||e.length===0?null:Lf(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.client.getAllFeatures){let e=this.client.getAllFeatures();return this.variantFlagPrefix?Object.keys(e).filter(a=>a.startsWith(this.variantFlagPrefix)):Object.keys(e)}return[]}};function fT(t){return new Yb(t)}var C3="https://cdn.syntrologie.com/configs",pT={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return dT({baseUrl:t.baseUrl??C3,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return fT({featureKey:t.featureKey})}};function hT(t,e={}){let a=pT[t];if(!a)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(pT).join(", ")}`);return a(e)}var mT={posthog:t=>ib(t),noop:()=>_y()};function gT(t,e){let a=mT[t];if(!a)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(mT).join(", ")}`);return a(e)}var Kb="syn_";function Yp(t){if(!t.startsWith(Kb))throw new Error("Invalid Syntro token: must start with 'syn_'");let a=t.slice(Kb.length).replace(/-/g,"+").replace(/_/g,"/"),n=atob(a),r=JSON.parse(n);if(r.v!==1)throw new Error(`Unsupported token version: ${r.v}`);return r}function Qb(t){let e=JSON.stringify(t),a=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return Kb+a}function pr(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{}}var vT="syntro_segment_attributes";function _3(){if(typeof window>"u")return{};try{let t=localStorage.getItem(vT);if(t){let e=JSON.parse(t);return Y("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){ya("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function w3(t){if(!(typeof window>"u"))try{localStorage.setItem(vT,JSON.stringify(t)),Y("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){ya("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function L3(t){if(!t)return{};let e={};for(let[a,n]of Object.entries(t))a.startsWith("in_segment_")&&(e[a]=n===!0);return e}function k3(){if(typeof window>"u")return{};let t={};try{let e=new URLSearchParams(window.location.search);for(let a of["utm_source","utm_medium","utm_campaign","utm_content","utm_term"]){let n=e.get(a);n&&(t[a]=n)}}catch{}try{navigator.language&&(t.browser_language=navigator.language),navigator.languages?.length&&(t.browser_languages=[...navigator.languages])}catch{}try{let e=window.innerWidth;t.device_type=e<768?"mobile":e<1024?"tablet":"desktop"}catch{}try{if(document.referrer){t.referrer=document.referrer;try{t.referrer_hostname=new URL(document.referrer).hostname}catch{}}}catch{}try{t.page_url=window.location.href,t.page_path=window.location.pathname}catch{}return t}async function I3(t){Lv(),Y("Syntro Bootstrap","====== INIT ======"),Y("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=Af();if(console.log(`[DIAG] Mode detection: sdkMode=${e}`),console.log("[DIAG] editorSource:",fu()),console.log("[DIAG] editorConf:",If()),Y("Syntro Bootstrap","SDK mode:",e??"normal"),!e&&typeof window<"u"){let w=!!window.__SYNTRO_EDITOR_PARAMS__,k=!!window.__SYNTRO_AUDIT_LEGEND__,T=!!window.__SYNTRO_REVIEW_DATA__;if(w||k||T){let D=[w&&"__SYNTRO_EDITOR_PARAMS__",k&&"__SYNTRO_AUDIT_LEGEND__",T&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${D.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&&e){let k=If()?.syntro_token;k?.startsWith("syn_")&&(a=k,Y("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${e} mode)`))}let n;if(a)if(a.startsWith("syn_"))Y("Syntro Bootstrap","Token starts with syn_, decoding..."),n=Yp(a),Lv(n.d);else if(e)Y("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${e} 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:",a),new Error("Invalid Syntro token: must start with 'syn_'");else if(e)Y("Syntro Bootstrap",`\u2713 No token, but ${e} 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 r=pr("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||pr("VITE_SYNTRO_EXPERIMENT_HOST")||n?.eh,o=pr("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||pr("VITE_SYNTRO_TELEMETRY_HOST")||n?.th,i=pr("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||pr("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,s=_3(),l=k3(),u={...l,...s};Y("Syntro Bootstrap","Phase 1: Browser metadata:",l),Y("Syntro Bootstrap","Phase 1: Cached segment attributes:",s);let c,d=pc();console.log("[Syntro Bootstrap] EventBus created");let f=Db(w=>{d.publishEvent(w)}),m=w=>{Y("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let k=L3(w);if(Y("Syntro Bootstrap","Segment flags from PostHog:",k),w3(k),c){let T=b?.getAll?.()??{},D={...l,...T,...k};Y("Syntro Bootstrap","Updating GrowthBook with attributes:",D),c.setAttributes?.(D)}},S;if(n?.t){let w=n.t==="noop"?"noop":"posthog";S=gT(w,{apiKey:n.t,apiHost:o,enableFeatureFlags:!0,onFeatureFlagsLoaded:m,onCapture:f}),console.log(`[Syntro Bootstrap] Telemetry client created (${w}) with EventBus wiring`)}let b;n?.e&&(c=cT("growthbook",{clientKey:n.e,apiHost:r,attributes:u,onExperimentViewed:S?.trackExperiment?(w,k,T)=>{S.trackExperiment(w,k,T)}:void 0})),b=vy({experiments:c,onMetricChange:(w,k)=>{Y("Syntro Bootstrap",`Session metric changed: ${w} = ${k}`)}}),Y("Syntro Bootstrap","SessionMetricTracker created");let x="production";e==="editor"?x="editor":e==="audit"?x="audit":pr("NODE_ENV")==="development"&&(x="development");let p=Wb({telemetry:S,sessionMetrics:b,mode:x,events:d});Y("Syntro Bootstrap","Runtime created:",{version:p.version,mode:p.mode,hasContext:!!p.context,hasEvents:!!p.events,hasState:!!p.state}),Y("Syntro Bootstrap","Core app executors already registered");let g=t.cdnBase||pr("NEXT_PUBLIC_SYNTRO_CDN_BASE")||pr("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",v=ov({cdnBase:g,registry:p.apps,onLoadStart:w=>{Y("Syntro Bootstrap",`Loading app from CDN: ${w}`)},onLoadEnd:(w,k,T)=>{k?Y("Syntro Bootstrap",`App loaded successfully: ${w}`):ya("Syntro Bootstrap",`Failed to load app: ${w}`,T)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:p.apps,runtime:p,version:p.version},Y("Syntro Bootstrap","Global SynOS object exposed"));let y=p.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${y.length} apps in registry:`,y.map(w=>`${w.manifest.id}(${w.state})`).join(", "));for(let w of y)if(w.state==="registered")try{await p.apps.activate(w.manifest.id),console.log(`[DIAG] Activated: ${w.manifest.id} \u2192 widgets: [${p.widgets.list().join(", ")}]`)}catch(k){console.error(`[DIAG] FAILED to activate: ${w.manifest.id}`,k),ya("Syntro Bootstrap",`Failed to auto-activate built-in app: ${w.manifest.id}`,k)}if(console.log(`[DIAG] Activation complete. Total widgets: [${p.widgets.list().join(", ")}]`),c?.refreshFeatures)try{await c.refreshFeatures(),Y("Syntro Bootstrap","GrowthBook features loaded")}catch(w){ya("Syntro Bootstrap","Failed to load GrowthBook features:",w)}let _;if(t.fetcher)_=t.fetcher;else if(n?.f){let w=hT(n.f,n.o??{});_=async()=>{let k=await w.fetch();return{...k.config,tiles:k.config.tiles??[]}}}else c&&(_=gs({experiments:c}));let L=new Set,C=_?async()=>{let w=await _();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${w.tiles?.length??0},`,`actions=${w.actions?.length??0},`,`theme=${w.theme?.name??"none"}`),w.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",w.actions.map((D,M)=>`[${M}] ${D.kind}${D.anchorId?` anchor="${D.anchorId.selector}"`:""}${D.label?` "${D.label}"`:""}`).join(", "));let k=w,T=v.getRequiredApps(k);return T.length>0?console.log("[Syntro Bootstrap] Required external apps:",T.join(", ")):Y("Syntro Bootstrap","No external apps required (all executors are built-in)"),T.length>0&&await v.loadAppsForConfig(k).then(async M=>{let P=M.filter(V=>V.success),F=M.filter(V=>!V.success);P.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${P.map(V=>V.appId).join(", ")}`);let U=F.filter(V=>!L.has(V.appId));U.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",U.map(V=>`${V.appId} (${V.error})`).join(", ")),U.forEach(V=>L.add(V.appId)));for(let V of T)if(p.apps.has(V))try{await p.apps.activate(V),console.log(`[Syntro Bootstrap] App activated: ${V}`)}catch(N){console.error(`[Syntro Bootstrap] Failed to activate app: ${V}`,N)}else console.error(`[Syntro Bootstrap] App "${V}" required by config but NOT registered.`,`Available apps: [${Array.from(p.apps.list?.()??[]).join(", ")}]`)}),w}:void 0;return{canvas:await Kv({...t.canvas,fetcher:C,integrations:{experiments:c,telemetry:S},editorUrl:i,runtime:p}),runtime:p,experiments:c,telemetry:S,sessionMetrics:b,appLoader:v}}var yT={init:I3,encodeToken:Qb,decodeToken:Yp};typeof window<"u"&&(window.Syntro=yT);var xT="2026-03-11T22:47:04.977Z (7d29d30f3e)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${xT}`);let t=window.SynOS,e=t?.appRegistry||ou;window.SynOS={...t,appRegistry:e,_runtimeBuild:xT,React:bT.default,ReactDOM:{...A3,createPortal:Kp.createPortal,flushSync:Kp.flushSync}},Rk(e)}export{yc as ANIMATION_KEYFRAMES,qp as ActivationConfigZ,EE as AddClassZ,za as AnchorIdZ,o3 as AnchorStateZ,mb as AnchorVisibleConditionZ,mf as AppRegistry,i3 as AugmentationZ,yE as BadgePositionZ,BE as BadgeZ,r3 as BoundingBoxZ,pu as CanvasEvents,Sy as CanvasRecipeZ,xo as ConditionZ,$p as ContextManager,Sb as CooldownActiveConditionZ,ic as CounterDefZ,kb as CtaButtonZ,Mv as DEFAULT_COOLDOWN,Rv as DEFAULT_TTL,fc as DecisionStrategyZ,bb as DismissedConditionZ,bs as EVENT_SCHEMA_VERSION,Gp as EventBus,_b as EventCountConditionZ,d3 as EventFilterZ,gb as EventOccurredConditionZ,eT as EventSourceZ,Up as ExecutorRegistry,dc as ExternalStrategyZ,g3 as FrequencyEntryZ,Cb as FrequencyLimitConditionZ,VF as HighlightStepZ,vE as HighlightStyleZ,DE as HighlightZ,ME as InsertHtmlZ,CE as InsertPositionZ,Tv as MAX_VISIBLE_TOASTS,oc as MatchOpZ,SE as ModalContentZ,FE as ModalZ,cc as ModelStrategyZ,UE as MountWidgetZ,HE as NavigateZ,hc as NavigationMonitor,c3 as NormalizedEventZ,Ev as NotificationToastStack,e3 as PageContextZ,t3 as PageHistoryEntryZ,pb as PageUrlConditionZ,$E as ParallelZ,xE as PlacementZ,OE as PulseZ,xT as RUNTIME_SDK_BUILD,lT as RUNTIME_VERSION,TE as RemoveClassZ,hb as RouteConditionZ,gE as RouteFilterZ,lc as RuleStrategyZ,sc as RuleZ,s3 as RuntimeContextZ,Fv as RuntimeProvider,Zr as SDK_SCHEMA_VERSION,kv as SDK_VERSION,rT as STATIC_SLOT_STYLES,uc as ScoreStrategyZ,kE as ScrollBehaviorZ,Lb as ScrollLogicalPositionZ,NE as ScrollToZ,cI as SelectorZ,qE as SequenceZ,a3 as SessionContextZ,xb as SessionMetricConditionZ,Jf as SessionMetricTracker,AE as SetAttrZ,RE as SetStyleZ,IE as SetTextZ,o1 as ShadowCanvasOverlay,Gk as ShadowRootProvider,u1 as SmartCanvasApp,Av as SmartCanvasController,Xv as SmartCanvasElement,B6 as SmartCanvasPortal,_e as StandardEvents,vb as StateEqualsConditionZ,Zp as StateStore,m3 as StoredValueZ,yT as Syntro,bu as TileCard,w5 as TileWheel,bE as TooltipContentZ,$F as TooltipStepZ,_E as TooltipTriggerZ,PE as TooltipZ,LE as TourStepForSchemaZ,VE as TourZ,zp as TriggerWhenZ,yb as ViewportConditionZ,n3 as ViewportContextZ,zE as WaitZ,wE as WidgetConfigZ,Xp as WidgetRegistry,ou as appRegistry,Nb as applyStaticSlotStyles,nv as cleanupAppContext,$g as contentRuntime,QH as coreActionStepSchemas,fb as createActionEngine,Ib as createAnchorResolver,av as createAppContext,ov as createAppLoader,gs as createCanvasConfigFetcher,Eb as createContextManager,Tb as createDecisionEngine,Rb as createEventAccumulator,pc as createEventBus,gy as createGrowthBookClient,_y as createNoopClient,D6 as createOverlayRecipeFetcher,ib as createPostHogClient,Db as createPostHogNormalizer,vy as createSessionMetricTracker,Kv as createSmartCanvas,Vk as createSmartCanvasController,Wb as createSmartCanvasRuntime,Fb as createStateStore,$b as createSurfaceContainer,jb as createSurfaces,S$ as decisionSchemas,Yp as decodeToken,Qb as encodeToken,XE as evaluate,GE as evaluateCondition,ZE as evaluateRule,Vp as evaluateRuleStrategy,jp as evaluateScoreStrategy,YE as evaluateSync,fr as executorRegistry,RO as getAntiFlickerSnippet,ek as getAppIdFromActionKind,rv as getAppIdFromWidgetId,CH as getExecutor,Wp as getSlotAnchorId,vc as getSlotType,Vb as getSlotZIndex,cb as hasExecutor,Rf as interpolateTemplate,JL as isCoreActionKind,Dv as matchEvent,A5 as needsMigration,QE as normalizePostHogEvent,tv as overlaysRuntime,Su as parseVersion,zb as playEnterAnimation,qb as playExitAnimation,Ef as registerConfigPredicates,p1 as registerSmartCanvasElement,Iv as resolveConfigUri,Hb as setupAdjacentPositioning,Ub as setupInlinePositioning,JE as shouldNormalizeEvent,hB as useDecision,Ov as useNotifications,Bv as useNotifyWatcher,Nv as usePageContext,Yn as useRuntime,Df as useRuntimeContext,fB as useRuntimeEvents,pB as useRuntimeState,cB as useSessionContext,s1 as useShadowCanvasConfig,xs as useShadowRoot,dB as useViewportContext,yo as validateAction,db as validateActions,b$ as validateActivationConfig,y$ as validateCondition,I5 as validateConfig,hV as validateEventFilter,y8 as validateFrequencyEntry,pV as validateNormalizedEvent,E6 as validateRecipe,$$ as validateRuntimeContext,v8 as validateStoredValue,x$ as validateStrategy,Gb as widgetRegistry};
|
|
501
|
+
`)).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),dr(s)||(a>e&&(o+=t.substring(e,a)),o+=s,e=a=n+1)}return a>e&&(o+=t.substring(e,t.length)),o},a4=!!Sx||!!bx,nE="text/plain",ih=function(t,e,a){var r;a===void 0&&(a=!0);var[n,o]=t.split("?"),i=W({},e),s=(r=o?.split("&").map((u=>{var c,[d,f]=u.split("="),h=a&&(c=i[d])!==null&&c!==void 0?c:f;return delete i[d],d+"="+h})))!==null&&r!==void 0?r:[],l=E3(i);return l&&s.push(l),n+"?"+s.join("&")},fc=(t,e)=>JSON.stringify(t,((a,r)=>typeof r=="bigint"?r.toString():r),e),px=t=>{var{data:e,compression:a}=t;if(e){if(a===gn.GZipJS){var r=e4((function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new Ga(l.length+(l.length>>>1)),f=0,h=function(g){d[f++]=g},S=0;S<c;++S){if(f+5>d.length){var x=new Ga(f+8+(c-S<<1));x.set(d),d=x}var b=l.charCodeAt(S);b<128||u?h(b):b<2048?(h(192|b>>>6),h(128|63&b)):b>55295&&b<57344?(h(240|(b=65536+(1047552&b)|1023&l.charCodeAt(++S))>>>18),h(128|b>>>12&63),h(128|b>>>6&63),h(128|63&b)):(h(224|b>>>12),h(128|b>>>6&63),h(128|63&b))}return vT(d,0,f)})(fc(e)),{mtime:0}),n=new Blob([r],{type:nE});return{contentType:nE,body:n,estimatedSize:n.size}}if(a===gn.Base64){var o=(function(l){var u,c,d,f,h,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",x=0,b=0,g="",m=[];if(!l)return l;l=t4(l);do u=(h=l.charCodeAt(x++)<<16|l.charCodeAt(x++)<<8|l.charCodeAt(x++))>>18&63,c=h>>12&63,d=h>>6&63,f=63&h,m[b++]=S.charAt(u)+S.charAt(c)+S.charAt(d)+S.charAt(f);while(x<l.length);switch(g=m.join(""),l.length%3){case 1:g=g.slice(0,-2)+"==";break;case 2:g=g.slice(0,-1)+"="}return g})(fc(e)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:fc(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=fc(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},Vp=[];bx&&Vp.push({transport:"fetch",method:t=>{var e,a,{contentType:r,body:n,estimatedSize:o}=(e=px(t))!==null&&e!==void 0?e:{},i=new Headers;Fe(t.headers,(function(c,d){i.append(d,c)})),r&&i.append("Content-Type",r);var s=t.url,l=null;if(wA){var u=new wA;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),t.timeout)}}bx(s,W({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 f={statusCode:c.status,text:d};if(c.status===200)try{f.json=JSON.parse(d)}catch(h){j.error(h)}t.callback==null||t.callback(f)})))).catch((c=>{j.error(c),t.callback==null||t.callback({statusCode:0,text:c})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Sx&&Vp.push({transport:"XHR",method:t=>{var e,a=new Sx;a.open(t.method||"GET",t.url,!0);var{contentType:r,body:n}=(e=px(t))!==null&&e!==void 0?e:{};Fe(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)}}),Ia!=null&&Ia.sendBeacon&&Vp.push({transport:"sendBeacon",method:t=>{var e=ih(t.url,{beacon:"1"});try{var a,{contentType:r,body:n}=(a=px(t))!==null&&a!==void 0?a:{},o=typeof n=="string"?new Blob([n],{type:r}):n;Ia.sendBeacon(e,o)}catch{}}});var sh=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 oE(t,e,a){return fc({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:a})}var yT={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=>sh(a,r))))),not_regex:(t,e)=>e.every((a=>t.every((r=>!sh(a,r))))),icontains:(t,e)=>e.map(zp).some((a=>t.map(zp).some((r=>a.includes(r))))),not_icontains:(t,e)=>e.map(zp).every((a=>t.map(zp).every((r=>!a.includes(r))))),gt:(t,e)=>e.some((a=>{var r=parseFloat(a);return!isNaN(r)&&t.some((n=>r>parseFloat(n)))})),lt:(t,e)=>e.some((a=>{var r=parseFloat(a);return!isNaN(r)&&t.some((n=>r<parseFloat(n)))}))},zp=t=>t.toLowerCase();function xT(t,e){return!t||Object.entries(t).every((a=>{var[r,n]=a,o=e?.[r];if($(o)||dr(o))return!1;var i=[String(o)],s=yT[n.operator];return!!s&&s(n.values,i)}))}var hx=nt("[Error tracking]"),cb=class{constructor(e){var a,r;this.Zt=[],this.ti=new Ex([new Rx,new Fx,new Ox,new Mx,new Px,new Bx,new Dx,new Nx],d3()),this._instance=e,this.Zt=(a=(r=this._instance.persistence)==null?void 0:r.get_property(Ux))!==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.Zt=o,this._instance.persistence&&this._instance.persistence.register({[Ux]:this.Zt,[NA]:i})}get ii(){var e,a=!!this._instance.get_property(NA),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??a)!==null&&e!==void 0&&e}buildProperties(e,a){return this.ti.buildFromUnknown(e,{syntheticException:a?.syntheticException,mechanism:{handled:a?.handled}})}sendExceptionEvent(e){var a=e.$exception_list;if(this.ei(a)){if(this.ri(a))return void hx.info("Skipping exception capture because a suppression rule matched");if(!this.ii&&this.si(a))return void hx.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ni(a))return void hx.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}ri(e){if(e.length===0)return!1;var a=e.reduce(((r,n)=>{var{type:o,value:i}=n;return bt(o)&&o.length>0&&r.$exception_types.push(o),bt(i)&&i.length>0&&r.$exception_values.push(i),r}),{$exception_types:[],$exception_values:[]});return this.Zt.some((r=>{var n=r.values.map((o=>{var i,s=yT[o.operator],l=Ce(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)}))}si(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://")))}ni(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}ei(e){return!ge(e)&&Ce(e)}},ka=nt("[FeatureFlags]"),rc=nt("[FeatureFlags]",{debugEnabled:!0}),mx="$active_feature_flags",$s="$override_feature_flags",iE="$feature_flag_payloads",nc="$override_feature_flag_payloads",sE="$feature_flag_request_id",lE="$feature_flag_evaluated_at",uE=t=>{var e={};for(var[a,r]of qp(t||{}))r&&(e[a]=r);return e},r4=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]})))):ka.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},n4=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),db=class{constructor(e){this.oi=!1,this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.ci=!1,this._instance=e,this.featureFlagEventHandlers=[]}fi(){var e,a=(e=this._instance.config.evaluation_contexts)!==null&&e!==void 0?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.ci||(ka.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ci=!0),a!=null&&a.length?a.filter((r=>{var n=r&&typeof r=="string"&&r.trim().length>0;return n||ka.error("Invalid evaluation context found:",r,"Expected non-empty string"),n})):[]}pi(){return this.fi().length>0}flags(){if(this._instance.config.__preview_remote_config)this.di=!0;else{var e=!this.gi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.mi({disableFlags:e})}}get hasLoadedFlags(){return this.ai}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(zx),a=this._instance.get_property($s),r=this._instance.get_property(nc);if(!r&&!a)return e||{};var n=ut({},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=$(c)?(s=u?.enabled)!==null&&s!==void 0&&s:!!c,f=$(c)?u.variant:typeof c=="string"?c:void 0,h=r?.[i],S=W({},u,{enabled:d,variant:d?f??u?.variant:void 0});d!==u?.enabled&&(S.original_enabled=u?.enabled),f!==u?.variant&&(S.original_variant=u?.variant),h&&(S.metadata=W({},u?.metadata,{payload:h,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),n[i]=S}return this.oi||(ka.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:n}),this.oi=!0),n}getFlagVariants(){var e=this._instance.get_property(Ks),a=this._instance.get_property($s);if(!a)return e||{};for(var r=ut({},e),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.oi||(ka.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:a,finalFlags:r}),this.oi=!0),r}getFlagPayloads(){var e=this._instance.get_property(iE),a=this._instance.get_property(nc);if(!a)return e||{};for(var r=ut({},e||{}),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.oi||(ka.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:a,finalPayloads:r}),this.oi=!0),r}reloadFeatureFlags(){this.ui||this._instance.config.advanced_disable_feature_flags||this.gi||(this.gi=setTimeout((()=>{this.mi()}),5))}bi(){clearTimeout(this.gi),this.gi=void 0}ensureFlagsLoaded(){this.ai||this.li||this.gi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ui=e}mi(e){var a;if(this.bi(),!this._instance.M())if(this.li)this.hi=!0;else{var r=this._instance.config.token,n=this._instance.get_property("$device_id"),o={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:W({},((a=this._instance.persistence)==null?void 0:a.get_initial_props())||{},this._instance.get_property(dc)||{}),group_properties:this._instance.get_property(wi)};dr(n)||$(n)||(o.$device_id=n),(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.pi()&&(o.evaluation_contexts=this.fi());var i=this._instance.config.__preview_remote_config,s=i?"/flags/?v=2":"/flags/?v=2&config=true",l=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",u=this._instance.requestRouter.endpointFor("flags",s+l);i&&(o.timezone=pT()),this.li=!0,this._instance._send_request({method:"POST",url:u,data:o,compression:this._instance.config.disable_compression?void 0:gn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:c=>{var d,f,h=!0;if(c.statusCode===200&&(this.hi||(this.$anon_distinct_id=void 0),h=!1),this.li=!1,this.di||(this.di=!0,this._instance.yi((f=c.json)!==null&&f!==void 0?f:{})),!o.disable_flags||this.hi)if(this.vi=!h,c.json&&(d=c.json.quotaLimited)!=null&&d.includes(n4.FeatureFlags))ka.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 S;o.disable_flags||this.receivedFeatureFlags((S=c.json)!==null&&S!==void 0?S:{},h),this.hi&&(this.hi=!1,this.mi())}}})}}getFeatureFlag(e,a){var r;if(a===void 0&&(a={}),this.ai||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlagResult(e,a);return(r=n?.variant)!==null&&r!==void 0?r:n?.enabled}ka.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var a=this.getFeatureFlagResult(e,{send_event:!1});return a?.payload}getFeatureFlagResult(e,a){if(a===void 0&&(a={}),this.ai||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants(),n=e in r,o=r[e],i=this.getFlagPayloads()[e],s=String(o),l=this._instance.get_property(sE)||void 0,u=this._instance.get_property(lE)||void 0,c=this._instance.get_property(Zp)||{};if((a.send_event||!("send_event"in a))&&(!(e in c)||!c[e].includes(s))){var d,f,h,S,x,b,g,m,y;Ce(c[e])?c[e].push(s):c[e]=[s],(d=this._instance.persistence)==null||d.register({[Zp]:c});var v=this.getFeatureFlagDetails(e),C={$feature_flag:e,$feature_flag_response:o,$feature_flag_payload:i||null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:((f=this._instance.config.bootstrap)==null||(f=f.featureFlags)==null?void 0:f[e])||null,$feature_flag_bootstrapped_payload:((h=this._instance.config.bootstrap)==null||(h=h.featureFlagPayloads)==null?void 0:h[e])||null,$used_bootstrap_value:!this.vi};$(v==null||(S=v.metadata)==null?void 0:S.version)||(C.$feature_flag_version=v.metadata.version);var w,_=(x=v==null||(b=v.reason)==null?void 0:b.description)!==null&&x!==void 0?x:v==null||(g=v.reason)==null?void 0:g.code;_&&(C.$feature_flag_reason=_),v!=null&&(m=v.metadata)!=null&&m.id&&(C.$feature_flag_id=v.metadata.id),$(v?.original_variant)&&$(v?.original_enabled)||(C.$feature_flag_original_response=$(v.original_variant)?v.original_enabled:v.original_variant),v!=null&&(y=v.metadata)!=null&&y.original_payload&&(C.$feature_flag_original_payload=v==null||(w=v.metadata)==null?void 0:w.original_payload),this._instance.capture("$feature_flag_called",C)}if(n){var L=i;if(!$(i))try{L=JSON.parse(i)}catch{}return{key:e,enabled:!!o,variant:typeof o=="string"?o:void 0,payload:L}}}else ka.warn('getFeatureFlagResult for key "'+e+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(e,a){var r=this._instance.config.token,n={distinct_id:this._instance.get_distinct_id(),token:r};this.pi()&&(n.evaluation_contexts=this.fi()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:n,compression:this._instance.config.disable_compression?void 0:gn.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.ai||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,a);return $(r)?void 0:!!r}ka.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.ai=!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=r4(i),f=d.flags,h=d.featureFlags,S=d.featureFlagPayloads;if(h){var x=i.requestId,b=i.evaluatedAt;if(Ce(h)){ka.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var g={};if(h)for(var m=0;m<h.length;m++)g[h[m]]=!0;s&&s.register({[mx]:h,[Ks]:g})}else{var y=h,v=S,C=f;if(i.errorsWhileComputingFlags)if(f){var w=new Set(Object.keys(f).filter((_=>{var L;return!((L=f[_])!=null&&L.failed)})));y=W({},l,Object.fromEntries(Object.entries(y).filter((_=>{var[L]=_;return w.has(L)})))),v=W({},u,Object.fromEntries(Object.entries(v||{}).filter((_=>{var[L]=_;return w.has(L)})))),C=W({},c,Object.fromEntries(Object.entries(C||{}).filter((_=>{var[L]=_;return w.has(L)}))))}else y=W({},l,y),v=W({},u,v),C=W({},c,C);s&&s.register(W({[mx]:Object.keys(uE(y)),[Ks]:y||{},[iE]:v||{},[zx]:C||{}},x?{[sE]:x}:{},b?{[lE]:b}:{}))}}})(e,this._instance.persistence,r,n,o),this.wi(a)}}override(e,a){a===void 0&&(a=!1),ka.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:a})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return ka.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister($s),this._instance.persistence.unregister(nc),this.wi(),rc.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var a,r=e;if(this.oi=!!((a=r.suppressWarning)!==null&&a!==void 0&&a),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister($s),rc.info("Flag overrides cleared");else if(r.flags){if(Ce(r.flags)){for(var n={},o=0;o<r.flags.length;o++)n[r.flags[o]]=!0;this._instance.persistence.register({[$s]:n})}else this._instance.persistence.register({[$s]:r.flags});rc.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(nc),rc.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[nc]:r.payloads}),rc.info("Payload overrides set",{payloads:r.payloads}))),void this.wi()}this.wi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ai){var{flags:a,flagVariants:r}=this.xi();e(a,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,a,r){var n,o=(this._instance.get_property(cc)||[]).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=W({},this.getFlagVariants(),{[e]:a});(n=this._instance.persistence)==null||n.register({[mx]:Object.keys(uE(l)),[Ks]:l}),this.wi()}getEarlyAccessFeatures(e,a,r){a===void 0&&(a=!1);var n=this._instance.get_property(cc),o=r?"&"+r.map((i=>"stage="+i)).join("&"):"";if(n&&!a)return e(n);this._instance._send_request({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(cc),(l=this._instance.persistence)==null||l.register({[cc]:u}),e(u)}}})}xi(){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)),{})}}wi(e){var{flags:a,flagVariants:r}=this.xi();this.featureFlagEventHandlers.forEach((n=>n(a,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(dc)||{};this._instance.register({[dc]:W({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(dc)}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(wi)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((n=>{r[n]=W({},r[n],e[n]),delete e[n]})),this._instance.register({[wi]:W({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var a=this._instance.get_property(wi)||{};this._instance.register({[wi]:W({},a,{[e]:{}})})}else this._instance.unregister(wi)}reset(){this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.$anon_distinct_id=void 0,this.bi(),this.oi=!1}},o4=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],gc=class{constructor(e,a){this.R=e,this.props={},this.Ei=!1,this.$i=(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.Si(e),this.load(),e.debug&&j.info("Persistence loaded",e.persistence,W({},this.props)),this.update_config(e,e,a),this.save()}isDisabled(){return!!this.ki}Si(e){o4.indexOf(e.persistence.toLowerCase())===-1&&(j.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var a=(function(n){n===void 0&&(n=[]);var o=[...P3,...n];return W({},et,{W:function(i){try{var s={};try{s=Ir.W(i)||{}}catch{}var l=ut(s,JSON.parse(et.q(i)||"{}"));return et.G(i,l),l}catch{}return null},G:function(i,s,l,u,c,d){try{et.G(i,s,void 0,void 0,d);var f={};o.forEach((h=>{s[h]&&(f[h]=s[h])})),Object.keys(f).length&&Ir.G(i,f,l,u,c,d)}catch(h){et.B(h)}},V:function(i,s){try{E?.localStorage.removeItem(i),Ir.V(i,s)}catch(l){et.B(l)}}})})(e.cookie_persisted_properties||[]),r=e.persistence.toLowerCase();return r==="localstorage"&&et.H()?et:r==="localstorage+cookie"&&a.H()?a:r==="sessionstorage"&&Pt.H()?Pt:r==="memory"?N3:r==="cookie"?Ir:a.H()?a:Ir}properties(){var e={};return Fe(this.props,(function(a,r){if(r===Ks&&xt(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,(dr(i=x3)?l:CA&&i.indexOf===CA?i.indexOf(s)!=-1:(Fe(i,(function(u){if(l||(l=u===s))return Gp})),l))||(e[r]=a);var i,s,l})),e}load(){if(!this.ki){var e=this.Y.W(this.$i);e&&(this.props=ut({},e))}}save(){this.ki||this.Y.G(this.$i,this.props,this.Pi,this.Ti,this.Ii,this.R.debug)}remove(){this.Y.V(this.$i,!1),this.Y.V(this.$i,!0)}clear(){this.remove(),this.props={}}register_once(e,a,r){if(xt(e)){$(a)&&(a="None"),this.Pi=$(r)?this.Ci:r;var n=!1;if(Fe(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(xt(e)){this.Pi=$(a)?this.Ci:a;var r=!1;if(Fe(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.Ei){var e=sT(this.R.custom_campaign_params,this.R.mask_personal_data_properties,this.R.custom_personal_data_properties);Xs(Nb(e))||this.register(e),this.Ei=!0}}update_search_keyword(){var e;this.register((e=V?.referrer)?uT(e):{})}update_referrer_info(){var e;this.register_once({$referrer:cT(),$referring_domain:V!=null&&V.referrer&&((e=Jp(V.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[jx]||this.props[Gx]||this.register_once({[Xp]:dT(this.R.mask_personal_data_properties,this.R.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Fe([Gx,jx],(i=>{var s=this.props[i];s&&Fe(s,(function(l,u){e["$initial_"+_x(u)]=l}))}));var a,r,n=this.props[Xp];if(n){var o=(a=fT(n),r={},Fe(a,(function(i,s){r["$initial_"+_x(s)]=i})),r);ut(e,o)}return e}safe_merge(e){return Fe(this.props,(function(a,r){r in e||(e[r]=a)})),e}update_config(e,a,r){if(this.Ci=this.Pi=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||!((i,s)=>{if(i.length!==s.length)return!1;var l=[...i].sort(),u=[...s].sort();return l.every(((c,d)=>c===u[d]))})(e.cookie_persisted_properties||[],a.cookie_persisted_properties||[])){var n=this.Si(e),o=this.props;this.clear(),this.Y=n,this.props=o,this.save()}}set_disabled(e){this.ki=e,this.ki?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ti&&(this.Ti=e,this.remove(),this.save())}set_secure(e){e!==this.Ii&&(this.Ii=e,this.remove(),this.save())}set_event_timer(e,a){var r=this.props[uc]||{};r[e]=a,this.props[uc]=r,this.save()}remove_event_timer(e){var a=(this.props[uc]||{})[e];return $(a)||(delete this.props[uc][e],this.save()),a}get_property(e){return this.props[e]}set_property(e,a){this.props[e]=a,this.save()}},cE=nt("[Product Tours]"),gx="ph_product_tours",fb=class{constructor(e){this.Ri=null,this.Fi=null,this._instance=e}onRemoteConfig(e){this._instance.persistence&&this._instance.persistence.register({[HA]:!(e==null||!e.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var e,a;this.Ri||(e=this._instance).config.disable_product_tours||(a=e.persistence)==null||!a.get_property(HA)||this.it((()=>this.Oi()))}it(e){var a,r;(a=Q.__PosthogExtensions__)!=null&&a.generateProductTours?e():(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"product-tours",(n=>{n?cE.error("Could not load product tours script",n):e()}))}Oi(){var e;!this.Ri&&(e=Q.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Ri=Q.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,a){if(a===void 0&&(a=!1),!Ce(this.Fi)||a){var r=this._instance.persistence;if(r){var n=r.props[gx];if(Ce(n)&&!a)return this.Fi=n,void e(n,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:o=>{var i=o.statusCode;if(i!==200||!o.json){var s="Product Tours API could not be loaded, status: "+i;return cE.error(s),void e([],{isLoaded:!1,error:s})}var l=Ce(o.json.product_tours)?o.json.product_tours:[];this.Fi=l,r&&r.register({[gx]:l}),e(l,{isLoaded:!0})}})}else e(this.Fi,{isLoaded:!0})}getActiveProductTours(e){ge(this.Ri)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ri.getActiveProductTours(e)}showProductTour(e){var a;(a=this.Ri)==null||a.showTourById(e)}previewTour(e){this.Ri?this.Ri.previewTour(e):this.it((()=>{var a;this.Oi(),(a=this.Ri)==null||a.previewTour(e)}))}dismissProductTour(){var e;(e=this.Ri)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Ri)==null||e.nextStep()}previousStep(){var e;(e=this.Ri)==null||e.previousStep()}clearCache(){var e;this.Fi=null,(e=this._instance.persistence)==null||e.unregister(gx)}resetTour(e){var a;(a=this.Ri)==null||a.resetTour(e)}resetAllTours(){var e;(e=this.Ri)==null||e.resetAllTours()}cancelPendingTour(e){var a;(a=this.Ri)==null||a.cancelPendingTour(e)}},oc=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),E8=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),T8=(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})({}),R8=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),vx=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),M8=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),O8=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),D8=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),pc=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t})({}),yx=(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.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t})({}),pb=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),Pe=nt("[Surveys]"),bT="seenSurvey_",i4=(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},dE=t=>((e,a)=>{var r=""+e+a.id;return a.current_iteration&&a.current_iteration>0&&(r=""+e+a.id+"_"+a.current_iteration),r})(bT,t),s4=[vx.Popover,vx.Widget,vx.API],l4={ignoreConditions:!1,ignoreDelay:!1,displayType:pb.Popover},Cc=class{constructor(){this.Mi={},this.Mi={}}on(e,a){return this.Mi[e]||(this.Mi[e]=[]),this.Mi[e].push(a),()=>{this.Mi[e]=this.Mi[e].filter((r=>r!==a))}}emit(e,a){for(var r of this.Mi[e]||[])r(a);for(var n of this.Mi["*"]||[])n(e,a)}};function js(t,e,a){if(ge(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 hb=class{constructor(e){this.Ai=new Cc,this.ji=(a,r)=>this.Di(a,r)&&this.Li(a,r)&&this.Ni(a,r)&&this.Ui(a,r),this.Di=(a,r)=>r==null||!r.event||a?.event===r?.event,this._instance=e,this.zi=new Set,this.Hi=new Set}init(){var e;if(!$((e=this._instance)==null?void 0:e._addCaptureHook)){var a;(a=this._instance)==null||a._addCaptureHook(((r,n)=>{this.on(r,n)}))}}register(e){var a,r;if(!$((a=this._instance)==null?void 0:a._addCaptureHook)&&(e.forEach((i=>{var s,l;(s=this.Hi)==null||s.add(i),(l=i.steps)==null||l.forEach((u=>{var c;(c=this.zi)==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.zi.has(e)||this.zi.has(a?.event))&&this.Hi&&((r=this.Hi)==null?void 0:r.size)>0&&this.Hi.forEach((n=>{this.Bi(a,n)&&this.Ai.emit("actionCaptured",n.name)}))}qi(e){this.onAction("actionCaptured",(a=>e(a)))}Bi(e,a){if(a?.steps==null)return!1;for(var r of a.steps)if(this.ji(e,r))return!0;return!1}onAction(e,a){return this.Ai.on(e,a)}Li(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"||!js(n,a.url,a.url_matching||"contains"))return!1}return!0}Ni(e,a){return!!this.Wi(e,a)&&!!this.Gi(e,a)&&!!this.Vi(e,a)}Wi(e,a){var r;if(a==null||!a.href)return!0;var n=this.Ji(e);if(n.length>0)return n.some((s=>js(s.href,a.href,a.href_matching||"exact")));var o,i=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!i&&js((o=i.match(/(?::|")href="(.*?)"/))?o[1]:"",a.href,a.href_matching||"exact")}Gi(e,a){var r;if(a==null||!a.text)return!0;var n=this.Ji(e);if(n.length>0)return n.some((u=>js(u.text,a.text,a.text_matching||"exact")||js(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=[],f=/(?::|")text="(.*?)"/g;!ge(c=f.exec(u));)d.includes(c[1])||d.push(c[1]);return d})(l),i=a.text,s=a.text_matching||"exact",o.some((u=>js(u,i,s))))}Vi(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}Ji(e){var a;return(e==null||(a=e.properties)==null?void 0:a.$elements)==null?[]:e?.properties.$elements}Ui(e,a){return a==null||!a.properties||a.properties.length===0||xT(a.properties.reduce(((r,n)=>{var o=Ce(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)}},mb=class{constructor(e){this._instance=e,this.Ki=new Map,this.Yi=new Map,this.Xi=new Map}Qi(e,a){return!!e&&xT(e.propertyFilters,a?.properties)}Zi(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}te(e,a,r){var n=(r===oc.Activation?this.Ki:this.Yi).get(e),o=[];return this.ie((i=>{o=i.filter((s=>n?.includes(s.id)))})),o.filter((i=>{var s,l=(s=i.conditions)==null||(s=s[r])==null||(s=s.values)==null?void 0:s.find((u=>u.name===e));return this.Qi(l,a)}))}register(e){var a;$((a=this._instance)==null?void 0:a._addCaptureHook)||(this.ee(e),this.re(e))}re(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.se==null&&(this.se=new hb(this._instance),this.se.init(),this.se.qi((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.se)==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.Xi.get(u.name);c&&c.push(r.id),this.Xi.set(u.name,c||[r.id])}})))})))}ee(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._addCaptureHook(((o,i)=>{this.onEvent(o,i)})),this.Ki=this.Zi(e,oc.Activation),this.Yi=this.Zi(e,oc.Cancellation))}onEvent(e,a){var r,n=this.ne(),o=this.oe(),i=this.ae(),s=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[o])||[];if(i===e&&a&&s.length>0){var l,u;n.info("event matched, removing item from activated items",{event:e,eventPayload:a,existingActivatedItems:s});var c=(a==null||(l=a.properties)==null?void 0:l.$survey_id)||(a==null||(u=a.properties)==null?void 0:u.$product_tour_id);if(c){var d=s.indexOf(c);d>=0&&(s.splice(d,1),this.le(s))}}else{if(this.Yi.has(e)){var f=this.te(e,a,oc.Cancellation);f.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:f.map((S=>S.id))}),f.forEach((S=>{var x=s.indexOf(S.id);x>=0&&s.splice(x,1),this.ue(S.id)})),this.le(s))}if(this.Ki.has(e)){n.info("event name matched",{event:e,eventPayload:a,items:this.Ki.get(e)});var h=this.te(e,a,oc.Activation);this.le(s.concat(h.map((S=>S.id))||[]))}}}onAction(e){var a,r=this.oe(),n=((a=this._instance)==null||(a=a.persistence)==null?void 0:a.props[r])||[];this.Xi.has(e)&&this.le(n.concat(this.Xi.get(e)||[]))}le(e){var a,r=this.ne(),n=this.oe(),o=[...new Set(e)].filter((i=>!this.he(i)));r.info("updating activated items",{activatedItems:o}),(a=this._instance)==null||(a=a.persistence)==null||a.register({[n]:o})}getActivatedIds(){var e,a=this.oe(),r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[a];return r||[]}getEventToItemsMap(){return this.Ki}de(){return this.se}},gb=class extends mb{constructor(e){super(e)}oe(){return"$surveys_activated"}ae(){return pc.SHOWN}ie(e){var a;(a=this._instance)==null||a.getSurveys(e)}ue(e){var a;(a=this._instance)==null||a.cancelPendingSurvey(e)}ne(){return Pe}he(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},vb=class{constructor(e){this.ve=void 0,this._surveyManager=null,this.ce=!1,this.fe=[],this.pe=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var a=e.surveys;if(ge(a))return Pe.warn("Flags not loaded yet. Not loading surveys.");var r=Ce(a);this.ve=r?a.length>0:a,Pe.info("flags response received, isSurveysEnabled: "+this.ve),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],a=0;a<localStorage.length;a++){var r=localStorage.key(a);(r!=null&&r.startsWith(bT)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((n=>localStorage.removeItem(n)))}loadIfEnabled(){if(!this._surveyManager)if(this.ce)Pe.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Pe.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Pe.info("Not loading surveys in cookieless mode without consent.");else{var e=Q?.__PosthogExtensions__;if(e){if(!$(this.ve)||this._instance.config.advanced_enable_surveys){var a=this.ve||this._instance.config.advanced_enable_surveys;this.ce=!0;try{var r=e.generateSurveys;if(r)return void this.ge(r,a);var n=e.loadExternalDependency;if(!n)return void this._e("PostHog loadExternalDependency extension not found.");n(this._instance,"surveys",(o=>{o||!e.generateSurveys?this._e("Could not load surveys script",o):this.ge(e.generateSurveys,a)}))}catch(o){throw this._e("Error initializing surveys",o),o}finally{this.ce=!1}}}else Pe.error("PostHog Extensions not found.")}}ge(e,a){this._surveyManager=e(this._instance,a),this._surveyEventReceiver=new gb(this._instance),Pe.info("Surveys loaded successfully"),this.me({isLoaded:!0})}_e(e,a){Pe.error(e,a),this.me({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.fe.push(e),this._surveyManager&&this.me({isLoaded:!0}),()=>{this.fe=this.fe.filter((a=>a!==e))}}getSurveys(e,a){if(a===void 0&&(a=!1),this._instance.config.disable_surveys)return Pe.info("Disabled. Not loading surveys."),e([]);var r,n=this._instance.get_property(qx);if(n&&!a)return e(n,{isLoaded:!0});typeof Promise<"u"&&this.pe?this.pe.then((o=>{var{surveys:i,context:s}=o;return e(i,s)})):(typeof Promise<"u"&&(this.pe=new Promise((o=>{r=o}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:o=>{var i;this.pe=null;var s=o.statusCode;if(s!==200||!o.json){var l="Surveys API could not be loaded, status: "+s;Pe.error(l);var u={isLoaded:!1,error:l};return e([],u),void(r==null||r({surveys:[],context:u}))}var c,d=o.json.surveys||[],f=d.filter((S=>(function(x){return!(!x.start_date||x.end_date)})(S)&&((function(x){var b;return!((b=x.conditions)==null||(b=b.events)==null||(b=b.values)==null||!b.length)})(S)||(function(x){var b;return!((b=x.conditions)==null||(b=b.actions)==null||(b=b.values)==null||!b.length)})(S))));f.length>0&&((c=this._surveyEventReceiver)==null||c.register(f)),(i=this._instance.persistence)==null||i.register({[qx]:d});var h={isLoaded:!0};e(d,h),r?.({surveys:d,context:h})}}))}me(e){for(var a of this.fe)try{if(!e.isLoaded)return a([],e);this.getSurveys(a)}catch(r){Pe.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,a){if(a===void 0&&(a=!1),!ge(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,a);Pe.warn("init was not called")}be(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}ye(e){if(ge(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var a=typeof e=="string"?this.be(e):e;return a?this._surveyManager.checkSurveyEligibility(a):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ge(this._surveyManager))return Pe.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var a=this.ye(e);return{visible:a.eligible,disabledReason:a.reason}}canRenderSurveyAsync(e,a){return ge(this._surveyManager)?(Pe.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.ye(i);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),a)}))}renderSurvey(e,a,r){var n;if(ge(this._surveyManager))Pe.warn("init was not called");else{var o=typeof e=="string"?this.be(e):e;if(o!=null&&o.id)if(s4.includes(o.type)){var i=V?.querySelector(a);if(i)return(n=o.appearance)!=null&&n.surveyPopupDelaySeconds?(Pe.info("Rendering survey "+o.id+" with delay of "+o.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var s,l;Pe.info("Rendering survey "+o.id+" with delay of "+((s=o.appearance)==null?void 0:s.surveyPopupDelaySeconds)+" seconds"),(l=this._surveyManager)==null||l.renderSurvey(o,i,r),Pe.info("Survey "+o.id+" rendered")}),1e3*o.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(o,i,r);Pe.warn("Survey element not found")}else Pe.warn("Surveys of type "+o.type+" cannot be rendered in the app");else Pe.warn("Survey not found")}}displaySurvey(e,a){var r;if(ge(this._surveyManager))Pe.warn("init was not called");else{var n=this.be(e);if(n){var o=n;if((r=n.appearance)!=null&&r.surveyPopupDelaySeconds&&a.ignoreDelay&&(o=W({},n,{appearance:W({},n.appearance,{surveyPopupDelaySeconds:0})})),a.displayType!==pb.Popover&&a.initialResponses&&Pe.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),a.ignoreConditions===!1){var i=this.canRenderSurvey(n);if(!i.visible)return void Pe.warn("Survey is not eligible to be displayed: ",i.disabledReason)}a.displayType!==pb.Inline?this._surveyManager.handlePopoverSurvey(o,a):this.renderSurvey(o,a.selector,a.properties)}else Pe.warn("Survey not found")}}cancelPendingSurvey(e){ge(this._surveyManager)?Pe.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}},fn=nt("[Conversations]"),yb=class{constructor(e){this.we=void 0,this._conversationsManager=null,this.xe=!1,this.Ee=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var a=e.conversations;ge(a)||(yn(a)?this.we=a:(this.we=a.enabled,this.Ee=a),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.we=void 0,this.Ee=null}loadIfEnabled(){if(!this._conversationsManager&&!this.xe&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=Q?.__PosthogExtensions__;if(e&&!$(this.we)&&this.we)if(this.Ee&&this.Ee.token){this.xe=!0;try{var a=e.initConversations;if(a)return this.$e(a),void(this.xe=!1);var r=e.loadExternalDependency;if(!r)return void this.Se("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(n=>{n||!e.initConversations?this.Se("Could not load conversations script",n):this.$e(e.initConversations),this.xe=!1}))}catch(n){this.Se("Error initializing conversations",n),this.xe=!1}}else fn.error("Conversations enabled but missing token in remote config.")}}$e(e){if(this.Ee)try{this._conversationsManager=e(this.Ee,this._instance),fn.info("Conversations loaded successfully")}catch(a){this.Se("Error completing conversations initialization",a)}else fn.error("Cannot complete initialization: remote config is null")}Se(e,a){fn.error(e,a),this._conversationsManager=null,this.xe=!1}show(){this._conversationsManager?this._conversationsManager.show():fn.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.we===!0&&!dr(this._conversationsManager)}isVisible(){var e,a;return(e=(a=this._conversationsManager)==null?void 0:a.isVisible())!==null&&e!==void 0&&e}sendMessage(e,a,r){var n=this;return Zs((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,a,r):(fn.warn("Conversations not available yet."),null)}))()}getMessages(e,a){var r=this;return Zs((function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,a):(fn.warn("Conversations not available yet."),null)}))()}markAsRead(e){var a=this;return Zs((function*(){return a._conversationsManager?a._conversationsManager.markAsRead(e):(fn.warn("Conversations not available yet."),null)}))()}getTickets(e){var a=this;return Zs((function*(){return a._conversationsManager?a._conversationsManager.getTickets(e):(fn.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var e,a;return(e=(a=this._conversationsManager)==null?void 0:a.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,a;return(e=(a=this._conversationsManager)==null?void 0:a.getWidgetSessionId())!==null&&e!==void 0?e:null}},xb=class{constructor(e){var a;this.ke=!1,this.Pe=!1,this._instance=e,this._instance&&(a=this._instance.config.logs)!=null&&a.captureConsoleLogs&&(this.ke=!0)}onRemoteConfig(e){var a,r=(a=e.logs)==null?void 0:a.captureConsoleLogs;!ge(r)&&r&&(this.ke=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.ke&&!this.Pe){var e=nt("[logs]"),a=Q?.__PosthogExtensions__;if(a){var r=a.loadExternalDependency;r?r(this._instance,"logs",(n=>{var o;n||(o=a.logs)==null||!o.initializeLogs?e.error("Could not load logs script",n):(a.logs.initializeLogs(this._instance),this.Pe=!0)})):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}},fE=nt("[RateLimiter]"),bb=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=a=>{var r=a.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((n=>{fE.info((n||"events")+" is quota limited."),this.serverLimits[n]=new Date().getTime()+6e4}))}catch(n){return void fE.warn('could not rate limit - continuing. Error: "'+n?.message+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var a,r,n;e===void 0&&(e=!1);var{captureEventsBurstLimit:o,captureEventsPerSecond:i}=this,s=new Date().getTime(),l=(a=(r=this.instance.persistence)==null?void 0:r.get_property($x))!==null&&a!==void 0?a:{tokens:o,last:s};l.tokens+=(s-l.last)/1e3*i,l.last=s,l.tokens>o&&(l.tokens=o);var u=l.tokens<1;return u||e||(l.tokens=Math.max(0,l.tokens-1)),!u||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+i+" events per second and "+o+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(n=this.instance.persistence)==null||n.set_property($x,l),{isRateLimited:u,remainingTokens:l.tokens}}isServerRateLimited(e){var a=this.serverLimits[e||"events"]||!1;return a!==!1&&new Date().getTime()<a}},Ci=nt("[RemoteConfig]"),Sb=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Q._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Te(e){var a,r;(a=Q.__PosthogExtensions__)!=null&&a.loadExternalDependency?(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(Ci.error("PostHog Extensions not found. Cannot load remote config."),e())}Ie(e){this._instance._send_request({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 Ci.info("Using preloaded remote config",this.remoteConfig),void this.yi(this.remoteConfig);if(this._instance.M())return void Ci.warn("Remote config is disabled. Falling back to local config.");this.Te((e=>{if(!e)return Ci.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ie((a=>{this.yi(a)}));this.yi(e)}))}catch(e){Ci.error("Error loading remote config",e)}}yi(e){e?this._instance.config.__preview_remote_config?(this._instance.yi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):Ci.info("__preview_remote_config is disabled. Logging config instead",e):Ci.error("Failed to fetch remote config from PostHog.")}},_b=3e3,Cb=class{constructor(e,a){this.Ce=!0,this.Re=[],this.Fe=Ar(a?.flush_interval_ms||_b,250,5e3,j.createLogger("flush interval"),_b),this.Oe=e}enqueue(e){this.Re.push(e),this.Me||this.Ae()}unload(){this.je();var e=this.Re.length>0?this.De():{},a=Object.values(e);[...a.filter((r=>r.url.indexOf("/e")===0)),...a.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Oe(W({},r,{transport:"sendBeacon"}))}))}enable(){this.Ce=!1,this.Ae()}Ae(){var e=this;this.Ce||(this.Me=setTimeout((()=>{if(this.je(),this.Re.length>0){var a=this.De(),r=function(){var o=a[n],i=new Date().getTime();o.data&&Ce(o.data)&&Fe(o.data,(s=>{s.offset=Math.abs(s.timestamp-i),delete s.timestamp})),e.Oe(o)};for(var n in a)r()}}),this.Fe))}je(){clearTimeout(this.Me),this.Me=void 0}De(){var e={};return Fe(this.Re,(a=>{var r,n=a,o=(n?n.batchKey:null)||n.url;$(e[o])&&(e[o]=W({},n,{data:[]})),(r=e[o].data)==null||r.push(n.data)})),this.Re=[],e}},u4=["retriesPerformedSoFar"],wb=class{constructor(e){this.Le=!1,this.Ne=3e3,this.Re=[],this._instance=e,this.Re=[],this.Ue=!0,!$(E)&&"onLine"in E.navigator&&(this.Ue=E.navigator.onLine,this.ze=()=>{this.Ue=!0,this.Lt()},this.He=()=>{this.Ue=!1},mt(E,"online",this.ze),mt(E,"offline",this.He))}get length(){return this.Re.length}retriableRequest(e){var{retriesPerformedSoFar:a}=e,r=yE(e,u4);Gs(a)&&(r.url=ih(r.url,{retry_count:a})),this._instance._send_request(W({},r,{callback:n=>{n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(a??0)<10?this.Be(W({retriesPerformedSoFar:a},r)):r.callback==null||r.callback(n)}}))}Be(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.Re.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),j.warn(o),this.Le||(this.Le=!0,this.qe())}qe(){if(this.We&&clearTimeout(this.We),this.Re.length===0)return this.Le=!1,void(this.We=void 0);this.We=setTimeout((()=>{this.Ue&&this.Re.length>0&&this.Lt(),this.qe()}),this.Ne)}Lt(){var e=Date.now(),a=[],r=this.Re.filter((o=>o.retryAt<e||(a.push(o),!1)));if(this.Re=a,r.length>0)for(var{requestOptions:n}of r)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.We&&(clearTimeout(this.We),this.We=void 0),this.Le=!1,$(E)||(this.ze&&(E.removeEventListener("online",this.ze),this.ze=void 0),this.He&&(E.removeEventListener("offline",this.He),this.He=void 0)),this.Re))try{this._instance._send_request(W({},e,{transport:"sendBeacon"}))}catch(a){j.error(a)}this.Re=[]}},Lb=class{constructor(e){this.Ge=()=>{var a,r,n,o;this.Ve||(this.Ve={});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.Ve.lastScrollY=Math.ceil(s),this.Ve.maxScrollY=Math.max(s,(a=this.Ve.maxScrollY)!==null&&a!==void 0?a:0),this.Ve.maxScrollHeight=Math.max(l,(r=this.Ve.maxScrollHeight)!==null&&r!==void 0?r:0),this.Ve.lastContentY=u,this.Ve.maxContentY=Math.max(u,(n=this.Ve.maxContentY)!==null&&n!==void 0?n:0),this.Ve.maxContentHeight=Math.max(c,(o=this.Ve.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Ve}resetContext(){var e=this.Ve;return setTimeout(this.Ge,0),e}startMeasuringScrollPosition(){mt(E,"scroll",this.Ge,{capture:!0}),mt(E,"scrollend",this.Ge,{capture:!0}),mt(E,"resize",this.Ge)}scrollElement(){if(!this._instance.config.scroll_root_selector)return E?.document.documentElement;var e=Ce(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=E?.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 E&&(E.scrollY||E.pageYOffset||E.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return E&&(E.scrollX||E.pageXOffset||E.document.documentElement.scrollLeft)||0}},c4=t=>dT(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),lh=class{constructor(e,a,r,n){this.Je=o=>{var i=this.Ke();if(!i||i.sessionId!==o){var s={sessionId:o,props:this.Ye(this._instance)};this.Xe.register({[Vx]:s})}},this._instance=e,this.Qe=a,this.Xe=r,this.Ye=n||c4,this.Qe.onSessionId(this.Je)}Ke(){return this.Xe.props[Vx]}getSetOnceProps(){var e,a=(e=this.Ke())==null?void 0:e.props;return a?"r"in a?fT(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 Fe(Nb(this.getSetOnceProps()),((a,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+_x(r)]=a})),e}},xx=nt("[SessionId]"),uh=class{on(e,a){return this.Ze.on(e,a)}constructor(e,a,r){var n;if(this.tr=[],this.ir=void 0,this.Ze=new Cc,this.er=(c,d)=>!(!Gs(c)||!Gs(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.R=e.config,this.Xe=e.persistence,this.rr=void 0,this.sr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.nr=a||So,this.ar=r||So;var o=this.R.persistence_name||this.R.token,i=this.R.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Ar(i,60,36e3,xx.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.lr(),this.ur="ph_"+o+"_window_id",this.hr="ph_"+o+"_primary_window_exists",this.dr()){var s=Pt.W(this.ur),l=Pt.W(this.hr);s&&!l?this.rr=s:Pt.V(this.ur),Pt.G(this.hr,!0)}if((n=this.R.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.R.bootstrap.sessionID);this.vr(this.R.bootstrap.sessionID,new Date().getTime(),u)}catch(c){xx.error("Invalid sessionID in bootstrap",c)}this.cr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return $(this.tr)&&(this.tr=[]),this.tr.push(e),this.sr&&e(this.sr,this.rr),()=>{this.tr=this.tr.filter((a=>a!==e))}}dr(){return this.R.persistence!=="memory"&&!this.Xe.ki&&Pt.H()}pr(e){e!==this.rr&&(this.rr=e,this.dr()&&Pt.G(this.ur,e))}gr(){return this.rr?this.rr:this.dr()?Pt.W(this.ur):null}vr(e,a,r){e===this.sr&&a===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=a,this.sr=e,this.Xe.register({[Wp]:[a,e,r]}))}_r(){var e=this.Xe.props[Wp];return Ce(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.vr(null,null,null)}destroy(){clearTimeout(this.mr),this.mr=void 0,this.ir&&E&&(E.removeEventListener("beforeunload",this.ir,{capture:!1}),this.ir=void 0),this.tr=[]}cr(){this.ir=()=>{this.dr()&&Pt.V(this.hr)},mt(E,"beforeunload",this.ir,{capture:!1})}checkAndGetSessionAndWindowId(e,a){if(e===void 0&&(e=!1),a===void 0&&(a=null),this.R.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._r(),s=this.gr(),l=Gs(i)&&Math.abs(r-i)>864e5,u=!1,c=!o,d=!c&&!e&&this.er(r,n);c||d||l?(o=this.nr(),s=this.ar(),xx.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}}),i=r,u=!0):s||(s=this.ar(),u=!0);var f=Gs(n)&&e&&!l?n:r,h=Gs(i)?i:new Date().getTime();return this.pr(s),this.vr(o,f,h),e||this.lr(),u&&this.tr.forEach((S=>S(o,s,u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:s,sessionStartTimestamp:h,changeReason:u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:n}}lr(){clearTimeout(this.mr),this.mr=setTimeout((()=>{var[e]=this._r();if(this.er(new Date().getTime(),e)){var a=this.sr;this.resetSessionId(),this.Ze.emit("forcedIdleReset",{idleSessionId:a})}}),1.1*this.sessionTimeoutMs)}},d4=["$set_once","$set"],xo=nt("[SiteApps]"),kb=class{constructor(e){this._instance=e,this.br=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}yr(e,a){if(a){var r=this.globalsForEvent(a);this.br.push(r),this.br.length>1e3&&(this.br=this.br.slice(10))}}get siteAppLoaders(){var e;return(e=Q._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.yr.bind(this));this.wr=()=>{e(),this.br=[],this.wr=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[f,h]of Object.entries(d))u[f]={id:c[f],type:f,properties:h};var{$set_once:S,$set:x}=e;return{event:W({},yE(e,d4),{properties:W({},e.properties,x?{$set:W({},(a=(r=e.properties)==null?void 0:r.$set)!==null&&a!==void 0?a:{},x)}:{},S?{$set_once:W({},(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.br.length&&(xo.info("Processing "+this.br.length+" events for site app with id "+e.id),this.br.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.wr)==null||s.call(this))},n=!1,o=s=>{a.errored=!s,a.loaded=!0,xo.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){xo.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(n&&a.loaded)try{r()}catch(s){xo.error("Error while processing buffered events PostHog app with config id "+e.id,s),a.errored=!0}}Er(){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)}$r(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){xo.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.Er(),void this._instance.on("eventCaptured",(u=>this.$r(u)))):void xo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.wr)==null||r.call(this),(n=e.siteApps)!=null&&n.length)if(this.isEnabled){var i=function(u){var c;Q["__$$ph_site_app_"+u]=o._instance,(c=Q.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(o._instance,l,(d=>{if(d)return xo.error("Error while initializing PostHog app with config id "+u,d)}))};for(var{id:s,url:l}of e.siteApps)i(s)}else xo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},ST=function(t,e){if(!t)return!1;var a=t.userAgent;if(a&&kA(a,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some((n=>kA(n?.brand,e))))return!0}catch{}return!!t.webdriver},hc=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),pE="i.posthog.com",Ib=class{constructor(e){this.Sr={},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("."+pE,".posthog.com")),a==="https://app.posthog.com"?"https://us.posthog.com":a}get region(){return this.Sr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Sr[this.apiHost]=hc.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Sr[this.apiHost]=hc.EU:this.Sr[this.apiHost]=hc.CUSTOM),this.Sr[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===hc.CUSTOM)return this.apiHost+a;var r=pE+a;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}},f4={icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!E&&sh(e.href,t),not_regex:(t,e)=>!!E&&!sh(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},Ab=class t{constructor(e){var a=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),a.getWebExperiments((n=>{t.kr("retrieved web experiments from the server"),a.Pr=new Map,n.forEach((o=>{if(o.feature_flag_key){var i;a.Pr&&(t.kr("setting flag key ",o.feature_flag_key," to web experiment ",o),(i=a.Pr)==null||i.set(o.feature_flag_key,o));var s=a._instance.getFeatureFlag(o.feature_flag_key);bt(s)&&o.variants[s]&&a.Tr(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var u=o.variants[l];t.Ir(u)&&a.Tr(o.name,l,u.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}onFeatureFlags(e){if(this._is_bot())t.kr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ge(this.Pr))return this.Pr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.kr("applying feature flags",e),e.forEach((a=>{var r;if(this.Pr&&(r=this.Pr)!=null&&r.has(a)){var n,o=this._instance.getFeatureFlag(a),i=(n=this.Pr)==null?void 0:n.get(a);o&&i!=null&&i.variants[o]&&this.Tr(i.name,o,i.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var a=eh(e?.search,"__experiment_id"),r=eh(e?.search,"__experiment_variant");a&&r&&(t.kr("previewing web experiments "+a+" && "+r),this.getWebExperiments((n=>{this.Cr(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._send_request({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)}})}Cr(e,a,r){var n=r.filter((o=>o.id===e));n&&n.length>0&&(t.kr("Previewing web experiment ["+n[0].name+"] with variant ["+a+"]"),this.Tr(n[0].name,a,n[0].variants[a].transforms))}static Ir(e){return!ge(e.conditions)&&t.Rr(e)&&t.Fr(e)}static Rr(e){var a;if(ge(e.conditions)||ge((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||f4[(n=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&n!==void 0?n:"icontains"](e.conditions.url,i))}static getWindowLocation(){return E?.location}static Fr(e){var a;if(ge(e.conditions)||ge((a=e.conditions)==null?void 0:a.utm))return!0;var r=sT();if(r.utm_source){var n,o,i,s,l,u,c,d,f=(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,h=(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,x=(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 f&&S&&x&&h}return!1}static kr(e){for(var a=arguments.length,r=new Array(a>1?a-1:0),n=1;n<a;n++)r[n-1]=arguments[n];j.info("[WebExperiments] "+e,r)}Tr(e,a,r){this._is_bot()?t.kr("Refusing to render web experiment since the viewer is a likely bot"):a!=="control"?r.forEach((n=>{if(n.selector){var o;t.kr("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.kr("Control variants leave the page unmodified.")}_is_bot(){return Ia&&this._instance?ST(Ia,this._instance.config.custom_blocked_useragents):void 0}},p4=nt("[PostHog ExternalIntegrations]"),h4={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Eb=class{constructor(e){this._instance=e}it(e,a){var r;(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(n=>{if(n)return p4.error("failed to load script",n);a()}))}startIfEnabledOrStop(){var e=this,a=function(i){var s,l,u;!n||(s=Q.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[i]||e.it(h4[i],(()=>{var c;(c=Q.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[i])==null||c.start(e._instance)})),!n&&(l=Q.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[i]&&((u=Q.__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)}}},Tb="[SessionRecording]",ic=nt(Tb),ch=class{get started(){var e;return!((e=this.Or)==null||!e.isStarted)}get status(){return this.Or?this.Or.status:this.Mr&&!this.Ar?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Mr=!1,this.jr=void 0,this._instance=e,!this._instance.sessionManager)throw ic.error("started without valid sessionManager"),new Error(Tb+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Tb+' cannot be used with cookieless_mode="always"')}get Ar(){var e,a=!((e=this._instance.get_property(ix))==null||!e.enabled),r=!this._instance.config.disable_session_recording,n=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return E&&a&&r&&!n}startIfEnabledOrStop(e){var a;if(!this.Ar||(a=this.Or)==null||!a.isStarted){var r=!$(Object.assign)&&!$(Array.from);this.Ar&&r?(this.Dr(e),ic.info("starting")):this.stopRecording()}}Dr(e){var a,r,n;this.Ar&&(Q!=null&&(a=Q.__PosthogExtensions__)!=null&&(a=a.rrweb)!=null&&a.record&&(r=Q.__PosthogExtensions__)!=null&&r.initSessionRecording?this.Lr(e):(n=Q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.Nr,(o=>{if(o)return ic.error("could not load recorder",o);this.Lr(e)})))}stopRecording(){var e,a;(e=this.jr)==null||e.call(this),this.jr=void 0,(a=this.Or)==null||a.stop()}Ur(){var e;(e=this._instance.persistence)==null||e.unregister($E)}zr(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=ge(s)?null:parseFloat(s);ge(l)&&this.Ur();var u=i?.minimumDurationMilliseconds;n.register({[ix]:W({enabled:!!i},i,{networkPayloadCapture:W({capturePerformance:e.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:$(u)?null:u,endpoint:i?.endpoint,triggerMatchType:i?.triggerMatchType,masking:i?.masking,urlTriggers:i?.urlTriggers})})};o(),(a=this.jr)==null||a.call(this),this.jr=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.zr(e),this.Mr=!0,this.startIfEnabledOrStop()):this.Mr=!0:ic.info("skipping remote config with no sessionRecording",e)}log(e,a){var r;a===void 0&&(a="log"),(r=this.Or)!=null&&r.log?this.Or.log(e,a):ic.warn("log called before recorder was ready")}get Nr(){var e,a,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(ix);return(r==null||(a=r.scriptConfig)==null?void 0:a.script)||"lazy-recorder"}Lr(e){var a,r;if((a=Q.__PosthogExtensions__)==null||!a.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Or||(this.Or=(r=Q.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.Or._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Or.start(e)}onRRwebEmit(e){var a;(a=this.Or)==null||a.onRRwebEmit==null||a.onRRwebEmit(e)}overrideLinkedFlag(){var e,a;this.Or||(a=this._instance.persistence)==null||a.register({$replay_override_linked_flag:!0}),(e=this.Or)==null||e.overrideLinkedFlag()}overrideSampling(){var e,a;this.Or||(a=this._instance.persistence)==null||a.register({$replay_override_sampling:!0}),(e=this.Or)==null||e.overrideSampling()}overrideTrigger(e){var a,r;this.Or||(r=this._instance.persistence)==null||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(a=this.Or)==null||a.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.Or)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,a){var r;return!((r=this.Or)==null||!r.tryAddCustomEvent(e,a))}},vc={},Rb=()=>{},Ws="posthog",_T=!a4&&ca?.indexOf("MSIE")===-1&&ca?.indexOf("Mozilla")===-1,hE=t=>{var e;return W({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:y3(V?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Rb,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:Nt&&bt(Nt?.search)&&Nt.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_conversations:!1,disable_product_tours:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(E==null||(e=E.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;j.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:_b},error_tracking:{},_onCapture:Rb,__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}:{},external_scripts_inject_target:a&&a>="2026-01-30"?"head":"body",internal_or_test_user_hostname:a&&a>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},mE=t=>{var e={};$(t.process_person)||(e.person_profiles=t.process_person),$(t.xhr_headers)||(e.request_headers=t.xhr_headers),$(t.cookie_name)||(e.persistence_name=t.cookie_name),$(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),$(t.store_google)||(e.save_campaign_params=t.store_google),$(t.verbose)||(e.debug=t.verbose);var a=ut({},e,t);return Ce(t.property_blacklist)&&($(t.property_denylist)?a.property_denylist=t.property_blacklist:Ce(t.property_denylist)?a.property_denylist=[...t.property_blacklist,...t.property_denylist]:j.error("Invalid value for property_denylist config: "+t.property_denylist)),a},Mb=class{constructor(){this.__forceAllowLocalhost=!1}get Hr(){return this.__forceAllowLocalhost}set Hr(e){j.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},dh=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 Mb,this.Br=!1,this.version=pn.LIB_VERSION,this.qr=new Cc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=hE(),this.SentryIntegration=tb,this.sentryIntegration=e=>(function(a,r){var n=iT(a,r);return{name:oT,processEvent:o=>n(o)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Wr=!1,this.Gr=null,this.Vr=null,this.Jr=null,this.featureFlags=new db(this),this.toolbar=new ab(this),this.scrollManager=new Lb(this),this.pageViewManager=new rh(this),this.surveys=new vb(this),this.conversations=new yb(this),this.logs=new xb(this),this.experiments=new Ab(this),this.exceptions=new cb(this),this.rateLimiter=new bb(this),this.requestRouter=new Ib(this),this.consent=new Qx(this),this.externalIntegrations=new Eb(this),this.people={set:(e,a,r)=>{var n=bt(e)?{[e]:a}:e;this.setPersonProperties(n),r?.({})},set_once:(e,a,r)=>{var n=bt(e)?{[e]:a}:e;this.setPersonProperties(void 0,n),r?.({})}},this.on("eventCaptured",(e=>j.info('send "'+e?.event+'"',e)))}init(e,a,r){if(r&&r!==Ws){var n,o=(n=vc[r])!==null&&n!==void 0?n:new t;return o._init(e,a,r),vc[r]=o,vc[Ws][r]=o,o}return this._init(e,a,r)}_init(e,a,r){var n;if(a===void 0&&(a={}),$(e)||Cx(e))return j.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.Kr(a.debug),this.Yr=a,this.Xr=[],a.person_profiles&&(this.Vr=a.person_profiles),this.set_config(ut({},hE(a.defaults),mE(a),{name:r,token:e})),this.config.on_xhr_error&&j.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=a.disable_compression?void 0:gn.GZipJS;var o=this.Qr();this.persistence=new gc(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new gc(W({},this.config,{persistence:"sessionStorage"}),o);var i=W({},this.persistence.props),s=W({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Zr=new Cb((m=>this.ts(m)),this.config.request_queue_config),this.es=new wb(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 uh(this),this.sessionPropsManager=new lh(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(j.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.rs(l)}),0)):(j.info("Initializing extensions synchronously"),this.rs(l)),pn.DEBUG=pn.DEBUG||this.config.debug,pn.DEBUG&&j.info("Starting in debug mode",{this:this,config:a,thisC:W({},this.config),p:i,s}),((n=a.bootstrap)==null?void 0:n.distinctID)!==void 0){var u,c,d=this.config.get_device_id(So()),f=(u=a.bootstrap)!=null&&u.isIdentifiedID?d:a.bootstrap.distinctID;this.persistence.set_property(hn,(c=a.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:f})}if(this.ss()){var h,S,x=Object.keys(((h=a.bootstrap)==null?void 0:h.featureFlags)||{}).filter((m=>{var y;return!((y=a.bootstrap)==null||(y=y.featureFlags)==null||!y[m])})).reduce(((m,y)=>{var v;return m[y]=((v=a.bootstrap)==null||(v=v.featureFlags)==null?void 0:v[y])||!1,m}),{}),b=Object.keys(((S=a.bootstrap)==null?void 0:S.featureFlagPayloads)||{}).filter((m=>x[m])).reduce(((m,y)=>{var v,C;return(v=a.bootstrap)!=null&&(v=v.featureFlagPayloads)!=null&&v[y]&&(m[y]=(C=a.bootstrap)==null||(C=C.featureFlagPayloads)==null?void 0:C[y]),m}),{});this.featureFlags.receivedFeatureFlags({featureFlags:x,featureFlagPayloads:b})}if(l)this.register_once({distinct_id:Qu,$device_id:null},"");else if(!this.get_distinct_id()){var g=this.config.get_device_id(So());this.register_once({distinct_id:g,$device_id:g},""),this.persistence.set_property(hn,"anonymous")}return mt(E,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),a.segment?U3(this,(()=>this.ns())):this.ns(),_o(this.config._onCapture)&&this.config._onCapture!==Rb&&(j.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(m=>this.config._onCapture(m.event,m)))),this.config.ip&&j.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}rs(e){var a=performance.now();this.historyAutocapture=new eb(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new rb(this).startIfEnabledOrStop()})),r.push((()=>{var n;this.siteApps=new kb(this),(n=this.siteApps)==null||n.init()})),e||r.push((()=>{this.sessionRecording=new ch(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Zx(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.logs.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new fb(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new ob(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new nb(this)})),r.push((()=>{this.exceptionObserver=new Jx(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new ah(this,H3),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.os){var n=this.os;this.os=void 0,this.yi(n)}})),this.ls(r,a)}ls(e,a){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-a>=30&&e.length>0)return void setTimeout((()=>{this.ls(e,a)}),0);var r=e.shift();if(r)try{r()}catch(o){j.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&&j.info("PostHog extensions initialized ("+n+"ms)")}yi(e){var a,r,n,o,i,s,l,u,c;if(!V||!V.body)return j.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.yi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.os=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=he(e.supportedCompression,gn.GZipJS)?gn.GZipJS:he(e.supportedCompression,gn.Base64)?gn.Base64:void 0),(a=e.analytics)!=null&&a.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Vr?this.Vr:"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),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),(s=this.productTours)==null||s.onRemoteConfig(e),(l=this.webVitalsAutocapture)==null||l.onRemoteConfig(e),(u=this.exceptionObserver)==null||u.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}ns(){try{this.config.loaded(this)}catch(r){j.critical("`loaded` function failed",r)}if(this.us(),this.config.internal_or_test_user_hostname&&Nt!=null&&Nt.hostname){var e=Nt.hostname,a=this.config.internal_or_test_user_hostname;(typeof a=="string"?e===a:a.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.hs()}),1),new Sb(this).load(),this.featureFlags.flags()}us(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Zr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Co(this.__request_queue,(e=>this.ts(e))),this.__request_queue=[],this.us()}_handle_unload(){var e,a;this.surveys.handlePageUnload(),this.config.request_batching?(this.ds()&&this.capture("$pageleave"),(e=this.Zr)==null||e.unload(),(a=this.es)==null||a.unload()):this.ds()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(_T?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=ih(e.url,{ip:this.config.ip?1:0}),e.headers=W({},this.config.request_headers,e.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=W({},a);i.timeout=i.timeout||6e4,i.url=ih(i.url,{_:new Date().getTime().toString(),ver:pn.LIB_VERSION,compression:i.compression});var s=(r=i.transport)!==null&&r!==void 0?r:"fetch",l=Vp.filter((c=>!i.disableTransport||!c.transport||!i.disableTransport.includes(c.transport))),u=(n=(o=zE(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)})(W({},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)}}))))}ts(e){this.es?this.es.retriableRequest(e):this._send_request(e)}_execute_array(e){var a,r=[],n=[],o=[];Co(e,(s=>{s&&(a=s[0],Ce(a)?o.push(s):_o(s)?s.call(this):Ce(s)&&a==="alias"?r.push(s):Ce(s)&&a.indexOf("capture")!==-1&&_o(this[a])?o.push(s):n.push(s))}));var i=function(s,l){Co(s,(function(u){if(Ce(u[0])){var c=l;Fe(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)}ss(){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.Zr){if(this.is_capturing())if(!$(e)&&bt(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&&!bt(a?.$current_url)&&(j.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=So(),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,f=e!=="$groupidentify",h=this.vs(r?.$set_once,f);if(h&&(c.$set_once=h),(c=g3(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,$(r?.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s),e===pc.DISMISSED||e===pc.SENT){var S=a?.[yx.SURVEY_ID],x=a?.[yx.SURVEY_ITERATION];d={id:S,current_iteration:x},localStorage.getItem(dE(d))||localStorage.setItem(dE(d),"true"),c.$set=W({},c.$set,{[i4({id:S,current_iteration:x},e===pc.SENT?"responded":"dismissed")]:!0})}else e===pc.SHOWN&&(c.$set=W({},c.$set,{[yx.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var b=W({},c.properties.$set,c.$set);if(Xs(b)||this.setPersonPropertiesForFlags(b),!ge(this.config.before_send)){var g=this.cs(c);if(!g)return;c=g}this.qr.emit("eventCaptured",c);var m={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.ts(m):this.Zr.enqueue(m),c}j.critical("This capture call is ignored due to client rate limiting.")}}else j.error("No event name provided to posthog.capture")}else j.uninitializedWarning("posthog.capture")}_addCaptureHook(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=W({},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=W({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!bt(s.distinct_id)&&!xn(s.distinct_id)||Cx(s.distinct_id))&&j.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,c=G3(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());s.$session_id=d,s.$window_id=f}this.sessionPropsManager&&ut(s,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&ut(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(h=this.es)==null?void 0:h.length}catch(g){s.$sdk_debug_error_capturing_properties=String(g)}if(this.requestRouter.region===hc.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=ut(s,u),e==="$pageview"&&V&&(s.title=V.title),!$(i)){var S=r.getTime()-i;s.$duration=parseFloat((S/1e3).toFixed(3))}ca&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=ut({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Ce(this.config.property_denylist)?Fe(this.config.property_denylist,(function(g){delete s[g]})):j.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var x=this.config.sanitize_properties;x&&(j.error("sanitize_properties is deprecated. Use before_send instead"),s=x(s,e));var b=this.fs();return s.$process_person_profile=b,b&&!o&&this.ps("_calculate_event_properties"),s}vs(e,a){var r;if(a===void 0&&(a=!0),!this.persistence||!this.fs()||this.Br)return e;var n=this.persistence.get_initial_props(),o=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),i=ut({},n,o||{},e||{}),s=this.config.sanitize_properties;return s&&(j.error("sanitize_properties is deprecated. Use before_send instead"),i=s(i,"$set_once")),a&&(this.Br=!0),Xs(i)?void 0:i}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)}gs(e,a){this.register({[e]:a})}getFeatureFlag(e,a){return this.featureFlags.getFeatureFlag(e,a)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,a){return this.featureFlags.getFeatureFlagResult(e,a)}isFeatureEnabled(e,a){return this.featureFlags.isFeatureEnabled(e,a)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,a,r){var n=r!=null&&r.merge?this.featureFlags.getFlagVariants():{},o=r!=null&&r.merge?this.featureFlags.getFlagPayloads():{},i=W({},n,e),s=W({},o,a),l={};for(var[u,c]of Object.entries(i)){var d=typeof c=="string";l[u]={key:u,enabled:!!d||!!c,variant:d?c:void 0,reason:void 0,metadata:$(s?.[u])?void 0:{id:0,version:void 0,description:void 0,payload:s[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}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.qr.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=l4),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 j.uninitializedWarning("posthog.identify");if(xn(e)&&(e=e.toString(),j.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()))j.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!==Qu){if(this.ps("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(lc)&&(this.unregister(lc),this.register({distinct_id:e}));var i=(this.persistence.get_property(hn)||"anonymous")==="anonymous";e!==n&&i?(this.persistence.set_property(hn,"identified"),this.setPersonPropertiesForFlags(W({},r||{},a||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:a||{},$set_once:r||{}}),this.Jr=oE(e,a,r),this.featureFlags.setAnonymousDistinctId(n)):(a||r)&&this.setPersonProperties(a,r),e!==n&&(this.reloadFeatureFlags(),this.unregister(Zp))}}else j.critical('The string "'+Qu+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else j.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,a){if((e||a)&&this.ps("posthog.setPersonProperties")){var r=oE(this.get_distinct_id(),e,a);this.Jr!==r?(this.setPersonPropertiesForFlags(W({},a||{},e||{})),this.capture("$set",{$set:e||{},$set_once:a||{}}),this.Jr=r):j.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,a,r){if(e&&a){var n=this.getGroups();n[e]!==a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:W({},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 j.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.ps("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,a)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var a,r,n,o;if(j.info("reset"),!this.__loaded)return j.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(hn,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Jr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Qu,$device_id:null},"");else{var s=this.config.get_device_id(So());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(qE)?(j.critical("Attempting to create alias for existing People user - aborting."),-2):this.ps("posthog.alias")?($(a)&&(a=this.get_distinct_id()),e!==a?(this.gs(lc,e),this.capture("$create_alias",{alias:e,distinct_id:a})):(j.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var a=W({},this.config);if(xt(e)){var r,n,o,i,s,l,u;ut(this.config,mE(e));var c=this.Qr();(r=this.persistence)==null||r.update_config(this.config,a,c),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new gc(W({},this.config,{persistence:"sessionStorage"}),c);var d=this.Kr(this.config.debug);yn(d)&&(this.config.debug=d),yn(this.config.debug)&&(this.config.debug?(pn.DEBUG=!0,et.H()&&et.G("ph_debug","true"),j.info("set_config",{config:e,oldConfig:a,newConfig:W({},this.config)})):(pn.DEBUG=!1,et.H()&&et.V("ph_debug"))),(n=this.exceptionObserver)==null||n.onConfigChange(),(o=this.sessionRecording)==null||o.startIfEnabledOrStop(),(i=this.autocapture)==null||i.startIfEnabled(),(s=this.heatmaps)==null||s.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this._s(),(u=this.externalIntegrations)==null||u.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(W({},n,a))}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}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:Ws;return a!==Ws&&(a=Ws+"."+a),a}_isIdentified(){var e,a;return((e=this.persistence)==null?void 0:e.get_property(hn))==="identified"||((a=this.sessionPersistence)==null?void 0:a.get_property(hn))==="identified"}fs(){var e,a;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Xs(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[lc])&&((a=this.persistence)==null||(a=a.props)==null||!a[Kp]))}ds(){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.fs()||this.ps("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ps("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ps(e){return this.config.person_profiles==="never"?(j.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.gs(Kp,!0),!0)}Qr(){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}_s(){var e,a,r,n,o=this.Qr();return((e=this.persistence)==null?void 0:e.ki)!==o&&((r=this.persistence)==null||r.set_disabled(o)),((a=this.sessionPersistence)==null?void 0:a.ki)!==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,o;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=new uh(this),this.pageViewManager=new rh(this),this.persistence&&(this.sessionPropsManager=new lh(this,this.sessionManager,this.persistence)),this.sessionRecording=new ch(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this._s(),this.us(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),($(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((o=e?.captureEventName)!==null&&o!==void 0?o:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.hs()}else j.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,a,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._s(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Qu,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(a=this.pageViewManager)==null||a.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.hs())):j.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===mn.GRANTED?"granted":e===mn.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._s()}_is_bot(){return Ia?ST(Ia,this.config.custom_blocked_useragents):void 0}hs(){V&&(V.visibilityState==="visible"?this.Wr||(this.Wr=!0,this.capture("$pageview",{title:V.title},{send_instantly:!0}),this.Gr&&(V.removeEventListener("visibilitychange",this.Gr),this.Gr=null)):this.Gr||(this.Gr=this.hs.bind(this),mt(V,"visibilitychange",this.Gr)))}debug(e){e===!1?(E?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(E?.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}))}M(){var e,a,r,n,o,i,s,l=this.Yr||{};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?(j.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=j,i=(a="advanced_disable_flags")in(e=l)&&!ge(e[a]),s=r in e&&!ge(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)}cs(e){if(ge(this.config.before_send))return e;var a=Ce(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of a){if(r=n(r),ge(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return VH(e.event)?j.warn(o+". This can cause unexpected behavior."):j.info(o),null}r.properties&&!Xs(r.properties)||j.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.Kt)==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)})}Kr(e){var a=yn(e)&&!e,r=et.H()&&et.q("ph_debug")==="true";return!a&&(!!r||e)}};(function(t,e){for(var a=0;a<e.length;a++)t.prototype[e[a]]=m3(t.prototype[e[a]])})(dh,["identify"]);var gE;var CT=(gE=vc[Ws]=new dh,(function(){function t(){t.done||(t.done=!0,_T=!1,Fe(vc,(function(e){e._dom_loaded()})))}V!=null&&V.addEventListener?V.readyState==="complete"?t():mt(V,"DOMContentLoaded",t,{capture:!1}):E&&j.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),gE);var Vb=class{constructor(e={}){this.options=e;D(this,"client");D(this,"featureFlagsCallback");D(this,"captureCallback");D(this,"rrwebCallback");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,this.rrwebCallback=e.onRRWebEvent,!this.client&&e.consent&&e.requireExplicitConsent&&typeof window<"u"&&e.apiKey){let a=e.consent;a.getStatus()==="granted"&&this.initPostHog(),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"}`,i={api_host:`${(e.apiHost??"https://telemetry.syntrologie.com").replace(/\/$/,"")}/t/${e.apiKey}`,advanced_disable_feature_flags:!a,advanced_disable_feature_flags_on_first_load:!a,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??"history_change",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},s=CT.init(e.apiKey,i,r);if(s&&(this.client=s),this.captureCallback&&this.client&&this.client.on("eventCaptured",(...l)=>{let u=l[0],c=typeof u=="string"?u:u?.event,d=typeof u=="string"?void 0:u?.properties;typeof c=="string"&&this.captureCallback?.(c,d)}),a&&this.featureFlagsCallback&&this.client){this.client.onFeatureFlags(()=>{let u=this.getAllFeatureFlags();u&&this.featureFlagsCallback&&this.featureFlagsCallback(u)});let l=this.getAllFeatureFlags();l&&Object.keys(l).length>0&&this.featureFlagsCallback(l)}this.rrwebCallback&&this.client&&this.setupRRWebIntercept()}setupRRWebIntercept(e=30){let a=this.client?.sessionRecording;if(!a){e>0&&setTimeout(()=>this.setupRRWebIntercept(e-1),500);return}let r=null,n=a;for(let i of Object.getOwnPropertyNames(n)){let s=n[i];if(s&&typeof s=="object"&&typeof s.onRRwebEmit=="function"&&typeof s.start=="function"&&s!==a){r=s;break}}if(!r){e>0&&setTimeout(()=>this.setupRRWebIntercept(e-1),500);return}let o=r.onRRwebEmit.bind(r);r.onRRwebEmit=i=>{this.rrwebCallback?.({kind:"rrweb",...i}),o(i)},typeof window<"u"&&(window.__RRWEB_INTERCEPT_READY__=!0)}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 $b(t={}){return new Vb(t)}var Ic=class{constructor(e,a){D(this,"telemetry");D(this,"variantId");D(this,"seenSet",new Set);D(this,"triggeredSet",new Set);this.telemetry=e,this.variantId=a}trackServed(e,a){this.telemetry.track?.("syntro_config_served",{variant_id:this.variantId,tiles:e,actions:a})}trackSeen(e,a){this.seenSet.has(e)||(this.seenSet.add(e),this.telemetry.track?.("syntro_intervention_seen",{variant_id:this.variantId,intervention_id:e,intervention_kind:a}))}trackTriggered(e,a){this.triggeredSet.has(e)||(this.triggeredSet.add(e),this.telemetry.track?.("syntro_intervention_triggered",{variant_id:this.variantId,intervention_id:e,intervention_kind:a}))}trackInteracted(e,a,r){this.telemetry.track?.("syntro_intervention_interacted",{variant_id:this.variantId,intervention_id:e,intervention_kind:a,interaction_type:r})}resetPage(){this.seenSet.clear(),this.triggeredSet.clear()}};var jb=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{}}}},Gb=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{}}}},Wb=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 mh=class{constructor(){D(this,"executors",new Map);for(let{kind:e,executor:a}of xv)this.registerCore(e,a);for(let{kind:e,executor:a}of Rv)this.registerCore(e,a);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",jb),this.registerCore("core:parallel",Gb),this.registerCore("core:wait",Wb)}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)}},bn=new mh;function m4(t){return bn.get(t)}function Zb(t){return bn.has(t)}function Xb(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 Kb(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 Yb(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>gh&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${gh}`,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 Qb(t,e,a){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function Jb(t,e,a){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(u0.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 e0(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 t0(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>vh&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${r}). Maximum is ${vh}`,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 a0(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 r0(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 n0(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=Er(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 o0(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=Er(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 i0(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 s0(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 l0(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=Er(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`})}}var u0=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),gh=5e4,vh=50;function Er(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(!Zb(r)&&r!=="core:mountWidget"){let n=bn.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":Sn(t,e,a);break;case"overlays:badge":Sn(t,e,a),Xb(t,e,a);break;case"overlays:tooltip":Sn(t,e,a),Kb(t,e,a);break;case"overlays:modal":s0(t,e,a);break;case"content:insertHtml":Sn(t,e,a),Yb(t,e,a);break;case"content:setText":Sn(t,e,a),Qb(t,e,a);break;case"content:setAttr":Sn(t,e,a),Jb(t,e,a);break;case"content:addClass":case"content:removeClass":Sn(t,e,a),e0(t,e,a);break;case"content:setStyle":Sn(t,e,a),t0(t,e,a);break;case"core:mountWidget":a0(t,e,a);break;case"core:wait":r0(t,e,a);break;case"core:sequence":n0(t,e,a);break;case"core:parallel":o0(t,e,a);break;case"overlays:tour":l0(t,e,a);break;case"navigation:navigate":i0(t,e,a);break}return{valid:e.length===0,errors:e,warnings:a}}function Sn(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 yh(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=Er(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 g4=0;function c0(t){let{overlayRoot:e,eventBus:a,surfaces:r,anchorResolver:n,waitForAnchor:o,adaptiveId:i,executorRegistry:s=bn,subscribeNavigation:l,runtime:u}=t,c=new Map,d=new Map;function f(){return`action-${++g4}`}function h(_,L){a&&a.publish(_,L)}function S(){return{overlayRoot:e,resolveAnchor:n,waitForAnchor:o,generateId:f,publishEvent:h,adaptiveId:i,applyAction:m,subscribeEvent:a?(_,L)=>a.subscribe({names:[_]},I=>L(I.props)):void 0,subscribeNavigation:l}}async function x(_,L){if(!r)throw new Error("Surfaces provider required for core:mountWidget actions");let I=r.mount(_.slot,{type:"widget",widgetId:_.widget.widgetId,config:_.widget.props},{priority:_.widget.priority});return L.publishEvent("action.applied",{id:L.generateId(),kind:"core:mountWidget",slot:_.slot,widgetId:_.widget.widgetId}),{cleanup:()=>{I.unmount()},updateFn:A=>{if("widget"in A&&A.widget){let T=A.widget;T.props&&I.update({type:"widget",widgetId:_.widget.widgetId,config:T.props})}}}}async function b(_,L){if(_.kind==="core:mountWidget")return x(_,L);let I=s.get(_.kind);if(!I){let A="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${_.kind}".`,`Registered: [${A}]`),new Error(`No executor for action kind: ${_.kind}`)}return I(_,L)}function g(_,L,I,A){if(!u)return;let T=[],N=async()=>{let B=c.get(_);if(!B)return;let H=u.evaluateSync(I).value;if(B.state==="applied"&&!H){try{await B.cleanup()}catch(R){console.error(`[ActionEngine] Error reverting conditional action ${_}:`,R)}B.state="deferred",B.cleanup=()=>{},B.updateFn=void 0,h("action.deferred",{id:_,kind:L.kind})}else if(B.state==="deferred"&&H)try{let R=S(),z=await b(L,R);B.state="applied",B.cleanup=z.cleanup,B.updateFn=z.updateFn,B.appliedTs=Date.now(),h("action.applied",{id:_,kind:L.kind,anchorId:"anchorId"in L?L.anchorId:void 0})}catch(R){console.error(`[ActionEngine] Error applying deferred action ${_}:`,R),B.state="failed"}};u.context&&T.push(u.context.subscribe(N)),u.accumulator&&T.push(u.accumulator.subscribe(N)),d.set(_,T)}async function m(_){let L=Er(_);if(!L.valid){let H=L.errors.map(R=>R.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${_?.kind}":`,H,_),new Error(`Action validation failed: ${H}`)}let I=f(),A=_.triggerWhen;if(A&&u&&!u.evaluateSync(A).value){let R={id:I,action:_,adaptiveId:i,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};c.set(I,R);let z={id:I,action:_,async revert(){let M=c.get(I);if(!M)return;let U=d.get(I);if(U){for(let ue of U)ue();d.delete(I)}M.state="reverted",c.delete(I)},isApplied(){return c.get(I)?.state==="applied"},async update(M){let U=c.get(I);if(!U||U.state!=="applied")throw new Error("Cannot update action that is not applied");if(U.updateFn)await U.updateFn(M);else throw new Error(`Action kind ${_.kind} does not support updates`)},getState(){return c.get(I)?.state??"reverted"}};return g(I,_,A,z),z}let T=S(),N=await b(_,T),B={id:I,action:_,adaptiveId:i,appliedTs:Date.now(),state:"applied",cleanup:N.cleanup,updateFn:N.updateFn};c.set(I,B),h("action.applied",{id:I,kind:_.kind,anchorId:"anchorId"in _?_.anchorId:void 0});let F={id:I,action:_,async revert(){let H=c.get(I);if(!H||H.state!=="applied")return;let R=d.get(I);if(R){for(let z of R)z();d.delete(I)}try{await H.cleanup(),H.state="reverted",h("action.reverted",{id:I,kind:_.kind})}catch(z){console.warn(`[ActionEngine] Cleanup error for ${_.kind} (${I}), ignoring:`,z),H.state="reverted",h("action.reverted",{id:I,kind:_.kind})}finally{c.delete(I)}},isApplied(){return c.get(I)?.state==="applied"},async update(H){let R=c.get(I);if(!R||R.state!=="applied")throw new Error("Cannot update action that is not applied");if(R.updateFn)await R.updateFn(H);else throw new Error(`Action kind ${_.kind} does not support updates`)},getState(){return c.get(I)?.state??"reverted"}};return A&&u&&g(I,_,A,F),F}async function y(_){console.log(`[ActionEngine] applyBatch: ${_.length} action(s)`,_.map(B=>B.kind).join(", "));let L=yh(_);if(!L.valid){let B=L.errors.map(F=>F.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${_.length} action(s):`,B,`
|
|
502
|
+
Actions:`,_.map((F,H)=>` [${H}] ${F.kind} ${F.anchorId?`anchor="${F.anchorId.selector}"`:""} ${F.label?`label="${F.label}"`:""}`).join(`
|
|
503
|
+
`)),new Error(`Batch validation failed: ${B}`)}let I=f(),A=[],T=[];try{let B=await Promise.allSettled(_.map(H=>m(H))),F=[];for(let H of B)H.status==="fulfilled"?(A.push(H.value),T.push(H.value)):F.push(H.reason instanceof Error?H.reason:new Error(String(H.reason)));if(F.length>0&&T.length===0)throw F[0];F.length>0&&console.warn(`[ActionEngine] ${F.length}/${_.length} action(s) failed in batch:`,F.map(H=>H.message).join("; "))}catch(B){console.error(`[ActionEngine] Batch apply FAILED. Successfully applied: ${T.length}. Rolling back...`,B);for(let F of T)try{await F.revert()}catch{}throw B}return{id:I,handles:A,async revertAll(){for(let B=A.length-1;B>=0;B--)try{await A[B].revert()}catch(F){console.error(`[ActionEngine] Error reverting action ${A[B].id}:`,F)}},isApplied(){return A.every(B=>B.isApplied())}}}function v(_){return Er(_)}function C(){return Array.from(c.values()).map(_=>({id:_.id,action:_.action,adaptiveId:_.adaptiveId,appliedTs:_.appliedTs,state:_.state}))}async function w(){for(let L of d.values())for(let I of L)try{I()}catch{}d.clear();let _=[];for(let L of c.values())if(L.state==="applied")try{let I=L.cleanup();I&&typeof I.then=="function"&&_.push(I.catch(A=>{console.error("[ActionEngine] Error during async cleanup:",A)}))}catch(I){console.error("[ActionEngine] Error during cleanup:",I)}c.clear(),_.length>0&&await Promise.all(_)}return{apply:m,applyBatch:y,validate:v,getActive:C,destroy:w}}var v4=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),wT=["ui.click","ui.scroll","ui.input","ui.change","ui.submit","ui.hover","ui.idle","ui.scroll_thrash","ui.focus_bounce","nav.page_view","nav.page_leave","behavior.rage_click","behavior.hesitation","behavior.confusion"],LT=p.enum(wT).describe("Event name to count. ui.* = user interactions and behavioral detectors, nav.* = page navigation, behavior.* = derived behavioral signals."),kT=["time_on_page","page_views","scroll_depth"],IT=p.enum(kT).describe("Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.");var d0=p.object({type:p.literal("page_url"),url:p.string().describe('URL path to match (e.g. "/pricing", "/dashboard")')}).describe('Fires when the current page URL matches. Use for page-specific actions. Example: {"type": "page_url", "url": "/pricing"}'),f0=p.object({type:p.literal("route"),routeId:p.string().describe("Named route ID from the route filter")}).describe("Fires when the current route matches a named route ID."),p0=p.object({type:p.literal("anchor_visible"),anchorId:p.string().describe("CSS selector of the anchor element"),state:p.enum(["visible","present","absent"]).describe('"visible" = in viewport, "present" = in DOM, "absent" = not in DOM')}).describe(`Fires based on a DOM element's visibility state. Example: {"type": "anchor_visible", "anchorId": "#cta-button", "state": "visible"}`),h0=p.object({type:p.literal("event_occurred"),eventName:p.string().describe('Event name (e.g. "ui.click", "$pageview")'),withinMs:p.number().optional().describe("Time window in ms. Omit = any time this session.")}).describe('Fires when a specific event has occurred during this session. Example: {"type": "event_occurred", "eventName": "ui.click", "withinMs": 5000}'),m0=p.object({type:p.literal("state_equals"),key:p.string().describe("Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set()."),value:p.unknown().describe("Expected value to match against")}).describe("Checks the SDK persistent state store (localStorage). ONLY for host-app state set via syntro.state.set() \u2014 NOT for user attributes like region, device, or UTM params (those are handled by segment targeting). Do NOT use this for targeting. If you do not know the valid state keys, do not use this condition type."),g0=p.object({type:p.literal("viewport"),minWidth:p.number().optional().describe("Minimum viewport width in pixels"),maxWidth:p.number().optional().describe("Maximum viewport width in pixels"),minHeight:p.number().optional().describe("Minimum viewport height in pixels"),maxHeight:p.number().optional().describe("Maximum viewport height in pixels")}).describe('Fires based on viewport (screen) size. Use for responsive behavior. Example: {"type": "viewport", "minWidth": 768} \u2014 fires on tablet and larger.'),v0=p.object({type:p.literal("session_metric"),key:IT,operator:p.enum(["gte","lte","eq","gt","lt"]),threshold:p.number().describe("Numeric threshold to compare against")}).describe('Fires when a session metric crosses a threshold. Valid keys: "time_on_page" (seconds), "page_views" (count), "scroll_depth" (0-100). Example: {"type": "session_metric", "key": "time_on_page", "operator": "gte", "threshold": 30}'),y0=p.object({type:p.literal("dismissed"),key:p.string().describe("Dismissal key (usually a tile or action ID)"),inverted:p.boolean().optional().describe("When true, fires if NOT dismissed (default behavior)")}).describe("Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed."),x0=p.object({type:p.literal("cooldown_active"),key:p.string().describe("Cooldown key"),inverted:p.boolean().optional().describe("When true, fires if cooldown is NOT active")}).describe("Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently."),b0=p.object({type:p.literal("frequency_limit"),key:p.string().describe("Frequency counter key"),limit:p.number().describe("Maximum allowed count"),inverted:p.boolean().optional().describe("When true, fires if limit NOT reached")}).describe("Checks if a frequency limit has been reached. Use to cap how many times an action fires per session."),Ac=p.object({equals:p.union([p.string(),p.number(),p.boolean()]).optional(),contains:p.string().optional()}).describe("Match operator for counter filters. Exactly one of equals or contains must be specified."),Ec=p.object({events:p.array(LT).min(1).describe("Event names to count. Use values from the countable events enum."),match:p.record(p.string(),Ac).optional().describe("Property filters. Keys are event prop names or element-chain fields (tag_name, $el_text, attr__*). All entries AND together.")}).describe("Defines what events to count. Registered as an accumulator predicate at config-load time."),S0=p.object({type:p.literal("event_count"),key:p.string().describe("Unique key for this counter (used for accumulator registration)"),operator:p.enum(["gte","lte","eq","gt","lt"]),count:p.number().int().min(0).describe("Target count threshold"),withinMs:p.number().positive().optional().describe("Time window in ms. Omit = count across entire session."),counter:Ec.optional().describe("Inline counter definition. Defines what events to count.")}).describe('Fires when accumulated event count crosses a threshold. Most powerful trigger type. Example: {"type": "event_count", "key": "pricing-clicks", "operator": "gte", "count": 3, "counter": {"events": ["ui.click"], "match": {"attr__data-cta": {"contains": "pricing"}}}}'),Lo=p.discriminatedUnion("type",[d0,f0,p0,h0,m0,g0,v0,y0,x0,b0,S0]),Tc=p.object({conditions:p.array(Lo).describe("Array of conditions \u2014 ALL must match (AND logic) for this rule to fire."),value:p.unknown().describe("Value returned when all conditions match. For triggerWhen: true = fire the action.")}).describe("A single rule. ALL conditions must match (AND logic). Rules in a strategy are evaluated top-to-bottom \u2014 first rule where all conditions match wins and returns its value."),Rc=p.object({type:p.literal("rules"),rules:p.array(Tc).describe("Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins."),default:p.unknown().describe("Fallback value when no rule matches. For triggerWhen: false = do not fire by default.")}).describe("Rule-based strategy. Evaluates rules top-to-bottom. First rule where ALL conditions match returns its value. If no rule matches, returns default. For triggerWhen: set value=true on matching rules, default=false."),Mc=p.object({type:p.literal("score"),field:p.string(),threshold:p.number(),above:p.unknown(),below:p.unknown()}).describe("Score-based strategy. Compares a field value against a threshold."),Oc=p.object({type:p.literal("model"),modelId:p.string(),inputs:p.array(p.string()),outputMapping:p.record(p.string(),p.unknown()),default:p.unknown()}).describe("ML model strategy. Sends inputs to a model and maps outputs."),Dc=p.object({type:p.literal("external"),endpoint:p.string(),method:p.enum(["GET","POST"]).optional(),default:p.unknown(),timeoutMs:p.number().optional()}).describe("External API strategy. Calls an endpoint to determine the value."),Bc=p.discriminatedUnion("type",[Rc,Mc,Oc,Dc]),xh=Bc.nullable().optional();var y4=p.object({events:p.array(p.string()),urlContains:p.string().optional(),props:p.record(p.union([p.string(),p.number(),p.boolean()])).optional()}),x4=p.object({title:p.string().optional(),body:p.string().optional(),icon:p.string().optional()}).nullable().optional();var AT=p.object({include:p.array(p.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:p.array(p.string()).optional().describe("URL patterns where this tile should NOT appear. Evaluated before include.")}),bh=p.object({routes:AT,onlyIfPopulated:p.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 b9(t){return Lo.safeParse(t)}function S9(t){return Bc.safeParse(t)}function _9(t){return bh.safeParse(t)}var C9=[{defName:"matchOp",schema:Ac},{defName:"counterDef",schema:Ec},{defName:"activationConfig",schema:bh},{defName:"routeFilter",schema:AT},{defName:"ruleStrategy",schema:Rc},{defName:"scoreStrategy",schema:Mc},{defName:"modelStrategy",schema:Oc},{defName:"externalStrategy",schema:Dc},{defName:"rule",schema:Tc},{defName:"condition",schema:Lo}];var _0=p.object({tileId:p.string(),itemId:p.string().optional()}).strict(),b4=p.object({on:p.string(),title:p.string(),body:p.string().optional(),icon:p.string().optional(),ttl:p.number().optional(),cooldown:p.number().optional(),deepLink:_0.optional()}).strict(),S4=p.object({id:p.string(),title:p.string().optional(),subtitle:p.string().optional(),icon:p.string().optional(),priority:p.number().optional(),widget:p.string(),props:p.record(p.unknown()).optional(),activation:bh.optional(),notifications:p.array(b4).optional()}).strict(),_4=p.object({position:p.enum(["left","right"]).optional(),layout:p.enum(["overlay","push"]).optional(),background:p.string().optional(),blur:p.string().optional(),border:p.string().optional(),width:p.string().optional(),transitionDuration:p.string().optional(),transitionEasing:p.string().optional(),transitionFade:p.string().optional()}),C4=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),color:p.string().optional(),size:p.string().optional(),shadow:p.string().optional(),borderRadius:p.string().optional(),icon:p.string().optional()}),w4=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),shadow:p.string().optional(),titleColor:p.string().optional(),textColor:p.string().optional(),iconBackground:p.string().optional(),iconShadow:p.string().optional(),headerPadding:p.string().optional(),bodyPadding:p.string().optional(),gap:p.string().optional()}),L4=p.object({background:p.string().optional(),textColor:p.string().optional(),titleColor:p.string().optional(),arrowColor:p.string().optional(),arrowSize:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),scrimOpacity:p.string().optional(),highlightRing:p.string().optional()}),k4=p.object({background:p.string().optional(),textColor:p.string().optional(),textSecondaryColor:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),successColor:p.string().optional(),warningColor:p.string().optional(),errorColor:p.string().optional(),iconBackground:p.string().optional(),progressGradient:p.string().optional()}),I4=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),textColor:p.string().optional(),textSecondaryColor:p.string().optional(),itemDivider:p.string().optional(),itemGap:p.string().optional(),itemPadding:p.string().optional(),itemFontSize:p.string().optional(),bodyPadding:p.string().optional(),bodyFontSize:p.string().optional(),categoryPadding:p.string().optional(),categoryGap:p.string().optional(),categoryFontSize:p.string().optional(),searchBackground:p.string().optional(),searchColor:p.string().optional(),chevronColor:p.string().optional()}),A4=p.object({mode:p.enum(["dark","light"]).optional(),fontFamily:p.string().optional(),colorPrimary:p.string().optional(),colorPrimaryHover:p.string().optional(),borderRadius:p.string().optional(),canvas:_4.optional(),launcher:C4.optional(),tile:w4.optional(),overlay:L4.optional(),notification:k4.optional(),content:I4.optional()}).strict(),E4=p.object({enabled:p.boolean().optional(),label:p.string().optional(),position:p.string().optional(),animate:p.boolean().optional(),animationStyle:p.enum(["pulse","bounce","glow"]).optional(),notificationCount:p.number().optional()}).strict(),A9=p.object({schemaVersion:p.string().optional(),fetchedAt:p.string().datetime(),configVersion:p.string().optional(),canvasTitle:p.string().optional(),tiles:p.array(S4),actions:p.array(p.any()),theme:A4.optional(),launcher:E4.optional(),meta:p.object({verificationSteps:p.array(p.union([p.string(),p.object({text:p.string(),check:Lo.optional()})])).optional()}).passthrough().optional()}).strict();var Lt={triggerWhen:xh},Wa=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),ET=p.object({color:p.string().optional(),scrimOpacity:p.number().min(0).max(1).optional(),paddingPx:p.number().optional(),radiusPx:p.number().optional()}).strict(),TT=p.enum(["top-left","top-right","bottom-left","bottom-right"]),RT=p.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),w0=p.object({label:p.string(),actionId:p.string(),primary:p.boolean().optional()}).strict(),MT=p.object({title:p.string().optional(),body:p.string(),ctaButtons:p.array(w0).optional()}).strict(),OT=p.object({title:p.string().optional(),body:p.string()}).strict(),DT=p.enum(["before","after","prepend","append","replace"]),BT=p.enum(["immediate","hover","click"]),PT=p.object({widgetId:p.string(),props:p.record(p.unknown()).optional(),priority:p.number().optional()}).strict(),NT=p.object({id:p.string(),action:p.any(),route:p.string().optional(),onAction:p.record(p.string()).optional()}).passthrough(),FT=p.enum(["auto","smooth","instant"]),C0=p.enum(["start","center","end","nearest"]),HT=p.object({kind:p.literal("content:setText"),anchorId:Wa,text:p.string(),label:p.string().optional()}).extend(Lt).strict(),UT=p.object({kind:p.literal("content:setAttr"),anchorId:Wa,attr:p.string(),value:p.string(),label:p.string().optional()}).extend(Lt).strict(),zT=p.object({kind:p.literal("content:addClass"),anchorId:Wa,className:p.string(),label:p.string().optional()}).extend(Lt).strict(),qT=p.object({kind:p.literal("content:removeClass"),anchorId:Wa,className:p.string(),label:p.string().optional()}).extend(Lt).strict(),VT=p.object({kind:p.literal("content:setStyle"),anchorId:Wa,styles:p.record(p.string()),label:p.string().optional()}).extend(Lt).strict(),$T=p.object({kind:p.literal("content:insertHtml"),anchorId:Wa,html:p.string(),position:DT,deepLink:_0.optional(),label:p.string().optional()}).extend(Lt).strict(),jT=p.object({kind:p.literal("overlays:highlight"),anchorId:Wa,style:ET.optional(),duration:p.number().optional(),label:p.string().optional()}).extend(Lt).strict(),GT=p.object({kind:p.literal("overlays:pulse"),anchorId:Wa,duration:p.number().optional(),label:p.string().optional()}).extend(Lt).strict(),WT=p.object({kind:p.literal("overlays:badge"),anchorId:Wa,content:p.string(),position:TT.optional(),label:p.string().optional()}).extend(Lt).strict(),ZT=p.object({kind:p.literal("overlays:tooltip"),anchorId:Wa,content:MT,trigger:BT.optional(),placement:RT.optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(Lt).strict(),XT=p.object({kind:p.literal("overlays:modal"),content:OT,size:p.enum(["sm","md","lg"]).optional(),blocking:p.boolean().optional(),scrim:p.object({opacity:p.number().min(0).max(1).optional()}).strict().optional(),dismiss:p.object({onEsc:p.boolean().optional(),closeButton:p.boolean().optional(),timeoutMs:p.number().min(0).optional()}).strict().optional(),ctaButtons:p.array(w0).optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(Lt).strict(),KT=p.object({kind:p.literal("navigation:scrollTo"),anchorId:Wa,behavior:FT.optional(),block:C0.optional(),inline:C0.optional(),label:p.string().optional()}).extend(Lt).strict(),YT=p.object({kind:p.literal("navigation:navigate"),url:p.string(),target:p.enum(["_self","_blank"]).optional(),label:p.string().optional()}).extend(Lt).strict(),QT=p.object({kind:p.literal("core:mountWidget"),slot:p.string(),widget:PT,label:p.string().optional()}).extend(Lt).strict(),JT=p.object({kind:p.literal("core:wait"),durationMs:p.number().min(0).optional(),event:p.string().optional(),label:p.string().optional()}).extend(Lt).strict(),eR=p.object({kind:p.literal("core:sequence"),actions:p.array(p.any()),label:p.string().optional()}).extend(Lt).strict(),tR=p.object({kind:p.literal("core:parallel"),actions:p.array(p.any()),waitFor:p.enum(["all","any"]).optional(),label:p.string().optional()}).extend(Lt).strict(),aR=p.object({kind:p.literal("overlays:tour"),tourId:p.string(),steps:p.array(NT).min(1),startStep:p.string().optional(),autoStart:p.boolean().optional(),label:p.string().optional()}).extend(Lt).passthrough(),T4=[{defName:"setText",schema:HT},{defName:"setAttr",schema:UT},{defName:"addClass",schema:zT},{defName:"removeClass",schema:qT},{defName:"setStyle",schema:VT},{defName:"insertHtml",schema:$T},{defName:"highlight",schema:jT},{defName:"pulse",schema:GT},{defName:"badge",schema:WT},{defName:"tooltip",schema:ZT},{defName:"modal",schema:XT},{defName:"scrollTo",schema:KT},{defName:"navigate",schema:YT},{defName:"mountWidget",schema:QT},{defName:"wait",schema:JT},{defName:"sequence",schema:eR},{defName:"parallel",schema:tR},{defName:"tour",schema:aR}];function L0(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(b){if(!e)return null;try{return e.matches(b)?e:e.querySelector(b)}catch{return null}}function l(){for(let[b,g]of r){let m=s(b);if(m){for(let y of g)clearTimeout(y.timer),y.resolve(m);r.delete(b)}}for(let[b,g]of n){let m=s(b);if(m){for(let y of g)y.cancelled||y.cb(m);n.delete(b)}}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(b,g){let m=r.get(b);m&&(m.delete(g),m.size===0&&r.delete(b)),r.size===0&&n.size===0&&c()}function f(b,g){if(i)return Promise.reject(new Error("AnchorResolver destroyed"));let m=s(b);if(m)return Promise.resolve(m);let y=g??a;return new Promise((v,C)=>{let w={resolve:v,reject:C,timer:setTimeout(()=>{d(b,w),C(new Error(`waitFor("${b}") timed out after ${y}ms`))},y)},_=r.get(b);_||(_=new Set,r.set(b,_)),_.add(w),u()})}function h(b,g){if(i)return()=>{};let m=s(b);if(m)return g(m),()=>{};let y={cb:g,cancelled:!1},v=n.get(b);return v||(v=new Set,n.set(b,v)),v.add(y),u(),()=>{y.cancelled=!0;let C=n.get(b);C&&(C.delete(y),C.size===0&&n.delete(b)),r.size===0&&n.size===0&&c()}}function S(){let b=0;for(let g of r.values())b+=g.size;return b}function x(){i=!0,c();let b=new Error("AnchorResolver destroyed");for(let g of r.values())for(let m of g)clearTimeout(m.timer),m.reject(b);r.clear(),n.clear()}return{resolve:s,waitFor:f,onAppear:h,pendingCount:S,destroy:x}}function R4(){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 k0(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(rR(a,r))return}if(e.include){for(let r of e.include)if(rR(a,r))return r;return}return a}function rR(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 Sh=class{constructor(e){D(this,"context");D(this,"previousContext");D(this,"listeners",new Set);D(this,"telemetry");D(this,"routes");D(this,"navigation");D(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=R4(),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=k0(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=k0(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)};window.addEventListener("resize",a),this.cleanupFns.push(()=>window.removeEventListener("resize",a));let r=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(r)}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=k0(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 I0(t){return new Sh(t)}var M4=p.object({url:p.string(),routeId:p.string().optional(),title:p.string().optional(),locale:p.string().optional()}),O4=p.object({url:p.string(),ts:p.number()}),D4=p.object({sessionId:p.string(),startTs:p.number(),pageHistory:p.array(O4).optional()}),B4=p.object({width:p.number(),height:p.number()}),P4=p.object({x:p.number(),y:p.number(),w:p.number(),h:p.number()}),N4=p.object({anchorId:p.string(),present:p.boolean(),visible:p.boolean().optional(),boundingBox:P4.optional()}),F4=p.record(p.string(),p.union([p.number(),p.string(),p.boolean(),p.undefined()])),H4=p.object({page:M4,session:D4,viewport:B4,anchors:p.array(N4).optional(),augmented:F4.optional()});function j9(t){return H4.safeParse(t)}function nR(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=a.anchors?.find(i=>i.anchorId===t.anchorId);switch(t.state){case"visible":return o?.visible===!0;case"present":return o?.present===!0;case"absent":return!o?.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 r?.getValue?r.getValue(t.key)===t.value:!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 oR(t,e){let a=[];for(let r of t.conditions){let n=nR(r,e);if(a.push({condition:r,result:n}),!n)return{matched:!1,conditionResults:a}}return{matched:!0,conditionResults:a}}function _h(t,e){for(let a=0;a<t.rules.length;a++){let r=t.rules[a],{matched:n,conditionResults:o}=oR(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 Ch(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 iR(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,getValue:i=>a.session.get(i)??a.user.get(i)}: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 sR(t,e,a={}){let r=iR(e,a);switch(t.type){case"rules":return _h(t,r);case"score":return Ch(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 lR(t,e,a={}){let r=iR(e,a);switch(t.type){case"rules":return _h(t,r);case"score":return Ch(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 A0(t){return{evaluate:(e,a)=>sR(e,a,t),evaluateSync:(e,a)=>lR(e,a,t)}}function E0(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 f=i.get(d.stateKey)||{count:0};f.count++,d.needsTimestamps&&(f.timestamps||(f.timestamps=[]),f.timestamps.push(u.ts),f.timestamps.length>200&&(f.timestamps=f.timestamps.slice(-200))),i.set(d.stateKey,f),c=!0}if(c)for(let d of n)try{d()}catch(f){console.error("[EventAccumulator] Subscriber error:",f)}}function l(){o||r.size===0||(o=e.subscribe(s))}return{register(u,c,d=!1){let f=`ev:${u}`,h=r.get(f);if(h){d&&!h.needsTimestamps&&(h.needsTimestamps=!0);return}r.set(f,{stateKey:f,needsTimestamps:d,predicate:c}),l()},getCount(u,c){let d=`ev:${u}`,f=i.get(d);if(!f)return 0;if(c===void 0||!f.timestamps)return f.count;let h=Date.now()-c;return f.timestamps.filter(S=>S>=h).length},subscribe(u){return n.add(u),()=>{n.delete(u)}},destroy(){o&&(o(),o=null),r.clear(),n.clear()}}}var uR="app:",U4="syntro:",z4=/^[a-z][a-z0-9_]*$/;function T0(t){if(!t)return{valid:!1,reason:"Event name cannot be empty"};if(t.startsWith(U4))return{valid:!1,reason:'"syntro:" prefix is reserved for internal SDK events'};if(!t.startsWith(uR))return{valid:!1,reason:`Custom events must start with "app:" prefix. Got: "${t}"`};let e=t.slice(uR.length).split(":");if(e.length<2)return{valid:!1,reason:`Event name must have at least 2 segments after "app:" (app:{category}:{action}). Got: "${t}"`};for(let a of e)if(!z4.test(a))return{valid:!1,reason:`Segment "${a}" must be lowercase alphanumeric + underscores. Got: "${t}"`};return{valid:!0}}function q4(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null}function cR(t,e,a=0){if(a>=e)return!1;for(let r of Object.values(t))if(r!==null&&typeof r=="object"&&!Array.isArray(r)&&!cR(r,e,a+1))return!1;return!0}function R0(t){if(t===void 0)return{valid:!0};if(t===null||typeof t!="object"||Array.isArray(t))return{valid:!1,reason:"Props must be a plain object"};if(!cR(t,2))return{valid:!1,reason:"Props nesting depth exceeds 2 levels"};let e=[];for(let[a,r]of Object.entries(t))r!==null&&typeof r=="object"||q4(r)||e.push(a);return e.length>0?{valid:!0,stripped:e}:{valid:!0}}function wh(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 Lh=class{constructor(e={}){D(this,"subscriptions",new Set);D(this,"history",[]);D(this,"maxHistorySize");D(this,"debug");D(this,"emitHistory");D(this,"posthogCapture");D(this,"testMode");this.maxHistorySize=e.maxHistorySize??100,this.debug=e.debug??!1,this.emitHistory=e.history??null,this.posthogCapture=e.posthogCapture??null,this.testMode=e.testMode??!1}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:st};this.publishEvent(n)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let a of this.subscriptions)if(wh(e,a.filter))try{a.callback(e)}catch(r){console.error("[EventBus] Subscriber error:",r)}}emit(e,a){let r=T0(e);if(!r.valid)return console.warn(`[EventBus] emit() rejected: ${r.reason}`),this.debug?{delivered:!1,matchedRules:[],posthogCaptured:!1,listenersNotified:0}:void 0;let n=R0(a);if(!n.valid)return console.warn(`[EventBus] emit() rejected props: ${n.reason}`),this.debug?{delivered:!1,matchedRules:[],posthogCaptured:!1,listenersNotified:0}:void 0;let o={ts:Date.now(),name:e,source:"custom",props:a,schemaVersion:st};this.history.push(o),this.history.length>this.maxHistorySize&&this.history.shift();let i=0;for(let l of this.subscriptions)if(wh(o,l.filter))try{l.callback(o),i++}catch(u){console.error("[EventBus] Subscriber error:",u),i++}let s=!1;if(this.posthogCapture&&!this.testMode)try{this.posthogCapture(e,a),s=!0}catch(l){console.error("[EventBus] PostHog capture error:",l)}if(this.emitHistory&&this.emitHistory.record({name:e,props:a,source:"custom",timestamp:o.ts,matchedRules:[]}),this.debug)return console.debug("[EventBus] emit()",{name:e,props:a,listenersNotified:i,posthogCaptured:s}),{delivered:!0,matchedRules:[],posthogCaptured:s,listenersNotified:i}}setPosthogCapture(e){this.posthogCapture=e}getRecent(e,a){let r=this.history;return e&&(r=r.filter(n=>wh(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=>wh(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 Pc(t={}){return new Lh(t)}var Nc=class{constructor(e=100){D(this,"entries",[]);D(this,"maxSize");this.maxSize=e}record(e){this.entries.push(e),this.maxSize>0&&this.entries.length>this.maxSize&&this.entries.shift()}getAll(){return[...this.entries]}clear(){this.entries=[]}};var dR=p.enum(["posthog","canvas","derived"]),V4=p.object({ts:p.number(),name:p.string(),source:dR,props:p.record(p.string(),p.unknown()).optional(),schemaVersion:p.string()}),$4=p.object({names:p.array(p.string()).optional(),patterns:p.array(p.string()).optional(),sources:p.array(dR).optional()});function xj(t){return V4.safeParse(t)}function bj(t){return $4.safeParse(t)}var Fc=class{constructor(){D(this,"listeners",new Set);D(this,"capturedPushState");D(this,"capturedReplaceState");D(this,"wasNative");D(this,"destroyed",!1);D(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 M0="cooldown:";function fR(t){return{set(e,a){let r=M0+e,n=Date.now()+a;t.set(r,n)},isActive(e){return this.remaining(e)>0},remaining(e){let a=M0+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=M0+e;t.remove(a)}}}var Hc="dismissed:";function pR(t,e){return{mark(a,r=!1){let n=Hc+a;(r?e:t).set(n,!0)},isDismissed(a){let r=Hc+a;return t.has(r)||e.has(r)},clear(a){let r=Hc+a;t.remove(r),e.remove(r)},clearAll(){for(let a of t.keys())a.startsWith(Hc)&&t.remove(a);for(let a of e.keys())a.startsWith(Hc)&&e.remove(a)}}}var O0="freq:";function hR(t){function e(a){let r=O0+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=O0+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=O0+a;t.remove(r)},hasReachedLimit(a,r){return this.count(a)>=r}}}var j4="syntro";function D0(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 Uc(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 kh=class{constructor(e={}){D(this,"session");D(this,"user");D(this,"dismissals");D(this,"cooldowns");D(this,"frequency");D(this,"namespace");D(this,"namespacedStorages",new Map);this.namespace=e.namespace??j4;let a=r=>typeof r=="object"&&r!==null&&typeof r.setItem=="function";typeof window<"u"?(this.session=a(window.sessionStorage)?D0(window.sessionStorage,this.namespace):Uc(this.namespace),this.user=a(window.localStorage)?D0(window.localStorage,this.namespace):Uc(this.namespace)):(this.session=Uc(this.namespace),this.user=Uc(this.namespace)),this.dismissals=pR(this.session,this.user),this.cooldowns=fR(this.user),this.frequency=hR(this.session)}ns(e){let a=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(a)){let r=typeof window<"u"&&typeof sessionStorage<"u"?D0(sessionStorage,a):Uc(a);this.namespacedStorages.set(a,r)}return this.namespacedStorages.get(a)}};function B0(t={}){return new kh(t)}function zc(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function Ih(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var mR={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"}},qc={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:[]},gR={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function P0(t,e,a){let r=mR[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 N0(t,e,a){let r=a.placement==="auto"?"bottom":a.placement,n=[Bf(a.offset?{mainAxis:a.offset.y,crossAxis:a.offset.x}:8)];return a.flip!==!1&&n.push(Nf()),a.shift!==!1&&n.push(Pf({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",Df(e,t,async()=>{let{x:i,y:s,strategy:l}=await Ff(e,t,{placement:r,middleware:n});Object.assign(t.style,{position:l,left:`${i}px`,top:`${s}px`})})}function F0(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 H0(t,e){return e==="none"||qc[e].length===0?null:t.animate(qc[e],gR)}function U0(t,e){if(e==="none"||qc[e].length===0)return Promise.resolve();let a=[...qc[e]].reverse(),r=t.animate(a,gR);return new Promise(n=>{r.onfinish=()=>n(),r.oncancel=()=>n()})}function z0(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 q0(t){switch(zc(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 vR(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(),f=c.startsWith("on"),h=(c==="href"||c==="src")&&d.startsWith("javascript:");(f||h)&&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 G4=0;function V0(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-${++G4}`}function c(v,C){a&&a.publish(v,C)}function d(v){let C=l.get(v);if(C){let w=b(v);for(let _ of C)try{_(w)}catch(L){console.error("[Surfaces] State callback error:",L)}}}let f=new Map;function h(v,C,w){switch(C.type){case"html":v.innerHTML=vR(C.content);return;case"widget":{if(o?.has(C.widgetId)){let _=o.mount(C.widgetId,v,C.config);return w&&f.set(w,_),()=>{_.unmount(),w&&f.delete(w)}}console.warn(`[Surfaces] Widget not found: ${C.widgetId}`),v.innerHTML=`<div data-widget-id="${C.widgetId}" data-widget-missing="true">Widget: ${C.widgetId}</div>`;return}case"custom":return C.mount(v);case"react":v.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function S(v,C,w){let _=u(),L=zc(v),I=w?.priority??0,A=w?.animation??n,T=w?.exclusive??!0,N=i.get(v);if(N&&T){if(N.options.priority>I)throw new Error(`Slot ${v} is occupied by higher priority content (${N.options.priority} > ${I})`);x(N)}let B=z0(v,_);B.style.zIndex=String(q0(v));let F;if(L==="static")P0(B,v,w?.constraints),e.appendChild(B);else if(L==="inline"){let M=Ih(v);if(!M)throw new Error(`Invalid inline slot: ${v}`);if(!r)throw new Error("Anchor resolver required for inline slots");let U=r({selector:M,route:"**"});if(!U)throw new Error(`Anchor not found for inline slot: ${M}`);F=F0(B,U)}else if(L==="adjacent"){let M=Ih(v);if(!M)throw new Error(`Invalid adjacent slot: ${v}`);if(!r)throw new Error("Anchor resolver required for adjacent slots");let U=r({selector:M,route:"**"});if(!U)throw new Error(`Anchor not found for adjacent slot: ${M}`);e.appendChild(B),F=N0(B,U,w?.position??{placement:"bottom"})}let H=h(B,C,_);H0(B,A);let R={id:_,slot:v,content:C,options:{priority:I,exclusive:T,animation:A,position:w?.position??{placement:"auto"},constraints:w?.constraints??{},adaptiveId:w?.adaptiveId,autoUnmountOnRouteChange:w?.autoUnmountOnRouteChange??!0},container:B,cleanup:()=>{F?.(),H?.()},mountedAt:Date.now()};return i.set(v,R),s.set(v,(s.get(v)??0)+1),c("surface.mounted",{slot:v,id:_,adaptiveId:w?.adaptiveId}),d(v),{id:_,update(M){let U=i.get(v);if(!U||U.id!==_)throw new Error("Mount no longer active");let ue=f.get(_);if(ue){if(M.type==="widget"){ue.update(M.config),U.content=M;return}ue.unmount(),f.delete(_)}U.container.innerHTML="";let Re=h(U.container,M,_);if(U.content=M,Re){let we=U.cleanup;U.cleanup=()=>{we?.(),Re()}}},setOptions(M){let U=i.get(v);if(!U||U.id!==_)throw new Error("Mount no longer active");M.priority!==void 0&&(U.options.priority=M.priority),M.animation!==void 0&&(U.options.animation=M.animation),M.constraints&&L==="static"&&(M.constraints.maxWidth&&(U.container.style.maxWidth=M.constraints.maxWidth),M.constraints.maxHeight&&(U.container.style.maxHeight=M.constraints.maxHeight),M.constraints.minWidth&&(U.container.style.minWidth=M.constraints.minWidth),M.constraints.minHeight&&(U.container.style.minHeight=M.constraints.minHeight)),d(v)},async unmount(){let M=i.get(v);!M||M.id!==_||await x(M)},isMounted(){return i.get(v)?.id===_},getContainer(){let M=i.get(v);return M?.id===_?M.container:null}}}async function x(v){v.container.isConnected&&await U0(v.container,v.options.animation);try{v.cleanup?.()}catch(C){console.warn("[Surfaces] Cleanup error during unmount, ignoring:",C)}try{v.container.remove()}catch{}i.delete(v.slot),c("surface.unmounted",{slot:v.slot,id:v.id}),d(v.slot)}function b(v){let C=i.get(v);return{slot:v,occupied:!!C,currentPriority:C?.options.priority,currentAdaptiveId:C?.options.adaptiveId,mountCount:s.get(v)??0,currentMountId:C?.id}}function g(v,C){let w=l.get(v);return w||(w=new Set,l.set(v,w)),w.add(C),()=>{w?.delete(C),w?.size===0&&l.delete(v)}}function m(v,C){let w=i.get(v);return w?C!==void 0?C>=w.options.priority:!1:!0}function y(){for(let v of i.values())try{v.cleanup?.(),v.container.remove()}catch(C){console.error("[Surfaces] Error during cleanup:",C)}i.clear(),l.clear()}return{mount:S,getState:b,onStateChange:g,canMount:m,destroy:y}}var Ah=class{constructor(){D(this,"widgets",new Map);D(this,"mountedWidgets",new Map);D(this,"mountIdCounter",0);D(this,"runtimeRef");D(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&&(a.isConnected&&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},f=n.widget.mount(a,d);c.cleanup=f??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()}},$0=new Ah;var xR="2.0.0";function W4(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(j0(r,n))return!1}if(e.include&&e.include.length>0){for(let n of e.include)if(j0(r,n))return!0;return!1}return!0}function j0(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 yR(t){let a=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(n=>{let o=n;if(/^https?:\/\//.test(o))try{o=new URL(o).pathname}catch{}return j0(a,o)})}function G0(t={}){let{telemetry:e,sessionMetrics:a,routes:r,mode:n="production",namespace:o}=t,i=t.widgets??$0,s=t.executors??bn,l=t.apps??mu,u=new Fc,c=I0({telemetry:e,routes:r,navigation:u}),d=t.events??Pc(),f=B0({namespace:o}),h=E0({eventBus:d,stateStore:f}),S=A0({state:f,events:d,sessionMetrics:a,accumulator:h}),x=W1(),b=L0(),g=_=>yR(_)?b.resolve(_.selector):null,m=async(_,L)=>{if(!yR(_))return null;try{return await b.waitFor(_.selector,L)}catch{return null}},y=V0({overlayRoot:x,eventBus:d,anchorResolver:g,widgetRegistry:i}),v=c0({overlayRoot:x,eventBus:d,surfaces:y,anchorResolver:g,waitForAnchor:m,executorRegistry:s,subscribeNavigation:_=>u.subscribe(_),runtime:{evaluateSync:_=>S.evaluateSync(_,c.get()),context:c,accumulator:h}}),C;if(a){a.increment("page_views");let _=typeof window<"u"?window.location.pathname:"/";C=u.subscribe((L,I)=>{if(I!=="replaceState")try{let A=new URL(L).pathname;A!==_&&(_=A,a.increment("page_views"))}catch{}})}let w={telemetry:e,context:c,events:d,state:f,sessionMetrics:a,actions:v,surfaces:y,widgets:i,executors:s,apps:l,accumulator:h,anchorResolver:b,navigation:u,version:xR,mode:n,async evaluate(_){return S.evaluate(_,c.get())},evaluateSync(_){return S.evaluateSync(_,c.get())},async filterTiles(_){let L=c.get().page.url,I=[];for(let A of _){let T=A.activation;if(!T){I.push(A);continue}if(W4(L,T.routes)){if(T.onlyIfPopulated){let N=A.props?.actions??[];if(N.length>0&&!N.some(F=>F.triggerWhen?S.evaluateSync(F.triggerWhen,c.get()).value:!0))continue}I.push(A)}}return I},setRoutes(_){c.setRoutes(_)},destroy(){l.unbind().catch(_=>{console.error("[Runtime] Error unbinding apps registry:",_)}),C?.(),b.destroy(),h.destroy(),u.destroy(),c.destroy(),v.destroy(),y.destroy()}};return l.bind(w),i.bindRuntime(w),w}var Z4=p.object({value:p.unknown(),expiresAt:p.number().optional()}),X4=p.object({count:p.number(),resetAt:p.number().optional()});function LG(t){return Z4.safeParse(t)}function kG(t){return X4.safeParse(t)}var W0="syn_";function Vc(t){if(!t.startsWith(W0))throw new Error("Invalid Syntro token: must start with 'syn_'");let a=t.slice(W0.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 Z0(t){let e=JSON.stringify(t),a=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return W0+a}function Za(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{}}var SR="syntro_segment_attributes";function _R(){if(typeof window>"u")return{};try{let t=localStorage.getItem(SR);if(t){let e=JSON.parse(t);return X("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){oa("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function CR(t){if(!(typeof window>"u"))try{localStorage.setItem(SR,JSON.stringify(t)),X("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){oa("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function wR(t){if(!t)return{};let e={};for(let[a,r]of Object.entries(t))a.startsWith("in_segment_")&&(e[a]=r===!0);return e}function X0(){if(typeof window>"u")return{};let t={};try{let e=new URLSearchParams(window.location.search);for(let a of["utm_source","utm_medium","utm_campaign","utm_content","utm_term"]){let r=e.get(a);r&&(t[a]=r)}}catch{}try{navigator.language&&(t.browser_language=navigator.language),navigator.languages?.length&&(t.browser_languages=[...navigator.languages])}catch{}try{let e=window.innerWidth;t.device_type=e<768?"mobile":e<1024?"tablet":"desktop"}catch{}try{if(document.referrer){t.referrer=document.referrer;try{t.referrer_hostname=new URL(document.referrer).hostname}catch{}}}catch{}try{let e=navigator.userAgent;e.includes("Edg/")?t.browser="Edge":e.includes("OPR/")||e.includes("Opera")?t.browser="Opera":e.includes("Chrome/")&&!e.includes("Chromium")?t.browser="Chrome":e.includes("Safari/")&&!e.includes("Chrome")?t.browser="Safari":e.includes("Firefox/")&&(t.browser="Firefox"),e.includes("Windows")?t.os="Windows":e.includes("iPhone")||e.includes("iPad")?t.os="iOS":e.includes("Mac OS X")||e.includes("Macintosh")?t.os="macOS":e.includes("Android")?t.os="Android":e.includes("Linux")&&(t.os="Linux")}catch{}try{t.page_url=window.location.href,t.page_path=window.location.pathname,t.page_host=window.location.hostname,window.location.search&&(t.page_query=window.location.search)}catch{}try{let e=window.Telegram?.WebApp;e?(t.surface_type="telegram",t.surface_host=e.platform||"unknown"):(t.surface_type="web",t.surface_host="web")}catch{t.surface_type="web",t.surface_host="web"}return t}var bR="syntro_geo",LR="https://geo.syntrologie.com";async function K0(t){if(typeof window>"u")return{};try{let e=localStorage.getItem(bR);if(e){let a=JSON.parse(e);return X("Syntro Bootstrap","Geo: using cached data:",a),a}}catch{}try{let e=await fetch(t,{signal:AbortSignal.timeout(2e3)});if(e.ok){let a=await e.json(),r={};for(let[n,o]of Object.entries(a))typeof o=="string"&&o&&(r[n]=o);try{localStorage.setItem(bR,JSON.stringify(r))}catch{}return X("Syntro Bootstrap","Geo: fetched from worker:",r),r}}catch{}return{}}var kR={growthbook:t=>Xy({...t,autoInit:!0})};function IR(t,e){let a=kR[t];if(!a)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(kR).join(", ")}`);return a(e)}var K4=["cdn.syntrologie.com","localhost","127.0.0.1"];function Y4(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):K4.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 Y0=class{constructor(e){D(this,"name","cdn");D(this,"url");D(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!Y4(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 Q4(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 Q4(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 AR(t){return new Y0(t)}var J4="syntro_exp",eU="syntro_var",Q0=class{constructor(e){D(this,"name","experiments");D(this,"client");D(this,"featureKey");D(this,"manifestKey");D(this,"variantFlagPrefix");this.client=e.client,this.featureKey=e.featureKey,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(J4),i=n.get(eU);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||this.client.getAllFeatures){let n=this.fetchMultiFlag();if(n){let o=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:o,cached:!0}}}}if(!this.featureKey)throw new Error("[SmartCanvas] No featureKey configured and no variant flags found. Ensure at least one config feature flag exists in your experiment platform.");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:Xf(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.client.getAllFeatures){let e=this.client.getAllFeatures();return this.variantFlagPrefix?Object.keys(e).filter(a=>a.startsWith(this.variantFlagPrefix)):Object.keys(e)}return[]}};function ER(t){return new Q0(t)}var tU="https://cdn.syntrologie.com/configs",TR={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return AR({baseUrl:t.baseUrl??tU,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return ER({featureKey:t.featureKey})}};function RR(t,e={}){let a=TR[t];if(!a)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(TR).join(", ")}`);return a(e)}var MR={posthog:t=>$b(t),noop:()=>ax()};function OR(t,e){let a=MR[t];if(!a)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(MR).join(", ")}`);return a(e)}async function DR(t){ay(),X("Syntro Bootstrap","====== INIT ======"),X("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=Qf();if(console.log(`[DIAG] Mode detection: sdkMode=${e}`),console.log("[DIAG] editorSource:",_u()),console.log("[DIAG] editorConf:",Yf()),X("Syntro Bootstrap","SDK mode:",e??"normal"),!e&&typeof window<"u"){let R=!!window.__SYNTRO_EDITOR_PARAMS__,z=!!window.__SYNTRO_AUDIT_LEGEND__,M=!!window.__SYNTRO_REVIEW_DATA__;if(R||z||M){let U=[R&&"__SYNTRO_EDITOR_PARAMS__",z&&"__SYNTRO_AUDIT_LEGEND__",M&&"__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&&e){let z=Yf()?.syntro_token;z?.startsWith("syn_")&&(a=z,X("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${e} mode)`))}let r;if(a)if(a.startsWith("syn_"))X("Syntro Bootstrap","Token starts with syn_, decoding..."),r=Vc(a),ay(r.d);else if(e)X("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${e} 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:",a),new Error("Invalid Syntro token: must start with 'syn_'");else if(e)X("Syntro Bootstrap",`\u2713 No token, but ${e} 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 n=Za("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||Za("VITE_SYNTRO_EXPERIMENT_HOST")||r?.eh,o=Za("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||Za("VITE_SYNTRO_TELEMETRY_HOST")||r?.th,i=Za("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||Za("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,s=r?.g||Za("NEXT_PUBLIC_SYNTRO_GEO_HOST")||Za("VITE_SYNTRO_GEO_HOST")||LR,l=_R(),u=X0(),c=t.appSignals??{},d={...u,...l,...c};X("Syntro Bootstrap","Phase 1: Browser metadata:",u),X("Syntro Bootstrap","Phase 1: Cached segment attributes:",l),Object.keys(c).length>0&&X("Syntro Bootstrap","Phase 1: App signals:",c);let f=K0(s),h=(()=>{try{if(typeof window>"u"||window.self===window.top)return Promise.resolve(null)}catch{}return new Promise(R=>{let z=setTimeout(()=>{window.removeEventListener("message",M),R(null)},500);function M(U){let ue=U.data;ue?.jsonrpc==="2.0"&&ue?.id===1&&ue?.result?.hostInfo&&(clearTimeout(z),window.removeEventListener("message",M),R(ue.result.hostInfo))}window.addEventListener("message",M);try{window.parent.postMessage({jsonrpc:"2.0",id:1,method:"ui/initialize",params:{capabilities:{}}},"*")}catch{clearTimeout(z),window.removeEventListener("message",M),R(null)}})})(),S,x=t.debug||t.testMode,b=Pc({debug:t.debug,history:x?new Nc(t.testMode?0:100):void 0,testMode:t.testMode});console.log("[Syntro Bootstrap] EventBus created");let g=sy({elementResolver:typeof window<"u"?(R,z)=>{let M=document.elementFromPoint(R,z);if(!M)return null;let U={tag_name:M.tagName.toLowerCase()};M.id&&(U.attr__id=M.id),M.className&&typeof M.className=="string"&&(U.classes=M.className.split(" ").filter(Boolean));for(let ue of M.attributes)ue.name.startsWith("data-")&&(U[`attr__${ue.name}`]=ue.value);return U}:void 0});g.onEvent(R=>b.publishEvent(R)),typeof window<"u"&&(setInterval(()=>g.tick(Date.now()),1e3),document.addEventListener("click",R=>{let z=[],M=R.target;for(;M&&M!==document.body;){let U={tag_name:M.tagName.toLowerCase()};for(let ue of M.attributes)(ue.name.startsWith("data-")||ue.name==="id"||ue.name==="class"||ue.name==="aria-label")&&(U[`attr__${ue.name}`]=ue.value);z.push(U),M=M.parentElement}g.enrichClickAttributes(Date.now(),z)},!0));let m=R=>{X("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let z=wR(R);if(X("Syntro Bootstrap","Segment flags from PostHog:",z),CR(z),S){let M=v?.getAll?.()??{},U={...u,...M,...z,...c};X("Syntro Bootstrap","Updating GrowthBook with attributes:",U),S.setAttributes?.(U)}},y;if(r?.t){let R=r.t==="noop"?"noop":"posthog";y=OR(R,{apiKey:r.t,apiHost:o,enableFeatureFlags:!0,sessionRecording:!0,onFeatureFlagsLoaded:m,onCapture:(M,U)=>{g.ingest({kind:"posthog",event:M,properties:U,timestamp:Date.now()})},onRRWebEvent:M=>{g.ingest(M)}}),console.log(`[Syntro Bootstrap] Telemetry client created (${R}) with EventBus wiring`),Object.keys(c).length>0&&(y.register?.(c),X("Syntro Bootstrap","Registered app signals as super properties:",c));let z=y;b.setPosthogCapture((M,U)=>{z.track?.(M,U)})}let v;r?.e&&(S=IR("growthbook",{clientKey:r.e,apiHost:n,attributes:d,onExperimentViewed:y?.trackExperiment?(R,z,M)=>{y.trackExperiment(R,z,M)}:void 0})),v=Ky({experiments:S,onMetricChange:(R,z)=>{X("Syntro Bootstrap",`Session metric changed: ${R} = ${z}`)}}),X("Syntro Bootstrap","SessionMetricTracker created");let C="production";e==="editor"?C="editor":e==="audit"?C="audit":Za("NODE_ENV")==="development"&&(C="development");let w=G0({telemetry:y,sessionMetrics:v,mode:C,events:b});X("Syntro Bootstrap","Runtime created:",{version:w.version,mode:w.mode,hasContext:!!w.context,hasEvents:!!w.events,hasState:!!w.state}),X("Syntro Bootstrap","Core app executors already registered");let _=t.cdnBase||Za("NEXT_PUBLIC_SYNTRO_CDN_BASE")||Za("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",L=Pv({cdnBase:_,registry:w.apps,onLoadStart:R=>{X("Syntro Bootstrap",`Loading app from CDN: ${R}`)},onLoadEnd:(R,z,M)=>{z?X("Syntro Bootstrap",`App loaded successfully: ${R}`):oa("Syntro Bootstrap",`Failed to load app: ${R}`,M)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:w.apps,runtime:w,version:w.version},X("Syntro Bootstrap","Global SynOS object exposed"));let I=w.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${I.length} apps in registry:`,I.map(R=>`${R.manifest.id}(${R.state})`).join(", "));for(let R of I)if(R.state==="registered")try{await w.apps.activate(R.manifest.id),console.log(`[DIAG] Activated: ${R.manifest.id} \u2192 widgets: [${w.widgets.list().join(", ")}]`)}catch(z){console.error(`[DIAG] FAILED to activate: ${R.manifest.id}`,z),oa("Syntro Bootstrap",`Failed to auto-activate built-in app: ${R.manifest.id}`,z)}if(console.log(`[DIAG] Activation complete. Total widgets: [${w.widgets.list().join(", ")}]`),S?.refreshFeatures)try{await S.refreshFeatures(),X("Syntro Bootstrap","GrowthBook features loaded")}catch(R){oa("Syntro Bootstrap","Failed to load GrowthBook features:",R)}let A=await f;if(S&&Object.keys(A).length>0){let R={...u,...A,...c};X("Syntro Bootstrap","Merging geo data into GrowthBook attributes:",A),S.setAttributes?.(R)}let T=await h;T&&S&&(u.surface_type="mcp-app",u.surface_host=T.name,S.setAttributes?.({...u,...A}),X("Syntro Bootstrap","MCP App detected:",T.name));let N;if(t.fetcher)N=t.fetcher;else if(r?.f){let R=RR(r.f,r.o??{});N=async()=>{let z=await R.fetch();return{...z.config,tiles:z.config.tiles??[]}}}else S&&(N=Cs({experiments:S}));let B=new Set,F=N?async()=>{let R=await N(),z=R.tiles?.length??0,M=R.actions?.length??0,U=R.meta?.variant_id;if((z>0||M>0)&&(U||console.warn("[Syntro] Config has content but no meta.variant_id \u2014 intervention tracking disabled")),y&&U){let we=new Ic(y,U);we.trackServed(z,M),typeof window<"u"&&(window.SynOS.interventionTracker=we),w.navigation.subscribe(()=>{we.resetPage()})}console.log("[Syntro Bootstrap] Config fetched:",`tiles=${R.tiles?.length??0},`,`actions=${R.actions?.length??0},`,`theme=${R.theme?.name??"none"}`),R.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",R.actions.map((we,gt)=>`[${gt}] ${we.kind}${we.anchorId?` anchor="${we.anchorId.selector}"`:""}${we.label?` "${we.label}"`:""}`).join(", "));let ue=R,Re=L.getRequiredApps(ue);return Re.length>0?console.log("[Syntro Bootstrap] Required external apps:",Re.join(", ")):X("Syntro Bootstrap","No external apps required (all executors are built-in)"),Re.length>0&&await L.loadAppsForConfig(ue).then(async gt=>{let G=gt.filter(Me=>Me.success),te=gt.filter(Me=>!Me.success);G.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${G.map(Me=>Me.appId).join(", ")}`);let Qe=te.filter(Me=>!B.has(Me.appId));Qe.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",Qe.map(Me=>`${Me.appId} (${Me.error})`).join(", ")),Qe.forEach(Me=>B.add(Me.appId)));for(let Me of Re)if(w.apps.has(Me))try{await w.apps.activate(Me),console.log(`[Syntro Bootstrap] App activated: ${Me}`)}catch(nl){console.error(`[Syntro Bootstrap] Failed to activate app: ${Me}`,nl)}else console.error(`[Syntro Bootstrap] App "${Me}" required by config but NOT registered.`,`Available apps: [${Array.from(w.apps.list?.()??[]).join(", ")}]`)}),R}:void 0;return{canvas:await Ty({...t.canvas,fetcher:F,integrations:{experiments:S,telemetry:y},editorUrl:i,runtime:w}),runtime:w,experiments:S,telemetry:y,sessionMetrics:v,appLoader:L}}async function aU(t){try{return await DR(t)}catch(e){let a=e instanceof Error?e.message:String(e);console.warn("[Syntrologie] SDK initialization failed:",a),typeof document<"u"&&document.getElementById("syntrologie-anti-flicker")?.remove();return}}function rU(t,e={}){if(typeof window>"u")return;let a=window.SynOS?.runtime;a?.events?.publish&&a.events.publish({name:t,source:"custom",props:e})}var BR={init:aU,encodeToken:Z0,decodeToken:Vc,events:{emit:rU}};typeof window<"u"&&(window.Syntro=BR);var PR="2026-04-18T04:36:24.703Z (cb8871918e2)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${PR}`);let t=window.SynOS,e=t?.appRegistry||mu;window.SynOS={...t,appRegistry:e,_runtimeBuild:PR,React:NR.default,ReactDOM:{...nU,createPortal:Eh.createPortal,flushSync:Eh.flushSync}},D1(e)}export{qc as ANIMATION_KEYFRAMES,bh as ActivationConfigZ,zT as AddClassZ,Wa as AnchorIdZ,N4 as AnchorStateZ,p0 as AnchorVisibleConditionZ,Uf as AppRegistry,F4 as AugmentationZ,TT as BadgePositionZ,WT as BadgeZ,P4 as BoundingBoxZ,ku as CanvasEvents,ex as CanvasRecipeZ,Lo as ConditionZ,Sh as ContextManager,x0 as CooldownActiveConditionZ,Ec as CounterDefZ,w0 as CtaButtonZ,py as DEFAULT_COOLDOWN,fy as DEFAULT_TTL,Bc as DecisionStrategyZ,y0 as DismissedConditionZ,st as EVENT_SCHEMA_VERSION,Lh as EventBus,S0 as EventCountConditionZ,$4 as EventFilterZ,Nc as EventHistory,h0 as EventOccurredConditionZ,dR as EventSourceZ,mh as ExecutorRegistry,Dc as ExternalStrategyZ,X4 as FrequencyEntryZ,b0 as FrequencyLimitConditionZ,NH as HighlightStepZ,ET as HighlightStyleZ,jT as HighlightZ,$T as InsertHtmlZ,DT as InsertPositionZ,Ic as InterventionTracker,dy as MAX_VISIBLE_TOASTS,Ac as MatchOpZ,OT as ModalContentZ,XT as ModalZ,Oc as ModelStrategyZ,QT as MountWidgetZ,YT as NavigateZ,Fc as NavigationMonitor,V4 as NormalizedEventZ,cy as NotificationToastStack,M4 as PageContextZ,O4 as PageHistoryEntryZ,d0 as PageUrlConditionZ,tR as ParallelZ,RT as PlacementZ,GT as PulseZ,PR as RUNTIME_SDK_BUILD,xR as RUNTIME_VERSION,qT as RemoveClassZ,f0 as RouteConditionZ,AT as RouteFilterZ,Rc as RuleStrategyZ,Tc as RuleZ,H4 as RuntimeContextZ,yy as RuntimeProvider,eo as SDK_SCHEMA_VERSION,ry as SDK_VERSION,mR as STATIC_SLOT_STYLES,Mc as ScoreStrategyZ,FT as ScrollBehaviorZ,C0 as ScrollLogicalPositionZ,KT as ScrollToZ,bA as SelectorZ,eR as SequenceZ,D4 as SessionContextZ,v0 as SessionMetricConditionZ,Tp as SessionMetricTracker,UT as SetAttrZ,VT as SetStyleZ,HT as SetTextZ,hI as ShadowCanvasOverlay,K1 as ShadowRootProvider,xI as SmartCanvasApp,oy as SmartCanvasController,Ay as SmartCanvasElement,L8 as SmartCanvasPortal,Dt as StandardEvents,m0 as StateEqualsConditionZ,kh as StateStore,Z4 as StoredValueZ,BR as Syntro,zu as TileCard,h$ as TileWheel,MT as TooltipContentZ,PH as TooltipStepZ,BT as TooltipTriggerZ,ZT as TooltipZ,NT as TourStepForSchemaZ,aR as TourZ,xh as TriggerWhenZ,g0 as ViewportConditionZ,B4 as ViewportContextZ,JT as WaitZ,PT as WidgetConfigZ,Ah as WidgetRegistry,mu as appRegistry,P0 as applyStaticSlotStyles,Dv as cleanupAppContext,bv as contentRuntime,T4 as coreActionStepSchemas,c0 as createActionEngine,L0 as createAnchorResolver,Ov as createAppContext,Pv as createAppLoader,Cs as createCanvasConfigFetcher,I0 as createContextManager,A0 as createDecisionEngine,E0 as createEventAccumulator,Pc as createEventBus,Xy as createGrowthBookClient,ax as createNoopClient,C8 as createOverlayRecipeFetcher,$b as createPostHogClient,tI as createPostHogNormalizer,Ky as createSessionMetricTracker,Ty as createSmartCanvas,Z1 as createSmartCanvasController,G0 as createSmartCanvasRuntime,B0 as createStateStore,z0 as createSurfaceContainer,V0 as createSurfaces,C9 as decisionSchemas,Vc as decodeToken,Z0 as encodeToken,sR as evaluate,nR as evaluateCondition,oR as evaluateRule,_h as evaluateRuleStrategy,Ch as evaluateScoreStrategy,lR as evaluateSync,bn as executorRegistry,iP as getAntiFlickerSnippet,e1 as getAppIdFromActionKind,Bv as getAppIdFromWidgetId,m4 as getExecutor,Ih as getSlotAnchorId,zc as getSlotType,q0 as getSlotZIndex,Zb as hasExecutor,cp as interpolateTemplate,Jk as isCoreActionKind,hy as matchEvent,y$ as needsMigration,wu as normalizePostHogEvent,Mv as overlaysRuntime,qu as parseVersion,H0 as playEnterAnimation,U0 as playExitAnimation,Jf as registerConfigPredicates,CI as registerSmartCanvasElement,ny as resolveConfigUri,N0 as setupAdjacentPositioning,F0 as setupInlinePositioning,Lu as shouldNormalizeEvent,mN as useDecision,my as useNotifications,gy as useNotifyWatcher,xy as usePageContext,en as useRuntime,fp as useRuntimeContext,pN as useRuntimeEvents,hN as useRuntimeState,dN as useSessionContext,vI as useShadowCanvasConfig,ks as useShadowRoot,fN as useViewportContext,Er as validateAction,yh as validateActions,_9 as validateActivationConfig,b9 as validateCondition,v$ as validateConfig,bj as validateEventFilter,T0 as validateEventName,kG as validateFrequencyEntry,xj as validateNormalizedEvent,R0 as validateProps,x8 as validateRecipe,j9 as validateRuntimeContext,LG as validateStoredValue,S9 as validateStrategy,$0 as widgetRegistry};
|
|
520
504
|
/*! Bundled license information:
|
|
521
505
|
|
|
522
506
|
react/cjs/react.production.js:
|
|
@@ -582,13 +566,24 @@ lucide-react/dist/esm/defaultAttributes.js:
|
|
|
582
566
|
lucide-react/dist/esm/shared/src/utils/hasA11yProp.js:
|
|
583
567
|
lucide-react/dist/esm/Icon.js:
|
|
584
568
|
lucide-react/dist/esm/createLucideIcon.js:
|
|
569
|
+
lucide-react/dist/esm/icons/arrow-right.js:
|
|
570
|
+
lucide-react/dist/esm/icons/banknote.js:
|
|
571
|
+
lucide-react/dist/esm/icons/bell.js:
|
|
572
|
+
lucide-react/dist/esm/icons/book-open.js:
|
|
573
|
+
lucide-react/dist/esm/icons/circle-check-big.js:
|
|
585
574
|
lucide-react/dist/esm/icons/circle-question-mark.js:
|
|
575
|
+
lucide-react/dist/esm/icons/clipboard-list.js:
|
|
586
576
|
lucide-react/dist/esm/icons/compass.js:
|
|
587
577
|
lucide-react/dist/esm/icons/file-text.js:
|
|
588
578
|
lucide-react/dist/esm/icons/gamepad-2.js:
|
|
579
|
+
lucide-react/dist/esm/icons/landmark.js:
|
|
589
580
|
lucide-react/dist/esm/icons/layers.js:
|
|
581
|
+
lucide-react/dist/esm/icons/lightbulb.js:
|
|
590
582
|
lucide-react/dist/esm/icons/message-circle.js:
|
|
583
|
+
lucide-react/dist/esm/icons/skip-forward.js:
|
|
591
584
|
lucide-react/dist/esm/icons/sparkles.js:
|
|
585
|
+
lucide-react/dist/esm/icons/timer.js:
|
|
586
|
+
lucide-react/dist/esm/icons/triangle-alert.js:
|
|
592
587
|
lucide-react/dist/esm/icons/trophy.js:
|
|
593
588
|
lucide-react/dist/esm/lucide-react.js:
|
|
594
589
|
(**
|