@syntrologie/runtime-sdk 2.4.0-canary.22 → 2.4.0-canary.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/schema.d.ts +3603 -36279
- package/dist/actions/schema.js +3 -3
- package/dist/{chunk-P5G4KT2U.js → chunk-BU4Z6PD7.js} +9 -4
- package/dist/chunk-BU4Z6PD7.js.map +7 -0
- package/dist/{chunk-WCQCVPJ7.js → chunk-LD22WJ44.js} +440 -132
- package/dist/chunk-LD22WJ44.js.map +7 -0
- package/dist/{chunk-HF3D7YFQ.js → chunk-NM5Y27GX.js} +24 -26
- package/dist/chunk-NM5Y27GX.js.map +7 -0
- package/dist/{chunk-2UYZ5DWI.js → chunk-WILWIL6L.js} +43 -5
- package/dist/chunk-WILWIL6L.js.map +7 -0
- package/dist/components/ShadowCanvasOverlay.d.ts +2 -1
- package/dist/components/TileIcon.d.ts +14 -0
- package/dist/config/schema.d.ts +914 -3656
- package/dist/config/schema.js +4 -2
- package/dist/decisions/schema.d.ts +19 -1467
- package/dist/decisions/schema.js +3 -1
- package/dist/decisions/types.d.ts +2 -2
- package/dist/index.js +87 -94
- package/dist/index.js.map +2 -2
- package/dist/react.js +4 -4
- package/dist/smart-canvas.esm.js +105 -62
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +849 -295
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +105 -62
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/theme/types.d.ts +2 -1
- package/dist/version.d.ts +1 -1
- package/dist/widgets/WidgetRegistry.d.ts +1 -0
- package/package.json +9 -8
- package/schema/canvas-config.schema.json +1346 -372
- package/dist/chunk-2UYZ5DWI.js.map +0 -7
- package/dist/chunk-HF3D7YFQ.js.map +0 -7
- package/dist/chunk-P5G4KT2U.js.map +0 -7
- package/dist/chunk-WCQCVPJ7.js.map +0 -7
package/dist/smart-canvas.esm.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var rR=Object.create;var Xc=Object.defineProperty;var oR=Object.getOwnPropertyDescriptor;var aR=Object.getOwnPropertyNames;var sR=Object.getPrototypeOf,lR=Object.prototype.hasOwnProperty;var r0=t=>{throw TypeError(t)};var cR=(t,e,n)=>e in t?Xc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Kn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),uR=(t,e)=>{for(var n in e)Xc(t,n,{get:e[n],enumerable:!0})},dR=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of aR(e))!lR.call(t,r)&&r!==n&&Xc(t,r,{get:()=>e[r],enumerable:!(i=oR(e,r))||i.enumerable});return t};var X=(t,e,n)=>(n=t!=null?rR(sR(t)):{},dR(e||!t||!t.__esModule?Xc(n,"default",{value:t,enumerable:!0}):n,t));var P=(t,e,n)=>cR(t,typeof e!="symbol"?e+"":e,n),o0=(t,e,n)=>e.has(t)||r0("Cannot "+n);var ge=(t,e,n)=>(o0(t,e,"read from private field"),n?n.call(t):e.get(t)),ar=(t,e,n)=>e.has(t)?r0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Qn=(t,e,n,i)=>(o0(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n);var m0=Kn(ie=>{"use strict";var _p=Symbol.for("react.transitional.element"),fR=Symbol.for("react.portal"),pR=Symbol.for("react.fragment"),hR=Symbol.for("react.strict_mode"),gR=Symbol.for("react.profiler"),mR=Symbol.for("react.consumer"),vR=Symbol.for("react.context"),yR=Symbol.for("react.forward_ref"),bR=Symbol.for("react.suspense"),_R=Symbol.for("react.memo"),u0=Symbol.for("react.lazy"),SR=Symbol.for("react.activity"),a0=Symbol.iterator;function xR(t){return t===null||typeof t!="object"?null:(t=a0&&t[a0]||t["@@iterator"],typeof t=="function"?t:null)}var d0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f0=Object.assign,p0={};function la(t,e,n){this.props=t,this.context=e,this.refs=p0,this.updater=n||d0}la.prototype.isReactComponent={};la.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")};la.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function h0(){}h0.prototype=la.prototype;function Sp(t,e,n){this.props=t,this.context=e,this.refs=p0,this.updater=n||d0}var xp=Sp.prototype=new h0;xp.constructor=Sp;f0(xp,la.prototype);xp.isPureReactComponent=!0;var s0=Array.isArray;function bp(){}var De={H:null,A:null,T:null,S:null},g0=Object.prototype.hasOwnProperty;function wp(t,e,n){var i=n.ref;return{$$typeof:_p,type:t,key:e,ref:i!==void 0?i:null,props:n}}function wR(t,e){return wp(t.type,e,t.props)}function Ep(t){return typeof t=="object"&&t!==null&&t.$$typeof===_p}function ER(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var l0=/\/+/g;function yp(t,e){return typeof t=="object"&&t!==null&&t.key!=null?ER(""+t.key):e.toString(36)}function CR(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(bp,bp):(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 sa(t,e,n,i,r){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(o){case"bigint":case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case _p:case fR:a=!0;break;case u0:return a=t._init,sa(a(t._payload),e,n,i,r)}}if(a)return r=r(t),a=i===""?"."+yp(t,0):i,s0(r)?(n="",a!=null&&(n=a.replace(l0,"$&/")+"/"),sa(r,e,n,"",function(c){return c})):r!=null&&(Ep(r)&&(r=wR(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(l0,"$&/")+"/")+a)),e.push(r)),1;a=0;var s=i===""?".":i+":";if(s0(t))for(var l=0;l<t.length;l++)i=t[l],o=s+yp(i,l),a+=sa(i,e,n,o,r);else if(l=xR(t),typeof l=="function")for(t=l.call(t),l=0;!(i=t.next()).done;)i=i.value,o=s+yp(i,l++),a+=sa(i,e,n,o,r);else if(o==="object"){if(typeof t.then=="function")return sa(CR(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return a}function Kc(t,e,n){if(t==null)return t;var i=[],r=0;return sa(t,i,"","",function(o){return e.call(n,o,r++)}),i}function AR(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var c0=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)},TR={map:Kc,forEach:function(t,e,n){Kc(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Kc(t,function(){e++}),e},toArray:function(t){return Kc(t,function(e){return e})||[]},only:function(t){if(!Ep(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ie.Activity=SR;ie.Children=TR;ie.Component=la;ie.Fragment=pR;ie.Profiler=gR;ie.PureComponent=Sp;ie.StrictMode=hR;ie.Suspense=bR;ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=De;ie.__COMPILER_RUNTIME={__proto__:null,c:function(t){return De.H.useMemoCache(t)}};ie.cache=function(t){return function(){return t.apply(null,arguments)}};ie.cacheSignal=function(){return null};ie.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=f0({},t.props),r=t.key;if(e!=null)for(o in e.key!==void 0&&(r=""+e.key),e)!g0.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(i[o]=e[o]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var a=Array(o),s=0;s<o;s++)a[s]=arguments[s+2];i.children=a}return wp(t.type,r,i)};ie.createContext=function(t){return t={$$typeof:vR,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:mR,_context:t},t};ie.createElement=function(t,e,n){var i,r={},o=null;if(e!=null)for(i in e.key!==void 0&&(o=""+e.key),e)g0.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];r.children=s}if(t&&t.defaultProps)for(i in a=t.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return wp(t,o,r)};ie.createRef=function(){return{current:null}};ie.forwardRef=function(t){return{$$typeof:yR,render:t}};ie.isValidElement=Ep;ie.lazy=function(t){return{$$typeof:u0,_payload:{_status:-1,_result:t},_init:AR}};ie.memo=function(t,e){return{$$typeof:_R,type:t,compare:e===void 0?null:e}};ie.startTransition=function(t){var e=De.T,n={};De.T=n;try{var i=t(),r=De.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(bp,c0)}catch(o){c0(o)}finally{e!==null&&n.types!==null&&(e.types=n.types),De.T=e}};ie.unstable_useCacheRefresh=function(){return De.H.useCacheRefresh()};ie.use=function(t){return De.H.use(t)};ie.useActionState=function(t,e,n){return De.H.useActionState(t,e,n)};ie.useCallback=function(t,e){return De.H.useCallback(t,e)};ie.useContext=function(t){return De.H.useContext(t)};ie.useDebugValue=function(){};ie.useDeferredValue=function(t,e){return De.H.useDeferredValue(t,e)};ie.useEffect=function(t,e){return De.H.useEffect(t,e)};ie.useEffectEvent=function(t){return De.H.useEffectEvent(t)};ie.useId=function(){return De.H.useId()};ie.useImperativeHandle=function(t,e,n){return De.H.useImperativeHandle(t,e,n)};ie.useInsertionEffect=function(t,e){return De.H.useInsertionEffect(t,e)};ie.useLayoutEffect=function(t,e){return De.H.useLayoutEffect(t,e)};ie.useMemo=function(t,e){return De.H.useMemo(t,e)};ie.useOptimistic=function(t,e){return De.H.useOptimistic(t,e)};ie.useReducer=function(t,e,n){return De.H.useReducer(t,e,n)};ie.useRef=function(t){return De.H.useRef(t)};ie.useState=function(t){return De.H.useState(t)};ie.useSyncExternalStore=function(t,e,n){return De.H.useSyncExternalStore(t,e,n)};ie.useTransition=function(){return De.H.useTransition()};ie.version="19.2.4"});var Qe=Kn((wI,v0)=>{"use strict";v0.exports=m0()});var b0=Kn(Dt=>{"use strict";var kR=Qe();function y0(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function sr(){}var Nt={d:{f:sr,r:function(){throw Error(y0(522))},D:sr,C:sr,L:sr,m:sr,X:sr,S:sr,M:sr},p:0,findDOMNode:null},RR=Symbol.for("react.portal");function OR(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:RR,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Fs=kR.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Qc(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Nt;Dt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(y0(299));return OR(t,e,null,n)};Dt.flushSync=function(t){var e=Fs.T,n=Nt.p;try{if(Fs.T=null,Nt.p=2,t)return t()}finally{Fs.T=e,Nt.p=n,Nt.d.f()}};Dt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Nt.d.C(t,e))};Dt.prefetchDNS=function(t){typeof t=="string"&&Nt.d.D(t)};Dt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=Qc(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Nt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:o}):n==="script"&&Nt.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Dt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=Qc(e.as,e.crossOrigin);Nt.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Nt.d.M(t)};Dt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=Qc(n,e.crossOrigin);Nt.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Dt.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=Qc(e.as,e.crossOrigin);Nt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Nt.d.m(t)};Dt.requestFormReset=function(t){Nt.d.r(t)};Dt.unstable_batchedUpdates=function(t,e){return t(e)};Dt.useFormState=function(t,e,n){return Fs.H.useFormState(t,e,n)};Dt.useFormStatus=function(){return Fs.H.useHostTransitionStatus()};Dt.version="19.2.4"});var $s=Kn((CI,S0)=>{"use strict";function _0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_0)}catch(t){console.error(t)}}_0(),S0.exports=b0()});var M0=Kn(ze=>{"use strict";function kp(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<Jc(r,e))t[i]=e,t[n]=r,n=i;else break e}}function Jn(t){return t.length===0?null:t[0]}function tu(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,o=r>>>1;i<o;){var a=2*(i+1)-1,s=t[a],l=a+1,c=t[l];if(0>Jc(s,n))l<r&&0>Jc(c,s)?(t[i]=c,t[l]=n,i=l):(t[i]=s,t[a]=n,i=a);else if(l<r&&0>Jc(c,n))t[i]=c,t[l]=n,i=l;else break e}}return e}function Jc(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}ze.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(x0=performance,ze.unstable_now=function(){return x0.now()}):(Cp=Date,w0=Cp.now(),ze.unstable_now=function(){return Cp.now()-w0});var x0,Cp,w0,gi=[],lr=[],MR=1,gn=null,At=3,Rp=!1,Us=!1,Vs=!1,Op=!1,A0=typeof setTimeout=="function"?setTimeout:null,T0=typeof clearTimeout=="function"?clearTimeout:null,E0=typeof setImmediate<"u"?setImmediate:null;function eu(t){for(var e=Jn(lr);e!==null;){if(e.callback===null)tu(lr);else if(e.startTime<=t)tu(lr),e.sortIndex=e.expirationTime,kp(gi,e);else break;e=Jn(lr)}}function Mp(t){if(Vs=!1,eu(t),!Us)if(Jn(gi)!==null)Us=!0,ua||(ua=!0,ca());else{var e=Jn(lr);e!==null&&Np(Mp,e.startTime-t)}}var ua=!1,js=-1,k0=5,R0=-1;function O0(){return Op?!0:!(ze.unstable_now()-R0<k0)}function Ap(){if(Op=!1,ua){var t=ze.unstable_now();R0=t;var e=!0;try{e:{Us=!1,Vs&&(Vs=!1,T0(js),js=-1),Rp=!0;var n=At;try{t:{for(eu(t),gn=Jn(gi);gn!==null&&!(gn.expirationTime>t&&O0());){var i=gn.callback;if(typeof i=="function"){gn.callback=null,At=gn.priorityLevel;var r=i(gn.expirationTime<=t);if(t=ze.unstable_now(),typeof r=="function"){gn.callback=r,eu(t),e=!0;break t}gn===Jn(gi)&&tu(gi),eu(t)}else tu(gi);gn=Jn(gi)}if(gn!==null)e=!0;else{var o=Jn(lr);o!==null&&Np(Mp,o.startTime-t),e=!1}}break e}finally{gn=null,At=n,Rp=!1}e=void 0}}finally{e?ca():ua=!1}}}var ca;typeof E0=="function"?ca=function(){E0(Ap)}:typeof MessageChannel<"u"?(Tp=new MessageChannel,C0=Tp.port2,Tp.port1.onmessage=Ap,ca=function(){C0.postMessage(null)}):ca=function(){A0(Ap,0)};var Tp,C0;function Np(t,e){js=A0(function(){t(ze.unstable_now())},e)}ze.unstable_IdlePriority=5;ze.unstable_ImmediatePriority=1;ze.unstable_LowPriority=4;ze.unstable_NormalPriority=3;ze.unstable_Profiling=null;ze.unstable_UserBlockingPriority=2;ze.unstable_cancelCallback=function(t){t.callback=null};ze.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"):k0=0<t?Math.floor(1e3/t):5};ze.unstable_getCurrentPriorityLevel=function(){return At};ze.unstable_next=function(t){switch(At){case 1:case 2:case 3:var e=3;break;default:e=At}var n=At;At=e;try{return t()}finally{At=n}};ze.unstable_requestPaint=function(){Op=!0};ze.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=At;At=t;try{return e()}finally{At=n}};ze.unstable_scheduleCallback=function(t,e,n){var i=ze.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,t={id:MR++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,kp(lr,t),Jn(gi)===null&&t===Jn(lr)&&(Vs?(T0(js),js=-1):Vs=!0,Np(Mp,n-i))):(t.sortIndex=r,kp(gi,t),Us||Rp||(Us=!0,ua||(ua=!0,ca()))),t};ze.unstable_shouldYield=O0;ze.unstable_wrapCallback=function(t){var e=At;return function(){var n=At;At=e;try{return t.apply(this,arguments)}finally{At=n}}}});var D0=Kn((TI,N0)=>{"use strict";N0.exports=M0()});var qw=Kn(Ad=>{"use strict";var ot=D0(),oS=Qe(),NR=$s();function M(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function aS(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Rl(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function sS(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 lS(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 L0(t){if(Rl(t)!==t)throw Error(M(188))}function DR(t){var e=t.alternate;if(!e){if(e=Rl(t),e===null)throw Error(M(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var o=r.alternate;if(o===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===n)return L0(r),t;if(o===i)return L0(r),e;o=o.sibling}throw Error(M(188))}if(n.return!==i.return)n=r,i=o;else{for(var a=!1,s=r.child;s;){if(s===n){a=!0,n=r,i=o;break}if(s===i){a=!0,i=r,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,i=r;break}if(s===i){a=!0,i=o,n=r;break}s=s.sibling}if(!a)throw Error(M(189))}}if(n.alternate!==i)throw Error(M(190))}if(n.tag!==3)throw Error(M(188));return n.stateNode.current===n?t:e}function cS(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=cS(t),e!==null)return e;t=t.sibling}return null}var He=Object.assign,LR=Symbol.for("react.element"),nu=Symbol.for("react.transitional.element"),Ks=Symbol.for("react.portal"),ma=Symbol.for("react.fragment"),uS=Symbol.for("react.strict_mode"),fh=Symbol.for("react.profiler"),dS=Symbol.for("react.consumer"),wi=Symbol.for("react.context"),sg=Symbol.for("react.forward_ref"),ph=Symbol.for("react.suspense"),hh=Symbol.for("react.suspense_list"),lg=Symbol.for("react.memo"),cr=Symbol.for("react.lazy"),gh=Symbol.for("react.activity"),IR=Symbol.for("react.memo_cache_sentinel"),I0=Symbol.iterator;function Ps(t){return t===null||typeof t!="object"?null:(t=I0&&t[I0]||t["@@iterator"],typeof t=="function"?t:null)}var HR=Symbol.for("react.client.reference");function mh(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===HR?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ma:return"Fragment";case fh:return"Profiler";case uS:return"StrictMode";case ph:return"Suspense";case hh:return"SuspenseList";case gh:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case Ks:return"Portal";case wi:return t.displayName||"Context";case dS:return(t._context.displayName||"Context")+".Consumer";case sg:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case lg:return e=t.displayName||null,e!==null?e:mh(t.type)||"Memo";case cr:e=t._payload,t=t._init;try{return mh(t(e))}catch{}}return null}var Qs=Array.isArray,Q=oS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=NR.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ho={pending:!1,data:null,method:null,action:null},vh=[],va=-1;function ri(t){return{current:t}}function ft(t){0>va||(t.current=vh[va],vh[va]=null,va--)}function Oe(t,e){va++,vh[va]=t.current,t.current=e}var ii=ri(null),gl=ri(null),_r=ri(null),Iu=ri(null);function Hu(t,e){switch(Oe(_r,e),Oe(gl,t),Oe(ii,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?V_(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=V_(e),t=Mw(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ft(ii),Oe(ii,t)}function Ia(){ft(ii),ft(gl),ft(_r)}function yh(t){t.memoizedState!==null&&Oe(Iu,t);var e=ii.current,n=Mw(e,t.type);e!==n&&(Oe(gl,t),Oe(ii,n))}function zu(t){gl.current===t&&(ft(ii),ft(gl)),Iu.current===t&&(ft(Iu),Al._currentValue=ho)}var Dp,H0;function co(t){if(Dp===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Dp=e&&e[1]||"",H0=-1<n.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<
|
|
3
|
-
`+
|
|
4
|
-
`),
|
|
5
|
-
`);for(r=
|
|
6
|
-
`+l[
|
|
7
|
-
Error generating stack: `+
|
|
8
|
-
`+i.stack}}var bh=Object.prototype.hasOwnProperty,cg=ot.unstable_scheduleCallback,Hp=ot.unstable_cancelCallback,BR=ot.unstable_shouldYield,FR=ot.unstable_requestPaint,rn=ot.unstable_now,$R=ot.unstable_getCurrentPriorityLevel,fS=ot.unstable_ImmediatePriority,pS=ot.unstable_UserBlockingPriority,Bu=ot.unstable_NormalPriority,UR=ot.unstable_LowPriority,hS=ot.unstable_IdlePriority,VR=ot.log,jR=ot.unstable_setDisableYieldValue,Ol=null,on=null;function gr(t){if(typeof VR=="function"&&jR(t),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(Ol,t)}catch{}}var an=Math.clz32?Math.clz32:ZR,PR=Math.log,qR=Math.LN2;function ZR(t){return t>>>=0,t===0?32:31-(PR(t)/qR|0)|0}var iu=256,ru=262144,ou=4194304;function uo(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 ud(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,o=t.suspendedLanes,a=t.pingedLanes;t=t.warmLanes;var s=i&134217727;return s!==0?(i=s&~o,i!==0?r=uo(i):(a&=s,a!==0?r=uo(a):n||(n=s&~t,n!==0&&(r=uo(n))))):(s=i&~o,s!==0?r=uo(s):a!==0?r=uo(a):n||(n=i&~t,n!==0&&(r=uo(n)))),r===0?0:e!==0&&e!==r&&(e&o)===0&&(o=r&-r,n=e&-e,o>=n||o===32&&(n&4194048)!==0)?e:r}function Ml(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function GR(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 gS(){var t=ou;return ou<<=1,(ou&62914560)===0&&(ou=4194304),t}function zp(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Nl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function YR(t,e,n,i,r,o){var a=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(n=a&~n;0<n;){var u=31-an(n),d=1<<u;s[u]=0,l[u]=-1;var h=c[u];if(h!==null)for(c[u]=null,u=0;u<h.length;u++){var m=h[u];m!==null&&(m.lane&=-536870913)}n&=~d}i!==0&&mS(t,i,0),o!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=o&~(a&~e))}function mS(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-an(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&261930}function vS(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-an(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function yS(t,e){var n=e&-e;return n=(n&42)!==0?1:ug(n),(n&(t.suspendedLanes|e))!==0?0:n}function ug(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 dg(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function bS(){var t=ye.p;return t!==0?t:(t=window.event,t===void 0?32:Vw(t.type))}function B0(t,e){var n=ye.p;try{return ye.p=t,e()}finally{ye.p=n}}var Dr=Math.random().toString(36).slice(2),mt="__reactFiber$"+Dr,jt="__reactProps$"+Dr,Za="__reactContainer$"+Dr,_h="__reactEvents$"+Dr,WR="__reactListeners$"+Dr,XR="__reactHandles$"+Dr,F0="__reactResources$"+Dr,Dl="__reactMarker$"+Dr;function fg(t){delete t[mt],delete t[jt],delete t[_h],delete t[WR],delete t[XR]}function ya(t){var e=t[mt];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Za]||n[mt]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=G_(t);t!==null;){if(n=t[mt])return n;t=G_(t)}return e}t=n,n=t.parentNode}return null}function Ga(t){if(t=t[mt]||t[Za]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function Js(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(M(33))}function ka(t){var e=t[F0];return e||(e=t[F0]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function dt(t){t[Dl]=!0}var _S=new Set,SS={};function Eo(t,e){Ha(t,e),Ha(t+"Capture",e)}function Ha(t,e){for(SS[t]=e,t=0;t<e.length;t++)_S.add(e[t])}var KR=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]*$"),$0={},U0={};function QR(t){return bh.call(U0,t)?!0:bh.call($0,t)?!1:KR.test(t)?U0[t]=!0:($0[t]=!0,!1)}function _u(t,e,n){if(QR(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function au(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function mi(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}function vn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function xS(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function JR(t,e,n){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,o=i.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(a){n=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Sh(t){if(!t._valueTracker){var e=xS(t)?"checked":"value";t._valueTracker=JR(t,e,""+t[e])}}function wS(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=xS(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function Fu(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 e2=/[\n"\\]/g;function _n(t){return t.replace(e2,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function xh(t,e,n,i,r,o,a,s){t.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?t.type=a:t.removeAttribute("type"),e!=null?a==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+vn(e)):t.value!==""+vn(e)&&(t.value=""+vn(e)):a!=="submit"&&a!=="reset"||t.removeAttribute("value"),e!=null?wh(t,a,vn(e)):n!=null?wh(t,a,vn(n)):i!=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=""+vn(s):t.removeAttribute("name")}function ES(t,e,n,i,r,o,a,s){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.type=o),e!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||e!=null)){Sh(t);return}n=n!=null?""+vn(n):"",e=e!=null?""+vn(e):n,s||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=s?t.checked:!!i,t.defaultChecked=!!i,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.name=a),Sh(t)}function wh(t,e,n){e==="number"&&Fu(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Ra(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+vn(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function CS(t,e,n){if(e!=null&&(e=""+vn(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+vn(n):""}function AS(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(M(92));if(Qs(i)){if(1<i.length)throw Error(M(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=vn(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i),Sh(t)}function za(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var t2=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 V0(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||t2.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function TS(t,e,n){if(e!=null&&typeof e!="object")throw Error(M(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&V0(t,r,i)}else for(var o in e)e.hasOwnProperty(o)&&V0(t,o,e[o])}function pg(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"]]),i2=/^[\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 Su(t){return i2.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Ei(){}var Eh=null;function hg(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ba=null,Oa=null;function j0(t){var e=Ga(t);if(e&&(t=e.stateNode)){var n=t[jt]||null;e:switch(t=e.stateNode,e.type){case"input":if(xh(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+_n(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[jt]||null;if(!r)throw Error(M(90));xh(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&wS(i)}break e;case"textarea":CS(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&Ra(t,!!n.multiple,e,!1)}}}var Bp=!1;function kS(t,e,n){if(Bp)return t(e,n);Bp=!0;try{var i=t(e);return i}finally{if(Bp=!1,(ba!==null||Oa!==null)&&(xd(),ba&&(e=ba,t=Oa,Oa=ba=null,j0(e),t)))for(e=0;e<t.length;e++)j0(t[e])}}function ml(t,e){var n=t.stateNode;if(n===null)return null;var i=n[jt]||null;if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(M(231,e,typeof n));return n}var Ri=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ch=!1;if(Ri)try{da={},Object.defineProperty(da,"passive",{get:function(){Ch=!0}}),window.addEventListener("test",da,da),window.removeEventListener("test",da,da)}catch{Ch=!1}var da,mr=null,gg=null,xu=null;function RS(){if(xu)return xu;var t,e=gg,n=e.length,i,r="value"in mr?mr.value:mr.textContent,o=r.length;for(t=0;t<n&&e[t]===r[t];t++);var a=n-t;for(i=1;i<=a&&e[n-i]===r[o-i];i++);return xu=r.slice(t,1<i?1-i:void 0)}function wu(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 su(){return!0}function P0(){return!1}function Pt(t){function e(n,i,r,o,a){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(n=t[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?su:P0,this.isPropagationStopped=P0,this}return He(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=su)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=su)},persist:function(){},isPersistent:su}),e}var Co={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dd=Pt(Co),Ll=He({},Co,{view:0,detail:0}),r2=Pt(Ll),Fp,$p,qs,fd=He({},Ll,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mg,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!==qs&&(qs&&t.type==="mousemove"?(Fp=t.screenX-qs.screenX,$p=t.screenY-qs.screenY):$p=Fp=0,qs=t),Fp)},movementY:function(t){return"movementY"in t?t.movementY:$p}}),q0=Pt(fd),o2=He({},fd,{dataTransfer:0}),a2=Pt(o2),s2=He({},Ll,{relatedTarget:0}),Up=Pt(s2),l2=He({},Co,{animationName:0,elapsedTime:0,pseudoElement:0}),c2=Pt(l2),u2=He({},Co,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),d2=Pt(u2),f2=He({},Co,{data:0}),Z0=Pt(f2),p2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},h2={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"},g2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function m2(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=g2[t])?!!e[t]:!1}function mg(){return m2}var v2=He({},Ll,{key:function(t){if(t.key){var e=p2[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=wu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?h2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mg,charCode:function(t){return t.type==="keypress"?wu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?wu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),y2=Pt(v2),b2=He({},fd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),G0=Pt(b2),_2=He({},Ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mg}),S2=Pt(_2),x2=He({},Co,{propertyName:0,elapsedTime:0,pseudoElement:0}),w2=Pt(x2),E2=He({},fd,{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}),C2=Pt(E2),A2=He({},Co,{newState:0,oldState:0}),T2=Pt(A2),k2=[9,13,27,32],vg=Ri&&"CompositionEvent"in window,nl=null;Ri&&"documentMode"in document&&(nl=document.documentMode);var R2=Ri&&"TextEvent"in window&&!nl,OS=Ri&&(!vg||nl&&8<nl&&11>=nl),Y0=" ",W0=!1;function MS(t,e){switch(t){case"keyup":return k2.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function NS(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _a=!1;function O2(t,e){switch(t){case"compositionend":return NS(e);case"keypress":return e.which!==32?null:(W0=!0,Y0);case"textInput":return t=e.data,t===Y0&&W0?null:t;default:return null}}function M2(t,e){if(_a)return t==="compositionend"||!vg&&MS(t,e)?(t=RS(),xu=gg=mr=null,_a=!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 OS&&e.locale!=="ko"?null:e.data;default:return null}}var N2={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"?!!N2[t.type]:e==="textarea"}function DS(t,e,n,i){ba?Oa?Oa.push(i):Oa=[i]:ba=i,e=id(e,"onChange"),0<e.length&&(n=new dd("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var il=null,vl=null;function D2(t){kw(t,0)}function pd(t){var e=Js(t);if(wS(e))return t}function K0(t,e){if(t==="change")return e}var LS=!1;Ri&&(Ri?(cu="oninput"in document,cu||(Vp=document.createElement("div"),Vp.setAttribute("oninput","return;"),cu=typeof Vp.oninput=="function"),lu=cu):lu=!1,LS=lu&&(!document.documentMode||9<document.documentMode));var lu,cu,Vp;function Q0(){il&&(il.detachEvent("onpropertychange",IS),vl=il=null)}function IS(t){if(t.propertyName==="value"&&pd(vl)){var e=[];DS(e,vl,t,hg(t)),kS(D2,e)}}function L2(t,e,n){t==="focusin"?(Q0(),il=e,vl=n,il.attachEvent("onpropertychange",IS)):t==="focusout"&&Q0()}function I2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return pd(vl)}function H2(t,e){if(t==="click")return pd(e)}function z2(t,e){if(t==="input"||t==="change")return pd(e)}function B2(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ln=typeof Object.is=="function"?Object.is:B2;function yl(t,e){if(ln(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!bh.call(e,r)||!ln(t[r],e[r]))return!1}return!0}function J0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function e_(t,e){var n=J0(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=J0(n)}}function HS(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?HS(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function zS(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Fu(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Fu(t.document)}return e}function yg(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 F2=Ri&&"documentMode"in document&&11>=document.documentMode,Sa=null,Ah=null,rl=null,Th=!1;function t_(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Th||Sa==null||Sa!==Fu(i)||(i=Sa,"selectionStart"in i&&yg(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),rl&&yl(rl,i)||(rl=i,i=id(Ah,"onSelect"),0<i.length&&(e=new dd("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=Sa)))}function lo(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var xa={animationend:lo("Animation","AnimationEnd"),animationiteration:lo("Animation","AnimationIteration"),animationstart:lo("Animation","AnimationStart"),transitionrun:lo("Transition","TransitionRun"),transitionstart:lo("Transition","TransitionStart"),transitioncancel:lo("Transition","TransitionCancel"),transitionend:lo("Transition","TransitionEnd")},jp={},BS={};Ri&&(BS=document.createElement("div").style,"AnimationEvent"in window||(delete xa.animationend.animation,delete xa.animationiteration.animation,delete xa.animationstart.animation),"TransitionEvent"in window||delete xa.transitionend.transition);function Ao(t){if(jp[t])return jp[t];if(!xa[t])return t;var e=xa[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in BS)return jp[t]=e[n];return t}var FS=Ao("animationend"),$S=Ao("animationiteration"),US=Ao("animationstart"),$2=Ao("transitionrun"),U2=Ao("transitionstart"),V2=Ao("transitioncancel"),VS=Ao("transitionend"),jS=new Map,kh="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(" ");kh.push("scrollEnd");function Fn(t,e){jS.set(t,e),Eo(e,[t])}var $u=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)},mn=[],wa=0,bg=0;function hd(){for(var t=wa,e=bg=wa=0;e<t;){var n=mn[e];mn[e++]=null;var i=mn[e];mn[e++]=null;var r=mn[e];mn[e++]=null;var o=mn[e];if(mn[e++]=null,i!==null&&r!==null){var a=i.pending;a===null?r.next=r:(r.next=a.next,a.next=r),i.pending=r}o!==0&&PS(n,r,o)}}function gd(t,e,n,i){mn[wa++]=t,mn[wa++]=e,mn[wa++]=n,mn[wa++]=i,bg|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function _g(t,e,n,i){return gd(t,e,n,i),Uu(t)}function To(t,e){return gd(t,null,null,e),Uu(t)}function PS(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,o=t.return;o!==null;)o.childLanes|=n,i=o.alternate,i!==null&&(i.childLanes|=n),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-an(n),t=o.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),o):null}function Uu(t){if(50<pl)throw pl=0,Wh=null,Error(M(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Ea={};function j2(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(t,e,n,i){return new j2(t,e,n,i)}function Sg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ai(t,e){var n=t.alternate;return n===null?(n=tn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function qS(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Eu(t,e,n,i,r,o){var a=0;if(i=t,typeof t=="function")Sg(t)&&(a=1);else if(typeof t=="string")a=ZO(t,n,ii.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case gh:return t=tn(31,n,e,r),t.elementType=gh,t.lanes=o,t;case ma:return go(n.children,r,o,e);case uS:a=8,r|=24;break;case fh:return t=tn(12,n,e,r|2),t.elementType=fh,t.lanes=o,t;case ph:return t=tn(13,n,e,r),t.elementType=ph,t.lanes=o,t;case hh:return t=tn(19,n,e,r),t.elementType=hh,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case wi:a=10;break e;case dS:a=9;break e;case sg:a=11;break e;case lg:a=14;break e;case cr:a=16,i=null;break e}a=29,n=Error(M(130,t===null?"null":typeof t,"")),i=null}return e=tn(a,n,e,r),e.elementType=t,e.type=i,e.lanes=o,e}function go(t,e,n,i){return t=tn(7,t,i,e),t.lanes=n,t}function Pp(t,e,n){return t=tn(6,t,null,e),t.lanes=n,t}function ZS(t){var e=tn(18,null,null,0);return e.stateNode=t,e}function qp(t,e,n){return e=tn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var n_=new WeakMap;function Sn(t,e){if(typeof t=="object"&&t!==null){var n=n_.get(t);return n!==void 0?n:(e={value:t,source:e,stack:z0(e)},n_.set(t,e),e)}return{value:t,source:e,stack:z0(e)}}var Ca=[],Aa=0,Vu=null,bl=0,yn=[],bn=0,Rr=null,ei=1,ti="";function Si(t,e){Ca[Aa++]=bl,Ca[Aa++]=Vu,Vu=t,bl=e}function GS(t,e,n){yn[bn++]=ei,yn[bn++]=ti,yn[bn++]=Rr,Rr=t;var i=ei;t=ti;var r=32-an(i)-1;i&=~(1<<r),n+=1;var o=32-an(e)+r;if(30<o){var a=r-r%5;o=(i&(1<<a)-1).toString(32),i>>=a,r-=a,ei=1<<32-an(e)+r|n<<r|i,ti=o+t}else ei=1<<o|n<<r|i,ti=t}function xg(t){t.return!==null&&(Si(t,1),GS(t,1,0))}function wg(t){for(;t===Vu;)Vu=Ca[--Aa],Ca[Aa]=null,bl=Ca[--Aa],Ca[Aa]=null;for(;t===Rr;)Rr=yn[--bn],yn[bn]=null,ti=yn[--bn],yn[bn]=null,ei=yn[--bn],yn[bn]=null}function YS(t,e){yn[bn++]=ei,yn[bn++]=ti,yn[bn++]=Rr,ei=e.id,ti=e.overflow,Rr=t}var vt=null,Ie=null,he=!1,Sr=null,xn=!1,Rh=Error(M(519));function Or(t){var e=Error(M(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _l(Sn(e,t)),Rh}function i_(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[mt]=t,e[jt]=i,n){case"dialog":le("cancel",e),le("close",e);break;case"iframe":case"object":case"embed":le("load",e);break;case"video":case"audio":for(n=0;n<El.length;n++)le(El[n],e);break;case"source":le("error",e);break;case"img":case"image":case"link":le("error",e),le("load",e);break;case"details":le("toggle",e);break;case"input":le("invalid",e),ES(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":le("invalid",e);break;case"textarea":le("invalid",e),AS(e,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||Ow(e.textContent,n)?(i.popover!=null&&(le("beforetoggle",e),le("toggle",e)),i.onScroll!=null&&le("scroll",e),i.onScrollEnd!=null&&le("scrollend",e),i.onClick!=null&&(e.onclick=Ei),e=!0):e=!1,e||Or(t,!0)}function r_(t){for(vt=t.return;vt;)switch(vt.tag){case 5:case 31:case 13:xn=!1;return;case 27:case 3:xn=!0;return;default:vt=vt.return}}function fa(t){if(t!==vt)return!1;if(!he)return r_(t),he=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||eg(t.type,t.memoizedProps)),n=!n),n&&Ie&&Or(t),r_(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Ie=Z_(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Ie=Z_(t)}else e===27?(e=Ie,Lr(t.type)?(t=rg,rg=null,Ie=t):Ie=e):Ie=vt?En(t.stateNode.nextSibling):null;return!0}function bo(){Ie=vt=null,he=!1}function Zp(){var t=Sr;return t!==null&&(Ut===null?Ut=t:Ut.push.apply(Ut,t),Sr=null),t}function _l(t){Sr===null?Sr=[t]:Sr.push(t)}var Oh=ri(null),ko=null,Ci=null;function dr(t,e,n){Oe(Oh,e._currentValue),e._currentValue=n}function Ti(t){t._currentValue=Oh.current,ft(Oh)}function Mh(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function Nh(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var o=r.dependencies;if(o!==null){var a=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|=n,s=o.alternate,s!==null&&(s.lanes|=n),Mh(o.return,n,t),i||(a=null);break e}o=s.next}}else if(r.tag===18){if(a=r.return,a===null)throw Error(M(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Mh(a,n,t),a=null}else a=r.child;if(a!==null)a.return=r;else for(a=r;a!==null;){if(a===t){a=null;break}if(r=a.sibling,r!==null){r.return=a.return,a=r;break}a=a.return}r=a}}function Ya(t,e,n,i){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 a=r.alternate;if(a===null)throw Error(M(387));if(a=a.memoizedProps,a!==null){var s=r.type;ln(r.pendingProps.value,a.value)||(t!==null?t.push(s):t=[s])}}else if(r===Iu.current){if(a=r.alternate,a===null)throw Error(M(387));a.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(Al):t=[Al])}r=r.return}t!==null&&Nh(e,t,n,i),e.flags|=262144}function ju(t){for(t=t.firstContext;t!==null;){if(!ln(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function _o(t){ko=t,Ci=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function yt(t){return WS(ko,t)}function uu(t,e){return ko===null&&_o(t),WS(t,e)}function WS(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},Ci===null){if(t===null)throw Error(M(308));Ci=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Ci=Ci.next=e;return n}var P2=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},q2=ot.unstable_scheduleCallback,Z2=ot.unstable_NormalPriority,tt={$$typeof:wi,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Eg(){return{controller:new P2,data:new Map,refCount:0}}function Il(t){t.refCount--,t.refCount===0&&q2(Z2,function(){t.controller.abort()})}var ol=null,Dh=0,Ba=0,Ma=null;function G2(t,e){if(ol===null){var n=ol=[];Dh=0,Ba=Wg(),Ma={status:"pending",value:void 0,then:function(i){n.push(i)}}}return Dh++,e.then(o_,o_),e}function o_(){if(--Dh===0&&ol!==null){Ma!==null&&(Ma.status="fulfilled");var t=ol;ol=null,Ba=0,Ma=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function Y2(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var a_=Q.S;Q.S=function(t,e){cw=rn(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&G2(t,e),a_!==null&&a_(t,e)};var mo=ri(null);function Cg(){var t=mo.current;return t!==null?t:Ae.pooledCache}function Cu(t,e){e===null?Oe(mo,mo.current):Oe(mo,e.pool)}function XS(){var t=Cg();return t===null?null:{parent:tt._currentValue,pool:t}}var Wa=Error(M(460)),Ag=Error(M(474)),md=Error(M(542)),Pu={then:function(){}};function s_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function KS(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(Ei,Ei),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,c_(t),t;default:if(typeof e.status=="string")e.then(Ei,Ei);else{if(t=Ae,t!==null&&100<t.shellSuspendCounter)throw Error(M(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,c_(t),t}throw vo=e,Wa}}function fo(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(vo=n,Wa):n}}var vo=null;function l_(){if(vo===null)throw Error(M(459));var t=vo;return vo=null,t}function c_(t){if(t===Wa||t===md)throw Error(M(483))}var Na=null,Sl=0;function du(t){var e=Sl;return Sl+=1,Na===null&&(Na=[]),KS(Na,t,e)}function Zs(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function fu(t,e){throw e.$$typeof===LR?Error(M(525)):(t=Object.prototype.toString.call(e),Error(M(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function QS(t){function e(f,p){if(t){var v=f.deletions;v===null?(f.deletions=[p],f.flags|=16):v.push(p)}}function n(f,p){if(!t)return null;for(;p!==null;)e(f,p),p=p.sibling;return null}function i(f){for(var p=new Map;f!==null;)f.key!==null?p.set(f.key,f):p.set(f.index,f),f=f.sibling;return p}function r(f,p){return f=Ai(f,p),f.index=0,f.sibling=null,f}function o(f,p,v){return f.index=v,t?(v=f.alternate,v!==null?(v=v.index,v<p?(f.flags|=67108866,p):v):(f.flags|=67108866,p)):(f.flags|=1048576,p)}function a(f){return t&&f.alternate===null&&(f.flags|=67108866),f}function s(f,p,v,y){return p===null||p.tag!==6?(p=Pp(v,f.mode,y),p.return=f,p):(p=r(p,v),p.return=f,p)}function l(f,p,v,y){var w=v.type;return w===ma?u(f,p,v.props.children,y,v.key):p!==null&&(p.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===cr&&fo(w)===p.type)?(p=r(p,v.props),Zs(p,v),p.return=f,p):(p=Eu(v.type,v.key,v.props,null,f.mode,y),Zs(p,v),p.return=f,p)}function c(f,p,v,y){return p===null||p.tag!==4||p.stateNode.containerInfo!==v.containerInfo||p.stateNode.implementation!==v.implementation?(p=qp(v,f.mode,y),p.return=f,p):(p=r(p,v.children||[]),p.return=f,p)}function u(f,p,v,y,w){return p===null||p.tag!==7?(p=go(v,f.mode,y,w),p.return=f,p):(p=r(p,v),p.return=f,p)}function d(f,p,v){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=Pp(""+p,f.mode,v),p.return=f,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case nu:return v=Eu(p.type,p.key,p.props,null,f.mode,v),Zs(v,p),v.return=f,v;case Ks:return p=qp(p,f.mode,v),p.return=f,p;case cr:return p=fo(p),d(f,p,v)}if(Qs(p)||Ps(p))return p=go(p,f.mode,v,null),p.return=f,p;if(typeof p.then=="function")return d(f,du(p),v);if(p.$$typeof===wi)return d(f,uu(f,p),v);fu(f,p)}return null}function h(f,p,v,y){var w=p!==null?p.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return w!==null?null:s(f,p,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case nu:return v.key===w?l(f,p,v,y):null;case Ks:return v.key===w?c(f,p,v,y):null;case cr:return v=fo(v),h(f,p,v,y)}if(Qs(v)||Ps(v))return w!==null?null:u(f,p,v,y,null);if(typeof v.then=="function")return h(f,p,du(v),y);if(v.$$typeof===wi)return h(f,p,uu(f,v),y);fu(f,v)}return null}function m(f,p,v,y,w){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return f=f.get(v)||null,s(p,f,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case nu:return f=f.get(y.key===null?v:y.key)||null,l(p,f,y,w);case Ks:return f=f.get(y.key===null?v:y.key)||null,c(p,f,y,w);case cr:return y=fo(y),m(f,p,v,y,w)}if(Qs(y)||Ps(y))return f=f.get(v)||null,u(p,f,y,w,null);if(typeof y.then=="function")return m(f,p,v,du(y),w);if(y.$$typeof===wi)return m(f,p,v,uu(p,y),w);fu(p,y)}return null}function S(f,p,v,y){for(var w=null,A=null,x=p,T=p=0,k=null;x!==null&&T<v.length;T++){x.index>T?(k=x,x=null):k=x.sibling;var E=h(f,x,v[T],y);if(E===null){x===null&&(x=k);break}t&&x&&E.alternate===null&&e(f,x),p=o(E,p,T),A===null?w=E:A.sibling=E,A=E,x=k}if(T===v.length)return n(f,x),he&&Si(f,T),w;if(x===null){for(;T<v.length;T++)x=d(f,v[T],y),x!==null&&(p=o(x,p,T),A===null?w=x:A.sibling=x,A=x);return he&&Si(f,T),w}for(x=i(x);T<v.length;T++)k=m(x,f,T,v[T],y),k!==null&&(t&&k.alternate!==null&&x.delete(k.key===null?T:k.key),p=o(k,p,T),A===null?w=k:A.sibling=k,A=k);return t&&x.forEach(function(R){return e(f,R)}),he&&Si(f,T),w}function _(f,p,v,y){if(v==null)throw Error(M(151));for(var w=null,A=null,x=p,T=p=0,k=null,E=v.next();x!==null&&!E.done;T++,E=v.next()){x.index>T?(k=x,x=null):k=x.sibling;var R=h(f,x,E.value,y);if(R===null){x===null&&(x=k);break}t&&x&&R.alternate===null&&e(f,x),p=o(R,p,T),A===null?w=R:A.sibling=R,A=R,x=k}if(E.done)return n(f,x),he&&Si(f,T),w;if(x===null){for(;!E.done;T++,E=v.next())E=d(f,E.value,y),E!==null&&(p=o(E,p,T),A===null?w=E:A.sibling=E,A=E);return he&&Si(f,T),w}for(x=i(x);!E.done;T++,E=v.next())E=m(x,f,T,E.value,y),E!==null&&(t&&E.alternate!==null&&x.delete(E.key===null?T:E.key),p=o(E,p,T),A===null?w=E:A.sibling=E,A=E);return t&&x.forEach(function(D){return e(f,D)}),he&&Si(f,T),w}function b(f,p,v,y){if(typeof v=="object"&&v!==null&&v.type===ma&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case nu:e:{for(var w=v.key;p!==null;){if(p.key===w){if(w=v.type,w===ma){if(p.tag===7){n(f,p.sibling),y=r(p,v.props.children),y.return=f,f=y;break e}}else if(p.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===cr&&fo(w)===p.type){n(f,p.sibling),y=r(p,v.props),Zs(y,v),y.return=f,f=y;break e}n(f,p);break}else e(f,p);p=p.sibling}v.type===ma?(y=go(v.props.children,f.mode,y,v.key),y.return=f,f=y):(y=Eu(v.type,v.key,v.props,null,f.mode,y),Zs(y,v),y.return=f,f=y)}return a(f);case Ks:e:{for(w=v.key;p!==null;){if(p.key===w)if(p.tag===4&&p.stateNode.containerInfo===v.containerInfo&&p.stateNode.implementation===v.implementation){n(f,p.sibling),y=r(p,v.children||[]),y.return=f,f=y;break e}else{n(f,p);break}else e(f,p);p=p.sibling}y=qp(v,f.mode,y),y.return=f,f=y}return a(f);case cr:return v=fo(v),b(f,p,v,y)}if(Qs(v))return S(f,p,v,y);if(Ps(v)){if(w=Ps(v),typeof w!="function")throw Error(M(150));return v=w.call(v),_(f,p,v,y)}if(typeof v.then=="function")return b(f,p,du(v),y);if(v.$$typeof===wi)return b(f,p,uu(f,v),y);fu(f,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,p!==null&&p.tag===6?(n(f,p.sibling),y=r(p,v),y.return=f,f=y):(n(f,p),y=Pp(v,f.mode,y),y.return=f,f=y),a(f)):n(f,p)}return function(f,p,v,y){try{Sl=0;var w=b(f,p,v,y);return Na=null,w}catch(x){if(x===Wa||x===md)throw x;var A=tn(29,x,null,f.mode);return A.lanes=y,A.return=f,A}}}var So=QS(!0),JS=QS(!1),ur=!1;function Tg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lh(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 xr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function wr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(ve&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=Uu(t),PS(t,null,n),e}return gd(t,i,e,n),Uu(t)}function al(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,vS(t,n)}}function Gp(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?r=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?r=o=e:o=o.next=e}else r=o=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Ih=!1;function sl(){if(Ih){var t=Ma;if(t!==null)throw t}}function ll(t,e,n,i){Ih=!1;var r=t.updateQueue;ur=!1;var o=r.firstBaseUpdate,a=r.lastBaseUpdate,s=r.shared.pending;if(s!==null){r.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?o=c:a.next=c,a=l;var u=t.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==a&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=r.baseState;a=0,u=c=l=null,s=o;do{var h=s.lane&-536870913,m=h!==s.lane;if(m?(fe&h)===h:(i&h)===h){h!==0&&h===Ba&&(Ih=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var S=t,_=s;h=e;var b=n;switch(_.tag){case 1:if(S=_.payload,typeof S=="function"){d=S.call(b,d,h);break e}d=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=_.payload,h=typeof S=="function"?S.call(b,d,h):S,h==null)break e;d=He({},d,h);break e;case 2:ur=!0}}h=s.callback,h!==null&&(t.flags|=64,m&&(t.flags|=8192),m=r.callbacks,m===null?r.callbacks=[h]:m.push(h))}else m={lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=m,l=d):u=u.next=m,a|=h;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);u===null&&(l=d),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,o===null&&(r.shared.lanes=0),Nr|=a,t.lanes=a,t.memoizedState=d}}function ex(t,e){if(typeof t!="function")throw Error(M(191,t));t.call(e)}function tx(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)ex(n[t],e)}var Fa=ri(null),qu=ri(0);function u_(t,e){t=Di,Oe(qu,t),Oe(Fa,e),Di=t|e.baseLanes}function Hh(){Oe(qu,Di),Oe(Fa,Fa.current)}function kg(){Di=qu.current,ft(Fa),ft(qu)}var cn=ri(null),wn=null;function fr(t){var e=t.alternate;Oe(Ye,Ye.current&1),Oe(cn,t),wn===null&&(e===null||Fa.current!==null||e.memoizedState!==null)&&(wn=t)}function zh(t){Oe(Ye,Ye.current),Oe(cn,t),wn===null&&(wn=t)}function nx(t){t.tag===22?(Oe(Ye,Ye.current),Oe(cn,t),wn===null&&(wn=t)):pr(t)}function pr(){Oe(Ye,Ye.current),Oe(cn,cn.current)}function en(t){ft(cn),wn===t&&(wn=null),ft(Ye)}var Ye=ri(0);function Zu(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ng(n)||ig(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Oi=0,re=null,Ee=null,Je=null,Gu=!1,Da=!1,xo=!1,Yu=0,xl=0,La=null,W2=0;function Ze(){throw Error(M(321))}function Rg(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!ln(t[n],e[n]))return!1;return!0}function Og(t,e,n,i,r,o){return Oi=o,re=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Q.H=t===null||t.memoizedState===null?Dx:Ug,xo=!1,o=n(i,r),xo=!1,Da&&(o=rx(e,n,i,r)),ix(t),o}function ix(t){Q.H=wl;var e=Ee!==null&&Ee.next!==null;if(Oi=0,Je=Ee=re=null,Gu=!1,xl=0,La=null,e)throw Error(M(300));t===null||nt||(t=t.dependencies,t!==null&&ju(t)&&(nt=!0))}function rx(t,e,n,i){re=t;var r=0;do{if(Da&&(La=null),xl=0,Da=!1,25<=r)throw Error(M(301));if(r+=1,Je=Ee=null,t.updateQueue!=null){var o=t.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}Q.H=Lx,o=e(n,i)}while(Da);return o}function X2(){var t=Q.H,e=t.useState()[0];return e=typeof e.then=="function"?Hl(e):e,t=t.useState()[0],(Ee!==null?Ee.memoizedState:null)!==t&&(re.flags|=1024),e}function Mg(){var t=Yu!==0;return Yu=0,t}function Ng(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function Dg(t){if(Gu){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}Gu=!1}Oi=0,Je=Ee=re=null,Da=!1,xl=Yu=0,La=null}function Lt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?re.memoizedState=Je=t:Je=Je.next=t,Je}function We(){if(Ee===null){var t=re.alternate;t=t!==null?t.memoizedState:null}else t=Ee.next;var e=Je===null?re.memoizedState:Je.next;if(e!==null)Je=e,Ee=t;else{if(t===null)throw re.alternate===null?Error(M(467)):Error(M(310));Ee=t,t={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Je===null?re.memoizedState=Je=t:Je=Je.next=t}return Je}function vd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hl(t){var e=xl;return xl+=1,La===null&&(La=[]),t=KS(La,t,e),e=re,(Je===null?e.memoizedState:Je.next)===null&&(e=e.alternate,Q.H=e===null||e.memoizedState===null?Dx:Ug),t}function yd(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Hl(t);if(t.$$typeof===wi)return yt(t)}throw Error(M(438,String(t)))}function Lg(t){var e=null,n=re.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=re.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=vd(),re.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=IR;return e.index++,n}function Mi(t,e){return typeof e=="function"?e(t):e}function Au(t){var e=We();return Ig(e,Ee,t)}function Ig(t,e,n){var i=t.queue;if(i===null)throw Error(M(311));i.lastRenderedReducer=n;var r=t.baseQueue,o=i.pending;if(o!==null){if(r!==null){var a=r.next;r.next=o.next,o.next=a}e.baseQueue=r=o,i.pending=null}if(o=t.baseState,r===null)t.memoizedState=o;else{e=r.next;var s=a=null,l=null,c=e,u=!1;do{var d=c.lane&-536870913;if(d!==c.lane?(fe&d)===d:(Oi&d)===d){var h=c.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),d===Ba&&(u=!0);else if((Oi&h)===h){c=c.next,h===Ba&&(u=!0);continue}else d={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=d,a=o):l=l.next=d,re.lanes|=h,Nr|=h;d=c.action,xo&&n(o,d),o=c.hasEagerState?c.eagerState:n(o,d)}else h={lane:d,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=h,a=o):l=l.next=h,re.lanes|=d,Nr|=d;c=c.next}while(c!==null&&c!==e);if(l===null?a=o:l.next=s,!ln(o,t.memoizedState)&&(nt=!0,u&&(n=Ma,n!==null)))throw n;t.memoizedState=o,t.baseState=a,t.baseQueue=l,i.lastRenderedState=o}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Yp(t){var e=We(),n=e.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,o=e.memoizedState;if(r!==null){n.pending=null;var a=r=r.next;do o=t(o,a.action),a=a.next;while(a!==r);ln(o,e.memoizedState)||(nt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,i]}function ox(t,e,n){var i=re,r=We(),o=he;if(o){if(n===void 0)throw Error(M(407));n=n()}else n=e();var a=!ln((Ee||r).memoizedState,n);if(a&&(r.memoizedState=n,nt=!0),r=r.queue,Hg(lx.bind(null,i,r,t),[t]),r.getSnapshot!==e||a||Je!==null&&Je.memoizedState.tag&1){if(i.flags|=2048,$a(9,{destroy:void 0},sx.bind(null,i,r,n,e),null),Ae===null)throw Error(M(349));o||(Oi&127)!==0||ax(i,e,n)}return n}function ax(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=re.updateQueue,e===null?(e=vd(),re.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function sx(t,e,n,i){e.value=n,e.getSnapshot=i,cx(e)&&ux(t)}function lx(t,e,n){return n(function(){cx(e)&&ux(t)})}function cx(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ln(t,n)}catch{return!0}}function ux(t){var e=To(t,2);e!==null&&Vt(e,t,2)}function Bh(t){var e=Lt();if(typeof t=="function"){var n=t;if(t=n(),xo){gr(!0);try{n()}finally{gr(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:t},e}function dx(t,e,n,i){return t.baseState=n,Ig(t,Ee,typeof i=="function"?i:Mi)}function K2(t,e,n,i,r){if(_d(t))throw Error(M(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(a){o.listeners.push(a)}};Q.T!==null?n(!0):o.isTransition=!1,i(o),n=e.pending,n===null?(o.next=e.pending=o,fx(e,o)):(o.next=n.next,e.pending=n.next=o)}}function fx(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var o=Q.T,a={};Q.T=a;try{var s=n(r,i),l=Q.S;l!==null&&l(a,s),d_(t,e,s)}catch(c){Fh(t,e,c)}finally{o!==null&&a.types!==null&&(o.types=a.types),Q.T=o}}else try{o=n(r,i),d_(t,e,o)}catch(c){Fh(t,e,c)}}function d_(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){f_(t,e,i)},function(i){return Fh(t,e,i)}):f_(t,e,n)}function f_(t,e,n){e.status="fulfilled",e.value=n,px(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,fx(t,n)))}function Fh(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,px(e),e=e.next;while(e!==i)}t.action=null}function px(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function hx(t,e){return e}function p_(t,e){if(he){var n=Ae.formState;if(n!==null){e:{var i=re;if(he){if(Ie){t:{for(var r=Ie,o=xn;r.nodeType!==8;){if(!o){r=null;break t}if(r=En(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){Ie=En(r.nextSibling),i=r.data==="F!";break e}}Or(i)}i=!1}i&&(e=n[0])}}return n=Lt(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hx,lastRenderedState:e},n.queue=i,n=Ox.bind(null,re,i),i.dispatch=n,i=Bh(!1),o=$g.bind(null,re,!1,i.queue),i=Lt(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=K2.bind(null,re,r,o,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function h_(t){var e=We();return gx(e,Ee,t)}function gx(t,e,n){if(e=Ig(t,e,hx)[0],t=Au(Mi)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Hl(e)}catch(a){throw a===Wa?md:a}else i=e;e=We();var r=e.queue,o=r.dispatch;return n!==e.memoizedState&&(re.flags|=2048,$a(9,{destroy:void 0},Q2.bind(null,r,n),null)),[i,o,t]}function Q2(t,e){t.action=e}function g_(t){var e=We(),n=Ee;if(n!==null)return gx(e,n,t);We(),e=e.memoizedState,n=We();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function $a(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=re.updateQueue,e===null&&(e=vd(),re.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function mx(){return We().memoizedState}function Tu(t,e,n,i){var r=Lt();re.flags|=t,r.memoizedState=$a(1|e,{destroy:void 0},n,i===void 0?null:i)}function bd(t,e,n,i){var r=We();i=i===void 0?null:i;var o=r.memoizedState.inst;Ee!==null&&i!==null&&Rg(i,Ee.memoizedState.deps)?r.memoizedState=$a(e,o,n,i):(re.flags|=t,r.memoizedState=$a(1|e,o,n,i))}function m_(t,e){Tu(8390656,8,t,e)}function Hg(t,e){bd(2048,8,t,e)}function J2(t){re.flags|=4;var e=re.updateQueue;if(e===null)e=vd(),re.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function vx(t){var e=We().memoizedState;return J2({ref:e,nextImpl:t}),function(){if((ve&2)!==0)throw Error(M(440));return e.impl.apply(void 0,arguments)}}function yx(t,e){return bd(4,2,t,e)}function bx(t,e){return bd(4,4,t,e)}function _x(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function Sx(t,e,n){n=n!=null?n.concat([t]):null,bd(4,4,_x.bind(null,e,t),n)}function zg(){}function xx(t,e){var n=We();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&Rg(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function wx(t,e){var n=We();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&Rg(e,i[1]))return i[0];if(i=t(),xo){gr(!0);try{t()}finally{gr(!1)}}return n.memoizedState=[i,e],i}function Bg(t,e,n){return n===void 0||(Oi&1073741824)!==0&&(fe&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=dw(),re.lanes|=t,Nr|=t,n)}function Ex(t,e,n,i){return ln(n,e)?n:Fa.current!==null?(t=Bg(t,n,i),ln(t,e)||(nt=!0),t):(Oi&42)===0||(Oi&1073741824)!==0&&(fe&261930)===0?(nt=!0,t.memoizedState=n):(t=dw(),re.lanes|=t,Nr|=t,e)}function Cx(t,e,n,i,r){var o=ye.p;ye.p=o!==0&&8>o?o:8;var a=Q.T,s={};Q.T=s,$g(t,!1,e,n);try{var l=r(),c=Q.S;if(c!==null&&c(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=Y2(l,i);cl(t,e,u,sn(t))}else cl(t,e,i,sn(t))}catch(d){cl(t,e,{then:function(){},status:"rejected",reason:d},sn())}finally{ye.p=o,a!==null&&s.types!==null&&(a.types=s.types),Q.T=a}}function eO(){}function $h(t,e,n,i){if(t.tag!==5)throw Error(M(476));var r=Ax(t).queue;Cx(t,r,e,ho,n===null?eO:function(){return Tx(t),n(i)})}function Ax(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:ho,baseState:ho,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:ho},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Tx(t){var e=Ax(t);e.next===null&&(e=t.alternate.memoizedState),cl(t,e.next.queue,{},sn())}function Fg(){return yt(Al)}function kx(){return We().memoizedState}function Rx(){return We().memoizedState}function tO(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=sn();t=xr(n);var i=wr(e,t,n);i!==null&&(Vt(i,e,n),al(i,e,n)),e={cache:Eg()},t.payload=e;return}e=e.return}}function nO(t,e,n){var i=sn();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},_d(t)?Mx(e,n):(n=_g(t,e,n,i),n!==null&&(Vt(n,t,i),Nx(n,e,i)))}function Ox(t,e,n){var i=sn();cl(t,e,n,i)}function cl(t,e,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(_d(t))Mx(e,r);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var a=e.lastRenderedState,s=o(a,n);if(r.hasEagerState=!0,r.eagerState=s,ln(s,a))return gd(t,e,r,0),Ae===null&&hd(),!1}catch{}if(n=_g(t,e,r,i),n!==null)return Vt(n,t,i),Nx(n,e,i),!0}return!1}function $g(t,e,n,i){if(i={lane:2,revertLane:Wg(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},_d(t)){if(e)throw Error(M(479))}else e=_g(t,n,i,2),e!==null&&Vt(e,t,2)}function _d(t){var e=t.alternate;return t===re||e!==null&&e===re}function Mx(t,e){Da=Gu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Nx(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,vS(t,n)}}var wl={readContext:yt,use:yd,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useLayoutEffect:Ze,useInsertionEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useSyncExternalStore:Ze,useId:Ze,useHostTransitionStatus:Ze,useFormState:Ze,useActionState:Ze,useOptimistic:Ze,useMemoCache:Ze,useCacheRefresh:Ze};wl.useEffectEvent=Ze;var Dx={readContext:yt,use:yd,useCallback:function(t,e){return Lt().memoizedState=[t,e===void 0?null:e],t},useContext:yt,useEffect:m_,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Tu(4194308,4,_x.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Tu(4194308,4,t,e)},useInsertionEffect:function(t,e){Tu(4,2,t,e)},useMemo:function(t,e){var n=Lt();e=e===void 0?null:e;var i=t();if(xo){gr(!0);try{t()}finally{gr(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Lt();if(n!==void 0){var r=n(e);if(xo){gr(!0);try{n(e)}finally{gr(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=nO.bind(null,re,t),[i.memoizedState,t]},useRef:function(t){var e=Lt();return t={current:t},e.memoizedState=t},useState:function(t){t=Bh(t);var e=t.queue,n=Ox.bind(null,re,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:zg,useDeferredValue:function(t,e){var n=Lt();return Bg(n,t,e)},useTransition:function(){var t=Bh(!1);return t=Cx.bind(null,re,t.queue,!0,!1),Lt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=re,r=Lt();if(he){if(n===void 0)throw Error(M(407));n=n()}else{if(n=e(),Ae===null)throw Error(M(349));(fe&127)!==0||ax(i,e,n)}r.memoizedState=n;var o={value:n,getSnapshot:e};return r.queue=o,m_(lx.bind(null,i,o,t),[t]),i.flags|=2048,$a(9,{destroy:void 0},sx.bind(null,i,o,n,e),null),n},useId:function(){var t=Lt(),e=Ae.identifierPrefix;if(he){var n=ti,i=ei;n=(i&~(1<<32-an(i)-1)).toString(32)+n,e="_"+e+"R_"+n,n=Yu++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=W2++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Fg,useFormState:p_,useActionState:p_,useOptimistic:function(t){var e=Lt();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=$g.bind(null,re,!0,n),n.dispatch=e,[t,e]},useMemoCache:Lg,useCacheRefresh:function(){return Lt().memoizedState=tO.bind(null,re)},useEffectEvent:function(t){var e=Lt(),n={impl:t};return e.memoizedState=n,function(){if((ve&2)!==0)throw Error(M(440));return n.impl.apply(void 0,arguments)}}},Ug={readContext:yt,use:yd,useCallback:xx,useContext:yt,useEffect:Hg,useImperativeHandle:Sx,useInsertionEffect:yx,useLayoutEffect:bx,useMemo:wx,useReducer:Au,useRef:mx,useState:function(){return Au(Mi)},useDebugValue:zg,useDeferredValue:function(t,e){var n=We();return Ex(n,Ee.memoizedState,t,e)},useTransition:function(){var t=Au(Mi)[0],e=We().memoizedState;return[typeof t=="boolean"?t:Hl(t),e]},useSyncExternalStore:ox,useId:kx,useHostTransitionStatus:Fg,useFormState:h_,useActionState:h_,useOptimistic:function(t,e){var n=We();return dx(n,Ee,t,e)},useMemoCache:Lg,useCacheRefresh:Rx};Ug.useEffectEvent=vx;var Lx={readContext:yt,use:yd,useCallback:xx,useContext:yt,useEffect:Hg,useImperativeHandle:Sx,useInsertionEffect:yx,useLayoutEffect:bx,useMemo:wx,useReducer:Yp,useRef:mx,useState:function(){return Yp(Mi)},useDebugValue:zg,useDeferredValue:function(t,e){var n=We();return Ee===null?Bg(n,t,e):Ex(n,Ee.memoizedState,t,e)},useTransition:function(){var t=Yp(Mi)[0],e=We().memoizedState;return[typeof t=="boolean"?t:Hl(t),e]},useSyncExternalStore:ox,useId:kx,useHostTransitionStatus:Fg,useFormState:g_,useActionState:g_,useOptimistic:function(t,e){var n=We();return Ee!==null?dx(n,Ee,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:Lg,useCacheRefresh:Rx};Lx.useEffectEvent=vx;function Wp(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:He({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Uh={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=sn(),r=xr(i);r.payload=e,n!=null&&(r.callback=n),e=wr(t,r,i),e!==null&&(Vt(e,t,i),al(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=sn(),r=xr(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=wr(t,r,i),e!==null&&(Vt(e,t,i),al(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=sn(),i=xr(n);i.tag=2,e!=null&&(i.callback=e),e=wr(t,i,n),e!==null&&(Vt(e,t,n),al(e,t,n))}};function v_(t,e,n,i,r,o,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,o,a):e.prototype&&e.prototype.isPureReactComponent?!yl(n,i)||!yl(r,o):!0}function y_(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&Uh.enqueueReplaceState(e,e.state,null)}function wo(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=He({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}function Ix(t){$u(t)}function Hx(t){console.error(t)}function zx(t){$u(t)}function Wu(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function b_(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Vh(t,e,n){return n=xr(n),n.tag=3,n.payload={element:null},n.callback=function(){Wu(t,e)},n}function Bx(t){return t=xr(t),t.tag=3,t}function Fx(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var o=i.value;t.payload=function(){return r(o)},t.callback=function(){b_(e,n,i)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(t.callback=function(){b_(e,n,i),typeof r!="function"&&(Er===null?Er=new Set([this]):Er.add(this));var s=i.stack;this.componentDidCatch(i.value,{componentStack:s!==null?s:""})})}function iO(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Ya(e,n,r,!0),n=cn.current,n!==null){switch(n.tag){case 31:case 13:return wn===null?ed():n.alternate===null&&Ge===0&&(Ge=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===Pu?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),ah(t,i,r)),!1;case 22:return n.flags|=65536,i===Pu?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),ah(t,i,r)),!1}throw Error(M(435,n.tag))}return ah(t,i,r),ed(),!1}if(he)return e=cn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==Rh&&(t=Error(M(422),{cause:i}),_l(Sn(t,n)))):(i!==Rh&&(e=Error(M(423),{cause:i}),_l(Sn(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=Sn(i,n),r=Vh(t.stateNode,i,r),Gp(t,r),Ge!==4&&(Ge=2)),!1;var o=Error(M(520),{cause:i});if(o=Sn(o,n),fl===null?fl=[o]:fl.push(o),Ge!==4&&(Ge=2),e===null)return!0;i=Sn(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=Vh(n.stateNode,i,t),Gp(n,t),!1;case 1:if(e=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Er===null||!Er.has(o))))return n.flags|=65536,r&=-r,n.lanes|=r,r=Bx(r),Fx(r,t,n,i),Gp(n,r),!1}n=n.return}while(n!==null);return!1}var Vg=Error(M(461)),nt=!1;function gt(t,e,n,i){e.child=t===null?JS(e,null,n,i):So(e,t.child,n,i)}function __(t,e,n,i,r){n=n.render;var o=e.ref;if("ref"in i){var a={};for(var s in i)s!=="ref"&&(a[s]=i[s])}else a=i;return _o(e),i=Og(t,e,n,a,o,r),s=Mg(),t!==null&&!nt?(Ng(t,e,r),Ni(t,e,r)):(he&&s&&xg(e),e.flags|=1,gt(t,e,i,r),e.child)}function S_(t,e,n,i,r){if(t===null){var o=n.type;return typeof o=="function"&&!Sg(o)&&o.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=o,$x(t,e,o,i,r)):(t=Eu(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!jg(t,r)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:yl,n(a,i)&&t.ref===e.ref)return Ni(t,e,r)}return e.flags|=1,t=Ai(o,i),t.ref=e.ref,t.return=e,e.child=t}function $x(t,e,n,i,r){if(t!==null){var o=t.memoizedProps;if(yl(o,i)&&t.ref===e.ref)if(nt=!1,e.pendingProps=i=o,jg(t,r))(t.flags&131072)!==0&&(nt=!0);else return e.lanes=t.lanes,Ni(t,e,r)}return jh(t,e,n,i,r)}function Ux(t,e,n,i){var r=i.children,o=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,t!==null){for(i=e.child=t.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~o}else i=0,e.child=null;return x_(t,e,o,n,i)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Cu(e,o!==null?o.cachePool:null),o!==null?u_(e,o):Hh(),nx(e);else return i=e.lanes=536870912,x_(t,e,o!==null?o.baseLanes|n:n,n,i)}else o!==null?(Cu(e,o.cachePool),u_(e,o),pr(e),e.memoizedState=null):(t!==null&&Cu(e,null),Hh(),pr(e));return gt(t,e,r,n),e.child}function el(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function x_(t,e,n,i,r){var o=Cg();return o=o===null?null:{parent:tt._currentValue,pool:o},e.memoizedState={baseLanes:n,cachePool:o},t!==null&&Cu(e,null),Hh(),nx(e),t!==null&&Ya(t,e,i,!0),e.childLanes=r,null}function ku(t,e){return e=Xu({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function w_(t,e,n){return So(e,t.child,null,n),t=ku(e,e.pendingProps),t.flags|=2,en(e),e.memoizedState=null,t}function rO(t,e,n){var i=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(he){if(i.mode==="hidden")return t=ku(e,i),e.lanes=536870912,el(null,t);if(zh(e),(t=Ie)?(t=Dw(t,xn),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Rr!==null?{id:ei,overflow:ti}:null,retryLane:536870912,hydrationErrors:null},n=ZS(t),n.return=e,e.child=n,vt=e,Ie=null)):t=null,t===null)throw Or(e);return e.lanes=536870912,null}return ku(e,i)}var o=t.memoizedState;if(o!==null){var a=o.dehydrated;if(zh(e),r)if(e.flags&256)e.flags&=-257,e=w_(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(M(558));else if(nt||Ya(t,e,n,!1),r=(n&t.childLanes)!==0,nt||r){if(i=Ae,i!==null&&(a=yS(i,n),a!==0&&a!==o.retryLane))throw o.retryLane=a,To(t,a),Vt(i,t,a),Vg;ed(),e=w_(t,e,n)}else t=o.treeContext,Ie=En(a.nextSibling),vt=e,he=!0,Sr=null,xn=!1,t!==null&&YS(e,t),e=ku(e,i),e.flags|=4096;return e}return t=Ai(t.child,{mode:i.mode,children:i.children}),t.ref=e.ref,e.child=t,t.return=e,t}function Ru(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(M(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function jh(t,e,n,i,r){return _o(e),n=Og(t,e,n,i,void 0,r),i=Mg(),t!==null&&!nt?(Ng(t,e,r),Ni(t,e,r)):(he&&i&&xg(e),e.flags|=1,gt(t,e,n,r),e.child)}function E_(t,e,n,i,r,o){return _o(e),e.updateQueue=null,n=rx(e,i,n,r),ix(t),i=Mg(),t!==null&&!nt?(Ng(t,e,o),Ni(t,e,o)):(he&&i&&xg(e),e.flags|=1,gt(t,e,n,o),e.child)}function C_(t,e,n,i,r){if(_o(e),e.stateNode===null){var o=Ea,a=n.contextType;typeof a=="object"&&a!==null&&(o=yt(a)),o=new n(i,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Uh,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=i,o.state=e.memoizedState,o.refs={},Tg(e),a=n.contextType,o.context=typeof a=="object"&&a!==null?yt(a):Ea,o.state=e.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(Wp(e,n,a,i),o.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(a=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),a!==o.state&&Uh.enqueueReplaceState(o,o.state,null),ll(e,i,o,r),sl(),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){o=e.stateNode;var s=e.memoizedProps,l=wo(n,s);o.props=l;var c=o.context,u=n.contextType;a=Ea,typeof u=="object"&&u!==null&&(a=yt(u));var d=n.getDerivedStateFromProps;u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||c!==a)&&y_(e,o,i,a),ur=!1;var h=e.memoizedState;o.state=h,ll(e,i,o,r),sl(),c=e.memoizedState,s||h!==c||ur?(typeof d=="function"&&(Wp(e,n,d,i),c=e.memoizedState),(l=ur||v_(e,n,l,i,h,c,a))?(u||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=i,e.memoizedState=c),o.props=i,o.state=c,o.context=a,i=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,Lh(t,e),a=e.memoizedProps,u=wo(n,a),o.props=u,d=e.pendingProps,h=o.context,c=n.contextType,l=Ea,typeof c=="object"&&c!==null&&(l=yt(c)),s=n.getDerivedStateFromProps,(c=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||h!==l)&&y_(e,o,i,l),ur=!1,h=e.memoizedState,o.state=h,ll(e,i,o,r),sl();var m=e.memoizedState;a!==d||h!==m||ur||t!==null&&t.dependencies!==null&&ju(t.dependencies)?(typeof s=="function"&&(Wp(e,n,s,i),m=e.memoizedState),(u=ur||v_(e,n,u,i,h,m,l)||t!==null&&t.dependencies!==null&&ju(t.dependencies))?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,m,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=m),o.props=i,o.state=m,o.context=l,i=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return o=i,Ru(t,e),i=(e.flags&128)!==0,o||i?(o=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:o.render(),e.flags|=1,t!==null&&i?(e.child=So(e,t.child,null,r),e.child=So(e,null,n,r)):gt(t,e,n,r),e.memoizedState=o.state,t=e.child):t=Ni(t,e,r),t}function A_(t,e,n,i){return bo(),e.flags|=256,gt(t,e,n,i),e.child}var Xp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kp(t){return{baseLanes:t,cachePool:XS()}}function Qp(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=nn),t}function Vx(t,e,n){var i=e.pendingProps,r=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(Ye.current&2)!==0),a&&(r=!0,e.flags&=-129),a=(e.flags&32)!==0,e.flags&=-33,t===null){if(he){if(r?fr(e):pr(e),(t=Ie)?(t=Dw(t,xn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Rr!==null?{id:ei,overflow:ti}:null,retryLane:536870912,hydrationErrors:null},n=ZS(t),n.return=e,e.child=n,vt=e,Ie=null)):t=null,t===null)throw Or(e);return ig(t)?e.lanes=32:e.lanes=536870912,null}var s=i.children;return i=i.fallback,r?(pr(e),r=e.mode,s=Xu({mode:"hidden",children:s},r),i=go(i,r,n,null),s.return=e,i.return=e,s.sibling=i,e.child=s,i=e.child,i.memoizedState=Kp(n),i.childLanes=Qp(t,a,n),e.memoizedState=Xp,el(null,i)):(fr(e),Ph(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(fr(e),e.flags&=-257,e=Jp(t,e,n)):e.memoizedState!==null?(pr(e),e.child=t.child,e.flags|=128,e=null):(pr(e),s=i.fallback,r=e.mode,i=Xu({mode:"visible",children:i.children},r),s=go(s,r,n,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,So(e,t.child,null,n),i=e.child,i.memoizedState=Kp(n),i.childLanes=Qp(t,a,n),e.memoizedState=Xp,e=el(null,i));else if(fr(e),ig(s)){if(a=s.nextSibling&&s.nextSibling.dataset,a)var c=a.dgst;a=c,i=Error(M(419)),i.stack="",i.digest=a,_l({value:i,source:null,stack:null}),e=Jp(t,e,n)}else if(nt||Ya(t,e,n,!1),a=(n&t.childLanes)!==0,nt||a){if(a=Ae,a!==null&&(i=yS(a,n),i!==0&&i!==l.retryLane))throw l.retryLane=i,To(t,i),Vt(a,t,i),Vg;ng(s)||ed(),e=Jp(t,e,n)}else ng(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Ie=En(s.nextSibling),vt=e,he=!0,Sr=null,xn=!1,t!==null&&YS(e,t),e=Ph(e,i.children),e.flags|=4096);return e}return r?(pr(e),s=i.fallback,r=e.mode,l=t.child,c=l.sibling,i=Ai(l,{mode:"hidden",children:i.children}),i.subtreeFlags=l.subtreeFlags&65011712,c!==null?s=Ai(c,s):(s=go(s,r,n,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,el(null,i),i=e.child,s=t.child.memoizedState,s===null?s=Kp(n):(r=s.cachePool,r!==null?(l=tt._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=XS(),s={baseLanes:s.baseLanes|n,cachePool:r}),i.memoizedState=s,i.childLanes=Qp(t,a,n),e.memoizedState=Xp,el(t.child,i)):(fr(e),n=t.child,t=n.sibling,n=Ai(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(a=e.deletions,a===null?(e.deletions=[t],e.flags|=16):a.push(t)),e.child=n,e.memoizedState=null,n)}function Ph(t,e){return e=Xu({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Xu(t,e){return t=tn(22,t,null,e),t.lanes=0,t}function Jp(t,e,n){return So(e,t.child,null,n),t=Ph(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function T_(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),Mh(t.return,e,n)}function eh(t,e,n,i,r,o){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:o}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r,a.treeForkCount=o)}function jx(t,e,n){var i=e.pendingProps,r=i.revealOrder,o=i.tail;i=i.children;var a=Ye.current,s=(a&2)!==0;if(s?(a=a&1|2,e.flags|=128):a&=1,Oe(Ye,a),gt(t,e,i,n),i=he?bl:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&T_(t,n,e);else if(t.tag===19)T_(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&Zu(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),eh(e,!1,r,n,o,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&Zu(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}eh(e,!0,n,null,o,i);break;case"together":eh(e,!1,null,null,void 0,i);break;default:e.memoizedState=null}return e.child}function Ni(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Nr|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Ya(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(M(153));if(e.child!==null){for(t=e.child,n=Ai(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Ai(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function jg(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&ju(t)))}function oO(t,e,n){switch(e.tag){case 3:Hu(e,e.stateNode.containerInfo),dr(e,tt,t.memoizedState.cache),bo();break;case 27:case 5:yh(e);break;case 4:Hu(e,e.stateNode.containerInfo);break;case 10:dr(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,zh(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(fr(e),e.flags|=128,null):(n&e.child.childLanes)!==0?Vx(t,e,n):(fr(e),t=Ni(t,e,n),t!==null?t.sibling:null);fr(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(Ya(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return jx(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Oe(Ye,Ye.current),i)break;return null;case 22:return e.lanes=0,Ux(t,e,n,e.pendingProps);case 24:dr(e,tt,t.memoizedState.cache)}return Ni(t,e,n)}function Px(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)nt=!0;else{if(!jg(t,n)&&(e.flags&128)===0)return nt=!1,oO(t,e,n);nt=(t.flags&131072)!==0}else nt=!1,he&&(e.flags&1048576)!==0&&GS(e,bl,e.index);switch(e.lanes=0,e.tag){case 16:e:{var i=e.pendingProps;if(t=fo(e.elementType),e.type=t,typeof t=="function")Sg(t)?(i=wo(t,i),e.tag=1,e=C_(null,e,t,i,n)):(e.tag=0,e=jh(null,e,t,i,n));else{if(t!=null){var r=t.$$typeof;if(r===sg){e.tag=11,e=__(null,e,t,i,n);break e}else if(r===lg){e.tag=14,e=S_(null,e,t,i,n);break e}}throw e=mh(t)||t,Error(M(306,e,""))}}return e;case 0:return jh(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=wo(i,e.pendingProps),C_(t,e,i,r,n);case 3:e:{if(Hu(e,e.stateNode.containerInfo),t===null)throw Error(M(387));i=e.pendingProps;var o=e.memoizedState;r=o.element,Lh(t,e),ll(e,i,null,n);var a=e.memoizedState;if(i=a.cache,dr(e,tt,i),i!==o.cache&&Nh(e,[tt],n,!0),sl(),i=a.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:a.cache},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){e=A_(t,e,i,n);break e}else if(i!==r){r=Sn(Error(M(424)),e),_l(r),e=A_(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Ie=En(t.firstChild),vt=e,he=!0,Sr=null,xn=!0,n=JS(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(bo(),i===r){e=Ni(t,e,n);break e}gt(t,e,i,n)}e=e.child}return e;case 26:return Ru(t,e),t===null?(n=W_(e.type,null,e.pendingProps,null))?e.memoizedState=n:he||(n=e.type,t=e.pendingProps,i=rd(_r.current).createElement(n),i[mt]=e,i[jt]=t,bt(i,n,t),dt(i),e.stateNode=i):e.memoizedState=W_(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return yh(e),t===null&&he&&(i=e.stateNode=Lw(e.type,e.pendingProps,_r.current),vt=e,xn=!0,r=Ie,Lr(e.type)?(rg=r,Ie=En(i.firstChild)):Ie=r),gt(t,e,e.pendingProps.children,n),Ru(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&he&&((r=i=Ie)&&(i=DO(i,e.type,e.pendingProps,xn),i!==null?(e.stateNode=i,vt=e,Ie=En(i.firstChild),xn=!1,r=!0):r=!1),r||Or(e)),yh(e),r=e.type,o=e.pendingProps,a=t!==null?t.memoizedProps:null,i=o.children,eg(r,o)?i=null:a!==null&&eg(r,a)&&(e.flags|=32),e.memoizedState!==null&&(r=Og(t,e,X2,null,null,n),Al._currentValue=r),Ru(t,e),gt(t,e,i,n),e.child;case 6:return t===null&&he&&((t=n=Ie)&&(n=LO(n,e.pendingProps,xn),n!==null?(e.stateNode=n,vt=e,Ie=null,t=!0):t=!1),t||Or(e)),null;case 13:return Vx(t,e,n);case 4:return Hu(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=So(e,null,i,n):gt(t,e,i,n),e.child;case 11:return __(t,e,e.type,e.pendingProps,n);case 7:return gt(t,e,e.pendingProps,n),e.child;case 8:return gt(t,e,e.pendingProps.children,n),e.child;case 12:return gt(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,dr(e,e.type,i.value),gt(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,_o(e),r=yt(r),i=i(r),e.flags|=1,gt(t,e,i,n),e.child;case 14:return S_(t,e,e.type,e.pendingProps,n);case 15:return $x(t,e,e.type,e.pendingProps,n);case 19:return jx(t,e,n);case 31:return rO(t,e,n);case 22:return Ux(t,e,n,e.pendingProps);case 24:return _o(e),i=yt(tt),t===null?(r=Cg(),r===null&&(r=Ae,o=Eg(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=n),r=o),e.memoizedState={parent:i,cache:r},Tg(e),dr(e,tt,r)):((t.lanes&n)!==0&&(Lh(t,e),ll(e,null,null,n),sl()),r=t.memoizedState,o=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),dr(e,tt,i)):(i=o.cache,dr(e,tt,i),i!==r.cache&&Nh(e,[tt],n,!0))),gt(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(M(156,e.tag))}function vi(t){t.flags|=4}function th(t,e,n,i,r){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(r&335544128)===r)if(t.stateNode.complete)t.flags|=8192;else if(hw())t.flags|=8192;else throw vo=Pu,Ag}else t.flags&=-16777217}function k_(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!zw(e))if(hw())t.flags|=8192;else throw vo=Pu,Ag}function pu(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?gS():536870912,t.lanes|=e,Ua|=e)}function Gs(t,e){if(!he)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Le(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function aO(t,e,n){var i=e.pendingProps;switch(wg(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(e),null;case 1:return Le(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),Ti(tt),Ia(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(fa(e)?vi(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Zp())),Le(e),null;case 26:var r=e.type,o=e.memoizedState;return t===null?(vi(e),o!==null?(Le(e),k_(e,o)):(Le(e),th(e,r,null,i,n))):o?o!==t.memoizedState?(vi(e),Le(e),k_(e,o)):(Le(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&vi(e),Le(e),th(e,r,t,i,n)),null;case 27:if(zu(e),n=_r.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&vi(e);else{if(!i){if(e.stateNode===null)throw Error(M(166));return Le(e),null}t=ii.current,fa(e)?i_(e,t):(t=Lw(r,i,n),e.stateNode=t,vi(e))}return Le(e),null;case 5:if(zu(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&vi(e);else{if(!i){if(e.stateNode===null)throw Error(M(166));return Le(e),null}if(o=ii.current,fa(e))i_(e,o);else{var a=rd(_r.current);switch(o){case 1:o=a.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=a.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":o=a.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof i.is=="string"?a.createElement("select",{is:i.is}):a.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is=="string"?a.createElement(r,{is:i.is}):a.createElement(r)}}o[mt]=e,o[jt]=i;e:for(a=e.child;a!==null;){if(a.tag===5||a.tag===6)o.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break e;for(;a.sibling===null;){if(a.return===null||a.return===e)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}e.stateNode=o;e:switch(bt(o,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&vi(e)}}return Le(e),th(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&vi(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(M(166));if(t=_r.current,fa(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=vt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[mt]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Ow(t.nodeValue,n)),t||Or(e,!0)}else t=rd(t).createTextNode(i),t[mt]=e,e.stateNode=t}return Le(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(i=fa(e),n!==null){if(t===null){if(!i)throw Error(M(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(557));t[mt]=e}else bo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Le(e),t=!1}else n=Zp(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(en(e),e):(en(e),null);if((e.flags&128)!==0)throw Error(M(558))}return Le(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=fa(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(M(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(M(317));r[mt]=e}else bo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Le(e),r=!1}else r=Zp(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(en(e),e):(en(e),null)}return en(e),(e.flags&128)!==0?(e.lanes=n,e):(n=i!==null,t=t!==null&&t.memoizedState!==null,n&&(i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==r&&(i.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),pu(e,e.updateQueue),Le(e),null);case 4:return Ia(),t===null&&Xg(e.stateNode.containerInfo),Le(e),null;case 10:return Ti(e.type),Le(e),null;case 19:if(ft(Ye),i=e.memoizedState,i===null)return Le(e),null;if(r=(e.flags&128)!==0,o=i.rendering,o===null)if(r)Gs(i,!1);else{if(Ge!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=Zu(t),o!==null){for(e.flags|=128,Gs(i,!1),t=o.updateQueue,e.updateQueue=t,pu(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)qS(n,t),n=n.sibling;return Oe(Ye,Ye.current&1|2),he&&Si(e,i.treeForkCount),e.child}t=t.sibling}i.tail!==null&&rn()>Qu&&(e.flags|=128,r=!0,Gs(i,!1),e.lanes=4194304)}else{if(!r)if(t=Zu(o),t!==null){if(e.flags|=128,r=!0,t=t.updateQueue,e.updateQueue=t,pu(e,t),Gs(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!he)return Le(e),null}else 2*rn()-i.renderingStartTime>Qu&&n!==536870912&&(e.flags|=128,r=!0,Gs(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(t=i.last,t!==null?t.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=rn(),t.sibling=null,n=Ye.current,Oe(Ye,r?n&1|2:n&1),he&&Si(e,i.treeForkCount),t):(Le(e),null);case 22:case 23:return en(e),kg(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(Le(e),e.subtreeFlags&6&&(e.flags|=8192)):Le(e),n=e.updateQueue,n!==null&&pu(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&ft(mo),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Ti(tt),Le(e),null;case 25:return null;case 30:return null}throw Error(M(156,e.tag))}function sO(t,e){switch(wg(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ti(tt),Ia(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return zu(e),null;case 31:if(e.memoizedState!==null){if(en(e),e.alternate===null)throw Error(M(340));bo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(en(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(M(340));bo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ft(Ye),null;case 4:return Ia(),null;case 10:return Ti(e.type),null;case 22:case 23:return en(e),kg(),t!==null&&ft(mo),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Ti(tt),null;case 25:return null;default:return null}}function qx(t,e){switch(wg(e),e.tag){case 3:Ti(tt),Ia();break;case 26:case 27:case 5:zu(e);break;case 4:Ia();break;case 31:e.memoizedState!==null&&en(e);break;case 13:en(e);break;case 19:ft(Ye);break;case 10:Ti(e.type);break;case 22:case 23:en(e),kg(),t!==null&&ft(mo);break;case 24:Ti(tt)}}function zl(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var o=n.create,a=n.inst;i=o(),a.destroy=i}n=n.next}while(n!==r)}}catch(s){_e(e,e.return,s)}}function Mr(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var o=r.next;i=o;do{if((i.tag&t)===t){var a=i.inst,s=a.destroy;if(s!==void 0){a.destroy=void 0,r=e;var l=n,c=s;try{c()}catch(u){_e(r,l,u)}}}i=i.next}while(i!==o)}}catch(u){_e(e,e.return,u)}}function Zx(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{tx(e,n)}catch(i){_e(t,t.return,i)}}}function Gx(t,e,n){n.props=wo(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){_e(t,e,i)}}function ul(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){_e(t,e,r)}}function ni(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){_e(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){_e(t,e,r)}else n.current=null}function Yx(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){_e(t,t.return,r)}}function nh(t,e,n){try{var i=t.stateNode;TO(i,t.type,n,e),i[jt]=e}catch(r){_e(t,t.return,r)}}function Wx(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Lr(t.type)||t.tag===4}function ih(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Wx(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&&Lr(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 qh(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Ei));else if(i!==4&&(i===27&&Lr(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(qh(t,e,n),t=t.sibling;t!==null;)qh(t,e,n),t=t.sibling}function Ku(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&Lr(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Ku(t,e,n),t=t.sibling;t!==null;)Ku(t,e,n),t=t.sibling}function Xx(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);bt(e,i,n),e[mt]=t,e[jt]=n}catch(o){_e(t,t.return,o)}}var xi=!1,et=!1,rh=!1,R_=typeof WeakSet=="function"?WeakSet:Set,ut=null;function lO(t,e){if(t=t.containerInfo,Qh=ld,t=zS(t),yg(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,c=0,u=0,d=t,h=null;t:for(;;){for(var m;d!==n||r!==0&&d.nodeType!==3||(s=a+r),d!==o||i!==0&&d.nodeType!==3||(l=a+i),d.nodeType===3&&(a+=d.nodeValue.length),(m=d.firstChild)!==null;)h=d,d=m;for(;;){if(d===t)break t;if(h===n&&++c===r&&(s=a),h===o&&++u===i&&(l=a),(m=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=m}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Jh={focusedElem:t,selectionRange:n},ld=!1,ut=e;ut!==null;)if(e=ut,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ut=t;else for(;ut!==null;){switch(e=ut,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(n=0;n<t.length;n++)r=t[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&o!==null){t=void 0,n=e,r=o.memoizedProps,o=o.memoizedState,i=n.stateNode;try{var S=wo(n.type,r);t=i.getSnapshotBeforeUpdate(S,o),i.__reactInternalSnapshotBeforeUpdate=t}catch(_){_e(n,n.return,_)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)tg(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":tg(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(M(163))}if(t=e.sibling,t!==null){t.return=e.return,ut=t;break}ut=e.return}}function Kx(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:bi(t,n),i&4&&zl(5,n);break;case 1:if(bi(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(a){_e(n,n.return,a)}else{var r=wo(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(a){_e(n,n.return,a)}}i&64&&Zx(n),i&512&&ul(n,n.return);break;case 3:if(bi(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{tx(t,e)}catch(a){_e(n,n.return,a)}}break;case 27:e===null&&i&4&&Xx(n);case 26:case 5:bi(t,n),e===null&&i&4&&Yx(n),i&512&&ul(n,n.return);break;case 12:bi(t,n);break;case 31:bi(t,n),i&4&&ew(t,n);break;case 13:bi(t,n),i&4&&tw(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=vO.bind(null,n),IO(t,n))));break;case 22:if(i=n.memoizedState!==null||xi,!i){e=e!==null&&e.memoizedState!==null||et,r=xi;var o=et;xi=i,(et=e)&&!o?_i(t,n,(n.subtreeFlags&8772)!==0):bi(t,n),xi=r,et=o}break;case 30:break;default:bi(t,n)}}function Qx(t){var e=t.alternate;e!==null&&(t.alternate=null,Qx(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&fg(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 Be=null,$t=!1;function yi(t,e,n){for(n=n.child;n!==null;)Jx(t,e,n),n=n.sibling}function Jx(t,e,n){if(on&&typeof on.onCommitFiberUnmount=="function")try{on.onCommitFiberUnmount(Ol,n)}catch{}switch(n.tag){case 26:et||ni(n,e),yi(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:et||ni(n,e);var i=Be,r=$t;Lr(n.type)&&(Be=n.stateNode,$t=!1),yi(t,e,n),hl(n.stateNode),Be=i,$t=r;break;case 5:et||ni(n,e);case 6:if(i=Be,r=$t,Be=null,yi(t,e,n),Be=i,$t=r,Be!==null)if($t)try{(Be.nodeType===9?Be.body:Be.nodeName==="HTML"?Be.ownerDocument.body:Be).removeChild(n.stateNode)}catch(o){_e(n,e,o)}else try{Be.removeChild(n.stateNode)}catch(o){_e(n,e,o)}break;case 18:Be!==null&&($t?(t=Be,P_(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),qa(t)):P_(Be,n.stateNode));break;case 4:i=Be,r=$t,Be=n.stateNode.containerInfo,$t=!0,yi(t,e,n),Be=i,$t=r;break;case 0:case 11:case 14:case 15:Mr(2,n,e),et||Mr(4,n,e),yi(t,e,n);break;case 1:et||(ni(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&Gx(n,e,i)),yi(t,e,n);break;case 21:yi(t,e,n);break;case 22:et=(i=et)||n.memoizedState!==null,yi(t,e,n),et=i;break;default:yi(t,e,n)}}function ew(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{qa(t)}catch(n){_e(e,e.return,n)}}}function tw(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{qa(t)}catch(n){_e(e,e.return,n)}}function cO(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new R_),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new R_),e;default:throw Error(M(435,t.tag))}}function hu(t,e){var n=cO(t);e.forEach(function(i){if(!n.has(i)){n.add(i);var r=yO.bind(null,t,i);i.then(r,r)}})}function Bt(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],o=t,a=e,s=a;e:for(;s!==null;){switch(s.tag){case 27:if(Lr(s.type)){Be=s.stateNode,$t=!1;break e}break;case 5:Be=s.stateNode,$t=!1;break e;case 3:case 4:Be=s.stateNode.containerInfo,$t=!0;break e}s=s.return}if(Be===null)throw Error(M(160));Jx(o,a,r),Be=null,$t=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)nw(e,t),e=e.sibling}var Bn=null;function nw(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Bt(e,t),Ft(t),i&4&&(Mr(3,t,t.return),zl(3,t),Mr(5,t,t.return));break;case 1:Bt(e,t),Ft(t),i&512&&(et||n===null||ni(n,n.return)),i&64&&xi&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Bn;if(Bt(e,t),Ft(t),i&512&&(et||n===null||ni(n,n.return)),i&4){var o=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":o=r.getElementsByTagName("title")[0],(!o||o[Dl]||o[mt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(i),r.head.insertBefore(o,r.querySelector("head > title"))),bt(o,i,n),o[mt]=t,dt(o),i=o;break e;case"link":var a=K_("link","href",r).get(i+(n.href||""));if(a){for(var s=0;s<a.length;s++)if(o=a[s],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break t}}o=r.createElement(i),bt(o,i,n),r.head.appendChild(o);break;case"meta":if(a=K_("meta","content",r).get(i+(n.content||""))){for(s=0;s<a.length;s++)if(o=a[s],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(s,1);break t}}o=r.createElement(i),bt(o,i,n),r.head.appendChild(o);break;default:throw Error(M(468,i))}o[mt]=t,dt(o),i=o}t.stateNode=i}else Q_(r,t.type,t.stateNode);else t.stateNode=X_(r,i,t.memoizedProps);else o!==i?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,i===null?Q_(r,t.type,t.stateNode):X_(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&nh(t,t.memoizedProps,n.memoizedProps)}break;case 27:Bt(e,t),Ft(t),i&512&&(et||n===null||ni(n,n.return)),n!==null&&i&4&&nh(t,t.memoizedProps,n.memoizedProps);break;case 5:if(Bt(e,t),Ft(t),i&512&&(et||n===null||ni(n,n.return)),t.flags&32){r=t.stateNode;try{za(r,"")}catch(S){_e(t,t.return,S)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,nh(t,r,n!==null?n.memoizedProps:r)),i&1024&&(rh=!0);break;case 6:if(Bt(e,t),Ft(t),i&4){if(t.stateNode===null)throw Error(M(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(S){_e(t,t.return,S)}}break;case 3:if(Nu=null,r=Bn,Bn=od(e.containerInfo),Bt(e,t),Bn=r,Ft(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{qa(e.containerInfo)}catch(S){_e(t,t.return,S)}rh&&(rh=!1,iw(t));break;case 4:i=Bn,Bn=od(t.stateNode.containerInfo),Bt(e,t),Ft(t),Bn=i;break;case 12:Bt(e,t),Ft(t);break;case 31:Bt(e,t),Ft(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,hu(t,i)));break;case 13:Bt(e,t),Ft(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Sd=rn()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,hu(t,i)));break;case 22:r=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=xi,u=et;if(xi=c||r,et=u||l,Bt(e,t),et=u,xi=c,Ft(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||l||xi||et||po(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(o=l.stateNode,r)a=o.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{s=l.stateNode;var d=l.memoizedProps.style,h=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(S){_e(l,l.return,S)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(S){_e(l,l.return,S)}}}else if(e.tag===18){if(n===null){l=e;try{var m=l.stateNode;r?q_(m,!0):q_(l.stateNode,!1)}catch(S){_e(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;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,hu(t,n))));break;case 19:Bt(e,t),Ft(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,hu(t,i)));break;case 30:break;case 21:break;default:Bt(e,t),Ft(t)}}function Ft(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(Wx(i)){n=i;break}i=i.return}if(n==null)throw Error(M(160));switch(n.tag){case 27:var r=n.stateNode,o=ih(t);Ku(t,o,r);break;case 5:var a=n.stateNode;n.flags&32&&(za(a,""),n.flags&=-33);var s=ih(t);Ku(t,s,a);break;case 3:case 4:var l=n.stateNode.containerInfo,c=ih(t);qh(t,c,l);break;default:throw Error(M(161))}}catch(u){_e(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function iw(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;iw(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function bi(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Kx(t,e.alternate,e),e=e.sibling}function po(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Mr(4,e,e.return),po(e);break;case 1:ni(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&Gx(e,e.return,n),po(e);break;case 27:hl(e.stateNode);case 26:case 5:ni(e,e.return),po(e);break;case 22:e.memoizedState===null&&po(e);break;case 30:po(e);break;default:po(e)}t=t.sibling}}function _i(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,o=e,a=o.flags;switch(o.tag){case 0:case 11:case 15:_i(r,o,n),zl(4,o);break;case 1:if(_i(r,o,n),i=o,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){_e(i,i.return,c)}if(i=o,r=i.updateQueue,r!==null){var s=i.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)ex(l[r],s)}catch(c){_e(i,i.return,c)}}n&&a&64&&Zx(o),ul(o,o.return);break;case 27:Xx(o);case 26:case 5:_i(r,o,n),n&&i===null&&a&4&&Yx(o),ul(o,o.return);break;case 12:_i(r,o,n);break;case 31:_i(r,o,n),n&&a&4&&ew(r,o);break;case 13:_i(r,o,n),n&&a&4&&tw(r,o);break;case 22:o.memoizedState===null&&_i(r,o,n),ul(o,o.return);break;case 30:break;default:_i(r,o,n)}e=e.sibling}}function Pg(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Il(n))}function qg(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Il(t))}function zn(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)rw(t,e,n,i),e=e.sibling}function rw(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:zn(t,e,n,i),r&2048&&zl(9,e);break;case 1:zn(t,e,n,i);break;case 3:zn(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Il(t)));break;case 12:if(r&2048){zn(t,e,n,i),t=e.stateNode;try{var o=e.memoizedProps,a=o.id,s=o.onPostCommit;typeof s=="function"&&s(a,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){_e(e,e.return,l)}}else zn(t,e,n,i);break;case 31:zn(t,e,n,i);break;case 13:zn(t,e,n,i);break;case 23:break;case 22:o=e.stateNode,a=e.alternate,e.memoizedState!==null?o._visibility&2?zn(t,e,n,i):dl(t,e):o._visibility&2?zn(t,e,n,i):(o._visibility|=2,ha(t,e,n,i,(e.subtreeFlags&10256)!==0||!1)),r&2048&&Pg(a,e);break;case 24:zn(t,e,n,i),r&2048&&qg(e.alternate,e);break;default:zn(t,e,n,i)}}function ha(t,e,n,i,r){for(r=r&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var o=t,a=e,s=n,l=i,c=a.flags;switch(a.tag){case 0:case 11:case 15:ha(o,a,s,l,r),zl(8,a);break;case 23:break;case 22:var u=a.stateNode;a.memoizedState!==null?u._visibility&2?ha(o,a,s,l,r):dl(o,a):(u._visibility|=2,ha(o,a,s,l,r)),r&&c&2048&&Pg(a.alternate,a);break;case 24:ha(o,a,s,l,r),r&&c&2048&&qg(a.alternate,a);break;default:ha(o,a,s,l,r)}e=e.sibling}}function dl(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:dl(n,i),r&2048&&Pg(i.alternate,i);break;case 24:dl(n,i),r&2048&&qg(i.alternate,i);break;default:dl(n,i)}e=e.sibling}}var tl=8192;function pa(t,e,n){if(t.subtreeFlags&tl)for(t=t.child;t!==null;)ow(t,e,n),t=t.sibling}function ow(t,e,n){switch(t.tag){case 26:pa(t,e,n),t.flags&tl&&t.memoizedState!==null&&GO(n,Bn,t.memoizedState,t.memoizedProps);break;case 5:pa(t,e,n);break;case 3:case 4:var i=Bn;Bn=od(t.stateNode.containerInfo),pa(t,e,n),Bn=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=tl,tl=16777216,pa(t,e,n),tl=i):pa(t,e,n));break;default:pa(t,e,n)}}function aw(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 Ys(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ut=i,lw(i,t)}aw(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)sw(t),t=t.sibling}function sw(t){switch(t.tag){case 0:case 11:case 15:Ys(t),t.flags&2048&&Mr(9,t,t.return);break;case 3:Ys(t);break;case 12:Ys(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Ou(t)):Ys(t);break;default:Ys(t)}}function Ou(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ut=i,lw(i,t)}aw(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Mr(8,e,e.return),Ou(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Ou(e));break;default:Ou(e)}t=t.sibling}}function lw(t,e){for(;ut!==null;){var n=ut;switch(n.tag){case 0:case 11:case 15:Mr(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Il(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,ut=i;else e:for(n=t;ut!==null;){i=ut;var r=i.sibling,o=i.return;if(Qx(i),i===n){ut=null;break e}if(r!==null){r.return=o,ut=r;break e}ut=o}}}var uO={getCacheForType:function(t){var e=yt(tt),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return yt(tt).controller.signal}},dO=typeof WeakMap=="function"?WeakMap:Map,ve=0,Ae=null,ce=null,fe=0,be=0,Jt=null,vr=!1,Xa=!1,Zg=!1,Di=0,Ge=0,Nr=0,yo=0,Gg=0,nn=0,Ua=0,fl=null,Ut=null,Zh=!1,Sd=0,cw=0,Qu=1/0,Ju=null,Er=null,rt=0,Cr=null,Va=null,ki=0,Gh=0,Yh=null,uw=null,pl=0,Wh=null;function sn(){return(ve&2)!==0&&fe!==0?fe&-fe:Q.T!==null?Wg():bS()}function dw(){if(nn===0)if((fe&536870912)===0||he){var t=ru;ru<<=1,(ru&3932160)===0&&(ru=262144),nn=t}else nn=536870912;return t=cn.current,t!==null&&(t.flags|=32),nn}function Vt(t,e,n){(t===Ae&&(be===2||be===9)||t.cancelPendingCommit!==null)&&(ja(t,0),yr(t,fe,nn,!1)),Nl(t,n),((ve&2)===0||t!==Ae)&&(t===Ae&&((ve&2)===0&&(yo|=n),Ge===4&&yr(t,fe,nn,!1)),oi(t))}function fw(t,e,n){if((ve&6)!==0)throw Error(M(327));var i=!n&&(e&127)===0&&(e&t.expiredLanes)===0||Ml(t,e),r=i?hO(t,e):oh(t,e,!0),o=i;do{if(r===0){Xa&&!i&&yr(t,e,0,!1);break}else{if(n=t.current.alternate,o&&!fO(n)){r=oh(t,e,!1),o=!1;continue}if(r===2){if(o=e,t.errorRecoveryDisabledLanes&o)var a=0;else a=t.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){e=a;e:{var s=t;r=fl;var l=s.current.memoizedState.isDehydrated;if(l&&(ja(s,a).flags|=256),a=oh(s,a,!1),a!==2){if(Zg&&!l){s.errorRecoveryDisabledLanes|=o,yo|=o,r=4;break e}o=Ut,Ut=r,o!==null&&(Ut===null?Ut=o:Ut.push.apply(Ut,o))}r=a}if(o=!1,r!==2)continue}}if(r===1){ja(t,0),yr(t,e,0,!0);break}e:{switch(i=t,o=r,o){case 0:case 1:throw Error(M(345));case 4:if((e&4194048)!==e)break;case 6:yr(i,e,nn,!vr);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(M(329))}if((e&62914560)===e&&(r=Sd+300-rn(),10<r)){if(yr(i,e,nn,!vr),ud(i,0,!0)!==0)break e;ki=e,i.timeoutHandle=Nw(O_.bind(null,i,n,Ut,Ju,Zh,e,nn,yo,Ua,vr,o,"Throttled",-0,0),r);break e}O_(i,n,Ut,Ju,Zh,e,nn,yo,Ua,vr,o,null,-0,0)}}break}while(!0);oi(t)}function O_(t,e,n,i,r,o,a,s,l,c,u,d,h,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:Ei},ow(e,o,d);var S=(o&62914560)===o?Sd-rn():(o&4194048)===o?cw-rn():0;if(S=YO(d,S),S!==null){ki=o,t.cancelPendingCommit=S(N_.bind(null,t,e,o,n,i,r,a,s,l,u,d,null,h,m)),yr(t,o,a,!c);return}}N_(t,e,o,n,i,r,a,s,l)}function fO(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],o=r.getSnapshot;r=r.value;try{if(!ln(o(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function yr(t,e,n,i){e&=~Gg,e&=~yo,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var o=31-an(r),a=1<<o;i[o]=-1,r&=~a}n!==0&&mS(t,n,e)}function xd(){return(ve&6)===0?(Bl(0,!1),!1):!0}function Yg(){if(ce!==null){if(be===0)var t=ce.return;else t=ce,Ci=ko=null,Dg(t),Na=null,Sl=0,t=ce;for(;t!==null;)qx(t.alternate,t),t=t.return;ce=null}}function ja(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,OO(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),ki=0,Yg(),Ae=t,ce=n=Ai(t.current,null),fe=e,be=0,Jt=null,vr=!1,Xa=Ml(t,e),Zg=!1,Ua=nn=Gg=yo=Nr=Ge=0,Ut=fl=null,Zh=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-an(i),o=1<<r;e|=t[r],i&=~o}return Di=e,hd(),n}function pw(t,e){re=null,Q.H=wl,e===Wa||e===md?(e=l_(),be=3):e===Ag?(e=l_(),be=4):be=e===Vg?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Jt=e,ce===null&&(Ge=1,Wu(t,Sn(e,t.current)))}function hw(){var t=cn.current;return t===null?!0:(fe&4194048)===fe?wn===null:(fe&62914560)===fe||(fe&536870912)!==0?t===wn:!1}function gw(){var t=Q.H;return Q.H=wl,t===null?wl:t}function mw(){var t=Q.A;return Q.A=uO,t}function ed(){Ge=4,vr||(fe&4194048)!==fe&&cn.current!==null||(Xa=!0),(Nr&134217727)===0&&(yo&134217727)===0||Ae===null||yr(Ae,fe,nn,!1)}function oh(t,e,n){var i=ve;ve|=2;var r=gw(),o=mw();(Ae!==t||fe!==e)&&(Ju=null,ja(t,e)),e=!1;var a=Ge;e:do try{if(be!==0&&ce!==null){var s=ce,l=Jt;switch(be){case 8:Yg(),a=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(e=!0);var c=be;if(be=0,Jt=null,Ta(t,s,l,c),n&&Xa){a=0;break e}break;default:c=be,be=0,Jt=null,Ta(t,s,l,c)}}pO(),a=Ge;break}catch(u){pw(t,u)}while(!0);return e&&t.shellSuspendCounter++,Ci=ko=null,ve=i,Q.H=r,Q.A=o,ce===null&&(Ae=null,fe=0,hd()),a}function pO(){for(;ce!==null;)vw(ce)}function hO(t,e){var n=ve;ve|=2;var i=gw(),r=mw();Ae!==t||fe!==e?(Ju=null,Qu=rn()+500,ja(t,e)):Xa=Ml(t,e);e:do try{if(be!==0&&ce!==null){e=ce;var o=Jt;t:switch(be){case 1:be=0,Jt=null,Ta(t,e,o,1);break;case 2:case 9:if(s_(o)){be=0,Jt=null,M_(e);break}e=function(){be!==2&&be!==9||Ae!==t||(be=7),oi(t)},o.then(e,e);break e;case 3:be=7;break e;case 4:be=5;break e;case 7:s_(o)?(be=0,Jt=null,M_(e)):(be=0,Jt=null,Ta(t,e,o,7));break;case 5:var a=null;switch(ce.tag){case 26:a=ce.memoizedState;case 5:case 27:var s=ce;if(a?zw(a):s.stateNode.complete){be=0,Jt=null;var l=s.sibling;if(l!==null)ce=l;else{var c=s.return;c!==null?(ce=c,wd(c)):ce=null}break t}}be=0,Jt=null,Ta(t,e,o,5);break;case 6:be=0,Jt=null,Ta(t,e,o,6);break;case 8:Yg(),Ge=6;break e;default:throw Error(M(462))}}gO();break}catch(u){pw(t,u)}while(!0);return Ci=ko=null,Q.H=i,Q.A=r,ve=n,ce!==null?0:(Ae=null,fe=0,hd(),Ge)}function gO(){for(;ce!==null&&!BR();)vw(ce)}function vw(t){var e=Px(t.alternate,t,Di);t.memoizedProps=t.pendingProps,e===null?wd(t):ce=e}function M_(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=E_(n,e,e.pendingProps,e.type,void 0,fe);break;case 11:e=E_(n,e,e.pendingProps,e.type.render,e.ref,fe);break;case 5:Dg(e);default:qx(n,e),e=ce=qS(e,Di),e=Px(n,e,Di)}t.memoizedProps=t.pendingProps,e===null?wd(t):ce=e}function Ta(t,e,n,i){Ci=ko=null,Dg(e),Na=null,Sl=0;var r=e.return;try{if(iO(t,r,e,n,fe)){Ge=1,Wu(t,Sn(n,t.current)),ce=null;return}}catch(o){if(r!==null)throw ce=r,o;Ge=1,Wu(t,Sn(n,t.current)),ce=null;return}e.flags&32768?(he||i===1?t=!0:Xa||(fe&536870912)!==0?t=!1:(vr=t=!0,(i===2||i===9||i===3||i===6)&&(i=cn.current,i!==null&&i.tag===13&&(i.flags|=16384))),yw(e,t)):wd(e)}function wd(t){var e=t;do{if((e.flags&32768)!==0){yw(e,vr);return}t=e.return;var n=aO(e.alternate,e,Di);if(n!==null){ce=n;return}if(e=e.sibling,e!==null){ce=e;return}ce=e=t}while(e!==null);Ge===0&&(Ge=5)}function yw(t,e){do{var n=sO(t.alternate,t);if(n!==null){n.flags&=32767,ce=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){ce=t;return}ce=t=n}while(t!==null);Ge=6,ce=null}function N_(t,e,n,i,r,o,a,s,l){t.cancelPendingCommit=null;do Ed();while(rt!==0);if((ve&6)!==0)throw Error(M(327));if(e!==null){if(e===t.current)throw Error(M(177));if(o=e.lanes|e.childLanes,o|=bg,YR(t,n,o,a,s,l),t===Ae&&(ce=Ae=null,fe=0),Va=e,Cr=t,ki=n,Gh=o,Yh=r,uw=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,bO(Bu,function(){return ww(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=Q.T,Q.T=null,r=ye.p,ye.p=2,a=ve,ve|=4;try{lO(t,e,n)}finally{ve=a,ye.p=r,Q.T=i}}rt=1,bw(),_w(),Sw()}}function bw(){if(rt===1){rt=0;var t=Cr,e=Va,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=Q.T,Q.T=null;var i=ye.p;ye.p=2;var r=ve;ve|=4;try{nw(e,t);var o=Jh,a=zS(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(a!==s&&s&&s.ownerDocument&&HS(s.ownerDocument.documentElement,s)){if(l!==null&&yg(s)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,h=d&&d.defaultView||window;if(h.getSelection){var m=h.getSelection(),S=s.textContent.length,_=Math.min(l.start,S),b=l.end===void 0?_:Math.min(l.end,S);!m.extend&&_>b&&(a=b,b=_,_=a);var f=e_(s,_),p=e_(s,b);if(f&&p&&(m.rangeCount!==1||m.anchorNode!==f.node||m.anchorOffset!==f.offset||m.focusNode!==p.node||m.focusOffset!==p.offset)){var v=d.createRange();v.setStart(f.node,f.offset),m.removeAllRanges(),_>b?(m.addRange(v),m.extend(p.node,p.offset)):(v.setEnd(p.node,p.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}}ld=!!Qh,Jh=Qh=null}finally{ve=r,ye.p=i,Q.T=n}}t.current=e,rt=2}}function _w(){if(rt===2){rt=0;var t=Cr,e=Va,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=Q.T,Q.T=null;var i=ye.p;ye.p=2;var r=ve;ve|=4;try{Kx(t,e.alternate,e)}finally{ve=r,ye.p=i,Q.T=n}}rt=3}}function Sw(){if(rt===4||rt===3){rt=0,FR();var t=Cr,e=Va,n=ki,i=uw;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?rt=5:(rt=0,Va=Cr=null,xw(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Er=null),dg(n),e=e.stateNode,on&&typeof on.onCommitFiberRoot=="function")try{on.onCommitFiberRoot(Ol,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Q.T,r=ye.p,ye.p=2,Q.T=null;try{for(var o=t.onRecoverableError,a=0;a<i.length;a++){var s=i[a];o(s.value,{componentStack:s.stack})}}finally{Q.T=e,ye.p=r}}(ki&3)!==0&&Ed(),oi(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===Wh?pl++:(pl=0,Wh=t):pl=0,Bl(0,!1)}}function xw(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Il(e)))}function Ed(){return bw(),_w(),Sw(),ww()}function ww(){if(rt!==5)return!1;var t=Cr,e=Gh;Gh=0;var n=dg(ki),i=Q.T,r=ye.p;try{ye.p=32>n?32:n,Q.T=null,n=Yh,Yh=null;var o=Cr,a=ki;if(rt=0,Va=Cr=null,ki=0,(ve&6)!==0)throw Error(M(331));var s=ve;if(ve|=4,sw(o.current),rw(o,o.current,a,n),ve=s,Bl(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(Ol,o)}catch{}return!0}finally{ye.p=r,Q.T=i,xw(t,e)}}function D_(t,e,n){e=Sn(n,e),e=Vh(t.stateNode,e,2),t=wr(t,e,2),t!==null&&(Nl(t,2),oi(t))}function _e(t,e,n){if(t.tag===3)D_(t,t,n);else for(;e!==null;){if(e.tag===3){D_(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Er===null||!Er.has(i))){t=Sn(n,t),n=Bx(2),i=wr(e,n,2),i!==null&&(Fx(n,i,e,t),Nl(i,2),oi(i));break}}e=e.return}}function ah(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new dO;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(Zg=!0,r.add(n),t=mO.bind(null,t,e,n),e.then(t,t))}function mO(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ae===t&&(fe&n)===n&&(Ge===4||Ge===3&&(fe&62914560)===fe&&300>rn()-Sd?(ve&2)===0&&ja(t,0):Gg|=n,Ua===fe&&(Ua=0)),oi(t)}function Ew(t,e){e===0&&(e=gS()),t=To(t,e),t!==null&&(Nl(t,e),oi(t))}function vO(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Ew(t,n)}function yO(t,e){var n=0;switch(t.tag){case 31:case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(M(314))}i!==null&&i.delete(e),Ew(t,n)}function bO(t,e){return cg(t,e)}var td=null,ga=null,Xh=!1,nd=!1,sh=!1,br=0;function oi(t){t!==ga&&t.next===null&&(ga===null?td=ga=t:ga=ga.next=t),nd=!0,Xh||(Xh=!0,SO())}function Bl(t,e){if(!sh&&nd){sh=!0;do for(var n=!1,i=td;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var o=0;else{var a=i.suspendedLanes,s=i.pingedLanes;o=(1<<31-an(42|t)+1)-1,o&=r&~(a&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,L_(i,o))}else o=fe,o=ud(i,i===Ae?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||Ml(i,o)||(n=!0,L_(i,o));i=i.next}while(n);sh=!1}}function _O(){Cw()}function Cw(){nd=Xh=!1;var t=0;br!==0&&RO()&&(t=br);for(var e=rn(),n=null,i=td;i!==null;){var r=i.next,o=Aw(i,e);o===0?(i.next=null,n===null?td=r:n.next=r,r===null&&(ga=n)):(n=i,(t!==0||(o&3)!==0)&&(nd=!0)),i=r}rt!==0&&rt!==5||Bl(t,!1),br!==0&&(br=0)}function Aw(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var a=31-an(o),s=1<<a,l=r[a];l===-1?((s&n)===0||(s&i)!==0)&&(r[a]=GR(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Ae,n=fe,n=ud(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(be===2||be===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&Hp(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Ml(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&Hp(i),dg(n)){case 2:case 8:n=pS;break;case 32:n=Bu;break;case 268435456:n=hS;break;default:n=Bu}return i=Tw.bind(null,t),n=cg(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&Hp(i),t.callbackPriority=2,t.callbackNode=null,2}function Tw(t,e){if(rt!==0&&rt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(Ed()&&t.callbackNode!==n)return null;var i=fe;return i=ud(t,t===Ae?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(fw(t,i,e),Aw(t,rn()),t.callbackNode!=null&&t.callbackNode===n?Tw.bind(null,t):null)}function L_(t,e){if(Ed())return null;fw(t,e,!0)}function SO(){MO(function(){(ve&6)!==0?cg(fS,_O):Cw()})}function Wg(){if(br===0){var t=Ba;t===0&&(t=iu,iu<<=1,(iu&261888)===0&&(iu=256)),br=t}return br}function I_(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Su(""+t)}function H_(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function xO(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var o=I_((r[jt]||null).action),a=i.submitter;a&&(e=(e=a[jt]||null)?I_(e.formAction):a.getAttribute("formAction"),e!==null&&(o=e,a=null));var s=new dd("action","action",null,i,r);t.push({event:s,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(br!==0){var l=a?H_(r,a):new FormData(r);$h(n,{pending:!0,data:l,method:r.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=a?H_(r,a):new FormData(r),$h(n,{pending:!0,data:l,method:r.method,action:o},o,l))},currentTarget:r}]})}}for(gu=0;gu<kh.length;gu++)mu=kh[gu],z_=mu.toLowerCase(),B_=mu[0].toUpperCase()+mu.slice(1),Fn(z_,"on"+B_);var mu,z_,B_,gu;Fn(FS,"onAnimationEnd");Fn($S,"onAnimationIteration");Fn(US,"onAnimationStart");Fn("dblclick","onDoubleClick");Fn("focusin","onFocus");Fn("focusout","onBlur");Fn($2,"onTransitionRun");Fn(U2,"onTransitionStart");Fn(V2,"onTransitionCancel");Fn(VS,"onTransitionEnd");Ha("onMouseEnter",["mouseout","mouseover"]);Ha("onMouseLeave",["mouseout","mouseover"]);Ha("onPointerEnter",["pointerout","pointerover"]);Ha("onPointerLeave",["pointerout","pointerover"]);Eo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Eo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Eo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Eo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Eo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Eo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var El="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(" "),wO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(El));function kw(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var o=void 0;if(e)for(var a=i.length-1;0<=a;a--){var s=i[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(u){$u(u)}r.currentTarget=null,o=l}else for(a=0;a<i.length;a++){if(s=i[a],l=s.instance,c=s.currentTarget,s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(u){$u(u)}r.currentTarget=null,o=l}}}}function le(t,e){var n=e[_h];n===void 0&&(n=e[_h]=new Set);var i=t+"__bubble";n.has(i)||(Rw(e,t,2,!1),n.add(i))}function lh(t,e,n){var i=0;e&&(i|=4),Rw(n,t,i,e)}var vu="_reactListening"+Math.random().toString(36).slice(2);function Xg(t){if(!t[vu]){t[vu]=!0,_S.forEach(function(n){n!=="selectionchange"&&(wO.has(n)||lh(n,!1,t),lh(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[vu]||(e[vu]=!0,lh("selectionchange",!1,e))}}function Rw(t,e,n,i){switch(Vw(e)){case 2:var r=KO;break;case 8:r=QO;break;default:r=em}n=r.bind(null,e,n,t),r=void 0,!Ch||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function ch(t,e,n,i,r){var o=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var a=i.tag;if(a===3||a===4){var s=i.stateNode.containerInfo;if(s===r)break;if(a===4)for(a=i.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===r)return;a=a.return}for(;s!==null;){if(a=ya(s),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){i=o=a;continue e}s=s.parentNode}}i=i.return}kS(function(){var c=o,u=hg(n),d=[];e:{var h=jS.get(t);if(h!==void 0){var m=dd,S=t;switch(t){case"keypress":if(wu(n)===0)break e;case"keydown":case"keyup":m=y2;break;case"focusin":S="focus",m=Up;break;case"focusout":S="blur",m=Up;break;case"beforeblur":case"afterblur":m=Up;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=q0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=a2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=S2;break;case FS:case $S:case US:m=c2;break;case VS:m=w2;break;case"scroll":case"scrollend":m=r2;break;case"wheel":m=C2;break;case"copy":case"cut":case"paste":m=d2;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=T2}var _=(e&4)!==0,b=!_&&(t==="scroll"||t==="scrollend"),f=_?h!==null?h+"Capture":null:h;_=[];for(var p=c,v;p!==null;){var y=p;if(v=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||v===null||f===null||(y=ml(p,f),y!=null&&_.push(Cl(p,y,v))),b)break;p=p.return}0<_.length&&(h=new m(h,S,null,n,u),d.push({event:h,listeners:_}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",m=t==="mouseout"||t==="pointerout",h&&n!==Eh&&(S=n.relatedTarget||n.fromElement)&&(ya(S)||S[Za]))break e;if((m||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,m?(S=n.relatedTarget||n.toElement,m=c,S=S?ya(S):null,S!==null&&(b=Rl(S),_=S.tag,S!==b||_!==5&&_!==27&&_!==6)&&(S=null)):(m=null,S=c),m!==S)){if(_=q0,y="onMouseLeave",f="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(_=G0,y="onPointerLeave",f="onPointerEnter",p="pointer"),b=m==null?h:Js(m),v=S==null?h:Js(S),h=new _(y,p+"leave",m,n,u),h.target=b,h.relatedTarget=v,y=null,ya(u)===c&&(_=new _(f,p+"enter",S,n,u),_.target=v,_.relatedTarget=b,y=_),b=y,m&&S)t:{for(_=EO,f=m,p=S,v=0,y=f;y;y=_(y))v++;y=0;for(var w=p;w;w=_(w))y++;for(;0<v-y;)f=_(f),v--;for(;0<y-v;)p=_(p),y--;for(;v--;){if(f===p||p!==null&&f===p.alternate){_=f;break t}f=_(f),p=_(p)}_=null}else _=null;m!==null&&F_(d,h,m,_,!1),S!==null&&b!==null&&F_(d,b,S,_,!0)}}e:{if(h=c?Js(c):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var A=K0;else if(X0(h))if(LS)A=z2;else{A=I2;var x=L2}else m=h.nodeName,!m||m.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&pg(c.elementType)&&(A=K0):A=H2;if(A&&(A=A(t,c))){DS(d,A,n,u);break e}x&&x(t,h,c),t==="focusout"&&c&&h.type==="number"&&c.memoizedProps.value!=null&&wh(h,"number",h.value)}switch(x=c?Js(c):window,t){case"focusin":(X0(x)||x.contentEditable==="true")&&(Sa=x,Ah=c,rl=null);break;case"focusout":rl=Ah=Sa=null;break;case"mousedown":Th=!0;break;case"contextmenu":case"mouseup":case"dragend":Th=!1,t_(d,n,u);break;case"selectionchange":if(F2)break;case"keydown":case"keyup":t_(d,n,u)}var T;if(vg)e:{switch(t){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else _a?MS(t,n)&&(k="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(OS&&n.locale!=="ko"&&(_a||k!=="onCompositionStart"?k==="onCompositionEnd"&&_a&&(T=RS()):(mr=u,gg="value"in mr?mr.value:mr.textContent,_a=!0)),x=id(c,k),0<x.length&&(k=new Z0(k,t,null,n,u),d.push({event:k,listeners:x}),T?k.data=T:(T=NS(n),T!==null&&(k.data=T)))),(T=R2?O2(t,n):M2(t,n))&&(k=id(c,"onBeforeInput"),0<k.length&&(x=new Z0("onBeforeInput","beforeinput",null,n,u),d.push({event:x,listeners:k}),x.data=T)),xO(d,t,c,n,u)}kw(d,e)})}function Cl(t,e,n){return{instance:t,listener:e,currentTarget:n}}function id(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,o=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=ml(t,n),r!=null&&i.unshift(Cl(t,r,o)),r=ml(t,e),r!=null&&i.push(Cl(t,r,o))),t.tag===3)return i;t=t.return}return[]}function EO(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,n,i,r){for(var o=e._reactName,a=[];n!==null&&n!==i;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,l!==null&&l===i)break;s!==5&&s!==26&&s!==27||c===null||(l=c,r?(c=ml(n,o),c!=null&&a.unshift(Cl(n,c,l))):r||(c=ml(n,o),c!=null&&a.push(Cl(n,c,l)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var CO=/\r\n?/g,AO=/\u0000|\uFFFD/g;function $_(t){return(typeof t=="string"?t:""+t).replace(CO,`
|
|
9
|
-
`).replace(AO,"")}function Ow(t,e){return e=$_(e),$_(t)===e}function we(t,e,n,i,r,o){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||za(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&za(t,""+i);break;case"className":au(t,"class",i);break;case"tabIndex":au(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":au(t,n,i);break;case"style":TS(t,i,o);break;case"data":if(e!=="object"){au(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Su(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(n==="formAction"?(e!=="input"&&we(t,e,"name",r.name,r,null),we(t,e,"formEncType",r.formEncType,r,null),we(t,e,"formMethod",r.formMethod,r,null),we(t,e,"formTarget",r.formTarget,r,null)):(we(t,e,"encType",r.encType,r,null),we(t,e,"method",r.method,r,null),we(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Su(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=Ei);break;case"onScroll":i!=null&&le("scroll",t);break;case"onScrollEnd":i!=null&&le("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(M(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(M(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=Su(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":le("beforetoggle",t),le("toggle",t),_u(t,"popover",i);break;case"xlinkActuate":mi(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":mi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":mi(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":mi(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":mi(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":mi(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":mi(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":mi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":mi(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":_u(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=n2.get(n)||n,_u(t,n,i))}}function Kh(t,e,n,i,r,o){switch(n){case"style":TS(t,i,o);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(M(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(M(60));t.innerHTML=n}}break;case"children":typeof i=="string"?za(t,i):(typeof i=="number"||typeof i=="bigint")&&za(t,""+i);break;case"onScroll":i!=null&&le("scroll",t);break;case"onScrollEnd":i!=null&&le("scrollend",t);break;case"onClick":i!=null&&(t.onclick=Ei);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!SS.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),o=t[jt]||null,o=o!=null?o[n]:null,typeof o=="function"&&t.removeEventListener(e,o,r),typeof i=="function")){typeof o!="function"&&o!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):_u(t,n,i)}}}function bt(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":le("error",t),le("load",t);var i=!1,r=!1,o;for(o in n)if(n.hasOwnProperty(o)){var a=n[o];if(a!=null)switch(o){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(M(137,e));default:we(t,e,o,a,n,null)}}r&&we(t,e,"srcSet",n.srcSet,n,null),i&&we(t,e,"src",n.src,n,null);return;case"input":le("invalid",t);var s=o=a=r=null,l=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":a=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":o=u;break;case"defaultValue":s=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(M(137,e));break;default:we(t,e,i,u,n,null)}}ES(t,o,s,l,c,a,r,!1);return;case"select":le("invalid",t),i=a=o=null;for(r in n)if(n.hasOwnProperty(r)&&(s=n[r],s!=null))switch(r){case"value":o=s;break;case"defaultValue":a=s;break;case"multiple":i=s;default:we(t,e,r,s,n,null)}e=o,n=a,t.multiple=!!i,e!=null?Ra(t,!!i,e,!1):n!=null&&Ra(t,!!i,n,!0);return;case"textarea":le("invalid",t),o=r=i=null;for(a in n)if(n.hasOwnProperty(a)&&(s=n[a],s!=null))switch(a){case"value":i=s;break;case"defaultValue":r=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(M(91));break;default:we(t,e,a,s,n,null)}AS(t,i,r,o);return;case"option":for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null)&&(l==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":we(t,e,l,i,n,null));return;case"dialog":le("beforetoggle",t),le("toggle",t),le("cancel",t),le("close",t);break;case"iframe":case"object":le("load",t);break;case"video":case"audio":for(i=0;i<El.length;i++)le(El[i],t);break;case"image":le("error",t),le("load",t);break;case"details":le("toggle",t);break;case"embed":case"source":case"link":le("error",t),le("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(M(137,e));default:we(t,e,c,i,n,null)}return;default:if(pg(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&Kh(t,e,u,i,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(i=n[s],i!=null&&we(t,e,s,i,n,null))}function TO(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,a=null,s=null,l=null,c=null,u=null;for(m in n){var d=n[m];if(n.hasOwnProperty(m)&&d!=null)switch(m){case"checked":break;case"value":break;case"defaultValue":l=d;default:i.hasOwnProperty(m)||we(t,e,m,null,i,d)}}for(var h in i){var m=i[h];if(d=n[h],i.hasOwnProperty(h)&&(m!=null||d!=null))switch(h){case"type":o=m;break;case"name":r=m;break;case"checked":c=m;break;case"defaultChecked":u=m;break;case"value":a=m;break;case"defaultValue":s=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(M(137,e));break;default:m!==d&&we(t,e,h,m,i,d)}}xh(t,a,s,l,c,u,o,r);return;case"select":m=a=s=h=null;for(o in n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":m=l;default:i.hasOwnProperty(o)||we(t,e,o,null,i,l)}for(r in i)if(o=i[r],l=n[r],i.hasOwnProperty(r)&&(o!=null||l!=null))switch(r){case"value":h=o;break;case"defaultValue":s=o;break;case"multiple":a=o;default:o!==l&&we(t,e,r,o,i,l)}e=s,n=a,i=m,h!=null?Ra(t,!!n,h,!1):!!i!=!!n&&(e!=null?Ra(t,!!n,e,!0):Ra(t,!!n,n?[]:"",!1));return;case"textarea":m=h=null;for(s in n)if(r=n[s],n.hasOwnProperty(s)&&r!=null&&!i.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:we(t,e,s,null,i,r)}for(a in i)if(r=i[a],o=n[a],i.hasOwnProperty(a)&&(r!=null||o!=null))switch(a){case"value":h=r;break;case"defaultValue":m=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(M(91));break;default:r!==o&&we(t,e,a,r,i,o)}CS(t,h,m);return;case"option":for(var S in n)h=n[S],n.hasOwnProperty(S)&&h!=null&&!i.hasOwnProperty(S)&&(S==="selected"?t.selected=!1:we(t,e,S,null,i,h));for(l in i)h=i[l],m=n[l],i.hasOwnProperty(l)&&h!==m&&(h!=null||m!=null)&&(l==="selected"?t.selected=h&&typeof h!="function"&&typeof h!="symbol":we(t,e,l,h,i,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 _ in n)h=n[_],n.hasOwnProperty(_)&&h!=null&&!i.hasOwnProperty(_)&&we(t,e,_,null,i,h);for(c in i)if(h=i[c],m=n[c],i.hasOwnProperty(c)&&h!==m&&(h!=null||m!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(M(137,e));break;default:we(t,e,c,h,i,m)}return;default:if(pg(e)){for(var b in n)h=n[b],n.hasOwnProperty(b)&&h!==void 0&&!i.hasOwnProperty(b)&&Kh(t,e,b,void 0,i,h);for(u in i)h=i[u],m=n[u],!i.hasOwnProperty(u)||h===m||h===void 0&&m===void 0||Kh(t,e,u,h,i,m);return}}for(var f in n)h=n[f],n.hasOwnProperty(f)&&h!=null&&!i.hasOwnProperty(f)&&we(t,e,f,null,i,h);for(d in i)h=i[d],m=n[d],!i.hasOwnProperty(d)||h===m||h==null&&m==null||we(t,e,d,h,i,m)}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 kO(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],o=r.transferSize,a=r.initiatorType,s=r.duration;if(o&&s&&U_(a)){for(a=0,s=r.responseEnd,i+=1;i<n.length;i++){var l=n[i],c=l.startTime;if(c>s)break;var u=l.transferSize,d=l.initiatorType;u&&U_(d)&&(l=l.responseEnd,a+=u*(l<s?1:(s-c)/(l-c)))}if(--i,e+=8*(o+a)/(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 Qh=null,Jh=null;function rd(t){return t.nodeType===9?t:t.ownerDocument}function V_(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 Mw(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 eg(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 uh=null;function RO(){var t=window.event;return t&&t.type==="popstate"?t===uh?!1:(uh=t,!0):(uh=null,!1)}var Nw=typeof setTimeout=="function"?setTimeout:void 0,OO=typeof clearTimeout=="function"?clearTimeout:void 0,j_=typeof Promise=="function"?Promise:void 0,MO=typeof queueMicrotask=="function"?queueMicrotask:typeof j_<"u"?function(t){return j_.resolve(null).then(t).catch(NO)}:Nw;function NO(t){setTimeout(function(){throw t})}function Lr(t){return t==="head"}function P_(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(i===0){t.removeChild(r),qa(e);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")hl(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,hl(n);for(var o=n.firstChild;o;){var a=o.nextSibling,s=o.nodeName;o[Dl]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=a}}else n==="body"&&hl(t.ownerDocument.body);n=r}while(n);qa(e)}function q_(t,e){var n=t;t=0;do{var i=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(t===0)break;t--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=i}while(n)}function tg(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":tg(n),fg(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function DO(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Dl])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=En(t.nextSibling),t===null)break}return null}function LO(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=En(t.nextSibling),t===null))return null;return t}function Dw(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=En(t.nextSibling),t===null))return null;return t}function ng(t){return t.data==="$?"||t.data==="$~"}function ig(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function IO(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function En(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 rg=null;function Z_(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return En(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function G_(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--}else n!=="/$"&&n!=="/&"||e++}t=t.previousSibling}return null}function Lw(t,e,n){switch(e=rd(n),t){case"html":if(t=e.documentElement,!t)throw Error(M(452));return t;case"head":if(t=e.head,!t)throw Error(M(453));return t;case"body":if(t=e.body,!t)throw Error(M(454));return t;default:throw Error(M(451))}}function hl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);fg(t)}var Cn=new Map,Y_=new Set;function od(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Li=ye.d;ye.d={f:HO,r:zO,D:BO,C:FO,L:$O,m:UO,X:jO,S:VO,M:PO};function HO(){var t=Li.f(),e=xd();return t||e}function zO(t){var e=Ga(t);e!==null&&e.tag===5&&e.type==="form"?Tx(e):Li.r(t)}var Ka=typeof document>"u"?null:document;function Iw(t,e,n){var i=Ka;if(i&&typeof e=="string"&&e){var r=_n(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Y_.has(r)||(Y_.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),bt(e,"link",t),dt(e),i.head.appendChild(e)))}}function BO(t){Li.D(t),Iw("dns-prefetch",t,null)}function FO(t,e){Li.C(t,e),Iw("preconnect",t,e)}function $O(t,e,n){Li.L(t,e,n);var i=Ka;if(i&&t&&e){var r='link[rel="preload"][as="'+_n(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+_n(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+_n(n.imageSizes)+'"]')):r+='[href="'+_n(t)+'"]';var o=r;switch(e){case"style":o=Pa(t);break;case"script":o=Qa(t)}Cn.has(o)||(t=He({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),Cn.set(o,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(Fl(o))||e==="script"&&i.querySelector($l(o))||(e=i.createElement("link"),bt(e,"link",t),dt(e),i.head.appendChild(e)))}}function UO(t,e){Li.m(t,e);var n=Ka;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+_n(i)+'"][href="'+_n(t)+'"]',o=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Qa(t)}if(!Cn.has(o)&&(t=He({rel:"modulepreload",href:t},e),Cn.set(o,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector($l(o)))return}i=n.createElement("link"),bt(i,"link",t),dt(i),n.head.appendChild(i)}}}function VO(t,e,n){Li.S(t,e,n);var i=Ka;if(i&&t){var r=ka(i).hoistableStyles,o=Pa(t);e=e||"default";var a=r.get(o);if(!a){var s={loading:0,preload:null};if(a=i.querySelector(Fl(o)))s.loading=5;else{t=He({rel:"stylesheet",href:t,"data-precedence":e},n),(n=Cn.get(o))&&Kg(t,n);var l=a=i.createElement("link");dt(l),bt(l,"link",t),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Mu(a,e,i)}a={type:"stylesheet",instance:a,count:1,state:s},r.set(o,a)}}}function jO(t,e){Li.X(t,e);var n=Ka;if(n&&t){var i=ka(n).hoistableScripts,r=Qa(t),o=i.get(r);o||(o=n.querySelector($l(r)),o||(t=He({src:t,async:!0},e),(e=Cn.get(r))&&Qg(t,e),o=n.createElement("script"),dt(o),bt(o,"link",t),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function PO(t,e){Li.M(t,e);var n=Ka;if(n&&t){var i=ka(n).hoistableScripts,r=Qa(t),o=i.get(r);o||(o=n.querySelector($l(r)),o||(t=He({src:t,async:!0,type:"module"},e),(e=Cn.get(r))&&Qg(t,e),o=n.createElement("script"),dt(o),bt(o,"link",t),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function W_(t,e,n,i){var r=(r=_r.current)?od(r):null;if(!r)throw Error(M(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Pa(n.href),n=ka(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Pa(n.href);var o=ka(r).hoistableStyles,a=o.get(t);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(t,a),(o=r.querySelector(Fl(t)))&&!o._p&&(a.instance=o,a.state.loading=5),Cn.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cn.set(t,n),o||qO(r,t,n,a.state))),e&&i===null)throw Error(M(528,""));return a}if(e&&i!==null)throw Error(M(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Qa(n),n=ka(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(M(444,t))}}function Pa(t){return'href="'+_n(t)+'"'}function Fl(t){return'link[rel="stylesheet"]['+t+"]"}function Hw(t){return He({},t,{"data-precedence":t.precedence,precedence:null})}function qO(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),bt(e,"link",n),dt(e),t.head.appendChild(e))}function Qa(t){return'[src="'+_n(t)+'"]'}function $l(t){return"script[async]"+t}function X_(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+_n(n.href)+'"]');if(i)return e.instance=i,dt(i),i;var r=He({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),dt(i),bt(i,"style",r),Mu(i,n.precedence,t),e.instance=i;case"stylesheet":r=Pa(n.href);var o=t.querySelector(Fl(r));if(o)return e.state.loading|=4,e.instance=o,dt(o),o;i=Hw(n),(r=Cn.get(r))&&Kg(i,r),o=(t.ownerDocument||t).createElement("link"),dt(o);var a=o;return a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),bt(o,"link",i),e.state.loading|=4,Mu(o,n.precedence,t),e.instance=o;case"script":return o=Qa(n.src),(r=t.querySelector($l(o)))?(e.instance=r,dt(r),r):(i=n,(r=Cn.get(o))&&(i=He({},n),Qg(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),dt(r),bt(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(M(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,Mu(i,n.precedence,t));return e.instance}function Mu(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,o=r,a=0;a<i.length;a++){var s=i[a];if(s.dataset.precedence===e)o=s;else if(o!==r)break}o?o.parentNode.insertBefore(t,o.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function Kg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Qg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Nu=null;function K_(t,e,n){if(Nu===null){var i=new Map,r=Nu=new Map;r.set(n,i)}else r=Nu,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var o=n[r];if(!(o[Dl]||o[mt]||t==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var a=o.getAttribute(e)||"";a=t+a;var s=i.get(a);s?s.push(o):i.set(a,[o])}}return i}function Q_(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function ZO(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function zw(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function GO(t,e,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=Pa(i.href),o=e.querySelector(Fl(r));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=ad.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=o,dt(o);return}o=e.ownerDocument||e,i=Hw(i),(r=Cn.get(r))&&Kg(i,r),o=o.createElement("link"),dt(o);var a=o;a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),bt(o,"link",i),n.instance=o}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=ad.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var dh=0;function YO(t,e){return t.stylesheets&&t.count===0&&Du(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var i=setTimeout(function(){if(t.stylesheets&&Du(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&dh===0&&(dh=62500*kO());var r=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Du(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>dh?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function ad(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Du(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var sd=null;function Du(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,sd=new Map,e.forEach(WO,t),sd=null,ad.call(t))}function WO(t,e){if(!(e.state.loading&4)){var n=sd.get(t);if(n)var i=n.get(null);else{n=new Map,sd.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var a=r[o];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),i=a)}i&&n.set(null,i)}r=e.instance,a=r.getAttribute("data-precedence"),o=n.get(a)||i,o===i&&n.set(null,r),n.set(a,r),this.count++,i=ad.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),o?o.parentNode.insertBefore(r,o.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var Al={$$typeof:wi,Provider:null,Consumer:null,_currentValue:ho,_currentValue2:ho,_threadCount:0};function XO(t,e,n,i,r,o,a,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=zp(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zp(0),this.hiddenUpdates=zp(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function Bw(t,e,n,i,r,o,a,s,l,c,u,d){return t=new XO(t,e,n,a,l,c,u,d,s),e=1,o===!0&&(e|=24),o=tn(3,null,null,e),t.current=o,o.stateNode=t,e=Eg(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:i,isDehydrated:n,cache:e},Tg(o),t}function Fw(t){return t?(t=Ea,t):Ea}function $w(t,e,n,i,r,o){r=Fw(r),i.context===null?i.context=r:i.pendingContext=r,i=xr(e),i.payload={element:n},o=o===void 0?null:o,o!==null&&(i.callback=o),n=wr(t,i,e),n!==null&&(Vt(n,t,e),al(n,t,e))}function J_(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Jg(t,e){J_(t,e),(t=t.alternate)&&J_(t,e)}function Uw(t){if(t.tag===13||t.tag===31){var e=To(t,67108864);e!==null&&Vt(e,t,67108864),Jg(t,67108864)}}function eS(t){if(t.tag===13||t.tag===31){var e=sn();e=ug(e);var n=To(t,e);n!==null&&Vt(n,t,e),Jg(t,e)}}var ld=!0;function KO(t,e,n,i){var r=Q.T;Q.T=null;var o=ye.p;try{ye.p=2,em(t,e,n,i)}finally{ye.p=o,Q.T=r}}function QO(t,e,n,i){var r=Q.T;Q.T=null;var o=ye.p;try{ye.p=8,em(t,e,n,i)}finally{ye.p=o,Q.T=r}}function em(t,e,n,i){if(ld){var r=og(i);if(r===null)ch(t,e,i,cd,n),tS(t,i);else if(eM(r,t,e,n,i))i.stopPropagation();else if(tS(t,i),e&4&&-1<JO.indexOf(t)){for(;r!==null;){var o=Ga(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var a=uo(o.pendingLanes);if(a!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-an(a);s.entanglements[1]|=l,a&=~l}oi(o),(ve&6)===0&&(Qu=rn()+500,Bl(0,!1))}}break;case 31:case 13:s=To(o,2),s!==null&&Vt(s,o,2),xd(),Jg(o,2)}if(o=og(i),o===null&&ch(t,e,i,cd,n),o===r)break;r=o}r!==null&&i.stopPropagation()}else ch(t,e,i,null,n)}}function og(t){return t=hg(t),tm(t)}var cd=null;function tm(t){if(cd=null,t=ya(t),t!==null){var e=Rl(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=sS(e),t!==null)return t;t=null}else if(n===31){if(t=lS(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return cd=t,null}function Vw(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($R()){case fS:return 2;case pS:return 8;case Bu:case UR:return 32;case hS:return 268435456;default:return 32}default:return 32}}var ag=!1,Ar=null,Tr=null,kr=null,Tl=new Map,kl=new Map,hr=[],JO="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 tS(t,e){switch(t){case"focusin":case"focusout":Ar=null;break;case"dragenter":case"dragleave":Tr=null;break;case"mouseover":case"mouseout":kr=null;break;case"pointerover":case"pointerout":Tl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":kl.delete(e.pointerId)}}function Ws(t,e,n,i,r,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:o,targetContainers:[r]},e!==null&&(e=Ga(e),e!==null&&Uw(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function eM(t,e,n,i,r){switch(e){case"focusin":return Ar=Ws(Ar,t,e,n,i,r),!0;case"dragenter":return Tr=Ws(Tr,t,e,n,i,r),!0;case"mouseover":return kr=Ws(kr,t,e,n,i,r),!0;case"pointerover":var o=r.pointerId;return Tl.set(o,Ws(Tl.get(o)||null,t,e,n,i,r)),!0;case"gotpointercapture":return o=r.pointerId,kl.set(o,Ws(kl.get(o)||null,t,e,n,i,r)),!0}return!1}function jw(t){var e=ya(t.target);if(e!==null){var n=Rl(e);if(n!==null){if(e=n.tag,e===13){if(e=sS(n),e!==null){t.blockedOn=e,B0(t.priority,function(){eS(n)});return}}else if(e===31){if(e=lS(n),e!==null){t.blockedOn=e,B0(t.priority,function(){eS(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Lu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=og(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);Eh=i,n.target.dispatchEvent(i),Eh=null}else return e=Ga(n),e!==null&&Uw(e),t.blockedOn=n,!1;e.shift()}return!0}function nS(t,e,n){Lu(t)&&n.delete(e)}function tM(){ag=!1,Ar!==null&&Lu(Ar)&&(Ar=null),Tr!==null&&Lu(Tr)&&(Tr=null),kr!==null&&Lu(kr)&&(kr=null),Tl.forEach(nS),kl.forEach(nS)}function yu(t,e){t.blockedOn===e&&(t.blockedOn=null,ag||(ag=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,tM)))}var bu=null;function iS(t){bu!==t&&(bu=t,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,function(){bu===t&&(bu=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(tm(i||n)===null)continue;break}var o=Ga(n);o!==null&&(t.splice(e,3),e-=3,$h(o,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function qa(t){function e(l){return yu(l,t)}Ar!==null&&yu(Ar,t),Tr!==null&&yu(Tr,t),kr!==null&&yu(kr,t),Tl.forEach(e),kl.forEach(e);for(var n=0;n<hr.length;n++){var i=hr[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<hr.length&&(n=hr[0],n.blockedOn===null);)jw(n),n.blockedOn===null&&hr.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],o=n[i+1],a=r[jt]||null;if(typeof o=="function")a||iS(n);else if(a){var s=null;if(o&&o.hasAttribute("formAction")){if(r=o,a=o[jt]||null)s=a.formAction;else if(tm(r)!==null)continue}else s=a.action;typeof s=="function"?n[i+1]=s:(n.splice(i,3),i-=3),iS(n)}}}function Pw(){function t(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(a){return r=a})},focusReset:"manual",scroll:"manual"})}function e(){r!==null&&(r(),r=null),i||setTimeout(n,20)}function n(){if(!i&&!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 i=!1,r=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null)}}}function nm(t){this._internalRoot=t}Cd.prototype.render=nm.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(M(409));var n=e.current,i=sn();$w(n,i,t,e,null,null)};Cd.prototype.unmount=nm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;$w(t.current,2,null,t,null,null),xd(),e[Za]=null}};function Cd(t){this._internalRoot=t}Cd.prototype.unstable_scheduleHydration=function(t){if(t){var e=bS();t={blockedOn:null,target:t,priority:e};for(var n=0;n<hr.length&&e!==0&&e<hr[n].priority;n++);hr.splice(n,0,t),n===0&&jw(t)}};var rS=oS.version;if(rS!=="19.2.4")throw Error(M(527,rS,"19.2.4"));ye.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(M(188)):(t=Object.keys(t).join(","),Error(M(268,t)));return t=DR(e),t=t!==null?cS(t):null,t=t===null?null:t.stateNode,t};var nM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Xs=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Xs.isDisabled&&Xs.supportsFiber))try{Ol=Xs.inject(nM),on=Xs}catch{}var Xs;Ad.createRoot=function(t,e){if(!aS(t))throw Error(M(299));var n=!1,i="",r=Ix,o=Hx,a=zx;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(o=e.onCaughtError),e.onRecoverableError!==void 0&&(a=e.onRecoverableError)),e=Bw(t,1,!1,null,null,n,i,null,r,o,a,Pw),t[Za]=e.current,Xg(t),new nm(e)};Ad.hydrateRoot=function(t,e,n){if(!aS(t))throw Error(M(299));var i=!1,r="",o=Ix,a=Hx,s=zx,l=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),e=Bw(t,1,!0,e,n??null,i,r,l,o,a,s,Pw),e.context=Fw(null),n=e.current,i=sn(),i=ug(i),r=xr(i),r.callback=null,wr(n,r,i),n=i,e.current.lanes=n,Nl(e,n),oi(e),t[Za]=e.current,Xg(t),new Cd(e)};Ad.version="19.2.4"});var Ro=Kn((RI,Gw)=>{"use strict";function Zw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Zw)}catch(t){console.error(t)}}Zw(),Gw.exports=qw()});var j1=Kn(Pd=>{"use strict";var WM=Symbol.for("react.transitional.element"),XM=Symbol.for("react.fragment");function V1(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:WM,type:t,key:i,ref:e!==void 0?e:null,props:n}}Pd.Fragment=XM;Pd.jsx=V1;Pd.jsxs=V1});var $e=Kn((GH,P1)=>{"use strict";P1.exports=j1()});var Jk=X(Qe(),1),gp=X($s(),1),_I=X(Ro(),1);function Yw(t,e,n,i){let r=i?.maxRetries??3,o=i?.debounceMs??50,a=t.parentElement??e.parentElement;if(!a)return()=>{};let s=0,l=null,c=!1,u=new MutationObserver(d=>{if(!c){for(let h of d)for(let m of h.removedNodes)if(m===t){if(s>=r){u.disconnect(),c=!0;return}l&&clearTimeout(l),l=setTimeout(()=>{if(!c){s++;try{n()}catch{u.disconnect(),c=!0}}},o);return}}});return u.observe(a,{childList:!0,subtree:!0}),()=>{c=!0,u.disconnect(),l&&clearTimeout(l)}}var iM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function im(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let a=r.currentNode,s=a.tagName.toLowerCase();if(!iM.has(s)){o.push(a);continue}for(let l of Array.from(a.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),d=c.startsWith("on"),m=(c==="href"||c==="src"||c==="formaction")&&(u.startsWith("javascript:")||u.startsWith("vbscript:")||u.startsWith("data:text/html"));(d||m)&&a.removeAttribute(l.name)}}for(let a of o){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML}var Ww=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=im(t.html),r=document.createElement("div");r.setAttribute("data-syntro-action-id",e.generateId()),r.innerHTML=i;let o=null;switch(t.position){case"before":n.insertAdjacentElement("beforebegin",r);break;case"after":n.insertAdjacentElement("afterend",r);break;case"prepend":n.insertBefore(r,n.firstChild);break;case"append":n.appendChild(r);break;case"replace":o=n.innerHTML,n.replaceWith(r);break}let a=null;if(t.deepLink){let{tileId:c,itemId:u}=t.deepLink;a=()=>{let d=window.SynOS?.handle;d&&(d.open(),d.runtime?.events?.publish("notification.deep_link",{tileId:c,itemId:u}))},r.style.cursor="pointer",r.addEventListener("click",a)}e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position});let l=Yw(r,n,()=>{switch(t.position){case"before":n.insertAdjacentElement("beforebegin",r);break;case"after":n.insertAdjacentElement("afterend",r);break;case"prepend":n.insertBefore(r,n.firstChild);break;case"append":n.appendChild(r);break;case"replace":break}});return{cleanup:()=>{if(a&&r.removeEventListener("click",a),l(),t.position==="replace"&&o!==null){let c=document.createElement(n.tagName);c.innerHTML=o,Array.from(n.attributes).forEach(u=>{c.setAttribute(u.name,u.value)}),r.replaceWith(c)}else r.remove()},updateFn:c=>{"html"in c&&typeof c.html=="string"&&(r.innerHTML=im(c.html))}}},Xw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.textContent??"";return n.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{n.textContent=i},updateFn:r=>{"text"in r&&typeof r.text=="string"&&(n.textContent=r.text)}}},Kw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=t.attr.toLowerCase();if(i.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);if(i==="href"||i==="src"||i==="formaction"){let s=t.value.trim().toLowerCase();if(s.startsWith("javascript:")||s.startsWith("vbscript:")||s.startsWith("data:text/html"))throw new Error(`Dangerous URL not allowed in ${t.attr}: ${t.value}`)}let o=n.getAttribute(t.attr),a=n.hasAttribute(t.attr);return n.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{a&&o!==null?n.setAttribute(t.attr,o):n.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&n.setAttribute(t.attr,s.value)}}},Qw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.classList.contains(t.className);return n.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i||n.classList.remove(t.className)}}},Jw=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=n.classList.contains(t.className);return n.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i&&n.classList.add(t.className)}}},e1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=new Map;for(let r of Object.keys(t.styles)){let o=n.style.getPropertyValue(r);i.set(r,o)}for(let[r,o]of Object.entries(t.styles))n.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 i)o?n.style.setProperty(r,o):n.style.removeProperty(r)},updateFn:r=>{if("styles"in r&&typeof r.styles=="object"&&r.styles)for(let[o,a]of Object.entries(r.styles))n.style.setProperty(o,a)}}},rm=[{kind:"content:insertHtml",executor:Ww},{kind:"content:setText",executor:Xw},{kind:"content:setAttr",executor:Kw},{kind:"content:addClass",executor:Qw},{kind:"content:removeClass",executor:Jw},{kind:"content:setStyle",executor:e1}],om={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:rm};var rM={light:50,medium:100,heavy:200},oM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],t1={init(t,e,n){let i=rM[n.intensity],r=n.colors.length>0?n.colors:oM,o=[];for(let a=0;a<i;a++)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,n){let i=!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&&(i=!0);return i},render(t,e){for(let n of e)n.opacity<.01||(t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.translate(n.x,n.y),t.rotate(n.rotation),n.shape==="circle"?(t.beginPath(),t.arc(0,0,n.size/2,0,Math.PI*2),t.fill()):t.fillRect(-n.size/2,-n.size/2,n.size,n.size*.6),t.restore())}};var aM={light:20,medium:40,heavy:80},sM="\u{1F389}",n1={init(t,e,n){let i=aM[n.intensity],r=typeof n.props?.emoji=="string"?n.props.emoji:sM,o=[];for(let a=0;a<i;a++)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 a of o)a.data&&(a.data.originX=a.x);return o},update(t,e,n){let i=!1;for(let r of t){r.y+=r.vy;let o=r.data?.wobblePhase??0,a=r.data?.wobbleAmp??1,s=r.data?.originX??r.x;r.x=s+Math.sin(n*.003+o)*a*20,r.y>600&&(r.opacity-=.02,r.opacity<0&&(r.opacity=0)),r.opacity>.01&&(i=!0)}return i},render(t,e){for(let n of e)n.opacity<.01||!n.emoji||(t.save(),t.globalAlpha=n.opacity,t.font=`${n.size}px serif`,t.textAlign="center",t.textBaseline="middle",t.fillText(n.emoji,n.x,n.y),t.restore())}};var lM={light:20,medium:40,heavy:80},cM={light:3,medium:4,heavy:5},i1={init(t,e,n){let i=lM[n.intensity],r=cM[n.intensity],o=n.colors.length>0?n.colors:["#ff4444","#44ff44","#4444ff"],a=[];for(let s=0;s<r;s++){let l=Math.random()*t*.8+t*.1,c=Math.random()*e*.6,u=o[Math.floor(Math.random()*o.length)];for(let d=0;d<i;d++){let h=Math.PI*2*d/i+(Math.random()-.5)*.3,m=Math.random()*3+2;a.push({x:l,y:c,vx:Math.cos(h)*m,vy:Math.sin(h)*m,rotation:0,rotationSpeed:0,size:Math.random()*3+2,color:u,opacity:1,shape:"circle",data:{centerX:l,centerY:c}})}}return a},update(t,e,n){let i=!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&&(i=!0);return i},render(t,e){for(let n of e)n.opacity<.01||(t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.shadowBlur=12,t.shadowColor=n.color,t.beginPath(),t.arc(n.x,n.y,n.size,0,Math.PI*2),t.fill(),t.restore())}};var uM={light:30,medium:60,heavy:120},r1={init(t,e,n){let i=uM[n.intensity],r=n.colors.length>0?n.colors:["#ffd700","#ffffff","#fffacd"],o=[];for(let a=0;a<i;a++)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,n){let i=!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,a=r.data?.baseOpacity??1;if(a<=.01)r.opacity=0;else{let s=Math.sin(n*.005+o)*.4+.6;r.opacity=a*s}r.opacity>.01&&(i=!0)}return i},render(t,e){for(let n of e){if(n.opacity<.01)continue;t.save(),t.globalAlpha=n.opacity,t.fillStyle=n.color,t.translate(n.x,n.y),t.rotate(n.rotation);let i=n.size;t.beginPath(),t.moveTo(0,-i),t.lineTo(i*.3,-i*.3),t.lineTo(i,0),t.lineTo(i*.3,i*.3),t.lineTo(0,i),t.lineTo(-i*.3,i*.3),t.lineTo(-i,0),t.lineTo(-i*.3,-i*.3),t.closePath(),t.fill(),t.restore()}}};var Td=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,n,i){this.container=e,this.effect=n,this.duration=i.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,a=window.innerWidth,s=window.innerHeight;r.width=a*o,r.height=s*o,r.style.width=`${a}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=n.init(a,s,i),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 n=e-this.startTime,i=e-this.lastFrame;if(this.lastFrame=e,n>=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,i,n)){this.stop();return}this.effect.render(this.ctx,this.particles),this.rafId=requestAnimationFrame(this.tick)}};var dM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],o1=new Map([["confetti",t1],["fireworks",i1],["sparkles",r1],["emoji-rain",n1]]),a1=async(t,e)=>{let n=o1.get(t.effect);if(!n)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...o1.keys()].join(", ")}`),{cleanup:()=>{}};let i={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:t.colors??dM,props:t.props},r=new Td;return r.start(e.overlayRoot,n,i),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{r.stop()}}};var sm="syntro_active_tour",kd=new Map;function fM(t){try{let e=localStorage.getItem(sm);if(!e)return null;let n=JSON.parse(e);return n.tourId!==t?null:n}catch{return null}}function am(t){try{localStorage.setItem(sm,JSON.stringify(t))}catch{}}function pM(){try{localStorage.removeItem(sm)}catch{}}function Ul(){return window.location.pathname}function hM(t){if(!t.route)return!0;let e=Ul();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var lm=async(t,e)=>{let{tourId:n,steps:i,startStep:r,autoStart:o=!0}=t;if(i.length===0)throw new Error(`Tour "${n}" has no steps`);if(kd.has(n))return{cleanup:async()=>{let v=kd.get(n);v&&await v.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let a=fM(n),s=!!a;if(!s&&!o)return{cleanup:()=>{}};a||(a={tourId:n,currentStepId:r||i[0].id,startedAt:Date.now()},am(a));let l=i.findIndex(v=>v.id===a.currentStepId);if(l===-1){let v=r||i[0].id;l=i.findIndex(y=>y.id===v),l===-1&&(l=0),a.currentStepId=i[l].id,am(a)}let c=i[l];if(!hM(c))return e.publishEvent("tour.waiting_for_route",{tourId:n,stepId:c.id,expectedRoute:c.route,currentRoute:Ul()}),{cleanup:()=>{}};let u=!1,d=null,h=null,m=null,S=async()=>{h&&(h(),h=null),d?.isApplied()&&(await d.revert(),d=null)},_=async v=>{if(u)return;if(await S(),v==="end"){pM(),e.publishEvent("tour.completed",{tourId:n,totalSteps:i.length}),u=!0;return}let y=i.find(w=>w.id===v);if(!y){console.error(`[Tour] Step "${v}" not found`);return}if(a.currentStepId=v,am(a),e.publishEvent("tour.step_changed",{tourId:n,previousStepId:c.id,nextStepId:v}),y.route&&y.route!==Ul()){e.publishEvent("tour.awaiting_navigation",{tourId:n,stepId:v,targetRoute:y.route});return}await b(y)},b=async v=>{if(!u){e.publishEvent("tour.step_started",{tourId:n,stepId:v.id,stepIndex:i.findIndex(y=>y.id===v.id),totalSteps:i.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:n,stepId:v.id,error:String(y)});return}if(v.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",A=>{let x=A?.actionId;if(x&&v.onAction){let T=v.onAction[x];T&&_(T)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",A=>{let x=A?.actionId;if(x&&v.onAction){let T=v.onAction[x];T&&_(T)}}),w=h;h=()=>{w(),y()}}}};m=(()=>{let v=Ul(),y=()=>{let x=Ul();x!==v&&(v=x,e.publishEvent("tour.route_changed",{tourId:n,newRoute:x}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>y());window.addEventListener("popstate",y);let w=history.pushState.bind(history),A=history.replaceState.bind(history);return history.pushState=(...x)=>{w(...x),queueMicrotask(y)},history.replaceState=(...x)=>{A(...x),queueMicrotask(y)},()=>{window.removeEventListener("popstate",y),history.pushState=w,history.replaceState=A}})(),s?e.publishEvent("tour.resumed",{tourId:n,stepId:a.currentStepId}):e.publishEvent("tour.started",{tourId:n,totalSteps:i.length,startStepId:a.currentStepId}),await b(c);let p=async()=>{u=!0,kd.delete(n),await S(),m&&m(),e.publishEvent("tour.paused",{tourId:n,stepId:a.currentStepId})};return kd.set(n,{cleanup:p}),{cleanup:p}};var _t={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"},C={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"},St={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},Fe={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},un={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},Vl={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},at={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},jl={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var Ii={primary:C[10],secondary:C[9],tertiary:C[8]},GI={primary:C[2],secondary:C[0]},cm={primary:C[4],secondary:C[3]},Rd={primary:{text:_t.white,icon:_t.white,border:ne[3],backgroundDefault:ne[3],backgroundHover:ne[2]},neutral:{text:C[10],textHover:_t.white,icon:C[10],iconHover:_t.white,border:C[4],background:C[2]},link:{text:_t.white,icon:_t.white,hover:ne[5]},error:{text:Fe[5],hover:Fe[6]},success:{text:Te[5],hover:Te[6]}},YI={slateGrey:{content:C[10],pillOutline:C[10],borderPrimary:C[5],borderSecondary:C[5],background:C[3]},brand:{content:ne[9],pillOutline:ne[9],borderPrimary:ne[6],borderSecondary:ne[6],background:ne[0]},red:{content:Fe[8],pillOutline:Fe[4],borderPrimary:Fe[2],borderSecondary:Fe[2],background:Fe[0]},yellow:{content:St[8],pillOutline:St[4],borderPrimary:St[2],borderSecondary:St[2],background:St[0]},green:{content:Te[8],pillOutline:Te[4],borderPrimary:Te[2],borderSecondary:Te[2],background:Te[0]},purple:{content:at[8],pillOutline:at[4],borderPrimary:at[2],borderSecondary:at[2],background:at[0]},blue:{content:un[8],pillOutline:un[4],borderPrimary:un[2],borderSecondary:un[2],background:un[0]},orange:{content:Vl[8],pillOutline:Vl[4],borderPrimary:Vl[2],borderSecondary:Vl[2],background:Vl[0]},pink:{content:jl[8],pillOutline:jl[4],borderPrimary:jl[2],borderSecondary:jl[2],background:jl[0]}},WI={green:{content:Te[8],border:Te[2],background:Te[0]},yellow:{content:St[8],border:St[2],background:St[0]},red:{content:Fe[8],border:Fe[2],background:Fe[0]}},XI={green:{content:Te[1],background:Te[9]},yellow:{content:St[1],background:St[9]},red:{content:Fe[1],background:Fe[9]}},KI={content:C[10],border:C[4],background:"#1c2124"},QI={backgroundDefault:C[2],backgroundHover:C[1],selected:C[3]},JI={background:C[2],icon:C[10],borderDefault:C[4],borderSelected:ne[3],textLabel:C[9],textPlaceholder:C[8],textHint:C[8]},eH={backgroundDefault:C[2],backgroundDisabled:C[0],textLabel:C[9],textPlaceholder:C[8],textHint:C[8],textError:Fe[5],iconDefault:C[9],iconPlaceholder:C[10],iconError:Fe[5],borderDefault:C[4],borderSelected:ne[3],borderError:Fe[5]},tH={handleDefault:_t.white,handleDisabled:C[10],off:{backgroundDefault:C[4],backgroundHover:C[5],backgroundDisabled:C[4]},on:{backgroundDefault:Te[3],backgroundHover:Te[2],backgroundDisabled:C[4]}},nH={off:{backgroundDefault:"#00000000",backgroundHover:C[5],backgroundDisabled:C[2],border:C[6]},on:{backgroundDefault:Te[0],backgroundHover:Te[1],backgroundDisabled:C[2],border:Te[3]}},iH={content:C[10],background:C[4]},rH={background:C[4],active:Te[3]},oH={background:C[1],content:C[9],border:C[4]},aH={backgroundDefault:C[1],backgroundHover:C[3],backgroundActive:C[4],border:C[4],contentPrimary:C[10],contentSecondary:C[9],contentTertiary:C[8]},sH={background:C[1],content:C[9],border:C[4]},lH={activeBackground:C[3],activeContent:ne[5],inactiveContent:C[9],border:C[4]},cH={header:{textDefault:C[9],textHover:C[8],backgroundDefault:C[1]},border:C[4],cell:{textPrimary:C[10],textSecondary:C[9],backgroundDefault:C[2],backgroundHover:C[1]}},uH={textPrimaryDefault:C[10],textPrimaryHover:C[10],textSecondaryDefault:C[8],textSecondaryHover:C[9],iconPrimary:C[10],iconSecondary:C[8]},dH={background:Te[1],active:Te[5]},fH={textDefault:C[10],textSelected:_t.white,textDisabled:C[7],backgroundDefault:C[2],backgroundMiddle:C[3],backgroundSelected:ne[3],border:C[4]},pH=C[9];var s1=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function l1(t,e,n){let i=n?.paddingPx??12,r=n?.radiusPx??12,o=Math.min(Math.max(n?.scrimOpacity??.55,0),1),a=n?.ringColor??`var(--syntro-ring, ${un[5]})`,s=n?.blocking??!1,l=n?.onClickOutside??!0,c=n?.onEsc??!0,u=getComputedStyle(document.documentElement),d=u.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=u.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 _=document.createElement("div");_.className="syntro-spotlight-ring",Object.assign(_.style,{position:"fixed",pointerEvents:"none",borderRadius:`${r}px`,border:`2px solid ${a||h||un[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(_);let b=[];if(!s1)for(let k=0;k<4;k++){let E=document.createElement("div");E.style.position="fixed",E.style.background="inherit",b.push(E),m.appendChild(E)}let f=k=>{m.style.clipPath=k,m.style.webkitClipPath=k},p=()=>{if(!t.isConnected){T.destroy();return}let k=t.getBoundingClientRect(),E=Math.max(0,k.left-i),R=Math.max(0,k.top-i),D=Math.min(window.innerWidth,k.width+i*2),N=Math.min(window.innerHeight,k.height+i*2);if(Object.assign(_.style,{left:`${E}px`,top:`${R}px`,width:`${D}px`,height:`${N}px`}),s1){let H=window.innerWidth,B=window.innerHeight,z=Math.min(r,D/2,N/2),te=`M 0 0 L ${H} 0 L ${H} ${B} L 0 ${B} Z`,I=`M ${E+z} ${R} A ${z} ${z} 0 0 0 ${E} ${R+z} L ${E} ${R+N-z} A ${z} ${z} 0 0 0 ${E+z} ${R+N} L ${E+D-z} ${R+N} A ${z} ${z} 0 0 0 ${E+D} ${R+N-z} L ${E+D} ${R+z} A ${z} ${z} 0 0 0 ${E+D-z} ${R} L ${E+z} ${R} Z`;f(`path('${te} ${I}')`)}else{let[H,B,z,te]=b;Object.assign(H.style,{left:"0px",top:"0px",width:"100vw",height:`${R}px`}),Object.assign(z.style,{left:"0px",top:`${R+N}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(R+N))}px`}),Object.assign(te.style,{left:"0px",top:`${R}px`,width:`${E}px`,height:`${N}px`}),Object.assign(B.style,{left:`${E+D}px`,top:`${R}px`,width:`${Math.max(0,window.innerWidth-(E+D))}px`,height:`${N}px`})}},v=new ResizeObserver(()=>requestAnimationFrame(p));v.observe(t);let y=()=>requestAnimationFrame(p),w=()=>requestAnimationFrame(p);window.addEventListener("scroll",y,!0),window.addEventListener("resize",w);let A=k=>{k.key==="Escape"&&c&&T.destroy()};c&&window.addEventListener("keydown",A);let x=k=>{s?(k.preventDefault(),k.stopPropagation()):l&&T.destroy()};m.addEventListener("click",x);let T={destroy(){v.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",w),c&&window.removeEventListener("keydown",A),m.removeEventListener("click",x),m.style.pointerEvents="none",m.style.opacity="0",setTimeout(()=>{m.remove(),_.remove()},220)}};return p(),T}var gM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function dn(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let a=r.currentNode,s=a.tagName.toLowerCase();if(!gM.has(s)){o.push(a);continue}for(let l of Array.from(a.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),d=c.startsWith("on"),h=(c==="href"||c==="src")&&u.startsWith("javascript:");(d||h)&&a.removeAttribute(l.name)}}for(let a of o){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML}var um=async(t,e)=>{let{content:n,size:i="md",blocking:r=!1,scrim:o,dismiss:a,ctaButtons:s}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
|
|
1
|
+
var AE=Object.create;var ic=Object.defineProperty;var kE=Object.getOwnPropertyDescriptor;var EE=Object.getOwnPropertyNames;var TE=Object.getPrototypeOf,RE=Object.prototype.hasOwnProperty;var bb=t=>{throw TypeError(t)};var ME=(t,e,a)=>e in t?ic(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var tr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),DE=(t,e)=>{for(var a in e)ic(t,a,{get:e[a],enumerable:!0})},OE=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of EE(e))!RE.call(t,n)&&n!==a&&ic(t,n,{get:()=>e[n],enumerable:!(r=kE(e,n))||r.enumerable});return t};var Y=(t,e,a)=>(a=t!=null?AE(TE(t)):{},OE(e||!t||!t.__esModule?ic(a,"default",{value:t,enumerable:!0}):a,t));var $=(t,e,a)=>ME(t,typeof e!="symbol"?e+"":e,a),Sb=(t,e,a)=>e.has(t)||bb("Cannot "+a);var me=(t,e,a)=>(Sb(t,e,"read from private field"),a?a.call(t):e.get(t)),un=(t,e,a)=>e.has(t)?bb("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),ar=(t,e,a,r)=>(Sb(t,e,"write to private field"),r?r.call(t,a):e.set(t,a),a);var Mb=tr(ne=>{"use strict";var Op=Symbol.for("react.transitional.element"),BE=Symbol.for("react.portal"),FE=Symbol.for("react.fragment"),NE=Symbol.for("react.strict_mode"),PE=Symbol.for("react.profiler"),HE=Symbol.for("react.consumer"),UE=Symbol.for("react.context"),qE=Symbol.for("react.forward_ref"),zE=Symbol.for("react.suspense"),VE=Symbol.for("react.memo"),Ib=Symbol.for("react.lazy"),$E=Symbol.for("react.activity"),Cb=Symbol.iterator;function jE(t){return t===null||typeof t!="object"?null:(t=Cb&&t[Cb]||t["@@iterator"],typeof t=="function"?t:null)}var Ab={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},kb=Object.assign,Eb={};function fi(t,e,a){this.props=t,this.context=e,this.refs=Eb,this.updater=a||Ab}fi.prototype.isReactComponent={};fi.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")};fi.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Tb(){}Tb.prototype=fi.prototype;function Bp(t,e,a){this.props=t,this.context=e,this.refs=Eb,this.updater=a||Ab}var Fp=Bp.prototype=new Tb;Fp.constructor=Bp;kb(Fp,fi.prototype);Fp.isPureReactComponent=!0;var _b=Array.isArray;function Dp(){}var Oe={H:null,A:null,T:null,S:null},Rb=Object.prototype.hasOwnProperty;function Np(t,e,a){var r=a.ref;return{$$typeof:Op,type:t,key:e,ref:r!==void 0?r:null,props:a}}function GE(t,e){return Np(t.type,e,t.props)}function Pp(t){return typeof t=="object"&&t!==null&&t.$$typeof===Op}function WE(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(a){return e[a]})}var wb=/\/+/g;function Mp(t,e){return typeof t=="object"&&t!==null&&t.key!=null?WE(""+t.key):e.toString(36)}function ZE(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Dp,Dp):(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 di(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 Op:case BE:i=!0;break;case Ib:return i=t._init,di(i(t._payload),e,a,r,n)}}if(i)return n=n(t),i=r===""?"."+Mp(t,0):r,_b(n)?(a="",i!=null&&(a=i.replace(wb,"$&/")+"/"),di(n,e,a,"",function(u){return u})):n!=null&&(Pp(n)&&(n=GE(n,a+(n.key==null||t&&t.key===n.key?"":(""+n.key).replace(wb,"$&/")+"/")+i)),e.push(n)),1;i=0;var s=r===""?".":r+":";if(_b(t))for(var l=0;l<t.length;l++)r=t[l],o=s+Mp(r,l),i+=di(r,e,a,o,n);else if(l=jE(t),typeof l=="function")for(t=l.call(t),l=0;!(r=t.next()).done;)r=r.value,o=s+Mp(r,l++),i+=di(r,e,a,o,n);else if(o==="object"){if(typeof t.then=="function")return di(ZE(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 sc(t,e,a){if(t==null)return t;var r=[],n=0;return di(t,r,"","",function(o){return e.call(a,o,n++)}),r}function XE(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 Lb=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)},YE={map:sc,forEach:function(t,e,a){sc(t,function(){e.apply(this,arguments)},a)},count:function(t){var e=0;return sc(t,function(){e++}),e},toArray:function(t){return sc(t,function(e){return e})||[]},only:function(t){if(!Pp(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ne.Activity=$E;ne.Children=YE;ne.Component=fi;ne.Fragment=FE;ne.Profiler=PE;ne.PureComponent=Bp;ne.StrictMode=NE;ne.Suspense=zE;ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Oe;ne.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Oe.H.useMemoCache(t)}};ne.cache=function(t){return function(){return t.apply(null,arguments)}};ne.cacheSignal=function(){return null};ne.cloneElement=function(t,e,a){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var r=kb({},t.props),n=t.key;if(e!=null)for(o in e.key!==void 0&&(n=""+e.key),e)!Rb.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 Np(t.type,n,r)};ne.createContext=function(t){return t={$$typeof:UE,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:HE,_context:t},t};ne.createElement=function(t,e,a){var r,n={},o=null;if(e!=null)for(r in e.key!==void 0&&(o=""+e.key),e)Rb.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 Np(t,o,n)};ne.createRef=function(){return{current:null}};ne.forwardRef=function(t){return{$$typeof:qE,render:t}};ne.isValidElement=Pp;ne.lazy=function(t){return{$$typeof:Ib,_payload:{_status:-1,_result:t},_init:XE}};ne.memo=function(t,e){return{$$typeof:VE,type:t,compare:e===void 0?null:e}};ne.startTransition=function(t){var e=Oe.T,a={};Oe.T=a;try{var r=t(),n=Oe.S;n!==null&&n(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Dp,Lb)}catch(o){Lb(o)}finally{e!==null&&a.types!==null&&(e.types=a.types),Oe.T=e}};ne.unstable_useCacheRefresh=function(){return Oe.H.useCacheRefresh()};ne.use=function(t){return Oe.H.use(t)};ne.useActionState=function(t,e,a){return Oe.H.useActionState(t,e,a)};ne.useCallback=function(t,e){return Oe.H.useCallback(t,e)};ne.useContext=function(t){return Oe.H.useContext(t)};ne.useDebugValue=function(){};ne.useDeferredValue=function(t,e){return Oe.H.useDeferredValue(t,e)};ne.useEffect=function(t,e){return Oe.H.useEffect(t,e)};ne.useEffectEvent=function(t){return Oe.H.useEffectEvent(t)};ne.useId=function(){return Oe.H.useId()};ne.useImperativeHandle=function(t,e,a){return Oe.H.useImperativeHandle(t,e,a)};ne.useInsertionEffect=function(t,e){return Oe.H.useInsertionEffect(t,e)};ne.useLayoutEffect=function(t,e){return Oe.H.useLayoutEffect(t,e)};ne.useMemo=function(t,e){return Oe.H.useMemo(t,e)};ne.useOptimistic=function(t,e){return Oe.H.useOptimistic(t,e)};ne.useReducer=function(t,e,a){return Oe.H.useReducer(t,e,a)};ne.useRef=function(t){return Oe.H.useRef(t)};ne.useState=function(t){return Oe.H.useState(t)};ne.useSyncExternalStore=function(t,e,a){return Oe.H.useSyncExternalStore(t,e,a)};ne.useTransition=function(){return Oe.H.useTransition()};ne.version="19.2.4"});var Ge=tr((aH,Db)=>{"use strict";Db.exports=Mb()});var Bb=tr(Ot=>{"use strict";var KE=Ge();function Ob(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 cn(){}var Dt={d:{f:cn,r:function(){throw Error(Ob(522))},D:cn,C:cn,L:cn,m:cn,X:cn,S:cn,M:cn},p:0,findDOMNode:null},QE=Symbol.for("react.portal");function JE(t,e,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:QE,key:r==null?null:""+r,children:t,containerInfo:e,implementation:a}}var zs=KE.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function lc(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Dt;Ot.createPortal=function(t,e){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Ob(299));return JE(t,e,null,a)};Ot.flushSync=function(t){var e=zs.T,a=Dt.p;try{if(zs.T=null,Dt.p=2,t)return t()}finally{zs.T=e,Dt.p=a,Dt.d.f()}};Ot.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Dt.d.C(t,e))};Ot.prefetchDNS=function(t){typeof t=="string"&&Dt.d.D(t)};Ot.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var a=e.as,r=lc(a,e.crossOrigin),n=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?Dt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:r,integrity:n,fetchPriority:o}):a==="script"&&Dt.d.X(t,{crossOrigin:r,integrity:n,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Ot.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=lc(e.as,e.crossOrigin);Dt.d.M(t,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Dt.d.M(t)};Ot.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,r=lc(a,e.crossOrigin);Dt.d.L(t,a,{crossOrigin:r,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Ot.preloadModule=function(t,e){if(typeof t=="string")if(e){var a=lc(e.as,e.crossOrigin);Dt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Dt.d.m(t)};Ot.requestFormReset=function(t){Dt.d.r(t)};Ot.unstable_batchedUpdates=function(t,e){return t(e)};Ot.useFormState=function(t,e,a){return zs.H.useFormState(t,e,a)};Ot.useFormStatus=function(){return zs.H.useHostTransitionStatus()};Ot.version="19.2.4"});var Vs=tr((nH,Nb)=>{"use strict";function Fb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Fb)}catch(t){console.error(t)}}Fb(),Nb.exports=Bb()});var Wb=tr(He=>{"use strict";function zp(t,e){var a=t.length;t.push(e);e:for(;0<a;){var r=a-1>>>1,n=t[r];if(0<uc(n,e))t[r]=e,t[a]=n,a=r;else break e}}function rr(t){return t.length===0?null:t[0]}function dc(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>uc(s,a))l<n&&0>uc(u,s)?(t[r]=u,t[l]=a,r=l):(t[r]=s,t[i]=a,r=i);else if(l<n&&0>uc(u,a))t[r]=u,t[l]=a,r=l;else break e}}return e}function uc(t,e){var a=t.sortIndex-e.sortIndex;return a!==0?a:t.id-e.id}He.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Pb=performance,He.unstable_now=function(){return Pb.now()}):(Hp=Date,Hb=Hp.now(),He.unstable_now=function(){return Hp.now()-Hb});var Pb,Hp,Hb,xr=[],dn=[],eT=1,ya=null,At=3,Vp=!1,$s=!1,js=!1,$p=!1,zb=typeof setTimeout=="function"?setTimeout:null,Vb=typeof clearTimeout=="function"?clearTimeout:null,Ub=typeof setImmediate<"u"?setImmediate:null;function cc(t){for(var e=rr(dn);e!==null;){if(e.callback===null)dc(dn);else if(e.startTime<=t)dc(dn),e.sortIndex=e.expirationTime,zp(xr,e);else break;e=rr(dn)}}function jp(t){if(js=!1,cc(t),!$s)if(rr(xr)!==null)$s=!0,hi||(hi=!0,pi());else{var e=rr(dn);e!==null&&Gp(jp,e.startTime-t)}}var hi=!1,Gs=-1,$b=5,jb=-1;function Gb(){return $p?!0:!(He.unstable_now()-jb<$b)}function Up(){if($p=!1,hi){var t=He.unstable_now();jb=t;var e=!0;try{e:{$s=!1,js&&(js=!1,Vb(Gs),Gs=-1),Vp=!0;var a=At;try{t:{for(cc(t),ya=rr(xr);ya!==null&&!(ya.expirationTime>t&&Gb());){var r=ya.callback;if(typeof r=="function"){ya.callback=null,At=ya.priorityLevel;var n=r(ya.expirationTime<=t);if(t=He.unstable_now(),typeof n=="function"){ya.callback=n,cc(t),e=!0;break t}ya===rr(xr)&&dc(xr),cc(t)}else dc(xr);ya=rr(xr)}if(ya!==null)e=!0;else{var o=rr(dn);o!==null&&Gp(jp,o.startTime-t),e=!1}}break e}finally{ya=null,At=a,Vp=!1}e=void 0}}finally{e?pi():hi=!1}}}var pi;typeof Ub=="function"?pi=function(){Ub(Up)}:typeof MessageChannel<"u"?(qp=new MessageChannel,qb=qp.port2,qp.port1.onmessage=Up,pi=function(){qb.postMessage(null)}):pi=function(){zb(Up,0)};var qp,qb;function Gp(t,e){Gs=zb(function(){t(He.unstable_now())},e)}He.unstable_IdlePriority=5;He.unstable_ImmediatePriority=1;He.unstable_LowPriority=4;He.unstable_NormalPriority=3;He.unstable_Profiling=null;He.unstable_UserBlockingPriority=2;He.unstable_cancelCallback=function(t){t.callback=null};He.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"):$b=0<t?Math.floor(1e3/t):5};He.unstable_getCurrentPriorityLevel=function(){return At};He.unstable_next=function(t){switch(At){case 1:case 2:case 3:var e=3;break;default:e=At}var a=At;At=e;try{return t()}finally{At=a}};He.unstable_requestPaint=function(){$p=!0};He.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var a=At;At=t;try{return e()}finally{At=a}};He.unstable_scheduleCallback=function(t,e,a){var r=He.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:eT++,callback:e,priorityLevel:t,startTime:a,expirationTime:n,sortIndex:-1},a>r?(t.sortIndex=a,zp(dn,t),rr(xr)===null&&t===rr(dn)&&(js?(Vb(Gs),Gs=-1):js=!0,Gp(jp,a-r))):(t.sortIndex=n,zp(xr,t),$s||Vp||($s=!0,hi||(hi=!0,pi()))),t};He.unstable_shouldYield=Gb;He.unstable_wrapCallback=function(t){var e=At;return function(){var a=At;At=e;try{return t.apply(this,arguments)}finally{At=a}}}});var Xb=tr((iH,Zb)=>{"use strict";Zb.exports=Wb()});var sw=tr(Fd=>{"use strict";var ot=Xb(),S0=Ge(),tT=Vs();function M(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function C0(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Ml(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 _0(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 w0(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 Yb(t){if(Ml(t)!==t)throw Error(M(188))}function aT(t){var e=t.alternate;if(!e){if(e=Ml(t),e===null)throw Error(M(188));return e!==t?null:t}for(var a=t,r=e;;){var n=a.return;if(n===null)break;var o=n.alternate;if(o===null){if(r=n.return,r!==null){a=r;continue}break}if(n.child===o.child){for(o=n.child;o;){if(o===a)return Yb(n),t;if(o===r)return Yb(n),e;o=o.sibling}throw Error(M(188))}if(a.return!==r.return)a=n,r=o;else{for(var i=!1,s=n.child;s;){if(s===a){i=!0,a=n,r=o;break}if(s===r){i=!0,r=n,a=o;break}s=s.sibling}if(!i){for(s=o.child;s;){if(s===a){i=!0,a=o,r=n;break}if(s===r){i=!0,r=o,a=n;break}s=s.sibling}if(!i)throw Error(M(189))}}if(a.alternate!==r)throw Error(M(190))}if(a.tag!==3)throw Error(M(188));return a.stateNode.current===a?t:e}function L0(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=L0(t),e!==null)return e;t=t.sibling}return null}var Ne=Object.assign,rT=Symbol.for("react.element"),fc=Symbol.for("react.transitional.element"),el=Symbol.for("react.portal"),bi=Symbol.for("react.fragment"),I0=Symbol.for("react.strict_mode"),Ih=Symbol.for("react.profiler"),A0=Symbol.for("react.consumer"),Ar=Symbol.for("react.context"),Sm=Symbol.for("react.forward_ref"),Ah=Symbol.for("react.suspense"),kh=Symbol.for("react.suspense_list"),Cm=Symbol.for("react.memo"),fn=Symbol.for("react.lazy"),Eh=Symbol.for("react.activity"),nT=Symbol.for("react.memo_cache_sentinel"),Kb=Symbol.iterator;function Ws(t){return t===null||typeof t!="object"?null:(t=Kb&&t[Kb]||t["@@iterator"],typeof t=="function"?t:null)}var oT=Symbol.for("react.client.reference");function Th(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===oT?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case bi:return"Fragment";case Ih:return"Profiler";case I0:return"StrictMode";case Ah:return"Suspense";case kh:return"SuspenseList";case Eh:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case el:return"Portal";case Ar:return t.displayName||"Context";case A0:return(t._context.displayName||"Context")+".Consumer";case Sm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Cm:return e=t.displayName||null,e!==null?e:Th(t.type)||"Memo";case fn:e=t._payload,t=t._init;try{return Th(t(e))}catch{}}return null}var tl=Array.isArray,ee=S0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=tT.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,yo={pending:!1,data:null,method:null,action:null},Rh=[],Si=-1;function lr(t){return{current:t}}function ht(t){0>Si||(t.current=Rh[Si],Rh[Si]=null,Si--)}function Te(t,e){Si++,Rh[Si]=t.current,t.current=e}var sr=lr(null),yl=lr(null),_n=lr(null),jc=lr(null);function Gc(t,e){switch(Te(_n,e),Te(yl,t),Te(sr,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?n0(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=n0(e),t=W_(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ht(sr),Te(sr,t)}function Hi(){ht(sr),ht(yl),ht(_n)}function Mh(t){t.memoizedState!==null&&Te(jc,t);var e=sr.current,a=W_(e,t.type);e!==a&&(Te(yl,t),Te(sr,a))}function Wc(t){yl.current===t&&(ht(sr),ht(yl)),jc.current===t&&(ht(jc),El._currentValue=yo)}var Wp,Qb;function ho(t){if(Wp===void 0)try{throw Error()}catch(a){var e=a.stack.trim().match(/\n( *(at )?)/);Wp=e&&e[1]||"",Qb=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Wp+t+Qb}var Zp=!1;function Xp(t,e){if(!t||Zp)return"";Zp=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(e){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(g){var h=g}Reflect.construct(t,[],d)}else{try{d.call()}catch(g){h=g}t.call(d.prototype)}}else{try{throw Error()}catch(g){h=g}(d=t())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(g){if(g&&h&&typeof g.stack=="string")return[g.stack,h.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=r.DetermineComponentFrameRoot(),i=o[0],s=o[1];if(i&&s){var l=i.split(`
|
|
4
|
+
`),u=s.split(`
|
|
5
|
+
`);for(n=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;n<u.length&&!u[n].includes("DetermineComponentFrameRoot");)n++;if(r===l.length||n===u.length)for(r=l.length-1,n=u.length-1;1<=r&&0<=n&&l[r]!==u[n];)n--;for(;1<=r&&0<=n;r--,n--)if(l[r]!==u[n]){if(r!==1||n!==1)do if(r--,n--,0>n||l[r]!==u[n]){var c=`
|
|
6
|
+
`+l[r].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=r&&0<=n);break}}}finally{Zp=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?ho(a):""}function iT(t,e){switch(t.tag){case 26:case 27:case 5:return ho(t.type);case 16:return ho("Lazy");case 13:return t.child!==e&&e!==null?ho("Suspense Fallback"):ho("Suspense");case 19:return ho("SuspenseList");case 0:case 15:return Xp(t.type,!1);case 11:return Xp(t.type.render,!1);case 1:return Xp(t.type,!0);case 31:return ho("Activity");default:return""}}function Jb(t){try{var e="",a=null;do e+=iT(t,a),a=t,t=t.return;while(t);return e}catch(r){return`
|
|
7
|
+
Error generating stack: `+r.message+`
|
|
8
|
+
`+r.stack}}var Dh=Object.prototype.hasOwnProperty,_m=ot.unstable_scheduleCallback,Yp=ot.unstable_cancelCallback,sT=ot.unstable_shouldYield,lT=ot.unstable_requestPaint,ia=ot.unstable_now,uT=ot.unstable_getCurrentPriorityLevel,k0=ot.unstable_ImmediatePriority,E0=ot.unstable_UserBlockingPriority,Zc=ot.unstable_NormalPriority,cT=ot.unstable_LowPriority,T0=ot.unstable_IdlePriority,dT=ot.log,fT=ot.unstable_setDisableYieldValue,Dl=null,sa=null;function yn(t){if(typeof dT=="function"&&fT(t),sa&&typeof sa.setStrictMode=="function")try{sa.setStrictMode(Dl,t)}catch{}}var la=Math.clz32?Math.clz32:mT,pT=Math.log,hT=Math.LN2;function mT(t){return t>>>=0,t===0?32:31-(pT(t)/hT|0)|0}var pc=256,hc=262144,mc=4194304;function mo(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 bd(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=mo(r):(i&=s,i!==0?n=mo(i):a||(a=s&~t,a!==0&&(n=mo(a))))):(s=r&~o,s!==0?n=mo(s):i!==0?n=mo(i):a||(a=r&~t,a!==0&&(n=mo(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 Ol(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function gT(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 R0(){var t=mc;return mc<<=1,(mc&62914560)===0&&(mc=4194304),t}function Kp(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function Bl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function vT(t,e,a,r,n,o){var i=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,u=t.hiddenUpdates;for(a=i&~a;0<a;){var c=31-la(a),d=1<<c;s[c]=0,l[c]=-1;var h=u[c];if(h!==null)for(u[c]=null,c=0;c<h.length;c++){var g=h[c];g!==null&&(g.lane&=-536870913)}a&=~d}r!==0&&M0(t,r,0),o!==0&&n===0&&t.tag!==0&&(t.suspendedLanes|=o&~(i&~e))}function M0(t,e,a){t.pendingLanes|=e,t.suspendedLanes&=~e;var r=31-la(e);t.entangledLanes|=e,t.entanglements[r]=t.entanglements[r]|1073741824|a&261930}function D0(t,e){var a=t.entangledLanes|=e;for(t=t.entanglements;a;){var r=31-la(a),n=1<<r;n&e|t[r]&e&&(t[r]|=e),a&=~n}}function O0(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 Lm(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function B0(){var t=ye.p;return t!==0?t:(t=window.event,t===void 0?32:nw(t.type))}function eS(t,e){var a=ye.p;try{return ye.p=t,e()}finally{ye.p=a}}var Fn=Math.random().toString(36).slice(2),yt="__reactFiber$"+Fn,Gt="__reactProps$"+Fn,Yi="__reactContainer$"+Fn,Oh="__reactEvents$"+Fn,yT="__reactListeners$"+Fn,xT="__reactHandles$"+Fn,tS="__reactResources$"+Fn,Fl="__reactMarker$"+Fn;function Im(t){delete t[yt],delete t[Gt],delete t[Oh],delete t[yT],delete t[xT]}function Ci(t){var e=t[yt];if(e)return e;for(var a=t.parentNode;a;){if(e=a[Yi]||a[yt]){if(a=e.alternate,e.child!==null||a!==null&&a.child!==null)for(t=u0(t);t!==null;){if(a=t[yt])return a;t=u0(t)}return e}t=a,a=t.parentNode}return null}function Ki(t){if(t=t[yt]||t[Yi]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function al(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(M(33))}function Mi(t){var e=t[tS];return e||(e=t[tS]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function pt(t){t[Fl]=!0}var F0=new Set,N0={};function ko(t,e){Ui(t,e),Ui(t+"Capture",e)}function Ui(t,e){for(N0[t]=e,t=0;t<e.length;t++)F0.add(e[t])}var bT=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]*$"),aS={},rS={};function ST(t){return Dh.call(rS,t)?!0:Dh.call(aS,t)?!1:bT.test(t)?rS[t]=!0:(aS[t]=!0,!1)}function Tc(t,e,a){if(ST(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 gc(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 br(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 ba(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function P0(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function CT(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 Bh(t){if(!t._valueTracker){var e=P0(t)?"checked":"value";t._valueTracker=CT(t,e,""+t[e])}}function H0(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),r="";return t&&(r=P0(t)?t.checked?"true":"false":t.value),t=r,t!==a?(e.setValue(t),!0):!1}function Xc(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 _T=/[\n"\\]/g;function _a(t){return t.replace(_T,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Fh(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=""+ba(e)):t.value!==""+ba(e)&&(t.value=""+ba(e)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),e!=null?Nh(t,i,ba(e)):a!=null?Nh(t,i,ba(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=""+ba(s):t.removeAttribute("name")}function U0(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)){Bh(t);return}a=a!=null?""+ba(a):"",e=e!=null?""+ba(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),Bh(t)}function Nh(t,e,a){e==="number"&&Xc(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Di(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=""+ba(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 q0(t,e,a){if(e!=null&&(e=""+ba(e),e!==t.value&&(t.value=e),a==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=a!=null?""+ba(a):""}function z0(t,e,a,r){if(e==null){if(r!=null){if(a!=null)throw Error(M(92));if(tl(r)){if(1<r.length)throw Error(M(93));r=r[0]}a=r}a==null&&(a=""),e=a}a=ba(e),t.defaultValue=a,r=t.textContent,r===a&&r!==""&&r!==null&&(t.value=r),Bh(t)}function qi(t,e){if(e){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=e;return}}t.textContent=e}var wT=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function nS(t,e,a){var r=e.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":r?t.setProperty(e,a):typeof a!="number"||a===0||wT.has(e)?e==="float"?t.cssFloat=a:t[e]=(""+a).trim():t[e]=a+"px"}function V0(t,e,a){if(e!=null&&typeof e!="object")throw Error(M(62));if(t=t.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||e!=null&&e.hasOwnProperty(r)||(r.indexOf("--")===0?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="");for(var n in e)r=e[n],e.hasOwnProperty(n)&&a[n]!==r&&nS(t,n,r)}else for(var o in e)e.hasOwnProperty(o)&&nS(t,o,e[o])}function Am(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 LT=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"]]),IT=/^[\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 Rc(t){return IT.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function kr(){}var Ph=null;function km(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var _i=null,Oi=null;function oS(t){var e=Ki(t);if(e&&(t=e.stateNode)){var a=t[Gt]||null;e:switch(t=e.stateNode,e.type){case"input":if(Fh(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="'+_a(""+e)+'"][type="radio"]'),e=0;e<a.length;e++){var r=a[e];if(r!==t&&r.form===t.form){var n=r[Gt]||null;if(!n)throw Error(M(90));Fh(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&&H0(r)}break e;case"textarea":q0(t,a.value,a.defaultValue);break e;case"select":e=a.value,e!=null&&Di(t,!!a.multiple,e,!1)}}}var Qp=!1;function $0(t,e,a){if(Qp)return t(e,a);Qp=!0;try{var r=t(e);return r}finally{if(Qp=!1,(_i!==null||Oi!==null)&&(Md(),_i&&(e=_i,t=Oi,Oi=_i=null,oS(e),t)))for(e=0;e<t.length;e++)oS(t[e])}}function xl(t,e){var a=t.stateNode;if(a===null)return null;var r=a[Gt]||null;if(r===null)return null;a=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(M(231,e,typeof a));return a}var Dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hh=!1;if(Dr)try{mi={},Object.defineProperty(mi,"passive",{get:function(){Hh=!0}}),window.addEventListener("test",mi,mi),window.removeEventListener("test",mi,mi)}catch{Hh=!1}var mi,xn=null,Em=null,Mc=null;function j0(){if(Mc)return Mc;var t,e=Em,a=e.length,r,n="value"in xn?xn.value:xn.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 Mc=n.slice(t,1<r?1-r:void 0)}function Dc(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 vc(){return!0}function iS(){return!1}function Wt(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)?vc:iS,this.isPropagationStopped=iS,this}return Ne(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=vc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=vc)},persist:function(){},isPersistent:vc}),e}var Eo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sd=Wt(Eo),Nl=Ne({},Eo,{view:0,detail:0}),AT=Wt(Nl),Jp,eh,Zs,Cd=Ne({},Nl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tm,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!==Zs&&(Zs&&t.type==="mousemove"?(Jp=t.screenX-Zs.screenX,eh=t.screenY-Zs.screenY):eh=Jp=0,Zs=t),Jp)},movementY:function(t){return"movementY"in t?t.movementY:eh}}),sS=Wt(Cd),kT=Ne({},Cd,{dataTransfer:0}),ET=Wt(kT),TT=Ne({},Nl,{relatedTarget:0}),th=Wt(TT),RT=Ne({},Eo,{animationName:0,elapsedTime:0,pseudoElement:0}),MT=Wt(RT),DT=Ne({},Eo,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),OT=Wt(DT),BT=Ne({},Eo,{data:0}),lS=Wt(BT),FT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NT={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"},PT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HT(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=PT[t])?!!e[t]:!1}function Tm(){return HT}var UT=Ne({},Nl,{key:function(t){if(t.key){var e=FT[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Dc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?NT[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tm,charCode:function(t){return t.type==="keypress"?Dc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Dc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),qT=Wt(UT),zT=Ne({},Cd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uS=Wt(zT),VT=Ne({},Nl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tm}),$T=Wt(VT),jT=Ne({},Eo,{propertyName:0,elapsedTime:0,pseudoElement:0}),GT=Wt(jT),WT=Ne({},Cd,{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}),ZT=Wt(WT),XT=Ne({},Eo,{newState:0,oldState:0}),YT=Wt(XT),KT=[9,13,27,32],Rm=Dr&&"CompositionEvent"in window,ol=null;Dr&&"documentMode"in document&&(ol=document.documentMode);var QT=Dr&&"TextEvent"in window&&!ol,G0=Dr&&(!Rm||ol&&8<ol&&11>=ol),cS=" ",dS=!1;function W0(t,e){switch(t){case"keyup":return KT.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Z0(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var wi=!1;function JT(t,e){switch(t){case"compositionend":return Z0(e);case"keypress":return e.which!==32?null:(dS=!0,cS);case"textInput":return t=e.data,t===cS&&dS?null:t;default:return null}}function eR(t,e){if(wi)return t==="compositionend"||!Rm&&W0(t,e)?(t=j0(),Mc=Em=xn=null,wi=!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 G0&&e.locale!=="ko"?null:e.data;default:return null}}var tR={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 fS(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!tR[t.type]:e==="textarea"}function X0(t,e,a,r){_i?Oi?Oi.push(r):Oi=[r]:_i=r,e=pd(e,"onChange"),0<e.length&&(a=new Sd("onChange","change",null,a,r),t.push({event:a,listeners:e}))}var il=null,bl=null;function aR(t){$_(t,0)}function _d(t){var e=al(t);if(H0(e))return t}function pS(t,e){if(t==="change")return e}var Y0=!1;Dr&&(Dr?(xc="oninput"in document,xc||(ah=document.createElement("div"),ah.setAttribute("oninput","return;"),xc=typeof ah.oninput=="function"),yc=xc):yc=!1,Y0=yc&&(!document.documentMode||9<document.documentMode));var yc,xc,ah;function hS(){il&&(il.detachEvent("onpropertychange",K0),bl=il=null)}function K0(t){if(t.propertyName==="value"&&_d(bl)){var e=[];X0(e,bl,t,km(t)),$0(aR,e)}}function rR(t,e,a){t==="focusin"?(hS(),il=e,bl=a,il.attachEvent("onpropertychange",K0)):t==="focusout"&&hS()}function nR(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return _d(bl)}function oR(t,e){if(t==="click")return _d(e)}function iR(t,e){if(t==="input"||t==="change")return _d(e)}function sR(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ca=typeof Object.is=="function"?Object.is:sR;function Sl(t,e){if(ca(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var a=Object.keys(t),r=Object.keys(e);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var n=a[r];if(!Dh.call(e,n)||!ca(t[n],e[n]))return!1}return!0}function mS(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function gS(t,e){var a=mS(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=mS(a)}}function Q0(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Q0(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function J0(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Xc(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=Xc(t.document)}return e}function Mm(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 lR=Dr&&"documentMode"in document&&11>=document.documentMode,Li=null,Uh=null,sl=null,qh=!1;function vS(t,e,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;qh||Li==null||Li!==Xc(r)||(r=Li,"selectionStart"in r&&Mm(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}),sl&&Sl(sl,r)||(sl=r,r=pd(Uh,"onSelect"),0<r.length&&(e=new Sd("onSelect","select",null,e,a),t.push({event:e,listeners:r}),e.target=Li)))}function po(t,e){var a={};return a[t.toLowerCase()]=e.toLowerCase(),a["Webkit"+t]="webkit"+e,a["Moz"+t]="moz"+e,a}var Ii={animationend:po("Animation","AnimationEnd"),animationiteration:po("Animation","AnimationIteration"),animationstart:po("Animation","AnimationStart"),transitionrun:po("Transition","TransitionRun"),transitionstart:po("Transition","TransitionStart"),transitioncancel:po("Transition","TransitionCancel"),transitionend:po("Transition","TransitionEnd")},rh={},eC={};Dr&&(eC=document.createElement("div").style,"AnimationEvent"in window||(delete Ii.animationend.animation,delete Ii.animationiteration.animation,delete Ii.animationstart.animation),"TransitionEvent"in window||delete Ii.transitionend.transition);function To(t){if(rh[t])return rh[t];if(!Ii[t])return t;var e=Ii[t],a;for(a in e)if(e.hasOwnProperty(a)&&a in eC)return rh[t]=e[a];return t}var tC=To("animationend"),aC=To("animationiteration"),rC=To("animationstart"),uR=To("transitionrun"),cR=To("transitionstart"),dR=To("transitioncancel"),nC=To("transitionend"),oC=new Map,zh="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(" ");zh.push("scrollEnd");function qa(t,e){oC.set(t,e),ko(e,[t])}var Yc=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)},xa=[],Ai=0,Dm=0;function wd(){for(var t=Ai,e=Dm=Ai=0;e<t;){var a=xa[e];xa[e++]=null;var r=xa[e];xa[e++]=null;var n=xa[e];xa[e++]=null;var o=xa[e];if(xa[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&&iC(a,n,o)}}function Ld(t,e,a,r){xa[Ai++]=t,xa[Ai++]=e,xa[Ai++]=a,xa[Ai++]=r,Dm|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function Om(t,e,a,r){return Ld(t,e,a,r),Kc(t)}function Ro(t,e){return Ld(t,null,null,e),Kc(t)}function iC(t,e,a){t.lanes|=a;var r=t.alternate;r!==null&&(r.lanes|=a);for(var n=!1,o=t.return;o!==null;)o.childLanes|=a,r=o.alternate,r!==null&&(r.childLanes|=a),o.tag===22&&(t=o.stateNode,t===null||t._visibility&1||(n=!0)),t=o,o=o.return;return t.tag===3?(o=t.stateNode,n&&e!==null&&(n=31-la(a),t=o.hiddenUpdates,r=t[n],r===null?t[n]=[e]:r.push(e),e.lane=a|536870912),o):null}function Kc(t){if(50<gl)throw gl=0,um=null,Error(M(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var ki={};function fR(t,e,a,r){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function na(t,e,a,r){return new fR(t,e,a,r)}function Bm(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Tr(t,e){var a=t.alternate;return a===null?(a=na(t.tag,e,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=e,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,e=t.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function sC(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 Oc(t,e,a,r,n,o){var i=0;if(r=t,typeof t=="function")Bm(t)&&(i=1);else if(typeof t=="string")i=mM(t,a,sr.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Eh:return t=na(31,a,e,n),t.elementType=Eh,t.lanes=o,t;case bi:return xo(a.children,n,o,e);case I0:i=8,n|=24;break;case Ih:return t=na(12,a,e,n|2),t.elementType=Ih,t.lanes=o,t;case Ah:return t=na(13,a,e,n),t.elementType=Ah,t.lanes=o,t;case kh:return t=na(19,a,e,n),t.elementType=kh,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Ar:i=10;break e;case A0:i=9;break e;case Sm:i=11;break e;case Cm:i=14;break e;case fn:i=16,r=null;break e}i=29,a=Error(M(130,t===null?"null":typeof t,"")),r=null}return e=na(i,a,e,n),e.elementType=t,e.type=r,e.lanes=o,e}function xo(t,e,a,r){return t=na(7,t,r,e),t.lanes=a,t}function nh(t,e,a){return t=na(6,t,null,e),t.lanes=a,t}function lC(t){var e=na(18,null,null,0);return e.stateNode=t,e}function oh(t,e,a){return e=na(4,t.children!==null?t.children:[],t.key,e),e.lanes=a,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var yS=new WeakMap;function wa(t,e){if(typeof t=="object"&&t!==null){var a=yS.get(t);return a!==void 0?a:(e={value:t,source:e,stack:Jb(e)},yS.set(t,e),e)}return{value:t,source:e,stack:Jb(e)}}var Ei=[],Ti=0,Qc=null,Cl=0,Sa=[],Ca=0,Mn=null,nr=1,or="";function Lr(t,e){Ei[Ti++]=Cl,Ei[Ti++]=Qc,Qc=t,Cl=e}function uC(t,e,a){Sa[Ca++]=nr,Sa[Ca++]=or,Sa[Ca++]=Mn,Mn=t;var r=nr;t=or;var n=32-la(r)-1;r&=~(1<<n),a+=1;var o=32-la(e)+n;if(30<o){var i=n-n%5;o=(r&(1<<i)-1).toString(32),r>>=i,n-=i,nr=1<<32-la(e)+n|a<<n|r,or=o+t}else nr=1<<o|a<<n|r,or=t}function Fm(t){t.return!==null&&(Lr(t,1),uC(t,1,0))}function Nm(t){for(;t===Qc;)Qc=Ei[--Ti],Ei[Ti]=null,Cl=Ei[--Ti],Ei[Ti]=null;for(;t===Mn;)Mn=Sa[--Ca],Sa[Ca]=null,or=Sa[--Ca],Sa[Ca]=null,nr=Sa[--Ca],Sa[Ca]=null}function cC(t,e){Sa[Ca++]=nr,Sa[Ca++]=or,Sa[Ca++]=Mn,nr=e.id,or=e.overflow,Mn=t}var xt=null,Fe=null,he=!1,wn=null,La=!1,Vh=Error(M(519));function Dn(t){var e=Error(M(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _l(wa(e,t)),Vh}function xS(t){var e=t.stateNode,a=t.type,r=t.memoizedProps;switch(e[yt]=t,e[Gt]=r,a){case"dialog":ue("cancel",e),ue("close",e);break;case"iframe":case"object":case"embed":ue("load",e);break;case"video":case"audio":for(a=0;a<Al.length;a++)ue(Al[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),U0(e,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ue("invalid",e);break;case"textarea":ue("invalid",e),z0(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||G_(e.textContent,a)?(r.popover!=null&&(ue("beforetoggle",e),ue("toggle",e)),r.onScroll!=null&&ue("scroll",e),r.onScrollEnd!=null&&ue("scrollend",e),r.onClick!=null&&(e.onclick=kr),e=!0):e=!1,e||Dn(t,!0)}function bS(t){for(xt=t.return;xt;)switch(xt.tag){case 5:case 31:case 13:La=!1;return;case 27:case 3:La=!0;return;default:xt=xt.return}}function gi(t){if(t!==xt)return!1;if(!he)return bS(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")||hm(t.type,t.memoizedProps)),a=!a),a&&Fe&&Dn(t),bS(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Fe=l0(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Fe=l0(t)}else e===27?(e=Fe,Nn(t.type)?(t=ym,ym=null,Fe=t):Fe=e):Fe=xt?Aa(t.stateNode.nextSibling):null;return!0}function _o(){Fe=xt=null,he=!1}function ih(){var t=wn;return t!==null&&($t===null?$t=t:$t.push.apply($t,t),wn=null),t}function _l(t){wn===null?wn=[t]:wn.push(t)}var $h=lr(null),Mo=null,Er=null;function hn(t,e,a){Te($h,e._currentValue),e._currentValue=a}function Rr(t){t._currentValue=$h.current,ht($h)}function jh(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 Gh(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),jh(o.return,a,t),r||(i=null);break e}o=s.next}}else if(n.tag===18){if(i=n.return,i===null)throw Error(M(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),jh(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 Qi(t,e,a,r){t=null;for(var n=e,o=!1;n!==null;){if(!o){if((n.flags&524288)!==0)o=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var i=n.alternate;if(i===null)throw Error(M(387));if(i=i.memoizedProps,i!==null){var s=n.type;ca(n.pendingProps.value,i.value)||(t!==null?t.push(s):t=[s])}}else if(n===jc.current){if(i=n.alternate,i===null)throw Error(M(387));i.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(t!==null?t.push(El):t=[El])}n=n.return}t!==null&&Gh(e,t,a,r),e.flags|=262144}function Jc(t){for(t=t.firstContext;t!==null;){if(!ca(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function wo(t){Mo=t,Er=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function bt(t){return dC(Mo,t)}function bc(t,e){return Mo===null&&wo(t),dC(t,e)}function dC(t,e){var a=e._currentValue;if(e={context:e,memoizedValue:a,next:null},Er===null){if(t===null)throw Error(M(308));Er=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Er=Er.next=e;return a}var pR=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()})}},hR=ot.unstable_scheduleCallback,mR=ot.unstable_NormalPriority,et={$$typeof:Ar,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pm(){return{controller:new pR,data:new Map,refCount:0}}function Pl(t){t.refCount--,t.refCount===0&&hR(mR,function(){t.controller.abort()})}var ll=null,Wh=0,zi=0,Bi=null;function gR(t,e){if(ll===null){var a=ll=[];Wh=0,zi=ug(),Bi={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Wh++,e.then(SS,SS),e}function SS(){if(--Wh===0&&ll!==null){Bi!==null&&(Bi.status="fulfilled");var t=ll;ll=null,zi=0,Bi=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function vR(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 CS=ee.S;ee.S=function(t,e){L_=ia(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&gR(t,e),CS!==null&&CS(t,e)};var bo=lr(null);function Hm(){var t=bo.current;return t!==null?t:Ie.pooledCache}function Bc(t,e){e===null?Te(bo,bo.current):Te(bo,e.pool)}function fC(){var t=Hm();return t===null?null:{parent:et._currentValue,pool:t}}var Ji=Error(M(460)),Um=Error(M(474)),Id=Error(M(542)),ed={then:function(){}};function _S(t){return t=t.status,t==="fulfilled"||t==="rejected"}function pC(t,e,a){switch(a=t[a],a===void 0?t.push(e):a!==e&&(e.then(kr,kr),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(kr,kr);else{if(t=Ie,t!==null&&100<t.shellSuspendCounter)throw Error(M(482));t=e,t.status="pending",t.then(function(r){if(e.status==="pending"){var n=e;n.status="fulfilled",n.value=r}},function(r){if(e.status==="pending"){var n=e;n.status="rejected",n.reason=r}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,LS(t),t}throw So=e,Ji}}function go(t){try{var e=t._init;return e(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(So=a,Ji):a}}var So=null;function wS(){if(So===null)throw Error(M(459));var t=So;return So=null,t}function LS(t){if(t===Ji||t===Id)throw Error(M(483))}var Fi=null,wl=0;function Sc(t){var e=wl;return wl+=1,Fi===null&&(Fi=[]),pC(Fi,t,e)}function Xs(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Cc(t,e){throw e.$$typeof===rT?Error(M(525)):(t=Object.prototype.toString.call(e),Error(M(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function hC(t){function e(f,m){if(t){var v=f.deletions;v===null?(f.deletions=[m],f.flags|=16):v.push(m)}}function a(f,m){if(!t)return null;for(;m!==null;)e(f,m),m=m.sibling;return null}function r(f){for(var m=new Map;f!==null;)f.key!==null?m.set(f.key,f):m.set(f.index,f),f=f.sibling;return m}function n(f,m){return f=Tr(f,m),f.index=0,f.sibling=null,f}function o(f,m,v){return f.index=v,t?(v=f.alternate,v!==null?(v=v.index,v<m?(f.flags|=67108866,m):v):(f.flags|=67108866,m)):(f.flags|=1048576,m)}function i(f){return t&&f.alternate===null&&(f.flags|=67108866),f}function s(f,m,v,y){return m===null||m.tag!==6?(m=nh(v,f.mode,y),m.return=f,m):(m=n(m,v),m.return=f,m)}function l(f,m,v,y){var _=v.type;return _===bi?c(f,m,v.props.children,y,v.key):m!==null&&(m.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===fn&&go(_)===m.type)?(m=n(m,v.props),Xs(m,v),m.return=f,m):(m=Oc(v.type,v.key,v.props,null,f.mode,y),Xs(m,v),m.return=f,m)}function u(f,m,v,y){return m===null||m.tag!==4||m.stateNode.containerInfo!==v.containerInfo||m.stateNode.implementation!==v.implementation?(m=oh(v,f.mode,y),m.return=f,m):(m=n(m,v.children||[]),m.return=f,m)}function c(f,m,v,y,_){return m===null||m.tag!==7?(m=xo(v,f.mode,y,_),m.return=f,m):(m=n(m,v),m.return=f,m)}function d(f,m,v){if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return m=nh(""+m,f.mode,v),m.return=f,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case fc:return v=Oc(m.type,m.key,m.props,null,f.mode,v),Xs(v,m),v.return=f,v;case el:return m=oh(m,f.mode,v),m.return=f,m;case fn:return m=go(m),d(f,m,v)}if(tl(m)||Ws(m))return m=xo(m,f.mode,v,null),m.return=f,m;if(typeof m.then=="function")return d(f,Sc(m),v);if(m.$$typeof===Ar)return d(f,bc(f,m),v);Cc(f,m)}return null}function h(f,m,v,y){var _=m!==null?m.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return _!==null?null:s(f,m,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case fc:return v.key===_?l(f,m,v,y):null;case el:return v.key===_?u(f,m,v,y):null;case fn:return v=go(v),h(f,m,v,y)}if(tl(v)||Ws(v))return _!==null?null:c(f,m,v,y,null);if(typeof v.then=="function")return h(f,m,Sc(v),y);if(v.$$typeof===Ar)return h(f,m,bc(f,v),y);Cc(f,v)}return null}function g(f,m,v,y,_){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return f=f.get(v)||null,s(m,f,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case fc:return f=f.get(y.key===null?v:y.key)||null,l(m,f,y,_);case el:return f=f.get(y.key===null?v:y.key)||null,u(m,f,y,_);case fn:return y=go(y),g(f,m,v,y,_)}if(tl(y)||Ws(y))return f=f.get(v)||null,c(m,f,y,_,null);if(typeof y.then=="function")return g(f,m,v,Sc(y),_);if(y.$$typeof===Ar)return g(f,m,v,bc(m,y),_);Cc(m,y)}return null}function S(f,m,v,y){for(var _=null,w=null,C=m,A=m=0,E=null;C!==null&&A<v.length;A++){C.index>A?(E=C,C=null):E=C.sibling;var L=h(f,C,v[A],y);if(L===null){C===null&&(C=E);break}t&&C&&L.alternate===null&&e(f,C),m=o(L,m,A),w===null?_=L:w.sibling=L,w=L,C=E}if(A===v.length)return a(f,C),he&&Lr(f,A),_;if(C===null){for(;A<v.length;A++)C=d(f,v[A],y),C!==null&&(m=o(C,m,A),w===null?_=C:w.sibling=C,w=C);return he&&Lr(f,A),_}for(C=r(C);A<v.length;A++)E=g(C,f,A,v[A],y),E!==null&&(t&&E.alternate!==null&&C.delete(E.key===null?A:E.key),m=o(E,m,A),w===null?_=E:w.sibling=E,w=E);return t&&C.forEach(function(k){return e(f,k)}),he&&Lr(f,A),_}function b(f,m,v,y){if(v==null)throw Error(M(151));for(var _=null,w=null,C=m,A=m=0,E=null,L=v.next();C!==null&&!L.done;A++,L=v.next()){C.index>A?(E=C,C=null):E=C.sibling;var k=h(f,C,L.value,y);if(k===null){C===null&&(C=E);break}t&&C&&k.alternate===null&&e(f,C),m=o(k,m,A),w===null?_=k:w.sibling=k,w=k,C=E}if(L.done)return a(f,C),he&&Lr(f,A),_;if(C===null){for(;!L.done;A++,L=v.next())L=d(f,L.value,y),L!==null&&(m=o(L,m,A),w===null?_=L:w.sibling=L,w=L);return he&&Lr(f,A),_}for(C=r(C);!L.done;A++,L=v.next())L=g(C,f,A,L.value,y),L!==null&&(t&&L.alternate!==null&&C.delete(L.key===null?A:L.key),m=o(L,m,A),w===null?_=L:w.sibling=L,w=L);return t&&C.forEach(function(O){return e(f,O)}),he&&Lr(f,A),_}function x(f,m,v,y){if(typeof v=="object"&&v!==null&&v.type===bi&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case fc:e:{for(var _=v.key;m!==null;){if(m.key===_){if(_=v.type,_===bi){if(m.tag===7){a(f,m.sibling),y=n(m,v.props.children),y.return=f,f=y;break e}}else if(m.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===fn&&go(_)===m.type){a(f,m.sibling),y=n(m,v.props),Xs(y,v),y.return=f,f=y;break e}a(f,m);break}else e(f,m);m=m.sibling}v.type===bi?(y=xo(v.props.children,f.mode,y,v.key),y.return=f,f=y):(y=Oc(v.type,v.key,v.props,null,f.mode,y),Xs(y,v),y.return=f,f=y)}return i(f);case el:e:{for(_=v.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===v.containerInfo&&m.stateNode.implementation===v.implementation){a(f,m.sibling),y=n(m,v.children||[]),y.return=f,f=y;break e}else{a(f,m);break}else e(f,m);m=m.sibling}y=oh(v,f.mode,y),y.return=f,f=y}return i(f);case fn:return v=go(v),x(f,m,v,y)}if(tl(v))return S(f,m,v,y);if(Ws(v)){if(_=Ws(v),typeof _!="function")throw Error(M(150));return v=_.call(v),b(f,m,v,y)}if(typeof v.then=="function")return x(f,m,Sc(v),y);if(v.$$typeof===Ar)return x(f,m,bc(f,v),y);Cc(f,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,m!==null&&m.tag===6?(a(f,m.sibling),y=n(m,v),y.return=f,f=y):(a(f,m),y=nh(v,f.mode,y),y.return=f,f=y),i(f)):a(f,m)}return function(f,m,v,y){try{wl=0;var _=x(f,m,v,y);return Fi=null,_}catch(C){if(C===Ji||C===Id)throw C;var w=na(29,C,null,f.mode);return w.lanes=y,w.return=f,w}}}var Lo=hC(!0),mC=hC(!1),pn=!1;function qm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zh(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 Ln(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function In(t,e,a){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(ve&2)!==0){var n=r.pending;return n===null?e.next=e:(e.next=n.next,n.next=e),r.pending=e,e=Kc(t),iC(t,null,a),e}return Ld(t,r,e,a),Kc(t)}function ul(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,D0(t,a)}}function sh(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 Xh=!1;function cl(){if(Xh){var t=Bi;if(t!==null)throw t}}function dl(t,e,a,r){Xh=!1;var n=t.updateQueue;pn=!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 h=s.lane&-536870913,g=h!==s.lane;if(g?(pe&h)===h:(r&h)===h){h!==0&&h===zi&&(Xh=!0),c!==null&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var S=t,b=s;h=e;var x=a;switch(b.tag){case 1:if(S=b.payload,typeof S=="function"){d=S.call(x,d,h);break e}d=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=b.payload,h=typeof S=="function"?S.call(x,d,h):S,h==null)break e;d=Ne({},d,h);break e;case 2:pn=!0}}h=s.callback,h!==null&&(t.flags|=64,g&&(t.flags|=8192),g=n.callbacks,g===null?n.callbacks=[h]:g.push(h))}else g={lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=g,l=d):c=c.next=g,i|=h;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;g=s,s=g.next,g.next=null,n.lastBaseUpdate=g,n.shared.pending=null}}while(!0);c===null&&(l=d),n.baseState=l,n.firstBaseUpdate=u,n.lastBaseUpdate=c,o===null&&(n.shared.lanes=0),Bn|=i,t.lanes=i,t.memoizedState=d}}function gC(t,e){if(typeof t!="function")throw Error(M(191,t));t.call(e)}function vC(t,e){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)gC(a[t],e)}var Vi=lr(null),td=lr(0);function IS(t,e){t=Nr,Te(td,t),Te(Vi,e),Nr=t|e.baseLanes}function Yh(){Te(td,Nr),Te(Vi,Vi.current)}function zm(){Nr=td.current,ht(Vi),ht(td)}var da=lr(null),Ia=null;function mn(t){var e=t.alternate;Te(Xe,Xe.current&1),Te(da,t),Ia===null&&(e===null||Vi.current!==null||e.memoizedState!==null)&&(Ia=t)}function Kh(t){Te(Xe,Xe.current),Te(da,t),Ia===null&&(Ia=t)}function yC(t){t.tag===22?(Te(Xe,Xe.current),Te(da,t),Ia===null&&(Ia=t)):gn(t)}function gn(){Te(Xe,Xe.current),Te(da,da.current)}function ra(t){ht(da),Ia===t&&(Ia=null),ht(Xe)}var Xe=lr(0);function ad(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||gm(a)||vm(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 Or=0,ie=null,we=null,Qe=null,rd=!1,Ni=!1,Io=!1,nd=0,Ll=0,Pi=null,yR=0;function We(){throw Error(M(321))}function Vm(t,e){if(e===null)return!1;for(var a=0;a<e.length&&a<t.length;a++)if(!ca(t[a],e[a]))return!1;return!0}function $m(t,e,a,r,n,o){return Or=o,ie=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ee.H=t===null||t.memoizedState===null?XC:tg,Io=!1,o=a(r,n),Io=!1,Ni&&(o=bC(e,a,r,n)),xC(t),o}function xC(t){ee.H=Il;var e=we!==null&&we.next!==null;if(Or=0,Qe=we=ie=null,rd=!1,Ll=0,Pi=null,e)throw Error(M(300));t===null||tt||(t=t.dependencies,t!==null&&Jc(t)&&(tt=!0))}function bC(t,e,a,r){ie=t;var n=0;do{if(Ni&&(Pi=null),Ll=0,Ni=!1,25<=n)throw Error(M(301));if(n+=1,Qe=we=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=YC,o=e(a,r)}while(Ni);return o}function xR(){var t=ee.H,e=t.useState()[0];return e=typeof e.then=="function"?Hl(e):e,t=t.useState()[0],(we!==null?we.memoizedState:null)!==t&&(ie.flags|=1024),e}function jm(){var t=nd!==0;return nd=0,t}function Gm(t,e,a){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a}function Wm(t){if(rd){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}rd=!1}Or=0,Qe=we=ie=null,Ni=!1,Ll=nd=0,Pi=null}function Bt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?ie.memoizedState=Qe=t:Qe=Qe.next=t,Qe}function Ye(){if(we===null){var t=ie.alternate;t=t!==null?t.memoizedState:null}else t=we.next;var e=Qe===null?ie.memoizedState:Qe.next;if(e!==null)Qe=e,we=t;else{if(t===null)throw ie.alternate===null?Error(M(467)):Error(M(310));we=t,t={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},Qe===null?ie.memoizedState=Qe=t:Qe=Qe.next=t}return Qe}function Ad(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hl(t){var e=Ll;return Ll+=1,Pi===null&&(Pi=[]),t=pC(Pi,t,e),e=ie,(Qe===null?e.memoizedState:Qe.next)===null&&(e=e.alternate,ee.H=e===null||e.memoizedState===null?XC:tg),t}function kd(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Hl(t);if(t.$$typeof===Ar)return bt(t)}throw Error(M(438,String(t)))}function Zm(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=Ad(),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]=nT;return e.index++,a}function Br(t,e){return typeof e=="function"?e(t):e}function Fc(t){var e=Ye();return Xm(e,we,t)}function Xm(t,e,a){var r=t.queue;if(r===null)throw Error(M(311));r.lastRenderedReducer=a;var n=t.baseQueue,o=r.pending;if(o!==null){if(n!==null){var i=n.next;n.next=o.next,o.next=i}e.baseQueue=n=o,r.pending=null}if(o=t.baseState,n===null)t.memoizedState=o;else{e=n.next;var s=i=null,l=null,u=e,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(pe&d)===d:(Or&d)===d){var h=u.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===zi&&(c=!0);else if((Or&h)===h){u=u.next,h===zi&&(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|=h,Bn|=h;d=u.action,Io&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else h={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=h,i=o):l=l.next=h,ie.lanes|=d,Bn|=d;u=u.next}while(u!==null&&u!==e);if(l===null?i=o:l.next=s,!ca(o,t.memoizedState)&&(tt=!0,c&&(a=Bi,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 lh(t){var e=Ye(),a=e.queue;if(a===null)throw Error(M(311));a.lastRenderedReducer=t;var r=a.dispatch,n=a.pending,o=e.memoizedState;if(n!==null){a.pending=null;var i=n=n.next;do o=t(o,i.action),i=i.next;while(i!==n);ca(o,e.memoizedState)||(tt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),a.lastRenderedState=o}return[o,r]}function SC(t,e,a){var r=ie,n=Ye(),o=he;if(o){if(a===void 0)throw Error(M(407));a=a()}else a=e();var i=!ca((we||n).memoizedState,a);if(i&&(n.memoizedState=a,tt=!0),n=n.queue,Ym(wC.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||Qe!==null&&Qe.memoizedState.tag&1){if(r.flags|=2048,$i(9,{destroy:void 0},_C.bind(null,r,n,a,e),null),Ie===null)throw Error(M(349));o||(Or&127)!==0||CC(r,e,a)}return a}function CC(t,e,a){t.flags|=16384,t={getSnapshot:e,value:a},e=ie.updateQueue,e===null?(e=Ad(),ie.updateQueue=e,e.stores=[t]):(a=e.stores,a===null?e.stores=[t]:a.push(t))}function _C(t,e,a,r){e.value=a,e.getSnapshot=r,LC(e)&&IC(t)}function wC(t,e,a){return a(function(){LC(e)&&IC(t)})}function LC(t){var e=t.getSnapshot;t=t.value;try{var a=e();return!ca(t,a)}catch{return!0}}function IC(t){var e=Ro(t,2);e!==null&&jt(e,t,2)}function Qh(t){var e=Bt();if(typeof t=="function"){var a=t;if(t=a(),Io){yn(!0);try{a()}finally{yn(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:t},e}function AC(t,e,a,r){return t.baseState=a,Xm(t,we,typeof r=="function"?r:Br)}function bR(t,e,a,r,n){if(Td(t))throw Error(M(485));if(t=e.action,t!==null){var o={payload:n,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){o.listeners.push(i)}};ee.T!==null?a(!0):o.isTransition=!1,r(o),a=e.pending,a===null?(o.next=e.pending=o,kC(e,o)):(o.next=a.next,e.pending=a.next=o)}}function kC(t,e){var a=e.action,r=e.payload,n=t.state;if(e.isTransition){var o=ee.T,i={};ee.T=i;try{var s=a(n,r),l=ee.S;l!==null&&l(i,s),AS(t,e,s)}catch(u){Jh(t,e,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),ee.T=o}}else try{o=a(n,r),AS(t,e,o)}catch(u){Jh(t,e,u)}}function AS(t,e,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){kS(t,e,r)},function(r){return Jh(t,e,r)}):kS(t,e,a)}function kS(t,e,a){e.status="fulfilled",e.value=a,EC(e),t.state=a,e=t.pending,e!==null&&(a=e.next,a===e?t.pending=null:(a=a.next,e.next=a,kC(t,a)))}function Jh(t,e,a){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do e.status="rejected",e.reason=a,EC(e),e=e.next;while(e!==r)}t.action=null}function EC(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function TC(t,e){return e}function ES(t,e){if(he){var a=Ie.formState;if(a!==null){e:{var r=ie;if(he){if(Fe){t:{for(var n=Fe,o=La;n.nodeType!==8;){if(!o){n=null;break t}if(n=Aa(n.nextSibling),n===null){n=null;break t}}o=n.data,n=o==="F!"||o==="F"?n:null}if(n){Fe=Aa(n.nextSibling),r=n.data==="F!";break e}}Dn(r)}r=!1}r&&(e=a[0])}}return a=Bt(),a.memoizedState=a.baseState=e,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:TC,lastRenderedState:e},a.queue=r,a=GC.bind(null,ie,r),r.dispatch=a,r=Qh(!1),o=eg.bind(null,ie,!1,r.queue),r=Bt(),n={state:e,dispatch:null,action:t,pending:null},r.queue=n,a=bR.bind(null,ie,n,o,a),n.dispatch=a,r.memoizedState=t,[e,a,!1]}function TS(t){var e=Ye();return RC(e,we,t)}function RC(t,e,a){if(e=Xm(t,e,TC)[0],t=Fc(Br)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var r=Hl(e)}catch(i){throw i===Ji?Id:i}else r=e;e=Ye();var n=e.queue,o=n.dispatch;return a!==e.memoizedState&&(ie.flags|=2048,$i(9,{destroy:void 0},SR.bind(null,n,a),null)),[r,o,t]}function SR(t,e){t.action=e}function RS(t){var e=Ye(),a=we;if(a!==null)return RC(e,a,t);Ye(),e=e.memoizedState,a=Ye();var r=a.queue.dispatch;return a.memoizedState=t,[e,r,!1]}function $i(t,e,a,r){return t={tag:t,create:a,deps:r,inst:e,next:null},e=ie.updateQueue,e===null&&(e=Ad(),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 MC(){return Ye().memoizedState}function Nc(t,e,a,r){var n=Bt();ie.flags|=t,n.memoizedState=$i(1|e,{destroy:void 0},a,r===void 0?null:r)}function Ed(t,e,a,r){var n=Ye();r=r===void 0?null:r;var o=n.memoizedState.inst;we!==null&&r!==null&&Vm(r,we.memoizedState.deps)?n.memoizedState=$i(e,o,a,r):(ie.flags|=t,n.memoizedState=$i(1|e,o,a,r))}function MS(t,e){Nc(8390656,8,t,e)}function Ym(t,e){Ed(2048,8,t,e)}function CR(t){ie.flags|=4;var e=ie.updateQueue;if(e===null)e=Ad(),ie.updateQueue=e,e.events=[t];else{var a=e.events;a===null?e.events=[t]:a.push(t)}}function DC(t){var e=Ye().memoizedState;return CR({ref:e,nextImpl:t}),function(){if((ve&2)!==0)throw Error(M(440));return e.impl.apply(void 0,arguments)}}function OC(t,e){return Ed(4,2,t,e)}function BC(t,e){return Ed(4,4,t,e)}function FC(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 NC(t,e,a){a=a!=null?a.concat([t]):null,Ed(4,4,FC.bind(null,e,t),a)}function Km(){}function PC(t,e){var a=Ye();e=e===void 0?null:e;var r=a.memoizedState;return e!==null&&Vm(e,r[1])?r[0]:(a.memoizedState=[t,e],t)}function HC(t,e){var a=Ye();e=e===void 0?null:e;var r=a.memoizedState;if(e!==null&&Vm(e,r[1]))return r[0];if(r=t(),Io){yn(!0);try{t()}finally{yn(!1)}}return a.memoizedState=[r,e],r}function Qm(t,e,a){return a===void 0||(Or&1073741824)!==0&&(pe&261930)===0?t.memoizedState=e:(t.memoizedState=a,t=A_(),ie.lanes|=t,Bn|=t,a)}function UC(t,e,a,r){return ca(a,e)?a:Vi.current!==null?(t=Qm(t,a,r),ca(t,e)||(tt=!0),t):(Or&42)===0||(Or&1073741824)!==0&&(pe&261930)===0?(tt=!0,t.memoizedState=a):(t=A_(),ie.lanes|=t,Bn|=t,e)}function qC(t,e,a,r,n){var o=ye.p;ye.p=o!==0&&8>o?o:8;var i=ee.T,s={};ee.T=s,eg(t,!1,e,a);try{var l=n(),u=ee.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=vR(l,r);fl(t,e,c,ua(t))}else fl(t,e,r,ua(t))}catch(d){fl(t,e,{then:function(){},status:"rejected",reason:d},ua())}finally{ye.p=o,i!==null&&s.types!==null&&(i.types=s.types),ee.T=i}}function _R(){}function em(t,e,a,r){if(t.tag!==5)throw Error(M(476));var n=zC(t).queue;qC(t,n,e,yo,a===null?_R:function(){return VC(t),a(r)})}function zC(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:yo,baseState:yo,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:yo},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function VC(t){var e=zC(t);e.next===null&&(e=t.alternate.memoizedState),fl(t,e.next.queue,{},ua())}function Jm(){return bt(El)}function $C(){return Ye().memoizedState}function jC(){return Ye().memoizedState}function wR(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=ua();t=Ln(a);var r=In(e,t,a);r!==null&&(jt(r,e,a),ul(r,e,a)),e={cache:Pm()},t.payload=e;return}e=e.return}}function LR(t,e,a){var r=ua();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Td(t)?WC(e,a):(a=Om(t,e,a,r),a!==null&&(jt(a,t,r),ZC(a,e,r)))}function GC(t,e,a){var r=ua();fl(t,e,a,r)}function fl(t,e,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Td(t))WC(e,n);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var i=e.lastRenderedState,s=o(i,a);if(n.hasEagerState=!0,n.eagerState=s,ca(s,i))return Ld(t,e,n,0),Ie===null&&wd(),!1}catch{}if(a=Om(t,e,n,r),a!==null)return jt(a,t,r),ZC(a,e,r),!0}return!1}function eg(t,e,a,r){if(r={lane:2,revertLane:ug(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Td(t)){if(e)throw Error(M(479))}else e=Om(t,a,r,2),e!==null&&jt(e,t,2)}function Td(t){var e=t.alternate;return t===ie||e!==null&&e===ie}function WC(t,e){Ni=rd=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function ZC(t,e,a){if((a&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,a|=r,e.lanes=a,D0(t,a)}}var Il={readContext:bt,use:kd,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useLayoutEffect:We,useInsertionEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useSyncExternalStore:We,useId:We,useHostTransitionStatus:We,useFormState:We,useActionState:We,useOptimistic:We,useMemoCache:We,useCacheRefresh:We};Il.useEffectEvent=We;var XC={readContext:bt,use:kd,useCallback:function(t,e){return Bt().memoizedState=[t,e===void 0?null:e],t},useContext:bt,useEffect:MS,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,Nc(4194308,4,FC.bind(null,e,t),a)},useLayoutEffect:function(t,e){return Nc(4194308,4,t,e)},useInsertionEffect:function(t,e){Nc(4,2,t,e)},useMemo:function(t,e){var a=Bt();e=e===void 0?null:e;var r=t();if(Io){yn(!0);try{t()}finally{yn(!1)}}return a.memoizedState=[r,e],r},useReducer:function(t,e,a){var r=Bt();if(a!==void 0){var n=a(e);if(Io){yn(!0);try{a(e)}finally{yn(!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=LR.bind(null,ie,t),[r.memoizedState,t]},useRef:function(t){var e=Bt();return t={current:t},e.memoizedState=t},useState:function(t){t=Qh(t);var e=t.queue,a=GC.bind(null,ie,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:Km,useDeferredValue:function(t,e){var a=Bt();return Qm(a,t,e)},useTransition:function(){var t=Qh(!1);return t=qC.bind(null,ie,t.queue,!0,!1),Bt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var r=ie,n=Bt();if(he){if(a===void 0)throw Error(M(407));a=a()}else{if(a=e(),Ie===null)throw Error(M(349));(pe&127)!==0||CC(r,e,a)}n.memoizedState=a;var o={value:a,getSnapshot:e};return n.queue=o,MS(wC.bind(null,r,o,t),[t]),r.flags|=2048,$i(9,{destroy:void 0},_C.bind(null,r,o,a,e),null),a},useId:function(){var t=Bt(),e=Ie.identifierPrefix;if(he){var a=or,r=nr;a=(r&~(1<<32-la(r)-1)).toString(32)+a,e="_"+e+"R_"+a,a=nd++,0<a&&(e+="H"+a.toString(32)),e+="_"}else a=yR++,e="_"+e+"r_"+a.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Jm,useFormState:ES,useActionState:ES,useOptimistic:function(t){var e=Bt();e.memoizedState=e.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=a,e=eg.bind(null,ie,!0,a),a.dispatch=e,[t,e]},useMemoCache:Zm,useCacheRefresh:function(){return Bt().memoizedState=wR.bind(null,ie)},useEffectEvent:function(t){var e=Bt(),a={impl:t};return e.memoizedState=a,function(){if((ve&2)!==0)throw Error(M(440));return a.impl.apply(void 0,arguments)}}},tg={readContext:bt,use:kd,useCallback:PC,useContext:bt,useEffect:Ym,useImperativeHandle:NC,useInsertionEffect:OC,useLayoutEffect:BC,useMemo:HC,useReducer:Fc,useRef:MC,useState:function(){return Fc(Br)},useDebugValue:Km,useDeferredValue:function(t,e){var a=Ye();return UC(a,we.memoizedState,t,e)},useTransition:function(){var t=Fc(Br)[0],e=Ye().memoizedState;return[typeof t=="boolean"?t:Hl(t),e]},useSyncExternalStore:SC,useId:$C,useHostTransitionStatus:Jm,useFormState:TS,useActionState:TS,useOptimistic:function(t,e){var a=Ye();return AC(a,we,t,e)},useMemoCache:Zm,useCacheRefresh:jC};tg.useEffectEvent=DC;var YC={readContext:bt,use:kd,useCallback:PC,useContext:bt,useEffect:Ym,useImperativeHandle:NC,useInsertionEffect:OC,useLayoutEffect:BC,useMemo:HC,useReducer:lh,useRef:MC,useState:function(){return lh(Br)},useDebugValue:Km,useDeferredValue:function(t,e){var a=Ye();return we===null?Qm(a,t,e):UC(a,we.memoizedState,t,e)},useTransition:function(){var t=lh(Br)[0],e=Ye().memoizedState;return[typeof t=="boolean"?t:Hl(t),e]},useSyncExternalStore:SC,useId:$C,useHostTransitionStatus:Jm,useFormState:RS,useActionState:RS,useOptimistic:function(t,e){var a=Ye();return we!==null?AC(a,we,t,e):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Zm,useCacheRefresh:jC};YC.useEffectEvent=DC;function uh(t,e,a,r){e=t.memoizedState,a=a(r,e),a=a==null?e:Ne({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var tm={enqueueSetState:function(t,e,a){t=t._reactInternals;var r=ua(),n=Ln(r);n.payload=e,a!=null&&(n.callback=a),e=In(t,n,r),e!==null&&(jt(e,t,r),ul(e,t,r))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var r=ua(),n=Ln(r);n.tag=1,n.payload=e,a!=null&&(n.callback=a),e=In(t,n,r),e!==null&&(jt(e,t,r),ul(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=ua(),r=Ln(a);r.tag=2,e!=null&&(r.callback=e),e=In(t,r,a),e!==null&&(jt(e,t,a),ul(e,t,a))}};function DS(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?!Sl(a,r)||!Sl(n,o):!0}function OS(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&&tm.enqueueReplaceState(e,e.state,null)}function Ao(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=Ne({},a));for(var n in t)a[n]===void 0&&(a[n]=t[n])}return a}function KC(t){Yc(t)}function QC(t){console.error(t)}function JC(t){Yc(t)}function od(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function BS(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 am(t,e,a){return a=Ln(a),a.tag=3,a.payload={element:null},a.callback=function(){od(t,e)},a}function e_(t){return t=Ln(t),t.tag=3,t}function t_(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(){BS(e,a,r)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(t.callback=function(){BS(e,a,r),typeof n!="function"&&(An===null?An=new Set([this]):An.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function IR(t,e,a,r,n){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(e=a.alternate,e!==null&&Qi(e,a,n,!0),a=da.current,a!==null){switch(a.tag){case 31:case 13:return Ia===null?cd():a.alternate===null&&Ze===0&&(Ze=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===ed?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([r]):e.add(r),bh(t,r,n)),!1;case 22:return a.flags|=65536,r===ed?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)),bh(t,r,n)),!1}throw Error(M(435,a.tag))}return bh(t,r,n),cd(),!1}if(he)return e=da.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=n,r!==Vh&&(t=Error(M(422),{cause:r}),_l(wa(t,a)))):(r!==Vh&&(e=Error(M(423),{cause:r}),_l(wa(e,a))),t=t.current.alternate,t.flags|=65536,n&=-n,t.lanes|=n,r=wa(r,a),n=am(t.stateNode,r,n),sh(t,n),Ze!==4&&(Ze=2)),!1;var o=Error(M(520),{cause:r});if(o=wa(o,a),ml===null?ml=[o]:ml.push(o),Ze!==4&&(Ze=2),e===null)return!0;r=wa(r,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=n&-n,a.lanes|=t,t=am(a.stateNode,r,t),sh(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"&&(An===null||!An.has(o))))return a.flags|=65536,n&=-n,a.lanes|=n,n=e_(n),t_(n,t,a,r),sh(a,n),!1}a=a.return}while(a!==null);return!1}var ag=Error(M(461)),tt=!1;function vt(t,e,a,r){e.child=t===null?mC(e,null,a,r):Lo(e,t.child,a,r)}function FS(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 wo(e),r=$m(t,e,a,i,o,n),s=jm(),t!==null&&!tt?(Gm(t,e,n),Fr(t,e,n)):(he&&s&&Fm(e),e.flags|=1,vt(t,e,r,n),e.child)}function NS(t,e,a,r,n){if(t===null){var o=a.type;return typeof o=="function"&&!Bm(o)&&o.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=o,a_(t,e,o,r,n)):(t=Oc(a.type,null,r,e,e.mode,n),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!rg(t,n)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:Sl,a(i,r)&&t.ref===e.ref)return Fr(t,e,n)}return e.flags|=1,t=Tr(o,r),t.ref=e.ref,t.return=e,e.child=t}function a_(t,e,a,r,n){if(t!==null){var o=t.memoizedProps;if(Sl(o,r)&&t.ref===e.ref)if(tt=!1,e.pendingProps=r=o,rg(t,n))(t.flags&131072)!==0&&(tt=!0);else return e.lanes=t.lanes,Fr(t,e,n)}return rm(t,e,a,r,n)}function r_(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 PS(t,e,o,a,r)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Bc(e,o!==null?o.cachePool:null),o!==null?IS(e,o):Yh(),yC(e);else return r=e.lanes=536870912,PS(t,e,o!==null?o.baseLanes|a:a,a,r)}else o!==null?(Bc(e,o.cachePool),IS(e,o),gn(e),e.memoizedState=null):(t!==null&&Bc(e,null),Yh(),gn(e));return vt(t,e,n,a),e.child}function rl(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function PS(t,e,a,r,n){var o=Hm();return o=o===null?null:{parent:et._currentValue,pool:o},e.memoizedState={baseLanes:a,cachePool:o},t!==null&&Bc(e,null),Yh(),yC(e),t!==null&&Qi(t,e,r,!0),e.childLanes=n,null}function Pc(t,e){return e=id({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function HS(t,e,a){return Lo(e,t.child,null,a),t=Pc(e,e.pendingProps),t.flags|=2,ra(e),e.memoizedState=null,t}function AR(t,e,a){var r=e.pendingProps,n=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(he){if(r.mode==="hidden")return t=Pc(e,r),e.lanes=536870912,rl(null,t);if(Kh(e),(t=Fe)?(t=X_(t,La),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Mn!==null?{id:nr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},a=lC(t),a.return=e,e.child=a,xt=e,Fe=null)):t=null,t===null)throw Dn(e);return e.lanes=536870912,null}return Pc(e,r)}var o=t.memoizedState;if(o!==null){var i=o.dehydrated;if(Kh(e),n)if(e.flags&256)e.flags&=-257,e=HS(t,e,a);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(M(558));else if(tt||Qi(t,e,a,!1),n=(a&t.childLanes)!==0,tt||n){if(r=Ie,r!==null&&(i=O0(r,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,Ro(t,i),jt(r,t,i),ag;cd(),e=HS(t,e,a)}else t=o.treeContext,Fe=Aa(i.nextSibling),xt=e,he=!0,wn=null,La=!1,t!==null&&cC(e,t),e=Pc(e,r),e.flags|=4096;return e}return t=Tr(t.child,{mode:r.mode,children:r.children}),t.ref=e.ref,e.child=t,t.return=e,t}function Hc(t,e){var a=e.ref;if(a===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(M(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function rm(t,e,a,r,n){return wo(e),a=$m(t,e,a,r,void 0,n),r=jm(),t!==null&&!tt?(Gm(t,e,n),Fr(t,e,n)):(he&&r&&Fm(e),e.flags|=1,vt(t,e,a,n),e.child)}function US(t,e,a,r,n,o){return wo(e),e.updateQueue=null,a=bC(e,r,a,n),xC(t),r=jm(),t!==null&&!tt?(Gm(t,e,o),Fr(t,e,o)):(he&&r&&Fm(e),e.flags|=1,vt(t,e,a,o),e.child)}function qS(t,e,a,r,n){if(wo(e),e.stateNode===null){var o=ki,i=a.contextType;typeof i=="object"&&i!==null&&(o=bt(i)),o=new a(r,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=tm,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=r,o.state=e.memoizedState,o.refs={},qm(e),i=a.contextType,o.context=typeof i=="object"&&i!==null?bt(i):ki,o.state=e.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(uh(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&&tm.enqueueReplaceState(o,o.state,null),dl(e,r,o,n),cl(),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=Ao(a,s);o.props=l;var u=o.context,c=a.contextType;i=ki,typeof c=="object"&&c!==null&&(i=bt(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||u!==i)&&OS(e,o,r,i),pn=!1;var h=e.memoizedState;o.state=h,dl(e,r,o,n),cl(),u=e.memoizedState,s||h!==u||pn?(typeof d=="function"&&(uh(e,a,d,r),u=e.memoizedState),(l=pn||DS(e,a,l,r,h,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,Zh(t,e),i=e.memoizedProps,c=Ao(a,i),o.props=c,d=e.pendingProps,h=o.context,u=a.contextType,l=ki,typeof u=="object"&&u!==null&&(l=bt(u)),s=a.getDerivedStateFromProps,(u=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||h!==l)&&OS(e,o,r,l),pn=!1,h=e.memoizedState,o.state=h,dl(e,r,o,n),cl();var g=e.memoizedState;i!==d||h!==g||pn||t!==null&&t.dependencies!==null&&Jc(t.dependencies)?(typeof s=="function"&&(uh(e,a,s,r),g=e.memoizedState),(c=pn||DS(e,a,c,r,h,g,l)||t!==null&&t.dependencies!==null&&Jc(t.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),o.props=r,o.state=g,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),r=!1)}return o=r,Hc(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=Lo(e,t.child,null,n),e.child=Lo(e,null,a,n)):vt(t,e,a,n),e.memoizedState=o.state,t=e.child):t=Fr(t,e,n),t}function zS(t,e,a,r){return _o(),e.flags|=256,vt(t,e,a,r),e.child}var ch={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function dh(t){return{baseLanes:t,cachePool:fC()}}function fh(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=oa),t}function n_(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:(Xe.current&2)!==0),i&&(n=!0,e.flags&=-129),i=(e.flags&32)!==0,e.flags&=-33,t===null){if(he){if(n?mn(e):gn(e),(t=Fe)?(t=X_(t,La),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Mn!==null?{id:nr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},a=lC(t),a.return=e,e.child=a,xt=e,Fe=null)):t=null,t===null)throw Dn(e);return vm(t)?e.lanes=32:e.lanes=536870912,null}var s=r.children;return r=r.fallback,n?(gn(e),n=e.mode,s=id({mode:"hidden",children:s},n),r=xo(r,n,a,null),s.return=e,r.return=e,s.sibling=r,e.child=s,r=e.child,r.memoizedState=dh(a),r.childLanes=fh(t,i,a),e.memoizedState=ch,rl(null,r)):(mn(e),nm(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(mn(e),e.flags&=-257,e=ph(t,e,a)):e.memoizedState!==null?(gn(e),e.child=t.child,e.flags|=128,e=null):(gn(e),s=r.fallback,n=e.mode,r=id({mode:"visible",children:r.children},n),s=xo(s,n,a,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,Lo(e,t.child,null,a),r=e.child,r.memoizedState=dh(a),r.childLanes=fh(t,i,a),e.memoizedState=ch,e=rl(null,r));else if(mn(e),vm(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var u=i.dgst;i=u,r=Error(M(419)),r.stack="",r.digest=i,_l({value:r,source:null,stack:null}),e=ph(t,e,a)}else if(tt||Qi(t,e,a,!1),i=(a&t.childLanes)!==0,tt||i){if(i=Ie,i!==null&&(r=O0(i,a),r!==0&&r!==l.retryLane))throw l.retryLane=r,Ro(t,r),jt(i,t,r),ag;gm(s)||cd(),e=ph(t,e,a)}else gm(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Fe=Aa(s.nextSibling),xt=e,he=!0,wn=null,La=!1,t!==null&&cC(e,t),e=nm(e,r.children),e.flags|=4096);return e}return n?(gn(e),s=r.fallback,n=e.mode,l=t.child,u=l.sibling,r=Tr(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u!==null?s=Tr(u,s):(s=xo(s,n,a,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,rl(null,r),r=e.child,s=t.child.memoizedState,s===null?s=dh(a):(n=s.cachePool,n!==null?(l=et._currentValue,n=n.parent!==l?{parent:l,pool:l}:n):n=fC(),s={baseLanes:s.baseLanes|a,cachePool:n}),r.memoizedState=s,r.childLanes=fh(t,i,a),e.memoizedState=ch,rl(t.child,r)):(mn(e),a=t.child,t=a.sibling,a=Tr(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 nm(t,e){return e=id({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function id(t,e){return t=na(22,t,null,e),t.lanes=0,t}function ph(t,e,a){return Lo(e,t.child,null,a),t=nm(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function VS(t,e,a){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),jh(t.return,e,a)}function hh(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 o_(t,e,a){var r=e.pendingProps,n=r.revealOrder,o=r.tail;r=r.children;var i=Xe.current,s=(i&2)!==0;if(s?(i=i&1|2,e.flags|=128):i&=1,Te(Xe,i),vt(t,e,r,a),r=he?Cl:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&VS(t,a,e);else if(t.tag===19)VS(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&&ad(t)===null&&(n=a),a=a.sibling;a=n,a===null?(n=e.child,e.child=null):(n=a.sibling,a.sibling=null),hh(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&&ad(t)===null){e.child=n;break}t=n.sibling,n.sibling=a,a=n,n=t}hh(e,!0,a,null,o,r);break;case"together":hh(e,!1,null,null,void 0,r);break;default:e.memoizedState=null}return e.child}function Fr(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),Bn|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(Qi(t,e,a,!1),(a&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(M(153));if(e.child!==null){for(t=e.child,a=Tr(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=Tr(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function rg(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&Jc(t)))}function kR(t,e,a){switch(e.tag){case 3:Gc(e,e.stateNode.containerInfo),hn(e,et,t.memoizedState.cache),_o();break;case 27:case 5:Mh(e);break;case 4:Gc(e,e.stateNode.containerInfo);break;case 10:hn(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Kh(e),null;break;case 13:var r=e.memoizedState;if(r!==null)return r.dehydrated!==null?(mn(e),e.flags|=128,null):(a&e.child.childLanes)!==0?n_(t,e,a):(mn(e),t=Fr(t,e,a),t!==null?t.sibling:null);mn(e);break;case 19:var n=(t.flags&128)!==0;if(r=(a&e.childLanes)!==0,r||(Qi(t,e,a,!1),r=(a&e.childLanes)!==0),n){if(r)return o_(t,e,a);e.flags|=128}if(n=e.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Te(Xe,Xe.current),r)break;return null;case 22:return e.lanes=0,r_(t,e,a,e.pendingProps);case 24:hn(e,et,t.memoizedState.cache)}return Fr(t,e,a)}function i_(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)tt=!0;else{if(!rg(t,a)&&(e.flags&128)===0)return tt=!1,kR(t,e,a);tt=(t.flags&131072)!==0}else tt=!1,he&&(e.flags&1048576)!==0&&uC(e,Cl,e.index);switch(e.lanes=0,e.tag){case 16:e:{var r=e.pendingProps;if(t=go(e.elementType),e.type=t,typeof t=="function")Bm(t)?(r=Ao(t,r),e.tag=1,e=qS(null,e,t,r,a)):(e.tag=0,e=rm(null,e,t,r,a));else{if(t!=null){var n=t.$$typeof;if(n===Sm){e.tag=11,e=FS(null,e,t,r,a);break e}else if(n===Cm){e.tag=14,e=NS(null,e,t,r,a);break e}}throw e=Th(t)||t,Error(M(306,e,""))}}return e;case 0:return rm(t,e,e.type,e.pendingProps,a);case 1:return r=e.type,n=Ao(r,e.pendingProps),qS(t,e,r,n,a);case 3:e:{if(Gc(e,e.stateNode.containerInfo),t===null)throw Error(M(387));r=e.pendingProps;var o=e.memoizedState;n=o.element,Zh(t,e),dl(e,r,null,a);var i=e.memoizedState;if(r=i.cache,hn(e,et,r),r!==o.cache&&Gh(e,[et],a,!0),cl(),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=zS(t,e,r,a);break e}else if(r!==n){n=wa(Error(M(424)),e),_l(n),e=zS(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,Fe=Aa(t.firstChild),xt=e,he=!0,wn=null,La=!0,a=mC(e,null,r,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(_o(),r===n){e=Fr(t,e,a);break e}vt(t,e,r,a)}e=e.child}return e;case 26:return Hc(t,e),t===null?(a=d0(e.type,null,e.pendingProps,null))?e.memoizedState=a:he||(a=e.type,t=e.pendingProps,r=hd(_n.current).createElement(a),r[yt]=e,r[Gt]=t,St(r,a,t),pt(r),e.stateNode=r):e.memoizedState=d0(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Mh(e),t===null&&he&&(r=e.stateNode=Y_(e.type,e.pendingProps,_n.current),xt=e,La=!0,n=Fe,Nn(e.type)?(ym=n,Fe=Aa(r.firstChild)):Fe=n),vt(t,e,e.pendingProps.children,a),Hc(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&he&&((n=r=Fe)&&(r=aM(r,e.type,e.pendingProps,La),r!==null?(e.stateNode=r,xt=e,Fe=Aa(r.firstChild),La=!1,n=!0):n=!1),n||Dn(e)),Mh(e),n=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,r=o.children,hm(n,o)?r=null:i!==null&&hm(n,i)&&(e.flags|=32),e.memoizedState!==null&&(n=$m(t,e,xR,null,null,a),El._currentValue=n),Hc(t,e),vt(t,e,r,a),e.child;case 6:return t===null&&he&&((t=a=Fe)&&(a=rM(a,e.pendingProps,La),a!==null?(e.stateNode=a,xt=e,Fe=null,t=!0):t=!1),t||Dn(e)),null;case 13:return n_(t,e,a);case 4:return Gc(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Lo(e,null,r,a):vt(t,e,r,a),e.child;case 11:return FS(t,e,e.type,e.pendingProps,a);case 7:return vt(t,e,e.pendingProps,a),e.child;case 8:return vt(t,e,e.pendingProps.children,a),e.child;case 12:return vt(t,e,e.pendingProps.children,a),e.child;case 10:return r=e.pendingProps,hn(e,e.type,r.value),vt(t,e,r.children,a),e.child;case 9:return n=e.type._context,r=e.pendingProps.children,wo(e),n=bt(n),r=r(n),e.flags|=1,vt(t,e,r,a),e.child;case 14:return NS(t,e,e.type,e.pendingProps,a);case 15:return a_(t,e,e.type,e.pendingProps,a);case 19:return o_(t,e,a);case 31:return AR(t,e,a);case 22:return r_(t,e,a,e.pendingProps);case 24:return wo(e),r=bt(et),t===null?(n=Hm(),n===null&&(n=Ie,o=Pm(),n.pooledCache=o,o.refCount++,o!==null&&(n.pooledCacheLanes|=a),n=o),e.memoizedState={parent:r,cache:n},qm(e),hn(e,et,n)):((t.lanes&a)!==0&&(Zh(t,e),dl(e,null,null,a),cl()),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),hn(e,et,r)):(r=o.cache,hn(e,et,r),r!==n.cache&&Gh(e,[et],a,!0))),vt(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(M(156,e.tag))}function Sr(t){t.flags|=4}function mh(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(T_())t.flags|=8192;else throw So=ed,Um}else t.flags&=-16777217}function $S(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!J_(e))if(T_())t.flags|=8192;else throw So=ed,Um}function _c(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?R0():536870912,t.lanes|=e,ji|=e)}function Ys(t,e){if(!he)switch(t.tailMode){case"hidden":e=t.tail;for(var a=null;e!==null;)e.alternate!==null&&(a=e),e=e.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Be(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 ER(t,e,a){var r=e.pendingProps;switch(Nm(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(e),null;case 1:return Be(e),null;case 3:return a=e.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),Rr(et),Hi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(gi(e)?Sr(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,ih())),Be(e),null;case 26:var n=e.type,o=e.memoizedState;return t===null?(Sr(e),o!==null?(Be(e),$S(e,o)):(Be(e),mh(e,n,null,r,a))):o?o!==t.memoizedState?(Sr(e),Be(e),$S(e,o)):(Be(e),e.flags&=-16777217):(t=t.memoizedProps,t!==r&&Sr(e),Be(e),mh(e,n,t,r,a)),null;case 27:if(Wc(e),a=_n.current,n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&Sr(e);else{if(!r){if(e.stateNode===null)throw Error(M(166));return Be(e),null}t=sr.current,gi(e)?xS(e,t):(t=Y_(n,r,a),e.stateNode=t,Sr(e))}return Be(e),null;case 5:if(Wc(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&Sr(e);else{if(!r){if(e.stateNode===null)throw Error(M(166));return Be(e),null}if(o=sr.current,gi(e))xS(e,o);else{var i=hd(_n.current);switch(o){case 1:o=i.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:o=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":o=i.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":o=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":o=i.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof r.is=="string"?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is=="string"?i.createElement(n,{is:r.is}):i.createElement(n)}}o[yt]=e,o[Gt]=r;e:for(i=e.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}e.stateNode=o;e:switch(St(o,n,r),n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Sr(e)}}return Be(e),mh(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,a),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==r&&Sr(e);else{if(typeof r!="string"&&e.stateNode===null)throw Error(M(166));if(t=_n.current,gi(e)){if(t=e.stateNode,a=e.memoizedProps,r=null,n=xt,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}t[yt]=e,t=!!(t.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||G_(t.nodeValue,a)),t||Dn(e,!0)}else t=hd(t).createTextNode(r),t[yt]=e,e.stateNode=t}return Be(e),null;case 31:if(a=e.memoizedState,t===null||t.memoizedState!==null){if(r=gi(e),a!==null){if(t===null){if(!r)throw Error(M(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(557));t[yt]=e}else _o(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Be(e),t=!1}else a=ih(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return e.flags&256?(ra(e),e):(ra(e),null);if((e.flags&128)!==0)throw Error(M(558))}return Be(e),null;case 13:if(r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=gi(e),r!==null&&r.dehydrated!==null){if(t===null){if(!n)throw Error(M(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(M(317));n[yt]=e}else _o(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Be(e),n=!1}else n=ih(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),n=!0;if(!n)return e.flags&256?(ra(e),e):(ra(e),null)}return ra(e),(e.flags&128)!==0?(e.lanes=a,e):(a=r!==null,t=t!==null&&t.memoizedState!==null,a&&(r=e.child,n=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(n=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==n&&(r.flags|=2048)),a!==t&&a&&(e.child.flags|=8192),_c(e,e.updateQueue),Be(e),null);case 4:return Hi(),t===null&&cg(e.stateNode.containerInfo),Be(e),null;case 10:return Rr(e.type),Be(e),null;case 19:if(ht(Xe),r=e.memoizedState,r===null)return Be(e),null;if(n=(e.flags&128)!==0,o=r.rendering,o===null)if(n)Ys(r,!1);else{if(Ze!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=ad(t),o!==null){for(e.flags|=128,Ys(r,!1),t=o.updateQueue,e.updateQueue=t,_c(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)sC(a,t),a=a.sibling;return Te(Xe,Xe.current&1|2),he&&Lr(e,r.treeForkCount),e.child}t=t.sibling}r.tail!==null&&ia()>ld&&(e.flags|=128,n=!0,Ys(r,!1),e.lanes=4194304)}else{if(!n)if(t=ad(o),t!==null){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,_c(e,t),Ys(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!he)return Be(e),null}else 2*ia()-r.renderingStartTime>ld&&a!==536870912&&(e.flags|=128,n=!0,Ys(r,!1),e.lanes=4194304);r.isBackwards?(o.sibling=e.child,e.child=o):(t=r.last,t!==null?t.sibling=o:e.child=o,r.last=o)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=ia(),t.sibling=null,a=Xe.current,Te(Xe,n?a&1|2:a&1),he&&Lr(e,r.treeForkCount),t):(Be(e),null);case 22:case 23:return ra(e),zm(),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&&(Be(e),e.subtreeFlags&6&&(e.flags|=8192)):Be(e),a=e.updateQueue,a!==null&&_c(e,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),r=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),r!==a&&(e.flags|=2048),t!==null&&ht(bo),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),Rr(et),Be(e),null;case 25:return null;case 30:return null}throw Error(M(156,e.tag))}function TR(t,e){switch(Nm(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Rr(et),Hi(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Wc(e),null;case 31:if(e.memoizedState!==null){if(ra(e),e.alternate===null)throw Error(M(340));_o()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(ra(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(M(340));_o()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ht(Xe),null;case 4:return Hi(),null;case 10:return Rr(e.type),null;case 22:case 23:return ra(e),zm(),t!==null&&ht(bo),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Rr(et),null;case 25:return null;default:return null}}function s_(t,e){switch(Nm(e),e.tag){case 3:Rr(et),Hi();break;case 26:case 27:case 5:Wc(e);break;case 4:Hi();break;case 31:e.memoizedState!==null&&ra(e);break;case 13:ra(e);break;case 19:ht(Xe);break;case 10:Rr(e.type);break;case 22:case 23:ra(e),zm(),t!==null&&ht(bo);break;case 24:Rr(et)}}function Ul(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){be(e,e.return,s)}}function On(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){be(n,l,c)}}}r=r.next}while(r!==o)}}catch(c){be(e,e.return,c)}}function l_(t){var e=t.updateQueue;if(e!==null){var a=t.stateNode;try{vC(e,a)}catch(r){be(t,t.return,r)}}}function u_(t,e,a){a.props=Ao(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(r){be(t,e,r)}}function pl(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){be(t,e,n)}}function ir(t,e){var a=t.ref,r=t.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(n){be(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){be(t,e,n)}else a.current=null}function c_(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){be(t,t.return,n)}}function gh(t,e,a){try{var r=t.stateNode;YR(r,t.type,a,e),r[Gt]=e}catch(n){be(t,t.return,n)}}function d_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Nn(t.type)||t.tag===4}function vh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||d_(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&&Nn(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 om(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=kr));else if(r!==4&&(r===27&&Nn(t.type)&&(a=t.stateNode,e=null),t=t.child,t!==null))for(om(t,e,a),t=t.sibling;t!==null;)om(t,e,a),t=t.sibling}function sd(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&&Nn(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(sd(t,e,a),t=t.sibling;t!==null;)sd(t,e,a),t=t.sibling}function f_(t){var e=t.stateNode,a=t.memoizedProps;try{for(var r=t.type,n=e.attributes;n.length;)e.removeAttributeNode(n[0]);St(e,r,a),e[yt]=t,e[Gt]=a}catch(o){be(t,t.return,o)}}var Ir=!1,Je=!1,yh=!1,jS=typeof WeakSet=="function"?WeakSet:Set,ft=null;function RR(t,e){if(t=t.containerInfo,fm=yd,t=J0(t),Mm(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,h=null;t:for(;;){for(var g;d!==a||n!==0&&d.nodeType!==3||(s=i+n),d!==o||r!==0&&d.nodeType!==3||(l=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(g=d.firstChild)!==null;)h=d,d=g;for(;;){if(d===t)break t;if(h===a&&++u===n&&(s=i),h===o&&++c===r&&(l=i),(g=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=g}a=s===-1||l===-1?null:{start:s,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(pm={focusedElem:t,selectionRange:a},yd=!1,ft=e;ft!==null;)if(e=ft,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ft=t;else for(;ft!==null;){switch(e=ft,o=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)n=t[a],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&o!==null){t=void 0,a=e,n=o.memoizedProps,o=o.memoizedState,r=a.stateNode;try{var S=Ao(a.type,n);t=r.getSnapshotBeforeUpdate(S,o),r.__reactInternalSnapshotBeforeUpdate=t}catch(b){be(a,a.return,b)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,a=t.nodeType,a===9)mm(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":mm(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(M(163))}if(t=e.sibling,t!==null){t.return=e.return,ft=t;break}ft=e.return}}function p_(t,e,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:_r(t,a),r&4&&Ul(5,a);break;case 1:if(_r(t,a),r&4)if(t=a.stateNode,e===null)try{t.componentDidMount()}catch(i){be(a,a.return,i)}else{var n=Ao(a.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(n,e,t.__reactInternalSnapshotBeforeUpdate)}catch(i){be(a,a.return,i)}}r&64&&l_(a),r&512&&pl(a,a.return);break;case 3:if(_r(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{vC(t,e)}catch(i){be(a,a.return,i)}}break;case 27:e===null&&r&4&&f_(a);case 26:case 5:_r(t,a),e===null&&r&4&&c_(a),r&512&&pl(a,a.return);break;case 12:_r(t,a);break;case 31:_r(t,a),r&4&&g_(t,a);break;case 13:_r(t,a),r&4&&v_(t,a),r&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=UR.bind(null,a),nM(t,a))));break;case 22:if(r=a.memoizedState!==null||Ir,!r){e=e!==null&&e.memoizedState!==null||Je,n=Ir;var o=Je;Ir=r,(Je=e)&&!o?wr(t,a,(a.subtreeFlags&8772)!==0):_r(t,a),Ir=n,Je=o}break;case 30:break;default:_r(t,a)}}function h_(t){var e=t.alternate;e!==null&&(t.alternate=null,h_(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Im(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 Ue=null,Vt=!1;function Cr(t,e,a){for(a=a.child;a!==null;)m_(t,e,a),a=a.sibling}function m_(t,e,a){if(sa&&typeof sa.onCommitFiberUnmount=="function")try{sa.onCommitFiberUnmount(Dl,a)}catch{}switch(a.tag){case 26:Je||ir(a,e),Cr(t,e,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Je||ir(a,e);var r=Ue,n=Vt;Nn(a.type)&&(Ue=a.stateNode,Vt=!1),Cr(t,e,a),vl(a.stateNode),Ue=r,Vt=n;break;case 5:Je||ir(a,e);case 6:if(r=Ue,n=Vt,Ue=null,Cr(t,e,a),Ue=r,Vt=n,Ue!==null)if(Vt)try{(Ue.nodeType===9?Ue.body:Ue.nodeName==="HTML"?Ue.ownerDocument.body:Ue).removeChild(a.stateNode)}catch(o){be(a,e,o)}else try{Ue.removeChild(a.stateNode)}catch(o){be(a,e,o)}break;case 18:Ue!==null&&(Vt?(t=Ue,i0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Xi(t)):i0(Ue,a.stateNode));break;case 4:r=Ue,n=Vt,Ue=a.stateNode.containerInfo,Vt=!0,Cr(t,e,a),Ue=r,Vt=n;break;case 0:case 11:case 14:case 15:On(2,a,e),Je||On(4,a,e),Cr(t,e,a);break;case 1:Je||(ir(a,e),r=a.stateNode,typeof r.componentWillUnmount=="function"&&u_(a,e,r)),Cr(t,e,a);break;case 21:Cr(t,e,a);break;case 22:Je=(r=Je)||a.memoizedState!==null,Cr(t,e,a),Je=r;break;default:Cr(t,e,a)}}function g_(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Xi(t)}catch(a){be(e,e.return,a)}}}function v_(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Xi(t)}catch(a){be(e,e.return,a)}}function MR(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new jS),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new jS),e;default:throw Error(M(435,t.tag))}}function wc(t,e){var a=MR(t);e.forEach(function(r){if(!a.has(r)){a.add(r);var n=qR.bind(null,t,r);r.then(n,n)}})}function qt(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(Nn(s.type)){Ue=s.stateNode,Vt=!1;break e}break;case 5:Ue=s.stateNode,Vt=!1;break e;case 3:case 4:Ue=s.stateNode.containerInfo,Vt=!0;break e}s=s.return}if(Ue===null)throw Error(M(160));m_(o,i,n),Ue=null,Vt=!1,o=n.alternate,o!==null&&(o.return=null),n.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)y_(e,t),e=e.sibling}var Ua=null;function y_(t,e){var a=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:qt(e,t),zt(t),r&4&&(On(3,t,t.return),Ul(3,t),On(5,t,t.return));break;case 1:qt(e,t),zt(t),r&512&&(Je||a===null||ir(a,a.return)),r&64&&Ir&&(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=Ua;if(qt(e,t),zt(t),r&512&&(Je||a===null||ir(a,a.return)),r&4){var o=a!==null?a.memoizedState:null;if(r=t.memoizedState,a===null)if(r===null)if(t.stateNode===null){e:{r=t.type,a=t.memoizedProps,n=n.ownerDocument||n;t:switch(r){case"title":o=n.getElementsByTagName("title")[0],(!o||o[Fl]||o[yt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=n.createElement(r),n.head.insertBefore(o,n.querySelector("head > title"))),St(o,r,a),o[yt]=t,pt(o),r=o;break e;case"link":var i=p0("link","href",n).get(r+(a.href||""));if(i){for(var s=0;s<i.length;s++)if(o=i[s],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){i.splice(s,1);break t}}o=n.createElement(r),St(o,r,a),n.head.appendChild(o);break;case"meta":if(i=p0("meta","content",n).get(r+(a.content||""))){for(s=0;s<i.length;s++)if(o=i[s],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){i.splice(s,1);break t}}o=n.createElement(r),St(o,r,a),n.head.appendChild(o);break;default:throw Error(M(468,r))}o[yt]=t,pt(o),r=o}t.stateNode=r}else h0(n,t.type,t.stateNode);else t.stateNode=f0(n,r,t.memoizedProps);else o!==r?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,r===null?h0(n,t.type,t.stateNode):f0(n,r,t.memoizedProps)):r===null&&t.stateNode!==null&&gh(t,t.memoizedProps,a.memoizedProps)}break;case 27:qt(e,t),zt(t),r&512&&(Je||a===null||ir(a,a.return)),a!==null&&r&4&&gh(t,t.memoizedProps,a.memoizedProps);break;case 5:if(qt(e,t),zt(t),r&512&&(Je||a===null||ir(a,a.return)),t.flags&32){n=t.stateNode;try{qi(n,"")}catch(S){be(t,t.return,S)}}r&4&&t.stateNode!=null&&(n=t.memoizedProps,gh(t,n,a!==null?a.memoizedProps:n)),r&1024&&(yh=!0);break;case 6:if(qt(e,t),zt(t),r&4){if(t.stateNode===null)throw Error(M(162));r=t.memoizedProps,a=t.stateNode;try{a.nodeValue=r}catch(S){be(t,t.return,S)}}break;case 3:if(zc=null,n=Ua,Ua=md(e.containerInfo),qt(e,t),Ua=n,zt(t),r&4&&a!==null&&a.memoizedState.isDehydrated)try{Xi(e.containerInfo)}catch(S){be(t,t.return,S)}yh&&(yh=!1,x_(t));break;case 4:r=Ua,Ua=md(t.stateNode.containerInfo),qt(e,t),zt(t),Ua=r;break;case 12:qt(e,t),zt(t);break;case 31:qt(e,t),zt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,wc(t,r)));break;case 13:qt(e,t),zt(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Rd=ia()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,wc(t,r)));break;case 22:n=t.memoizedState!==null;var l=a!==null&&a.memoizedState!==null,u=Ir,c=Je;if(Ir=u||n,Je=c||l,qt(e,t),Je=c,Ir=u,zt(t),r&8192)e:for(e=t.stateNode,e._visibility=n?e._visibility&-2:e._visibility|1,n&&(a===null||l||Ir||Je||vo(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,h=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(S){be(l,l.return,S)}}}else if(e.tag===6){if(a===null){l=e;try{l.stateNode.nodeValue=n?"":l.memoizedProps}catch(S){be(l,l.return,S)}}}else if(e.tag===18){if(a===null){l=e;try{var g=l.stateNode;n?s0(g,!0):s0(l.stateNode,!1)}catch(S){be(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,wc(t,a))));break;case 19:qt(e,t),zt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,wc(t,r)));break;case 30:break;case 21:break;default:qt(e,t),zt(t)}}function zt(t){var e=t.flags;if(e&2){try{for(var a,r=t.return;r!==null;){if(d_(r)){a=r;break}r=r.return}if(a==null)throw Error(M(160));switch(a.tag){case 27:var n=a.stateNode,o=vh(t);sd(t,o,n);break;case 5:var i=a.stateNode;a.flags&32&&(qi(i,""),a.flags&=-33);var s=vh(t);sd(t,s,i);break;case 3:case 4:var l=a.stateNode.containerInfo,u=vh(t);om(t,u,l);break;default:throw Error(M(161))}}catch(c){be(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function x_(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;x_(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function _r(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)p_(t,e.alternate,e),e=e.sibling}function vo(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:On(4,e,e.return),vo(e);break;case 1:ir(e,e.return);var a=e.stateNode;typeof a.componentWillUnmount=="function"&&u_(e,e.return,a),vo(e);break;case 27:vl(e.stateNode);case 26:case 5:ir(e,e.return),vo(e);break;case 22:e.memoizedState===null&&vo(e);break;case 30:vo(e);break;default:vo(e)}t=t.sibling}}function wr(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:wr(n,o,a),Ul(4,o);break;case 1:if(wr(n,o,a),r=o,n=r.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(u){be(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++)gC(l[n],s)}catch(u){be(r,r.return,u)}}a&&i&64&&l_(o),pl(o,o.return);break;case 27:f_(o);case 26:case 5:wr(n,o,a),a&&r===null&&i&4&&c_(o),pl(o,o.return);break;case 12:wr(n,o,a);break;case 31:wr(n,o,a),a&&i&4&&g_(n,o);break;case 13:wr(n,o,a),a&&i&4&&v_(n,o);break;case 22:o.memoizedState===null&&wr(n,o,a),pl(o,o.return);break;case 30:break;default:wr(n,o,a)}e=e.sibling}}function ng(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&&Pl(a))}function og(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Pl(t))}function Ha(t,e,a,r){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)b_(t,e,a,r),e=e.sibling}function b_(t,e,a,r){var n=e.flags;switch(e.tag){case 0:case 11:case 15:Ha(t,e,a,r),n&2048&&Ul(9,e);break;case 1:Ha(t,e,a,r);break;case 3:Ha(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&&Pl(t)));break;case 12:if(n&2048){Ha(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){be(e,e.return,l)}}else Ha(t,e,a,r);break;case 31:Ha(t,e,a,r);break;case 13:Ha(t,e,a,r);break;case 23:break;case 22:o=e.stateNode,i=e.alternate,e.memoizedState!==null?o._visibility&2?Ha(t,e,a,r):hl(t,e):o._visibility&2?Ha(t,e,a,r):(o._visibility|=2,yi(t,e,a,r,(e.subtreeFlags&10256)!==0||!1)),n&2048&&ng(i,e);break;case 24:Ha(t,e,a,r),n&2048&&og(e.alternate,e);break;default:Ha(t,e,a,r)}}function yi(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:yi(o,i,s,l,n),Ul(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?yi(o,i,s,l,n):hl(o,i):(c._visibility|=2,yi(o,i,s,l,n)),n&&u&2048&&ng(i.alternate,i);break;case 24:yi(o,i,s,l,n),n&&u&2048&&og(i.alternate,i);break;default:yi(o,i,s,l,n)}e=e.sibling}}function hl(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:hl(a,r),n&2048&&ng(r.alternate,r);break;case 24:hl(a,r),n&2048&&og(r.alternate,r);break;default:hl(a,r)}e=e.sibling}}var nl=8192;function vi(t,e,a){if(t.subtreeFlags&nl)for(t=t.child;t!==null;)S_(t,e,a),t=t.sibling}function S_(t,e,a){switch(t.tag){case 26:vi(t,e,a),t.flags&nl&&t.memoizedState!==null&&gM(a,Ua,t.memoizedState,t.memoizedProps);break;case 5:vi(t,e,a);break;case 3:case 4:var r=Ua;Ua=md(t.stateNode.containerInfo),vi(t,e,a),Ua=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=nl,nl=16777216,vi(t,e,a),nl=r):vi(t,e,a));break;default:vi(t,e,a)}}function C_(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 Ks(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var r=e[a];ft=r,w_(r,t)}C_(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)__(t),t=t.sibling}function __(t){switch(t.tag){case 0:case 11:case 15:Ks(t),t.flags&2048&&On(9,t,t.return);break;case 3:Ks(t);break;case 12:Ks(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Uc(t)):Ks(t);break;default:Ks(t)}}function Uc(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var r=e[a];ft=r,w_(r,t)}C_(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:On(8,e,e.return),Uc(e);break;case 22:a=e.stateNode,a._visibility&2&&(a._visibility&=-3,Uc(e));break;default:Uc(e)}t=t.sibling}}function w_(t,e){for(;ft!==null;){var a=ft;switch(a.tag){case 0:case 11:case 15:On(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:Pl(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,ft=r;else e:for(a=t;ft!==null;){r=ft;var n=r.sibling,o=r.return;if(h_(r),r===a){ft=null;break e}if(n!==null){n.return=o,ft=n;break e}ft=o}}}var DR={getCacheForType:function(t){var e=bt(et),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a},cacheSignal:function(){return bt(et).controller.signal}},OR=typeof WeakMap=="function"?WeakMap:Map,ve=0,Ie=null,ce=null,pe=0,xe=0,aa=null,bn=!1,es=!1,ig=!1,Nr=0,Ze=0,Bn=0,Co=0,sg=0,oa=0,ji=0,ml=null,$t=null,im=!1,Rd=0,L_=0,ld=1/0,ud=null,An=null,nt=0,kn=null,Gi=null,Mr=0,sm=0,lm=null,I_=null,gl=0,um=null;function ua(){return(ve&2)!==0&&pe!==0?pe&-pe:ee.T!==null?ug():B0()}function A_(){if(oa===0)if((pe&536870912)===0||he){var t=hc;hc<<=1,(hc&3932160)===0&&(hc=262144),oa=t}else oa=536870912;return t=da.current,t!==null&&(t.flags|=32),oa}function jt(t,e,a){(t===Ie&&(xe===2||xe===9)||t.cancelPendingCommit!==null)&&(Wi(t,0),Sn(t,pe,oa,!1)),Bl(t,a),((ve&2)===0||t!==Ie)&&(t===Ie&&((ve&2)===0&&(Co|=a),Ze===4&&Sn(t,pe,oa,!1)),ur(t))}function k_(t,e,a){if((ve&6)!==0)throw Error(M(327));var r=!a&&(e&127)===0&&(e&t.expiredLanes)===0||Ol(t,e),n=r?NR(t,e):xh(t,e,!0),o=r;do{if(n===0){es&&!r&&Sn(t,e,0,!1);break}else{if(a=t.current.alternate,o&&!BR(a)){n=xh(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&&(Wi(s,i).flags|=256),i=xh(s,i,!1),i!==2){if(ig&&!l){s.errorRecoveryDisabledLanes|=o,Co|=o,n=4;break e}o=$t,$t=n,o!==null&&($t===null?$t=o:$t.push.apply($t,o))}n=i}if(o=!1,n!==2)continue}}if(n===1){Wi(t,0),Sn(t,e,0,!0);break}e:{switch(r=t,o=n,o){case 0:case 1:throw Error(M(345));case 4:if((e&4194048)!==e)break;case 6:Sn(r,e,oa,!bn);break e;case 2:$t=null;break;case 3:case 5:break;default:throw Error(M(329))}if((e&62914560)===e&&(n=Rd+300-ia(),10<n)){if(Sn(r,e,oa,!bn),bd(r,0,!0)!==0)break e;Mr=e,r.timeoutHandle=Z_(GS.bind(null,r,a,$t,ud,im,e,oa,Co,ji,bn,o,"Throttled",-0,0),n);break e}GS(r,a,$t,ud,im,e,oa,Co,ji,bn,o,null,-0,0)}}break}while(!0);ur(t)}function GS(t,e,a,r,n,o,i,s,l,u,c,d,h,g){if(t.timeoutHandle=-1,d=e.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kr},S_(e,o,d);var S=(o&62914560)===o?Rd-ia():(o&4194048)===o?L_-ia():0;if(S=vM(d,S),S!==null){Mr=o,t.cancelPendingCommit=S(ZS.bind(null,t,e,o,a,r,n,i,s,l,c,d,null,h,g)),Sn(t,o,i,!u);return}}ZS(t,e,o,a,r,n,i,s,l)}function BR(t){for(var e=t;;){var a=e.tag;if((a===0||a===11||a===15)&&e.flags&16384&&(a=e.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var n=a[r],o=n.getSnapshot;n=n.value;try{if(!ca(o(),n))return!1}catch{return!1}}if(a=e.child,e.subtreeFlags&16384&&a!==null)a.return=e,e=a;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Sn(t,e,a,r){e&=~sg,e&=~Co,t.suspendedLanes|=e,t.pingedLanes&=~e,r&&(t.warmLanes|=e),r=t.expirationTimes;for(var n=e;0<n;){var o=31-la(n),i=1<<o;r[o]=-1,n&=~i}a!==0&&M0(t,a,e)}function Md(){return(ve&6)===0?(ql(0,!1),!1):!0}function lg(){if(ce!==null){if(xe===0)var t=ce.return;else t=ce,Er=Mo=null,Wm(t),Fi=null,wl=0,t=ce;for(;t!==null;)s_(t.alternate,t),t=t.return;ce=null}}function Wi(t,e){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,JR(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Mr=0,lg(),Ie=t,ce=a=Tr(t.current,null),pe=e,xe=0,aa=null,bn=!1,es=Ol(t,e),ig=!1,ji=oa=sg=Co=Bn=Ze=0,$t=ml=null,im=!1,(e&8)!==0&&(e|=e&32);var r=t.entangledLanes;if(r!==0)for(t=t.entanglements,r&=e;0<r;){var n=31-la(r),o=1<<n;e|=t[n],r&=~o}return Nr=e,wd(),a}function E_(t,e){ie=null,ee.H=Il,e===Ji||e===Id?(e=wS(),xe=3):e===Um?(e=wS(),xe=4):xe=e===ag?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,aa=e,ce===null&&(Ze=1,od(t,wa(e,t.current)))}function T_(){var t=da.current;return t===null?!0:(pe&4194048)===pe?Ia===null:(pe&62914560)===pe||(pe&536870912)!==0?t===Ia:!1}function R_(){var t=ee.H;return ee.H=Il,t===null?Il:t}function M_(){var t=ee.A;return ee.A=DR,t}function cd(){Ze=4,bn||(pe&4194048)!==pe&&da.current!==null||(es=!0),(Bn&134217727)===0&&(Co&134217727)===0||Ie===null||Sn(Ie,pe,oa,!1)}function xh(t,e,a){var r=ve;ve|=2;var n=R_(),o=M_();(Ie!==t||pe!==e)&&(ud=null,Wi(t,e)),e=!1;var i=Ze;e:do try{if(xe!==0&&ce!==null){var s=ce,l=aa;switch(xe){case 8:lg(),i=6;break e;case 3:case 2:case 9:case 6:da.current===null&&(e=!0);var u=xe;if(xe=0,aa=null,Ri(t,s,l,u),a&&es){i=0;break e}break;default:u=xe,xe=0,aa=null,Ri(t,s,l,u)}}FR(),i=Ze;break}catch(c){E_(t,c)}while(!0);return e&&t.shellSuspendCounter++,Er=Mo=null,ve=r,ee.H=n,ee.A=o,ce===null&&(Ie=null,pe=0,wd()),i}function FR(){for(;ce!==null;)D_(ce)}function NR(t,e){var a=ve;ve|=2;var r=R_(),n=M_();Ie!==t||pe!==e?(ud=null,ld=ia()+500,Wi(t,e)):es=Ol(t,e);e:do try{if(xe!==0&&ce!==null){e=ce;var o=aa;t:switch(xe){case 1:xe=0,aa=null,Ri(t,e,o,1);break;case 2:case 9:if(_S(o)){xe=0,aa=null,WS(e);break}e=function(){xe!==2&&xe!==9||Ie!==t||(xe=7),ur(t)},o.then(e,e);break e;case 3:xe=7;break e;case 4:xe=5;break e;case 7:_S(o)?(xe=0,aa=null,WS(e)):(xe=0,aa=null,Ri(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?J_(i):s.stateNode.complete){xe=0,aa=null;var l=s.sibling;if(l!==null)ce=l;else{var u=s.return;u!==null?(ce=u,Dd(u)):ce=null}break t}}xe=0,aa=null,Ri(t,e,o,5);break;case 6:xe=0,aa=null,Ri(t,e,o,6);break;case 8:lg(),Ze=6;break e;default:throw Error(M(462))}}PR();break}catch(c){E_(t,c)}while(!0);return Er=Mo=null,ee.H=r,ee.A=n,ve=a,ce!==null?0:(Ie=null,pe=0,wd(),Ze)}function PR(){for(;ce!==null&&!sT();)D_(ce)}function D_(t){var e=i_(t.alternate,t,Nr);t.memoizedProps=t.pendingProps,e===null?Dd(t):ce=e}function WS(t){var e=t,a=e.alternate;switch(e.tag){case 15:case 0:e=US(a,e,e.pendingProps,e.type,void 0,pe);break;case 11:e=US(a,e,e.pendingProps,e.type.render,e.ref,pe);break;case 5:Wm(e);default:s_(a,e),e=ce=sC(e,Nr),e=i_(a,e,Nr)}t.memoizedProps=t.pendingProps,e===null?Dd(t):ce=e}function Ri(t,e,a,r){Er=Mo=null,Wm(e),Fi=null,wl=0;var n=e.return;try{if(IR(t,n,e,a,pe)){Ze=1,od(t,wa(a,t.current)),ce=null;return}}catch(o){if(n!==null)throw ce=n,o;Ze=1,od(t,wa(a,t.current)),ce=null;return}e.flags&32768?(he||r===1?t=!0:es||(pe&536870912)!==0?t=!1:(bn=t=!0,(r===2||r===9||r===3||r===6)&&(r=da.current,r!==null&&r.tag===13&&(r.flags|=16384))),O_(e,t)):Dd(e)}function Dd(t){var e=t;do{if((e.flags&32768)!==0){O_(e,bn);return}t=e.return;var a=ER(e.alternate,e,Nr);if(a!==null){ce=a;return}if(e=e.sibling,e!==null){ce=e;return}ce=e=t}while(e!==null);Ze===0&&(Ze=5)}function O_(t,e){do{var a=TR(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);Ze=6,ce=null}function ZS(t,e,a,r,n,o,i,s,l){t.cancelPendingCommit=null;do Od();while(nt!==0);if((ve&6)!==0)throw Error(M(327));if(e!==null){if(e===t.current)throw Error(M(177));if(o=e.lanes|e.childLanes,o|=Dm,vT(t,a,o,i,s,l),t===Ie&&(ce=Ie=null,pe=0),Gi=e,kn=t,Mr=a,sm=o,lm=n,I_=r,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,zR(Zc,function(){return H_(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||r){r=ee.T,ee.T=null,n=ye.p,ye.p=2,i=ve,ve|=4;try{RR(t,e,a)}finally{ve=i,ye.p=n,ee.T=r}}nt=1,B_(),F_(),N_()}}function B_(){if(nt===1){nt=0;var t=kn,e=Gi,a=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||a){a=ee.T,ee.T=null;var r=ye.p;ye.p=2;var n=ve;ve|=4;try{y_(e,t);var o=pm,i=J0(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(i!==s&&s&&s.ownerDocument&&Q0(s.ownerDocument.documentElement,s)){if(l!==null&&Mm(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,h=d&&d.defaultView||window;if(h.getSelection){var g=h.getSelection(),S=s.textContent.length,b=Math.min(l.start,S),x=l.end===void 0?b:Math.min(l.end,S);!g.extend&&b>x&&(i=x,x=b,b=i);var f=gS(s,b),m=gS(s,x);if(f&&m&&(g.rangeCount!==1||g.anchorNode!==f.node||g.anchorOffset!==f.offset||g.focusNode!==m.node||g.focusOffset!==m.offset)){var v=d.createRange();v.setStart(f.node,f.offset),g.removeAllRanges(),b>x?(g.addRange(v),g.extend(m.node,m.offset)):(v.setEnd(m.node,m.offset),g.addRange(v))}}}}for(d=[],g=s;g=g.parentNode;)g.nodeType===1&&d.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<d.length;s++){var y=d[s];y.element.scrollLeft=y.left,y.element.scrollTop=y.top}}yd=!!fm,pm=fm=null}finally{ve=n,ye.p=r,ee.T=a}}t.current=e,nt=2}}function F_(){if(nt===2){nt=0;var t=kn,e=Gi,a=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||a){a=ee.T,ee.T=null;var r=ye.p;ye.p=2;var n=ve;ve|=4;try{p_(t,e.alternate,e)}finally{ve=n,ye.p=r,ee.T=a}}nt=3}}function N_(){if(nt===4||nt===3){nt=0,lT();var t=kn,e=Gi,a=Mr,r=I_;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?nt=5:(nt=0,Gi=kn=null,P_(t,t.pendingLanes));var n=t.pendingLanes;if(n===0&&(An=null),Lm(a),e=e.stateNode,sa&&typeof sa.onCommitFiberRoot=="function")try{sa.onCommitFiberRoot(Dl,e,void 0,(e.current.flags&128)===128)}catch{}if(r!==null){e=ee.T,n=ye.p,ye.p=2,ee.T=null;try{for(var o=t.onRecoverableError,i=0;i<r.length;i++){var s=r[i];o(s.value,{componentStack:s.stack})}}finally{ee.T=e,ye.p=n}}(Mr&3)!==0&&Od(),ur(t),n=t.pendingLanes,(a&261930)!==0&&(n&42)!==0?t===um?gl++:(gl=0,um=t):gl=0,ql(0,!1)}}function P_(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Pl(e)))}function Od(){return B_(),F_(),N_(),H_()}function H_(){if(nt!==5)return!1;var t=kn,e=sm;sm=0;var a=Lm(Mr),r=ee.T,n=ye.p;try{ye.p=32>a?32:a,ee.T=null,a=lm,lm=null;var o=kn,i=Mr;if(nt=0,Gi=kn=null,Mr=0,(ve&6)!==0)throw Error(M(331));var s=ve;if(ve|=4,__(o.current),b_(o,o.current,i,a),ve=s,ql(0,!1),sa&&typeof sa.onPostCommitFiberRoot=="function")try{sa.onPostCommitFiberRoot(Dl,o)}catch{}return!0}finally{ye.p=n,ee.T=r,P_(t,e)}}function XS(t,e,a){e=wa(a,e),e=am(t.stateNode,e,2),t=In(t,e,2),t!==null&&(Bl(t,2),ur(t))}function be(t,e,a){if(t.tag===3)XS(t,t,a);else for(;e!==null;){if(e.tag===3){XS(e,t,a);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(An===null||!An.has(r))){t=wa(a,t),a=e_(2),r=In(e,a,2),r!==null&&(t_(a,r,e,t),Bl(r,2),ur(r));break}}e=e.return}}function bh(t,e,a){var r=t.pingCache;if(r===null){r=t.pingCache=new OR;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)||(ig=!0,n.add(a),t=HR.bind(null,t,e,a),e.then(t,t))}function HR(t,e,a){var r=t.pingCache;r!==null&&r.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Ie===t&&(pe&a)===a&&(Ze===4||Ze===3&&(pe&62914560)===pe&&300>ia()-Rd?(ve&2)===0&&Wi(t,0):sg|=a,ji===pe&&(ji=0)),ur(t)}function U_(t,e){e===0&&(e=R0()),t=Ro(t,e),t!==null&&(Bl(t,e),ur(t))}function UR(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),U_(t,a)}function qR(t,e){var a=0;switch(t.tag){case 31:case 13:var r=t.stateNode,n=t.memoizedState;n!==null&&(a=n.retryLane);break;case 19:r=t.stateNode;break;case 22:r=t.stateNode._retryCache;break;default:throw Error(M(314))}r!==null&&r.delete(e),U_(t,a)}function zR(t,e){return _m(t,e)}var dd=null,xi=null,cm=!1,fd=!1,Sh=!1,Cn=0;function ur(t){t!==xi&&t.next===null&&(xi===null?dd=xi=t:xi=xi.next=t),fd=!0,cm||(cm=!0,$R())}function ql(t,e){if(!Sh&&fd){Sh=!0;do for(var a=!1,r=dd;r!==null;){if(!e)if(t!==0){var n=r.pendingLanes;if(n===0)var o=0;else{var i=r.suspendedLanes,s=r.pingedLanes;o=(1<<31-la(42|t)+1)-1,o&=n&~(i&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,YS(r,o))}else o=pe,o=bd(r,r===Ie?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(o&3)===0||Ol(r,o)||(a=!0,YS(r,o));r=r.next}while(a);Sh=!1}}function VR(){q_()}function q_(){fd=cm=!1;var t=0;Cn!==0&&QR()&&(t=Cn);for(var e=ia(),a=null,r=dd;r!==null;){var n=r.next,o=z_(r,e);o===0?(r.next=null,a===null?dd=n:a.next=n,n===null&&(xi=a)):(a=r,(t!==0||(o&3)!==0)&&(fd=!0)),r=n}nt!==0&&nt!==5||ql(t,!1),Cn!==0&&(Cn=0)}function z_(t,e){for(var a=t.suspendedLanes,r=t.pingedLanes,n=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var i=31-la(o),s=1<<i,l=n[i];l===-1?((s&a)===0||(s&r)!==0)&&(n[i]=gT(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Ie,a=pe,a=bd(t,t===e?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,a===0||t===e&&(xe===2||xe===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&Yp(r),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Ol(t,a)){if(e=a&-a,e===t.callbackPriority)return e;switch(r!==null&&Yp(r),Lm(a)){case 2:case 8:a=E0;break;case 32:a=Zc;break;case 268435456:a=T0;break;default:a=Zc}return r=V_.bind(null,t),a=_m(a,r),t.callbackPriority=e,t.callbackNode=a,e}return r!==null&&r!==null&&Yp(r),t.callbackPriority=2,t.callbackNode=null,2}function V_(t,e){if(nt!==0&&nt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Od()&&t.callbackNode!==a)return null;var r=pe;return r=bd(t,t===Ie?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(k_(t,r,e),z_(t,ia()),t.callbackNode!=null&&t.callbackNode===a?V_.bind(null,t):null)}function YS(t,e){if(Od())return null;k_(t,e,!0)}function $R(){eM(function(){(ve&6)!==0?_m(k0,VR):q_()})}function ug(){if(Cn===0){var t=zi;t===0&&(t=pc,pc<<=1,(pc&261888)===0&&(pc=256)),Cn=t}return Cn}function KS(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Rc(""+t)}function QS(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 jR(t,e,a,r,n){if(e==="submit"&&a&&a.stateNode===n){var o=KS((n[Gt]||null).action),i=r.submitter;i&&(e=(e=i[Gt]||null)?KS(e.formAction):i.getAttribute("formAction"),e!==null&&(o=e,i=null));var s=new Sd("action","action",null,r,n);t.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Cn!==0){var l=i?QS(n,i):new FormData(n);em(a,{pending:!0,data:l,method:n.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=i?QS(n,i):new FormData(n),em(a,{pending:!0,data:l,method:n.method,action:o},o,l))},currentTarget:n}]})}}for(Lc=0;Lc<zh.length;Lc++)Ic=zh[Lc],JS=Ic.toLowerCase(),e0=Ic[0].toUpperCase()+Ic.slice(1),qa(JS,"on"+e0);var Ic,JS,e0,Lc;qa(tC,"onAnimationEnd");qa(aC,"onAnimationIteration");qa(rC,"onAnimationStart");qa("dblclick","onDoubleClick");qa("focusin","onFocus");qa("focusout","onBlur");qa(uR,"onTransitionRun");qa(cR,"onTransitionStart");qa(dR,"onTransitionCancel");qa(nC,"onTransitionEnd");Ui("onMouseEnter",["mouseout","mouseover"]);Ui("onMouseLeave",["mouseout","mouseover"]);Ui("onPointerEnter",["pointerout","pointerover"]);Ui("onPointerLeave",["pointerout","pointerover"]);ko("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ko("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ko("onBeforeInput",["compositionend","keypress","textInput","paste"]);ko("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ko("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ko("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Al="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(" "),GR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Al));function $_(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){Yc(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){Yc(c)}n.currentTarget=null,o=l}}}}function ue(t,e){var a=e[Oh];a===void 0&&(a=e[Oh]=new Set);var r=t+"__bubble";a.has(r)||(j_(e,t,2,!1),a.add(r))}function Ch(t,e,a){var r=0;e&&(r|=4),j_(a,t,r,e)}var Ac="_reactListening"+Math.random().toString(36).slice(2);function cg(t){if(!t[Ac]){t[Ac]=!0,F0.forEach(function(a){a!=="selectionchange"&&(GR.has(a)||Ch(a,!1,t),Ch(a,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Ac]||(e[Ac]=!0,Ch("selectionchange",!1,e))}}function j_(t,e,a,r){switch(nw(e)){case 2:var n=bM;break;case 8:n=SM;break;default:n=hg}a=n.bind(null,e,a,t),n=void 0,!Hh||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 _h(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=Ci(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}$0(function(){var u=o,c=km(a),d=[];e:{var h=oC.get(t);if(h!==void 0){var g=Sd,S=t;switch(t){case"keypress":if(Dc(a)===0)break e;case"keydown":case"keyup":g=qT;break;case"focusin":S="focus",g=th;break;case"focusout":S="blur",g=th;break;case"beforeblur":case"afterblur":g=th;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=sS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=ET;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=$T;break;case tC:case aC:case rC:g=MT;break;case nC:g=GT;break;case"scroll":case"scrollend":g=AT;break;case"wheel":g=ZT;break;case"copy":case"cut":case"paste":g=OT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=uS;break;case"toggle":case"beforetoggle":g=YT}var b=(e&4)!==0,x=!b&&(t==="scroll"||t==="scrollend"),f=b?h!==null?h+"Capture":null:h;b=[];for(var m=u,v;m!==null;){var y=m;if(v=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||v===null||f===null||(y=xl(m,f),y!=null&&b.push(kl(m,y,v))),x)break;m=m.return}0<b.length&&(h=new g(h,S,null,a,c),d.push({event:h,listeners:b}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",g=t==="mouseout"||t==="pointerout",h&&a!==Ph&&(S=a.relatedTarget||a.fromElement)&&(Ci(S)||S[Yi]))break e;if((g||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,g?(S=a.relatedTarget||a.toElement,g=u,S=S?Ci(S):null,S!==null&&(x=Ml(S),b=S.tag,S!==x||b!==5&&b!==27&&b!==6)&&(S=null)):(g=null,S=u),g!==S)){if(b=sS,y="onMouseLeave",f="onMouseEnter",m="mouse",(t==="pointerout"||t==="pointerover")&&(b=uS,y="onPointerLeave",f="onPointerEnter",m="pointer"),x=g==null?h:al(g),v=S==null?h:al(S),h=new b(y,m+"leave",g,a,c),h.target=x,h.relatedTarget=v,y=null,Ci(c)===u&&(b=new b(f,m+"enter",S,a,c),b.target=v,b.relatedTarget=x,y=b),x=y,g&&S)t:{for(b=WR,f=g,m=S,v=0,y=f;y;y=b(y))v++;y=0;for(var _=m;_;_=b(_))y++;for(;0<v-y;)f=b(f),v--;for(;0<y-v;)m=b(m),y--;for(;v--;){if(f===m||m!==null&&f===m.alternate){b=f;break t}f=b(f),m=b(m)}b=null}else b=null;g!==null&&t0(d,h,g,b,!1),S!==null&&x!==null&&t0(d,x,S,b,!0)}}e:{if(h=u?al(u):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var w=pS;else if(fS(h))if(Y0)w=iR;else{w=nR;var C=rR}else g=h.nodeName,!g||g.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?u&&Am(u.elementType)&&(w=pS):w=oR;if(w&&(w=w(t,u))){X0(d,w,a,c);break e}C&&C(t,h,u),t==="focusout"&&u&&h.type==="number"&&u.memoizedProps.value!=null&&Nh(h,"number",h.value)}switch(C=u?al(u):window,t){case"focusin":(fS(C)||C.contentEditable==="true")&&(Li=C,Uh=u,sl=null);break;case"focusout":sl=Uh=Li=null;break;case"mousedown":qh=!0;break;case"contextmenu":case"mouseup":case"dragend":qh=!1,vS(d,a,c);break;case"selectionchange":if(lR)break;case"keydown":case"keyup":vS(d,a,c)}var A;if(Rm)e:{switch(t){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else wi?W0(t,a)&&(E="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(E="onCompositionStart");E&&(G0&&a.locale!=="ko"&&(wi||E!=="onCompositionStart"?E==="onCompositionEnd"&&wi&&(A=j0()):(xn=c,Em="value"in xn?xn.value:xn.textContent,wi=!0)),C=pd(u,E),0<C.length&&(E=new lS(E,t,null,a,c),d.push({event:E,listeners:C}),A?E.data=A:(A=Z0(a),A!==null&&(E.data=A)))),(A=QT?JT(t,a):eR(t,a))&&(E=pd(u,"onBeforeInput"),0<E.length&&(C=new lS("onBeforeInput","beforeinput",null,a,c),d.push({event:C,listeners:E}),C.data=A)),jR(d,t,u,a,c)}$_(d,e)})}function kl(t,e,a){return{instance:t,listener:e,currentTarget:a}}function pd(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=xl(t,a),n!=null&&r.unshift(kl(t,n,o)),n=xl(t,e),n!=null&&r.push(kl(t,n,o))),t.tag===3)return r;t=t.return}return[]}function WR(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function t0(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=xl(a,o),u!=null&&i.unshift(kl(a,u,l))):n||(u=xl(a,o),u!=null&&i.push(kl(a,u,l)))),a=a.return}i.length!==0&&t.push({event:e,listeners:i})}var ZR=/\r\n?/g,XR=/\u0000|\uFFFD/g;function a0(t){return(typeof t=="string"?t:""+t).replace(ZR,`
|
|
9
|
+
`).replace(XR,"")}function G_(t,e){return e=a0(e),a0(t)===e}function _e(t,e,a,r,n,o){switch(a){case"children":typeof r=="string"?e==="body"||e==="textarea"&&r===""||qi(t,r):(typeof r=="number"||typeof r=="bigint")&&e!=="body"&&qi(t,""+r);break;case"className":gc(t,"class",r);break;case"tabIndex":gc(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":gc(t,a,r);break;case"style":V0(t,r,o);break;case"data":if(e!=="object"){gc(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=Rc(""+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"&&_e(t,e,"name",n.name,n,null),_e(t,e,"formEncType",n.formEncType,n,null),_e(t,e,"formMethod",n.formMethod,n,null),_e(t,e,"formTarget",n.formTarget,n,null)):(_e(t,e,"encType",n.encType,n,null),_e(t,e,"method",n.method,n,null),_e(t,e,"target",n.target,n,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=Rc(""+r),t.setAttribute(a,r);break;case"onClick":r!=null&&(t.onclick=kr);break;case"onScroll":r!=null&&ue("scroll",t);break;case"onScrollEnd":r!=null&&ue("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(M(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(M(60));t.innerHTML=a}}break;case"multiple":t.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":t.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){t.removeAttribute("xlink:href");break}a=Rc(""+r),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,""+r):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":r===!0?t.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,r):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?t.setAttribute(a,r):t.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?t.removeAttribute(a):t.setAttribute(a,r);break;case"popover":ue("beforetoggle",t),ue("toggle",t),Tc(t,"popover",r);break;case"xlinkActuate":br(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":br(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":br(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":br(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":br(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":br(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":br(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":br(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":br(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Tc(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=LT.get(a)||a,Tc(t,a,r))}}function dm(t,e,a,r,n,o){switch(a){case"style":V0(t,r,o);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(M(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(M(60));t.innerHTML=a}}break;case"children":typeof r=="string"?qi(t,r):(typeof r=="number"||typeof r=="bigint")&&qi(t,""+r);break;case"onScroll":r!=null&&ue("scroll",t);break;case"onScrollEnd":r!=null&&ue("scrollend",t);break;case"onClick":r!=null&&(t.onclick=kr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!N0.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[Gt]||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,""):Tc(t,a,r)}}}function St(t,e,a){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ue("error",t),ue("load",t);var r=!1,n=!1,o;for(o in a)if(a.hasOwnProperty(o)){var i=a[o];if(i!=null)switch(o){case"src":r=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(M(137,e));default:_e(t,e,o,i,a,null)}}n&&_e(t,e,"srcSet",a.srcSet,a,null),r&&_e(t,e,"src",a.src,a,null);return;case"input":ue("invalid",t);var s=o=i=n=null,l=null,u=null;for(r in a)if(a.hasOwnProperty(r)){var c=a[r];if(c!=null)switch(r){case"name":n=c;break;case"type":i=c;break;case"checked":l=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":s=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(M(137,e));break;default:_e(t,e,r,c,a,null)}}U0(t,o,s,l,u,i,n,!1);return;case"select":ue("invalid",t),r=i=o=null;for(n in a)if(a.hasOwnProperty(n)&&(s=a[n],s!=null))switch(n){case"value":o=s;break;case"defaultValue":i=s;break;case"multiple":r=s;default:_e(t,e,n,s,a,null)}e=o,a=i,t.multiple=!!r,e!=null?Di(t,!!r,e,!1):a!=null&&Di(t,!!r,a,!0);return;case"textarea":ue("invalid",t),o=n=r=null;for(i in a)if(a.hasOwnProperty(i)&&(s=a[i],s!=null))switch(i){case"value":r=s;break;case"defaultValue":n=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(M(91));break;default:_e(t,e,i,s,a,null)}z0(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":_e(t,e,l,r,a,null));return;case"dialog":ue("beforetoggle",t),ue("toggle",t),ue("cancel",t),ue("close",t);break;case"iframe":case"object":ue("load",t);break;case"video":case"audio":for(r=0;r<Al.length;r++)ue(Al[r],t);break;case"image":ue("error",t),ue("load",t);break;case"details":ue("toggle",t);break;case"embed":case"source":case"link":ue("error",t),ue("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in a)if(a.hasOwnProperty(u)&&(r=a[u],r!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(M(137,e));default:_e(t,e,u,r,a,null)}return;default:if(Am(e)){for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!==void 0&&dm(t,e,c,r,a,void 0));return}}for(s in a)a.hasOwnProperty(s)&&(r=a[s],r!=null&&_e(t,e,s,r,a,null))}function YR(t,e,a,r){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,o=null,i=null,s=null,l=null,u=null,c=null;for(g in a){var d=a[g];if(a.hasOwnProperty(g)&&d!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":l=d;default:r.hasOwnProperty(g)||_e(t,e,g,null,r,d)}}for(var h in r){var g=r[h];if(d=a[h],r.hasOwnProperty(h)&&(g!=null||d!=null))switch(h){case"type":o=g;break;case"name":n=g;break;case"checked":u=g;break;case"defaultChecked":c=g;break;case"value":i=g;break;case"defaultValue":s=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(M(137,e));break;default:g!==d&&_e(t,e,h,g,r,d)}}Fh(t,i,s,l,u,c,o,n);return;case"select":g=i=s=h=null;for(o in a)if(l=a[o],a.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":g=l;default:r.hasOwnProperty(o)||_e(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":h=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:o!==l&&_e(t,e,n,o,r,l)}e=s,a=i,r=g,h!=null?Di(t,!!a,h,!1):!!r!=!!a&&(e!=null?Di(t,!!a,e,!0):Di(t,!!a,a?[]:"",!1));return;case"textarea":g=h=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:_e(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":h=n;break;case"defaultValue":g=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(M(91));break;default:n!==o&&_e(t,e,i,n,r,o)}q0(t,h,g);return;case"option":for(var S in a)h=a[S],a.hasOwnProperty(S)&&h!=null&&!r.hasOwnProperty(S)&&(S==="selected"?t.selected=!1:_e(t,e,S,null,r,h));for(l in r)h=r[l],g=a[l],r.hasOwnProperty(l)&&h!==g&&(h!=null||g!=null)&&(l==="selected"?t.selected=h&&typeof h!="function"&&typeof h!="symbol":_e(t,e,l,h,r,g));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in a)h=a[b],a.hasOwnProperty(b)&&h!=null&&!r.hasOwnProperty(b)&&_e(t,e,b,null,r,h);for(u in r)if(h=r[u],g=a[u],r.hasOwnProperty(u)&&h!==g&&(h!=null||g!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(M(137,e));break;default:_e(t,e,u,h,r,g)}return;default:if(Am(e)){for(var x in a)h=a[x],a.hasOwnProperty(x)&&h!==void 0&&!r.hasOwnProperty(x)&&dm(t,e,x,void 0,r,h);for(c in r)h=r[c],g=a[c],!r.hasOwnProperty(c)||h===g||h===void 0&&g===void 0||dm(t,e,c,h,r,g);return}}for(var f in a)h=a[f],a.hasOwnProperty(f)&&h!=null&&!r.hasOwnProperty(f)&&_e(t,e,f,null,r,h);for(d in r)h=r[d],g=a[d],!r.hasOwnProperty(d)||h===g||h==null&&g==null||_e(t,e,d,h,r,g)}function r0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function KR(){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&&r0(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&&r0(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 fm=null,pm=null;function hd(t){return t.nodeType===9?t:t.ownerDocument}function n0(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 W_(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 hm(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 QR(){var t=window.event;return t&&t.type==="popstate"?t===wh?!1:(wh=t,!0):(wh=null,!1)}var Z_=typeof setTimeout=="function"?setTimeout:void 0,JR=typeof clearTimeout=="function"?clearTimeout:void 0,o0=typeof Promise=="function"?Promise:void 0,eM=typeof queueMicrotask=="function"?queueMicrotask:typeof o0<"u"?function(t){return o0.resolve(null).then(t).catch(tM)}:Z_;function tM(t){setTimeout(function(){throw t})}function Nn(t){return t==="head"}function i0(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),Xi(e);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")vl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,vl(a);for(var o=a.firstChild;o;){var i=o.nextSibling,s=o.nodeName;o[Fl]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&vl(t.ownerDocument.body);a=n}while(a);Xi(e)}function s0(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 mm(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":mm(a),Im(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function aM(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[Fl])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=Aa(t.nextSibling),t===null)break}return null}function rM(t,e,a){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Aa(t.nextSibling),t===null))return null;return t}function X_(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=Aa(t.nextSibling),t===null))return null;return t}function gm(t){return t.data==="$?"||t.data==="$~"}function vm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function nM(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 Aa(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 ym=null;function l0(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(e===0)return Aa(t.nextSibling);e--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||e++}t=t.nextSibling}return null}function u0(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 Y_(t,e,a){switch(e=hd(a),t){case"html":if(t=e.documentElement,!t)throw Error(M(452));return t;case"head":if(t=e.head,!t)throw Error(M(453));return t;case"body":if(t=e.body,!t)throw Error(M(454));return t;default:throw Error(M(451))}}function vl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Im(t)}var ka=new Map,c0=new Set;function md(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Pr=ye.d;ye.d={f:oM,r:iM,D:sM,C:lM,L:uM,m:cM,X:fM,S:dM,M:pM};function oM(){var t=Pr.f(),e=Md();return t||e}function iM(t){var e=Ki(t);e!==null&&e.tag===5&&e.type==="form"?VC(e):Pr.r(t)}var ts=typeof document>"u"?null:document;function K_(t,e,a){var r=ts;if(r&&typeof e=="string"&&e){var n=_a(e);n='link[rel="'+t+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),c0.has(n)||(c0.add(n),t={rel:t,crossOrigin:a,href:e},r.querySelector(n)===null&&(e=r.createElement("link"),St(e,"link",t),pt(e),r.head.appendChild(e)))}}function sM(t){Pr.D(t),K_("dns-prefetch",t,null)}function lM(t,e){Pr.C(t,e),K_("preconnect",t,e)}function uM(t,e,a){Pr.L(t,e,a);var r=ts;if(r&&t&&e){var n='link[rel="preload"][as="'+_a(e)+'"]';e==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+_a(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+_a(a.imageSizes)+'"]')):n+='[href="'+_a(t)+'"]';var o=n;switch(e){case"style":o=Zi(t);break;case"script":o=as(t)}ka.has(o)||(t=Ne({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),ka.set(o,t),r.querySelector(n)!==null||e==="style"&&r.querySelector(zl(o))||e==="script"&&r.querySelector(Vl(o))||(e=r.createElement("link"),St(e,"link",t),pt(e),r.head.appendChild(e)))}}function cM(t,e){Pr.m(t,e);var a=ts;if(a&&t){var r=e&&typeof e.as=="string"?e.as:"script",n='link[rel="modulepreload"][as="'+_a(r)+'"][href="'+_a(t)+'"]',o=n;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=as(t)}if(!ka.has(o)&&(t=Ne({rel:"modulepreload",href:t},e),ka.set(o,t),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Vl(o)))return}r=a.createElement("link"),St(r,"link",t),pt(r),a.head.appendChild(r)}}}function dM(t,e,a){Pr.S(t,e,a);var r=ts;if(r&&t){var n=Mi(r).hoistableStyles,o=Zi(t);e=e||"default";var i=n.get(o);if(!i){var s={loading:0,preload:null};if(i=r.querySelector(zl(o)))s.loading=5;else{t=Ne({rel:"stylesheet",href:t,"data-precedence":e},a),(a=ka.get(o))&&dg(t,a);var l=i=r.createElement("link");pt(l),St(l,"link",t),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,qc(i,e,r)}i={type:"stylesheet",instance:i,count:1,state:s},n.set(o,i)}}}function fM(t,e){Pr.X(t,e);var a=ts;if(a&&t){var r=Mi(a).hoistableScripts,n=as(t),o=r.get(n);o||(o=a.querySelector(Vl(n)),o||(t=Ne({src:t,async:!0},e),(e=ka.get(n))&&fg(t,e),o=a.createElement("script"),pt(o),St(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function pM(t,e){Pr.M(t,e);var a=ts;if(a&&t){var r=Mi(a).hoistableScripts,n=as(t),o=r.get(n);o||(o=a.querySelector(Vl(n)),o||(t=Ne({src:t,async:!0,type:"module"},e),(e=ka.get(n))&&fg(t,e),o=a.createElement("script"),pt(o),St(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function d0(t,e,a,r){var n=(n=_n.current)?md(n):null;if(!n)throw Error(M(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=Zi(a.href),a=Mi(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=Zi(a.href);var o=Mi(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(zl(t)))&&!o._p&&(i.instance=o,i.state.loading=5),ka.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},ka.set(t,a),o||hM(n,t,a,i.state))),e&&r===null)throw Error(M(528,""));return i}if(e&&r!==null)throw Error(M(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=as(a),a=Mi(n).hoistableScripts,r=a.get(e),r||(r={type:"script",instance:null,count:0,state:null},a.set(e,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(M(444,t))}}function Zi(t){return'href="'+_a(t)+'"'}function zl(t){return'link[rel="stylesheet"]['+t+"]"}function Q_(t){return Ne({},t,{"data-precedence":t.precedence,precedence:null})}function hM(t,e,a,r){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?r.loading=1:(e=t.createElement("link"),r.preload=e,e.addEventListener("load",function(){return r.loading|=1}),e.addEventListener("error",function(){return r.loading|=2}),St(e,"link",a),pt(e),t.head.appendChild(e))}function as(t){return'[src="'+_a(t)+'"]'}function Vl(t){return"script[async]"+t}function f0(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var r=t.querySelector('style[data-href~="'+_a(a.href)+'"]');if(r)return e.instance=r,pt(r),r;var n=Ne({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),pt(r),St(r,"style",n),qc(r,a.precedence,t),e.instance=r;case"stylesheet":n=Zi(a.href);var o=t.querySelector(zl(n));if(o)return e.state.loading|=4,e.instance=o,pt(o),o;r=Q_(a),(n=ka.get(n))&&dg(r,n),o=(t.ownerDocument||t).createElement("link"),pt(o);var i=o;return i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),St(o,"link",r),e.state.loading|=4,qc(o,a.precedence,t),e.instance=o;case"script":return o=as(a.src),(n=t.querySelector(Vl(o)))?(e.instance=n,pt(n),n):(r=a,(n=ka.get(o))&&(r=Ne({},a),fg(r,n)),t=t.ownerDocument||t,n=t.createElement("script"),pt(n),St(n,"link",r),t.head.appendChild(n),e.instance=n);case"void":return null;default:throw Error(M(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(r=e.instance,e.state.loading|=4,qc(r,a.precedence,t));return e.instance}function qc(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 dg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function fg(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var zc=null;function p0(t,e,a){if(zc===null){var r=new Map,n=zc=new Map;n.set(a,r)}else n=zc,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[Fl]||o[yt]||t==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(e)||"";i=t+i;var s=r.get(i);s?s.push(o):r.set(i,[o])}}return r}function h0(t,e,a){t=t.ownerDocument||t,t.head.insertBefore(a,e==="title"?t.querySelector("head > title"):null)}function mM(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 J_(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function gM(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=Zi(r.href),o=e.querySelector(zl(n));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=gd.bind(t),e.then(t,t)),a.state.loading|=4,a.instance=o,pt(o);return}o=e.ownerDocument||e,r=Q_(r),(n=ka.get(n))&&dg(r,n),o=o.createElement("link"),pt(o);var i=o;i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),St(o,"link",r),a.instance=o}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,e),(e=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=gd.bind(t),e.addEventListener("load",a),e.addEventListener("error",a))}}var Lh=0;function vM(t,e){return t.stylesheets&&t.count===0&&Vc(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var r=setTimeout(function(){if(t.stylesheets&&Vc(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&Lh===0&&(Lh=62500*KR());var n=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Vc(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>Lh?50:800)+e);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function gd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var vd=null;function Vc(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,vd=new Map,e.forEach(yM,t),vd=null,gd.call(t))}function yM(t,e){if(!(e.state.loading&4)){var a=vd.get(t);if(a)var r=a.get(null);else{a=new Map,vd.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=gd.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 El={$$typeof:Ar,Provider:null,Consumer:null,_currentValue:yo,_currentValue2:yo,_threadCount:0};function xM(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=Kp(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kp(0),this.hiddenUpdates=Kp(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 ew(t,e,a,r,n,o,i,s,l,u,c,d){return t=new xM(t,e,a,i,l,u,c,d,s),e=1,o===!0&&(e|=24),o=na(3,null,null,e),t.current=o,o.stateNode=t,e=Pm(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:r,isDehydrated:a,cache:e},qm(o),t}function tw(t){return t?(t=ki,t):ki}function aw(t,e,a,r,n,o){n=tw(n),r.context===null?r.context=n:r.pendingContext=n,r=Ln(e),r.payload={element:a},o=o===void 0?null:o,o!==null&&(r.callback=o),a=In(t,r,e),a!==null&&(jt(a,t,e),ul(a,t,e))}function m0(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<e?a:e}}function pg(t,e){m0(t,e),(t=t.alternate)&&m0(t,e)}function rw(t){if(t.tag===13||t.tag===31){var e=Ro(t,67108864);e!==null&&jt(e,t,67108864),pg(t,67108864)}}function g0(t){if(t.tag===13||t.tag===31){var e=ua();e=wm(e);var a=Ro(t,e);a!==null&&jt(a,t,e),pg(t,e)}}var yd=!0;function bM(t,e,a,r){var n=ee.T;ee.T=null;var o=ye.p;try{ye.p=2,hg(t,e,a,r)}finally{ye.p=o,ee.T=n}}function SM(t,e,a,r){var n=ee.T;ee.T=null;var o=ye.p;try{ye.p=8,hg(t,e,a,r)}finally{ye.p=o,ee.T=n}}function hg(t,e,a,r){if(yd){var n=xm(r);if(n===null)_h(t,e,r,xd,a),v0(t,r);else if(_M(n,t,e,a,r))r.stopPropagation();else if(v0(t,r),e&4&&-1<CM.indexOf(t)){for(;n!==null;){var o=Ki(n);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=mo(o.pendingLanes);if(i!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var l=1<<31-la(i);s.entanglements[1]|=l,i&=~l}ur(o),(ve&6)===0&&(ld=ia()+500,ql(0,!1))}}break;case 31:case 13:s=Ro(o,2),s!==null&&jt(s,o,2),Md(),pg(o,2)}if(o=xm(r),o===null&&_h(t,e,r,xd,a),o===n)break;n=o}n!==null&&r.stopPropagation()}else _h(t,e,r,null,a)}}function xm(t){return t=km(t),mg(t)}var xd=null;function mg(t){if(xd=null,t=Ci(t),t!==null){var e=Ml(t);if(e===null)t=null;else{var a=e.tag;if(a===13){if(t=_0(e),t!==null)return t;t=null}else if(a===31){if(t=w0(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 xd=t,null}function nw(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(uT()){case k0:return 2;case E0:return 8;case Zc:case cT:return 32;case T0:return 268435456;default:return 32}default:return 32}}var bm=!1,En=null,Tn=null,Rn=null,Tl=new Map,Rl=new Map,vn=[],CM="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 v0(t,e){switch(t){case"focusin":case"focusout":En=null;break;case"dragenter":case"dragleave":Tn=null;break;case"mouseover":case"mouseout":Rn=null;break;case"pointerover":case"pointerout":Tl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rl.delete(e.pointerId)}}function Qs(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=Ki(e),e!==null&&rw(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,n!==null&&e.indexOf(n)===-1&&e.push(n),t)}function _M(t,e,a,r,n){switch(e){case"focusin":return En=Qs(En,t,e,a,r,n),!0;case"dragenter":return Tn=Qs(Tn,t,e,a,r,n),!0;case"mouseover":return Rn=Qs(Rn,t,e,a,r,n),!0;case"pointerover":var o=n.pointerId;return Tl.set(o,Qs(Tl.get(o)||null,t,e,a,r,n)),!0;case"gotpointercapture":return o=n.pointerId,Rl.set(o,Qs(Rl.get(o)||null,t,e,a,r,n)),!0}return!1}function ow(t){var e=Ci(t.target);if(e!==null){var a=Ml(e);if(a!==null){if(e=a.tag,e===13){if(e=_0(a),e!==null){t.blockedOn=e,eS(t.priority,function(){g0(a)});return}}else if(e===31){if(e=w0(a),e!==null){t.blockedOn=e,eS(t.priority,function(){g0(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 $c(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var a=xm(t.nativeEvent);if(a===null){a=t.nativeEvent;var r=new a.constructor(a.type,a);Ph=r,a.target.dispatchEvent(r),Ph=null}else return e=Ki(a),e!==null&&rw(e),t.blockedOn=a,!1;e.shift()}return!0}function y0(t,e,a){$c(t)&&a.delete(e)}function wM(){bm=!1,En!==null&&$c(En)&&(En=null),Tn!==null&&$c(Tn)&&(Tn=null),Rn!==null&&$c(Rn)&&(Rn=null),Tl.forEach(y0),Rl.forEach(y0)}function kc(t,e){t.blockedOn===e&&(t.blockedOn=null,bm||(bm=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,wM)))}var Ec=null;function x0(t){Ec!==t&&(Ec=t,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,function(){Ec===t&&(Ec=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(mg(r||a)===null)continue;break}var o=Ki(a);o!==null&&(t.splice(e,3),e-=3,em(o,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function Xi(t){function e(l){return kc(l,t)}En!==null&&kc(En,t),Tn!==null&&kc(Tn,t),Rn!==null&&kc(Rn,t),Tl.forEach(e),Rl.forEach(e);for(var a=0;a<vn.length;a++){var r=vn[a];r.blockedOn===t&&(r.blockedOn=null)}for(;0<vn.length&&(a=vn[0],a.blockedOn===null);)ow(a),a.blockedOn===null&&vn.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[Gt]||null;if(typeof o=="function")i||x0(a);else if(i){var s=null;if(o&&o.hasAttribute("formAction")){if(n=o,i=o[Gt]||null)s=i.formAction;else if(mg(n)!==null)continue}else s=i.action;typeof s=="function"?a[r+1]=s:(a.splice(r,3),r-=3),x0(a)}}}function iw(){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 gg(t){this._internalRoot=t}Bd.prototype.render=gg.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(M(409));var a=e.current,r=ua();aw(a,r,t,e,null,null)};Bd.prototype.unmount=gg.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;aw(t.current,2,null,t,null,null),Md(),e[Yi]=null}};function Bd(t){this._internalRoot=t}Bd.prototype.unstable_scheduleHydration=function(t){if(t){var e=B0();t={blockedOn:null,target:t,priority:e};for(var a=0;a<vn.length&&e!==0&&e<vn[a].priority;a++);vn.splice(a,0,t),a===0&&ow(t)}};var b0=S0.version;if(b0!=="19.2.4")throw Error(M(527,b0,"19.2.4"));ye.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(M(188)):(t=Object.keys(t).join(","),Error(M(268,t)));return t=aT(e),t=t!==null?L0(t):null,t=t===null?null:t.stateNode,t};var LM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:ee,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Js=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Js.isDisabled&&Js.supportsFiber))try{Dl=Js.inject(LM),sa=Js}catch{}var Js;Fd.createRoot=function(t,e){if(!C0(t))throw Error(M(299));var a=!1,r="",n=KC,o=QC,i=JC;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=ew(t,1,!1,null,null,a,r,null,n,o,i,iw),t[Yi]=e.current,cg(t),new gg(e)};Fd.hydrateRoot=function(t,e,a){if(!C0(t))throw Error(M(299));var r=!1,n="",o=KC,i=QC,s=JC,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=ew(t,1,!0,e,a??null,r,n,l,o,i,s,iw),e.context=tw(null),a=e.current,r=ua(),r=wm(r),n=Ln(r),n.callback=null,In(a,n,r),a=r,e.current.lanes=a,Bl(e,a),ur(e),t[Yi]=e.current,cg(t),new Bd(e)};Fd.version="19.2.4"});var Do=tr((lH,uw)=>{"use strict";function lw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lw)}catch(t){console.error(t)}}lw(),uw.exports=sw()});var oL=tr(ef=>{"use strict";var b2=Symbol.for("react.transitional.element"),S2=Symbol.for("react.fragment");function nL(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:b2,type:t,key:r,ref:e!==void 0?e:null,props:a}}ef.Fragment=S2;ef.jsx=nL;ef.jsxs=nL});var Re=tr((L4,iL)=>{"use strict";iL.exports=oL()});var CE=Y(Ge(),1),Ep=Y(Vs(),1),JP=Y(Do(),1);function cw(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 h of d)for(let g of h.removedNodes)if(g===t){if(s>=n){c.disconnect(),u=!0;return}l&&clearTimeout(l),l=setTimeout(()=>{if(!u){s++;try{a()}catch{c.disconnect(),u=!0}}},o);return}}});return c.observe(i,{childList:!0,subtree:!0}),()=>{u=!0,c.disconnect(),l&&clearTimeout(l)}}var IM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function vg(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(!IM.has(s)){o.push(i);continue}for(let l of Array.from(i.attributes)){let u=l.name.toLowerCase(),c=l.value.trim().toLowerCase(),d=u.startsWith("on"),g=(u==="href"||u==="src"||u==="formaction")&&(c.startsWith("javascript:")||c.startsWith("vbscript:")||c.startsWith("data:text/html"));(d||g)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var dw=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=vg(t.html),n=document.createElement("div");n.setAttribute("data-syntro-action-id",e.generateId()),n.innerHTML=r;let o=null;switch(t.position){case"before":a.insertAdjacentElement("beforebegin",n);break;case"after":a.insertAdjacentElement("afterend",n);break;case"prepend":a.insertBefore(n,a.firstChild);break;case"append":a.appendChild(n);break;case"replace":o=a.innerHTML,a.replaceWith(n);break}let i=null;if(t.deepLink){let{tileId:u,itemId:c}=t.deepLink;i=()=>{let d=window.SynOS?.handle;d&&(d.open(),d.runtime?.events?.publish("notification.deep_link",{tileId:u,itemId:c}))},n.style.cursor="pointer",n.addEventListener("click",i)}e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position});let l=cw(n,a,()=>{switch(t.position){case"before":a.insertAdjacentElement("beforebegin",n);break;case"after":a.insertAdjacentElement("afterend",n);break;case"prepend":a.insertBefore(n,a.firstChild);break;case"append":a.appendChild(n);break;case"replace":break}});return{cleanup:()=>{if(i&&n.removeEventListener("click",i),l(),t.position==="replace"&&o!==null){let u=document.createElement(a.tagName);u.innerHTML=o,Array.from(a.attributes).forEach(c=>{u.setAttribute(c.name,c.value)}),n.replaceWith(u)}else n.remove()},updateFn:u=>{"html"in u&&typeof u.html=="string"&&(n.innerHTML=vg(u.html))}}},fw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.textContent??"";return a.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{a.textContent=r},updateFn:n=>{"text"in n&&typeof n.text=="string"&&(a.textContent=n.text)}}},pw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=t.attr.toLowerCase();if(r.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);if(r==="href"||r==="src"||r==="formaction"){let s=t.value.trim().toLowerCase();if(s.startsWith("javascript:")||s.startsWith("vbscript:")||s.startsWith("data:text/html"))throw new Error(`Dangerous URL not allowed in ${t.attr}: ${t.value}`)}let o=a.getAttribute(t.attr),i=a.hasAttribute(t.attr);return a.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{i&&o!==null?a.setAttribute(t.attr,o):a.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&a.setAttribute(t.attr,s.value)}}},hw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.classList.contains(t.className);return a.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r||a.classList.remove(t.className)}}},mw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.classList.contains(t.className);return a.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r&&a.classList.add(t.className)}}},gw=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=new Map;for(let n of Object.keys(t.styles)){let o=a.style.getPropertyValue(n);r.set(n,o)}for(let[n,o]of Object.entries(t.styles))a.style.setProperty(n,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[n,o]of r)o?a.style.setProperty(n,o):a.style.removeProperty(n)},updateFn:n=>{if("styles"in n&&typeof n.styles=="object"&&n.styles)for(let[o,i]of Object.entries(n.styles))a.style.setProperty(o,i)}}},yg=[{kind:"content:insertHtml",executor:dw},{kind:"content:setText",executor:fw},{kind:"content:setAttr",executor:pw},{kind:"content:addClass",executor:hw},{kind:"content:removeClass",executor:mw},{kind:"content:setStyle",executor:gw}],xg={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:yg};var AM={light:50,medium:100,heavy:200},kM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],vw={init(t,e,a){let r=AM[a.intensity],n=a.colors.length>0?a.colors:kM,o=[];for(let i=0;i<r;i++)o.push({x:Math.random()*t,y:Math.random()*-e*.3,vx:(Math.random()-.5)*4,vy:Math.random()*2+1,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.2,size:Math.random()*6+4,color:n[Math.floor(Math.random()*n.length)],opacity:1,shape:Math.random()>.5?"rect":"circle"});return o},update(t,e,a){let r=!1;for(let n of t)n.vy+=.15,n.vx*=.99,n.x+=n.vx,n.y+=n.vy,n.rotation+=n.rotationSpeed,n.y>0&&n.opacity>0&&n.y>500&&(n.opacity-=.02,n.opacity<0&&(n.opacity=0)),n.opacity>.01&&(r=!0);return r},render(t,e){for(let a of e)a.opacity<.01||(t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.translate(a.x,a.y),t.rotate(a.rotation),a.shape==="circle"?(t.beginPath(),t.arc(0,0,a.size/2,0,Math.PI*2),t.fill()):t.fillRect(-a.size/2,-a.size/2,a.size,a.size*.6),t.restore())}};var EM={light:20,medium:40,heavy:80},TM="\u{1F389}",yw={init(t,e,a){let r=EM[a.intensity],n=typeof a.props?.emoji=="string"?a.props.emoji:TM,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 RM={light:20,medium:40,heavy:80},MM={light:3,medium:4,heavy:5},xw={init(t,e,a){let r=RM[a.intensity],n=MM[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 h=Math.PI*2*d/r+(Math.random()-.5)*.3,g=Math.random()*3+2;i.push({x:l,y:u,vx:Math.cos(h)*g,vy:Math.sin(h)*g,rotation:0,rotationSpeed:0,size:Math.random()*3+2,color:c,opacity:1,shape:"circle",data:{centerX:l,centerY:u}})}}return i},update(t,e,a){let r=!1;for(let n of t)n.vx*=.97,n.vy*=.97,n.vy+=.03,n.x+=n.vx,n.y+=n.vy,n.opacity-=.008,n.opacity<0&&(n.opacity=0),n.opacity>.01&&(r=!0);return r},render(t,e){for(let a of e)a.opacity<.01||(t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.shadowBlur=12,t.shadowColor=a.color,t.beginPath(),t.arc(a.x,a.y,a.size,0,Math.PI*2),t.fill(),t.restore())}};var DM={light:30,medium:60,heavy:120},bw={init(t,e,a){let r=DM[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 Nd=class{constructor(){this.canvas=null,this.ctx=null,this.rafId=null,this.particles=[],this.startTime=0,this.lastFrame=0,this.duration=0,this.effect=null,this.container=null}start(e,a,r){this.container=e,this.effect=a,this.duration=r.duration;let n=document.createElement("canvas");n.setAttribute("data-syntro-celebrate",""),Object.assign(n.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let o=window.devicePixelRatio||1,i=window.innerWidth,s=window.innerHeight;n.width=i*o,n.height=s*o,n.style.width=`${i}px`,n.style.height=`${s}px`;let l=n.getContext("2d");l&&(l.scale(o,o),this.canvas=n,this.ctx=l,e.appendChild(n),this.particles=a.init(i,s,r),this.startTime=performance.now(),this.lastFrame=this.startTime,this.tick=this.tick.bind(this),this.rafId=requestAnimationFrame(this.tick))}stop(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.canvas&&this.container&&(this.canvas.remove(),this.canvas=null),this.ctx=null,this.effect=null,this.container=null,this.particles=[]}tick(e){if(!this.ctx||!this.canvas||!this.effect)return;let a=e-this.startTime,r=e-this.lastFrame;if(this.lastFrame=e,a>=this.duration){this.stop();return}let n=this.canvas.width/(window.devicePixelRatio||1),o=this.canvas.height/(window.devicePixelRatio||1);if(this.ctx.clearRect(0,0,n,o),!this.effect.update(this.particles,r,a)){this.stop();return}this.effect.render(this.ctx,this.particles),this.rafId=requestAnimationFrame(this.tick)}};var OM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"];function BM(t,e){return[t,e,`${t}cc`,`${e}cc`,"#ffffff",`${t}80`]}function FM(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 BM(a,r||a)}catch{}return null}var Sw=new Map([["confetti",vw],["fireworks",xw],["sparkles",bw],["emoji-rain",yw]]),Cw=async(t,e)=>{let a=Sw.get(t.effect);if(!a)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...Sw.keys()].join(", ")}`),{cleanup:()=>{}};let r=t.colors??FM(e.overlayRoot)??OM,n={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:r,props:t.props},o=new Nd;return o.start(e.overlayRoot,a,n),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{o.stop()}}};var Sg="syntro_active_tour",Pd=new Map;function NM(t){try{let e=localStorage.getItem(Sg);if(!e)return null;let a=JSON.parse(e);return a.tourId!==t?null:a}catch{return null}}function bg(t){try{localStorage.setItem(Sg,JSON.stringify(t))}catch{}}function PM(){try{localStorage.removeItem(Sg)}catch{}}function $l(){return window.location.pathname}function HM(t){if(!t.route)return!0;let e=$l();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var Cg=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(Pd.has(a))return{cleanup:async()=>{let v=Pd.get(a);v&&await v.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let i=NM(a),s=!!i;if(!s&&!o)return{cleanup:()=>{}};i||(i={tourId:a,currentStepId:n||r[0].id,startedAt:Date.now()},bg(i));let l=r.findIndex(v=>v.id===i.currentStepId);if(l===-1){let v=n||r[0].id;l=r.findIndex(y=>y.id===v),l===-1&&(l=0),i.currentStepId=r[l].id,bg(i)}let u=r[l];if(!HM(u))return e.publishEvent("tour.waiting_for_route",{tourId:a,stepId:u.id,expectedRoute:u.route,currentRoute:$l()}),{cleanup:()=>{}};let c=!1,d=null,h=null,g=null,S=async()=>{h&&(h(),h=null),d?.isApplied()&&(await d.revert(),d=null)},b=async v=>{if(c)return;if(await S(),v==="end"){PM(),e.publishEvent("tour.completed",{tourId:a,totalSteps:r.length}),c=!0;return}let y=r.find(_=>_.id===v);if(!y){console.error(`[Tour] Step "${v}" not found`);return}if(i.currentStepId=v,bg(i),e.publishEvent("tour.step_changed",{tourId:a,previousStepId:u.id,nextStepId:v}),y.route&&y.route!==$l()){e.publishEvent("tour.awaiting_navigation",{tourId:a,stepId:v,targetRoute:y.route});return}await x(y)},x=async v=>{if(!c){e.publishEvent("tour.step_started",{tourId:a,stepId:v.id,stepIndex:r.findIndex(y=>y.id===v.id),totalSteps:r.length});try{d=await e.applyAction(v.action)}catch(y){console.error(`[Tour] Failed to execute step "${v.id}":`,y),e.publishEvent("tour.step_failed",{tourId:a,stepId:v.id,error:String(y)});return}if(v.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",w=>{let C=w?.actionId;if(C&&v.onAction){let A=v.onAction[C];A&&b(A)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",w=>{let C=w?.actionId;if(C&&v.onAction){let A=v.onAction[C];A&&b(A)}}),_=h;h=()=>{_(),y()}}}};g=(()=>{let v=$l(),y=()=>{let C=$l();C!==v&&(v=C,e.publishEvent("tour.route_changed",{tourId:a,newRoute:C}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>y());window.addEventListener("popstate",y);let _=history.pushState.bind(history),w=history.replaceState.bind(history);return history.pushState=(...C)=>{_(...C),queueMicrotask(y)},history.replaceState=(...C)=>{w(...C),queueMicrotask(y)},()=>{window.removeEventListener("popstate",y),history.pushState=_,history.replaceState=w}})(),s?e.publishEvent("tour.resumed",{tourId:a,stepId:i.currentStepId}):e.publishEvent("tour.started",{tourId:a,totalSteps:r.length,startStepId:i.currentStepId}),await x(u);let m=async()=>{c=!0,Pd.delete(a),await S(),g&&g(),e.publishEvent("tour.paused",{tourId:a,stepId:i.currentStepId})};return Pd.set(a,{cleanup:m}),{cleanup:m}};var za={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"},Ae={0:"#07230a",1:"#0e4514",2:"#16681e",3:"#1d8a28",4:"#24ad32",5:"#4fbd5a",6:"#7acd82",7:"#a5deab",8:"#d0eed3",9:"#e5f6e7"},Ct={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},qe={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},fa={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},jl={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},Ft={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},Gl={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var pa={primary:I[10],secondary:I[9],tertiary:I[8]},IH={primary:I[2],secondary:I[0]},_g={primary:I[4],secondary:I[3]},Hd={primary:{text:za.white,icon:za.white,border:re[3],backgroundDefault:re[3],backgroundHover:re[2]},neutral:{text:I[10],textHover:za.white,icon:I[10],iconHover:za.white,border:I[4],background:I[2]},link:{text:za.white,icon:za.white,hover:re[5]},error:{text:qe[5],hover:qe[6]},success:{text:Ae[5],hover:Ae[6]}},AH={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:qe[8],pillOutline:qe[4],borderPrimary:qe[2],borderSecondary:qe[2],background:qe[0]},yellow:{content:Ct[8],pillOutline:Ct[4],borderPrimary:Ct[2],borderSecondary:Ct[2],background:Ct[0]},green:{content:Ae[8],pillOutline:Ae[4],borderPrimary:Ae[2],borderSecondary:Ae[2],background:Ae[0]},purple:{content:Ft[8],pillOutline:Ft[4],borderPrimary:Ft[2],borderSecondary:Ft[2],background:Ft[0]},blue:{content:fa[8],pillOutline:fa[4],borderPrimary:fa[2],borderSecondary:fa[2],background:fa[0]},orange:{content:jl[8],pillOutline:jl[4],borderPrimary:jl[2],borderSecondary:jl[2],background:jl[0]},pink:{content:Gl[8],pillOutline:Gl[4],borderPrimary:Gl[2],borderSecondary:Gl[2],background:Gl[0]}},kH={green:{content:Ae[8],border:Ae[2],background:Ae[0]},yellow:{content:Ct[8],border:Ct[2],background:Ct[0]},red:{content:qe[8],border:qe[2],background:qe[0]}},EH={green:{content:Ae[1],background:Ae[9]},yellow:{content:Ct[1],background:Ct[9]},red:{content:qe[1],background:qe[9]}},TH={content:I[10],border:I[4],background:"#1c2124"},RH={backgroundDefault:I[2],backgroundHover:I[1],selected:I[3]},MH={background:I[2],icon:I[10],borderDefault:I[4],borderSelected:re[3],textLabel:I[9],textPlaceholder:I[8],textHint:I[8]},DH={backgroundDefault:I[2],backgroundDisabled:I[0],textLabel:I[9],textPlaceholder:I[8],textHint:I[8],textError:qe[5],iconDefault:I[9],iconPlaceholder:I[10],iconError:qe[5],borderDefault:I[4],borderSelected:re[3],borderError:qe[5]},OH={handleDefault:za.white,handleDisabled:I[10],off:{backgroundDefault:I[4],backgroundHover:I[5],backgroundDisabled:I[4]},on:{backgroundDefault:Ae[3],backgroundHover:Ae[2],backgroundDisabled:I[4]}},BH={off:{backgroundDefault:"#00000000",backgroundHover:I[5],backgroundDisabled:I[2],border:I[6]},on:{backgroundDefault:Ae[0],backgroundHover:Ae[1],backgroundDisabled:I[2],border:Ae[3]}},FH={content:I[10],background:I[4]},NH={background:I[4],active:Ae[3]},PH={background:I[1],content:I[9],border:I[4]},HH={backgroundDefault:I[1],backgroundHover:I[3],backgroundActive:I[4],border:I[4],contentPrimary:I[10],contentSecondary:I[9],contentTertiary:I[8]},UH={background:I[1],content:I[9],border:I[4]},qH={activeBackground:I[3],activeContent:re[5],inactiveContent:I[9],border:I[4]},zH={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]}},VH={textPrimaryDefault:I[10],textPrimaryHover:I[10],textSecondaryDefault:I[8],textSecondaryHover:I[9],iconPrimary:I[10],iconSecondary:I[8]},$H={background:Ae[1],active:Ae[5]},jH={textDefault:I[10],textSelected:za.white,textDisabled:I[7],backgroundDefault:I[2],backgroundMiddle:I[3],backgroundSelected:re[3],border:I[4]},GH=I[9];var _w=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function ww(t,e,a){let r=a?.paddingPx??12,n=a?.radiusPx??12,o=Math.min(Math.max(a?.scrimOpacity??.55,0),1),i=a?.ringColor??`var(--syntro-ring, ${fa[5]})`,s=a?.blocking??!1,l=a?.onClickOutside??!0,u=a?.onEsc??!0,c=getComputedStyle(document.documentElement),d=c.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=c.getPropertyValue("--syntro-ring").trim(),g=document.createElement("div");g.className="syntro-spotlight-scrim";let S=s||l;Object.assign(g.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:S?"auto":"none",background:d||`rgba(2, 6, 23, ${o})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(g),requestAnimationFrame(()=>g.style.opacity="1");let b=document.createElement("div");b.className="syntro-spotlight-ring",Object.assign(b.style,{position:"fixed",pointerEvents:"none",borderRadius:`${n}px`,border:`2px solid ${i||h||fa[5]}`,boxShadow:"0 0 0 4px rgba(255,255,255,0.35)",zIndex:"2147483647",transition:"all 220ms cubic-bezier(0.16,1,0.3,1)"}),e.appendChild(b);let x=[];if(!_w)for(let E=0;E<4;E++){let L=document.createElement("div");L.style.position="fixed",L.style.background="inherit",x.push(L),g.appendChild(L)}let f=E=>{g.style.clipPath=E,g.style.webkitClipPath=E},m=()=>{if(!t.isConnected){A.destroy();return}let E=t.getBoundingClientRect(),L=Math.max(0,E.left-r),k=Math.max(0,E.top-r),O=Math.min(window.innerWidth,E.width+r*2),R=Math.min(window.innerHeight,E.height+r*2);if(Object.assign(b.style,{left:`${L}px`,top:`${k}px`,width:`${O}px`,height:`${R}px`}),_w){let N=window.innerWidth,P=window.innerHeight,F=Math.min(n,O/2,R/2),Q=`M 0 0 L ${N} 0 L ${N} ${P} L 0 ${P} Z`,D=`M ${L+F} ${k} A ${F} ${F} 0 0 0 ${L} ${k+F} L ${L} ${k+R-F} A ${F} ${F} 0 0 0 ${L+F} ${k+R} L ${L+O-F} ${k+R} A ${F} ${F} 0 0 0 ${L+O} ${k+R-F} L ${L+O} ${k+F} A ${F} ${F} 0 0 0 ${L+O-F} ${k} L ${L+F} ${k} Z`;f(`path('${Q} ${D}')`)}else{let[N,P,F,Q]=x;Object.assign(N.style,{left:"0px",top:"0px",width:"100vw",height:`${k}px`}),Object.assign(F.style,{left:"0px",top:`${k+R}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(k+R))}px`}),Object.assign(Q.style,{left:"0px",top:`${k}px`,width:`${L}px`,height:`${R}px`}),Object.assign(P.style,{left:`${L+O}px`,top:`${k}px`,width:`${Math.max(0,window.innerWidth-(L+O))}px`,height:`${R}px`})}},v=new ResizeObserver(()=>requestAnimationFrame(m));v.observe(t);let y=()=>requestAnimationFrame(m),_=()=>requestAnimationFrame(m);window.addEventListener("scroll",y,!0),window.addEventListener("resize",_);let w=E=>{E.key==="Escape"&&u&&A.destroy()};u&&window.addEventListener("keydown",w);let C=E=>{s?(E.preventDefault(),E.stopPropagation()):l&&A.destroy()};g.addEventListener("click",C);let A={destroy(){v.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",_),u&&window.removeEventListener("keydown",w),g.removeEventListener("click",C),g.style.pointerEvents="none",g.style.opacity="0",setTimeout(()=>{g.remove(),b.remove()},220)}};return m(),A}var UM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function ha(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let a=document.createElement("template");a.innerHTML=t;let r=a.content,n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;n.nextNode();){let i=n.currentNode,s=i.tagName.toLowerCase();if(!UM.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"),h=(u==="href"||u==="src")&&c.startsWith("javascript:");(d||h)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var Oo={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: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
|
|
16
|
+
`,e.overlayRoot.appendChild(l);let u=document.createElement("div");u.className=`syntro-modal syntro-modal-${r}`,u.setAttribute("role","dialog"),u.setAttribute("aria-modal","true");let c={sm:"360px",md:"480px",lg:"640px"};u.style.cssText=`
|
|
17
17
|
position: fixed;
|
|
18
18
|
top: 50%;
|
|
19
19
|
left: 50%;
|
|
20
20
|
transform: translate(-50%, -50%) scale(0.95);
|
|
21
|
-
max-width: ${
|
|
21
|
+
max-width: ${c[r]};
|
|
22
22
|
width: 90%;
|
|
23
|
-
background: ${
|
|
24
|
-
border-radius:
|
|
23
|
+
background: ${Oo.bg};
|
|
24
|
+
border-radius: ${Oo.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(
|
|
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: ${Oo.title};">${ha(a.title)}</h2>`),d+=`<div class="syntro-modal-body" style="color: ${Oo.text}; line-height: 1.5;">${ha(a.body)}</div>`,i?.closeButton!==!1&&(d+=`
|
|
31
31
|
<button class="syntro-modal-close" data-syntro-action="dismiss" style="
|
|
32
32
|
position: absolute;
|
|
33
33
|
top: 16px;
|
|
@@ -36,16 +36,17 @@ Error generating stack: `+i.message+`
|
|
|
36
36
|
border: none;
|
|
37
37
|
cursor: pointer;
|
|
38
38
|
padding: 4px;
|
|
39
|
-
color:
|
|
39
|
+
color: ${Oo.text};
|
|
40
|
+
opacity: 0.6;
|
|
40
41
|
" aria-label="Close">
|
|
41
42
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
|
|
42
43
|
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
|
|
43
44
|
</svg>
|
|
44
45
|
</button>
|
|
45
|
-
`),s&&s.length>0){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 _ of s){let w=_.primary??!1;d+=`
|
|
46
47
|
<button
|
|
47
|
-
class="syntro-modal-btn ${
|
|
48
|
-
data-syntro-action="${
|
|
48
|
+
class="syntro-modal-btn ${w?"syntro-modal-btn-primary":""}"
|
|
49
|
+
data-syntro-action="${ha(_.actionId)}"
|
|
49
50
|
style="
|
|
50
51
|
padding: 10px 20px;
|
|
51
52
|
border-radius: 8px;
|
|
@@ -53,64 +54,79 @@ Error generating stack: `+i.message+`
|
|
|
53
54
|
font-weight: 500;
|
|
54
55
|
cursor: pointer;
|
|
55
56
|
transition: background 150ms ease;
|
|
56
|
-
${
|
|
57
|
+
${w?`background: ${Oo.accent}; color: white; border: none;`:`background: transparent; color: ${Oo.accent}; border: 1px solid currentColor; opacity: 0.7;`}
|
|
57
58
|
"
|
|
58
59
|
>
|
|
59
|
-
${
|
|
60
|
+
${ha(_.label)}
|
|
60
61
|
</button>
|
|
61
|
-
`}d+="</div>"}c.innerHTML=d,e.overlayRoot.appendChild(c);let h=null,m=c.querySelectorAll("[data-syntro-action]"),S=w=>{let x=w.currentTarget.getAttribute("data-syntro-action");x&&(h=x,e.publishEvent("action.modal_cta_clicked",{actionId:x}),y.destroy())};m.forEach(w=>w.addEventListener("click",S));let _=w=>{w.key==="Escape"&&a?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",_);let b=()=>{r||y.destroy()};l.addEventListener("click",b);let f=[];r&&Array.from(document.body.children).forEach(w=>{w!==e.overlayRoot&&w.getAttribute("inert")===null&&!w.querySelector("[data-syntro-editor-panel]")&&!w.hasAttribute("data-syntro-editor-panel")&&(w.setAttribute("inert",""),f.push(w))});let p;a?.timeoutMs&&(p=setTimeout(()=>{y.destroy()},a.timeoutMs));let v=c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');v.length>0&&requestAnimationFrame(()=>v[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",c.style.opacity="1",c.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:i,blocking:r});let y={destroy(){p&&clearTimeout(p),window.removeEventListener("keydown",_),l.removeEventListener("click",b),m.forEach(w=>w.removeEventListener("click",S)),f.forEach(w=>w.removeAttribute("inert")),c.style.pointerEvents="none",l.style.pointerEvents="none",c.style.opacity="0",c.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{c.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:h})}};return{cleanup:()=>{y.destroy()}}};var d1=["top","right","bottom","left"];var Ir=Math.min,Hi=Math.max,ql=Math.round,Zl=Math.floor,$n=t=>({x:t,y:t}),mM={left:"right",right:"left",bottom:"top",top:"bottom"},vM={start:"end",end:"start"};function Md(t,e,n){return Hi(t,Ir(e,n))}function Oo(t,e){return typeof t=="function"?t(e):t}function Hr(t){return t.split("-")[0]}function Ja(t){return t.split("-")[1]}function dm(t){return t==="x"?"y":"x"}function Nd(t){return t==="y"?"height":"width"}var yM=new Set(["top","bottom"]);function zi(t){return yM.has(Hr(t))?"y":"x"}function Dd(t){return dm(zi(t))}function f1(t,e,n){n===void 0&&(n=!1);let i=Ja(t),r=Dd(t),o=Nd(r),a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=Pl(a)),[a,Pl(a)]}function p1(t){let e=Pl(t);return[Od(t),e,Od(e)]}function Od(t){return t.replace(/start|end/g,e=>vM[e])}var c1=["left","right"],u1=["right","left"],bM=["top","bottom"],_M=["bottom","top"];function SM(t,e,n){switch(t){case"top":case"bottom":return n?e?u1:c1:e?c1:u1;case"left":case"right":return e?bM:_M;default:return[]}}function h1(t,e,n,i){let r=Ja(t),o=SM(Hr(t),n==="start",i);return r&&(o=o.map(a=>a+"-"+r),e&&(o=o.concat(o.map(Od)))),o}function Pl(t){return t.replace(/left|right|bottom|top/g,e=>mM[e])}function xM(t){return{top:0,right:0,bottom:0,left:0,...t}}function fm(t){return typeof t!="number"?xM(t):{top:t,right:t,bottom:t,left:t}}function Mo(t){let{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function g1(t,e,n){let{reference:i,floating:r}=t,o=zi(e),a=Dd(e),s=Nd(a),l=Hr(e),c=o==="y",u=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,h=i[s]/2-r[s]/2,m;switch(l){case"top":m={x:u,y:i.y-r.height};break;case"bottom":m={x:u,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:d};break;case"left":m={x:i.x-r.width,y:d};break;default:m={x:i.x,y:i.y}}switch(Ja(e)){case"start":m[a]-=h*(n&&c?-1:1);break;case"end":m[a]+=h*(n&&c?-1:1);break}return m}async function y1(t,e){var n;e===void 0&&(e={});let{x:i,y:r,platform:o,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=Oo(e,t),S=fm(m),b=s[h?d==="floating"?"reference":"floating":d],f=Mo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),p=d==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.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},w=Mo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:p,offsetParent:v,strategy:l}):p);return{top:(f.top-w.top+S.top)/y.y,bottom:(w.bottom-f.bottom+S.bottom)/y.y,left:(f.left-w.left+S.left)/y.x,right:(w.right-f.right+S.right)/y.x}}var b1=async(t,e,n)=>{let{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e)),c=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=g1(c,i,l),h=i,m={},S=0;for(let b=0;b<s.length;b++){var _;let{name:f,fn:p}=s[b],{x:v,y,data:w,reset:A}=await p({x:u,y:d,initialPlacement:i,placement:h,strategy:r,middlewareData:m,rects:c,platform:{...a,detectOverflow:(_=a.detectOverflow)!=null?_:y1},elements:{reference:t,floating:e}});u=v??u,d=y??d,m={...m,[f]:{...m[f],...w}},A&&S<=50&&(S++,typeof A=="object"&&(A.placement&&(h=A.placement),A.rects&&(c=A.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:r}):A.rects),{x:u,y:d}=g1(c,h,l)),b=-1)}return{x:u,y:d,placement:h,strategy:r,middlewareData:m}},_1=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:r,rects:o,platform:a,elements:s,middlewareData:l}=e,{element:c,padding:u=0}=Oo(t,e)||{};if(c==null)return{};let d=fm(u),h={x:n,y:i},m=Dd(r),S=Nd(m),_=await a.getDimensions(c),b=m==="y",f=b?"top":"left",p=b?"bottom":"right",v=b?"clientHeight":"clientWidth",y=o.reference[S]+o.reference[m]-h[m]-o.floating[S],w=h[m]-o.reference[m],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c)),x=A?A[v]:0;(!x||!await(a.isElement==null?void 0:a.isElement(A)))&&(x=s.floating[v]||o.floating[S]);let T=y/2-w/2,k=x/2-_[S]/2-1,E=Ir(d[f],k),R=Ir(d[p],k),D=E,N=x-_[S]-R,H=x/2-_[S]/2+T,B=Md(D,H,N),z=!l.arrow&&Ja(r)!=null&&H!==B&&o.reference[S]/2-(H<D?E:R)-_[S]/2<0,te=z?H<D?H-D:H-N:0;return{[m]:h[m]+te,data:{[m]:B,centerOffset:H-B-te,...z&&{alignmentOffset:te}},reset:z}}});var S1=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:r,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:_=!0,...b}=Oo(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};let f=Hr(r),p=zi(s),v=Hr(s)===s,y=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=h||(v||!_?[Pl(s)]:p1(s)),A=S!=="none";!h&&A&&w.push(...h1(s,_,S,y));let x=[s,...w],T=await l.detectOverflow(e,b),k=[],E=((i=o.flip)==null?void 0:i.overflows)||[];if(u&&k.push(T[f]),d){let H=f1(r,a,y);k.push(T[H[0]],T[H[1]])}if(E=[...E,{placement:r,overflows:k}],!k.every(H=>H<=0)){var R,D;let H=(((R=o.flip)==null?void 0:R.index)||0)+1,B=x[H];if(B&&(!(d==="alignment"?p!==zi(B):!1)||E.every(I=>zi(I.placement)===p?I.overflows[0]>0:!0)))return{data:{index:H,overflows:E},reset:{placement:B}};let z=(D=E.filter(te=>te.overflows[0]<=0).sort((te,I)=>te.overflows[1]-I.overflows[1])[0])==null?void 0:D.placement;if(!z)switch(m){case"bestFit":{var N;let te=(N=E.filter(I=>{if(A){let G=zi(I.placement);return G===p||G==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(G=>G>0).reduce((G,J)=>G+J,0)]).sort((I,G)=>I[1]-G[1])[0])==null?void 0:N[0];te&&(z=te);break}case"initialPlacement":z=s;break}if(r!==z)return{reset:{placement:z}}}return{}}}};function m1(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function v1(t){return d1.some(e=>t[e]>=0)}var x1=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n,platform:i}=e,{strategy:r="referenceHidden",...o}=Oo(t,e);switch(r){case"referenceHidden":{let a=await i.detectOverflow(e,{...o,elementContext:"reference"}),s=m1(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:v1(s)}}}case"escaped":{let a=await i.detectOverflow(e,{...o,altBoundary:!0}),s=m1(a,n.floating);return{data:{escapedOffsets:s,escaped:v1(s)}}}default:return{}}}}};var wM=new Set(["left","top"]);async function EM(t,e){let{placement:n,platform:i,elements:r}=t,o=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=Hr(n),s=Ja(n),l=zi(n)==="y",c=wM.has(a)?-1:1,u=o&&l?-1:1,d=Oo(e,t),{mainAxis:h,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*u,y:h*c}:{x:h*c,y:m*u}}var w1=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:r,y:o,placement:a,middlewareData:s}=e,l=await EM(e,t);return a===((n=s.offset)==null?void 0:n.placement)&&(i=s.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:a}}}}},E1=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:r,platform:o}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:f=>{let{x:p,y:v}=f;return{x:p,y:v}}},...c}=Oo(t,e),u={x:n,y:i},d=await o.detectOverflow(e,c),h=zi(Hr(r)),m=dm(h),S=u[m],_=u[h];if(a){let f=m==="y"?"top":"left",p=m==="y"?"bottom":"right",v=S+d[f],y=S-d[p];S=Md(v,S,y)}if(s){let f=h==="y"?"top":"left",p=h==="y"?"bottom":"right",v=_+d[f],y=_-d[p];_=Md(v,_,y)}let b=l.fn({...e,[m]:S,[h]:_});return{...b,data:{x:b.x-n,y:b.y-i,enabled:{[m]:a,[h]:s}}}}}};function Ld(){return typeof window<"u"}function No(t){return A1(t)?(t.nodeName||"").toLowerCase():"#document"}function qt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Un(t){var e;return(e=(A1(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function A1(t){return Ld()?t instanceof Node||t instanceof qt(t).Node:!1}function An(t){return Ld()?t instanceof Element||t instanceof qt(t).Element:!1}function Vn(t){return Ld()?t instanceof HTMLElement||t instanceof qt(t).HTMLElement:!1}function C1(t){return!Ld()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof qt(t).ShadowRoot}var CM=new Set(["inline","contents"]);function ts(t){let{overflow:e,overflowX:n,overflowY:i,display:r}=Tn(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!CM.has(r)}var AM=new Set(["table","td","th"]);function T1(t){return AM.has(No(t))}var TM=[":popover-open",":modal"];function Gl(t){return TM.some(e=>{try{return t.matches(e)}catch{return!1}})}var kM=["transform","translate","scale","rotate","perspective"],RM=["transform","translate","scale","rotate","perspective","filter"],OM=["paint","layout","strict","content"];function Id(t){let e=Hd(),n=An(t)?Tn(t):t;return kM.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||RM.some(i=>(n.willChange||"").includes(i))||OM.some(i=>(n.contain||"").includes(i))}function k1(t){let e=Bi(t);for(;Vn(e)&&!Do(e);){if(Id(e))return e;if(Gl(e))return null;e=Bi(e)}return null}function Hd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var MM=new Set(["html","body","#document"]);function Do(t){return MM.has(No(t))}function Tn(t){return qt(t).getComputedStyle(t)}function Yl(t){return An(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Bi(t){if(No(t)==="html")return t;let e=t.assignedSlot||t.parentNode||C1(t)&&t.host||Un(t);return C1(e)?e.host:e}function R1(t){let e=Bi(t);return Do(e)?t.ownerDocument?t.ownerDocument.body:t.body:Vn(e)&&ts(e)?e:R1(e)}function es(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let r=R1(t),o=r===((i=t.ownerDocument)==null?void 0:i.body),a=qt(r);if(o){let s=zd(a);return e.concat(a,a.visualViewport||[],ts(r)?r:[],s&&n?es(s):[])}return e.concat(r,es(r,[],n))}function zd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function D1(t){let e=Tn(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,r=Vn(t),o=r?t.offsetWidth:n,a=r?t.offsetHeight:i,s=ql(n)!==o||ql(i)!==a;return s&&(n=o,i=a),{width:n,height:i,$:s}}function hm(t){return An(t)?t:t.contextElement}function ns(t){let e=hm(t);if(!Vn(e))return $n(1);let n=e.getBoundingClientRect(),{width:i,height:r,$:o}=D1(e),a=(o?ql(n.width):n.width)/i,s=(o?ql(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var NM=$n(0);function L1(t){let e=qt(t);return!Hd()||!e.visualViewport?NM:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function DM(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==qt(t)?!1:e}function Lo(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let r=t.getBoundingClientRect(),o=hm(t),a=$n(1);e&&(i?An(i)&&(a=ns(i)):a=ns(t));let s=DM(o,n,i)?L1(o):$n(0),l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,u=r.width/a.x,d=r.height/a.y;if(o){let h=qt(o),m=i&&An(i)?qt(i):i,S=h,_=zd(S);for(;_&&i&&m!==S;){let b=ns(_),f=_.getBoundingClientRect(),p=Tn(_),v=f.left+(_.clientLeft+parseFloat(p.paddingLeft))*b.x,y=f.top+(_.clientTop+parseFloat(p.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=v,c+=y,S=qt(_),_=zd(S)}}return Mo({width:u,height:d,x:l,y:c})}function Bd(t,e){let n=Yl(t).scrollLeft;return e?e.left+n:Lo(Un(t)).left+n}function I1(t,e){let n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Bd(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function LM(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t,o=r==="fixed",a=Un(i),s=e?Gl(e.floating):!1;if(i===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=$n(1),u=$n(0),d=Vn(i);if((d||!d&&!o)&&((No(i)!=="body"||ts(a))&&(l=Yl(i)),Vn(i))){let m=Lo(i);c=ns(i),u.x=m.x+i.clientLeft,u.y=m.y+i.clientTop}let h=a&&!d&&!o?I1(a,l):$n(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function IM(t){return Array.from(t.getClientRects())}function HM(t){let e=Un(t),n=Yl(t),i=t.ownerDocument.body,r=Hi(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=Hi(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),a=-n.scrollLeft+Bd(t),s=-n.scrollTop;return Tn(i).direction==="rtl"&&(a+=Hi(e.clientWidth,i.clientWidth)-r),{width:r,height:o,x:a,y:s}}var O1=25;function zM(t,e){let n=qt(t),i=Un(t),r=n.visualViewport,o=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){o=r.width,a=r.height;let u=Hd();(!u||u&&e==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}let c=Bd(i);if(c<=0){let u=i.ownerDocument,d=u.body,h=getComputedStyle(d),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,S=Math.abs(i.clientWidth-d.clientWidth-m);S<=O1&&(o-=S)}else c<=O1&&(o+=c);return{width:o,height:a,x:s,y:l}}var BM=new Set(["absolute","fixed"]);function FM(t,e){let n=Lo(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,o=Vn(t)?ns(t):$n(1),a=t.clientWidth*o.x,s=t.clientHeight*o.y,l=r*o.x,c=i*o.y;return{width:a,height:s,x:l,y:c}}function M1(t,e,n){let i;if(e==="viewport")i=zM(t,n);else if(e==="document")i=HM(Un(t));else if(An(e))i=FM(e,n);else{let r=L1(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Mo(i)}function H1(t,e){let n=Bi(t);return n===e||!An(n)||Do(n)?!1:Tn(n).position==="fixed"||H1(n,e)}function $M(t,e){let n=e.get(t);if(n)return n;let i=es(t,[],!1).filter(s=>An(s)&&No(s)!=="body"),r=null,o=Tn(t).position==="fixed",a=o?Bi(t):t;for(;An(a)&&!Do(a);){let s=Tn(a),l=Id(a);!l&&s.position==="fixed"&&(r=null),(o?!l&&!r:!l&&s.position==="static"&&!!r&&BM.has(r.position)||ts(a)&&!l&&H1(t,a))?i=i.filter(u=>u!==a):r=s,a=Bi(a)}return e.set(t,i),i}function UM(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t,a=[...n==="clippingAncestors"?Gl(e)?[]:$M(e,this._c):[].concat(n),i],s=a[0],l=a.reduce((c,u)=>{let d=M1(e,u,r);return c.top=Hi(d.top,c.top),c.right=Ir(d.right,c.right),c.bottom=Ir(d.bottom,c.bottom),c.left=Hi(d.left,c.left),c},M1(e,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function VM(t){let{width:e,height:n}=D1(t);return{width:e,height:n}}function jM(t,e,n){let i=Vn(e),r=Un(e),o=n==="fixed",a=Lo(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=$n(0);function c(){l.x=Bd(r)}if(i||!i&&!o)if((No(e)!=="body"||ts(r))&&(s=Yl(e)),i){let m=Lo(e,!0,o,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else r&&c();o&&!i&&r&&c();let u=r&&!i&&!o?I1(r,s):$n(0),d=a.left+s.scrollLeft-l.x-u.x,h=a.top+s.scrollTop-l.y-u.y;return{x:d,y:h,width:a.width,height:a.height}}function pm(t){return Tn(t).position==="static"}function N1(t,e){if(!Vn(t)||Tn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Un(t)===n&&(n=n.ownerDocument.body),n}function z1(t,e){let n=qt(t);if(Gl(t))return n;if(!Vn(t)){let r=Bi(t);for(;r&&!Do(r);){if(An(r)&&!pm(r))return r;r=Bi(r)}return n}let i=N1(t,e);for(;i&&T1(i)&&pm(i);)i=N1(i,e);return i&&Do(i)&&pm(i)&&!Id(i)?n:i||k1(t)||n}var PM=async function(t){let e=this.getOffsetParent||z1,n=this.getDimensions,i=await n(t.floating);return{reference:jM(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function qM(t){return Tn(t).direction==="rtl"}var ZM={convertOffsetParentRelativeRectToViewportRelativeRect:LM,getDocumentElement:Un,getClippingRect:UM,getOffsetParent:z1,getElementRects:PM,getClientRects:IM,getDimensions:VM,getScale:ns,isElement:An,isRTL:qM};function B1(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function GM(t,e){let n=null,i,r=Un(t);function o(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();let c=t.getBoundingClientRect(),{left:u,top:d,width:h,height:m}=c;if(s||e(),!h||!m)return;let S=Zl(d),_=Zl(r.clientWidth-(u+h)),b=Zl(r.clientHeight-(d+m)),f=Zl(u),v={rootMargin:-S+"px "+-_+"px "+-b+"px "+-f+"px",threshold:Hi(0,Ir(1,l))||1},y=!0;function w(A){let x=A[0].intersectionRatio;if(x!==l){if(!y)return a();x?a(!1,x):i=setTimeout(()=>{a(!1,1e-7)},1e3)}x===1&&!B1(c,t.getBoundingClientRect())&&a(),y=!1}try{n=new IntersectionObserver(w,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,v)}n.observe(t)}return a(!0),o}function Fd(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=hm(t),u=r||o?[...c?es(c):[],...es(e)]:[];u.forEach(f=>{r&&f.addEventListener("scroll",n,{passive:!0}),o&&f.addEventListener("resize",n)});let d=c&&s?GM(c,n):null,h=-1,m=null;a&&(m=new ResizeObserver(f=>{let[p]=f;p&&p.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(e)})),n()}),c&&!l&&m.observe(c),m.observe(e));let S,_=l?Lo(t):null;l&&b();function b(){let f=Lo(t);_&&!B1(_,f)&&n(),_=f,S=requestAnimationFrame(b)}return n(),()=>{var f;u.forEach(p=>{r&&p.removeEventListener("scroll",n),o&&p.removeEventListener("resize",n)}),d?.(),(f=m)==null||f.disconnect(),m=null,l&&cancelAnimationFrame(S)}}var $d=w1;var Ud=E1,Vd=S1;var F1=x1,$1=_1;var jd=(t,e,n)=>{let i=new Map,r={platform:ZM,...n},o={...r.platform,_c:i};return b1(t,e,{...r,platform:o})};function YM(t){let e=t.getBoundingClientRect(),n=window.innerWidth,i=window.innerHeight;if(!(e.width>n*.8||e.height>i*.8))return t;let o=Math.max(e.left,0),a=Math.max(e.top,0),s=Math.min(e.right,n),l=Math.min(e.bottom,i),c=(o+s)/2,u=(a+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:c,y:u,top:u,left:c,right:c,bottom:u}}}}function U1(t,e,n){let i=t.getBoundingClientRect();i.width>window.innerWidth*.8||i.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});let o=document.createElement("div");if(o.className="syntro-tooltip",o.setAttribute("role","tooltip"),o.innerHTML=dn(n.html),!n.trigger||n.trigger==="immediate"){let f=document.createElement("button");f.className="syntro-tooltip-close",f.setAttribute("aria-label","Close"),f.textContent="\xD7",Object.assign(f.style,{position:"absolute",top:"4px",right:"4px",background:"none",border:"none",color:"inherit",fontSize:"16px",lineHeight:"1",cursor:"pointer",opacity:"0.6",padding:"2px 4px"}),f.addEventListener("mouseenter",()=>{f.style.opacity="1"}),f.addEventListener("mouseleave",()=>{f.style.opacity="0.6"}),f.addEventListener("click",()=>b.destroy()),o.style.position="relative",o.appendChild(f)}let a=o.querySelectorAll("[data-syntro-action]"),s=f=>{let v=f.currentTarget.getAttribute("data-syntro-action");v&&n.onAction&&n.onAction(v)};a.forEach(f=>f.addEventListener("click",s));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let c=[$d(n.offsetPx??8),Vd(),Ud({padding:8}),F1(),$1({element:l})],u=n.placement&&n.placement!=="auto"?n.placement:"top",d=Fd(t,o,async()=>{if(!t.isConnected){b.destroy();return}let f=YM(t),p=await jd(f,o,{placement:u,strategy:"fixed",middleware:c}),{x:v,y,strategy:w,middlewareData:A,placement:x}=p;if(Object.assign(o.style,{left:`${v}px`,top:`${y}px`,position:w}),A.arrow){let{x:T,y:k}=A.arrow,E=x.split("-")[0],R={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:T!=null?`${T}px`:"",top:k!=null?`${k}px`:"",right:"",bottom:"",[R[E]]:"-4px"});let D={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${D[E]||"0deg"})`}}),h=f=>{f.key==="Escape"&&b.destroy()};window.addEventListener("keydown",h);let m=[];if(n.blocking){Array.from(document.body.children).forEach(p=>{p!==e&&p.getAttribute("inert")===null&&(p.setAttribute("inert",""),m.push(p.id||p.tagName))});let f=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(f.length>0){let p=f[0],v=f[f.length-1],y=w=>{w.key==="Tab"&&(w.shiftKey?document.activeElement===p&&(v.focus(),w.preventDefault()):document.activeElement===v&&(p.focus(),w.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>p.focus())}}let _=(()=>{if(n.trigger==="hover"){let f=()=>{o.style.visibility="visible",o.style.opacity="1"},p=()=>{o.style.visibility="hidden",o.style.opacity="0"};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",f),t.addEventListener("mouseleave",p),t.addEventListener("focus",f),t.addEventListener("blur",p),()=>{t.removeEventListener("mouseenter",f),t.removeEventListener("mouseleave",p),t.removeEventListener("focus",f),t.removeEventListener("blur",p)}}if(n.trigger==="click"){let f=()=>{o.style.visibility==="visible"?b.destroy():(o.style.visibility="visible",o.style.opacity="1")};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",f),()=>t.removeEventListener("click",f)}return o.style.opacity="0",o.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{o.style.opacity="1"}),()=>{}})(),b={el:o,destroy(){d(),_(),window.removeEventListener("keydown",h),a.forEach(f=>f.removeEventListener("click",s)),n.blocking&&Array.from(document.body.children).forEach(f=>{f!==e&&f.removeAttribute("inert")}),o.style.pointerEvents="none",o.style.opacity="0",setTimeout(()=>o.remove(),200)}};return b}var gm=X($e(),1),Pe=X(Qe(),1),G1=X(Ro(),1);var Ue=X($e(),1);function KM({completed:t,total:e}){let n=e>0?Math.round(t/e*100):0;return(0,Ue.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,Ue.jsx)("div",{role:"progressbar","aria-valuenow":n,"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:`${n}%`}})})}function QM({step:t,isCompleted:e,isCurrent:n,tourId:i,onStepClick:r}){return(0,Ue.jsxs)("button",{type:"button","data-testid":`step-${t.id}`,"data-current":n?"true":void 0,"data-completed":e?"true":void 0,"aria-current":n?"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 ${n?"se-font-semibold se-text-slate-grey-10":"se-text-slate-grey-8"}`,onClick:()=>r(i,t.id),children:[(0,Ue.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,Ue.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):n?(0,Ue.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,Ue.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,Ue.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function JM({workflow:t,expanded:e,onStepClick:n,onDismiss:i}){let r=t.completedSteps.length,o=t.steps.length;return(0,Ue.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,Ue.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,Ue.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,Ue.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,Ue.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:()=>i(t.tourId),"aria-label":`Dismiss ${t.meta.title}`,children:"\u2715"})]}),(0,Ue.jsxs)("div",{className:"se-mb-2",children:[(0,Ue.jsx)(KM,{completed:r,total:o}),(0,Ue.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[r," of ",o," steps"]})]}),(0,Ue.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(a=>(0,Ue.jsx)(QM,{step:a,isCompleted:t.completedSteps.includes(a.id),isCurrent:t.currentStepId===a.id,tourId:t.tourId,onStepClick:n},a.id))}),e&&t.meta.description&&(0,Ue.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function q1({workflows:t,expanded:e,onStepClick:n,onDismiss:i}){return t.length===0?(0,Ue.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,Ue.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(r=>(0,Ue.jsx)(JM,{workflow:r,expanded:e,onStepClick:n,onDismiss:i},r.tourId))})}function Z1(t,e){let n=document.createElement("div");n.setAttribute("data-testid","workflow-toast"),n.className="se-fixed se-bottom-4 se-right-4 se-z-50",Object.assign(n.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 i=document.createElement("div");if(i.className="se-font-semibold",i.style.fontWeight="600",i.textContent=e.title,n.appendChild(i),e.body){let a=document.createElement("div");a.className="se-mt-1 se-text-sm",a.style.marginTop="4px",a.style.fontSize="13px",a.style.color="var(--se-color-text-secondary, #666)",a.textContent=e.body,n.appendChild(a)}t.appendChild(n);let r,o=setTimeout(()=>{n.style.opacity="0",r=setTimeout(()=>{n.remove()},300)},4e3);return()=>{clearTimeout(o),clearTimeout(r),n.remove()}}function eN(t){let e=new Map;for(let n of t){let i=n.action;if(i.kind==="core:tour"&&i.workflow&&i.tourId){let r=i.workflow,a=(i.steps||[]).map(s=>({id:s.id,title:r.stepTitles?.[s.id]||s.id}));e.set(i.tourId,{meta:r,steps:a})}}return e}function tN({runtime:t}){let[e,n]=(0,Pe.useState)(0),i=(0,Pe.useMemo)(()=>{let b=t?.actions?.getActive?.()||[];return eN(b)},[t,e]),r=(0,Pe.useRef)(i);r.current=i,(0,Pe.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>n(b=>b+1))},[t]);let o=(0,Pe.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),a=(0,Pe.useRef)(new Set),s=(0,Pe.useRef)([]),l=(0,Pe.useRef)(null),c=(0,Pe.useRef)({}),[u,d]=(0,Pe.useState)([]),h=(0,Pe.useRef)(!1);if(!h.current&&o){let b=o.get?.("notified")||[];for(let p of b)a.current.add(p);let f=o.get?.("completed")||{};c.current={...f},h.current=!0}(0,Pe.useEffect)(()=>{if(i.size===0)return;let b=o?.get?.("dismissed")||[],f=o?.get?.("completed")||{};d(p=>{let v=new Set(p.map(w=>w.tourId)),y=[];for(let[w,{meta:A,steps:x}]of i){if(v.has(w))continue;let T="active";b.includes(w)?T="dismissed":f[w]&&(T="completed"),y.push({tourId:w,meta:A,steps:x,currentStepId:null,completedSteps:[],status:T,completedAt:f[w]||void 0})}return y.length>0?[...p,...y]:p});for(let[p,{meta:v}]of i)if(!a.current.has(p)&&v.notification&&l.current&&!b.includes(p)&&!f[p]){a.current.add(p),o?.set?.("notified",[...a.current]);let y=Z1(l.current,v.notification);s.current.push(y)}},[i,o]),(0,Pe.useEffect)(()=>{if(!t?.events?.subscribe)return;let b=t.events.subscribe({patterns:["^tour\\."]},f=>{let p=f.props?.tourId;if(!p)return;let v=r.current;if(!v.has(p)&&f.name==="tour.started"){n(y=>y+1);return}v.has(p)&&d(y=>y.map(A=>{if(A.tourId!==p)return A;switch(f.name){case"tour.started":{let x=f.props?.startStepId||A.steps[0]?.id||null;if(!a.current.has(p)){a.current.add(p),o?.set?.("notified",[...a.current]);let k=v.get(p);if(k?.meta.notification&&l.current){let E=Z1(l.current,k.meta.notification);s.current.push(E)}}let T=y.filter(k=>k.status==="active"||k.tourId===p).map(k=>k.tourId);return T.includes(p)||T.push(p),o?.set?.("active",[...new Set(T)]),{...A,status:"active",currentStepId:x,completedSteps:A.status==="active"?A.completedSteps:[]}}case"tour.step_started":{let x=f.props?.stepId;return{...A,currentStepId:x||A.currentStepId}}case"tour.step_changed":{let x=f.props?.previousStepId,T=f.props?.nextStepId,k=x&&!A.completedSteps.includes(x)?[...A.completedSteps,x]:A.completedSteps;return{...A,currentStepId:T||A.currentStepId,completedSteps:k}}case"tour.completed":{let x=Date.now();return c.current[p]=x,o?.set?.("completed",{...c.current}),{...A,status:"completed",currentStepId:null,completedSteps:A.steps.map(T=>T.id),completedAt:x}}case"tour.paused":return A;default:return A}}))});return()=>{b();for(let f of s.current)f();s.current=[]}},[t,o]);let m=(0,Pe.useCallback)((b,f)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:b,stepId:f})},[t]),S=(0,Pe.useCallback)(b=>{d(f=>{let p=f.map(y=>y.tourId===b?{...y,status:"dismissed"}:y),v=p.filter(y=>y.status==="dismissed").map(y=>y.tourId);return o?.set?.("dismissed",v),p})},[o]),_=(0,Pe.useMemo)(()=>u.filter(b=>b.status==="active"),[u]);return(0,gm.jsx)("div",{ref:l,children:(0,gm.jsx)(q1,{workflows:_,onStepClick:m,onDismiss:S})})}var Y1={mount(t,e){let n=e?.runtime||null,i=(0,G1.createRoot)(t);return i.render(Pe.default.createElement(tN,{runtime:n})),()=>{i.unmount()}}};var W1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=l1(n,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:t.style?.color,blocking:t.blocking??!1,onClickOutside:t.onClickOutside??!0,onEsc:t.onEsc??!0});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{i.destroy()}}},X1=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n&&e.waitForAnchor&&(n=await e.waitForAnchor(t.anchorId,3e3)),!n)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let i=t.duration??2e3;if(!document.querySelector("[data-syntro-pulse-styles]")){let a=document.createElement("style");a.setAttribute("data-syntro-pulse-styles",""),a.textContent=`
|
|
62
|
+
`}d+="</div>"}u.innerHTML=d,e.overlayRoot.appendChild(u);let h=null,g=u.querySelectorAll("[data-syntro-action]"),S=_=>{let C=_.currentTarget.getAttribute("data-syntro-action");C&&(h=C,e.publishEvent("action.modal_cta_clicked",{actionId:C}),y.destroy())};g.forEach(_=>_.addEventListener("click",S));let b=_=>{_.key==="Escape"&&i?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",b);let x=()=>{n||y.destroy()};l.addEventListener("click",x);let f=[];n&&Array.from(document.body.children).forEach(_=>{_!==e.overlayRoot&&_.getAttribute("inert")===null&&!_.querySelector("[data-syntro-editor-panel]")&&!_.hasAttribute("data-syntro-editor-panel")&&(_.setAttribute("inert",""),f.push(_))});let m;i?.timeoutMs&&(m=setTimeout(()=>{y.destroy()},i.timeoutMs));let v=u.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');v.length>0&&requestAnimationFrame(()=>v[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",u.style.opacity="1",u.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:r,blocking:n});let y={destroy(){m&&clearTimeout(m),window.removeEventListener("keydown",b),l.removeEventListener("click",x),g.forEach(_=>_.removeEventListener("click",S)),f.forEach(_=>_.removeAttribute("inert")),u.style.pointerEvents="none",l.style.pointerEvents="none",u.style.opacity="0",u.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{u.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:h})}};return{cleanup:()=>{y.destroy()}}};var Aw=["top","right","bottom","left"];var Pn=Math.min,Hr=Math.max,Zl=Math.round,Xl=Math.floor,Va=t=>({x:t,y:t}),qM={left:"right",right:"left",bottom:"top",top:"bottom"},zM={start:"end",end:"start"};function qd(t,e,a){return Hr(t,Pn(e,a))}function Bo(t,e){return typeof t=="function"?t(e):t}function Hn(t){return t.split("-")[0]}function rs(t){return t.split("-")[1]}function Lg(t){return t==="x"?"y":"x"}function zd(t){return t==="y"?"height":"width"}var VM=new Set(["top","bottom"]);function Ur(t){return VM.has(Hn(t))?"y":"x"}function Vd(t){return Lg(Ur(t))}function kw(t,e,a){a===void 0&&(a=!1);let r=rs(t),n=Vd(t),o=zd(n),i=n==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(i=Wl(i)),[i,Wl(i)]}function Ew(t){let e=Wl(t);return[Ud(t),e,Ud(e)]}function Ud(t){return t.replace(/start|end/g,e=>zM[e])}var Lw=["left","right"],Iw=["right","left"],$M=["top","bottom"],jM=["bottom","top"];function GM(t,e,a){switch(t){case"top":case"bottom":return a?e?Iw:Lw:e?Lw:Iw;case"left":case"right":return e?$M:jM;default:return[]}}function Tw(t,e,a,r){let n=rs(t),o=GM(Hn(t),a==="start",r);return n&&(o=o.map(i=>i+"-"+n),e&&(o=o.concat(o.map(Ud)))),o}function Wl(t){return t.replace(/left|right|bottom|top/g,e=>qM[e])}function WM(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ig(t){return typeof t!="number"?WM(t):{top:t,right:t,bottom:t,left:t}}function Fo(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 Rw(t,e,a){let{reference:r,floating:n}=t,o=Ur(e),i=Vd(e),s=zd(i),l=Hn(e),u=o==="y",c=r.x+r.width/2-n.width/2,d=r.y+r.height/2-n.height/2,h=r[s]/2-n[s]/2,g;switch(l){case"top":g={x:c,y:r.y-n.height};break;case"bottom":g={x:c,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-n.width,y:d};break;default:g={x:r.x,y:r.y}}switch(rs(e)){case"start":g[i]-=h*(a&&u?-1:1);break;case"end":g[i]+=h*(a&&u?-1:1);break}return g}async function Ow(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:h=!1,padding:g=0}=Bo(e,t),S=Ig(g),x=s[h?d==="floating"?"reference":"floating":d],f=Fo(await o.getClippingRect({element:(a=await(o.isElement==null?void 0:o.isElement(x)))==null||a?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),m=d==="floating"?{x:r,y:n,width:i.floating.width,height:i.floating.height}:i.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),y=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},_=Fo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:m,offsetParent:v,strategy:l}):m);return{top:(f.top-_.top+S.top)/y.y,bottom:(_.bottom-f.bottom+S.bottom)/y.y,left:(f.left-_.left+S.left)/y.x,right:(_.right-f.right+S.right)/y.x}}var Bw=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}=Rw(u,r,l),h=r,g={},S=0;for(let x=0;x<s.length;x++){var b;let{name:f,fn:m}=s[x],{x:v,y,data:_,reset:w}=await m({x:c,y:d,initialPlacement:r,placement:h,strategy:n,middlewareData:g,rects:u,platform:{...i,detectOverflow:(b=i.detectOverflow)!=null?b:Ow},elements:{reference:t,floating:e}});c=v??c,d=y??d,g={...g,[f]:{...g[f],..._}},w&&S<=50&&(S++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:n}):w.rects),{x:c,y:d}=Rw(u,h,l)),x=-1)}return{x:c,y:d,placement:h,strategy:n,middlewareData:g}},Fw=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}=Bo(t,e)||{};if(u==null)return{};let d=Ig(c),h={x:a,y:r},g=Vd(n),S=zd(g),b=await i.getDimensions(u),x=g==="y",f=x?"top":"left",m=x?"bottom":"right",v=x?"clientHeight":"clientWidth",y=o.reference[S]+o.reference[g]-h[g]-o.floating[S],_=h[g]-o.reference[g],w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u)),C=w?w[v]:0;(!C||!await(i.isElement==null?void 0:i.isElement(w)))&&(C=s.floating[v]||o.floating[S]);let A=y/2-_/2,E=C/2-b[S]/2-1,L=Pn(d[f],E),k=Pn(d[m],E),O=L,R=C-b[S]-k,N=C/2-b[S]/2+A,P=qd(O,N,R),F=!l.arrow&&rs(n)!=null&&N!==P&&o.reference[S]/2-(N<O?L:k)-b[S]/2<0,Q=F?N<O?N-O:N-R:0;return{[g]:h[g]+Q,data:{[g]:P,centerOffset:N-P-Q,...F&&{alignmentOffset:Q}},reset:F}}});var Nw=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:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:b=!0,...x}=Bo(t,e);if((a=o.arrow)!=null&&a.alignmentOffset)return{};let f=Hn(n),m=Ur(s),v=Hn(s)===s,y=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=h||(v||!b?[Wl(s)]:Ew(s)),w=S!=="none";!h&&w&&_.push(...Tw(s,b,S,y));let C=[s,..._],A=await l.detectOverflow(e,x),E=[],L=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&E.push(A[f]),d){let N=kw(n,i,y);E.push(A[N[0]],A[N[1]])}if(L=[...L,{placement:n,overflows:E}],!E.every(N=>N<=0)){var k,O;let N=(((k=o.flip)==null?void 0:k.index)||0)+1,P=C[N];if(P&&(!(d==="alignment"?m!==Ur(P):!1)||L.every(D=>Ur(D.placement)===m?D.overflows[0]>0:!0)))return{data:{index:N,overflows:L},reset:{placement:P}};let F=(O=L.filter(Q=>Q.overflows[0]<=0).sort((Q,D)=>Q.overflows[1]-D.overflows[1])[0])==null?void 0:O.placement;if(!F)switch(g){case"bestFit":{var R;let Q=(R=L.filter(D=>{if(w){let W=Ur(D.placement);return W===m||W==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(W=>W>0).reduce((W,dt)=>W+dt,0)]).sort((D,W)=>D[1]-W[1])[0])==null?void 0:R[0];Q&&(F=Q);break}case"initialPlacement":F=s;break}if(n!==F)return{reset:{placement:F}}}return{}}}};function Mw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Dw(t){return Aw.some(e=>t[e]>=0)}var Pw=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:a,platform:r}=e,{strategy:n="referenceHidden",...o}=Bo(t,e);switch(n){case"referenceHidden":{let i=await r.detectOverflow(e,{...o,elementContext:"reference"}),s=Mw(i,a.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Dw(s)}}}case"escaped":{let i=await r.detectOverflow(e,{...o,altBoundary:!0}),s=Mw(i,a.floating);return{data:{escapedOffsets:s,escaped:Dw(s)}}}default:return{}}}}};var ZM=new Set(["left","top"]);async function XM(t,e){let{placement:a,platform:r,elements:n}=t,o=await(r.isRTL==null?void 0:r.isRTL(n.floating)),i=Hn(a),s=rs(a),l=Ur(a)==="y",u=ZM.has(i)?-1:1,c=o&&l?-1:1,d=Bo(e,t),{mainAxis:h,crossAxis:g,alignmentAxis:S}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof S=="number"&&(g=s==="end"?S*-1:S),l?{x:g*c,y:h*u}:{x:h*u,y:g*c}}var Hw=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 XM(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}}}}},Uw=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:a,y:r,placement:n,platform:o}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:f=>{let{x:m,y:v}=f;return{x:m,y:v}}},...u}=Bo(t,e),c={x:a,y:r},d=await o.detectOverflow(e,u),h=Ur(Hn(n)),g=Lg(h),S=c[g],b=c[h];if(i){let f=g==="y"?"top":"left",m=g==="y"?"bottom":"right",v=S+d[f],y=S-d[m];S=qd(v,S,y)}if(s){let f=h==="y"?"top":"left",m=h==="y"?"bottom":"right",v=b+d[f],y=b-d[m];b=qd(v,b,y)}let x=l.fn({...e,[g]:S,[h]:b});return{...x,data:{x:x.x-a,y:x.y-r,enabled:{[g]:i,[h]:s}}}}}};function $d(){return typeof window<"u"}function No(t){return zw(t)?(t.nodeName||"").toLowerCase():"#document"}function Zt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $a(t){var e;return(e=(zw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function zw(t){return $d()?t instanceof Node||t instanceof Zt(t).Node:!1}function Ea(t){return $d()?t instanceof Element||t instanceof Zt(t).Element:!1}function ja(t){return $d()?t instanceof HTMLElement||t instanceof Zt(t).HTMLElement:!1}function qw(t){return!$d()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Zt(t).ShadowRoot}var YM=new Set(["inline","contents"]);function os(t){let{overflow:e,overflowX:a,overflowY:r,display:n}=Ta(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+a)&&!YM.has(n)}var KM=new Set(["table","td","th"]);function Vw(t){return KM.has(No(t))}var QM=[":popover-open",":modal"];function Yl(t){return QM.some(e=>{try{return t.matches(e)}catch{return!1}})}var JM=["transform","translate","scale","rotate","perspective"],e2=["transform","translate","scale","rotate","perspective","filter"],t2=["paint","layout","strict","content"];function jd(t){let e=Gd(),a=Ea(t)?Ta(t):t;return JM.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)||e2.some(r=>(a.willChange||"").includes(r))||t2.some(r=>(a.contain||"").includes(r))}function $w(t){let e=qr(t);for(;ja(e)&&!Po(e);){if(jd(e))return e;if(Yl(e))return null;e=qr(e)}return null}function Gd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var a2=new Set(["html","body","#document"]);function Po(t){return a2.has(No(t))}function Ta(t){return Zt(t).getComputedStyle(t)}function Kl(t){return Ea(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function qr(t){if(No(t)==="html")return t;let e=t.assignedSlot||t.parentNode||qw(t)&&t.host||$a(t);return qw(e)?e.host:e}function jw(t){let e=qr(t);return Po(e)?t.ownerDocument?t.ownerDocument.body:t.body:ja(e)&&os(e)?e:jw(e)}function ns(t,e,a){var r;e===void 0&&(e=[]),a===void 0&&(a=!0);let n=jw(t),o=n===((r=t.ownerDocument)==null?void 0:r.body),i=Zt(n);if(o){let s=Wd(i);return e.concat(i,i.visualViewport||[],os(n)?n:[],s&&a?ns(s):[])}return e.concat(n,ns(n,[],a))}function Wd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Xw(t){let e=Ta(t),a=parseFloat(e.width)||0,r=parseFloat(e.height)||0,n=ja(t),o=n?t.offsetWidth:a,i=n?t.offsetHeight:r,s=Zl(a)!==o||Zl(r)!==i;return s&&(a=o,r=i),{width:a,height:r,$:s}}function kg(t){return Ea(t)?t:t.contextElement}function is(t){let e=kg(t);if(!ja(e))return Va(1);let a=e.getBoundingClientRect(),{width:r,height:n,$:o}=Xw(e),i=(o?Zl(a.width):a.width)/r,s=(o?Zl(a.height):a.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var r2=Va(0);function Yw(t){let e=Zt(t);return!Gd()||!e.visualViewport?r2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function n2(t,e,a){return e===void 0&&(e=!1),!a||e&&a!==Zt(t)?!1:e}function Ho(t,e,a,r){e===void 0&&(e=!1),a===void 0&&(a=!1);let n=t.getBoundingClientRect(),o=kg(t),i=Va(1);e&&(r?Ea(r)&&(i=is(r)):i=is(t));let s=n2(o,a,r)?Yw(o):Va(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 h=Zt(o),g=r&&Ea(r)?Zt(r):r,S=h,b=Wd(S);for(;b&&r&&g!==S;){let x=is(b),f=b.getBoundingClientRect(),m=Ta(b),v=f.left+(b.clientLeft+parseFloat(m.paddingLeft))*x.x,y=f.top+(b.clientTop+parseFloat(m.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=v,u+=y,S=Zt(b),b=Wd(S)}}return Fo({width:c,height:d,x:l,y:u})}function Zd(t,e){let a=Kl(t).scrollLeft;return e?e.left+a:Ho($a(t)).left+a}function Kw(t,e){let a=t.getBoundingClientRect(),r=a.left+e.scrollLeft-Zd(t,a),n=a.top+e.scrollTop;return{x:r,y:n}}function o2(t){let{elements:e,rect:a,offsetParent:r,strategy:n}=t,o=n==="fixed",i=$a(r),s=e?Yl(e.floating):!1;if(r===i||s&&o)return a;let l={scrollLeft:0,scrollTop:0},u=Va(1),c=Va(0),d=ja(r);if((d||!d&&!o)&&((No(r)!=="body"||os(i))&&(l=Kl(r)),ja(r))){let g=Ho(r);u=is(r),c.x=g.x+r.clientLeft,c.y=g.y+r.clientTop}let h=i&&!d&&!o?Kw(i,l):Va(0);return{width:a.width*u.x,height:a.height*u.y,x:a.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:a.y*u.y-l.scrollTop*u.y+c.y+h.y}}function i2(t){return Array.from(t.getClientRects())}function s2(t){let e=$a(t),a=Kl(t),r=t.ownerDocument.body,n=Hr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Hr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),i=-a.scrollLeft+Zd(t),s=-a.scrollTop;return Ta(r).direction==="rtl"&&(i+=Hr(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:i,y:s}}var Gw=25;function l2(t,e){let a=Zt(t),r=$a(t),n=a.visualViewport,o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(n){o=n.width,i=n.height;let c=Gd();(!c||c&&e==="fixed")&&(s=n.offsetLeft,l=n.offsetTop)}let u=Zd(r);if(u<=0){let c=r.ownerDocument,d=c.body,h=getComputedStyle(d),g=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,S=Math.abs(r.clientWidth-d.clientWidth-g);S<=Gw&&(o-=S)}else u<=Gw&&(o+=u);return{width:o,height:i,x:s,y:l}}var u2=new Set(["absolute","fixed"]);function c2(t,e){let a=Ho(t,!0,e==="fixed"),r=a.top+t.clientTop,n=a.left+t.clientLeft,o=ja(t)?is(t):Va(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 Ww(t,e,a){let r;if(e==="viewport")r=l2(t,a);else if(e==="document")r=s2($a(t));else if(Ea(e))r=c2(e,a);else{let n=Yw(t);r={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return Fo(r)}function Qw(t,e){let a=qr(t);return a===e||!Ea(a)||Po(a)?!1:Ta(a).position==="fixed"||Qw(a,e)}function d2(t,e){let a=e.get(t);if(a)return a;let r=ns(t,[],!1).filter(s=>Ea(s)&&No(s)!=="body"),n=null,o=Ta(t).position==="fixed",i=o?qr(t):t;for(;Ea(i)&&!Po(i);){let s=Ta(i),l=jd(i);!l&&s.position==="fixed"&&(n=null),(o?!l&&!n:!l&&s.position==="static"&&!!n&&u2.has(n.position)||os(i)&&!l&&Qw(t,i))?r=r.filter(c=>c!==i):n=s,i=qr(i)}return e.set(t,r),r}function f2(t){let{element:e,boundary:a,rootBoundary:r,strategy:n}=t,i=[...a==="clippingAncestors"?Yl(e)?[]:d2(e,this._c):[].concat(a),r],s=i[0],l=i.reduce((u,c)=>{let d=Ww(e,c,n);return u.top=Hr(d.top,u.top),u.right=Pn(d.right,u.right),u.bottom=Pn(d.bottom,u.bottom),u.left=Hr(d.left,u.left),u},Ww(e,s,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function p2(t){let{width:e,height:a}=Xw(t);return{width:e,height:a}}function h2(t,e,a){let r=ja(e),n=$a(e),o=a==="fixed",i=Ho(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=Va(0);function u(){l.x=Zd(n)}if(r||!r&&!o)if((No(e)!=="body"||os(n))&&(s=Kl(e)),r){let g=Ho(e,!0,o,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else n&&u();o&&!r&&n&&u();let c=n&&!r&&!o?Kw(n,s):Va(0),d=i.left+s.scrollLeft-l.x-c.x,h=i.top+s.scrollTop-l.y-c.y;return{x:d,y:h,width:i.width,height:i.height}}function Ag(t){return Ta(t).position==="static"}function Zw(t,e){if(!ja(t)||Ta(t).position==="fixed")return null;if(e)return e(t);let a=t.offsetParent;return $a(t)===a&&(a=a.ownerDocument.body),a}function Jw(t,e){let a=Zt(t);if(Yl(t))return a;if(!ja(t)){let n=qr(t);for(;n&&!Po(n);){if(Ea(n)&&!Ag(n))return n;n=qr(n)}return a}let r=Zw(t,e);for(;r&&Vw(r)&&Ag(r);)r=Zw(r,e);return r&&Po(r)&&Ag(r)&&!jd(r)?a:r||$w(t)||a}var m2=async function(t){let e=this.getOffsetParent||Jw,a=this.getDimensions,r=await a(t.floating);return{reference:h2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function g2(t){return Ta(t).direction==="rtl"}var v2={convertOffsetParentRelativeRectToViewportRelativeRect:o2,getDocumentElement:$a,getClippingRect:f2,getOffsetParent:Jw,getElementRects:m2,getClientRects:i2,getDimensions:p2,getScale:is,isElement:Ea,isRTL:g2};function eL(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function y2(t,e){let a=null,r,n=$a(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:h,height:g}=u;if(s||e(),!h||!g)return;let S=Xl(d),b=Xl(n.clientWidth-(c+h)),x=Xl(n.clientHeight-(d+g)),f=Xl(c),v={rootMargin:-S+"px "+-b+"px "+-x+"px "+-f+"px",threshold:Hr(0,Pn(1,l))||1},y=!0;function _(w){let C=w[0].intersectionRatio;if(C!==l){if(!y)return i();C?i(!1,C):r=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!eL(u,t.getBoundingClientRect())&&i(),y=!1}try{a=new IntersectionObserver(_,{...v,root:n.ownerDocument})}catch{a=new IntersectionObserver(_,v)}a.observe(t)}return i(!0),o}function Xd(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=kg(t),c=n||o?[...u?ns(u):[],...ns(e)]:[];c.forEach(f=>{n&&f.addEventListener("scroll",a,{passive:!0}),o&&f.addEventListener("resize",a)});let d=u&&s?y2(u,a):null,h=-1,g=null;i&&(g=new ResizeObserver(f=>{let[m]=f;m&&m.target===u&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=g)==null||v.observe(e)})),a()}),u&&!l&&g.observe(u),g.observe(e));let S,b=l?Ho(t):null;l&&x();function x(){let f=Ho(t);b&&!eL(b,f)&&a(),b=f,S=requestAnimationFrame(x)}return a(),()=>{var f;c.forEach(m=>{n&&m.removeEventListener("scroll",a),o&&m.removeEventListener("resize",a)}),d?.(),(f=g)==null||f.disconnect(),g=null,l&&cancelAnimationFrame(S)}}var Yd=Hw;var Kd=Uw,Qd=Nw;var tL=Pw,aL=Fw;var Jd=(t,e,a)=>{let r=new Map,n={platform:v2,...a},o={...n.platform,_c:r};return Bw(t,e,{...n,platform:o})};function x2(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 rL(t,e,a){let r=t.getBoundingClientRect();r.width>window.innerWidth*.8||r.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});let o=document.createElement("div");if(o.className="syntro-tooltip",o.setAttribute("role","tooltip"),o.innerHTML=ha(a.html),!a.trigger||a.trigger==="immediate"){let f=document.createElement("button");f.className="syntro-tooltip-close",f.setAttribute("aria-label","Close"),f.textContent="\xD7",Object.assign(f.style,{position:"absolute",top:"4px",right:"4px",background:"none",border:"none",color:"inherit",fontSize:"16px",lineHeight:"1",cursor:"pointer",opacity:"0.6",padding:"2px 4px"}),f.addEventListener("mouseenter",()=>{f.style.opacity="1"}),f.addEventListener("mouseleave",()=>{f.style.opacity="0.6"}),f.addEventListener("click",()=>x.destroy()),o.style.position="relative",o.appendChild(f)}let i=o.querySelectorAll("[data-syntro-action]"),s=f=>{let v=f.currentTarget.getAttribute("data-syntro-action");v&&a.onAction&&a.onAction(v)};i.forEach(f=>f.addEventListener("click",s));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let u=[Yd(a.offsetPx??8),Qd(),Kd({padding:8}),tL(),aL({element:l})],c=a.placement&&a.placement!=="auto"?a.placement:"top",d=Xd(t,o,async()=>{if(!t.isConnected){x.destroy();return}let f=x2(t),m=await Jd(f,o,{placement:c,strategy:"fixed",middleware:u}),{x:v,y,strategy:_,middlewareData:w,placement:C}=m;if(Object.assign(o.style,{left:`${v}px`,top:`${y}px`,position:_}),w.arrow){let{x:A,y:E}=w.arrow,L=C.split("-")[0],k={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:A!=null?`${A}px`:"",top:E!=null?`${E}px`:"",right:"",bottom:"",[k[L]]:"-4px"});let O={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${O[L]||"0deg"})`}}),h=f=>{f.key==="Escape"&&x.destroy()};window.addEventListener("keydown",h);let g=[];if(a.blocking){Array.from(document.body.children).forEach(m=>{m!==e&&m.getAttribute("inert")===null&&(m.setAttribute("inert",""),g.push(m.id||m.tagName))});let f=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(f.length>0){let m=f[0],v=f[f.length-1],y=_=>{_.key==="Tab"&&(_.shiftKey?document.activeElement===m&&(v.focus(),_.preventDefault()):document.activeElement===v&&(m.focus(),_.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>m.focus())}}let b=(()=>{if(a.trigger==="hover"){let f=()=>{o.style.visibility="visible",o.style.opacity="1"},m=()=>{o.style.visibility="hidden",o.style.opacity="0"};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",f),t.addEventListener("mouseleave",m),t.addEventListener("focus",f),t.addEventListener("blur",m),()=>{t.removeEventListener("mouseenter",f),t.removeEventListener("mouseleave",m),t.removeEventListener("focus",f),t.removeEventListener("blur",m)}}if(a.trigger==="click"){let f=()=>{o.style.visibility==="visible"?x.destroy():(o.style.visibility="visible",o.style.opacity="1")};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",f),()=>t.removeEventListener("click",f)}return o.style.opacity="0",o.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{o.style.opacity="1"}),()=>{}})(),x={el:o,destroy(){d(),b(),window.removeEventListener("keydown",h),i.forEach(f=>f.removeEventListener("click",s)),a.blocking&&Array.from(document.body.children).forEach(f=>{f!==e&&f.removeAttribute("inert")}),o.style.pointerEvents="none",o.style.opacity="0",setTimeout(()=>o.remove(),200)}};return x}var Eg=Y(Re(),1),$e=Y(Ge(),1),uL=Y(Do(),1);var ze=Y(Re(),1);function C2({completed:t,total:e}){let a=e>0?Math.round(t/e*100):0;return(0,ze.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,ze.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 _2({step:t,isCompleted:e,isCurrent:a,tourId:r,onStepClick:n}){return(0,ze.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,ze.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,ze.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):a?(0,ze.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,ze.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,ze.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function w2({workflow:t,expanded:e,onStepClick:a,onDismiss:r}){let n=t.completedSteps.length,o=t.steps.length;return(0,ze.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,ze.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,ze.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,ze.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,ze.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,ze.jsxs)("div",{className:"se-mb-2",children:[(0,ze.jsx)(C2,{completed:n,total:o}),(0,ze.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[n," of ",o," steps"]})]}),(0,ze.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(i=>(0,ze.jsx)(_2,{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,ze.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function sL({workflows:t,expanded:e,onStepClick:a,onDismiss:r}){return t.length===0?(0,ze.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,ze.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(n=>(0,ze.jsx)(w2,{workflow:n,expanded:e,onStepClick:a,onDismiss:r},n.tourId))})}function lL(t,e){let a=document.createElement("div");a.setAttribute("data-testid","workflow-toast"),a.className="se-fixed se-bottom-4 se-right-4 se-z-50",Object.assign(a.style,{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483646",padding:"12px 16px",borderRadius:"8px",backgroundColor:"var(--se-color-bg-surface, #fff)",color:"var(--se-color-text-primary, #1a1a1a)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",maxWidth:"320px",fontFamily:"var(--se-font-family, system-ui, sans-serif)",fontSize:"14px",lineHeight:"1.4",transition:"opacity 0.3s ease"});let r=document.createElement("div");if(r.className="se-font-semibold",r.style.fontWeight="600",r.textContent=e.title,a.appendChild(r),e.body){let i=document.createElement("div");i.className="se-mt-1 se-text-sm",i.style.marginTop="4px",i.style.fontSize="13px",i.style.color="var(--se-color-text-secondary, #666)",i.textContent=e.body,a.appendChild(i)}t.appendChild(a);let n,o=setTimeout(()=>{a.style.opacity="0",n=setTimeout(()=>{a.remove()},300)},4e3);return()=>{clearTimeout(o),clearTimeout(n),a.remove()}}function L2(t){let e=new Map;for(let a of t){let r=a.action;if(r.kind==="core:tour"&&r.workflow&&r.tourId){let n=r.workflow,i=(r.steps||[]).map(s=>({id:s.id,title:n.stepTitles?.[s.id]||s.id}));e.set(r.tourId,{meta:n,steps:i})}}return e}function I2({runtime:t}){let[e,a]=(0,$e.useState)(0),r=(0,$e.useMemo)(()=>{let x=t?.actions?.getActive?.()||[];return L2(x)},[t,e]),n=(0,$e.useRef)(r);n.current=r,(0,$e.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>a(x=>x+1))},[t]);let o=(0,$e.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),i=(0,$e.useRef)(new Set),s=(0,$e.useRef)([]),l=(0,$e.useRef)(null),u=(0,$e.useRef)({}),[c,d]=(0,$e.useState)([]),h=(0,$e.useRef)(!1);if(!h.current&&o){let x=o.get?.("notified")||[];for(let m of x)i.current.add(m);let f=o.get?.("completed")||{};u.current={...f},h.current=!0}(0,$e.useEffect)(()=>{if(r.size===0)return;let x=o?.get?.("dismissed")||[],f=o?.get?.("completed")||{};d(m=>{let v=new Set(m.map(_=>_.tourId)),y=[];for(let[_,{meta:w,steps:C}]of r){if(v.has(_))continue;let A="active";x.includes(_)?A="dismissed":f[_]&&(A="completed"),y.push({tourId:_,meta:w,steps:C,currentStepId:null,completedSteps:[],status:A,completedAt:f[_]||void 0})}return y.length>0?[...m,...y]:m});for(let[m,{meta:v}]of r)if(!i.current.has(m)&&v.notification&&l.current&&!x.includes(m)&&!f[m]){i.current.add(m),o?.set?.("notified",[...i.current]);let y=lL(l.current,v.notification);s.current.push(y)}},[r,o]),(0,$e.useEffect)(()=>{if(!t?.events?.subscribe)return;let x=t.events.subscribe({patterns:["^tour\\."]},f=>{let m=f.props?.tourId;if(!m)return;let v=n.current;if(!v.has(m)&&f.name==="tour.started"){a(y=>y+1);return}v.has(m)&&d(y=>y.map(w=>{if(w.tourId!==m)return w;switch(f.name){case"tour.started":{let C=f.props?.startStepId||w.steps[0]?.id||null;if(!i.current.has(m)){i.current.add(m),o?.set?.("notified",[...i.current]);let E=v.get(m);if(E?.meta.notification&&l.current){let L=lL(l.current,E.meta.notification);s.current.push(L)}}let A=y.filter(E=>E.status==="active"||E.tourId===m).map(E=>E.tourId);return A.includes(m)||A.push(m),o?.set?.("active",[...new Set(A)]),{...w,status:"active",currentStepId:C,completedSteps:w.status==="active"?w.completedSteps:[]}}case"tour.step_started":{let C=f.props?.stepId;return{...w,currentStepId:C||w.currentStepId}}case"tour.step_changed":{let C=f.props?.previousStepId,A=f.props?.nextStepId,E=C&&!w.completedSteps.includes(C)?[...w.completedSteps,C]:w.completedSteps;return{...w,currentStepId:A||w.currentStepId,completedSteps:E}}case"tour.completed":{let C=Date.now();return u.current[m]=C,o?.set?.("completed",{...u.current}),{...w,status:"completed",currentStepId:null,completedSteps:w.steps.map(A=>A.id),completedAt:C}}case"tour.paused":return w;default:return w}}))});return()=>{x();for(let f of s.current)f();s.current=[]}},[t,o]);let g=(0,$e.useCallback)((x,f)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:x,stepId:f})},[t]),S=(0,$e.useCallback)(x=>{d(f=>{let m=f.map(y=>y.tourId===x?{...y,status:"dismissed"}:y),v=m.filter(y=>y.status==="dismissed").map(y=>y.tourId);return o?.set?.("dismissed",v),m})},[o]),b=(0,$e.useMemo)(()=>c.filter(x=>x.status==="active"),[c]);return(0,Eg.jsx)("div",{ref:l,children:(0,Eg.jsx)(sL,{workflows:b,onStepClick:g,onDismiss:S})})}var cL={mount(t,e){let a=e?.runtime||null,r=(0,uL.createRoot)(t);return r.render($e.default.createElement(I2,{runtime:a})),()=>{r.unmount()}}};var dL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=ww(a,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:t.style?.color,blocking:t.blocking??!1,onClickOutside:t.onClickOutside??!0,onEsc:t.onEsc??!0});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{r.destroy()}}},fL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=t.duration??4e3;await new Promise(b=>requestAnimationFrame(b));let n=b=>({r:parseInt(b.slice(1,3),16),g:parseInt(b.slice(3,5),16),b:parseInt(b.slice(5,7),16)}),i={r:79,g:70,b:229},s=null;try{let b=getComputedStyle(e.overlayRoot),x=b.getPropertyValue("--sc-color-primary")?.trim(),f=b.getPropertyValue("--sc-color-primary-hover")?.trim();x?.startsWith("#")&&x.length>=7&&(i=n(x)),f?.startsWith("#")&&f.length>=7&&(s=n(f))}catch{}let l=document.querySelector("[data-syntro-pulse-styles]");l&&l.remove();let u=document.createElement("style");u.setAttribute("data-syntro-pulse-styles","");let{r:c,g:d,b:h}=i;if(s){let{r:b,g:x,b:f}=s;u.textContent=`
|
|
62
63
|
@keyframes syntro-pulse-anim {
|
|
63
64
|
0%, 100% {
|
|
64
|
-
box-shadow: 0 0 0 0 rgba(
|
|
65
|
+
box-shadow: 0 0 0 0 rgba(${c}, ${d}, ${h}, 0.35);
|
|
66
|
+
}
|
|
67
|
+
25% {
|
|
68
|
+
box-shadow: 0 0 0 12px rgba(${c}, ${d}, ${h}, 0);
|
|
69
|
+
}
|
|
70
|
+
50% {
|
|
71
|
+
box-shadow: 0 0 0 0 rgba(${b}, ${x}, ${f}, 0.35);
|
|
72
|
+
}
|
|
73
|
+
75% {
|
|
74
|
+
box-shadow: 0 0 0 12px rgba(${b}, ${x}, ${f}, 0);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`}else u.textContent=`
|
|
78
|
+
@keyframes syntro-pulse-anim {
|
|
79
|
+
0%, 100% {
|
|
80
|
+
box-shadow: 0 0 0 0 rgba(${c}, ${d}, ${h}, 0.35);
|
|
65
81
|
}
|
|
66
82
|
50% {
|
|
67
|
-
box-shadow: 0 0 0
|
|
83
|
+
box-shadow: 0 0 0 12px rgba(${c}, ${d}, ${h}, 0);
|
|
68
84
|
}
|
|
69
85
|
}
|
|
70
|
-
|
|
86
|
+
`;document.head.appendChild(u);let g=a.style.animation;a.style.animation="syntro-pulse-anim 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite",a.setAttribute("data-syntro-pulse","true");let S=setTimeout(()=>{a.style.animation=g,a.removeAttribute("data-syntro-pulse")},r);return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:pulse",anchorId:t.anchorId,duration:r}),{cleanup:()=>{clearTimeout(S),a.style.animation=g,a.removeAttribute("data-syntro-pulse")}}},pL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r="#4f46e5";try{let s=getComputedStyle(e.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();s?.startsWith("#")&&s.length>=7&&(r=s)}catch{}let n=document.createElement("div");n.textContent=t.content,n.setAttribute("data-syntro-badge",t.anchorId.selector),Object.assign(n.style,{position:"absolute",padding:"2px 6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",color:"white",background:r,borderRadius:"9999px",pointerEvents:"none",zIndex:"2147483646",whiteSpace:"nowrap"});let o=t.position??"top-right",i=a.style.position;switch(getComputedStyle(a).position==="static"&&(a.style.position="relative"),a.appendChild(n),o){case"top-left":Object.assign(n.style,{top:"-8px",left:"-8px"});break;case"top-right":Object.assign(n.style,{top:"-8px",right:"-8px"});break;case"bottom-left":Object.assign(n.style,{bottom:"-8px",left:"-8px"});break;case"bottom-right":Object.assign(n.style,{bottom:"-8px",right:"-8px"});break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:badge",anchorId:t.anchorId,content:t.content,position:o}),{cleanup:()=>{n.remove(),i!==void 0&&(a.style.position=i)},updateFn:s=>{"content"in s&&typeof s.content=="string"&&(n.textContent=s.content)}}},hL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let{content:r}=t,n="";if(r.title&&(n+=`<div class="syntro-tt-title">${ha(r.title)}</div>`),n+=`<div class="syntro-tt-body">${ha(r.body)}</div>`,r.ctaButtons&&r.ctaButtons.length>0){n+='<div class="syntro-tt-actions">';for(let i of r.ctaButtons){let s=i.primary??!1;n+=`
|
|
71
87
|
<button
|
|
72
88
|
class="syntro-tt-btn ${s?"syntro-tt-btn-primary":""}"
|
|
73
|
-
data-syntro-action="${
|
|
89
|
+
data-syntro-action="${ha(i.actionId)}"
|
|
74
90
|
>
|
|
75
|
-
${
|
|
91
|
+
${ha(i.label)}
|
|
76
92
|
</button>
|
|
77
|
-
`}
|
|
93
|
+
`}n+="</div>"}else r.cta&&(n+=`<div class="syntro-tt-actions">
|
|
78
94
|
<button class="syntro-tt-btn syntro-tt-btn-primary" data-syntro-action="cta">
|
|
79
|
-
${
|
|
95
|
+
${ha(r.cta.label)}
|
|
80
96
|
</button>
|
|
81
|
-
</div>`);let o=
|
|
97
|
+
</div>`);let o=rL(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()}}},Tg=[{kind:"overlays:highlight",executor:dL},{kind:"overlays:pulse",executor:fL},{kind:"overlays:badge",executor:pL},{kind:"overlays:tooltip",executor:hL},{kind:"overlays:modal",executor:wg},{kind:"core:tour",executor:Cg},{kind:"overlays:celebrate",executor:Cw}],Rg={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, celebrations, visual overlays, and workflow tracking",executors:Tg,widgets:[{id:"adaptive-overlays:workflow-tracker",component:cL,metadata:{name:"Workflow Tracker",icon:"\u{1F4CB}",description:"Tracks multi-step workflow progress across tours"}}]};function Mg(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 h=a.surfaces.mount(u,c,{...d,adaptiveId:e});return{unmount:()=>h.unmount(),update:g=>h.update(g)}},canMount:(u,c)=>a.surfaces.canMount(u,c)},events:{subscribe:u=>a.events.subscribe(c=>{u(c)}),publish:(u,c)=>{a.events.publish(u,{...c,_appId:e})}},registerAction:u=>{a.executors.register(u.kind,u.executor,u.schema,e,r),o.push(u.kind)},registerWidget:u=>{a.widgets.register(u.id,u.component,e,u.metadata),i.push(u.id)}}}function Dg(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var A2=new Set(["overlays:highlight","overlays:pulse","overlays:badge","overlays:tooltip","overlays:modal","content:insertHtml","content:setText","content:setAttr","content:addClass","content:removeClass","content:setStyle","core:mountWidget","core:wait","core:sequence","core:parallel","core:tour"]),k2={faq:"adaptive-faq",nav:"adaptive-nav",gamification:"adaptive-gamification",chatbot:"adaptive-chatbot"};function mL(t){return k2[t]??t}function gL(t){return A2.has(t)}function vL(t){if(gL(t))return null;let e=t.indexOf(":");return e===-1?null:mL(t.slice(0,e))}function Og(t){let e=t.indexOf(":");return e===-1?null:mL(t.slice(0,e))}function Bg(t){let{cdnBase:e,registry:a,timeout:r=1e4,onLoadStart:n,onLoadEnd:o}=t,i=new Map,s=new Set,l=new Map;function u(b){return`${e}/adaptives/${b}/index.js`}async function c(b){if(a.has(b))return{appId:b,success:!0,manifest:a.get(b)?.manifest};if(l.has(b))return l.get(b);if(i.has(b))return i.get(b);let x=(async()=>{n?.(b);try{let f=u(b);if(s.has(f)){let _=a.get(b);if(_)return o?.(b,!0),{appId:b,success:!0,manifest:_.manifest}}let m=new Promise((_,w)=>{setTimeout(()=>w(new Error(`Timeout loading app: ${b}`)),r)}),v=d(f,b);await Promise.race([v,m]),s.add(f);let y=a.get(b);if(!y)throw new Error(`App ${b} did not register after loading`);return o?.(b,!0),{appId:b,success:!0,manifest:y.manifest}}catch(f){let m=f instanceof Error?f.message:String(f);o?.(b,!1,m);let v={appId:b,success:!1,error:m};return l.set(b,v),v}finally{i.delete(b)}})();return i.set(b,x),x}async function d(b,x){if(typeof window<"u"){try{let f=await import(b);f.manifest?a.register(f.manifest):f.default?.manifest?a.register(f.default.manifest):f.default&&a.register(f.default);return}catch{}return new Promise((f,m)=>{let v=document.createElement("script");v.src=b,v.async=!0,v.onload=()=>{a.get(x)?f():m(new Error(`App ${x} did not self-register`))},v.onerror=()=>{m(new Error(`Failed to load app script: ${b}`))},document.head.appendChild(v)})}throw new Error("Dynamic app loading not supported in SSR")}function h(b){let x=new Set;if(b.apps)for(let f of b.apps)x.add(f);if(b.actions)for(let f of b.actions){let m=vL(f.kind);if(m&&x.add(m),f.kind==="core:mountWidget"){let v=f.widget?.widgetId;if(v){let y=Og(v);y&&x.add(y)}}}if(b.tiles){for(let f of b.tiles)if(f.widget){let m=Og(f.widget);m&&x.add(m)}}return Array.from(x)}async function g(b){let x=h(b);return x.length===0?[]:await Promise.all(x.map(m=>c(m)))}async function S(b){return Promise.all(b.map(x=>c(x)))}return{loadApp:c,loadAppsForConfig:g,preloadApps:S,getRequiredApps:h,getAppUrl:u}}var tf=class{constructor(){$(this,"apps",new Map);$(this,"eventListeners",new Set);$(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,a]of this.apps)a.state==="active"&&await this.deactivate(e);this.runtime=null}register(e){if(!e.id||typeof e.id!="string")throw new Error("App manifest must have an 'id' property");if(!e.version||typeof e.version!="string")throw new Error("App manifest must have a 'version' property");if(!e.name||typeof e.name!="string")throw new Error("App manifest must have a 'name' property");if(this.apps.has(e.id)){if(this.apps.get(e.id).state==="active")throw new Error(`Cannot re-register active app: ${e.id}`);console.warn(`[AppRegistry] Overriding existing app registration: ${e.id}`)}let a={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,a),this.emit({type:"app:registered",appId:e.id,manifest:e}),a}async activate(e){let a=this.apps.get(e);if(!a)throw new Error(`App not registered: ${e}`);if(a.state==="active"||a.state==="activating"){console.warn(`[AppRegistry] App already ${a.state}: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(a.manifest.dependencies)for(let r of a.manifest.dependencies){let n=this.apps.get(r);if(!n||n.state!=="active")throw new Error(`App ${e} depends on ${r}, which is not active`)}a.state="activating";try{let r=a.manifest.metadata?.isBuiltIn===!0,n=Mg({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)}Dg(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()}},Ql=new tf;var Wa=Y(Re(),1);var Uo=Y(Ge(),1),Ng=Y(Do(),1);var zr=Y(Ge(),1);var yL=/```json\s*\n([\s\S]*?)```/g;function xL(t){let e=[],a=t,r=[],n;for(yL.lastIndex=0;(n=yL.exec(t))!==null;)r.push({fullMatch:n[0],json:n[1],index:n.index});for(let o=r.length-1;o>=0;o--){let{fullMatch:i,json:s}=r[o],l;try{l=JSON.parse(s)}catch{continue}typeof l=="object"&&l!==null&&"kind"in l&&typeof l.kind=="string"&&(e.unshift(l),a=a.replace(i,""))}return a=a.replace(/\n{3,}/g,`
|
|
82
98
|
|
|
83
|
-
`).trim(),{displayText:
|
|
84
|
-
<div style="padding: 16px; font-family: system-ui; color: ${
|
|
85
|
-
<p style="margin: 0 0 8px; color: ${
|
|
86
|
-
<p style="margin: 0; font-size: 12px; color: ${
|
|
99
|
+
`).trim(),{displayText:a,actions:e}}var Jl=class extends Error{constructor(e){super(e),this.name="AuthError"}};function E2(){let t=document.cookie.match(/stytch_session_jwt=([^;]*)/);if(!t||!t[1])throw new Jl("No authentication token found");let e=localStorage.getItem("syntrologie_workspace_id");if(!e)throw new Jl("No workspace ID found");return{Authorization:`Bearer ${t[1]}`,"X-Workspace-Id":e}}async function bL(t,e){let a=E2(),r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...a},body:JSON.stringify(e)});if(!r.ok)throw r.status===401?new Jl("Session expired or unauthorized"):new Error(`Chat request failed: ${r.status} ${r.statusText}`);return r.json()}var T2=0;function Fg(){return`msg-${Date.now()}-${++T2}`}function SL(t){let{backendUrl:e,tileId:a,runtime:r,greeting:n,maxHistory:o=20,mlflowRunId:i,config:s}=t,[l,u]=(0,zr.useState)(()=>n?[{id:Fg(),role:"assistant",text:n,timestamp:Date.now()}]:[]),[c,d]=(0,zr.useState)(!1),[h,g]=(0,zr.useState)(null),S=(0,zr.useRef)(null),b=(0,zr.useCallback)(async f=>{let m=f.trim();if(!m)return;g(null);let v={id:Fg(),role:"user",text:m,timestamp:Date.now()};u(y=>[...y,v]),d(!0);try{let _=[...l,v].slice(-o).map(L=>({role:L.role,content:L.text})),w=await bL(e,{message:m,history:_,mlflow_run_id:i,current_config:s}),{displayText:C,actions:A}=xL(w.response),E={id:Fg(),role:"assistant",text:C,timestamp:Date.now()};u(L=>[...L,E]),A.length>0&&(S.current?.isApplied()&&await S.current.revertAll(),S.current=await r.actions.applyBatch(A),r.events.publish("chatbot.actions_applied",{count:A.length,kinds:A.map(L=>L.kind),tileId:a}))}catch(y){let _=y instanceof Error?y.message:"An unexpected error occurred";g(_)}finally{d(!1)}},[e,l,o,i,s,r,a]),x=(0,zr.useCallback)(()=>{u([]),g(null),S.current?.isApplied()&&(S.current.revertAll(),S.current=null),sessionStorage.removeItem(`syntro:chatbot:history:${a}`)},[a]);return{messages:l,isLoading:c,error:h,sendMessage:b,clearMessages:x}}var Ga={container:{display:"flex",flexDirection:"column",height:"100%",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"14px",touchAction:"none"},messageList:{flex:1,overflowY:"auto",padding:"12px",display:"flex",flexDirection:"column",gap:"8px"},messageBubble:{maxWidth:"85%",padding:"8px 12px",borderRadius:"12px",lineHeight:1.5,wordBreak:"break-word"},userMessage:{alignSelf:"flex-end",backgroundColor:Ft[4],color:za.white,borderBottomRightRadius:"4px"},assistantMessage:{alignSelf:"flex-start",backgroundColor:"rgba(255, 255, 255, 0.08)",color:I[10],borderBottomLeftRadius:"4px"},loadingDots:{alignSelf:"flex-start",padding:"8px 16px",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:"12px",color:I[8],fontSize:"13px"},errorBanner:{padding:"8px 12px",backgroundColor:"rgba(239, 68, 68, 0.1)",color:qe[4],fontSize:"13px",borderRadius:"8px",margin:"0 12px"},inputForm:{display:"flex",gap:"8px",padding:"12px",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},input:{flex:1,padding:"8px 12px",borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.1)",backgroundColor:"rgba(0, 0, 0, 0.2)",color:I[12],fontSize:"14px",outline:"none",fontFamily:"inherit"},sendButton:{padding:"8px 16px",borderRadius:"8px",border:"none",backgroundColor:Ft[4],color:za.white,fontWeight:600,fontSize:"13px",cursor:"pointer",whiteSpace:"nowrap"},sendButtonDisabled:{opacity:.5,cursor:"not-allowed"}};function R2({message:t}){let e=t.role==="user",a={...Ga.messageBubble,...e?Ga.userMessage:Ga.assistantMessage};return(0,Wa.jsx)("div",{style:a,children:t.text})}function M2({config:t,runtime:e,tileId:a}){let{messages:r,isLoading:n,error:o,sendMessage:i,clearMessages:s}=SL({backendUrl:t.backendUrl,tileId:a,runtime:e,greeting:t.greeting,maxHistory:t.maxHistory,mlflowRunId:t.mlflowRunId}),l=(0,Uo.useRef)(null),u=(0,Uo.useRef)(null);(0,Uo.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[]);let c=d=>{d.preventDefault();let h=u.current;if(!h||!h.value.trim()||n)return;let g=h.value;h.value="",i(g)};return(0,Wa.jsxs)("div",{style:Ga.container,"data-testid":"chat-assistant",children:[(0,Wa.jsxs)("div",{ref:l,style:Ga.messageList,children:[r.map(d=>(0,Wa.jsx)(R2,{message:d},d.id)),n&&(0,Wa.jsx)("div",{style:Ga.loadingDots,children:"Thinking..."})]}),o&&(0,Wa.jsx)("div",{style:Ga.errorBanner,children:o}),(0,Wa.jsxs)("form",{onSubmit:c,style:Ga.inputForm,children:[(0,Wa.jsx)("input",{ref:u,style:Ga.input,placeholder:"Ask anything...",disabled:n,"data-testid":"chat-input"}),(0,Wa.jsx)("button",{type:"submit",disabled:n,style:{...Ga.sendButton,...n?Ga.sendButtonDisabled:{}},"data-testid":"chat-send",children:"Send"})]})]})}var CL={mount(t,e){let{config:a,runtime:r,tileId:n="chatbot-widget"}=e||{};if(a&&r&&typeof Ng.createRoot=="function"){let o=(0,Ng.createRoot)(t);return o.render(Uo.default.createElement(M2,{config:a,runtime:r,tileId:n})),()=>{o.unmount()}}return!a||!r?(t.innerHTML=`<div style="padding: 16px; color: ${I[8]};">Chat widget requires config and runtime.</div>`,()=>{t.innerHTML=""}):(t.innerHTML=`
|
|
100
|
+
<div style="padding: 16px; font-family: system-ui; color: ${I[10]};">
|
|
101
|
+
<p style="margin: 0 0 8px; color: ${I[8]};">${a.greeting||"Hi! How can I help?"}</p>
|
|
102
|
+
<p style="margin: 0; font-size: 12px; color: ${I[7]};">Chat widget mounted. Awaiting React renderer.</p>
|
|
87
103
|
</div>
|
|
88
|
-
`,()=>{t.innerHTML=""})}};var sE={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:aE,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function lE(t,e,n){if(e){let i=t.getState().items.find(r=>r.config.id===e);if(i)return i}if(n){let i=t.findByQuestion(n);if(i)return i}throw new Error("FAQ item not found")}async function lN(t,e,n){let i=lE(n,t.itemId,t.itemQuestion),{id:r}=i.config;t.expand!==!1&&n.expand(r);let o=document.querySelector(`[data-faq-item-id="${r}"]`);return o&&o.scrollIntoView({behavior:t.behavior??"smooth"}),e.publishEvent("faq:scroll_to",{itemId:r}),{cleanup:()=>{}}}async function cN(t,e,n){let i=lE(n,t.itemId,t.itemQuestion),{id:r}=i.config,o=t.state??"toggle",a;switch(o){case"open":n.expand(r),a="open";break;case"closed":n.collapse(r),a="closed";break;default:{let s=n.getState().expandedItems.has(r);n.toggle(r),a=s?"closed":"open";break}}return e.publishEvent("faq:toggle",{itemId:r,newState:a}),{cleanup:()=>{}}}async function uN(t,e,n){switch(t.operation){case"add":{let i=t.items??[],r=t.position==="prepend"?"prepend":"append";n.addItems(i,r);break}case"remove":{if(!t.itemId)throw new Error("FAQ item not found");if(!n.getState().items.some(r=>r.config.id===t.itemId))throw new Error("FAQ item not found");n.removeItem(t.itemId);break}case"reorder":{let i=t.order??[];n.reorderItems(i);break}case"replace":{let i=t.items??[];n.replaceItems(i);break}}return e.publishEvent("faq:update",{operation:t.operation}),{cleanup:()=>{}}}var cE=[{kind:"faq:scroll_to",executor:lN},{kind:"faq:toggle_item",executor:cN},{kind:"faq:update",executor:uN}];var Ve=X($e(),1);var ke=X(Qe(),1),Em=X(Ro(),1);function uE(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function dN(t){return typeof t=="string"?(0,Ve.jsx)("p",{style:{margin:0},children:t}):t.type==="rich"?(0,Ve.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}}):(0,Ve.jsx)("p",{style:{margin:0},children:t.content})}function fN(t){return t?t===!0?{style:"thumbs"}:t:null}function pN(t){return t.prompt||"Was this helpful?"}var Tt={container:{fontFamily:"system-ui, -apple-system, sans-serif",maxWidth:"800px",margin:"0 auto"},searchWrapper:{marginBottom:"16px"},searchInput:{width:"100%",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",outline:"none",transition:"border-color 0.15s ease"},accordion:{display:"flex",flexDirection:"column",gap:"8px"},item:{borderRadius:"8px",overflow:"hidden",transition:"box-shadow 0.15s ease"},question:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",border:"none",cursor:"pointer",fontSize:"15px",fontWeight:500,textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"18px",transition:"transform 0.2s ease"},answer:{padding:"0 20px 16px 20px",fontSize:"14px",lineHeight:1.6,overflow:"hidden",transition:"max-height 0.2s ease, padding 0.2s ease"},category:{display:"inline-block",fontSize:"11px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"4px 8px",borderRadius:"4px",marginBottom:"8px"},categoryHeader:{fontSize:"13px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",padding:"12px 4px 6px 4px",marginTop:"8px"},feedback:{display:"flex",alignItems:"center",gap:"8px",marginTop:"12px",paddingTop:"10px",borderTop:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"13px"},feedbackButton:{background:"none",border:"1px solid transparent",cursor:"pointer",fontSize:"16px",padding:"4px 8px",borderRadius:"4px",transition:"background-color 0.15s ease, border-color 0.15s ease"},feedbackButtonSelected:{borderColor:"rgba(0, 0, 0, 0.2)",backgroundColor:"rgba(0, 0, 0, 0.04)"},emptyState:{textAlign:"center",padding:"48px 24px",fontSize:"14px"},noResults:{textAlign:"center",padding:"32px 16px",fontSize:"14px"}},is={light:{container:{backgroundColor:_t.white,color:C[1]},searchInput:{backgroundColor:C[12],border:`1px solid ${C[11]}`,color:C[1]},item:{backgroundColor:C[12],border:`1px solid ${C[11]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},question:{backgroundColor:"transparent",color:C[1]},questionHover:{backgroundColor:C[12]},answer:{color:C[6]},category:{backgroundColor:at[8],color:at[2]},categoryHeader:{color:C[7]},emptyState:{color:C[8]},feedbackPrompt:{color:C[7]}},dark:{container:{backgroundColor:C[1],color:C[12]},searchInput:{backgroundColor:C[3],border:`1px solid ${C[5]}`,color:C[12]},item:{backgroundColor:C[3],border:`1px solid ${C[5]}`},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},question:{backgroundColor:"transparent",color:C[12]},questionHover:{backgroundColor:C[5]},answer:{color:C[8]},category:{backgroundColor:at[0],color:at[6]},categoryHeader:{color:C[8]},emptyState:{color:C[7]},feedbackPrompt:{color:C[8]}}};function hN({item:t,isExpanded:e,isHighlighted:n,onToggle:i,theme:r,feedbackConfig:o,feedbackValue:a,onFeedback:s}){let[l,c]=(0,ke.useState)(!1),u=is[r],{question:d,answer:h}=t.config,m={...Tt.item,...u.item,...e?u.itemExpanded:{},...n?{boxShadow:"0 0 0 2px #6366f1, 0 0 12px rgba(99, 102, 241, 0.4)",transition:"box-shadow 0.3s ease"}:{}},S={...Tt.question,...u.question,...l?u.questionHover:{}},_={...Tt.chevron,transform:e?"rotate(180deg)":"rotate(0deg)"},b={...Tt.answer,...u.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},f={...Tt.feedback,...u.feedbackPrompt};return(0,Ve.jsxs)("div",{style:m,"data-faq-item-id":t.config.id,children:[(0,Ve.jsxs)("button",{type:"button",style:S,onClick:i,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-expanded":e,children:[(0,Ve.jsx)("span",{children:d}),(0,Ve.jsx)("span",{style:_,children:"\u25BC"})]}),(0,Ve.jsxs)("div",{style:b,"aria-hidden":!e,children:[dN(h),e&&o&&(0,Ve.jsxs)("div",{style:f,children:[(0,Ve.jsx)("span",{children:pN(o)}),(0,Ve.jsx)("button",{type:"button",style:{...Tt.feedbackButton,...a==="up"?Tt.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>s(t.config.id,d,"up"),children:"\u{1F44D}"}),(0,Ve.jsx)("button",{type:"button",style:{...Tt.feedbackButton,...a==="down"?Tt.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>s(t.config.id,d,"down"),children:"\u{1F44E}"})]})]})]})}function gN({config:t,runtime:e,instanceId:n}){let[i,r]=(0,ke.useReducer)(R=>R+1,0),[o,a]=(0,ke.useState)(new Set),[s,l]=(0,ke.useState)(null),[c,u]=(0,ke.useState)(""),[d,h]=(0,ke.useState)(new Map),m=(0,ke.useMemo)(()=>fN(t.feedback),[t.feedback]);(0,ke.useEffect)(()=>e.context.subscribe(()=>{r()}),[e.context]),(0,ke.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{r()})},[e.accumulator]),(0,ke.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let N=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(H=>{let B=H.props?.actionId;return typeof B=="string"&&B.startsWith("faq:open:")}).pop();if(N&&Date.now()-N.ts<1e4){let H=N.props.actionId.replace("faq:open:","");a(new Set([H])),requestAnimationFrame(()=>{let B=document.querySelector(`[data-faq-item-id="${H}"]`);B&&B.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},D=>{let N=D.props?.actionId;if(typeof N!="string"||!N.startsWith("faq:open:"))return;let H=N.replace("faq:open:","");a(new Set([H])),requestAnimationFrame(()=>{let B=document.querySelector(`[data-faq-item-id="${H}"]`);B&&B.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]),(0,ke.useEffect)(()=>{if(!e.events.subscribe)return;let R=N=>{let H=N.props?.tileId,B=N.props?.itemId;H===n&&B&&(a(new Set([B])),l(B),setTimeout(()=>l(null),1500),requestAnimationFrame(()=>{let z=document.querySelector(`[data-faq-item-id="${B}"]`);z&&z.scrollIntoView({behavior:"smooth",block:"center"})}))};if(e.events.getRecent){let H=e.events.getRecent({names:["notification.deep_link"]},5).filter(B=>B.props?.tileId===n&&B.props?.itemId).pop();H&&Date.now()-H.ts<1e4&&R(H)}return e.events.subscribe({names:["notification.deep_link"]},R)},[e,n]);let S=(0,ke.useMemo)(()=>t.actions.filter(R=>R.triggerWhen?e.evaluateSync(R.triggerWhen).value:!0),[t.actions,e,i]),_=(0,ke.useMemo)(()=>t.ordering==="priority"?[...S].sort((R,D)=>(D.config.priority??0)-(R.config.priority??0)):S,[S,t.ordering]),b=(0,ke.useMemo)(()=>{if(!t.searchable||!c.trim())return _;let R=c.toLowerCase();return _.filter(D=>D.config.question.toLowerCase().includes(R)||uE(D.config.answer).toLowerCase().includes(R)||D.config.category?.toLowerCase().includes(R))},[_,c,t.searchable]),f=(0,ke.useMemo)(()=>{let R=new Map;for(let D of b){let N=D.config.category;R.has(N)||R.set(N,[]),R.get(N).push(D)}return R},[b]),p=(0,ke.useMemo)(()=>b.some(R=>R.config.category),[b]),v=(0,ke.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),y=(0,ke.useCallback)(R=>{a(D=>{let N=new Set(D);return t.expandBehavior==="single"?D.has(R)?new Set:new Set([R]):(D.has(R)?N.delete(R):N.add(R),N)}),e.events.publish("faq:toggled",{instanceId:n,questionId:R,expanded:!o.has(R),timestamp:Date.now()})},[t.expandBehavior,e.events,n,o]),w=(0,ke.useCallback)((R,D,N)=>{h(H=>{let B=new Map(H);return B.set(R,N),B}),e.events.publish("faq:feedback",{itemId:R,question:D,value:N})},[e.events]),A={...Tt.container,...is[v].container},x={...Tt.searchInput,...is[v].searchInput},T={...Tt.emptyState,...is[v].emptyState},k={...Tt.categoryHeader,...is[v].categoryHeader},E=R=>R.map(D=>(0,Ve.jsx)(hN,{item:D,isExpanded:o.has(D.config.id),isHighlighted:s===D.config.id,onToggle:()=>y(D.config.id),theme:v,feedbackConfig:m,feedbackValue:d.get(D.config.id),onFeedback:w},D.config.id));return S.length===0?(0,Ve.jsx)("div",{style:A,"data-adaptive-id":n,"data-adaptive-type":"adaptive-faq",children:(0,Ve.jsx)("div",{style:T,children:"No FAQ questions available."})}):(0,Ve.jsxs)("div",{style:A,"data-adaptive-id":n,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,Ve.jsx)("div",{style:Tt.searchWrapper,children:(0,Ve.jsx)("input",{type:"text",placeholder:"Search questions...",value:c,onChange:R=>u(R.target.value),style:x})}),(0,Ve.jsx)("div",{style:Tt.accordion,children:p?Array.from(f.entries()).map(([R,D])=>(0,Ve.jsxs)(ke.default.Fragment,{children:[R&&(0,Ve.jsx)("div",{style:k,"data-category-header":R,children:R}),E(D)]},R??"__ungrouped")):E(b)}),t.searchable&&b.length===0&&c&&(0,Ve.jsxs)("div",{style:{...Tt.noResults,...is[v].emptyState},children:['No questions found matching "',c,'"']})]})}var dE={mount(t,e){let{runtime:n,instanceId:i="faq-widget",...r}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(n&&typeof Em.createRoot=="function"){let a=(0,Em.createRoot)(t);return a.render(ke.default.createElement(gN,{config:r,runtime:n,instanceId:i})),()=>{a.unmount()}}let o=r.actions||[];return t.innerHTML=`
|
|
104
|
+
`,()=>{t.innerHTML=""})}};var _L={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:CL,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function wL(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 D2(t,e,a){let r=wL(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 O2(t,e,a){let r=wL(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 B2(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 LL=[{kind:"faq:scroll_to",executor:D2},{kind:"faq:toggle_item",executor:O2},{kind:"faq:update",executor:B2}];var Pe=Y(Re(),1);var ke=Y(Ge(),1),Pg=Y(Do(),1);function IL(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function F2(t){return typeof t=="string"?(0,Pe.jsx)("p",{style:{margin:0},children:t}):t.type==="rich"?(0,Pe.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}}):(0,Pe.jsx)("p",{style:{margin:0},children:t.content})}function N2(t){return t?t===!0?{style:"thumbs"}:t:null}function P2(t){return t.prompt||"Was this helpful?"}var kt={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"}},ss={light:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${I[11]}`},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},question:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},questionHover:{backgroundColor:"var(--sc-content-background-hover)"},answer:{color:"var(--sc-content-text-secondary-color)"},category:{backgroundColor:Ft[8],color:Ft[2]},categoryHeader:{color:I[7]},emptyState:{color:I[8]},feedbackPrompt:{color:I[7]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${I[5]}`},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},question:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},questionHover:{backgroundColor:"var(--sc-content-background-hover)"},answer:{color:"var(--sc-content-text-secondary-color)"},category:{backgroundColor:Ft[0],color:Ft[6]},categoryHeader:{color:I[8]},emptyState:{color:I[7]},feedbackPrompt:{color:I[8]}}};function H2({item:t,isExpanded:e,isHighlighted:a,isLast:r,onToggle:n,theme:o,feedbackConfig:i,feedbackValue:s,onFeedback:l}){let[u,c]=(0,ke.useState)(!1),d=ss[o],{question:h,answer:g}=t.config,S={...kt.item,...d.item,...e?d.itemExpanded:{},...a?{boxShadow:"0 0 0 2px #6366f1, 0 0 12px rgba(99, 102, 241, 0.4)",transition:"box-shadow 0.3s ease"}:{},...r?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},b={...kt.question,...d.question,...u?d.questionHover:{}},x={...kt.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},f={...kt.answer,...d.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},m={...kt.feedback,...d.feedbackPrompt};return(0,Pe.jsxs)("div",{style:S,"data-faq-item-id":t.config.id,children:[(0,Pe.jsxs)("button",{type:"button",style:b,onClick:n,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-expanded":e,children:[(0,Pe.jsx)("span",{children:h}),(0,Pe.jsx)("span",{style:x,children:"\u203A"})]}),(0,Pe.jsxs)("div",{style:f,"aria-hidden":!e,children:[F2(g),e&&i&&(0,Pe.jsxs)("div",{style:m,children:[(0,Pe.jsx)("span",{children:P2(i)}),(0,Pe.jsx)("button",{type:"button",style:{...kt.feedbackButton,...s==="up"?kt.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>l(t.config.id,h,"up"),children:"\u{1F44D}"}),(0,Pe.jsx)("button",{type:"button",style:{...kt.feedbackButton,...s==="down"?kt.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>l(t.config.id,h,"down"),children:"\u{1F44E}"})]})]})]})}function U2({config:t,runtime:e,instanceId:a}){let[r,n]=(0,ke.useReducer)(k=>k+1,0),[o,i]=(0,ke.useState)(new Set),[s,l]=(0,ke.useState)(null),[u,c]=(0,ke.useState)(""),[d,h]=(0,ke.useState)(new Map),g=(0,ke.useMemo)(()=>N2(t.feedback),[t.feedback]);(0,ke.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,ke.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]),(0,ke.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let R=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(N=>{let P=N.props?.actionId;return typeof P=="string"&&P.startsWith("faq:open:")}).pop();if(R&&Date.now()-R.ts<1e4){let N=R.props.actionId.replace("faq:open:","");i(new Set([N])),requestAnimationFrame(()=>{let P=document.querySelector(`[data-faq-item-id="${N}"]`);P&&P.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},O=>{let R=O.props?.actionId;if(typeof R!="string"||!R.startsWith("faq:open:"))return;let N=R.replace("faq:open:","");i(new Set([N])),requestAnimationFrame(()=>{let P=document.querySelector(`[data-faq-item-id="${N}"]`);P&&P.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]),(0,ke.useEffect)(()=>{if(!e.events.subscribe)return;let k=R=>{let N=R.props?.tileId,P=R.props?.itemId;N===a&&P&&(i(new Set([P])),l(P),setTimeout(()=>l(null),1500),requestAnimationFrame(()=>{let F=document.querySelector(`[data-faq-item-id="${P}"]`);F&&F.scrollIntoView({behavior:"smooth",block:"center"})}))};if(e.events.getRecent){let N=e.events.getRecent({names:["notification.deep_link"]},5).filter(P=>P.props?.tileId===a&&P.props?.itemId).pop();N&&Date.now()-N.ts<1e4&&k(N)}return e.events.subscribe({names:["notification.deep_link"]},k)},[e,a]);let S=(0,ke.useMemo)(()=>t.actions.filter(k=>k.triggerWhen?e.evaluateSync(k.triggerWhen).value:!0),[t.actions,e,r]),b=(0,ke.useMemo)(()=>t.ordering==="priority"?[...S].sort((k,O)=>(O.config.priority??0)-(k.config.priority??0)):S,[S,t.ordering]),x=(0,ke.useMemo)(()=>{if(!t.searchable||!u.trim())return b;let k=u.toLowerCase();return b.filter(O=>O.config.question.toLowerCase().includes(k)||IL(O.config.answer).toLowerCase().includes(k)||O.config.category?.toLowerCase().includes(k))},[b,u,t.searchable]),f=(0,ke.useMemo)(()=>{let k=new Map;for(let O of x){let R=O.config.category;k.has(R)||k.set(R,[]),k.get(R).push(O)}return k},[x]),m=(0,ke.useMemo)(()=>x.some(k=>k.config.category),[x]),v=(0,ke.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),y=(0,ke.useCallback)(k=>{i(O=>{let R=new Set(O);return t.expandBehavior==="single"?O.has(k)?new Set:new Set([k]):(O.has(k)?R.delete(k):R.add(k),R)}),e.events.publish("faq:toggled",{instanceId:a,questionId:k,expanded:!o.has(k),timestamp:Date.now()})},[t.expandBehavior,e.events,a,o]),_=(0,ke.useCallback)((k,O,R)=>{h(N=>{let P=new Map(N);return P.set(k,R),P}),e.events.publish("faq:feedback",{itemId:k,question:O,value:R})},[e.events]),w={...kt.container,...ss[v].container},C={...kt.searchInput,...ss[v].searchInput},A={...kt.emptyState,...ss[v].emptyState},E={...kt.categoryHeader,...ss[v].categoryHeader},L=k=>k.map((O,R)=>(0,Pe.jsx)(H2,{item:O,isExpanded:o.has(O.config.id),isHighlighted:s===O.config.id,isLast:R===k.length-1,onToggle:()=>y(O.config.id),theme:v,feedbackConfig:g,feedbackValue:d.get(O.config.id),onFeedback:_},O.config.id));return S.length===0?(0,Pe.jsx)("div",{style:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:(0,Pe.jsx)("div",{style:A,children:"No FAQ questions available."})}):(0,Pe.jsxs)("div",{style:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,Pe.jsxs)("div",{style:kt.searchWrapper,children:[(0,Pe.jsx)("style",{children:`[data-adaptive-id="${a}"] input::placeholder { color: var(--sc-content-search-color, inherit); opacity: 0.7; }`}),(0,Pe.jsx)("input",{type:"text",placeholder:"Search questions...",value:u,onChange:k=>c(k.target.value),style:C})]}),(0,Pe.jsx)("div",{style:kt.accordion,children:m?Array.from(f.entries()).map(([k,O])=>(0,Pe.jsxs)(ke.default.Fragment,{children:[k&&(0,Pe.jsx)("div",{style:E,"data-category-header":k,children:k}),L(O)]},k??"__ungrouped")):L(x)}),t.searchable&&x.length===0&&u&&(0,Pe.jsxs)("div",{style:{...kt.noResults,...ss[v].emptyState},children:['No questions found matching "',u,'"']})]})}var AL={mount(t,e){let{runtime:a,instanceId:r="faq-widget",...n}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(a&&typeof Pg.createRoot=="function"){let i=(0,Pg.createRoot)(t);return i.render(ke.default.createElement(U2,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
|
|
89
105
|
<div style="font-family: system-ui; max-width: 800px;">
|
|
90
|
-
${o.map(
|
|
91
|
-
<div style="margin-bottom: 8px; padding: 16px; background: ${
|
|
92
|
-
<strong>${
|
|
93
|
-
<p style="margin-top: 8px; color: ${
|
|
106
|
+
${o.map(i=>`
|
|
107
|
+
<div style="margin-bottom: 8px; padding: 16px; background: ${I[12]}; border-radius: 8px;">
|
|
108
|
+
<strong>${i.config.question}</strong>
|
|
109
|
+
<p style="margin-top: 8px; color: ${I[6]};">${IL(i.config.answer)}</p>
|
|
94
110
|
</div>
|
|
95
111
|
`).join("")}
|
|
96
112
|
</div>
|
|
97
|
-
`,()=>{t.innerHTML=""}}};var
|
|
113
|
+
`,()=>{t.innerHTML=""}}};var kL={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:LL,widgets:[{id:"adaptive-faq:accordion",component:AL,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 q2=async(t,e)=>{let{badgeId:a}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:a,awardedAt:Date.now()}),{cleanup:()=>{}}},z2=async(t,e)=>{let{points:a,reason:r}=t;return e.publishEvent("gamification.points_added",{points:a,reason:r,timestamp:Date.now()}),{cleanup:()=>{}}},V2={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},$2=[{kind:"gamification:awardBadge",executor:q2},{kind:"gamification:addPoints",executor:z2}],j2=[V2],EL={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:$2,eventHandlers:j2};var _t=Y(Re(),1);var it=Y(Ge(),1),Hg=Y(Do(),1);function af(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Za={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"}},rf={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 G2({item:t,isExpanded:e,isLast:a,onToggle:r,onNavigate:n,theme:o}){let[i,s]=(0,it.useState)(!1),l=rf[o],{title:u,description:c,href:d,icon:h,external:g}=t.config,S={...Za.item,...l.item,...e?l.itemExpanded:{},...a?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},b={...Za.header,...l.header,...i?l.headerHover:{}},x={...Za.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},f={...Za.body,...l.body,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},m=v=>{v.preventDefault(),v.stopPropagation(),d&&n(d,g??!1)};return(0,_t.jsxs)("div",{style:S,"data-nav-tip-id":t.config.id,children:[(0,_t.jsxs)("button",{type:"button",style:b,onClick:r,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),"aria-expanded":e,children:[h&&(0,_t.jsx)("span",{style:Za.icon,children:h}),(0,_t.jsx)("span",{children:u}),(0,_t.jsx)("span",{style:x,children:"\u203A"})]}),(0,_t.jsxs)("div",{style:f,"aria-hidden":!e,children:[(0,_t.jsx)("p",{style:Za.description,children:c}),d&&(0,_t.jsxs)("a",{href:d,onClick:m,style:{...Za.linkButton,...l.linkButton},target:g?"_blank":void 0,rel:g?"noopener noreferrer":void 0,children:["Go ",g?"\u2197":"\u2192"]})]})]})}function W2({config:t,runtime:e,instanceId:a}){let[r,n]=(0,it.useReducer)(f=>f+1,0),[o,i]=(0,it.useState)(new Set);(0,it.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,it.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]);let s=(0,it.useMemo)(()=>t.actions.filter(f=>{if(!f.triggerWhen)return!0;try{return e.evaluateSync(f.triggerWhen).value}catch{return!1}}),[t.actions,e,r]),l=(0,it.useMemo)(()=>{let f=new Map;for(let m of s){let v=m.config.category;f.has(v)||f.set(v,[]),f.get(v).push(m)}return f},[s]),u=(0,it.useMemo)(()=>s.some(f=>f.config.category),[s]),c=(0,it.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),d=(0,it.useCallback)(f=>{i(m=>{let v=m.has(f),y;if(t.expandBehavior==="single"){for(let _ of m)_!==f&&e.events.publish("nav:toggled",{instanceId:a,tipId:_,expanded:!1,timestamp:Date.now()});y=v?new Set:new Set([f])}else y=new Set(m),v?y.delete(f):y.add(f);return e.events.publish("nav:toggled",{instanceId:a,tipId:f,expanded:!v,timestamp:Date.now()}),y})},[t.expandBehavior,e.events,a]),h=(0,it.useCallback)((f,m)=>{let v=f.trim().toLowerCase();if(!(v.startsWith("javascript:")||v.startsWith("data:")))if(e.events.publish("nav:tip_clicked",{instanceId:a,href:f,external:m,timestamp:Date.now()}),m)window.open(f,"_blank","noopener,noreferrer");else{let y=new URL(f,window.location.origin);y.search=window.location.search,window.location.href=y.toString()}},[e.events,a]),g={...Za.container,...rf[c].container},S={...Za.categoryHeader,...rf[c].categoryHeader},b={...Za.emptyState,...rf[c].emptyState},x=f=>f.map((m,v)=>(0,_t.jsx)(G2,{item:m,isExpanded:o.has(m.config.id),isLast:v===f.length-1,onToggle:()=>d(m.config.id),onNavigate:h,theme:c},m.config.id));return s.length===0?(0,_t.jsx)("div",{style:g,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,_t.jsx)("div",{style:b,children:"No navigation tips available."})}):(0,_t.jsx)("div",{style:g,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,_t.jsx)("div",{style:Za.accordion,children:u?Array.from(l.entries()).map(([f,m])=>(0,_t.jsxs)(it.default.Fragment,{children:[f&&(0,_t.jsx)("div",{style:S,"data-category-header":f,children:f}),x(m)]},f??"__ungrouped")):x(s)})})}var TL={mount(t,e){let{runtime:a,instanceId:r="nav-widget",...n}=e||{expandBehavior:"single",theme:"auto",actions:[]};if(a&&typeof Hg.createRoot=="function"){let i=(0,Hg.createRoot)(t);return i.render(it.default.createElement(W2,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
|
|
98
114
|
<div style="font-family: system-ui; max-width: 100%;">
|
|
99
|
-
${o.map(
|
|
100
|
-
<div style="margin-bottom: 4px; padding: 12px 16px; background: ${
|
|
101
|
-
${
|
|
102
|
-
<p style="margin-top: 8px; color: ${
|
|
103
|
-
${
|
|
115
|
+
${o.map(i=>`
|
|
116
|
+
<div style="margin-bottom: 4px; padding: 12px 16px; background: ${I[12]}; border-radius: 8px;">
|
|
117
|
+
${i.config.icon?`<span>${af(i.config.icon)}</span> `:""}<strong>${af(i.config.title)}</strong>
|
|
118
|
+
<p style="margin-top: 8px; color: ${I[6]}; font-size: 13px;">${af(i.config.description)}</p>
|
|
119
|
+
${i.config.href?`<a href="${af(i.config.href)}" style="color: ${Ft[2]}; font-size: 13px;">Go →</a>`:""}
|
|
104
120
|
</div>
|
|
105
121
|
`).join("")}
|
|
106
122
|
</div>
|
|
107
|
-
`,()=>{t.innerHTML=""}}};var
|
|
123
|
+
`,()=>{t.innerHTML=""}}};var Z2=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 X2(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}var Y2=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&&X2(a)?(window.history.pushState(null,"",a),window.dispatchEvent(new PopStateEvent("popstate"))):window.location.href=a,{cleanup:()=>{}}},K2=[{kind:"navigation:scrollTo",executor:Z2},{kind:"navigation:navigate",executor:Y2}],RL={id:"adaptive-nav",version:"2.0.0",name:"Navigation Tips",description:"Navigation actions and accordion-based tips with per-item conditional visibility",executors:K2,widgets:[{id:"adaptive-nav:tips",component:TL,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 Q2=[_L,xg,kL,EL,RL,Rg],J2=Q2.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 ML(t){let e=0;for(let a of J2)t.has(a.id)||(t.register(a),e++);console.log("[Syntro Runtime] Registered",e,"built-in runtime modules")}var DL={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important",hostLoadingSelector:"",waitForHostReady:""};function OL(t={}){let{timeout:e,className:a,style:r,hostLoadingSelector:n,waitForHostReady:o}={...DL,...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 eD(t={}){let{className:e,style:a}={...DL,...t};return`
|
|
108
124
|
(function() {
|
|
109
125
|
var s = document.createElement('style');
|
|
110
|
-
s.textContent = '.${e} { ${
|
|
126
|
+
s.textContent = '.${e} { ${a} }';
|
|
111
127
|
document.head.appendChild(s);
|
|
112
128
|
document.documentElement.className += ' ${e}';
|
|
113
|
-
})();`}function
|
|
129
|
+
})();`}function nf(t,e,a="first-match"){for(let r of e){let n=t.getFeatureValue?.(r,null);if(!n||typeof n!="object")continue;let o=n,i=o.tiles&&o.tiles.length>0,s=o.actions&&o.actions.length>0;if(i||s)return{tiles:o.tiles??[],actions:o.actions??[],fetchedAt:o.fetchedAt??new Date().toISOString(),...o.schemaVersion&&{schemaVersion:o.schemaVersion},...o.configVersion&&{configVersion:o.configVersion},...o.canvasTitle&&{canvasTitle:o.canvasTitle},...o.theme&&{theme:o.theme},...o.launcher&&{launcher:o.launcher}}}return null}var Ug=!1;function BL(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function qg(t){if(BL()){Ug=!0;return}Ug=t??!1}function tD(){return BL()?!0:Ug}function Z(t,e,a){tD()&&(a!==void 0?console.log(`[${t}]`,e,a):console.log(`[${t}]`,e))}function ma(t,e,a){a!==void 0?console.warn(`[${t}]`,e,a):console.warn(`[${t}]`,e)}function of(t,e,a){a!==void 0?console.error(`[${t}]`,e,a):console.error(`[${t}]`,e)}var zg="2.4.0-canary.24";var Un="2.0";var aD=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function rD(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):aD.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 nD(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var FL="syntro_config_cache",oD=1440*60*1e3;function NL(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function iD(t,e){if(NL())try{let a={config:t,timestamp:Date.now(),sdkVersion:e};localStorage.setItem(FL,JSON.stringify(a))}catch{}}function sD(t){if(!NL())return null;try{let e=localStorage.getItem(FL);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>oD?null:a.config}catch{return null}}var Vg=({configUri:t,experiments:e,featureKey:a="smart-canvas-config-uri"})=>{if(t)return t;let r=e?.getFeatureValue?.(a,null);if(r)return r};function lD(t,e,a){if(e){let r=t.getFeatureValue?.(e,null);if(r&&typeof r=="object"){let n=r.variant_flags;if(n&&n.length>0)return n}}if(a&&t.getAllFeatures){let r=t.getAllFeatures();return Object.keys(r).filter(n=>n.startsWith(a))}return[]}var ls=({configUri:t,experiments:e,featureKey:a,credentials:r,configFeatureKey:n="smart-canvas-config",manifestKey:o,variantFlagPrefix:i,sdkVersion:s})=>async()=>{if(e&&n){let c=e.getFeatureValue?.(n,null);if(c&&typeof c=="object")return Z("SmartCanvas Config","Resolved config directly from feature flag",c),c}if(e&&(o||i)){let c=lD(e,o,i);if(c.length>0){let d=nf(e,c);if(d)return Z("SmartCanvas Config","Resolved config from variant flags",d),d}}let l=Vg({configUri:t,experiments:e,featureKey:a});if(!l)return Z("SmartCanvas Config","No config available \u2014 returning empty config"),{tiles:[],actions:[],fetchedAt:new Date().toISOString()};if(!rD(l))throw new Error(`SmartCanvas: config URI not allowed: ${l}`);let u=r??(nD(l)?"include":"omit");try{let c=await fetch(l,{credentials:u,headers:{"X-SDK-Version":zg,"X-SDK-Schema-Version":Un}});if(!c.ok)throw new Error(`SmartCanvas: failed to fetch config (${c.status})`);let d=await c.json();return Z("SmartCanvas Config","Fetched config from URI",d),s&&iD(d,s),d}catch(c){if(s){let d=sD(s);if(d)return Z("SmartCanvas Config","Serving config from offline cache"),d}throw c}};var uD=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function PL(t){if(typeof window>"u")return null;let a=new URLSearchParams(window.location.search).get(t);if(!a)return null;try{let r=a.replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(atob(r))}catch(r){return ma("Syntro Runtime",`Failed to decode ${t}:`,r),null}}var us,cs;function qn(){if(us==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.token)us={token:t.token,api_base:t.apiBase||""},console.log(`[DIAG] getEditorSource: from __SYNTRO_EDITOR_PARAMS__ (token=${us.token.slice(0,15)}...)`);else{let e=PL("editor_source");e&&(us=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 us??null}function qo(){if(cs==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.mode)cs={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=${cs.mode})`);else{let e=PL("editor_conf");e&&(cs=e),console.log(`[DIAG] getEditorConf: from URL param \u2192 ${e?`mode=${e.mode}`:"NULL"}`)}}return cs??null}function cD(t){Z("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return Z("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(ma("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1):uD.some(n=>n.startsWith(".")?e.hostname.endsWith(n)||e.hostname===n.slice(1):e.hostname===n)?(Z("Syntro Runtime","\u2713 Editor URL validated"),!0):(ma("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return ma("Syntro Runtime",`\u274C Invalid editor URL: ${t}`,e),!1}}var HL=()=>{let t=qo();return!qn()?.token||!t?null:t.mode==="editor"||t.mode==="audit"||t.mode==="review"?t.mode:null};function dD(){return qn()?.token??null}function fD(){return qn()?.api_base??null}var eu=null,UL=async t=>{if(Z("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){Z("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){Z("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}if(eu)return Z("Syntro Runtime","Editor SDK load already in progress, waiting..."),eu;let e=typeof t=="string"?{editorUrl:t}:t??{};if(e.editorUrl==="skip"){Z("Syntro Runtime",'editorUrl="skip" \u2014 deferring to caller'),Z("Syntro Runtime","================================");return}let a=fD(),n=(a?`${a}/api/editor/sdk/editor-sdk.js`:null)||e.editorUrl;if(!n){ma("Syntro Runtime","\u274C No editor SDK URL available (no api_base, no editorUrl option)"),Z("Syntro Runtime","================================");return}let o=dD();if(!o){ma("Syntro Runtime","\u274C No token found in editor_source."),Z("Syntro Runtime","================================");return}let i=`${n}?token=${encodeURIComponent(o)}`;if(Z("Syntro Runtime","Editor URL:",i),Z("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,hasEditorUrl:!!n,hasApiBase:!!a,tokenPrefix:`${o.slice(0,10)}...`}),!cD(n)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",n),Z("Syntro Runtime","================================");return}return Z("Syntro Runtime","\u2713 URL validated, injecting script tag..."),eu=new Promise((s,l)=>{let u=document.createElement("script");u.src=i,u.async=!0,e.integrity&&(u.integrity=e.integrity,u.crossOrigin="anonymous",Z("Syntro Runtime","SRI integrity check enabled")),u.onload=()=>{Z("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),Z("Syntro Runtime","================================"),s()},u.onerror=c=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",c),console.error("[Syntro Runtime] URL attempted:",i),Z("Syntro Runtime","================================"),eu=null,l(c)},document.head.appendChild(u),Z("Syntro Runtime","Script tag appended to <head>")}),eu};var pD=new Set(["tag_name","$el_text"]);function hD(t){return pD.has(t)||t.startsWith("attr__")}function qL(t,e){return t.equals!==void 0?e===t.equals:t.contains!==void 0?typeof e=="string"&&e.includes(t.contains):!1}function mD(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(hD(n)){let i=r.props?.elements;if(!i||!i.some(l=>qL(o,l[n])))return!1}else if(!qL(o,r.props?.[n]))return!1}return!0}}function zL(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?mD(n):()=>!0;e.register(r.key,o)}}function sf(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"&&zL(i.triggerWhen,e)}if(a)for(let r of a){let n=r;n.triggerWhen?.type==="rules"&&zL(n.triggerWhen,e)}}var cr=null;function $L(t){cr&&cr!==t?t.appendChild(cr):cr=t;let e=t.getRootNode();e instanceof ShadowRoot&&gD(e)}function jL(){return cr||(cr=document.createElement("div"),cr.id="syntro-overlays",Object.assign(cr.style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),document.body.appendChild(cr)),cr}var VL=!1;function gD(t){if(VL)return;let e=`
|
|
114
130
|
:host {
|
|
115
131
|
--syntro-surface: var(--sc-overlay-background, #0f1318);
|
|
116
132
|
--syntro-fg: var(--sc-overlay-text-color, #cbd0d7);
|
|
@@ -122,6 +138,9 @@ Error generating stack: `+i.message+`
|
|
|
122
138
|
--syntro-border: var(--sc-overlay-border, #2b333f);
|
|
123
139
|
--syntro-tooltip-bg: var(--syntro-surface);
|
|
124
140
|
--syntro-tooltip-fg: var(--syntro-fg);
|
|
141
|
+
--syntro-tooltip-title-color: var(--sc-overlay-title-color, var(--syntro-fg));
|
|
142
|
+
--syntro-tooltip-arrow-bg: var(--sc-overlay-arrow-color, var(--syntro-tooltip-bg));
|
|
143
|
+
--syntro-tooltip-arrow-size: var(--sc-overlay-arrow-size, 8px);
|
|
125
144
|
--syntro-tooltip-radius: var(--syntro-radius);
|
|
126
145
|
--syntro-tooltip-padding: 12px 16px;
|
|
127
146
|
--syntro-tooltip-shadow: var(--syntro-shadow);
|
|
@@ -148,14 +167,13 @@ Error generating stack: `+i.message+`
|
|
|
148
167
|
transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
149
168
|
}
|
|
150
169
|
|
|
151
|
-
/* Tooltip arrow */
|
|
170
|
+
/* Tooltip arrow \u2014 triangle via clip-path (square box so rotation is symmetric) */
|
|
152
171
|
.syntro-tooltip-arrow {
|
|
153
172
|
position: absolute;
|
|
154
|
-
width:
|
|
155
|
-
height:
|
|
156
|
-
background:
|
|
157
|
-
|
|
158
|
-
z-index: -1;
|
|
173
|
+
width: var(--syntro-tooltip-arrow-size);
|
|
174
|
+
height: var(--syntro-tooltip-arrow-size);
|
|
175
|
+
background: var(--syntro-tooltip-arrow-bg);
|
|
176
|
+
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
|
159
177
|
}
|
|
160
178
|
|
|
161
179
|
/* Tooltip content */
|
|
@@ -163,6 +181,7 @@ Error generating stack: `+i.message+`
|
|
|
163
181
|
font-weight: 600;
|
|
164
182
|
font-size: 15px;
|
|
165
183
|
margin-bottom: 6px;
|
|
184
|
+
color: var(--syntro-tooltip-title-color);
|
|
166
185
|
}
|
|
167
186
|
|
|
168
187
|
.syntro-tt-body {
|
|
@@ -369,7 +388,7 @@ Error generating stack: `+i.message+`
|
|
|
369
388
|
.syntro-modal-btn-primary:hover {
|
|
370
389
|
background: var(--syntro-accent-hover, #d44844);
|
|
371
390
|
}
|
|
372
|
-
`,
|
|
391
|
+
`,a=document.createElement("style");a.setAttribute("data-syntro","base-overlay"),a.textContent=e,t.appendChild(a),VL=!0}var hI=Y(Do(),1);var $g=class{constructor(e){$(this,"state");$(this,"listeners",new Set);let a=e?.open??!1;if(e?.open===void 0)try{let r=sessionStorage?.getItem("syntro:editor:panel-open");r!==null&&(a=JSON.parse(r))}catch{}this.state={open:a}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOpen(e){if(this.state.open!==e){this.state={...this.state,open:e};try{sessionStorage?.setItem("syntro:editor:panel-open",JSON.stringify(e))}catch{}this.emit()}}toggle(){this.setOpen(!this.state.open)}emit(){for(let e of this.listeners)e(this.state)}},GL=t=>new $g(t);var lf=Y(Ge(),1),XL=Y(Re(),1),WL=(0,lf.createContext)(null);function ZL({shadowRoot:t,portalRoot:e,overlayContainer:a,children:r}){return(0,XL.jsx)(WL.Provider,{value:{shadowRoot:t,portalRoot:e,overlayContainer:a},children:r})}function ds(){let t=(0,lf.useContext)(WL);if(!t)throw new Error("useShadowRoot() called outside ShadowRootProvider");return t}var Kt=Y(Ge(),1);var lt=Y(Ge(),1),cv=Y(Vs(),1);var Se={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"},fs="1.0.0";function Xa(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:fs}}function vD(t){return Xa(Se.CANVAS_OPENED,{surface:t})}function yD(t){return Xa(Se.CANVAS_CLOSED,{surface:t})}function xD(t,e){return Xa(Se.TILE_VIEWED,{tileId:t,surface:e})}function bD(t,e){return Xa(Se.TILE_EXPANDED,{tileId:t,surface:e})}function SD(t,e){return Xa(Se.TILE_COLLAPSED,{tileId:t,surface:e})}function CD(t,e,a){return Xa(Se.TILE_ACTION,{tileId:t,actionId:e,surface:a})}function _D(t,e){return Xa(Se.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function wD(t,e){return Xa(Se.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function LD(t,e,a){return Xa(Se.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:a})}function ID(t,e,a){return Xa(Se.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:a})}function AD(t,e){let a=t.startsWith("canvas.")?t:`canvas.${t}`;return Xa(a,e)}var tu={canvasOpened:vD,canvasClosed:yD,tileViewed:xD,tileExpanded:bD,tileCollapsed:SD,tileAction:CD,overlayStarted:_D,overlayCompleted:wD,overlayDismissed:LD,overlayStepViewed:ID,custom:AD};var Ra=Y(Re(),1),YL="syntro-toast-styles",kD=`
|
|
373
392
|
@keyframes syntro-toast-slide-in {
|
|
374
393
|
from { opacity: 0; transform: translateY(12px); }
|
|
375
394
|
to { opacity: 1; transform: translateY(0); }
|
|
@@ -387,10 +406,10 @@ Error generating stack: `+i.message+`
|
|
|
387
406
|
.syntro-toast-progress.paused {
|
|
388
407
|
animation-play-state: paused;
|
|
389
408
|
}
|
|
390
|
-
`;function rD(t){if(t.querySelector(`#${LE}`))return;let e=document.createElement("style");e.id=LE,e.textContent=iD,t.appendChild(e)}function Mm({notifications:t,onDismiss:e,onClickNotification:n,position:i}){let{shadowRoot:r}=ss();return rD(r),t.length===0?null:(0,kn.jsx)("div",{"data-testid":"notification-toast-stack",style:{position:"fixed",bottom:"6rem",[i==="right"?"right":"left"]:"2.5rem",display:"flex",flexDirection:"column",gap:"8px",zIndex:2147483648,pointerEvents:"auto",width:"280px"},children:t.map(o=>(0,kn.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:a=>{a.currentTarget.style.transform="translateY(-1px)";let s=a.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.add("paused")},onMouseLeave:a=>{a.currentTarget.style.transform="translateY(0)";let s=a.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.remove("paused")},children:[(0,kn.jsxs)("div",{onClick:()=>n(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,kn.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,kn.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,kn.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,kn.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,kn.jsx)("button",{type:"button",onClick:a=>{a.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,kn.jsx)("div",{style:{height:"2px",background:"rgba(255, 255, 255, 0.06)"},children:(0,kn.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var Gn=X(Qe(),1);var Nm=3,Dm=8e3,Lm=3e4;var oD=0;function Qd(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(n,i)=>!e||!(i in e)?n:String(e[i]))}function aD(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function Im(t,e){for(let n of e){let i=n.notifications;if(!(!i||i.length===0))for(let r of i){if(!aD(t.name,r.on))continue;let o=Date.now(),a=r.ttl??8e3;return{notification:{id:`notif-${++oD}-${o}`,title:Qd(r.title,t.props),body:r.body?Qd(r.body,t.props):void 0,icon:r.icon,tileId:n.id,itemId:r.deepLink?.itemId?Qd(r.deepLink.itemId,t.props):void 0,expiresAt:o+a,createdAt:o,ttl:a},rule:r}}}return null}function Hm(t,e){let[n,i]=(0,Gn.useState)([]),r=(0,Gn.useRef)(new Map),o=(0,Gn.useRef)(new Map),a=(0,Gn.useCallback)(c=>{t?.publish(Se.NOTIFICATION_DISMISSED,{notificationId:c.id,tileId:c.tileId,itemId:c.itemId})},[t]),s=(0,Gn.useCallback)(c=>{let u=setTimeout(()=>{i(d=>d.filter(h=>h.id!==c.id)),o.current.delete(c.id),a(c)},c.ttl);o.current.set(c.id,u)},[a]),l=(0,Gn.useCallback)(c=>{i(d=>{let h=d.find(m=>m.id===c);return h&&a(h),d.filter(m=>m.id!==c)});let u=o.current.get(c);u&&(clearTimeout(u),o.current.delete(c))},[a]);return(0,Gn.useEffect)(()=>{if(!t)return;let c=t.subscribe(u=>{let d=Im(u,e);if(!d)return;let{notification:h,rule:m}=d,S=h.itemId?`${h.tileId}:${u.name}:${h.itemId}`:`${h.tileId}:${u.name}`,_=r.current.get(S),b=Date.now(),f=m.cooldown??3e4;_!==void 0&&b-_<f||(r.current.set(S,b),i(p=>{if(h.itemId&&p.some(w=>w.tileId===h.tileId&&w.itemId===h.itemId))return p;let v=[...p,h];if(v.length>3){let y=v.shift(),w=o.current.get(y.id);w&&(clearTimeout(w),o.current.delete(y.id))}return v}),t.publish(Se.NOTIFICATION_SHOWN,{notificationId:h.id,tileId:h.tileId,itemId:h.itemId,title:h.title}),s(h))});return()=>{c();for(let u of o.current.values())clearTimeout(u);o.current.clear()}},[t,e,s]),{notifications:n,dismiss:l}}var Jd=X(Qe(),1);function sD(t,e){let n=[];for(let i of t){let r=i.widget.split(":")[0],a=e.get(r)?.manifest.runtime?.notifyWatchers;a&&n.push(...a(i.props??{}))}return n}function zm(t,e,n){let i=(0,Jd.useRef)(new Map);(0,Jd.useEffect)(()=>{if(!t?.events||!n)return;let r=sD(e,n);if(r.length===0)return;let o=t.state.ns("notified");for(let s of r)if(!i.current.has(s.id)){let l=t.evaluateSync(s.strategy);i.current.set(s.id,l.value),l.value&&!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),c=i.current.get(s.id)??!1;i.current.set(s.id,l.value),!c&&l.value?(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps)):c&&!l.value&&o.remove(s.id)}})},[t,e,n])}var Zt=X(Qe(),1),IE=X($e(),1),Bm=(0,Zt.createContext)({runtime:null,context:null});function Fm({runtime:t,children:e}){let[n,i]=(0,Zt.useState)(t?t.context.get():null);(0,Zt.useEffect)(()=>t?(i(t.context.get()),t.context.subscribe(a=>{i(a)})):void 0,[t]);let r=(0,Zt.useMemo)(()=>({runtime:t,context:n}),[t,n]);return(0,IE.jsx)(Bm.Provider,{value:r,children:e})}function $i(){let{runtime:t}=(0,Zt.useContext)(Bm);return t}function ef(){let{context:t}=(0,Zt.useContext)(Bm);return t}function $m(){return ef()?.page??null}function lD(){return ef()?.session??null}function cD(){return ef()?.viewport??null}function uD(t,e,n=[]){let i=$i();(0,Zt.useEffect)(()=>i?t?i.events.subscribe(t,e):i.events.subscribe(e):void 0,[i,...n,e,t])}function dD(){return $i()?.state??null}function fD(t,e){let n=$i(),[i,r]=(0,Zt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Zt.useEffect)(()=>{if(!n||!t){r({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return n.evaluate(t).then(a=>{o||r({value:a.value,isFallback:a.isFallback,isLoading:!1})}),()=>{o=!0}},[n,t,e]),i}function se(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var pD={colorPrimary:ne[3],colorPrimaryHover:ne[4],colorPrimaryMuted:ne[0],colorBackground:se(C[1],.95),colorBackgroundElevated:se(C[3],.95),colorBackgroundSubtle:se(C[0],.2),colorSurface:se(C[4],.8),colorSurfaceHover:se(C[5],.8),colorText:Ii.primary,colorTextSecondary:Ii.secondary,colorTextMuted:Ii.tertiary,colorTextInverse:C[1],colorBorder:cm.primary,colorBorderSubtle:cm.secondary,colorSuccess:Te[4],colorSuccessMuted:Te[0],colorWarning:St[4],colorWarningMuted:St[0],colorError:Fe[4],colorErrorMuted:Fe[0],colorInfo:un[4],colorInfoMuted:un[0],colorNotification:ne[4],colorNotificationMuted:se(ne[4],.4),glassBackground:se(C[1],.6),glassBackgroundHover:se(C[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"},hD={colorPrimary:ne[3],colorPrimaryHover:ne[2],colorPrimaryMuted:se(ne[5],.1),colorBackground:se(C[12],.95),colorBackgroundElevated:se(C[11],.95),colorBackgroundSubtle:se(C[0],.02),colorSurface:se(C[11],.6),colorSurfaceHover:se(C[10],.6),colorText:C[1],colorTextSecondary:C[6],colorTextMuted:C[8],colorTextInverse:C[12],colorBorder:se(C[0],.12),colorBorderSubtle:se(C[0],.06),colorSuccess:Te[4],colorSuccessMuted:se(Te[4],.12),colorWarning:St[4],colorWarningMuted:se(St[4],.12),colorError:Fe[4],colorErrorMuted:se(Fe[4],.12),colorInfo:un[4],colorInfoMuted:se(un[4],.12),colorNotification:ne[3],colorNotificationMuted:se(ne[3],.4),glassBackground:se(C[12],.7),glassBackgroundHover:se(C[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 gD(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var Um={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",background:se(C[1],.6),blur:"blur(24px)",border:"none",width:"clamp(320px, 16.666vw, 420px)"},launcher:{background:Rd.primary.backgroundDefault,backgroundHover:Rd.primary.backgroundHover,color:Rd.primary.icon,size:"56px",shadow:`0 8px 32px ${se(C[0],.6)}`},tile:{background:se(C[1],.6),backgroundHover:se(C[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:Ii.primary,textColor:Ii.secondary,iconBackground:`linear-gradient(135deg, ${ne[3]} 0%, ${ne[3]}cc 100%)`,iconShadow:`0 2px 8px ${ne[3]}40`},overlay:{background:se(C[1],.6),textColor:Ii.primary,border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:se(C[0],.95),textColor:Ii.primary,textSecondaryColor:Ii.secondary,border:`1px solid ${C[5]}`,borderRadius:"12px",successColor:Te[4],warningColor:St[4],errorColor:Fe[4],iconBackground:se(ne[3],.15),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[4]})`}},Vm={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",background:se(C[12],.7),blur:"blur(24px)",border:"none",width:"clamp(320px, 16.666vw, 420px)"},launcher:{background:ne[3],backgroundHover:ne[2],color:"#ffffff",size:"56px",shadow:"0 8px 32px rgba(0, 0, 0, 0.15)"},tile:{background:se(C[12],.7),backgroundHover:se(C[12],.8),border:"1px solid rgba(0, 0, 0, 0.06)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.12)",titleColor:C[1],textColor:C[6],iconBackground:`linear-gradient(135deg, ${ne[3]} 0%, ${ne[3]}cc 100%)`,iconShadow:`0 2px 8px ${ne[3]}40`},overlay:{background:se(C[12],.7),textColor:C[1],border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:se(C[12],.95),textColor:C[1],textSecondaryColor:C[6],border:`1px solid ${se(C[0],.12)}`,borderRadius:"12px",successColor:Te[4],warningColor:St[4],errorColor:Fe[4],iconBackground:se(ne[3],.1),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[2]})`}};function jm(t){let e=t.mode==="light"?Vm:Um;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}}}function Pm(t,e){let n=e.mode??t.mode??"dark",i=n==="light"?Vm:Um;return{mode:n,fontFamily:e.fontFamily??t.fontFamily??i.fontFamily,colorPrimary:e.colorPrimary??t.colorPrimary??i.colorPrimary,colorPrimaryHover:e.colorPrimaryHover??t.colorPrimaryHover??i.colorPrimaryHover,borderRadius:e.borderRadius??t.borderRadius??i.borderRadius,canvas:{...i.canvas,...t.canvas,...e.canvas},launcher:{...i.launcher,...t.launcher,...e.launcher},tile:{...i.tile,...t.tile,...e.tile},overlay:{...i.overlay,...t.overlay,...e.overlay},notification:{...i.notification,...t.notification,...e.notification}}}var mD=["canvas","launcher","tile","overlay","notification"];function qm(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 n of mD){let i=t[n];if(i)for(let[r,o]of Object.entries(i))o!==void 0&&(e[`--sc-${n}-${gD(r)}`]=o)}return e}var Ui=X(Qe(),1);var zE=X($e(),1),HE=(0,Ui.createContext)(null);function Zm({children:t,themeConfig:e,workspaceTheme:n,shadowRoot:i}){let r=(0,Ui.useMemo)(()=>n?Pm(n,e??{}):jm(e??{}),[e,n]),o=(0,Ui.useMemo)(()=>qm(r),[r]);(0,Ui.useEffect)(()=>{if(!i)return;let s=i.querySelector("#sc-theme-vars");s||(s=document.createElement("style"),s.id="sc-theme-vars",i.insertBefore(s,i.firstChild));let l=Object.entries(o).map(([c,u])=>` ${c}: ${u};`).join(`
|
|
409
|
+
`;function ED(t){if(t.querySelector(`#${YL}`))return;let e=document.createElement("style");e.id=YL,e.textContent=kD,t.appendChild(e)}function jg({notifications:t,onDismiss:e,onClickNotification:a,position:r}){let{shadowRoot:n}=ds();return ED(n),t.length===0?null:(0,Ra.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,Ra.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,Ra.jsxs)("div",{onClick:()=>a(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,Ra.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,Ra.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Ra.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,Ra.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,Ra.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,Ra.jsx)("div",{style:{height:"2px",background:"rgba(0, 0, 0, 0.08)"},children:(0,Ra.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var Ya=Y(Ge(),1);var Gg=3,Wg=8e3,Zg=3e4;var TD=0;function uf(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(a,r)=>!e||!(r in e)?a:String(e[r]))}function RD(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function Xg(t,e){for(let a of e){let r=a.notifications;if(!(!r||r.length===0))for(let n of r){if(!RD(t.name,n.on))continue;let o=Date.now(),i=n.ttl??8e3;return{notification:{id:`notif-${++TD}-${o}`,title:uf(n.title,t.props),body:n.body?uf(n.body,t.props):void 0,icon:n.icon,tileId:a.id,itemId:n.deepLink?.itemId?uf(n.deepLink.itemId,t.props):void 0,expiresAt:o+i,createdAt:o,ttl:i},rule:n}}}return null}function Yg(t,e){let[a,r]=(0,Ya.useState)([]),n=(0,Ya.useRef)(new Map),o=(0,Ya.useRef)(new Map),i=(0,Ya.useCallback)(u=>{t?.publish(Se.NOTIFICATION_DISMISSED,{notificationId:u.id,tileId:u.tileId,itemId:u.itemId})},[t]),s=(0,Ya.useCallback)(u=>{let c=setTimeout(()=>{r(d=>d.filter(h=>h.id!==u.id)),o.current.delete(u.id),i(u)},u.ttl);o.current.set(u.id,c)},[i]),l=(0,Ya.useCallback)(u=>{r(d=>{let h=d.find(g=>g.id===u);return h&&i(h),d.filter(g=>g.id!==u)});let c=o.current.get(u);c&&(clearTimeout(c),o.current.delete(u))},[i]);return(0,Ya.useEffect)(()=>{if(!t)return;let u=t.subscribe(c=>{let d=Xg(c,e);if(!d)return;let{notification:h,rule:g}=d,S=h.itemId?`${h.tileId}:${c.name}:${h.itemId}`:`${h.tileId}:${c.name}`,b=n.current.get(S),x=Date.now(),f=g.cooldown??3e4;b!==void 0&&x-b<f||(n.current.set(S,x),r(m=>{if(h.itemId&&m.some(_=>_.tileId===h.tileId&&_.itemId===h.itemId))return m;let v=[...m,h];if(v.length>3){let y=v.shift(),_=o.current.get(y.id);_&&(clearTimeout(_),o.current.delete(y.id))}return v}),t.publish(Se.NOTIFICATION_SHOWN,{notificationId:h.id,tileId:h.tileId,itemId:h.itemId,title:h.title}),s(h))});return()=>{u();for(let c of o.current.values())clearTimeout(c);o.current.clear()}},[t,e,s]),{notifications:a,dismiss:l}}var cf=Y(Ge(),1);function MD(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 Kg(t,e,a){let r=(0,cf.useRef)(new Map);(0,cf.useEffect)(()=>{if(!t?.events||!a)return;let n=MD(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 Xt=Y(Ge(),1),KL=Y(Re(),1),Qg=(0,Xt.createContext)({runtime:null,context:null});function Jg({runtime:t,children:e}){let[a,r]=(0,Xt.useState)(t?t.context.get():null);(0,Xt.useEffect)(()=>t?(r(t.context.get()),t.context.subscribe(i=>{r(i)})):void 0,[t]);let n=(0,Xt.useMemo)(()=>({runtime:t,context:a}),[t,a]);return(0,KL.jsx)(Qg.Provider,{value:n,children:e})}function Vr(){let{runtime:t}=(0,Xt.useContext)(Qg);return t}function df(){let{context:t}=(0,Xt.useContext)(Qg);return t}function ev(){return df()?.page??null}function DD(){return df()?.session??null}function OD(){return df()?.viewport??null}function BD(t,e,a=[]){let r=Vr();(0,Xt.useEffect)(()=>r?t?r.events.subscribe(t,e):r.events.subscribe(e):void 0,[r,...a,e,t])}function FD(){return Vr()?.state??null}function ND(t,e){let a=Vr(),[r,n]=(0,Xt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Xt.useEffect)(()=>{if(!a||!t){n({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return a.evaluate(t).then(i=>{o||n({value:i.value,isFallback:i.isFallback,isLoading:!1})}),()=>{o=!0}},[a,t,e]),r}function ae(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var PD={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:pa.primary,colorTextSecondary:pa.secondary,colorTextMuted:pa.tertiary,colorTextInverse:I[1],colorBorder:_g.primary,colorBorderSubtle:_g.secondary,colorSuccess:Ae[4],colorSuccessMuted:Ae[0],colorWarning:Ct[4],colorWarningMuted:Ct[0],colorError:qe[4],colorErrorMuted:qe[0],colorInfo:fa[4],colorInfoMuted:fa[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"},HD={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:Ae[4],colorSuccessMuted:ae(Ae[4],.12),colorWarning:Ct[4],colorWarningMuted:ae(Ct[4],.12),colorError:qe[4],colorErrorMuted:ae(qe[4],.12),colorInfo:fa[4],colorInfoMuted:ae(fa[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 UD(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var tv={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)"},launcher:{background:Hd.primary.backgroundDefault,backgroundHover:Hd.primary.backgroundHover,color:Hd.primary.icon,size:"56px",shadow:`0 8px 32px ${ae(I[0],.6)}`,borderRadius:"9999px"},tile:{background:ae(I[1],.6),backgroundHover:ae(I[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:pa.primary,textColor:pa.secondary,iconBackground:`linear-gradient(135deg, ${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:pa.primary,titleColor:pa.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:pa.primary,textSecondaryColor:pa.secondary,border:`1px solid ${I[5]}`,borderRadius:"12px",successColor:Ae[4],warningColor:Ct[4],errorColor:qe[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:pa.primary,textSecondaryColor:pa.secondary,itemDivider:"none",itemGap:"6px",itemPadding:"12px 16px",itemFontSize:"15px",bodyPadding:"0 16px 12px 16px",bodyFontSize:"14px",categoryPadding:"8px 4px 4px 4px",categoryGap:"4px",categoryFontSize:"12px",searchBackground:ae(I[3],.8),searchColor:pa.primary,chevronColor:"currentColor"}},av={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)"},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:Ae[4],warningColor:Ct[4],errorColor:qe[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 rv(t){let e=t.mode==="light"?av:tv;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 nv(t,e){let a=e.mode??t.mode??"dark",r=a==="light"?av:tv;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 qD=["canvas","launcher","tile","overlay","notification","content"];function ov(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 qD){let r=t[a];if(r)for(let[n,o]of Object.entries(r))o!==void 0&&(e[`--sc-${a}-${UD(n)}`]=o)}return e}var $r=Y(Ge(),1);var JL=Y(Re(),1),QL=(0,$r.createContext)(null);function iv({children:t,themeConfig:e,workspaceTheme:a,shadowRoot:r}){let n=(0,$r.useMemo)(()=>a?nv(a,e??{}):rv(e??{}),[e,a]),o=(0,$r.useMemo)(()=>ov(n),[n]);(0,$r.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(`
|
|
391
410
|
`);s.textContent=`:host {
|
|
392
411
|
${l}
|
|
393
|
-
}`},[
|
|
412
|
+
}`},[r,o]);let i={config:n,mode:n.mode,cssVariables:o};return(0,JL.jsx)(QL.Provider,{value:i,children:t})}function sv(){let t=(0,$r.useContext)(QL);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}var st=Y(Ge(),1);var pf=Y(Ge());var ff=(...t)=>t.filter((e,a,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===a).join(" ").trim();var eI=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var tI=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,a,r)=>r?r.toUpperCase():a.toLowerCase());var lv=t=>{let e=tI(t);return e.charAt(0).toUpperCase()+e.slice(1)};var au=Y(Ge());var aI={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 rI=t=>{for(let e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};var nI=(0,au.forwardRef)(({color:t="currentColor",size:e=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:n="",children:o,iconNode:i,...s},l)=>(0,au.createElement)("svg",{ref:l,...aI,width:e,height:e,stroke:t,strokeWidth:r?Number(a)*24/Number(e):a,className:ff("lucide",n),...!o&&!rI(s)&&{"aria-hidden":"true"},...s},[...i.map(([u,c])=>(0,au.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var Et=(t,e)=>{let a=(0,pf.forwardRef)(({className:r,...n},o)=>(0,pf.createElement)(nI,{ref:o,iconNode:e,className:ff(`lucide-${eI(lv(t))}`,`lucide-${t}`,r),...n}));return a.displayName=lv(t),a};var zD=[["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"}]],Ka=Et("circle-question-mark",zD);var VD=[["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"}]],ru=Et("compass",VD);var $D=[["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"}]],nu=Et("file-text",$D);var jD=[["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"}]],ou=Et("gamepad-2",jD);var GD=[["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"}]],zn=Et("layers",GD);var WD=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],iu=Et("message-circle",WD);var ZD=[["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"}]],Vn=Et("sparkles",ZD);var XD=[["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"}]],su=Et("trophy",XD);var uv=Y(Re(),1),YD={"\u2753":Ka,"\u{1F9ED}":ru,"\u{1F4DD}":nu,"\u{1F3AF}":zn,"\u{1F3C6}":su,"\u2728":Vn,"\u{1F4AC}":iu,"\u{1F3AE}":ou};function oI({emoji:t,size:e=18,color:a="currentColor"}){let r=YD[t];return r?(0,uv.jsx)(r,{size:e,color:a}):(0,uv.jsx)("span",{children:t})}var Yt=Y(Re(),1);function KD({widgetId:t,props:e}){let a=Vr(),r=(0,st.useRef)(null),n=(0,st.useRef)(null),o=a?.widgets,i=o?.has(t)??!1,[,s]=(0,st.useReducer)(l=>l+1,0);return(0,st.useEffect)(()=>{if(!(!o||i))return o.subscribe(l=>{l.type==="registered"&&l.widgetId===t&&s()})},[o,t,i]),(0,st.useEffect)(()=>{if(!r.current||!o||!i)return;let l=o.mount(t,r.current,e);return n.current=l,()=>{l.unmount(),n.current=null}},[o,t,e,i]),!o||!o.has(t)?(0,Yt.jsxs)("div",{style:{padding:"0.75rem",fontSize:"0.8rem",color:"var(--sc-tile-text-color)",fontStyle:"italic"},children:["Widget not available: ",t]}):(0,Yt.jsx)("div",{ref:r,style:{width:"100%",minHeight:"40px"}})}function lu({config:t,surface:e,telemetry:a,style:r}){let{title:n,subtitle:o,widget:i,props:s,icon:l}=t,[,u]=(0,st.useState)(0),c=Vr();(0,st.useEffect)(()=>{c&&u(_=>_+1)},[c]);let d=(0,st.useMemo)(()=>c?.widgets?.getRegistration?.(i),[c?.widgets,i]),h=(0,st.useMemo)(()=>l||(d?.metadata?.icon??"+"),[l,d]),g=(0,st.useMemo)(()=>o||d?.metadata?.subtitle,[o,d]),[S,b]=(0,st.useState)(!1),x=(0,st.useCallback)(()=>b(!0),[]),f=(0,st.useCallback)(()=>b(!1),[]),m={display:"flex",flexDirection:"column",borderRadius:"var(--sc-tile-border-radius)",background:S?"var(--sc-tile-background-hover)":"var(--sc-tile-background)",backdropFilter:"blur(16px) saturate(1.2)",WebkitBackdropFilter:"blur(16px) saturate(1.2)",border:"var(--sc-tile-border)",boxShadow:"var(--sc-tile-shadow)",color:"var(--sc-tile-title-color)",fontFamily:"var(--sc-font-family)",overflow:"hidden",cursor:"default",transition:"all 0.25s ease",transform:S?"scale(1.01)":"scale(1)",...r},v={display:"flex",alignItems:"center",gap:"var(--sc-tile-gap, 0.25rem)",padding:"var(--sc-tile-header-padding, 0.375rem 0.75rem)",minHeight:"44px"},y={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return(0,Yt.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:m,onMouseEnter:x,onMouseLeave:f,children:[(0,Yt.jsxs)("div",{style:v,children:[(0,Yt.jsx)("div",{style:y,children:(0,Yt.jsx)(oI,{emoji:h,size:g?36:24})}),(0,Yt.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Yt.jsx)("h3",{style:{fontSize:"1.14rem",fontWeight:600,color:"var(--sc-tile-title-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n??i}),g&&(0,Yt.jsx)("p",{style:{fontSize:"0.8rem",fontWeight:400,color:"var(--sc-tile-text-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:g})]})]}),(0,Yt.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,Yt.jsx)("div",{style:{paddingTop:"var(--sc-tile-gap, 0.25rem)"},children:(0,Yt.jsx)(KD,{widgetId:i,props:{...s,instanceId:t.id}})})})]})}var ge=Y(Re(),1),iI="syntro-launcher-styles";function QD(t,e){if(t.querySelector(`#${iI}`))return;let a=document.createElement("style");a.id=iI,a.textContent=e,t.appendChild(a)}function sI({isOpen:t,onToggle:e,telemetry:a,launcherLabel:r="Adaptives",launcherIcon:n,launcherAnimate:o=!1,launcherAnimationStyle:i="pulse",notificationCount:s,footerSlot:l,tiles:u,isLoading:c,error:d,canvasTitle:h,displayMode:g="standard"}){let[S,b]=(0,lt.useState)(!1),[x,f]=(0,lt.useState)(null),m=(0,lt.useRef)(null),v=Vr(),{shadowRoot:y,portalRoot:_}=ds(),{config:w}=sv(),{notifications:C,dismiss:A}=Yg(v?.events??null,u);Kg(v,u,v?.apps);let E=(0,lt.useCallback)(X=>{v&&v.events.publish(Se.NOTIFICATION_CLICKED,{notificationId:X.id,tileId:X.tileId,itemId:X.itemId}),t||e(),v&&X.tileId&&v.events.publish(Se.NOTIFICATION_DEEP_LINK,{tileId:X.tileId,itemId:X.itemId}),A(X.id)},[v,t,e,A]),L=(0,lt.useMemo)(()=>`
|
|
394
413
|
@keyframes syntro-launcher-pulse {
|
|
395
414
|
0%, 100% {
|
|
396
415
|
box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 0 ${w.colorPrimary}66;
|
|
@@ -423,7 +442,7 @@ ${l}
|
|
|
423
442
|
.syntro-badge-ping { animation: syntro-badge-ping 1.5s cubic-bezier(0,0,0.2,1) infinite; }
|
|
424
443
|
.syntro-badge-glow { animation: syntro-badge-glow 2s ease-in-out infinite; }
|
|
425
444
|
.syntro-badge-bounce { animation: syntro-badge-bounce 2s ease-in-out infinite; }
|
|
426
|
-
`,[w.colorPrimary,w.colorPrimaryHover]);(0,kt.useEffect)(()=>{t&&l.forEach(J=>{if(n?.trackRectangleViewed(J.id,"overlay"),p){let me=Ql.tileViewed(J.id,"overlay");p.events.publish(me.name,me.props,me.source)}})},[n,p,t,l]),(0,kt.useEffect)(()=>{S(!0),yD(v,k)},[v,k]);let E=(0,kt.useCallback)(()=>{let J=!t;if(J?n?.trackCanvasOpened("overlay"):n?.trackCanvasClosed("overlay"),p){let me=J?Ql.canvasOpened("overlay"):Ql.canvasClosed("overlay");p.events.publish(me.name,me.props,me.source)}e()},[t,n,p,e]),R=(0,kt.useCallback)(J=>{let me=J.currentTarget.getBoundingClientRect();f.current={startX:J.clientX,startY:J.clientY,startElX:me.left,startElY:me.top,dragged:!1},J.currentTarget.setPointerCapture(J.pointerId)},[]),D=(0,kt.useCallback)(J=>{let me=f.current;if(!me)return;let Ke=J.clientX-me.startX,Mt=J.clientY-me.startY;(Math.abs(Ke)>5||Math.abs(Mt)>5)&&(me.dragged=!0),me.dragged&&b({x:me.startElX+Ke,y:me.startElY+Mt})},[]),N=(0,kt.useCallback)(J=>{let me=f.current;f.current=null,me&&!me.dragged&&E()},[E]),H=h==="focused",B=w.canvas.position==="right",z=2147483600,te={display:"flex",flexDirection:"column",width:H?"40vw":w.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:t?"transform 340ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease-out":"transform 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease-in",color:"var(--sc-overlay-text-color)",background:H?"var(--sc-canvas-background)":"var(--sc-canvas-background, transparent)",backdropFilter:H?`${w.canvas.blur??"blur(24px)"} saturate(1.2)`:"blur(6px)",WebkitBackdropFilter:H?`${w.canvas.blur??"blur(24px)"} saturate(1.2)`:"blur(6px)",...H?{}:{maskImage:B?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)",WebkitMaskImage:B?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)"},border:"none",borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":B?"translateX(120%)":"translateX(-120%)"},G=(0,pe.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:z},children:(0,pe.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:B?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,pe.jsxs)("div",{"data-shadow-canvas-id":"overlay-container",style:te,children:[H&&d&&(0,pe.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,pe.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"var(--sc-notification-text-secondary-color)"},children:d})}),(0,pe.jsx)("div",{style:{flex:1,overflowY:"auto",padding:H?"0":"1rem"},children:c?(0,pe.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:H?"1rem":"0"},children:"Loading..."}):u?(0,pe.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:H?"1rem":"0"},children:["Failed to load: ",u]}):H?l.length>0?(0,pe.jsx)(Jl,{config:l[0],surface:"overlay",telemetry:n,style:{width:"100%",height:"100%"}}):null:(0,pe.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:l.map(J=>(0,pe.jsx)(Jl,{config:J,surface:"overlay",telemetry:n,style:{width:"100%"}},J.id))})}),s]}),(0,pe.jsx)("div",{onClick:E,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return m?(0,pe.jsxs)(pe.Fragment,{children:[(0,Ym.createPortal)((0,pe.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:z+47},children:[(0,pe.jsx)(Mm,{notifications:A,onDismiss:x,onClickNotification:T,position:w.canvas.position??"right"}),(0,pe.jsxs)("button",{type:"button","aria-label":"Toggle shadow canvas",className:r&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",..._?{top:_.y,left:_.x}:{bottom:"2.5rem",right:B?"2.5rem":void 0,left:B?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:"9999px",color:"var(--sc-launcher-color)",boxShadow:"var(--sc-launcher-shadow)",transition:f.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:f.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:R,onPointerMove:D,onPointerUp:N,onMouseEnter:J=>{f.current?.dragged||(J.currentTarget.style.backgroundColor=w.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:J=>{f.current?.dragged||(J.currentTarget.style.backgroundColor=w.launcher.background??"var(--sc-launcher-background)")},children:[(0,pe.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transition:"transform 200ms ease"},children:t?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("path",{d:"M18 6L6 18"}),(0,pe.jsx)("path",{d:"M6 6l12 12"})]}):(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("path",{d:"M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 0-1.275-1.275L3 12l5.813-1.912a2 2 0 0 0 1.275-1.275L12 3Z"}),(0,pe.jsx)("path",{d:"M5 3v4"}),(0,pe.jsx)("path",{d:"M3 5h4"}),(0,pe.jsx)("path",{d:"M19 17v4"}),(0,pe.jsx)("path",{d:"M17 19h4"})]})}),!t&&A.length>0&&(0,pe.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,pe.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${w.colorPrimaryHover}66`}}),(0,pe.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,pe.jsx)("span",{className:"syntro-badge-bounce",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"9999px",background:w.colorPrimaryHover,color:"#ffffff",fontSize:11,fontWeight:700},children:A.length>99?"99+":A.length})]})]})]}),y),t?(0,Ym.createPortal)(G,y):null]}):null}var Yn=X(Qe(),1);var bD=t=>[...t].sort((e,n)=>(n.priority??0)-(e.priority??0));function $E({fetcher:t,experiments:e,runtime:n,pageUrl:i,pollIntervalMs:r}){let[o,a]=(0,Yn.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Yn.useRef)("[]"),l=(0,Yn.useCallback)(async()=>{try{a(S=>({...S,isLoading:!0,error:void 0}));let c=await t();Y("SmartCanvas Config","Raw config response",c);let u=c.tiles||[];n?(u=await n.filterTiles(u),e&&(u=u.filter(S=>e.shouldRenderRectangle(S)))):e&&(u=u.filter(S=>e.shouldRenderRectangle(S))),Y("SmartCanvas Config",`Tile count after filtering: ${u.length}`);let d=c.actions||[],h=JSON.stringify(d),m=h!==s.current;m&&(s.current=h),a(S=>({tiles:bD(u),actions:m?d:S.actions,isLoading:!1,fetchedAt:c.fetchedAt,canvasTitle:c.canvasTitle,configVersion:c.configVersion,theme:c.theme,launcher:c.launcher}))}catch(c){let u=c instanceof Error?c.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",u,c),a(d=>({...d,isLoading:!1,error:u}))}},[e,t,n]);return(0,Yn.useEffect)(()=>{if(l(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>l())},[l,e,i]),(0,Yn.useEffect)(()=>{if(!r)return;let c=setInterval(()=>{l()},r);return()=>clearInterval(c)},[l,r]),(0,Yn.useMemo)(()=>o,[o])}var cs=X($e(),1);function VE({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:m="include",footerSlot:S,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:p}){return c?(0,cs.jsx)(Fm,{runtime:c,children:(0,cs.jsx)(UE,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:m,footerSlot:S,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:p})}):(0,cs.jsx)(UE,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:a,experiments:s,telemetry:l,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:m,footerSlot:S,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:p})}function UE({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:a,experiments:s,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:m="include",footerSlot:S,launcherLabel:_,canvasHost:b,initialBatchHandle:f,workspaceTheme:p}){let[v,y]=(0,Gt.useState)(t.getState().open),w=$m(),[A,x]=(0,Gt.useState)(()=>typeof window<"u"?window.location.href:"/"),T=w?.url??A;(0,Gt.useEffect)(()=>{if(c||typeof window>"u")return;let z=()=>x(window.location.href);window.addEventListener("popstate",z),window.addEventListener("hashchange",z);let te=history.pushState,I=history.replaceState;return history.pushState=function(...G){te.apply(this,G),queueMicrotask(z)},history.replaceState=function(...G){I.apply(this,G),queueMicrotask(z)},()=>{window.removeEventListener("popstate",z),window.removeEventListener("hashchange",z),history.pushState=te,history.replaceState=I}},[c]);let k=(0,Gt.useMemo)(()=>e||rs({configUri:n,experiments:s,featureKey:i,configFeatureKey:r,credentials:o}),[e,n,s,i,r,o]),E=$E({fetcher:k,experiments:s,runtime:c,pageUrl:T}),R=E.tiles.length>0&&!E.error;(0,Gt.useEffect)(()=>t.subscribe(z=>y(z.open)),[t]),(0,Gt.useEffect)(()=>{!E.isLoading&&!R&&t.getState().open&&t.setOpen(!1)},[t,R,E.isLoading]);let D=(0,Gt.useRef)(f??null),N=(0,Gt.useRef)(!!f);(0,Gt.useEffect)(()=>{if(!c?.actions)return;if(N.current){E.actions.length>0&&(N.current=!1);return}let z=!1;return(async()=>{if(D.current){try{await D.current.revertAll()}catch(I){console.error("[SmartCanvasApp] Failed to revert actions:",I)}D.current=null}if(!z&&E.actions.length>0)try{let I=await c.actions.applyBatch(E.actions);z?await I.revertAll():D.current=I}catch(I){z||console.error("[SmartCanvasApp] Failed to apply actions:",I)}})(),()=>{z=!0,D.current&&(D.current.revertAll().catch(I=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",I)}),D.current=null)}},[c,E.actions,T]),(0,Gt.useEffect)(()=>{if(c)return c.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[c,t]);let{shadowRoot:H}=ss(),B=E.theme;return!E.isLoading&&!R?null:(0,cs.jsx)(Zm,{themeConfig:B,workspaceTheme:p,shadowRoot:H,children:(0,cs.jsx)(FE,{tiles:E.tiles,isLoading:E.isLoading,error:E.error,canvasTitle:E.canvasTitle,telemetry:l,launcherLabel:_??E.launcher?.label,launcherAnimate:E.launcher?.animate,launcherAnimationStyle:E.launcher?.animationStyle,notificationCount:E.launcher?.notificationCount??E.tiles.length,footerSlot:S,isOpen:v,onToggle:()=>t.toggle(),displayMode:E.displayMode})})}var Xm=X($e(),1),jE="smart-canvas",PE=`
|
|
445
|
+
`,[w.colorPrimary,w.colorPrimaryHover]);(0,lt.useEffect)(()=>{t&&u.forEach(X=>{if(a?.trackRectangleViewed(X.id,"overlay"),v){let oe=tu.tileViewed(X.id,"overlay");v.events.publish(oe.name,oe.props,oe.source)}})},[a,v,t,u]),(0,lt.useEffect)(()=>{b(!0),QD(y,L)},[y,L]);let k=(0,lt.useCallback)(()=>{let X=!t;if(X?a?.trackCanvasOpened("overlay"):a?.trackCanvasClosed("overlay"),v){let oe=X?tu.canvasOpened("overlay"):tu.canvasClosed("overlay");v.events.publish(oe.name,oe.props,oe.source)}e()},[t,a,v,e]),O=(0,lt.useCallback)(X=>{let oe=X.currentTarget.getBoundingClientRect();m.current={startX:X.clientX,startY:X.clientY,startElX:oe.left,startElY:oe.top,dragged:!1},X.currentTarget.setPointerCapture(X.pointerId)},[]),R=(0,lt.useCallback)(X=>{let oe=m.current;if(!oe)return;let Ut=X.clientX-oe.startX,Mt=X.clientY-oe.startY;(Math.abs(Ut)>5||Math.abs(Mt)>5)&&(oe.dragged=!0),oe.dragged&&f({x:oe.startElX+Ut,y:oe.startElY+Mt})},[]),N=(0,lt.useCallback)(X=>{let oe=m.current;m.current=null,oe&&!oe.dragged&&k()},[k]),P=g==="focused",F=w.canvas.position==="right",Q=w.canvas.layout==="push",D=(0,lt.useRef)(null),W=2147483600;(0,lt.useEffect)(()=>{if(!Q)return;let X=document.documentElement,oe=F?"marginRight":"marginLeft",Ut=X.style.transition;if(X.style.transition=`${oe} 340ms cubic-bezier(0.16, 1, 0.3, 1)`,t){let Mt=D.current?.offsetWidth??380;X.style[oe]=`${Mt}px`}else X.style[oe]="0px";return()=>{X.style[oe]="",X.style.transition=Ut}},[Q,t,F]),(0,lt.useEffect)(()=>{if(!Q||!t)return;let X=D.current;if(!X)return;let oe=F?"marginRight":"marginLeft",Ut=new ResizeObserver(([Mt])=>{document.documentElement.style[oe]=`${Mt.contentRect.width}px`});return Ut.observe(X),()=>Ut.disconnect()},[Q,t,F]);let dt={display:"flex",flexDirection:"column",width:P?"40vw":w.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:t?"transform 340ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease-out":"transform 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease-in",color:"var(--sc-overlay-text-color)",background:P?"var(--sc-canvas-background)":"var(--sc-canvas-background, transparent)",backdropFilter:P?`${w.canvas.blur??"blur(24px)"} saturate(1.2)`:"blur(6px)",WebkitBackdropFilter:P?`${w.canvas.blur??"blur(24px)"} saturate(1.2)`:"blur(6px)",...P?{}:{maskImage:F?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)",WebkitMaskImage:F?"linear-gradient(to right, transparent, black 6%)":"linear-gradient(to left, transparent, black 6%)"},border:"none",borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":F?"translateX(120%)":"translateX(-120%)"},rt=(0,ge.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:W},children:(0,ge.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:F?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,ge.jsxs)("div",{ref:D,"data-shadow-canvas-id":"overlay-container",style:dt,children:[P&&h&&(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:h})}),(0,ge.jsx)("div",{style:{flex:1,overflowY:"auto",padding:P?"0":"1rem"},children:c?(0,ge.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:P?"1rem":"0"},children:"Loading..."}):d?(0,ge.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:P?"1rem":"0"},children:["Failed to load: ",d]}):P?u.length>0?(0,ge.jsx)(lu,{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(X=>(0,ge.jsx)(lu,{config:X,surface:"overlay",telemetry:a,style:{width:"100%"}},X.id))})}),l]}),(0,ge.jsx)("div",{onClick:k,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return S?(0,ge.jsxs)(ge.Fragment,{children:[(0,cv.createPortal)((0,ge.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:W+47},children:[(0,ge.jsx)(jg,{notifications:C,onDismiss:A,onClickNotification:E,position:w.canvas.position??"right"}),(0,ge.jsxs)("button",{type:"button","aria-label":"Toggle shadow canvas",className:o&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",...x?{top:x.y,left:x.x}:{bottom:"2.5rem",right:F?"2.5rem":void 0,left:F?void 0:"2.5rem"},pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",width:"var(--sc-launcher-size, 56px)",height:"var(--sc-launcher-size, 56px)",borderRadius:"var(--sc-launcher-border-radius, 9999px)",color:"var(--sc-launcher-color)",boxShadow:"var(--sc-launcher-shadow)",transition:m.current?"none":"transform 0.2s ease, opacity 0.3s ease, background-color 0.2s ease",outline:"none",padding:0,border:"none",backgroundColor:"var(--sc-launcher-background)",cursor:m.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:O,onPointerMove:R,onPointerUp:N,onMouseEnter:X=>{m.current?.dragged||(X.currentTarget.style.backgroundColor=w.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:X=>{m.current?.dragged||(X.currentTarget.style.backgroundColor=w.launcher.background??"var(--sc-launcher-background)")},children:[t?(0,ge.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transition:"transform 200ms ease"},children:[(0,ge.jsx)("path",{d:"M18 6L6 18"}),(0,ge.jsx)("path",{d:"M6 6l12 12"})]}):n?(0,ge.jsx)("img",{src:n,alt:"","aria-hidden":"true",style:{width:"60%",height:"60%",objectFit:"contain",pointerEvents:"none"}}):(0,ge.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transition:"transform 200ms ease"},children:[(0,ge.jsx)("path",{d:"M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 0-1.275-1.275L3 12l5.813-1.912a2 2 0 0 0 1.275-1.275L12 3Z"}),(0,ge.jsx)("path",{d:"M5 3v4"}),(0,ge.jsx)("path",{d:"M3 5h4"}),(0,ge.jsx)("path",{d:"M19 17v4"}),(0,ge.jsx)("path",{d:"M17 19h4"})]}),!t&&C.length>0&&(0,ge.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,ge.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${w.colorPrimaryHover}66`}}),(0,ge.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,ge.jsx)("span",{className:"syntro-badge-bounce",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"9999px",background:w.colorPrimaryHover,color:"#ffffff",fontSize:11,fontWeight:700},children:C.length>99?"99+":C.length})]})]})]}),_),t?(0,cv.createPortal)(rt,_):null]}):null}var Nt=Y(Ge(),1);var lI=t=>[...t].sort((e,a)=>(a.priority??0)-(e.priority??0));function uI({fetcher:t,experiments:e,runtime:a,pageUrl:r,pollIntervalMs:n}){let[o,i]=(0,Nt.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Nt.useRef)("[]"),l=(0,Nt.useRef)(null),u=(0,Nt.useCallback)(async()=>{let d=l.current;if(!d||!a)return;let h=d.tiles||[];h=await a.filterTiles(h),e&&(h=h.filter(g=>e.shouldRenderRectangle(g))),i(g=>({...g,tiles:lI(h)}))},[a,e]),c=(0,Nt.useCallback)(async()=>{try{i(x=>({...x,isLoading:!0,error:void 0}));let d=await t();Z("SmartCanvas Config","Raw config response",d),l.current=d;let h=d.tiles||[];a?(h=await a.filterTiles(h),e&&(h=h.filter(x=>e.shouldRenderRectangle(x)))):e&&(h=h.filter(x=>e.shouldRenderRectangle(x))),Z("SmartCanvas Config",`Tile count after filtering: ${h.length}`);let g=d.actions||[],S=JSON.stringify(g),b=S!==s.current;b&&(s.current=S),i(x=>({tiles:lI(h),actions:b?g:x.actions,isLoading:!1,fetchedAt:d.fetchedAt,canvasTitle:d.canvasTitle,configVersion:d.configVersion,theme:d.theme,launcher:d.launcher}))}catch(d){let h=d instanceof Error?d.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",h,d),i(g=>({...g,isLoading:!1,error:h}))}},[e,t,a]);return(0,Nt.useEffect)(()=>{if(c(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>c())},[c,e,r]),(0,Nt.useEffect)(()=>{if(a?.accumulator)return a.accumulator.subscribe(()=>{u()})},[a,u]),(0,Nt.useEffect)(()=>{if(a?.context)return a.context.subscribe(()=>{u()})},[a,u]),(0,Nt.useEffect)(()=>{if(!n)return;let d=setInterval(()=>{c()},n);return()=>clearInterval(d)},[c,n]),(0,Nt.useMemo)(()=>o,[o])}var ps=Y(Re(),1);function dI({controller:t,fetcher:e,configUri:a,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:n="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:m}){return u?(0,ps.jsx)(Jg,{runtime:u,children:(0,ps.jsx)(cI,{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:h,overlayFetchCredentials:g,footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:m})}):(0,ps.jsx)(cI,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:m})}function cI({controller:t,fetcher:e,configUri:a,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:n="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:m}){let[v,y]=(0,Kt.useState)(t.getState().open),_=ev(),[w,C]=(0,Kt.useState)(()=>typeof window<"u"?window.location.href:"/"),A=_?.url??w;(0,Kt.useEffect)(()=>{if(u||typeof window>"u")return;let F=()=>C(window.location.href);window.addEventListener("popstate",F),window.addEventListener("hashchange",F);let Q=history.pushState,D=history.replaceState;return history.pushState=function(...W){Q.apply(this,W),queueMicrotask(F)},history.replaceState=function(...W){D.apply(this,W),queueMicrotask(F)},()=>{window.removeEventListener("popstate",F),window.removeEventListener("hashchange",F),history.pushState=Q,history.replaceState=D}},[u]);let E=(0,Kt.useMemo)(()=>e||ls({configUri:a,experiments:s,featureKey:r,configFeatureKey:n,credentials:o}),[e,a,s,r,n,o]),L=uI({fetcher:E,experiments:s,runtime:u,pageUrl:A}),k=L.tiles.length>0&&!L.error;(0,Kt.useEffect)(()=>t.subscribe(F=>y(F.open)),[t]),(0,Kt.useEffect)(()=>{!L.isLoading&&!k&&t.getState().open&&t.setOpen(!1)},[t,k,L.isLoading]);let O=(0,Kt.useRef)(f??null),R=(0,Kt.useRef)(!!f);(0,Kt.useEffect)(()=>{if(!u?.actions)return;if(R.current){L.actions.length>0&&(R.current=!1);return}let F=!1;return(async()=>{if(O.current){try{await O.current.revertAll()}catch(D){console.error("[SmartCanvasApp] Failed to revert actions:",D)}O.current=null}if(!F&&L.actions.length>0)try{let D=await u.actions.applyBatch(L.actions);F?await D.revertAll():O.current=D}catch(D){F||console.error("[SmartCanvasApp] Failed to apply actions:",D)}})(),()=>{F=!0,O.current&&(O.current.revertAll().catch(D=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",D)}),O.current=null)}},[u,L.actions,A]),(0,Kt.useEffect)(()=>{if(u)return u.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[u,t]);let{shadowRoot:N}=ds(),P=L.theme;return!L.isLoading&&!k?null:(0,ps.jsx)(iv,{themeConfig:P,workspaceTheme:m,shadowRoot:N,children:(0,ps.jsx)(sI,{tiles:L.tiles,isLoading:L.isLoading,error:L.error,canvasTitle:L.canvasTitle,telemetry:l,launcherLabel:b??L.launcher?.label,launcherIcon:L.launcher?.icon,launcherAnimate:L.launcher?.animate,launcherAnimationStyle:L.launcher?.animationStyle,notificationCount:L.launcher?.notificationCount??L.tiles.length,footerSlot:S,isOpen:v,onToggle:()=>t.toggle(),displayMode:L.displayMode})})}var fv=Y(Re(),1),fI="smart-canvas",pI=`
|
|
427
446
|
:host {
|
|
428
447
|
font: inherit;
|
|
429
448
|
color: inherit;
|
|
@@ -437,12 +456,12 @@ ${l}
|
|
|
437
456
|
*, *::before, *::after {
|
|
438
457
|
box-sizing: border-box;
|
|
439
458
|
}
|
|
440
|
-
`,On,Fr,$r,Vi,ji,Ur,Pi,Wm=class extends HTMLElement{constructor(){super();ar(this,On);ar(this,Fr);ar(this,$r);ar(this,Vi);ar(this,ji);ar(this,Ur,null);ar(this,Pi,null);Qn(this,On,this.attachShadow({mode:"open",delegatesFocus:!0})),Qn(this,Fr,document.createElement("div")),ge(this,Fr).setAttribute("part","mount"),ge(this,On).appendChild(ge(this,Fr)),Qn(this,$r,document.createElement("div")),ge(this,$r).id="portalRoot",ge(this,On).appendChild(ge(this,$r)),Qn(this,Vi,document.createElement("div")),ge(this,Vi).id="overlayContainer",Object.assign(ge(this,Vi).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),ge(this,On).appendChild(ge(this,Vi)),Qn(this,ji,OE()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){ge(this,Ur)?.unmount(),Qn(this,Ur,null)}getMountNode(){return ge(this,Fr)}getController(){return ge(this,ji)}getPortalRoot(){return ge(this,$r)}getOverlayContainer(){return ge(this,Vi)}getShadowRoot(){return ge(this,On)}open(){ge(this,ji).setOpen(!0)}close(){ge(this,ji).setOpen(!1)}toggle(){ge(this,ji).toggle()}setOverrideFetcher(n){ge(this,Pi)&&(Qn(this,Pi,{...ge(this,Pi),fetcher:n}),this.render())}mountReactApp(n){Qn(this,Pi,n),this.render()}render(){!this.isConnected||!ge(this,Pi)||(ge(this,Ur)||Qn(this,Ur,(0,qE.createRoot)(ge(this,Fr))),ge(this,Ur).render((0,Xm.jsx)(NE,{shadowRoot:ge(this,On),portalRoot:ge(this,$r),overlayContainer:ge(this,Vi),children:(0,Xm.jsx)(VE,{...ge(this,Pi),controller:ge(this,ji),canvasHost:this})})))}applyBaseStyles(){if(ge(this,On).adoptedStyleSheets!==void 0){let n=new CSSStyleSheet;n.replaceSync(PE),ge(this,On).adoptedStyleSheets=[n]}else{let n=document.createElement("style");n.textContent=PE,ge(this,On).appendChild(n)}}};On=new WeakMap,Fr=new WeakMap,$r=new WeakMap,Vi=new WeakMap,ji=new WeakMap,Ur=new WeakMap,Pi=new WeakMap;var ZE=()=>{typeof window>"u"||customElements.get(jE)||customElements.define(jE,Wm)};var Km=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=yE(b)}let n=null,i=null,r=null,{runtime:o}=t;async function a(b){!o?.actions||b.length===0||(r?.isApplied()&&await r.revertAll(),r=await o.actions.applyBatch(b))}async function s(){r?.isApplied()&&(await r.revertAll(),r=null)}if(t.fetcher)try{i=t.fetcher,console.log("[SmartCanvas] Fetching initial config...");let b=await t.fetcher();n=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((f,p)=>`[${p}] ${f.kind}${f.anchorId?` anchor="${typeof f.anchorId=="string"?f.anchorId:f.anchorId.selector}"`:""}${f.label?` "${f.label}"`:""}`).join(", ")),b.actions&&b.actions.length>0&&o?.actions&&(await a(b.actions),console.log("[SmartCanvas] Initial actions applied successfully")),b.tiles&&o?.accumulator&&Xd(b.tiles,o.accumulator,b.actions)}catch(b){console.error("[SmartCanvas] Error fetching/applying initial config:",b)}e&&e();let l=wE();ZE();let c=document.createElement("smart-canvas");if(kE(c.getOverlayContainer()),t.tokens)for(let[b,f]of Object.entries(t.tokens))c.style.setProperty(b,f);let u=()=>{let b=t.target??document.body;b&&b.appendChild(c)};document.body?u():document.addEventListener("DOMContentLoaded",u,{once:!0}),l&&(console.log(`[SmartCanvas] Loading editor SDK for ${l} mode`),EE(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,h=t.integrations?.telemetry,m=t.fetcher??rs({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});i||(i=m);let S={fetcher:m,pollIntervalMs:t.pollIntervalMs,experiments:d,telemetry:h,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};c.mountReactApp(S),t.defaultOpen&&c.open();let _={el:c,open:()=>c.open(),close:()=>c.close(),destroy:()=>{s(),c.remove()},setTokens:b=>{for(let[f,p]of Object.entries(b))c.style.setProperty(f,p)},getConfig:async()=>{if(i)try{let b=await i();return n=b,b}catch(b){console.error("[SmartCanvas] Error fetching config:",b)}return n??{tiles:[],actions:[],fetchedAt:""}},setEnabled:async b=>{b?n&&await a(n.actions):await s()},setOverrideFetcher:b=>{i=b,c.setOverrideFetcher(b),o?.accumulator&&b().then(f=>{f?.tiles&&Xd(f.tiles,o.accumulator,f.actions)}).catch(()=>{})},registerTelemetryProperties:b=>{h?.register?.(b)},getSessionId:()=>h?.getSessionId?.(),startSessionRecording:()=>{h?.startSessionRecording?.()},track:(b,f)=>h?.track?(h.track(b,f),!0):!1,runtime:o};if(typeof window<"u"){let b=window.SynOS;b&&(b.handle=_)}return _};typeof window<"u"&&(window.SmartCanvas={async create(t){return Km(t)}});var jr=X(Qe(),1);var Vr=X($e(),1);function fB({tiles:t,intervalMs:e=7e3,telemetry:n}){let[i,r]=(0,jr.useState)(0),o=(0,jr.useMemo)(()=>[...t].sort((a,s)=>(a.priority??0)-(s.priority??0)),[t]);return(0,jr.useEffect)(()=>{n?.trackCanvasOpened("wheel")},[n]),(0,jr.useEffect)(()=>{if(o.length<=1)return;let a=setInterval(()=>{r(s=>(s+1)%o.length)},e);return()=>clearInterval(a)},[o,e]),(0,jr.useEffect)(()=>{let a=o[i];a&&n?.trackRectangleViewed(a.id,"wheel")},[i,o,n]),o.length?(0,Vr.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,Vr.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${i*100}%)`,width:`${o.length*100}%`},children:o.map(a=>(0,Vr.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,Vr.jsx)(Jl,{config:a,surface:"wheel",telemetry:n})},a.id))}),(0,Vr.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((a,s)=>(0,Vr.jsx)("button",{type:"button",style:{height:"0.5rem",width:"1.5rem",borderRadius:"9999px",background:s===i?"var(--sc-color-primary)":"var(--sc-tile-text-color)",border:"none",cursor:"pointer",padding:0},onClick:()=>r(s)},a.id))})]}):null}function ec(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function gB(t){let e=[],n=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let i=t;if(i.tiles||n.push("Config missing required field: tiles"),i.actions||n.push("Config missing required field: actions"),i.fetchedAt||n.push("Config missing required field: fetchedAt"),n.length>0)return{valid:!1,errors:n,warnings:e};let r=i.schemaVersion||"1.0",o=ec(r),a=ec(zr);return o.major>a.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<a.major||!i.schemaVersion?(e.push(`Config schema v${r} is older than SDK v${zr}. Migrating config to current version.`),{valid:!0,warnings:e,errors:n,migratedConfig:_D(i,r)}):{valid:!0,warnings:e,errors:n}}function _D(t,e){let n={...t};return ec(e).major===1&&(n=SD(n)),n.schemaVersion=zr,n}function SD(t){let e={schemaVersion:"2.0",tiles:[],actions:t.actions||[],fetchedAt:t.fetchedAt||new Date().toISOString()};return t.tiles&&Array.isArray(t.tiles)&&(e.tiles=t.tiles.map(n=>{let i={...n};if(n.experiment&&!n.activation){let r=n.experiment;r.featureKey&&(i.activation={strategy:{type:"external",provider:"growthbook",featureKey:r.featureKey,fallback:!1}}),delete i.experiment}return i})),t.configVersion&&(e.configVersion=t.configVersion),t.canvasTitle&&(e.canvasTitle=t.canvasTitle),t.theme&&(e.theme=t.theme),t.launcher&&(e.launcher=t.launcher),e}function mB(t){if(!t||typeof t!="object")return!1;let e=t,n=e.schemaVersion||"1.0",i=ec(n),r=ec(zr);return i.major<r.major||!e.schemaVersion}var YE={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function WE(){return YE}function Qm(t){let e=2166136261,n=t.length;for(let i=0;i<n;i++)e^=t.charCodeAt(i),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function tc(t,e,n){return n===2?Qm(Qm(t+e)+"")%1e4/1e4:n===1?Qm(e+t)%1e3/1e3:null}function xD(t){return t<=0?[]:new Array(t).fill(1/t)}function tf(t,e){return t>=e[0]&&t<e[1]}function XE(t,e){let n=tc("__"+e[0],t,1);return n===null?!1:n>=e[1]&&n<e[2]}function KE(t,e){for(let n=0;n<e.length;n++)if(tf(t,e[n]))return n;return-1}function ev(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function nf(t,e){if(!e.length)return!1;let n=!1,i=!1;for(let r=0;r<e.length;r++){let o=CD(t,e[r].type,e[r].pattern);if(e[r].include===!1){if(o)return!1}else n=!0,o&&(i=!0)}return i||!n}function wD(t,e,n){try{let i=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return n&&(i="\\/?"+i.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+i+"$","i").test(t)}catch{return!1}}function ED(t,e){try{let n=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),i=[[t.host,n.host,!1],[t.pathname,n.pathname,!0]];return n.hash&&i.push([t.hash,n.hash,!1]),n.searchParams.forEach((r,o)=>{i.push([t.searchParams.get(o)||"",r,!1])}),!i.some(r=>!wD(r[0],r[1],r[2]))}catch{return!1}}function CD(t,e,n){try{let i=new URL(t,"https://_");if(e==="regex"){let r=ev(n);return r?r.test(i.href)||r.test(i.href.substring(i.origin.length)):!1}else if(e==="simple")return ED(i,n);return!1}catch{return!1}}function QE(t,e,n){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let i=xD(t);n=n||i,n.length!==t&&(n=i);let r=n.reduce((a,s)=>s+a,0);(r<.99||r>1.01)&&(n=i);let o=0;return n.map(a=>{let s=o;return o+=a,[s,s+e*a]})}function JE(t,e,n){if(!e)return null;let i=e.split("?")[1];if(!i)return null;let r=i.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return r.length>0&&r[0]>=0&&r[0]<n?r[0]:null}function eC(t){try{return t()}catch(e){return console.error(e),!1}}var Jm=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function zo(t,e,n){if(e=e||"",n=n||globalThis.crypto&&globalThis.crypto.subtle||YE.SubtleCrypto,!n)throw new Error("No SubtleCrypto implementation found");try{let i=await n.importKey("raw",Jm(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[r,o]=t.split("."),a=await n.decrypt({name:"AES-CBC",iv:Jm(r)},i,Jm(o));return new TextDecoder().decode(a)}catch{throw new Error("Failed to decrypt")}}function nc(t){return typeof t=="string"?t:JSON.stringify(t)}function pn(t){typeof t=="number"&&(t=t+""),(!t||typeof t!="string")&&(t="0");let e=t.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return e.length===3&&e.push("~"),e.map(n=>n.match(/^[0-9]+$/)?n.padStart(5," "):n).join("-")}function tC(){let t;try{t="1.6.4"}catch{t=""}return t}function nC(t,e){let n,i;try{n=new URL(t),i=new URL(e)}catch(r){return console.error(`Unable to merge query strings: ${r}`),e}return n.searchParams.forEach((r,o)=>{i.searchParams.has(o)||i.searchParams.set(o,r)}),i.toString()}function GE(t){return typeof t=="object"&&t!==null}function rf(t){return t.urlPatterns&&t.variations.some(e=>GE(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>GE(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function of(t,e){return new Promise(n=>{let i=!1,r,o=a=>{i||(i=!0,r&&clearTimeout(r),n(a||null))};e&&(r=setTimeout(()=>o(),e)),t.then(a=>o(a)).catch(()=>o())})}var Rt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},si=WE(),us={fetchFeaturesCall:({host:t,clientKey:e,headers:n})=>si.fetch(`${t}/api/features/${e}`,{headers:n}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:n,headers:i})=>{let r={method:"POST",headers:{"Content-Type":"application/json",...i},body:JSON.stringify(n)};return si.fetch(`${t}/api/eval/${e}`,r)},eventSourceCall:({host:t,clientKey:e,headers:n})=>n?new si.EventSource(`${t}/sub/${e}`,{headers:n}):new si.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let n=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),kD()):document.visibilityState==="hidden"&&(t=window.setTimeout(TD,Rt.idleStreamInterval))};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(si.localStorage=globalThis.localStorage)}catch{}var ds=new Map,iC=!1,qi=new Map,af=new Map,fs=new Map,ps=new Set;function oC(t){Object.assign(Rt,t),Rt.backgroundSync||av()}async function aC({instance:t,timeout:e,skipCache:n,allowStale:i,backgroundSync:r}){return r||(Rt.backgroundSync=!1),RD({instance:t,allowStale:i,timeout:e,skipCache:n})}function AD(t){let e=ic(t),n=ds.get(e)||new Set;n.add(t),ds.set(e,n)}function sC(t){ds.forEach(e=>e.delete(t))}function TD(){fs.forEach(t=>{t&&(t.state="idle",rv(t))})}function kD(){fs.forEach(t=>{t&&t.state==="idle"&&ov(t)})}async function rC(){try{if(!si.localStorage)return;await si.localStorage.setItem(Rt.cacheKey,JSON.stringify(Array.from(qi.entries())))}catch{}}async function RD({instance:t,allowStale:e,timeout:n,skipCache:i}){let r=ic(t),o=nv(t),a=new Date,s=new Date(a.getTime()-Rt.maxAge+Rt.staleTTL);await OD();let l=!Rt.disableCache&&!i?qi.get(o):void 0;return l&&(e||l.staleAt>a)&&l.staleAt>s?(l.sse&&ps.add(r),l.staleAt<a?tv(t):iv(t),{data:l.data,success:!0,source:"cache"}):await of(tv(t),n)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function ic(t){let[e,n]=t.getApiInfo();return`${e}||${n}`}function nv(t){let e=ic(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let n=t.getAttributes(),i=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),r={};i.forEach(s=>{r[s]=n[s]});let o=t.getForcedVariations(),a=t.getUrl();return`${e}||${JSON.stringify({ca:r,fv:o,url:a})}`}async function OD(){if(!iC){iC=!0;try{if(si.localStorage){let t=await si.localStorage.getItem(Rt.cacheKey);if(!Rt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([n,i])=>{qi.set(n,{...i,staleAt:new Date(i.staleAt)})}),lC()}}}catch{}if(!Rt.disableIdleStreams){let t=us.startIdleListener();t&&(us.stopIdleListener=t)}}}function lC(){let t=Array.from(qi.entries()).map(([n,i])=>({key:n,staleAt:i.staleAt.getTime()})).sort((n,i)=>n.staleAt-i.staleAt),e=Math.min(Math.max(0,qi.size-Rt.maxEntries),qi.size);for(let n=0;n<e;n++)qi.delete(t[n].key)}function cC(t,e,n){let i=n.dateUpdated||"",r=new Date(Date.now()+Rt.staleTTL),o=Rt.disableCache?void 0:qi.get(e);if(o&&i&&o.version===i){o.staleAt=r,rC();return}Rt.disableCache||(qi.set(e,{data:n,version:i,staleAt:r,sse:ps.has(t)}),lC()),rC();let a=ds.get(t);a&&a.forEach(s=>MD(s,n))}async function MD(t,e){await t.setPayload(e||t.getPayload())}async function tv(t){let{apiHost:e,apiRequestHeaders:n}=t.getApiHosts(),i=t.getClientKey(),r="isRemoteEval"in t&&t.isRemoteEval(),o=ic(t),a=nv(t),s=af.get(a);return s||(s=(r?us.fetchRemoteEvalCall({host:e,clientKey:i,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:n}):us.fetchFeaturesCall({host:e,clientKey:i,headers:n})).then(c=>{if(!c.ok)throw new Error(`HTTP error: ${c.status}`);return c.headers.get("x-sse-support")==="enabled"&&ps.add(o),c.json()}).then(c=>(cC(o,a,c),iv(t),af.delete(a),{data:c,success:!0,source:"network"})).catch(c=>(af.delete(a),{data:null,source:"error",success:!1,error:c})),af.set(a,s)),s}function iv(t,e=!1){let n=ic(t),i=nv(t),{streamingHost:r,streamingHostRequestHeaders:o}=t.getApiHosts(),a=t.getClientKey();if(e&&ps.add(n),Rt.backgroundSync&&ps.has(n)&&si.EventSource){if(fs.has(n))return;let s={src:null,host:r,clientKey:a,headers:o,cb:l=>{try{if(l.type==="features-updated"){let c=ds.get(n);c&&c.forEach(u=>{tv(u)})}else if(l.type==="features"){let c=JSON.parse(l.data);cC(n,i,c)}s.errors=0}catch{uC(s)}},errors:0,state:"active"};fs.set(n,s),ov(s)}}function uC(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);rv(t),setTimeout(()=>{["idle","active"].includes(t.state)||ov(t)},Math.min(e,3e5))}}function rv(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function ov(t){t.src=us.eventSourceCall({host:t.host,clientKey:t.clientKey,headers:t.headers}),t.state="active",t.src.addEventListener("features",t.cb),t.src.addEventListener("features-updated",t.cb),t.src.onerror=()=>uC(t),t.src.onopen=()=>{t.errors=0}}function ND(t,e){rv(t),fs.delete(e)}function av(){ps.clear(),fs.forEach(ND),ds.clear(),us.stopIdleListener()}function sf(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&iv(t,!0),AD(t)}}var DD=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,cv={revert:function(){}},df=new Map,uv=new Set;function LD(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function ff(t){var e=df.get(t);return e||(e={element:t,attributes:{}},df.set(t,e)),e}function pf(t,e,n,i,r){var o=n(t),a={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&a._positionTimeout)){e==="position"&&(a._positionTimeout=setTimeout(function(){a._positionTimeout=null},1e3));var s=n(t);e==="position"&&s.parentNode===a.virtualValue.parentNode&&s.insertBeforeNode===a.virtualValue.insertBeforeNode||s!==a.virtualValue&&(a.originalValue=s,r(a))}}),mutationRunner:r,setValue:i,getCurrentValue:n};return e==="position"&&t.parentNode?a.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):a.observer.observe(t,LD(e)),a}function hf(t,e){var n=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!n||t.parentNode!==n.parentNode||t.insertBeforeNode!==n.insertBeforeNode)&&(e.isDirty=!0,dC()):t!==n&&(e.isDirty=!0,dC())}function ID(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),hf(WD(e),t)}function HD(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(n){return n.mutate(e)}),hf(Array.from(e).filter(Boolean).join(" "),t)}function zD(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),hf(e,t)}function BD(t){var e=t.parentSelector,n=t.insertBeforeSelector,i=document.querySelector(e);if(!i)return null;var r=n?document.querySelector(n):null;return n&&!r?null:{parentNode:i,insertBeforeNode:r}}function FD(t){var e=t.originalValue;t.mutations.forEach(function(n){var i=n.mutate(),r=BD(i);e=r||e}),hf(e,t)}var $D=function(e){return e.innerHTML},UD=function(e,n){return e.innerHTML=n};function pC(t){var e=ff(t);return e.html||(e.html=pf(t,"html",$D,UD,ID)),e.html}var VD=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},jD=function(e,n){n.insertBeforeNode&&!n.parentNode.contains(n.insertBeforeNode)||n.parentNode.insertBefore(e,n.insertBeforeNode)};function hC(t){var e=ff(t);return e.position||(e.position=pf(t,"position",VD,jD,FD)),e.position}var PD=function(e,n){return n?e.className=n:e.removeAttribute("class")},qD=function(e){return e.className};function gC(t){var e=ff(t);return e.classes||(e.classes=pf(t,"class",qD,PD,HD)),e.classes}var ZD=function(e){return function(n){var i;return(i=n.getAttribute(e))!=null?i:null}},GD=function(e){return function(n,i){return i!==null?n.setAttribute(e,i):n.removeAttribute(e)}};function mC(t,e){var n=ff(t);return n.attributes[e]||(n.attributes[e]=pf(t,e,ZD(e),GD(e),zD)),n.attributes[e]}function YD(t,e){var n=df.get(t);if(n)if(e==="html"){var i,r;(i=n.html)==null||(r=i.observer)==null||r.disconnect(),delete n.html}else if(e==="class"){var o,a;(o=n.classes)==null||(a=o.observer)==null||a.disconnect(),delete n.classes}else if(e==="position"){var s,l;(s=n.position)==null||(l=s.observer)==null||l.disconnect(),delete n.position}else{var c,u,d;(c=n.attributes)==null||(u=c[e])==null||(d=u.observer)==null||d.disconnect(),delete n.attributes[e]}}var lf;function WD(t){return lf||(lf=document.createElement("div")),lf.innerHTML=t,lf.innerHTML}function cf(t,e,n){if(n.isDirty){n.isDirty=!1;var i=n.virtualValue;n.mutations.length||YD(t,e),n.setValue(t,i)}}function XD(t,e){t.html&&cf(e,"html",t.html),t.classes&&cf(e,"class",t.classes),t.position&&cf(e,"position",t.position),Object.keys(t.attributes).forEach(function(n){cf(e,n,t.attributes[n])})}function dC(){df.forEach(XD)}function KD(t,e){var n=null;t.kind==="html"?n=pC(e):t.kind==="class"?n=gC(e):t.kind==="attribute"?n=mC(e,t.attribute):t.kind==="position"&&(n=hC(e)),n&&(n.mutations.push(t),n.mutationRunner(n))}function QD(t,e){var n=null;if(t.kind==="html"?n=pC(e):t.kind==="class"?n=gC(e):t.kind==="attribute"?n=mC(e,t.attribute):t.kind==="position"&&(n=hC(e)),!!n){var i=n.mutations.indexOf(t);i!==-1&&n.mutations.splice(i,1),n.mutationRunner(n)}}function vC(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),n=document.querySelectorAll(t.selector);n.forEach(function(i){e.has(i)||(t.elements.add(i),KD(t,i))})}}function JD(t){t.elements.forEach(function(e){return QD(t,e)}),t.elements.clear(),uv.delete(t)}function fC(){uv.forEach(vC)}var sv;function e4(){typeof document>"u"||(sv||(sv=new MutationObserver(function(){fC()})),fC(),sv.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}e4();function gf(t){return typeof document>"u"?cv:(uv.add(t),vC(t),{revert:function(){JD(t)}})}function lv(t,e){return gf({kind:"html",elements:new Set,mutate:e,selector:t})}function yC(t,e){return gf({kind:"position",elements:new Set,mutate:e,selector:t})}function rc(t,e){return gf({kind:"class",elements:new Set,mutate:e,selector:t})}function uf(t,e,n){return DD.test(e)?e==="class"||e==="className"?rc(t,function(i){var r=n(Array.from(i).join(" "));i.clear(),r&&r.split(/\s+/g).filter(Boolean).forEach(function(o){return i.add(o)})}):gf({kind:"attribute",attribute:e,elements:new Set,mutate:n,selector:t}):cv}function t4(t){var e=t.selector,n=t.action,i=t.value,r=t.attribute,o=t.parentSelector,a=t.insertBeforeSelector;if(r==="html"){if(n==="append")return lv(e,function(s){return s+(i??"")});if(n==="set")return lv(e,function(){return i??""})}else if(r==="class"){if(n==="append")return rc(e,function(s){i&&s.add(i)});if(n==="remove")return rc(e,function(s){i&&s.delete(i)});if(n==="set")return rc(e,function(s){s.clear(),i&&s.add(i)})}else if(r==="position"){if(n==="set"&&o)return yC(e,function(){return{insertBeforeSelector:a,parentSelector:o}})}else{if(n==="append")return uf(e,r,function(s){return s!==null?s+(i??""):i??""});if(n==="set")return uf(e,r,function(){return i??""});if(n==="remove")return uf(e,r,function(){return null})}return cv}var n4={html:lv,classes:rc,attribute:uf,position:yC,declarative:t4},bC=n4;var dv={};function Pr(t,e,n){n=n||{};for(let[i,r]of Object.entries(e))switch(i){case"$or":if(!xC(t,r,n))return!1;break;case"$nor":if(xC(t,r,n))return!1;break;case"$and":if(!s4(t,r,n))return!1;break;case"$not":if(Pr(t,r,n))return!1;break;default:if(!oc(r,i4(t,i),n))return!1}return!0}function i4(t,e){let n=e.split("."),i=t;for(let r=0;r<n.length;r++)if(i&&typeof i=="object"&&n[r]in i)i=i[n[r]];else return null;return i}function _C(t,e=!1){let n=`${t}${e?"/i":""}`;return dv[n]||(dv[n]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),dv[n]}function oc(t,e,n,i=!1){if(typeof t=="string")return i?String(e).toLowerCase()===t.toLowerCase():e+""===t;if(typeof t=="number")return e*1===t;if(typeof t=="boolean")return e!==null&&!!e===t;if(t===null)return e===null;if(Array.isArray(t)||!wC(t))return JSON.stringify(e)===JSON.stringify(t);for(let r in t)if(!a4(r,e,t[r],n))return!1;return!0}function wC(t){let e=Object.keys(t);return e.length>0&&e.filter(n=>n[0]==="$").length===e.length}function r4(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 o4(t,e,n){if(!Array.isArray(t))return!1;let i=wC(e)?r=>oc(e,r,n):r=>Pr(r,e,n);for(let r=0;r<t.length;r++)if(t[r]&&i(t[r]))return!0;return!1}function hs(t,e,n=!1){if(n){let i=r=>typeof r=="string"?r.toLowerCase():r;return Array.isArray(t)?t.some(r=>e.some(o=>i(r)===i(o))):e.some(r=>i(t)===i(r))}return Array.isArray(t)?t.some(i=>e.includes(i)):e.includes(t)}function SC(t,e,n,i=!1){if(!Array.isArray(t))return!1;for(let r=0;r<e.length;r++){let o=!1;for(let a=0;a<t.length;a++)if(oc(e[r],t[a],n,i)){o=!0;break}if(!o)return!1}return!0}function a4(t,e,n,i){switch(t){case"$veq":return pn(e)===pn(n);case"$vne":return pn(e)!==pn(n);case"$vgt":return pn(e)>pn(n);case"$vgte":return pn(e)>=pn(n);case"$vlt":return pn(e)<pn(n);case"$vlte":return pn(e)<=pn(n);case"$eq":return e===n;case"$ne":return e!==n;case"$lt":return e<n;case"$lte":return e<=n;case"$gt":return e>n;case"$gte":return e>=n;case"$exists":return n?e!=null:e==null;case"$in":return Array.isArray(n)?hs(e,n):!1;case"$ini":return Array.isArray(n)?hs(e,n,!0):!1;case"$inGroup":return hs(e,i[n]||[]);case"$notInGroup":return!hs(e,i[n]||[]);case"$nin":return Array.isArray(n)?!hs(e,n):!1;case"$nini":return Array.isArray(n)?!hs(e,n,!0):!1;case"$not":return!oc(n,e,i);case"$size":return Array.isArray(e)?oc(n,e.length,i):!1;case"$elemMatch":return o4(e,n,i);case"$all":return Array.isArray(n)?SC(e,n,i):!1;case"$alli":return Array.isArray(n)?SC(e,n,i,!0):!1;case"$regex":try{return _C(n).test(e)}catch{return!1}case"$regexi":try{return _C(n,!0).test(e)}catch{return!1}case"$type":return r4(e)===n;default:return console.error("Unknown operator: "+t),!1}}function xC(t,e,n){if(!e.length)return!0;for(let i=0;i<e.length;i++)if(Pr(t,e[i],n))return!0;return!1}function s4(t,e,n){for(let i=0;i<e.length;i++)if(!Pr(t,e[i],n))return!1;return!0}var l4="Feature Evaluated",c4="Experiment Viewed";function u4(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),e}function d4(t){return t.global.forcedVariations&&t.user.forcedVariations?{...t.global.forcedVariations,...t.user.forcedVariations}:t.global.forcedVariations?t.global.forcedVariations:t.user.forcedVariations?t.user.forcedVariations:{}}async function gs(t){try{await t()}catch{}}function EC(t,e,n){if(t.user.trackedExperiments){let r=yf(e,n);if(t.user.trackedExperiments.has(r))return[];t.user.trackedExperiments.add(r)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:n,timestamp:Date.now().toString(),logType:"experiment"});let i=[];if(t.global.trackingCallback){let r=t.global.trackingCallback;i.push(gs(()=>r(e,n,t.user)))}if(t.user.trackingCallback){let r=t.user.trackingCallback;i.push(gs(()=>r(e,n)))}if(t.global.eventLogger){let r=t.global.eventLogger;i.push(gs(()=>r(c4,{experimentId:e.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},t.user)))}return i}function f4(t,e,n){if(t.user.trackedFeatureUsage){let i=JSON.stringify(n.value);if(t.user.trackedFeatureUsage[e]===i)return;t.user.trackedFeatureUsage[e]=i,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:n,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let i=t.global.onFeatureUsage;gs(()=>i(e,n,t.user))}if(t.user.onFeatureUsage){let i=t.user.onFeatureUsage;gs(()=>i(e,n))}if(t.global.eventLogger){let i=t.global.eventLogger;gs(()=>i(l4,{feature:e,source:n.source,value:n.value,ruleId:n.source==="defaultValue"?"$default":n.ruleId||"",variationId:n.experimentResult?n.experimentResult.key:""},t.user))}}function mf(t,e){if(e.stack.evaluatedFeatures.has(t))return qr(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let n=u4(e);if(n.has(t))return qr(e,t,n.get(t),"override");if(!e.global.features||!e.global.features[t])return qr(e,t,null,"unknownFeature");let i=e.global.features[t];if(i.rules){let r=new Set(e.stack.evaluatedFeatures);e:for(let o of i.rules){if(o.parentConditions)for(let l of o.parentConditions){e.stack.evaluatedFeatures=new Set(r);let c=mf(l.id,e);if(c.source==="cyclicPrerequisite")return qr(e,t,null,"cyclicPrerequisite");let u={value:c.value};if(!Pr(u,l.condition||{})){if(l.gate)return qr(e,t,null,"prerequisite");continue e}}if(o.filters&&TC(o.filters,e))continue;if("force"in o){if(o.condition&&!AC(o.condition,e)||!p4(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=>{!EC(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),qr(e,t,o.force,"force",o.id)}if(!o.variations)continue;let a={variations:o.variations,key:o.key||t};"coverage"in o&&(a.coverage=o.coverage),o.weights&&(a.weights=o.weights),o.hashAttribute&&(a.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(a.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(a.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(a.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(a.minBucketVersion=o.minBucketVersion),o.namespace&&(a.namespace=o.namespace),o.meta&&(a.meta=o.meta),o.ranges&&(a.ranges=o.ranges),o.name&&(a.name=o.name),o.phase&&(a.phase=o.phase),o.seed&&(a.seed=o.seed),o.hashVersion&&(a.hashVersion=o.hashVersion),o.filters&&(a.filters=o.filters),o.condition&&(a.condition=o.condition);let{result:s}=vf(a,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(a,s),s.inExperiment&&!s.passthrough)return qr(e,t,s.value,"experiment",o.id,a,s)}}return qr(e,t,i.defaultValue===void 0?null:i.defaultValue,"defaultValue")}function vf(t,e,n){let i=t.key,r=t.variations.length;if(r<2)return{result:je(n,t,-1,!1,e)};if(n.global.enabled===!1||n.user.enabled===!1)return{result:je(n,t,-1,!1,e)};if(t=h4(t,n),t.urlPatterns&&!nf(n.user.url||"",t.urlPatterns))return{result:je(n,t,-1,!1,e)};let o=JE(i,n.user.url||"",r);if(o!==null)return{result:je(n,t,o,!1,e)};let a=d4(n);if(i in a){let b=a[i];return{result:je(n,t,b,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:je(n,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=Bo(n,t.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:je(n,t,-1,!1,e)};let c=-1,u=!1,d=!1;if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:b,versionIsBlocked:f}=v4({ctx:n,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});u=b>=0,c=b,d=!!f}if(!u){if(t.filters){if(TC(t.filters,n))return{result:je(n,t,-1,!1,e)}}else if(t.namespace&&!XE(l,t.namespace))return{result:je(n,t,-1,!1,e)};if(t.include&&!eC(t.include))return{result:je(n,t,-1,!1,e)};if(t.condition&&!AC(t.condition,n))return{result:je(n,t,-1,!1,e)};if(t.parentConditions){let b=new Set(n.stack.evaluatedFeatures);for(let f of t.parentConditions){n.stack.evaluatedFeatures=new Set(b);let p=mf(f.id,n);if(p.source==="cyclicPrerequisite")return{result:je(n,t,-1,!1,e)};let v={value:p.value};if(!Pr(v,f.condition||{}))return{result:je(n,t,-1,!1,e)}}}if(t.groups&&!m4(t.groups,n))return{result:je(n,t,-1,!1,e)}}if(t.url&&!g4(t.url,n))return{result:je(n,t,-1,!1,e)};let h=tc(t.seed||i,l,t.hashVersion||1);if(h===null)return{result:je(n,t,-1,!1,e)};if(!u){let b=t.ranges||QE(r,t.coverage===void 0?1:t.coverage,t.weights);c=KE(h,b)}if(d)return{result:je(n,t,-1,!1,e,void 0,!0)};if(c<0)return{result:je(n,t,-1,!1,e)};if("force"in t)return{result:je(n,t,t.force===void 0?-1:t.force,!1,e)};if(n.global.qaMode||n.user.qaMode)return{result:je(n,t,-1,!1,e)};if(t.status==="stopped")return{result:je(n,t,-1,!1,e)};let m=je(n,t,c,!0,e,h,u);if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:b,key:f,doc:p}=b4(n,s,nc(l),{[fv(t.key,t.bucketVersion)]:m.key});b&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[f]=p,n.user.saveStickyBucketAssignmentDoc(p))}let S=EC(n,t,m);S.length===0&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:t,result:m});let _=S.length?S.length===1?S[0]:Promise.all(S).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&n.global.recordChangeId&&n.global.recordChangeId(t.changeId),{result:m,trackingCall:_}}function qr(t,e,n,i,r,o,a){let s={value:n,on:!!n,off:!n,source:i,ruleId:r||""};return o&&(s.experiment=o),a&&(s.experimentResult=a),i!=="override"&&f4(t,e,s),s}function CC(t){return{...t.user.attributes,...t.user.attributeOverrides}}function AC(t,e){return Pr(CC(e),t,e.global.savedGroups||{})}function TC(t,e){return t.some(n=>{let{hashValue:i}=Bo(e,n.attribute);if(!i)return!0;let r=tc(n.seed,i,n.hashVersion||2);return r===null?!0:!n.ranges.some(o=>tf(r,o))})}function p4(t,e,n,i,r,o,a){if(!r&&o===void 0)return!0;if(!r&&o===0)return!1;let{hashValue:s}=Bo(t,n,i);if(!s)return!1;let l=tc(e,s,a||1);return l===null?!1:r?tf(l,r):o!==void 0?l<=o:!0}function je(t,e,n,i,r,o,a){let s=!0;(n<0||n>=e.variations.length)&&(n=0,s=!1);let{hashAttribute:l,hashValue:c}=Bo(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),u=e.meta?e.meta[n]:{},d={key:u.key||""+n,featureId:r,inExperiment:s,hashUsed:i,variationId:n,value:e.variations[n],hashAttribute:l,hashValue:c,stickyBucketUsed:!!a};return u.name&&(d.name=u.name),o!==void 0&&(d.bucket=o),u.passthrough&&(d.passthrough=u.passthrough),d}function h4(t,e){let n=t.key,i=e.global.overrides;return i&&i[n]&&(t=Object.assign({},t,i[n]),typeof t.url=="string"&&(t.url=ev(t.url))),t}function Bo(t,e,n){let i=e||"id",r="",o=CC(t);return o[i]&&(r=o[i]),!r&&n&&(o[n]&&(r=o[n]),r&&(i=n)),{hashAttribute:i,hashValue:r}}function g4(t,e){let n=e.user.url;if(!n)return!1;let i=n.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(n)||t.test(i))}function m4(t,e){let n=e.global.groups||{};for(let i=0;i<t.length;i++)if(n[t[i]])return!0;return!1}function v4({ctx:t,expKey:e,expBucketVersion:n,expHashAttribute:i,expFallbackAttribute:r,expMinBucketVersion:o,expMeta:a}){n=n||0,o=o||0,i=i||"id",a=a||[];let s=fv(e,n),l=y4(t,i,r);if(o>0)for(let d=0;d<o;d++){let h=fv(e,d);if(l[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let c=l[s];if(c===void 0)return{variation:-1};let u=a.findIndex(d=>d.key===c);return u<0?{variation:-1}:{variation:u}}function fv(t,e){return e=e||0,`${t}__${e}`}function pv(t,e){return`${t}||${e}`}function y4(t,e,n){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:i,hashValue:r}=Bo(t,e),o=pv(i,nc(r)),{hashAttribute:a,hashValue:s}=Bo(t,n),l=s?pv(a,nc(s)):null,c={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[o]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[o].assignments||{}),c}function b4(t,e,n,i){let r=pv(e,n),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[r]?t.user.stickyBucketAssignmentDocs[r].assignments||{}:{},a={...o,...i},s=JSON.stringify(o)!==JSON.stringify(a);return{key:r,doc:{attributeName:e,attributeValue:n,assignments:a},changed:s}}function _4(t,e){let n=new Set,i=e&&e.features?e.features:t.global.features||{},r=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(i).forEach(o=>{let a=i[o];if(a.rules)for(let s of a.rules)s.variations&&(n.add(s.hashAttribute||"id"),s.fallbackAttribute&&n.add(s.fallbackAttribute))}),r.map(o=>{n.add(o.hashAttribute||"id"),o.fallbackAttribute&&n.add(o.fallbackAttribute)}),Array.from(n)}async function kC(t,e,n){let i=hv(t,n);return e.getAllAssignments(i)}function hv(t,e){let n={};return _4(t,e).forEach(r=>{let{hashValue:o}=Bo(t,r);n[r]=nc(o)}),n}async function RC(t,e,n){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await zo(t.encryptedFeatures,e,n))}catch(i){console.error(i)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await zo(t.encryptedExperiments,e,n))}catch(i){console.error(i)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await zo(t.encryptedSavedGroups,e,n))}catch(i){console.error(i)}delete t.encryptedSavedGroups}return t}function OC(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 yf(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var ms=typeof window<"u"&&typeof document<"u",S4=tC(),ac=class{constructor(e){if(e=e||{},this.version=S4,this._options=this.context=e,this._renderer=e.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!e.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl="",this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!e.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._onExperimentEval=this._onExperimentEval.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),e.remoteEval){if(e.decryptionKey)throw new Error("Encryption is not available for remoteEval");if(!e.clientKey)throw new Error("Missing clientKey");let n=!1;try{n=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(n)throw new Error("Cannot use remoteEval on GrowthBook Cloud")}else if(e.cacheKeyAttributes)throw new Error("cacheKeyAttributes are only used for remoteEval");if(e.stickyBucketService){let n=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=i=>n.saveAssignments(i)}if(e.plugins)for(let n of e.plugins)n(this);if(e.features&&(this.ready=!0),ms&&e.enableDevMode&&(window._growthbook=this,document.dispatchEvent(new Event("gbloaded"))),e.experiments&&(this.ready=!0,this._updateAllAutoExperiments()),this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let n in this._options.stickyBucketAssignmentDocs){let i=this._options.stickyBucketAssignmentDocs[n];i&&this._options.stickyBucketService.saveAssignments(i).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let n=await RC(e,this._options.decryptionKey);this._decryptedPayload=n,await this.refreshStickyBuckets(n),n.features&&(this._options.features=n.features),n.savedGroups&&(this._options.savedGroups=n.savedGroups),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let n=e.payload;if(n.encryptedExperiments||n.encryptedFeatures)throw new Error("initSync does not support encrypted payloads");return this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs&&(this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,n)),this._payload=n,this._decryptedPayload=n,n.features&&(this._options.features=n.features),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,sf(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&oC(e.cacheSettings),e.payload)return await this.setPayload(e.payload),sf(this,e),{success:!0,source:"init"};{let{data:n,...i}=await this._refresh({...e,allowStale:!0});return sf(this,e),await this.setPayload(n||{}),i}}async loadFeatures(e){e=e||{},await this.init({skipCache:e.skipCache,timeout:e.timeout,streaming:(this._options.backgroundSync??!0)&&(e.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(e){let n=await this._refresh({...e||{},allowStale:!1});n.data&&await this.setPayload(n.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return OC(this._options)}getClientKey(){return this._options.clientKey||""}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh({timeout:e,skipCache:n,allowStale:i,streaming:r}){if(!this._options.clientKey)throw new Error("Missing clientKey");return aC({instance:this,timeout:e,skipCache:n||this._options.disableCache,allowStale:i,backgroundSync:r??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(e){console.error("Failed to render",e)}}setFeatures(e){this._options.features=e,this.ready=!0,this._render()}async setEncryptedFeatures(e,n,i){let r=await zo(e,n||this._options.decryptionKey,i);this.setFeatures(JSON.parse(r))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,n,i){let r=await zo(e,n||this._options.decryptionKey,i);this.setExperiments(JSON.parse(r))}async setAttributes(e){if(this._options.attributes=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(e){return this.setAttributes({...this._options.attributes,...e})}async setAttributeOverrides(e){if(this._options.attributeOverrides=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(e){if(this._options.forcedVariations=e||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(e){this._options.forcedFeatureValues=e,this._render()}async setURL(e){if(e!==this._options.url){if(this._options.url=e,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(e){return this._subscriptions.add(e),()=>{this._subscriptions.delete(e)}}async _refreshForRemoteEval(){if(!this._options.remoteEval||!this._initialized)return;let e=await this._refresh({allowStale:!1});e.data&&await this.setPayload(e.data)}getAllResults(){return new Map(this._assigned)}onDestroy(e){this._destroyCallbacks.push(e)}isDestroyed(){return!!this._destroyed}destroy(e){e=e||{},this._destroyed=!0,this._destroyCallbacks.forEach(n=>{try{n()}catch(i){console.error(i)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,sC(this),e.destroyAllStreams&&av(),this.logs=[],ms&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(n=>{n.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,n){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=n,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:n}=vf(e,null,this._getEvalContext());return this._onExperimentEval(e,n),n}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(i=>i.key===e).map(i=>this._runAutoExperiment(i)).filter(i=>i!==null):null}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._onExperimentEval,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(e,n){let i=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!i)return null;let r=this._isAutoExperimentBlockedByContext(e),o,a;r?o=je(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:a}=vf(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let s=JSON.stringify(o.value);if(!n&&o.inExperiment&&i&&i.valueHash===s)return o;if(i&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=rf(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let c=e.persistQueryString?nC(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(nf(c,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),o;this._redirectedUrl=c;let{navigate:u,delay:d}=this._getNavigateFunction();if(u)if(ms)Promise.all([...a?[of(a,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??d))]).then(()=>{try{u(c)}catch(h){console.error(h)}});else try{u(c)}catch(h){console.error(h)}}else if(l==="visual"){let c=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);c&&this._activeAutoExperiments.set(e,{undo:c,valueHash:s})}}return o}_undoActiveAutoExperiment(e){let n=this._activeAutoExperiments.get(e);n&&(n.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let n=this._options.experiments||[],i=new Set(n);this._activeAutoExperiments.forEach((r,o)=>{i.has(o)||(r.undo(),this._activeAutoExperiments.delete(o))});for(let r of n){let o=this._runAutoExperiment(r,e);if(o&&o.inExperiment&&rf(r)==="redirect")break}}_onExperimentEval(e,n){let i=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:n}),this._subscriptions.size>0&&this._fireSubscriptions(e,n,i)}_fireSubscriptions(e,n,i){(!i||i.result.inExperiment!==n.inExperiment||i.result.variationId!==n.variationId)&&this._subscriptions.forEach(r=>{try{r(e,n)}catch(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,n){let i=this.evalFeature(e).value;return i===null?n:i}feature(e){return this.evalFeature(e)}evalFeature(e){return mf(e,this._getEvalContext())}log(e,n){this.debug&&(this._options.log?this._options.log(e,n):console.log(e,n))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(n=>n&&n.experiment&&n.result).map(n=>[yf(n.experiment,n.result),n]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(n=>{!n||!n.experiment||!n.result?console.error("Invalid deferred tracking call",{call:n}):e.push(this._options.trackingCallback(n.experiment,n.result))}),this._deferredTrackingCalls.clear(),await Promise.all(e)}setTrackingCallback(e){this._options.trackingCallback=e,this.fireDeferredTrackingCalls()}setEventLogger(e){this._options.eventLogger=e}async logEvent(e,n){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:n,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,n||{},this._getUserContext())}catch(i){console.error(i)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(yf(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(ms?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let n=rf(e);if(n==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(i=>i.js))return!0}else if(n==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let i=new URL(this._getContextUrl());for(let r of e.variations){if(!r||!r.urlRedirect)continue;let o=new URL(r.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(o.protocol!==i.protocol||o.host!==i.host))return!0}}catch(i){return this.log("Error parsing current or redirect URL",{id:e.key,error:i}),!0}}else return!0;return!!(e.changeId&&(this._options.blockedChangeIds||[]).includes(e.changeId))}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){return this._options.navigate?{navigate:this._options.navigate,delay:0}:ms?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!ms)return;let n=[];if(e.css){let i=document.createElement("style");i.innerHTML=e.css,document.head.appendChild(i),n.push(()=>i.remove())}if(e.js){let i=document.createElement("script");i.innerHTML=e.js,this._options.jsInjectionNonce&&(i.nonce=this._options.jsInjectionNonce),document.head.appendChild(i),n.push(()=>i.remove())}return e.domMutations&&e.domMutations.forEach(i=>{n.push(bC.declarative(i).revert)}),()=>{n.forEach(i=>i())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let n=this._getEvalContext(),i=await kC(n,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=i}}generateStickyBucketAssignmentDocsSync(e,n){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let i=this._getEvalContext(),r=hv(i,n);return e.getAllAssignmentsSync(r)}inDevMode(){return!!this._options.enableDevMode}};var x4="https://experiment.syntrologie.com",gv=class{constructor(e={}){P(this,"gb");P(this,"featureListeners",new Set);if(e.client)this.gb=e.client;else{let n=e.onExperimentViewed?(i,r)=>{e.onExperimentViewed(i.key,r.variationId,typeof r.value=="string"?r.value:`variation_${r.variationId}`)}:void 0;this.gb=new ac({...e,apiHost:e.apiHost??x4,enableDevMode:e.enableDevMode??!0,trackingCallback:n}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes(e)}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,n){return this.gb.getFeatureValue(e,n)}getAllFeatures(){let e=this.gb.getFeatures(),n={};for(let i of Object.keys(e))n[i]=this.gb.getFeatureValue(i,null);return n}shouldRenderRectangle(e){return!0}onFeaturesChanged(e){return this.featureListeners.add(e),this.featureListeners.size===1&&this.gb.setRenderer(()=>{for(let n of this.featureListeners)n()}),()=>{this.featureListeners.delete(e),this.featureListeners.size===0&&this.gb.setRenderer(null)}}};function mv(t={}){return new gv(t)}var MC="syntro_session_metrics",bf=class{constructor(e={}){P(this,"metrics",new Map);P(this,"experiments");P(this,"attributePrefix");P(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,n=1){let r=(this.metrics.get(e)??0)+n;return this.metrics.set(e,r),this.saveToStorage(),this.updateExperimentAttributes(e,r),this.onMetricChange?.(e,r),r}set(e,n){this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,n){return this.get(e)>=n}getAll(){return Object.fromEntries(this.metrics)}reset(e){this.metrics.delete(e),this.saveToStorage(),this.updateExperimentAttributes(e,0),this.onMetricChange?.(e,0)}resetAll(){let e=Array.from(this.metrics.keys());this.metrics.clear(),this.saveToStorage();let n={};for(let i of e)n[`${this.attributePrefix}${i}`]=0,this.onMetricChange?.(i,0);this.experiments?.setAttributes?.(n)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,n){if(!this.experiments?.setAttributes)return;let i=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[i]:n})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[n,i]of this.metrics)e[`${this.attributePrefix}${n}`]=i;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(MC);if(e){let n=JSON.parse(e);for(let[i,r]of Object.entries(n))this.metrics.set(i,r.count)}}catch(e){console.warn("[SessionMetricTracker] Failed to load from sessionStorage:",e)}}saveToStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e={};for(let[n,i]of this.metrics)e[n]={count:i,lastUpdated:Date.now()};sessionStorage.setItem(MC,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function vv(t={}){return new bf(t)}var g={};uR(g,{BRAND:()=>Y4,DIRTY:()=>Fo,EMPTY_PATH:()=>A4,INVALID:()=>W,NEVER:()=>NL,OK:()=>Ot,ParseStatus:()=>wt,Schema:()=>ae,ZodAny:()=>Yr,ZodArray:()=>Wi,ZodBigInt:()=>Uo,ZodBoolean:()=>Vo,ZodBranded:()=>lc,ZodCatch:()=>Jo,ZodDate:()=>jo,ZodDefault:()=>Qo,ZodDiscriminatedUnion:()=>xf,ZodEffects:()=>Dn,ZodEnum:()=>Xo,ZodError:()=>Yt,ZodFirstPartyTypeKind:()=>K,ZodFunction:()=>Ef,ZodIntersection:()=>Go,ZodIssueCode:()=>L,ZodLazy:()=>Yo,ZodLiteral:()=>Wo,ZodMap:()=>xs,ZodNaN:()=>Es,ZodNativeEnum:()=>Ko,ZodNever:()=>Wn,ZodNull:()=>qo,ZodNullable:()=>ui,ZodNumber:()=>$o,ZodObject:()=>Wt,ZodOptional:()=>Mn,ZodParsedType:()=>j,ZodPipeline:()=>cc,ZodPromise:()=>Wr,ZodReadonly:()=>ea,ZodRecord:()=>wf,ZodSchema:()=>ae,ZodSet:()=>ws,ZodString:()=>Gr,ZodSymbol:()=>_s,ZodTransformer:()=>Dn,ZodTuple:()=>ci,ZodType:()=>ae,ZodUndefined:()=>Po,ZodUnion:()=>Zo,ZodUnknown:()=>Yi,ZodVoid:()=>Ss,addIssueToContext:()=>F,any:()=>iL,array:()=>sL,bigint:()=>Q4,boolean:()=>VC,coerce:()=>ML,custom:()=>FC,date:()=>J4,datetimeRegex:()=>zC,defaultErrorMap:()=>Zi,discriminatedUnion:()=>dL,effect:()=>wL,enum:()=>_L,function:()=>vL,getErrorMap:()=>vs,getParsedType:()=>li,instanceof:()=>X4,intersection:()=>fL,isAborted:()=>_f,isAsync:()=>ys,isDirty:()=>Sf,isValid:()=>Zr,late:()=>W4,lazy:()=>yL,literal:()=>bL,makeIssue:()=>sc,map:()=>gL,nan:()=>K4,nativeEnum:()=>SL,never:()=>oL,null:()=>nL,nullable:()=>CL,number:()=>UC,object:()=>lL,objectUtil:()=>yv,oboolean:()=>OL,onumber:()=>RL,optional:()=>EL,ostring:()=>kL,pipeline:()=>TL,preprocess:()=>AL,promise:()=>xL,quotelessJson:()=>w4,record:()=>hL,set:()=>mL,setErrorMap:()=>C4,strictObject:()=>cL,string:()=>$C,symbol:()=>eL,transformer:()=>wL,tuple:()=>pL,undefined:()=>tL,union:()=>uL,unknown:()=>rL,util:()=>ue,void:()=>aL});var ue;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{let o={};for(let a of r)o[a]=a;return o},t.getValidEnumValues=r=>{let o=t.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),a={};for(let s of o)a[s]=r[s];return t.objectValues(a)},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 a in r)Object.prototype.hasOwnProperty.call(r,a)&&o.push(a);return o},t.find=(r,o)=>{for(let a of r)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=i,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(ue||(ue={}));var yv;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(yv||(yv={}));var j=ue.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),li=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 L=ue.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"]),w4=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Yt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},i={_errors:[]},r=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let s=i,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return r(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ue.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Yt.create=t=>new Yt(t);var E4=(t,e)=>{let n;switch(t.code){case L.invalid_type:t.received===j.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case L.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ue.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:n=`Unrecognized key(s) in object: ${ue.joinValues(t.keys,", ")}`;break;case L.invalid_union:n="Invalid input";break;case L.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ue.joinValues(t.options)}`;break;case L.invalid_enum_value:n=`Invalid enum value. Expected ${ue.joinValues(t.options)}, received '${t.received}'`;break;case L.invalid_arguments:n="Invalid function arguments";break;case L.invalid_return_type:n="Invalid function return type";break;case L.invalid_date:n="Invalid date";break;case L.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ue.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case L.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case L.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case L.custom:n="Invalid input";break;case L.invalid_intersection_types:n="Intersection results could not be merged";break;case L.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case L.not_finite:n="Number must be finite";break;default:n=e.defaultError,ue.assertNever(t)}return{message:n}},Zi=E4;var NC=Zi;function C4(t){NC=t}function vs(){return NC}var sc=t=>{let{data:e,path:n,errorMaps:i,issueData:r}=t,o=[...n,...r.path||[]],a={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let s="",l=i.filter(c=>!!c).slice().reverse();for(let c of l)s=c(a,{data:e,defaultError:s}).message;return{...r,path:o,message:s}},A4=[];function F(t,e){let n=vs(),i=sc({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Zi?void 0:Zi].filter(r=>!!r)});t.common.issues.push(i)}var wt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let i=[];for(let r of n){if(r.status==="aborted")return W;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){let i=[];for(let r of n){let o=await r.key,a=await r.value;i.push({key:o,value:a})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,n){let i={};for(let r of n){let{key:o,value:a}=r;if(o.status==="aborted"||a.status==="aborted")return W;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[o.value]=a.value)}return{status:e.value,value:i}}},W=Object.freeze({status:"aborted"}),Fo=t=>({status:"dirty",value:t}),Ot=t=>({status:"valid",value:t}),_f=t=>t.status==="aborted",Sf=t=>t.status==="dirty",Zr=t=>t.status==="valid",ys=t=>typeof Promise<"u"&&t instanceof Promise;var Z;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Z||(Z={}));var Nn=class{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},DC=(t,e)=>{if(Zr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Yt(t.common.issues);return this._error=n,this._error}}};function oe(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(a,s)=>{let{message:l}=t;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??i??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:r}}var ae=class{get description(){return this._def.description}_getType(e){return li(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:li(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wt,ctx:{common:e.parent.common,data:e.data,parsedType:li(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(ys(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:li(e)},r=this._parseSync({data:e,path:i.path,parent:i});return DC(i,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:li(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:n});return Zr(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Zr(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){let i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:li(e)},r=this._parse({data:e,path:i.path,parent:i}),o=await(ys(r)?r:Promise.resolve(r));return DC(i,o)}refine(e,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let a=e(r),s=()=>o.addIssue({code:L.custom,...i(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new Dn({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Mn.create(this,this._def)}nullable(){return ui.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Wi.create(this)}promise(){return Wr.create(this,this._def)}or(e){return Zo.create([this,e],this._def)}and(e){return Go.create(this,e,this._def)}transform(e){return new Dn({...oe(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Qo({...oe(this._def),innerType:this,defaultValue:n,typeName:K.ZodDefault})}brand(){return new lc({typeName:K.ZodBranded,type:this,...oe(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Jo({...oe(this._def),innerType:this,catchValue:n,typeName:K.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return cc.create(this,e)}readonly(){return ea.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},T4=/^c[^\s-]{8,}$/i,k4=/^[0-9a-z]+$/,R4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,O4=/^[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,M4=/^[a-z0-9_-]{21}$/i,N4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,D4=/^[-+]?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)?)??$/,L4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,I4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",bv,H4=/^(?:(?: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])$/,z4=/^(?:(?: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])$/,B4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,F4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,U4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,IC="((\\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])))",V4=new RegExp(`^${IC}$`);function HC(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function j4(t){return new RegExp(`^${HC(t)}$`)}function zC(t){let e=`${IC}T${HC(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function P4(t,e){return!!((e==="v4"||!e)&&H4.test(t)||(e==="v6"||!e)&&B4.test(t))}function q4(t,e){if(!N4.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function Z4(t,e){return!!((e==="v4"||!e)&&z4.test(t)||(e==="v6"||!e)&&F4.test(t))}var Gr=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==j.string){let o=this._getOrReturnCtx(e);return F(o,{code:L.invalid_type,expected:j.string,received:o.parsedType}),W}let i=new wt,r;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),F(r,{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),F(r,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,s=e.data.length<o.value;(a||s)&&(r=this._getOrReturnCtx(e,r),a?F(r,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&F(r,{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")L4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"email",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")bv||(bv=new RegExp(I4,"u")),bv.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"emoji",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")O4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"uuid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")M4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"nanoid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")T4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"cuid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")k4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"cuid2",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")R4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"ulid",code:L.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),F(r,{validation:"url",code:L.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"regex",code:L.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),F(r,{code:L.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.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),F(r,{code:L.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),F(r,{code:L.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?zC(o).test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{code:L.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?V4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{code:L.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?j4(o).test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{code:L.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?D4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"duration",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?P4(e.data,o.version)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"ip",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?q4(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"jwt",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?Z4(e.data,o.version)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"cidr",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?$4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"base64",code:L.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?U4.test(e.data)||(r=this._getOrReturnCtx(e,r),F(r,{validation:"base64url",code:L.invalid_string,message:o.message}),i.dirty()):ue.assertNever(o);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:L.invalid_string,...Z.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Z.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Z.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Z.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Z.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Z.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Z.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Z.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Z.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Z.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Z.errToObj(n)})}nonempty(e){return this.min(1,Z.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Gr.create=t=>new Gr({checks:[],typeName:K.ZodString,coerce:t?.coerce??!1,...oe(t)});function G4(t,e){let n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(t.toFixed(r).replace(".","")),a=Number.parseInt(e.toFixed(r).replace(".",""));return o%a/10**r}var $o=class t extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==j.number){let o=this._getOrReturnCtx(e);return F(o,{code:L.invalid_type,expected:j.number,received:o.parsedType}),W}let i,r=new wt;for(let o of this._def.checks)o.kind==="int"?ue.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{code:L.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),F(i,{code:L.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)&&(i=this._getOrReturnCtx(e,i),F(i,{code:L.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?G4(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),F(i,{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),F(i,{code:L.not_finite,message:o.message}),r.dirty()):ue.assertNever(o);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Z.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:Z.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ue.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}};$o.create=t=>new $o({checks:[],typeName:K.ZodNumber,coerce:t?.coerce||!1,...oe(t)});var Uo=class t extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==j.bigint)return this._getInvalidInput(e);let i,r=new wt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),F(i,{code:L.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)&&(i=this._getOrReturnCtx(e,i),F(i,{code:L.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),F(i,{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):ue.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return F(n,{code:L.invalid_type,expected:j.bigint,received:n.parsedType}),W}gte(e,n){return this.setLimit("min",e,!0,Z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Z.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:Z.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:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Uo.create=t=>new Uo({checks:[],typeName:K.ZodBigInt,coerce:t?.coerce??!1,...oe(t)});var Vo=class extends ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==j.boolean){let i=this._getOrReturnCtx(e);return F(i,{code:L.invalid_type,expected:j.boolean,received:i.parsedType}),W}return Ot(e.data)}};Vo.create=t=>new Vo({typeName:K.ZodBoolean,coerce:t?.coerce||!1,...oe(t)});var jo=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==j.date){let o=this._getOrReturnCtx(e);return F(o,{code:L.invalid_type,expected:j.date,received:o.parsedType}),W}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return F(o,{code:L.invalid_date}),W}let i=new wt,r;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),F(r,{code:L.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),F(r,{code:L.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):ue.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Z.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Z.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};jo.create=t=>new jo({checks:[],coerce:t?.coerce||!1,typeName:K.ZodDate,...oe(t)});var _s=class extends ae{_parse(e){if(this._getType(e)!==j.symbol){let i=this._getOrReturnCtx(e);return F(i,{code:L.invalid_type,expected:j.symbol,received:i.parsedType}),W}return Ot(e.data)}};_s.create=t=>new _s({typeName:K.ZodSymbol,...oe(t)});var Po=class extends ae{_parse(e){if(this._getType(e)!==j.undefined){let i=this._getOrReturnCtx(e);return F(i,{code:L.invalid_type,expected:j.undefined,received:i.parsedType}),W}return Ot(e.data)}};Po.create=t=>new Po({typeName:K.ZodUndefined,...oe(t)});var qo=class extends ae{_parse(e){if(this._getType(e)!==j.null){let i=this._getOrReturnCtx(e);return F(i,{code:L.invalid_type,expected:j.null,received:i.parsedType}),W}return Ot(e.data)}};qo.create=t=>new qo({typeName:K.ZodNull,...oe(t)});var Yr=class extends ae{constructor(){super(...arguments),this._any=!0}_parse(e){return Ot(e.data)}};Yr.create=t=>new Yr({typeName:K.ZodAny,...oe(t)});var Yi=class extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ot(e.data)}};Yi.create=t=>new Yi({typeName:K.ZodUnknown,...oe(t)});var Wn=class extends ae{_parse(e){let n=this._getOrReturnCtx(e);return F(n,{code:L.invalid_type,expected:j.never,received:n.parsedType}),W}};Wn.create=t=>new Wn({typeName:K.ZodNever,...oe(t)});var Ss=class extends ae{_parse(e){if(this._getType(e)!==j.undefined){let i=this._getOrReturnCtx(e);return F(i,{code:L.invalid_type,expected:j.void,received:i.parsedType}),W}return Ot(e.data)}};Ss.create=t=>new Ss({typeName:K.ZodVoid,...oe(t)});var Wi=class t extends ae{_parse(e){let{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==j.array)return F(n,{code:L.invalid_type,expected:j.array,received:n.parsedType}),W;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,s=n.data.length<r.exactLength.value;(a||s)&&(F(n,{code:a?L.too_big:L.too_small,minimum:s?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(F(n,{code:L.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(F(n,{code:L.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>r.type._parseAsync(new Nn(n,a,n.path,s)))).then(a=>wt.mergeArray(i,a));let o=[...n.data].map((a,s)=>r.type._parseSync(new Nn(n,a,n.path,s)));return wt.mergeArray(i,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:Z.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:Z.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:Z.toString(n)}})}nonempty(e){return this.min(1,e)}};Wi.create=(t,e)=>new Wi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...oe(e)});function bs(t){if(t instanceof Wt){let e={};for(let n in t.shape){let i=t.shape[n];e[n]=Mn.create(bs(i))}return new Wt({...t._def,shape:()=>e})}else return t instanceof Wi?new Wi({...t._def,type:bs(t.element)}):t instanceof Mn?Mn.create(bs(t.unwrap())):t instanceof ui?ui.create(bs(t.unwrap())):t instanceof ci?ci.create(t.items.map(e=>bs(e))):t}var Wt=class t extends ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ue.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==j.object){let c=this._getOrReturnCtx(e);return F(c,{code:L.invalid_type,expected:j.object,received:c.parsedType}),W}let{status:i,ctx:r}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Wn&&this._def.unknownKeys==="strip"))for(let c in r.data)a.includes(c)||s.push(c);let l=[];for(let c of a){let u=o[c],d=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Nn(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Wn){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")s.length>0&&(F(r,{code:L.unrecognized_keys,keys:s}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of s){let d=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Nn(r,d,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let d=await u.key,h=await u.value;c.push({key:d,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>wt.mergeObjectSync(i,c)):wt.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return Z.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:Z.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let i of ue.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let i of ue.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}deepPartial(){return bs(this)}partial(e){let n={};for(let i of ue.objectKeys(this.shape)){let r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let i of ue.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Mn;)o=o._def.innerType;n[i]=o}return new t({...this._def,shape:()=>n})}keyof(){return BC(ue.objectKeys(this.shape))}};Wt.create=(t,e)=>new Wt({shape:()=>t,unknownKeys:"strip",catchall:Wn.create(),typeName:K.ZodObject,...oe(e)});Wt.strictCreate=(t,e)=>new Wt({shape:()=>t,unknownKeys:"strict",catchall:Wn.create(),typeName:K.ZodObject,...oe(e)});Wt.lazycreate=(t,e)=>new Wt({shape:t,unknownKeys:"strip",catchall:Wn.create(),typeName:K.ZodObject,...oe(e)});var Zo=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=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 n.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new Yt(s.ctx.common.issues));return F(n,{code:L.invalid_union,unionErrors:a}),W}if(n.common.async)return Promise.all(i.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let o,a=[];for(let l of i){let c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(l=>new Yt(l));return F(n,{code:L.invalid_union,unionErrors:s}),W}}get options(){return this._def.options}};Zo.create=(t,e)=>new Zo({options:t,typeName:K.ZodUnion,...oe(e)});var Gi=t=>t instanceof Yo?Gi(t.schema):t instanceof Dn?Gi(t.innerType()):t instanceof Wo?[t.value]:t instanceof Xo?t.options:t instanceof Ko?ue.objectValues(t.enum):t instanceof Qo?Gi(t._def.innerType):t instanceof Po?[void 0]:t instanceof qo?[null]:t instanceof Mn?[void 0,...Gi(t.unwrap())]:t instanceof ui?[null,...Gi(t.unwrap())]:t instanceof lc||t instanceof ea?Gi(t.unwrap()):t instanceof Jo?Gi(t._def.innerType):[],xf=class t extends ae{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==j.object)return F(n,{code:L.invalid_type,expected:j.object,received:n.parsedType}),W;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(F(n,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),W)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){let r=new Map;for(let o of n){let a=Gi(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(r.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);r.set(s,o)}}return new t({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...oe(i)})}};function _v(t,e){let n=li(t),i=li(e);if(t===e)return{valid:!0,data:t};if(n===j.object&&i===j.object){let r=ue.objectKeys(e),o=ue.objectKeys(t).filter(s=>r.indexOf(s)!==-1),a={...t,...e};for(let s of o){let l=_v(t[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===j.array&&i===j.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let o=0;o<t.length;o++){let a=t[o],s=e[o],l=_v(a,s);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return n===j.date&&i===j.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Go=class extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=(o,a)=>{if(_f(o)||_f(a))return W;let s=_v(o.value,a.value);return s.valid?((Sf(o)||Sf(a))&&n.dirty(),{status:n.value,value:s.data}):(F(i,{code:L.invalid_intersection_types}),W)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>r(o,a)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Go.create=(t,e,n)=>new Go({left:t,right:e,typeName:K.ZodIntersection,...oe(n)});var ci=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.array)return F(i,{code:L.invalid_type,expected:j.array,received:i.parsedType}),W;if(i.data.length<this._def.items.length)return F(i,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),W;!this._def.rest&&i.data.length>this._def.items.length&&(F(i,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Nn(i,a,i.path,s)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>wt.mergeArray(n,a)):wt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};ci.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ci({items:t,typeName:K.ZodTuple,rest:null,...oe(e)})};var wf=class t extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.object)return F(i,{code:L.invalid_type,expected:j.object,received:i.parsedType}),W;let r=[],o=this._def.keyType,a=this._def.valueType;for(let s in i.data)r.push({key:o._parse(new Nn(i,s,i.path,s)),value:a._parse(new Nn(i,i.data[s],i.path,s)),alwaysSet:s in i.data});return i.common.async?wt.mergeObjectAsync(n,r):wt.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof ae?new t({keyType:e,valueType:n,typeName:K.ZodRecord,...oe(i)}):new t({keyType:Gr.create(),valueType:e,typeName:K.ZodRecord,...oe(n)})}},xs=class extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.map)return F(i,{code:L.invalid_type,expected:j.map,received:i.parsedType}),W;let r=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([s,l],c)=>({key:r._parse(new Nn(i,s,i.path,[c,"key"])),value:o._parse(new Nn(i,l,i.path,[c,"value"]))}));if(i.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return W;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of a){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return W;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}}}};xs.create=(t,e,n)=>new xs({valueType:e,keyType:t,typeName:K.ZodMap,...oe(n)});var ws=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==j.set)return F(i,{code:L.invalid_type,expected:j.set,received:i.parsedType}),W;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(F(i,{code:L.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(F(i,{code:L.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function a(l){let c=new Set;for(let u of l){if(u.status==="aborted")return W;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}let s=[...i.data.values()].map((l,c)=>o._parse(new Nn(i,l,i.path,c)));return i.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,n){return new t({...this._def,minSize:{value:e,message:Z.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:Z.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};ws.create=(t,e)=>new ws({valueType:t,minSize:null,maxSize:null,typeName:K.ZodSet,...oe(e)});var Ef=class t extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==j.function)return F(n,{code:L.invalid_type,expected:j.function,received:n.parsedType}),W;function i(s,l){return sc({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,vs(),Zi].filter(c=>!!c),issueData:{code:L.invalid_arguments,argumentsError:l}})}function r(s,l){return sc({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,vs(),Zi].filter(c=>!!c),issueData:{code:L.invalid_return_type,returnTypeError:l}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Wr){let s=this;return Ot(async function(...l){let c=new Yt([]),u=await s._def.args.parseAsync(l,o).catch(m=>{throw c.addIssue(i(l,m)),c}),d=await Reflect.apply(a,this,u);return await s._def.returns._def.type.parseAsync(d,o).catch(m=>{throw c.addIssue(r(d,m)),c})})}else{let s=this;return Ot(function(...l){let c=s._def.args.safeParse(l,o);if(!c.success)throw new Yt([i(l,c.error)]);let u=Reflect.apply(a,this,c.data),d=s._def.returns.safeParse(u,o);if(!d.success)throw new Yt([r(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:ci.create(e).rest(Yi.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new t({args:e||ci.create([]).rest(Yi.create()),returns:n||Yi.create(),typeName:K.ZodFunction,...oe(i)})}},Yo=class extends ae{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Yo.create=(t,e)=>new Yo({getter:t,typeName:K.ZodLazy,...oe(e)});var Wo=class extends ae{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return F(n,{received:n.data,code:L.invalid_literal,expected:this._def.value}),W}return{status:"valid",value:e.data}}get value(){return this._def.value}};Wo.create=(t,e)=>new Wo({value:t,typeName:K.ZodLiteral,...oe(e)});function BC(t,e){return new Xo({values:t,typeName:K.ZodEnum,...oe(e)})}var Xo=class t extends ae{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),i=this._def.values;return F(n,{expected:ue.joinValues(i),received:n.parsedType,code:L.invalid_type}),W}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),i=this._def.values;return F(n,{received:n.data,code:L.invalid_enum_value,options:i}),W}return Ot(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}};Xo.create=BC;var Ko=class extends ae{_parse(e){let n=ue.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==j.string&&i.parsedType!==j.number){let r=ue.objectValues(n);return F(i,{expected:ue.joinValues(r),received:i.parsedType,code:L.invalid_type}),W}if(this._cache||(this._cache=new Set(ue.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=ue.objectValues(n);return F(i,{received:i.data,code:L.invalid_enum_value,options:r}),W}return Ot(e.data)}get enum(){return this._def.values}};Ko.create=(t,e)=>new Ko({values:t,typeName:K.ZodNativeEnum,...oe(e)});var Wr=class extends ae{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==j.promise&&n.common.async===!1)return F(n,{code:L.invalid_type,expected:j.promise,received:n.parsedType}),W;let i=n.parsedType===j.promise?n.data:Promise.resolve(n.data);return Ot(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Wr.create=(t,e)=>new Wr({type:t,typeName:K.ZodPromise,...oe(e)});var Dn=class extends ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:a=>{F(i,a),a.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let a=r.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return W;let l=await this._def.schema._parseAsync({data:s,path:i.path,parent:i});return l.status==="aborted"?W:l.status==="dirty"?Fo(l.value):n.value==="dirty"?Fo(l.value):l});{if(n.value==="aborted")return W;let s=this._def.schema._parseSync({data:a,path:i.path,parent:i});return s.status==="aborted"?W:s.status==="dirty"?Fo(s.value):n.value==="dirty"?Fo(s.value):s}}if(r.type==="refinement"){let a=s=>{let l=r.refinement(s,o);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?W:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>s.status==="aborted"?W:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Zr(a))return W;let s=r.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Zr(a)?Promise.resolve(r.transform(a.value,o)).then(s=>({status:n.value,value:s})):W);ue.assertNever(r)}};Dn.create=(t,e,n)=>new Dn({schema:t,typeName:K.ZodEffects,effect:e,...oe(n)});Dn.createWithPreprocess=(t,e,n)=>new Dn({schema:e,effect:{type:"preprocess",transform:t},typeName:K.ZodEffects,...oe(n)});var Mn=class extends ae{_parse(e){return this._getType(e)===j.undefined?Ot(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mn.create=(t,e)=>new Mn({innerType:t,typeName:K.ZodOptional,...oe(e)});var ui=class extends ae{_parse(e){return this._getType(e)===j.null?Ot(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ui.create=(t,e)=>new ui({innerType:t,typeName:K.ZodNullable,...oe(e)});var Qo=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return n.parsedType===j.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Qo.create=(t,e)=>new Qo({innerType:t,typeName:K.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...oe(e)});var Jo=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return ys(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Yt(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Yt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Jo.create=(t,e)=>new Jo({innerType:t,typeName:K.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...oe(e)});var Es=class extends ae{_parse(e){if(this._getType(e)!==j.nan){let i=this._getOrReturnCtx(e);return F(i,{code:L.invalid_type,expected:j.nan,received:i.parsedType}),W}return{status:"valid",value:e.data}}};Es.create=t=>new Es({typeName:K.ZodNaN,...oe(t)});var Y4=Symbol("zod_brand"),lc=class extends ae{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},cc=class t extends ae{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?W:o.status==="dirty"?(n.dirty(),Fo(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?W:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new t({in:e,out:n,typeName:K.ZodPipeline})}},ea=class extends ae{_parse(e){let n=this._def.innerType._parse(e),i=r=>(Zr(r)&&(r.value=Object.freeze(r.value)),r);return ys(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};ea.create=(t,e)=>new ea({innerType:t,typeName:K.ZodReadonly,...oe(e)});function LC(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function FC(t,e={},n){return t?Yr.create().superRefine((i,r)=>{let o=t(i);if(o instanceof Promise)return o.then(a=>{if(!a){let s=LC(e,i),l=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:l})}});if(!o){let a=LC(e,i),s=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:s})}}):Yr.create()}var W4={object:Wt.lazycreate},K;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(K||(K={}));var X4=(t,e={message:`Input not instance of ${t.name}`})=>FC(n=>n instanceof t,e),$C=Gr.create,UC=$o.create,K4=Es.create,Q4=Uo.create,VC=Vo.create,J4=jo.create,eL=_s.create,tL=Po.create,nL=qo.create,iL=Yr.create,rL=Yi.create,oL=Wn.create,aL=Ss.create,sL=Wi.create,lL=Wt.create,cL=Wt.strictCreate,uL=Zo.create,dL=xf.create,fL=Go.create,pL=ci.create,hL=wf.create,gL=xs.create,mL=ws.create,vL=Ef.create,yL=Yo.create,bL=Wo.create,_L=Xo.create,SL=Ko.create,xL=Wr.create,wL=Dn.create,EL=Mn.create,CL=ui.create,AL=Dn.createWithPreprocess,TL=cc.create,kL=()=>$C().optional(),RL=()=>UC().optional(),OL=()=>VC().optional(),ML={string:(t=>Gr.create({...t,coerce:!0})),number:(t=>$o.create({...t,coerce:!0})),boolean:(t=>Vo.create({...t,coerce:!0})),bigint:(t=>Uo.create({...t,coerce:!0})),date:(t=>jo.create({...t,coerce:!0}))};var NL=W;var jC=g.union([g.object({type:g.literal("data"),key:g.string(),value:g.string().optional()}),g.object({type:g.literal("css"),value:g.string()}),g.object({type:g.literal("aria"),role:g.string().optional(),label:g.string().optional()}),g.object({type:g.literal("shadow-css"),value:g.string()}),g.object({type:g.literal("ref"),el:g.any()})]),DL=g.object({kind:g.literal("tooltip"),id:g.string(),anchor:jC,content:g.object({title:g.string().optional(),body:g.string()}),placement:g.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:g.number().optional(),blocking:g.boolean().optional(),trigger:g.enum(["immediate","hover","click"]).optional(),dismiss:g.object({onEsc:g.boolean().optional(),closeButton:g.boolean().optional(),timeoutMs:g.number().optional()}).optional()}),LL=g.object({kind:g.literal("highlight"),id:g.string(),anchor:jC,copy:g.string().optional(),ring:g.object({paddingPx:g.number().optional(),radiusPx:g.number().optional()}).optional(),scrim:g.object({opacity:g.number().optional()}).optional(),ringColor:g.string().optional(),blocking:g.boolean().optional(),dismiss:g.object({onClickOutside:g.boolean().optional(),onEsc:g.boolean().optional(),timeoutMs:g.number().optional()}).optional()}),Sv=g.object({id:g.string(),version:g.number(),routes:g.array(g.string()).optional(),steps:g.array(g.union([DL,LL]))});function vF(t){return Sv.parse(t)}var SF=({configUri:t,experiments:e,featureKey:n="smart-canvas-overlay-uri",credentials:i="include"}={})=>async()=>{let r=Rm({configUri:t,experiments:e,featureKey:n});if(!r)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(r,{credentials:i});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let a=await o.json();return Sv.parse(a)};var Cf=X(Qe(),1),PC=X($s(),1);function wF({element:t,children:e}){let[n,i]=(0,Cf.useState)(null);return(0,Cf.useLayoutEffect)(()=>{if(!t){i(null);return}return i(t.getMountNode()),()=>i(null)},[t]),n?(0,PC.createPortal)(e,n):null}function IL(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let n=0;n<16;n++)e+=t[Math.floor(Math.random()*t.length)];return e}var xv=class{constructor(){P(this,"sessionId");this.sessionId=IL(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,n){}trackAction(e,n,i){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,n,i){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}track(e,n){}};function wv(){return new xv}var O=typeof window<"u"?window:void 0,Ct=typeof globalThis<"u"?globalThis:O;typeof self>"u"&&(Ct.self=Ct),typeof File>"u"&&(Ct.File=function(){});var $A=Array.prototype,qC=$A.forEach,ZC=$A.indexOf,hn=Ct?.navigator,U=Ct?.document,Kt=Ct?.location,Fv=Ct?.fetch,$v=Ct!=null&&Ct.XMLHttpRequest&&"withCredentials"in new Ct.XMLHttpRequest?Ct.XMLHttpRequest:void 0,GC=Ct?.AbortController,Xt=hn?.userAgent,ee=O??{},Ki={DEBUG:!1,LIB_VERSION:"1.302.2"};function YC(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(i,r)}function WC(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(l){YC(o,i,r,a,s,"next",l)}function s(l){YC(o,i,r,a,s,"throw",l)}a(void 0)}))}}function q(){return q=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},q.apply(null,arguments)}function UA(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}var HL=["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"],XC=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return HL.concat(e).some((i=>{var r=i.toLowerCase();return n.indexOf(r)!==-1}))},zL=["$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 de(t,e){return t.indexOf(e)!==-1}var ip=function(t){return t.trim()},Uv=function(t){return t.replace(/^\$/,"")},BL=Array.isArray,VA=Object.prototype,jA=VA.hasOwnProperty,rp=VA.toString,Re=BL||function(t){return rp.call(t)==="[object Array]"},to=t=>typeof t=="function",pt=t=>t===Object(t)&&!Re(t),ks=t=>{if(pt(t)){for(var e in t)if(jA.call(t,e))return!1;return!0}return!1},$=t=>t===void 0,lt=t=>rp.call(t)=="[object String]",Vv=t=>lt(t)&&t.trim().length===0,tr=t=>t===null,Ce=t=>$(t)||tr(t),hi=t=>rp.call(t)=="[object Number]",no=t=>rp.call(t)==="[object Boolean]",FL=t=>t instanceof FormData,$L=t=>de(zL,t);function jv(t){return t===null||typeof t!="object"}function Hf(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function PA(t){return!$(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var UL=[!0,"true",1,"1","yes"],Ev=t=>de(UL,t),VL=[!1,"false",0,"0","no"];function di(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),hi(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),di(r||n,e,n,i))}var Pv=class{constructor(e){this.t={},this.i=e.i,this.o=di(e.bucketSize,0,100,e.h),this.m=di(e.refillRate,0,this.o,e.h),this.S=di(e.refillInterval,0,864e5,e.h)}$(e,n){var i=n-e.lastAccess,r=Math.floor(i/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 n,i=Date.now(),r=String(e),o=this.t[r];return o?this.$(o,i):(o={tokens:this.o,lastAccess:i},this.t[r]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((n=this.i)==null||n.call(this,e)),o.tokens===0)}stop(){this.t={}}},Af,KC,Cv,jL=t=>t instanceof Error;function PL(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return Cv&&n.length===KC||(KC=n.length,Cv=n.reduce(((i,r)=>{Af||(Af={});var o=Af[r];if(o)i[o[0]]=o[1];else for(var a=t(r),s=a.length-1;s>=0;s--){var l=a[s],c=l?.filename,u=e[r];if(c&&u){i[c]=u,Af[r]=[c,u];break}}return i}),{})),Cv}}var qv=class{constructor(e,n,i){i===void 0&&(i=[]),this.coercers=e,this.stackParser=n,this.modifiers=i}buildFromUnknown(e,n){n===void 0&&(n={});var i=n&&n.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,n,0).apply(e),o=this.buildParsingContext(),a=this.parseStacktrace(r,o);return{$exception_list:this.convertToExceptionList(a,i),$exception_level:"error"}}modifyFrames(e){var n=this;return WC((function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&Re(i.stacktrace.frames)&&(i.stacktrace.frames=yield n.applyModifiers(i.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var i,r;return e.cause!=null&&(i=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),n.chunkIdMap)),q({},e,{cause:i,stack:r})}applyChunkIds(e,n){return e.map((i=>(i.filename&&n&&(i.chunk_id=n[i.filename]),i)))}applyCoercers(e,n){for(var i of this.coercers)if(i.match(e))return i.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return WC((function*(){var i=e;for(var r of n.modifiers)i=yield r(i);return i}))()}convertToExceptionList(e,n){var i,r,o,a={type:e.type,value:e.value,mechanism:{type:(i=n.type)!==null&&i!==void 0?i:"generic",handled:(r=n.handled)===null||r===void 0||r,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var s=[a];return e.cause!=null&&s.push(...this.convertToExceptionList(e.cause,q({},n,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:PL(this.stackParser)}}buildCoercingContext(e,n,i){i===void 0&&(i=0);var r=(o,a)=>{if(a<=4){var s=this.buildCoercingContext(e,n,a);return this.applyCoercers(o,s)}};return q({},n,{syntheticException:i==0?n.syntheticException:void 0,mechanism:e,apply:o=>r(o,i),next:o=>r(o,i+1)})}},Ns="?";function Zv(t,e,n,i,r){var o={platform:t,filename:e,function:n==="<anonymous>"?Ns:n,in_app:!0};return $(i)||(o.lineno=i),$(r)||(o.colno=r),o}var qA=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,i=t.indexOf("safari-web-extension")!==-1;return n||i?[t.indexOf("@")!==-1?t.split("@")[0]:Ns,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},qL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ZL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,GL=/\((\S*)(?::(\d+))(?::(\d+))\)/,YL=(t,e)=>{var n=qL.exec(t);if(n){var[,i,r,o]=n;return Zv(e,i,Ns,+r,+o)}var a=ZL.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var s=GL.exec(a[2]);s&&(a[2]=s[1],a[3]=s[2],a[4]=s[3])}var[l,c]=qA(a[1]||Ns,a[2]);return Zv(e,c,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},WL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,XL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,KL=(t,e)=>{var n=WL.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var i=XL.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}var r=n[3],o=n[1]||Ns;return[o,r]=qA(o,r),Zv(e,r,o,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},QC=/\(error: (.*)\)/,JC=50;function QL(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return function(r,o){o===void 0&&(o=0);for(var a=[],s=r.split(`
|
|
441
|
-
`),l=o;l<s.length;l++){var c=s[l];if(!(c.length>1024)){var u=QC.test(c)?c.replace(QC,"$1"):c;if(!u.match(/\S*Error: /)){for(var d of n){var h=d(u,t);if(h){a.push(h);break}}if(a.length>=JC)break}}}return(function(m){if(!m.length)return[];var S=Array.from(m);return S.reverse(),S.slice(0,JC).map((_=>{return q({},_,{filename:_.filename||(b=S,b[b.length-1]||{}).filename,function:_.function||Ns});var b}))})(a)}}var Gv=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var i=lt(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return Hf(e,"DOMException")}isDOMError(e){return Hf(e,"DOMError")}},Yv=class{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var i=e.message;return i.error&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}},Wv=class{constructor(){}match(e){return Hf(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var i,r=n.apply(e.error);return r||{type:"ErrorEvent",value:e.message,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},JL=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Xv=class{match(e){return typeof e=="string"}coerce(e,n){var i,[r,o]=this.getInfos(e);return{type:r??"Error",value:o??e,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}getInfos(e){var n="Error",i=e,r=e.match(JL);return r&&(n=r[1],i=r[2]),[n,i]}},e3=["fatal","error","warning","log","info","debug"];function ZA(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var i=n.length;i>0;i--){var r=n.slice(0,i).join(", ");if(!(r.length>e))return i===n.length||r.length<=e?r:r.slice(0,e)+"..."}return""}var Kv=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var i,r=this.getErrorPropertyFromObject(e);return r?n.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(i=n.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return PA(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var i=this.getObjectClassName(e);return(i&&i!=="Object"?"'"+i+"'":"Object")+" captured as exception with keys: "+ZA(e)}isSeverityLevel(e){return lt(e)&&!Vv(e)&&e3.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=e[n];if(jL(i))return i}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},Qv=class{match(e){return PA(e)}coerce(e,n){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+ZA(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},Jv=class{match(e){return jv(e)}coerce(e,n){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},ey=class{match(e){return Hf(e,"PromiseRejectionEvent")}coerce(e,n){var i,r=this.getUnhandledRejectionReason(e);return jv(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}:n.apply(r)}getUnhandledRejectionReason(e){if(jv(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}},GA=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,i={k:function(r){if(O&&(Ki.DEBUG||ee.POSTHOG_DEBUG||n)&&!$(O.console)&&O.console){for(var o=("__rrweb_original__"in O.console[r])?O.console[r].__rrweb_original__:O.console[r],a=arguments.length,s=new Array(a>1?a-1:0),l=1;l<a;l++)s[l-1]=arguments[l];o(t,...s)}},info:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("log",...o)},warn:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("warn",...o)},error:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i.k("error",...o)},critical:function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];console.error(t,...o)},uninitializedWarning:r=>{i.error("You must initialize PostHog before calling "+r)},createLogger:(r,o)=>GA(t+" "+r,o)};return i},V=GA("[PostHog.js]"),ct=V.createLogger,t3=ct("[ExternalScriptsLoader]"),eA=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return t3.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var i=U?.querySelectorAll("script");if(i){for(var r,o=function(){if(i[a].src===e){var l=i[a];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",(c=>{l.__posthog_loading_callback_fired=!0,n(void 0,c)})),l.onerror=c=>n(c),{v:void 0})}},a=0;a<i.length;a++)if(r=o())return r.v}var s=()=>{if(!U)return n("document not found");var l=U.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,n(void 0,d)},l.onerror=d=>n(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");var c,u=U.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):U.body.appendChild(l)};U!=null&&U.body?s():U?.addEventListener("DOMContentLoaded",s)};ee.__PosthogExtensions__=ee.__PosthogExtensions__||{},ee.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var i="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(i="/array/"+t.config.token+"/config.js"),e==="toolbar"){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}var o=t.requestRouter.endpointFor("assets",i);eA(t,o,n)},ee.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var i=t.requestRouter.endpointFor("api",e);eA(t,i,n)};var zf={};function io(t,e,n){if(Re(t)){if(qC&&t.forEach===qC)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var i=0,r=t.length;i<r;i++)if(i in t&&e.call(n,t[i],i)===zf)return}}}function Me(t,e,n){if(!Ce(t)){if(Re(t))return io(t,e,n);if(FL(t)){for(var i of t.entries())if(e.call(n,i[1],i[0])===zf)return}else for(var r in t)if(jA.call(t,r)&&e.call(n,t[r],r)===zf)return}}var Xe=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return io(n,(function(r){for(var o in r)r[o]!==void 0&&(t[o]=r[o])})),t},Is=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return io(n,(function(r){io(r,(function(o){t.push(o)}))})),t};function Df(t){for(var e=Object.keys(t),n=e.length,i=new Array(n);n--;)i[n]=[e[n],t[e[n]]];return i}var tA=function(t){try{return t()}catch{return}},n3=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(this,n)}catch(r){V.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),V.critical(r)}}},Wy=function(t){var e={};return Me(t,(function(n,i){(lt(n)&&n.length>0||hi(n))&&(e[i]=n)})),e};function i3(t,e){return n=t,i=o=>lt(o)&&!tr(e)?o.slice(0,e):o,r=new Set,(function o(a,s){return a!==Object(a)?i?i(a,s):a:r.has(a)?void 0:(r.add(a),Re(a)?(l=[],io(a,(c=>{l.push(o(c))}))):(l={},Me(a,((c,u)=>{r.has(c)||(l[u]=o(c,u))}))),l);var l})(n);var n,i,r}var r3=["herokuapp.com","vercel.app","netlify.app"];function o3(t){var e=t?.hostname;if(!lt(e))return!1;var n=e.split(".").slice(-2).join(".");for(var i of r3)if(n===i)return!1;return!0}function YA(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function it(t,e,n,i){var{capture:r=!1,passive:o=!0}=i??{};t?.addEventListener(e,n,{capture:r,passive:o})}var WA="$people_distinct_id",bc="__alias",_c="__timers",nA="$autocapture_disabled_server_side",ty="$heatmaps_enabled_server_side",iA="$exception_capture_enabled_server_side",ny="$error_tracking_suppression_rules",rA="$error_tracking_capture_extension_exceptions",oA="$web_vitals_enabled_server_side",XA="$dead_clicks_enabled_server_side",aA="$web_vitals_allowed_metrics",Av="$session_recording_remote_config",Bf="$sesid",KA="$session_is_sampled",Rs="$enabled_feature_flags",Sc="$early_access_features",iy="$feature_flag_details",xc="$stored_person_properties",ia="$stored_group_properties",ry="$surveys",Tf="$surveys_activated",Ff="$flag_call_reported",Qi="$user_state",oy="$client_session_props",ay="$capture_rate_limit",sy="$initial_campaign_params",ly="$initial_referrer_info",$f="$initial_person_info",Uf="$epp",QA="__POSTHOG_TOOLBAR__",uc="$posthog_cookieless",a3=[WA,bc,"__cmpns",_c,"$session_recording_enabled_server_side",ty,Bf,Rs,ny,Qi,Sc,iy,ia,xc,ry,Ff,oy,ay,sy,ly,Uf,$f];function sA(t){return t instanceof Element&&(t.id===QA||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function op(t){return!!t&&t.nodeType===1}function ro(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function JA(t){return!!t&&t.nodeType===3}function eT(t){return!!t&&t.nodeType===11}function Xy(t){return t?ip(t).split(/\s+/):[]}function lA(t){var e=O?.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function Vf(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 Xy(e)}function tT(t){return Ce(t)?null:ip(t).split(/(\s+)/).filter((e=>Rc(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ic(t){var e="";return cy(t)&&!aT(t)&&t.childNodes&&t.childNodes.length&&Me(t.childNodes,(function(n){var i;JA(n)&&n.textContent&&(e+=(i=tT(n.textContent))!==null&&i!==void 0?i:"")})),ip(e)}function nT(t){return $(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Ky=["a","button","form","input","select","textarea","label"];function iT(t,e){if($(e))return!0;var n,i=function(o){if(e.some((a=>o.matches(a))))return{v:!0}};for(var r of t)if(n=i(r))return n.v;return!1}function rT(t){var e=t.parentNode;return!(!e||!op(e))&&e}var s3=["next","previous","prev",">","<"],cA=10,uA=[".ph-no-rageclick",".ph-no-capture"];function l3(t,e){if(!O||Qy(t))return!1;var n,i,r;if(no(e)?(n=!!e&&uA,i=void 0):(n=(r=e?.css_selector_ignorelist)!==null&&r!==void 0?r:uA,i=e?.content_ignorelist),n===!1)return!1;var{targetElementList:o}=oT(t,!1);return!(function(a,s){if(a===!1||$(a))return!1;var l;if(a===!0)l=s3;else{if(!Re(a))return!1;if(a.length>cA)return V.error("[PostHog] content_ignorelist array cannot exceed "+cA+" items. Use css_selector_ignorelist for more complex matching."),!1;l=a.map((c=>c.toLowerCase()))}return s.some((c=>{var{safeText:u,ariaLabel:d}=c;return l.some((h=>u.includes(h)||d.includes(h)))}))})(i,o.map((a=>{var s;return{safeText:Ic(a).toLowerCase(),ariaLabel:((s=a.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!iT(o,n)}var Qy=t=>!t||ro(t,"html")||!op(t),oT=(t,e)=>{if(!O||Qy(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,i=[t],r=t;r.parentNode&&!ro(r,"body");)if(eT(r.parentNode))i.push(r.parentNode.host),r=r.parentNode.host;else{var o=rT(r);if(!o)break;if(e||Ky.indexOf(o.tagName.toLowerCase())>-1)n=!0;else{var a=O.getComputedStyle(o);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}i.push(o),r=o}return{parentIsUsefulElement:n,targetElementList:i}};function c3(t,e,n,i,r){var o,a,s,l;if(n===void 0&&(n=void 0),!O||Qy(t)||(o=n)!=null&&o.url_allowlist&&!lA(n.url_allowlist)||(a=n)!=null&&a.url_ignorelist&&lA(n.url_ignorelist))return!1;if((s=n)!=null&&s.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some((S=>e.type===S)))return!1}var{parentIsUsefulElement:u,targetElementList:d}=oT(t,i);if(!(function(S,_){var b=_?.element_allowlist;if($(b))return!0;var f,p=function(y){if(b.some((w=>y.tagName.toLowerCase()===w)))return{v:!0}};for(var v of S)if(f=p(v))return f.v;return!1})(d,n)||!iT(d,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var h=O.getComputedStyle(t);if(h&&h.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 u?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Ky.indexOf(m)>-1||t.getAttribute("contenteditable")==="true")}}function cy(t){for(var e=t;e.parentNode&&!ro(e,"body");e=e.parentNode){var n=Vf(e);if(de(n,"ph-sensitive")||de(n,"ph-no-capture"))return!1}if(de(Vf(t),"ph-include"))return!0;var i=t.type||"";if(lt(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";return!(lt(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 aT(t){return!!(ro(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ro(t,"select")||ro(t,"textarea")||t.getAttribute("contenteditable")==="true")}var sT="(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})",u3=new RegExp("^(?:"+sT+")$"),d3=new RegExp(sT),lT="\\d{3}-?\\d{2}-?\\d{4}",f3=new RegExp("^("+lT+")$"),p3=new RegExp("("+lT+")");function Rc(t,e){return e===void 0&&(e=!0),!(Ce(t)||lt(t)&&(t=ip(t),(e?u3:d3).test((t||"").replace(/[- ]/g,""))||(e?f3:p3).test(t)))}function cT(t){var e=Ic(t);return Rc(e=(e+" "+uT(t)).trim())?e:""}function uT(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Me(t.childNodes,(function(n){var i;if(n&&((i=n.tagName)==null?void 0:i.toLowerCase())==="span")try{var r=Ic(n);e=(e+" "+r).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+uT(n)).trim())}catch(o){V.error("[AutoCapture]",o)}})),e}function h3(t){return(function(e){var n=e.map((i=>{var r,o,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class)for(var s of(i.attr_class.sort(),i.attr_class))a+="."+s.replace(/"/g,"");var l=q({},i.text?{text:i.text}:{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(o=i.nth_of_type)!==null&&o!==void 0?o:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),c={};return Df(l).sort(((u,d)=>{var[h]=u,[m]=d;return h.localeCompare(m)})).forEach((u=>{var[d,h]=u;return c[dA(d.toString())]=dA(h.toString())})),a+=":",a+=Df(c).map((u=>{var[d,h]=u;return d+'="'+h+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var i,r,o={text:(i=n.$el_text)==null?void 0:i.slice(0,400),tag_name:n.tag_name,href:(r=n.attr__href)==null?void 0:r.slice(0,2048),attr_class:g3(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Df(n).filter((a=>{var[s]=a;return s.indexOf("attr__")===0})).forEach((a=>{var[s,l]=a;return o.attributes[s]=l})),o}))})(t))}function dA(t){return t.replace(/"|\\"/g,'\\"')}function g3(t){var e=t.attr__class;return e?Re(e)?e:Xy(e):void 0}var jf=class{constructor(e){this.disabled=e===!1;var n=pt(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(n-r.y)<this.thresholdPx&&i-r.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:i}];return!1}},Tv="$copy_autocapture",er=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var Pf=t=>{var e=U?.createElement("a");return $(e)?null:(e.href=t,e)},m3=function(t,e){var n,i;e===void 0&&(e="&");var r=[];return Me(t,(function(o,a){$(o)||$(a)||a==="undefined"||(n=encodeURIComponent((s=>s instanceof File)(o)?o.name:o.toString()),i=encodeURIComponent(a),r[r.length]=i+"="+n)})),r.join(e)},qf=function(t,e){for(var n,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var o=i[r].split("=");if(o[0]===e){n=o;break}}if(!Re(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{V.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Hc=function(t,e,n){if(!t||!e||!e.length)return t;for(var i=t.split("#"),r=i[0]||"",o=i[1],a=r.split("?"),s=a[1],l=a[0],c=(s||"").split("&"),u=[],d=0;d<c.length;d++){var h=c[d].split("=");Re(h)&&(e.includes(h[0])?u.push(h[0]+"="+n):u.push(c[d]))}var m=l;return s!=null&&(m+="?"+u.join("&")),o!=null&&(m+="#"+o),m},Zf=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},fA=ct("[AutoCapture]");function kv(t,e){return e.length>t?e.slice(0,t)+"...":e}function v3(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!op(e));return e}function y3(t,e,n,i){var r=t.tagName.toLowerCase(),o={tag_name:r};Ky.indexOf(r)>-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?o.$el_text=kv(1024,cT(t)):o.$el_text=kv(1024,Ic(t)));var a=Vf(t);a.length>0&&(o.classes=a.filter((function(u){return u!==""}))),Me(t.attributes,(function(u){var d;if((!aT(t)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(i==null||!i.includes(u.name))&&!e&&Rc(u.value)&&(d=u.name,!lt(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var h=u.value;u.name==="class"&&(h=Xy(h).join(" ")),o["attr__"+u.name]=kv(1024,h)}}));for(var s=1,l=1,c=t;c=v3(c);)s++,c.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function b3(t,e){for(var n,i,{e:r,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,c=[t],u=t;u.parentNode&&!ro(u,"body");)eT(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,h=[],m={},S=!1,_=!1;if(Me(c,(y=>{var w=cy(y);y.tagName.toLowerCase()==="a"&&(S=y.getAttribute("href"),S=w&&S&&Rc(S)&&S),de(Vf(y),"ph-no-capture")&&(_=!0),h.push(y3(y,o,a,s));var A=(function(x){if(!cy(x))return{};var T={};return Me(x.attributes,(function(k){if(k.name&&k.name.indexOf("data-ph-capture-attribute")===0){var E=k.name.replace("data-ph-capture-attribute-",""),R=k.value;E&&R&&Rc(R)&&(T[E]=R)}})),T})(y);Xe(m,A)})),_)return{props:{},explicitNoCapture:_};if(a||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=cT(t):h[0].$el_text=Ic(t)),S){var b,f;h[0].attr__href=S;var p=(b=Pf(S))==null?void 0:b.host,v=O==null||(f=O.location)==null?void 0:f.host;p&&v&&p!==v&&(d=S)}return{props:Xe({$event_type:r.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:h3(h)},(n=h[0])!=null&&n.$el_text?{$el_text:(i=h[0])==null?void 0:i.$el_text}:{},d&&r.type==="click"?{$external_click_url:d}:{},m)}}var uy=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new jf(e.config.rageclick),this.I=null}get F(){var e,n,i=pt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),i.url_ignorelist=(n=i.url_ignorelist)==null?void 0:n.map((r=>new RegExp(r))),i}C(){if(this.isBrowserSupported()){if(O&&U){var e=i=>{i=i||O?.event;try{this.M(i)}catch(r){fA.error("Failed to capture event",r)}};if(it(U,"submit",e,{capture:!0}),it(U,"change",e,{capture:!0}),it(U,"click",e,{capture:!0}),this.F.capture_copied_text){var n=i=>{i=i||O?.event,this.M(i,Tv)};it(U,"copy",n,{capture:!0}),it(U,"cut",n,{capture:!0})}}}else fA.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({[nA]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var n,i=[];return(n=this.I)==null||n.forEach((r=>{var o=U?.querySelectorAll(r);o?.forEach((a=>{e===a&&i.push(r)}))})),i}get isEnabled(){var e,n,i=(e=this.instance.persistence)==null?void 0:e.props[nA],r=this.T;if(tr(r)&&!no(i)&&!this.instance.O())return!1;var o=(n=this.T)!==null&&n!==void 0?n:!!i;return!!this.instance.config.autocapture&&!o}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var i,r=nT(e);JA(r)&&(r=r.parentNode||null),n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&l3(r,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=n===Tv;if(r&&c3(r,e,this.F,o,o?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:s}=b3(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&&(a.$element_selectors=l),n===Tv){var c,u=tT(O==null||(c=O.getSelection())==null?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=d}return this.instance.capture(n,a),!0}}}isBrowserSupported(){return to(U?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return hi(t)&&isFinite(t)&&Math.floor(t)===t});var pA="0123456789abcdef",dy=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,i,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||n<0||i<0||r<0||e>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var 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|n>>>8,o[7]=n,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new t(o)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+pA.charAt(this.bytes[n]>>>4)+pA.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var i=this.bytes[n]-e.bytes[n];if(i!==0)return Math.sign(i)}return 0}},fy=class{constructor(){this.A=0,this.D=0,this.j=new py}generate(){var e=this.generateOrAbort();if($(e)){this.A=0;var n=this.generateOrAbort();if($(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return dy.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())}},hA,dT=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};O&&!$(O.crypto)&&crypto.getRandomValues&&(dT=t=>crypto.getRandomValues(t));var py=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(dT(this.N),this.U=0),this.N[this.U++]}},eo=()=>_3().toString(),_3=()=>(hA||(hA=new fy)).generate(),dc="",S3=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function x3(t,e){if(e){var n=(function(r,o){if(o===void 0&&(o=U),dc)return dc;if(!o||["localhost","127.0.0.1"].includes(r))return"";for(var a=r.split("."),s=Math.min(a.length,8),l="dmn_chk_"+eo();!dc&&s--;){var c=a.slice(s).join("."),u=l+"=1;domain=."+c+";path=/";o.cookie=u+";max-age=3",o.cookie.includes(l)&&(o.cookie=u+";max-age=0",dc=c)}return dc})(t);if(!n){var i=(r=>{var o=r.match(S3);return o?o[0]:""})(t);i!==n&&V.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}var pi={H:()=>!!U,B:function(t){V.error("cookieStore error: "+t)},q:function(t){if(U){try{for(var e=t+"=",n=U.cookie.split(";").filter((o=>o.length)),i=0;i<n.length;i++){for(var r=n[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(pi.q(t))||{}}catch{}return e},G:function(t,e,n,i,r){if(U)try{var o="",a="",s=x3(U.location.hostname,i);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}r&&(a="; secure");var c=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+a;return c.length>3686.4&&V.warn("cookieStore warning: large cookie, len="+c.length),U.cookie=c,c}catch{return}},V:function(t,e){if(U!=null&&U.cookie)try{pi.G(t,"",-1,e)}catch{return}}},Rv=null,qe={H:function(){if(!tr(Rv))return Rv;var t=!0;if($(O))t=!1;else try{var e="__mplssupport__";qe.G(e,"xyz"),qe.q(e)!=='"xyz"'&&(t=!1),qe.V(e)}catch{t=!1}return t||V.error("localStorage unsupported; falling back to cookie store"),Rv=t,t},B:function(t){V.error("localStorage error: "+t)},q:function(t){try{return O?.localStorage.getItem(t)}catch(e){qe.B(e)}return null},W:function(t){try{return JSON.parse(qe.q(t))||{}}catch{}return null},G:function(t,e){try{O?.localStorage.setItem(t,JSON.stringify(e))}catch(n){qe.B(n)}},V:function(t){try{O?.localStorage.removeItem(t)}catch(e){qe.B(e)}}},w3=["distinct_id",Bf,KA,Uf,$f],kf=q({},qe,{W:function(t){try{var e={};try{e=pi.W(t)||{}}catch{}var n=Xe(e,JSON.parse(qe.q(t)||"{}"));return qe.G(t,n),n}catch{}return null},G:function(t,e,n,i,r,o){try{qe.G(t,e,void 0,void 0,o);var a={};w3.forEach((s=>{e[s]&&(a[s]=e[s])})),Object.keys(a).length&&pi.G(t,a,n,i,r,o)}catch(s){qe.B(s)}},V:function(t,e){try{O?.localStorage.removeItem(t),pi.V(t,e)}catch(n){qe.B(n)}}}),Rf={},E3={H:function(){return!0},B:function(t){V.error("memoryStorage error: "+t)},q:function(t){return Rf[t]||null},W:function(t){return Rf[t]||null},G:function(t,e){Rf[t]=e},V:function(t){delete Rf[t]}},ta=null,Et={H:function(){if(!tr(ta))return ta;if(ta=!0,$(O))ta=!1;else try{var t="__support__";Et.G(t,"xyz"),Et.q(t)!=='"xyz"'&&(ta=!1),Et.V(t)}catch{ta=!1}return ta},B:function(t){V.error("sessionStorage error: ",t)},q:function(t){try{return O?.sessionStorage.getItem(t)}catch(e){Et.B(e)}return null},W:function(t){try{return JSON.parse(Et.q(t))||null}catch{}return null},G:function(t,e){try{O?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Et.B(n)}},V:function(t){try{O?.sessionStorage.removeItem(t)}catch(e){Et.B(e)}}},Ji=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),hy=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?Ji.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===Ji.DENIED||this.consent===Ji.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Ji.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:i}=this._instance.config;return i||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return Ev(e)?Ji.GRANTED:de(VL,e)?Ji.DENIED:Ji.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?qe:pi;var n=e==="localStorage"?pi:qe;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Ev(n.q(this.X))),n.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!YA([hn?.doNotTrack,hn?.msDoNotTrack,ee.doNotTrack],(e=>Ev(e)))}},Of=ct("[Dead Clicks]"),C3=()=>!0,A3=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(XA)),i=t.instance.config.capture_dead_clicks;return no(i)?i:!!pt(i)||n},Gf=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,i){this.instance=e,this.isEnabled=n,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[XA]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(r=>{r?Of.error("failed to load script",r):e()}))}et(){var e;if(U){if(!this.tt&&(e=ee.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=pt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=ee.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(U),Of.info("starting...")}}else Of.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Of.info("stopping..."))}},fc=ct("[ExceptionAutocapture]"),gy=class{constructor(e){var n,i,r;this.rt=()=>{var o;if(O&&this.isEnabled&&(o=ee.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var a=ee.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=ee.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=ee.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=a(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=s(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){fc.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((n=this._instance.persistence)==null||!n.props[iA]),this.F=this.ht(),this.vt=new Pv({refillRate:(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:fc}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return pt(e)?n=q({},n,e):($(e)?this.ut:e)&&(n=q({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(fc.info("enabled"),this.it(this.rt))}it(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return fc.error("failed to load script",r);e()}))}lt(){var e,n,i;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(i=this.ot)==null||i.call(this),this.ot=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ut=!!n||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[iA]:this.ut}),this.startIfEnabled()}captureException(e){var n,i,r=(n=e==null||(i=e.$exception_list)==null||(i=i[0])==null?void 0:i.type)!==null&&n!==void 0?n:"Exception";this.vt.consumeRateLimit(r)?fc.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}};function gA(t,e,n){try{if(!(e in t))return()=>{};var i=t[e],r=n(i);return to(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=r,()=>{t[e]=i}}catch{return()=>{}}}var my=class{constructor(e){var n;this._instance=e,this.dt=(O==null||(n=O.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(V.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,V.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(O&&O.history){var i=this;(e=O.history.pushState)!=null&&e.__posthog_wrapped__||gA(O.history,"pushState",(r=>function(o,a,s){r.call(this,o,a,s),i.ft("pushState")})),(n=O.history.replaceState)!=null&&n.__posthog_wrapped__||gA(O.history,"replaceState",(r=>function(o,a,s){r.call(this,o,a,s),i.ft("replaceState")})),this.gt()}}ft(e){try{var n,i=O==null||(n=O.location)==null?void 0:n.pathname;if(!i)return;i!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=i}catch(r){V.error("Error capturing "+e+" pageview",r)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};it(O,"popstate",e),this.ct=()=>{O&&O.removeEventListener("popstate",e)}}}},Ov=ct("[SegmentIntegration]");function T3(t,e){var n=t.config.segment;if(!n)return e();(function(i,r){var o=i.config.segment;if(!o)return r();var a=l=>{var c=()=>l.anonymousId()||eo();i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(Qi,"identified")),r()},s=o.user();"then"in s&&to(s.then)?s.then((l=>a(l))):a(s)})(t,(()=>{n.register((i=>{Promise&&Promise.resolve||Ov.warn("This browser does not have Promise support, and can not use the segment integration");var r=(o,a)=>{if(!a)return o;o.event.userId||o.event.anonymousId===i.get_distinct_id()||(Ov.info("No userId set, resetting PostHog"),i.reset()),o.event.userId&&o.event.userId!==i.get_distinct_id()&&(Ov.info("UserId set, identifying with PostHog"),i.identify(o.event.userId));var s=i.calculateEventProperties(a,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 fT="posthog-js";function pT(t,e){var{organization:n,projectId:i,prefix:r,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return s=>{var l,c,u,d,h;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)||[],_=S.map((f=>q({},f,{stacktrace:f.stacktrace?q({},f.stacktrace,{type:"raw",frames:(f.stacktrace.frames||[]).map((p=>q({},p,{platform:"web:javascript"})))}):void 0}))),b={$exception_message:((c=S[0])==null?void 0:c.value)||s.message,$exception_type:(u=S[0])==null?void 0:u.type,$exception_level:s.level,$exception_list:_,$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:(h=S[0])==null?void 0:h.type,$sentry_tags:s.tags};return n&&i&&(b.$sentry_url=(r||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+s.event_id),a&&t.exceptions.sendExceptionEvent(b),s}}var vy=class{constructor(e,n,i,r,o,a){this.name=fT,this.setupOnce=function(s){s(pT(e,{organization:n,projectId:i,prefix:r,severityAllowList:o,sendExceptionsToPostHog:a==null||a}))}}},k3=O!=null&&O.location?Zf(O.location.hash,"__posthog")||Zf(location.hash,"state"):null,mA="_postHogToolbarParams",vA=ct("[Toolbar]"),Jr=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(Jr||{}),yy=class{constructor(e){this.instance=e}_t(e){ee.ph_toolbar_state=e}yt(){var e;return(e=ee.ph_toolbar_state)!==null&&e!==void 0?e:Jr.UNINITIALIZED}maybeLoadToolbar(e,n,i){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),!O||!U)return!1;e=e??O.location,i=i??O.history;try{if(!n){try{O.localStorage.setItem("test","test"),O.localStorage.removeItem("test")}catch{return!1}n=O?.localStorage}var r,o=k3||Zf(e.hash,"__posthog")||Zf(e.hash,"state"),a=o?tA((()=>JSON.parse(atob(decodeURIComponent(o)))))||tA((()=>JSON.parse(decodeURIComponent(o)))):null;return a&&a.action==="ph_authorize"?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(n.getItem(mA)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}bt(e){var n=ee.ph_load_toolbar||ee.ph_load_editor;!Ce(n)&&to(n)?n(e,this.instance):vA.warn("No toolbar load function found")}loadToolbar(e){var n=!(U==null||!U.getElementById(QA));if(!O||n)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=q({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(O.localStorage.setItem(mA,JSON.stringify(q({},r,{source:void 0}))),this.yt()===Jr.LOADED)this.bt(r);else if(this.yt()===Jr.UNINITIALIZED){var o;this._t(Jr.LOADING),(o=ee.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(a=>{if(a)return vA.error("[Toolbar] Failed to load",a),void this._t(Jr.UNINITIALIZED);this._t(Jr.LOADED),this.bt(r)})),it(O,"turbolinks:load",(()=>{this._t(Jr.UNINITIALIZED),this.loadToolbar(r)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,i){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),this.maybeLoadToolbar(e,n,i)}},R3=ct("[TracingHeaders]"),by=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var n,i;$(this.xt)&&((n=ee.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),$(this.St)&&((i=ee.__PosthogExtensions__)==null||(i=i.tracingHeadersPatchFns)==null||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return R3.error("failed to load script",r);e()}))}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(n=this.St)==null||n.call(this),this.xt=void 0,this.St=void 0)}},Ln="Mobile",Yf="iOS",fi="Android",Oc="Tablet",hT=fi+" "+Oc,gT="iPad",mT="Apple",vT=mT+" Watch",Mc="Safari",Ds="BlackBerry",yT="Samsung",bT=yT+"Browser",_T=yT+" Internet",ra="Chrome",O3=ra+" OS",ST=ra+" "+Yf,Jy="Internet Explorer",xT=Jy+" "+Ln,eb="Opera",M3=eb+" Mini",tb="Edge",wT="Microsoft "+tb,Os="Firefox",ET=Os+" "+Yf,Nc="Nintendo",Dc="PlayStation",Ms="Xbox",CT=fi+" "+Ln,AT=Ln+" "+Mc,wc="Windows",_y=wc+" Phone",yA="Nokia",Sy="Ouya",TT="Generic",N3=TT+" "+Ln.toLowerCase(),kT=TT+" "+Oc.toLowerCase(),xy="Konqueror",Ht="(\\d+(\\.\\d+)?)",Mv=new RegExp("Version/"+Ht),D3=new RegExp(Ms,"i"),L3=new RegExp(Dc+" \\w+","i"),I3=new RegExp(Nc+" \\w+","i"),nb=new RegExp(Ds+"|PlayBook|BB10","i"),H3={"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"},z3=(t,e)=>e&&de(e,mT)||(function(n){return de(n,Mc)&&!de(n,ra)&&!de(n,fi)})(t),RT=function(t,e){return e=e||"",de(t," OPR/")&&de(t,"Mini")?M3:de(t," OPR/")?eb:nb.test(t)?Ds:de(t,"IE"+Ln)||de(t,"WPDesktop")?xT:de(t,bT)?_T:de(t,tb)||de(t,"Edg/")?wT:de(t,"FBIOS")?"Facebook "+Ln:de(t,"UCWEB")||de(t,"UCBrowser")?"UC Browser":de(t,"CriOS")?ST:de(t,"CrMo")||de(t,ra)?ra:de(t,fi)&&de(t,Mc)?CT:de(t,"FxiOS")?ET:de(t.toLowerCase(),xy.toLowerCase())?xy:z3(t,e)?de(t,Ln)?AT:Mc:de(t,Os)?Os:de(t,"MSIE")||de(t,"Trident/")?Jy:de(t,"Gecko")?Os:""},B3={[xT]:[new RegExp("rv:"+Ht)],[wT]:[new RegExp(tb+"?\\/"+Ht)],[ra]:[new RegExp("("+ra+"|CrMo)\\/"+Ht)],[ST]:[new RegExp("CriOS\\/"+Ht)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ht)],[Mc]:[Mv],[AT]:[Mv],[eb]:[new RegExp("(Opera|OPR)\\/"+Ht)],[Os]:[new RegExp(Os+"\\/"+Ht)],[ET]:[new RegExp("FxiOS\\/"+Ht)],[xy]:[new RegExp("Konqueror[:/]?"+Ht,"i")],[Ds]:[new RegExp(Ds+" "+Ht),Mv],[CT]:[new RegExp("android\\s"+Ht,"i")],[_T]:[new RegExp(bT+"\\/"+Ht)],[Jy]:[new RegExp("(rv:|MSIE )"+Ht)],Mozilla:[new RegExp("rv:"+Ht)]},F3=function(t,e){var n=RT(t,e),i=B3[n];if($(i))return null;for(var r=0;r<i.length;r++){var o=i[r],a=t.match(o);if(a)return parseFloat(a[a.length-2])}return null},bA=[[new RegExp(Ms+"; "+Ms+" (.*?)[);]","i"),t=>[Ms,t&&t[1]||""]],[new RegExp(Nc,"i"),[Nc,""]],[new RegExp(Dc,"i"),[Dc,""]],[nb,[Ds,""]],[new RegExp(wc,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[_y,""];if(new RegExp(Ln).test(e)&&!/IEMobile\b/.test(e))return[wc+" "+Ln,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var i=n[1],r=H3[i]||"";return/arm/i.test(e)&&(r="RT"),[wc,r]}return[wc,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Yf,e.join(".")]}return[Yf,""]}],[/(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("("+fi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+fi+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[fi,e.join(".")]}return[fi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[O3,""]],[/Linux|debian/i,["Linux",""]]],_A=function(t){return I3.test(t)?Nc:L3.test(t)?Dc:D3.test(t)?Ms:new RegExp(Sy,"i").test(t)?Sy:new RegExp("("+_y+"|WPDesktop)","i").test(t)?_y:/iPad/.test(t)?gT:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?vT:nb.test(t)?Ds:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(yA,"i").test(t)?yA:/(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(Ln).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)?fi:hT:fi:new RegExp("(pda|"+Ln+")","i").test(t)?N3:new RegExp(Oc,"i").test(t)&&!new RegExp(Oc+" pc","i").test(t)?kT:""},Mf="https?://(.*)",Hs=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],$3=Is(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Hs),zc="<masked>",U3=["li_fat_id"];function OT(t,e,n){if(!U)return{};var i,r=e?Is([],Hs,n||[]):[],o=MT(Hc(U.URL,r,zc),t),a=(i={},Me(U3,(function(s){var l=pi.q(s);i[s]=l||null})),i);return Xe(a,o)}function MT(t,e){var n=$3.concat(e||[]),i={};return Me(n,(function(r){var o=qf(t,r);i[r]=o||null})),i}function NT(t){var e=(function(o){return o?o.search(Mf+"google.([^/?]*)")===0?"google":o.search(Mf+"bing.com")===0?"bing":o.search(Mf+"yahoo.com")===0?"yahoo":o.search(Mf+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",i={};if(!tr(e)){i.$search_engine=e;var r=U?qf(U.referrer,n):"";r.length&&(i.ph_keyword=r)}return i}function SA(){return navigator.language||navigator.userLanguage}function DT(){return U?.referrer||"$direct"}function LT(t,e){var n=t?Is([],Hs,e||[]):[],i=Kt?.href.substring(0,1e3);return{r:DT().substring(0,1e3),u:i?Hc(i,n,zc):void 0}}function IT(t){var e,{r:n,u:i}=t,r={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=Pf(n))==null?void 0:e.host};if(i){r.$current_url=i;var o=Pf(i);r.$host=o?.host,r.$pathname=o?.pathname;var a=MT(i);Xe(r,a)}if(n){var s=NT(n);Xe(r,s)}return r}function HT(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function V3(){try{return new Date().getTimezoneOffset()}catch{return}}function j3(t,e){if(!Xt)return{};var n,i,r,o=t?Is([],Hs,e||[]):[],[a,s]=(function(l){for(var c=0;c<bA.length;c++){var[u,d]=bA[c],h=u.exec(l),m=h&&(to(d)?d(h,l):d);if(m)return m}return["",""]})(Xt);return Xe(Wy({$os:a,$os_version:s,$browser:RT(Xt,navigator.vendor),$device:_A(Xt),$device_type:(i=Xt,r=_A(i),r===gT||r===hT||r==="Kobo"||r==="Kindle Fire"||r===kT?Oc:r===Nc||r===Ms||r===Dc||r===Sy?"Console":r===vT?"Wearable":r?Ln:"Desktop"),$timezone:HT(),$timezone_offset:V3()}),{$current_url:Hc(Kt?.href,o,zc),$host:Kt?.host,$pathname:Kt?.pathname,$raw_user_agent:Xt.length>1e3?Xt.substring(0,997)+"...":Xt,$browser_version:F3(Xt,navigator.vendor),$browser_language:SA(),$browser_language_prefix:(n=SA(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:O?.screen.height,$screen_width:O?.screen.width,$viewport_height:O?.innerHeight,$viewport_width:O?.innerWidth,$lib:"web",$lib_version:Ki.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Xr=ct("[Web Vitals]"),xA=9e5,wy=class{constructor(e){var n;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((i,r)=>q({},i,{["$web_vitals_"+r.name+"_event"]:q({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=i=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if($(o))Xr.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Tt();$(a)||(Ce(i?.name)||Ce(i?.value)?Xr.error("Invalid metric received",i):this.Rt&&i.value>=this.Rt?Xr.error("Ignoring metric with value >= "+this.Rt,i):(this.N.url!==a&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),$(this.N.url)&&(this.N.url=a),this.N.firstMetricTimestamp=$(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.N.metrics.push(q({},i,{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var i,r,o,a,s=ee.__PosthogExtensions__;$(s)||$(s.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:r,onFCP:o,onINP:a}=s.postHogWebVitalsCallbacks),i&&r&&o&&a?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Pt.bind(this)),this.P=!0):Xr.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((n=this._instance.persistence)==null||!n.props[oA]),this.startIfEnabled()}get allowedMetrics(){var e,n,i=pt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return $(i)?((n=this._instance.persistence)==null?void 0:n.props[aA])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(pt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=pt(this._instance.config.capture_performance)&&hi(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:xA;return 0<e&&e<=6e4?xA:e}get isEnabled(){var e=Kt?.protocol;if(e!=="http:"&&e!=="https:")return Xr.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=pt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:no(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return no(n)?n:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(Xr.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=pt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=pt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[oA]:n}),this._instance.persistence.register({[aA]:i})),this.Et=n,this.startIfEnabled()}it(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",(r=>{r?Xr.error("failed to load script",r):e()}))}Tt(){var e=O?O.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,r=n?Is([],Hs,i||[]):[];return Hc(e,r,zc)}Xr.error("Could not determine current URL")}},P3=ct("[Heatmaps]");function wA(t){return pt(t)&&"clientX"in t&&"clientY"in t&&hi(t.clientX)&&hi(t.clientY)}var Ey=class{constructor(e){var n;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((n=this.instance.persistence)==null||!n.props[ty]),this.rageclicks=new jf(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return pt(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 $(this.instance.config.capture_heatmaps)?$(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;P3.info("starting..."),this.Ft(),this.Ct()}else{var e;clearInterval((e=this.It)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ty]:n}),this.Et=n,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ct(){this.It&&clearInterval(this.It),this.It=(function(e){return e?.visibilityState==="visible"})(U)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){O&&U&&(this.jt=this.Dt.bind(this),it(O,"beforeunload",this.jt),this.Lt=e=>this.At(e||O?.event),it(U,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||O?.event),it(U,"mousemove",this.Nt,{capture:!0}),this.zt=new Gf(this.instance,C3,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),it(U,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;O&&U&&(this.jt&&O.removeEventListener("beforeunload",this.jt),this.Lt&&U.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&U.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&U.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,n){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),a=(function(s,l,c){for(var u=s;u&&op(u)&&!ro(u,"body");){if(u===c)return!1;if(de(l,O?.getComputedStyle(u).position))return!0;u=rT(u)}return!1})(nT(e),["fixed","sticky"],o);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:i),target_fixed:a,type:n}}At(e,n){var i;if(n===void 0&&(n="click"),!sA(e.target)&&wA(e)){var r=this.qt(e,n);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(q({},r,{type:"rageclick"})),this.Wt(r)}}Ut(e){!sA(e.target)&&wA(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(O){var n=O.location.href,i=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,o=i?Is([],Hs,r||[]):[],a=Hc(n,o,zc);this.N=this.N||{},this.N[a]||(this.N[a]=[]),this.N[a].push(e)}}Dt(){this.N&&!ks(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},Cy=class{constructor(e){this._instance=e}doPageView(e,n){var i,r=this.Gt(e,n);return this.Vt={pathname:(i=O?.location.pathname)!==null&&i!==void 0?i:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var n;return this.Gt(e,(n=this.Vt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,n){var i=this.Vt;if(!i)return{$pageview_id:n};var r={$pageview_id:n,$prev_pageview_id:i.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:s,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:d}=o;if(!($(a)||$(s)||$(l)||$(c)||$(u)||$(d))){a=Math.ceil(a),s=Math.ceil(s),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d);var h=a<=1?1:di(s/a,0,1,V),m=a<=1?1:di(l/a,0,1,V),S=c<=1?1:di(u/c,0,1,V),_=c<=1?1:di(d/c,0,1,V);r=Xe(r,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:S,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}},In=Uint8Array,zt=Uint16Array,Ls=Uint32Array,ib=new In([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 In([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]),EA=new In([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zT=function(t,e){for(var n=new zt(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new Ls(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)r[o]=o-n[i]<<5|i;return[n,r]},BT=zT(ib,2),q3=BT[0],Ay=BT[1];q3[28]=258,Ay[258]=28;for(Ty=zT(rb,0)[1],Wf=new zt(32768),Ne=0;Ne<32768;++Ne)Kr=(43690&Ne)>>>1|(21845&Ne)<<1,Kr=(61680&(Kr=(52428&Kr)>>>2|(13107&Kr)<<2))>>>4|(3855&Kr)<<4,Wf[Ne]=((65280&Kr)>>>8|(255&Kr)<<8)>>>1;var Kr,Ty,Wf,Ne,Ac=function(t,e,n){for(var i=t.length,r=0,o=new zt(e);r<i;++r)++o[t[r]-1];var a,s=new zt(e);for(r=0;r<e;++r)s[r]=s[r-1]+o[r-1]<<1;if(n){a=new zt(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],u=e-t[r],d=s[t[r]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)a[Wf[d]>>>l]=c}else for(a=new zt(i),r=0;r<i;++r)a[r]=Wf[s[t[r]-1]++]>>>15-t[r];return a},oa=new In(288);for(Ne=0;Ne<144;++Ne)oa[Ne]=8;for(Ne=144;Ne<256;++Ne)oa[Ne]=9;for(Ne=256;Ne<280;++Ne)oa[Ne]=7;for(Ne=280;Ne<288;++Ne)oa[Ne]=8;var Xf=new In(32);for(Ne=0;Ne<32;++Ne)Xf[Ne]=5;var Z3=Ac(oa,9,0),G3=Ac(Xf,5,0),FT=function(t){return(t/8>>0)+(7&t&&1)},$T=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var i=new(t instanceof zt?zt:t instanceof Ls?Ls:In)(n-e);return i.set(t.subarray(e,n)),i},Xi=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8},pc=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8,t[i+2]|=n>>>16},Nv=function(t,e){for(var n=[],i=0;i<t.length;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,o=n.slice();if(!r)return[new In(0),0];if(r==1){var a=new In(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(w,A){return w.f-A.f})),n.push({s:-1,f:25001});var s=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:s.f+l.f,l:s,r:l};var h=o[0].s;for(i=1;i<r;++i)o[i].s>h&&(h=o[i].s);var m=new zt(h+1),S=ky(n[u-1],m,0);if(S>e){i=0;var _=0,b=S-e,f=1<<b;for(o.sort((function(w,A){return m[A.s]-m[w.s]||w.f-A.f}));i<r;++i){var p=o[i].s;if(!(m[p]>e))break;_+=f-(1<<S-m[p]),m[p]=e}for(_>>>=b;_>0;){var v=o[i].s;m[v]<e?_-=1<<e-m[v]++-1:++i}for(;i>=0&&_;--i){var y=o[i].s;m[y]==e&&(--m[y],++_)}S=e}return[new In(m),S]},ky=function(t,e,n){return t.s==-1?Math.max(ky(t.l,e,n+1),ky(t.r,e,n+1)):e[t.s]=n},CA=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new zt(++e),i=0,r=t[0],o=1,a=function(l){n[i++]=l},s=1;s<=e;++s)if(t[s]==r&&s!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(r),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(r);o=1,r=t[s]}return[n.subarray(0,i),e]},hc=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},Ry=function(t,e,n){var i=n.length,r=FT(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var o=0;o<i;++o)t[r+o+4]=n[o];return 8*(r+4+i)},AA=function(t,e,n,i,r,o,a,s,l,c,u){Xi(e,u++,n),++r[256];for(var d=Nv(r,15),h=d[0],m=d[1],S=Nv(o,15),_=S[0],b=S[1],f=CA(h),p=f[0],v=f[1],y=CA(_),w=y[0],A=y[1],x=new zt(19),T=0;T<p.length;++T)x[31&p[T]]++;for(T=0;T<w.length;++T)x[31&w[T]]++;for(var k=Nv(x,7),E=k[0],R=k[1],D=19;D>4&&!E[EA[D-1]];--D);var N,H,B,z,te=c+5<<3,I=hc(r,oa)+hc(o,Xf)+a,G=hc(r,h)+hc(o,_)+a+14+3*D+hc(x,E)+(2*x[16]+3*x[17]+7*x[18]);if(te<=I&&te<=G)return Ry(e,u,t.subarray(l,l+c));if(Xi(e,u,1+(G<I)),u+=2,G<I){N=Ac(h,m,0),H=h,B=Ac(_,b,0),z=_;var J=Ac(E,R,0);for(Xi(e,u,v-257),Xi(e,u+5,A-1),Xi(e,u+10,D-4),u+=14,T=0;T<D;++T)Xi(e,u+3*T,E[EA[T]]);u+=3*D;for(var me=[p,w],Ke=0;Ke<2;++Ke){var Mt=me[Ke];for(T=0;T<Mt.length;++T){var Qt=31&Mt[T];Xi(e,u,J[Qt]),u+=E[Qt],Qt>15&&(Xi(e,u,Mt[T]>>>5&127),u+=Mt[T]>>>12)}}}else N=Z3,H=oa,B=G3,z=Xf;for(T=0;T<s;++T)if(i[T]>255){Qt=i[T]>>>18&31,pc(e,u,N[Qt+257]),u+=H[Qt+257],Qt>7&&(Xi(e,u,i[T]>>>23&31),u+=ib[Qt]);var aa=31&i[T];pc(e,u,B[aa]),u+=z[aa],aa>3&&(pc(e,u,i[T]>>>5&8191),u+=rb[aa])}else pc(e,u,N[i[T]]),u+=H[i[T]];return pc(e,u,N[256]),u+H[256]},Y3=new Ls([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),W3=(function(){for(var t=new Ls(256),e=0;e<256;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),X3=function(t,e,n,i,r){return(function(o,a,s,l,c,u){var d=o.length,h=new In(l+d+5*(1+Math.floor(d/7e3))+c),m=h.subarray(l,h.length-c),S=0;if(!a||d<8)for(var _=0;_<=d;_+=65535){var b=_+65535;b<d?S=Ry(m,S,o.subarray(_,b)):(m[_]=u,S=Ry(m,S,o.subarray(_,d)))}else{for(var f=Y3[a-1],p=f>>>13,v=8191&f,y=(1<<s)-1,w=new zt(32768),A=new zt(y+1),x=Math.ceil(s/3),T=2*x,k=function(vp){return(o[vp]^o[vp+1]<<x^o[vp+2]<<T)&y},E=new Ls(25e3),R=new zt(288),D=new zt(32),N=0,H=0,B=(_=0,0),z=0,te=0;_<d;++_){var I=k(_),G=32767&_,J=A[I];if(w[G]=J,A[I]=G,z<=_){var me=d-_;if((N>7e3||B>24576)&&me>423){S=AA(o,m,0,E,R,D,H,B,te,_-te,S),B=N=H=0,te=_;for(var Ke=0;Ke<286;++Ke)R[Ke]=0;for(Ke=0;Ke<30;++Ke)D[Ke]=0}var Mt=2,Qt=0,aa=v,rr=G-J&32767;if(me>2&&I==k(_-rr))for(var eR=Math.min(p,me)-1,tR=Math.min(32767,_),nR=Math.min(258,me);rr<=tR&&--aa&&G!=J;){if(o[_+Mt]==o[_+Mt-rr]){for(var or=0;or<nR&&o[_+or]==o[_+or-rr];++or);if(or>Mt){if(Mt=or,Qt=rr,or>eR)break;var iR=Math.min(rr,or-2),e0=0;for(Ke=0;Ke<iR;++Ke){var mp=_-rr+Ke+32768&32767,t0=mp-w[mp]+32768&32767;t0>e0&&(e0=t0,J=mp)}}}rr+=(G=J)-(J=w[G])+32768&32767}if(Qt){E[B++]=268435456|Ay[Mt]<<18|Ty[Qt];var n0=31&Ay[Mt],i0=31&Ty[Qt];H+=ib[n0]+rb[i0],++R[257+n0],++D[i0],z=_+Mt,++N}else E[B++]=o[_],++R[o[_]]}}S=AA(o,m,u,E,R,D,H,B,te,_-te,S)}return $T(h,0,l+FT(S)+c)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,i,!0)},Dv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function K3(t,e){e===void 0&&(e={});var n=(function(){var s=4294967295;return{p:function(l){for(var c=s,u=0;u<l.length;++u)c=W3[255&c^l[u]]^c>>>8;s=c},d:function(){return 4294967295^s}}})(),i=t.length;n.p(t);var r,o=X3(t,e,10+((r=e).filename&&r.filename.length+1||0),8),a=o.length;return(function(s,l){var c=l.filename;if(s[0]=31,s[1]=139,s[2]=8,s[8]=l.level<2?4:l.level==9?2:0,s[9]=3,l.mtime!=0&&Dv(s,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){s[3]=8;for(var u=0;u<=c.length;++u)s[u+10]=c.charCodeAt(u)}})(o,e),Dv(o,a-8,n.d()),Dv(o,a-4,i),o}var Q3=function(t){var e,n,i,r,o="";for(e=n=0,i=(t=(t+"").replace(/\r\n/g,`
|
|
459
|
+
`,Ma,$n,jn,jr,Gr,Gn,Wr,dv=class extends HTMLElement{constructor(){super();un(this,Ma);un(this,$n);un(this,jn);un(this,jr);un(this,Gr);un(this,Gn,null);un(this,Wr,null);ar(this,Ma,this.attachShadow({mode:"open",delegatesFocus:!0})),ar(this,$n,document.createElement("div")),me(this,$n).setAttribute("part","mount"),me(this,Ma).appendChild(me(this,$n)),ar(this,jn,document.createElement("div")),me(this,jn).id="portalRoot",me(this,Ma).appendChild(me(this,jn)),ar(this,jr,document.createElement("div")),me(this,jr).id="overlayContainer",Object.assign(me(this,jr).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),me(this,Ma).appendChild(me(this,jr)),ar(this,Gr,GL()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){me(this,Gn)?.unmount(),ar(this,Gn,null)}getMountNode(){return me(this,$n)}getController(){return me(this,Gr)}getPortalRoot(){return me(this,jn)}getOverlayContainer(){return me(this,jr)}getShadowRoot(){return me(this,Ma)}open(){me(this,Gr).setOpen(!0)}close(){me(this,Gr).setOpen(!1)}toggle(){me(this,Gr).toggle()}setOverrideFetcher(a){me(this,Wr)&&(ar(this,Wr,{...me(this,Wr),fetcher:a}),this.render())}mountReactApp(a){ar(this,Wr,a),this.render()}render(){!this.isConnected||!me(this,Wr)||(me(this,Gn)||ar(this,Gn,(0,hI.createRoot)(me(this,$n))),me(this,Gn).render((0,fv.jsx)(ZL,{shadowRoot:me(this,Ma),portalRoot:me(this,jn),overlayContainer:me(this,jr),children:(0,fv.jsx)(dI,{...me(this,Wr),controller:me(this,Gr),canvasHost:this})})))}applyBaseStyles(){if(me(this,Ma).adoptedStyleSheets!==void 0){let a=new CSSStyleSheet;a.replaceSync(pI),me(this,Ma).adoptedStyleSheets=[a]}else{let a=document.createElement("style");a.textContent=pI,me(this,Ma).appendChild(a)}}};Ma=new WeakMap,$n=new WeakMap,jn=new WeakMap,jr=new WeakMap,Gr=new WeakMap,Gn=new WeakMap,Wr=new WeakMap;var mI=()=>{typeof window>"u"||customElements.get(fI)||customElements.define(fI,dv)};var pv=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=OL(x)}let a=null,r=null,n=null,{runtime:o}=t;async function i(x){!o?.actions||x.length===0||(n?.isApplied()&&await n.revertAll(),n=await o.actions.applyBatch(x))}async function s(){n?.isApplied()&&(await n.revertAll(),n=null)}if(t.fetcher)try{r=t.fetcher,console.log("[SmartCanvas] Fetching initial config...");let x=await t.fetcher();a=x,console.log("[SmartCanvas] Config fetched:",`tiles=${x.tiles?.length??0},`,`actions=${x.actions?.length??0},`,`theme=${x.theme?.mode??"default"}`),x.actions?.length&&console.log("[SmartCanvas] Actions to apply:",x.actions.map((f,m)=>`[${m}] ${f.kind}${f.anchorId?` anchor="${typeof f.anchorId=="string"?f.anchorId:f.anchorId.selector}"`:""}${f.label?` "${f.label}"`:""}`).join(", ")),x.actions&&x.actions.length>0&&o?.actions&&(await i(x.actions),console.log("[SmartCanvas] Initial actions applied successfully")),x.tiles&&o?.accumulator&&sf(x.tiles,o.accumulator,x.actions)}catch(x){console.error("[SmartCanvas] Error fetching/applying initial config:",x)}e&&e();let l=HL();mI();let u=document.createElement("smart-canvas");if($L(u.getOverlayContainer()),t.tokens)for(let[x,f]of Object.entries(t.tokens))u.style.setProperty(x,f);let c=()=>{let x=t.target??document.body;x&&x.appendChild(u)};document.body?c():document.addEventListener("DOMContentLoaded",c,{once:!0}),l&&(console.log(`[SmartCanvas] Loading editor SDK for ${l} mode`),UL(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,h=t.integrations?.telemetry,g=t.fetcher??ls({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});r||(r=g);let S={fetcher:g,pollIntervalMs:t.pollIntervalMs,experiments:d,telemetry:h,runtime:o,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,initialBatchHandle:n,workspaceTheme:t.workspaceTheme};u.mountReactApp(S),t.defaultOpen&&u.open();let b={el:u,open:()=>u.open(),close:()=>u.close(),destroy:()=>{s(),u.remove()},setTokens:x=>{for(let[f,m]of Object.entries(x))u.style.setProperty(f,m)},getConfig:async()=>{if(r)try{let x=await r();return a=x,x}catch(x){console.error("[SmartCanvas] Error fetching config:",x)}return a??{tiles:[],actions:[],fetchedAt:""}},setEnabled:async x=>{x?a&&await i(a.actions):await s()},setOverrideFetcher:x=>{r=x,u.setOverrideFetcher(x),o?.accumulator&&x().then(f=>{f?.tiles&&sf(f.tiles,o.accumulator,f.actions)}).catch(()=>{})},registerTelemetryProperties:x=>{h?.register?.(x)},getSessionId:()=>h?.getSessionId?.(),startSessionRecording:()=>{h?.startSessionRecording?.()},track:(x,f)=>h?.track?(h.track(x,f),!0):!1,runtime:o};if(typeof window<"u"){let x=window.SynOS;x&&(x.handle=b)}return b};typeof window<"u"&&(window.SmartCanvas={async create(t){return pv(t)}});var Zn=Y(Ge(),1);var Wn=Y(Re(),1);function Oq({tiles:t,intervalMs:e=7e3,telemetry:a}){let[r,n]=(0,Zn.useState)(0),o=(0,Zn.useMemo)(()=>[...t].sort((i,s)=>(i.priority??0)-(s.priority??0)),[t]);return(0,Zn.useEffect)(()=>{a?.trackCanvasOpened("wheel")},[a]),(0,Zn.useEffect)(()=>{if(o.length<=1)return;let i=setInterval(()=>{n(s=>(s+1)%o.length)},e);return()=>clearInterval(i)},[o,e]),(0,Zn.useEffect)(()=>{let i=o[r];i&&a?.trackRectangleViewed(i.id,"wheel")},[r,o,a]),o.length?(0,Wn.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,Wn.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${r*100}%)`,width:`${o.length*100}%`},children:o.map(i=>(0,Wn.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,Wn.jsx)(lu,{config:i,surface:"wheel",telemetry:a})},i.id))}),(0,Wn.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((i,s)=>(0,Wn.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 uu(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function Nq(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=uu(n),i=uu(Un);return o.major>i.major&&e.push(`Config schema v${n} is newer than SDK v${Un}. 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${Un}. Migrating config to current version.`),{valid:!0,warnings:e,errors:a,migratedConfig:JD(r,n)}):{valid:!0,warnings:e,errors:a}}function JD(t,e){let a={...t};return uu(e).major===1&&(a=eO(a)),a.schemaVersion=Un,a}function eO(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 Pq(t){if(!t||typeof t!="object")return!1;let e=t,a=e.schemaVersion||"1.0",r=uu(a),n=uu(Un);return r.major<n.major||!e.schemaVersion}var vI={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function yI(){return vI}function hv(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 cu(t,e,a){return a===2?hv(hv(t+e)+"")%1e4/1e4:a===1?hv(e+t)%1e3/1e3:null}function tO(t){return t<=0?[]:new Array(t).fill(1/t)}function hf(t,e){return t>=e[0]&&t<e[1]}function xI(t,e){let a=cu("__"+e[0],t,1);return a===null?!1:a>=e[1]&&a<e[2]}function bI(t,e){for(let a=0;a<e.length;a++)if(hf(t,e[a]))return a;return-1}function gv(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function mf(t,e){if(!e.length)return!1;let a=!1,r=!1;for(let n=0;n<e.length;n++){let o=nO(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 aO(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 rO(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=>!aO(n[0],n[1],n[2]))}catch{return!1}}function nO(t,e,a){try{let r=new URL(t,"https://_");if(e==="regex"){let n=gv(a);return n?n.test(r.href)||n.test(r.href.substring(r.origin.length)):!1}else if(e==="simple")return rO(r,a);return!1}catch{return!1}}function SI(t,e,a){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let r=tO(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 CI(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 _I(t){try{return t()}catch(e){return console.error(e),!1}}var mv=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function zo(t,e,a){if(e=e||"",a=a||globalThis.crypto&&globalThis.crypto.subtle||vI.SubtleCrypto,!a)throw new Error("No SubtleCrypto implementation found");try{let r=await a.importKey("raw",mv(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[n,o]=t.split("."),i=await a.decrypt({name:"AES-CBC",iv:mv(n)},r,mv(o));return new TextDecoder().decode(i)}catch{throw new Error("Failed to decrypt")}}function du(t){return typeof t=="string"?t:JSON.stringify(t)}function ga(t){typeof t=="number"&&(t=t+""),(!t||typeof t!="string")&&(t="0");let e=t.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return e.length===3&&e.push("~"),e.map(a=>a.match(/^[0-9]+$/)?a.padStart(5," "):a).join("-")}function wI(){let t;try{t="1.6.4"}catch{t=""}return t}function LI(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 gI(t){return typeof t=="object"&&t!==null}function gf(t){return t.urlPatterns&&t.variations.some(e=>gI(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>gI(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function vf(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 Tt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},dr=yI(),hs={fetchFeaturesCall:({host:t,clientKey:e,headers:a})=>dr.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 dr.fetch(`${t}/api/eval/${e}`,n)},eventSourceCall:({host:t,clientKey:e,headers:a})=>a?new dr.EventSource(`${t}/sub/${e}`,{headers:a}):new dr.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let a=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),sO()):document.visibilityState==="hidden"&&(t=window.setTimeout(iO,Tt.idleStreamInterval))};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(dr.localStorage=globalThis.localStorage)}catch{}var ms=new Map,II=!1,Zr=new Map,yf=new Map,gs=new Map,vs=new Set;function kI(t){Object.assign(Tt,t),Tt.backgroundSync||Cv()}async function EI({instance:t,timeout:e,skipCache:a,allowStale:r,backgroundSync:n}){return n||(Tt.backgroundSync=!1),lO({instance:t,allowStale:r,timeout:e,skipCache:a})}function oO(t){let e=fu(t),a=ms.get(e)||new Set;a.add(t),ms.set(e,a)}function TI(t){ms.forEach(e=>e.delete(t))}function iO(){gs.forEach(t=>{t&&(t.state="idle",bv(t))})}function sO(){gs.forEach(t=>{t&&t.state==="idle"&&Sv(t)})}async function AI(){try{if(!dr.localStorage)return;await dr.localStorage.setItem(Tt.cacheKey,JSON.stringify(Array.from(Zr.entries())))}catch{}}async function lO({instance:t,allowStale:e,timeout:a,skipCache:r}){let n=fu(t),o=yv(t),i=new Date,s=new Date(i.getTime()-Tt.maxAge+Tt.staleTTL);await uO();let l=!Tt.disableCache&&!r?Zr.get(o):void 0;return l&&(e||l.staleAt>i)&&l.staleAt>s?(l.sse&&vs.add(n),l.staleAt<i?vv(t):xv(t),{data:l.data,success:!0,source:"cache"}):await vf(vv(t),a)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function fu(t){let[e,a]=t.getApiInfo();return`${e}||${a}`}function yv(t){let e=fu(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 uO(){if(!II){II=!0;try{if(dr.localStorage){let t=await dr.localStorage.getItem(Tt.cacheKey);if(!Tt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([a,r])=>{Zr.set(a,{...r,staleAt:new Date(r.staleAt)})}),RI()}}}catch{}if(!Tt.disableIdleStreams){let t=hs.startIdleListener();t&&(hs.stopIdleListener=t)}}}function RI(){let t=Array.from(Zr.entries()).map(([a,r])=>({key:a,staleAt:r.staleAt.getTime()})).sort((a,r)=>a.staleAt-r.staleAt),e=Math.min(Math.max(0,Zr.size-Tt.maxEntries),Zr.size);for(let a=0;a<e;a++)Zr.delete(t[a].key)}function MI(t,e,a){let r=a.dateUpdated||"",n=new Date(Date.now()+Tt.staleTTL),o=Tt.disableCache?void 0:Zr.get(e);if(o&&r&&o.version===r){o.staleAt=n,AI();return}Tt.disableCache||(Zr.set(e,{data:a,version:r,staleAt:n,sse:vs.has(t)}),RI()),AI();let i=ms.get(t);i&&i.forEach(s=>cO(s,a))}async function cO(t,e){await t.setPayload(e||t.getPayload())}async function vv(t){let{apiHost:e,apiRequestHeaders:a}=t.getApiHosts(),r=t.getClientKey(),n="isRemoteEval"in t&&t.isRemoteEval(),o=fu(t),i=yv(t),s=yf.get(i);return s||(s=(n?hs.fetchRemoteEvalCall({host:e,clientKey:r,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:a}):hs.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"&&vs.add(o),u.json()}).then(u=>(MI(o,i,u),xv(t),yf.delete(i),{data:u,success:!0,source:"network"})).catch(u=>(yf.delete(i),{data:null,source:"error",success:!1,error:u})),yf.set(i,s)),s}function xv(t,e=!1){let a=fu(t),r=yv(t),{streamingHost:n,streamingHostRequestHeaders:o}=t.getApiHosts(),i=t.getClientKey();if(e&&vs.add(a),Tt.backgroundSync&&vs.has(a)&&dr.EventSource){if(gs.has(a))return;let s={src:null,host:n,clientKey:i,headers:o,cb:l=>{try{if(l.type==="features-updated"){let u=ms.get(a);u&&u.forEach(c=>{vv(c)})}else if(l.type==="features"){let u=JSON.parse(l.data);MI(a,r,u)}s.errors=0}catch{DI(s)}},errors:0,state:"active"};gs.set(a,s),Sv(s)}}function DI(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);bv(t),setTimeout(()=>{["idle","active"].includes(t.state)||Sv(t)},Math.min(e,3e5))}}function bv(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function Sv(t){t.src=hs.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=()=>DI(t),t.src.onopen=()=>{t.errors=0}}function dO(t,e){bv(t),gs.delete(e)}function Cv(){vs.clear(),gs.forEach(dO),ms.clear(),hs.stopIdleListener()}function xf(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&xv(t,!0),oO(t)}}var fO=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Lv={revert:function(){}},_f=new Map,Iv=new Set;function pO(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function wf(t){var e=_f.get(t);return e||(e={element:t,attributes:{}},_f.set(t,e)),e}function Lf(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,pO(e)),i}function If(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,OI()):t!==a&&(e.isDirty=!0,OI())}function hO(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),If(kO(e),t)}function mO(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(a){return a.mutate(e)}),If(Array.from(e).filter(Boolean).join(" "),t)}function gO(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),If(e,t)}function vO(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 yO(t){var e=t.originalValue;t.mutations.forEach(function(a){var r=a.mutate(),n=vO(r);e=n||e}),If(e,t)}var xO=function(e){return e.innerHTML},bO=function(e,a){return e.innerHTML=a};function FI(t){var e=wf(t);return e.html||(e.html=Lf(t,"html",xO,bO,hO)),e.html}var SO=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},CO=function(e,a){a.insertBeforeNode&&!a.parentNode.contains(a.insertBeforeNode)||a.parentNode.insertBefore(e,a.insertBeforeNode)};function NI(t){var e=wf(t);return e.position||(e.position=Lf(t,"position",SO,CO,yO)),e.position}var _O=function(e,a){return a?e.className=a:e.removeAttribute("class")},wO=function(e){return e.className};function PI(t){var e=wf(t);return e.classes||(e.classes=Lf(t,"class",wO,_O,mO)),e.classes}var LO=function(e){return function(a){var r;return(r=a.getAttribute(e))!=null?r:null}},IO=function(e){return function(a,r){return r!==null?a.setAttribute(e,r):a.removeAttribute(e)}};function HI(t,e){var a=wf(t);return a.attributes[e]||(a.attributes[e]=Lf(t,e,LO(e),IO(e),gO)),a.attributes[e]}function AO(t,e){var a=_f.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 bf;function kO(t){return bf||(bf=document.createElement("div")),bf.innerHTML=t,bf.innerHTML}function Sf(t,e,a){if(a.isDirty){a.isDirty=!1;var r=a.virtualValue;a.mutations.length||AO(t,e),a.setValue(t,r)}}function EO(t,e){t.html&&Sf(e,"html",t.html),t.classes&&Sf(e,"class",t.classes),t.position&&Sf(e,"position",t.position),Object.keys(t.attributes).forEach(function(a){Sf(e,a,t.attributes[a])})}function OI(){_f.forEach(EO)}function TO(t,e){var a=null;t.kind==="html"?a=FI(e):t.kind==="class"?a=PI(e):t.kind==="attribute"?a=HI(e,t.attribute):t.kind==="position"&&(a=NI(e)),a&&(a.mutations.push(t),a.mutationRunner(a))}function RO(t,e){var a=null;if(t.kind==="html"?a=FI(e):t.kind==="class"?a=PI(e):t.kind==="attribute"?a=HI(e,t.attribute):t.kind==="position"&&(a=NI(e)),!!a){var r=a.mutations.indexOf(t);r!==-1&&a.mutations.splice(r,1),a.mutationRunner(a)}}function UI(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),TO(t,r))})}}function MO(t){t.elements.forEach(function(e){return RO(t,e)}),t.elements.clear(),Iv.delete(t)}function BI(){Iv.forEach(UI)}var _v;function DO(){typeof document>"u"||(_v||(_v=new MutationObserver(function(){BI()})),BI(),_v.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}DO();function Af(t){return typeof document>"u"?Lv:(Iv.add(t),UI(t),{revert:function(){MO(t)}})}function wv(t,e){return Af({kind:"html",elements:new Set,mutate:e,selector:t})}function qI(t,e){return Af({kind:"position",elements:new Set,mutate:e,selector:t})}function pu(t,e){return Af({kind:"class",elements:new Set,mutate:e,selector:t})}function Cf(t,e,a){return fO.test(e)?e==="class"||e==="className"?pu(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)})}):Af({kind:"attribute",attribute:e,elements:new Set,mutate:a,selector:t}):Lv}function OO(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 wv(e,function(s){return s+(r??"")});if(a==="set")return wv(e,function(){return r??""})}else if(n==="class"){if(a==="append")return pu(e,function(s){r&&s.add(r)});if(a==="remove")return pu(e,function(s){r&&s.delete(r)});if(a==="set")return pu(e,function(s){s.clear(),r&&s.add(r)})}else if(n==="position"){if(a==="set"&&o)return qI(e,function(){return{insertBeforeSelector:i,parentSelector:o}})}else{if(a==="append")return Cf(e,n,function(s){return s!==null?s+(r??""):r??""});if(a==="set")return Cf(e,n,function(){return r??""});if(a==="remove")return Cf(e,n,function(){return null})}return Lv}var BO={html:wv,classes:pu,attribute:Cf,position:qI,declarative:OO},zI=BO;var Av={};function Xn(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(!UO(t,n,a))return!1;break;case"$not":if(Xn(t,n,a))return!1;break;default:if(!hu(n,FO(t,r),a))return!1}return!0}function FO(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 VI(t,e=!1){let a=`${t}${e?"/i":""}`;return Av[a]||(Av[a]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),Av[a]}function hu(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)||!GI(t))return JSON.stringify(e)===JSON.stringify(t);for(let n in t)if(!HO(n,e,t[n],a))return!1;return!0}function GI(t){let e=Object.keys(t);return e.length>0&&e.filter(a=>a[0]==="$").length===e.length}function NO(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 PO(t,e,a){if(!Array.isArray(t))return!1;let r=GI(e)?n=>hu(e,n,a):n=>Xn(n,e,a);for(let n=0;n<t.length;n++)if(t[n]&&r(t[n]))return!0;return!1}function ys(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 $I(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(hu(e[n],t[i],a,r)){o=!0;break}if(!o)return!1}return!0}function HO(t,e,a,r){switch(t){case"$veq":return ga(e)===ga(a);case"$vne":return ga(e)!==ga(a);case"$vgt":return ga(e)>ga(a);case"$vgte":return ga(e)>=ga(a);case"$vlt":return ga(e)<ga(a);case"$vlte":return ga(e)<=ga(a);case"$eq":return e===a;case"$ne":return e!==a;case"$lt":return e<a;case"$lte":return e<=a;case"$gt":return e>a;case"$gte":return e>=a;case"$exists":return a?e!=null:e==null;case"$in":return Array.isArray(a)?ys(e,a):!1;case"$ini":return Array.isArray(a)?ys(e,a,!0):!1;case"$inGroup":return ys(e,r[a]||[]);case"$notInGroup":return!ys(e,r[a]||[]);case"$nin":return Array.isArray(a)?!ys(e,a):!1;case"$nini":return Array.isArray(a)?!ys(e,a,!0):!1;case"$not":return!hu(a,e,r);case"$size":return Array.isArray(e)?hu(a,e.length,r):!1;case"$elemMatch":return PO(e,a,r);case"$all":return Array.isArray(a)?$I(e,a,r):!1;case"$alli":return Array.isArray(a)?$I(e,a,r,!0):!1;case"$regex":try{return VI(a).test(e)}catch{return!1}case"$regexi":try{return VI(a,!0).test(e)}catch{return!1}case"$type":return NO(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(Xn(t,e[r],a))return!0;return!1}function UO(t,e,a){for(let r=0;r<e.length;r++)if(!Xn(t,e[r],a))return!1;return!0}var qO="Feature Evaluated",zO="Experiment Viewed";function VO(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 $O(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 xs(t){try{await t()}catch{}}function WI(t,e,a){if(t.user.trackedExperiments){let n=Tf(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(xs(()=>n(e,a,t.user)))}if(t.user.trackingCallback){let n=t.user.trackingCallback;r.push(xs(()=>n(e,a)))}if(t.global.eventLogger){let n=t.global.eventLogger;r.push(xs(()=>n(zO,{experimentId:e.key,variationId:a.key,hashAttribute:a.hashAttribute,hashValue:a.hashValue},t.user)))}return r}function jO(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;xs(()=>r(e,a,t.user))}if(t.user.onFeatureUsage){let r=t.user.onFeatureUsage;xs(()=>r(e,a))}if(t.global.eventLogger){let r=t.global.eventLogger;xs(()=>r(qO,{feature:e,source:a.source,value:a.value,ruleId:a.source==="defaultValue"?"$default":a.ruleId||"",variationId:a.experimentResult?a.experimentResult.key:""},t.user))}}function kf(t,e){if(e.stack.evaluatedFeatures.has(t))return Yn(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let a=VO(e);if(a.has(t))return Yn(e,t,a.get(t),"override");if(!e.global.features||!e.global.features[t])return Yn(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=kf(l.id,e);if(u.source==="cyclicPrerequisite")return Yn(e,t,null,"cyclicPrerequisite");let c={value:u.value};if(!Xn(c,l.condition||{})){if(l.gate)return Yn(e,t,null,"prerequisite");continue e}}if(o.filters&&YI(o.filters,e))continue;if("force"in o){if(o.condition&&!XI(o.condition,e)||!GO(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=>{!WI(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),Yn(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}=Ef(i,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(i,s),s.inExperiment&&!s.passthrough)return Yn(e,t,s.value,"experiment",o.id,i,s)}}return Yn(e,t,r.defaultValue===void 0?null:r.defaultValue,"defaultValue")}function Ef(t,e,a){let r=t.key,n=t.variations.length;if(n<2)return{result:Ve(a,t,-1,!1,e)};if(a.global.enabled===!1||a.user.enabled===!1)return{result:Ve(a,t,-1,!1,e)};if(t=WO(t,a),t.urlPatterns&&!mf(a.user.url||"",t.urlPatterns))return{result:Ve(a,t,-1,!1,e)};let o=CI(r,a.user.url||"",n);if(o!==null)return{result:Ve(a,t,o,!1,e)};let i=$O(a);if(r in i){let x=i[r];return{result:Ve(a,t,x,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:Ve(a,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=Vo(a,t.hashAttribute,a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:Ve(a,t,-1,!1,e)};let u=-1,c=!1,d=!1;if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:x,versionIsBlocked:f}=YO({ctx:a,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});c=x>=0,u=x,d=!!f}if(!c){if(t.filters){if(YI(t.filters,a))return{result:Ve(a,t,-1,!1,e)}}else if(t.namespace&&!xI(l,t.namespace))return{result:Ve(a,t,-1,!1,e)};if(t.include&&!_I(t.include))return{result:Ve(a,t,-1,!1,e)};if(t.condition&&!XI(t.condition,a))return{result:Ve(a,t,-1,!1,e)};if(t.parentConditions){let x=new Set(a.stack.evaluatedFeatures);for(let f of t.parentConditions){a.stack.evaluatedFeatures=new Set(x);let m=kf(f.id,a);if(m.source==="cyclicPrerequisite")return{result:Ve(a,t,-1,!1,e)};let v={value:m.value};if(!Xn(v,f.condition||{}))return{result:Ve(a,t,-1,!1,e)}}}if(t.groups&&!XO(t.groups,a))return{result:Ve(a,t,-1,!1,e)}}if(t.url&&!ZO(t.url,a))return{result:Ve(a,t,-1,!1,e)};let h=cu(t.seed||r,l,t.hashVersion||1);if(h===null)return{result:Ve(a,t,-1,!1,e)};if(!c){let x=t.ranges||SI(n,t.coverage===void 0?1:t.coverage,t.weights);u=bI(h,x)}if(d)return{result:Ve(a,t,-1,!1,e,void 0,!0)};if(u<0)return{result:Ve(a,t,-1,!1,e)};if("force"in t)return{result:Ve(a,t,t.force===void 0?-1:t.force,!1,e)};if(a.global.qaMode||a.user.qaMode)return{result:Ve(a,t,-1,!1,e)};if(t.status==="stopped")return{result:Ve(a,t,-1,!1,e)};let g=Ve(a,t,u,!0,e,h,c);if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:x,key:f,doc:m}=QO(a,s,du(l),{[kv(t.key,t.bucketVersion)]:g.key});x&&(a.user.stickyBucketAssignmentDocs=a.user.stickyBucketAssignmentDocs||{},a.user.stickyBucketAssignmentDocs[f]=m,a.user.saveStickyBucketAssignmentDoc(m))}let S=WI(a,t,g);S.length===0&&a.global.saveDeferredTrack&&a.global.saveDeferredTrack({experiment:t,result:g});let b=S.length?S.length===1?S[0]:Promise.all(S).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&a.global.recordChangeId&&a.global.recordChangeId(t.changeId),{result:g,trackingCall:b}}function Yn(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"&&jO(t,e,s),s}function ZI(t){return{...t.user.attributes,...t.user.attributeOverrides}}function XI(t,e){return Xn(ZI(e),t,e.global.savedGroups||{})}function YI(t,e){return t.some(a=>{let{hashValue:r}=Vo(e,a.attribute);if(!r)return!0;let n=cu(a.seed,r,a.hashVersion||2);return n===null?!0:!a.ranges.some(o=>hf(n,o))})}function GO(t,e,a,r,n,o,i){if(!n&&o===void 0)return!0;if(!n&&o===0)return!1;let{hashValue:s}=Vo(t,a,r);if(!s)return!1;let l=cu(e,s,i||1);return l===null?!1:n?hf(l,n):o!==void 0?l<=o:!0}function Ve(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}=Vo(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 WO(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=gv(t.url))),t}function Vo(t,e,a){let r=e||"id",n="",o=ZI(t);return o[r]&&(n=o[r]),!n&&a&&(o[a]&&(n=o[a]),n&&(r=a)),{hashAttribute:r,hashValue:n}}function ZO(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 XO(t,e){let a=e.global.groups||{};for(let r=0;r<t.length;r++)if(a[t[r]])return!0;return!1}function YO({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=kv(e,a),l=KO(t,r,n);if(o>0)for(let d=0;d<o;d++){let h=kv(e,d);if(l[h]!==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 kv(t,e){return e=e||0,`${t}__${e}`}function Ev(t,e){return`${t}||${e}`}function KO(t,e,a){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:r,hashValue:n}=Vo(t,e),o=Ev(r,du(n)),{hashAttribute:i,hashValue:s}=Vo(t,a),l=s?Ev(i,du(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 QO(t,e,a,r){let n=Ev(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 JO(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 KI(t,e,a){let r=Tv(t,a);return e.getAllAssignments(r)}function Tv(t,e){let a={};return JO(t,e).forEach(n=>{let{hashValue:o}=Vo(t,n);a[n]=du(o)}),a}async function QI(t,e,a){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await zo(t.encryptedFeatures,e,a))}catch(r){console.error(r)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await zo(t.encryptedExperiments,e,a))}catch(r){console.error(r)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await zo(t.encryptedSavedGroups,e,a))}catch(r){console.error(r)}delete t.encryptedSavedGroups}return t}function JI(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 Tf(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var bs=typeof window<"u"&&typeof document<"u",eB=wI(),mu=class{constructor(e){if(e=e||{},this.version=eB,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 QI(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,xf(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&kI(e.cacheSettings),e.payload)return await this.setPayload(e.payload),xf(this,e),{success:!0,source:"init"};{let{data:a,...r}=await this._refresh({...e,allowStale:!0});return xf(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 JI(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 EI({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 zo(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 zo(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,TI(this),e.destroyAllStreams&&Cv(),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}=Ef(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=Ve(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:i}=Ef(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=gf(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let u=e.persistQueryString?LI(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(mf(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?[vf(i,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??d))]).then(()=>{try{c(u)}catch(h){console.error(h)}});else try{c(u)}catch(h){console.error(h)}}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&&gf(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 kf(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=>[Tf(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(Tf(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(bs?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let a=gf(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(zI.declarative(r).revert)}),()=>{a.forEach(r=>r())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let a=this._getEvalContext(),r=await KI(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=Tv(r,a);return e.getAllAssignmentsSync(n)}inDevMode(){return!!this._options.enableDevMode}};var tB="https://experiment.syntrologie.com",Rv=class{constructor(e={}){$(this,"gb");$(this,"featureListeners",new Set);if(e.client)this.gb=e.client;else{let a=e.onExperimentViewed?(r,n)=>{e.onExperimentViewed(r.key,n.variationId,typeof n.value=="string"?n.value:`variation_${n.variationId}`)}:void 0;this.gb=new mu({...e,apiHost:e.apiHost??tB,enableDevMode:e.enableDevMode??!0,trackingCallback:a}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes(e)}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,a){return this.gb.getFeatureValue(e,a)}getAllFeatures(){let e=this.gb.getFeatures(),a={};for(let r of Object.keys(e))a[r]=this.gb.getFeatureValue(r,null);return a}shouldRenderRectangle(e){return!0}onFeaturesChanged(e){return this.featureListeners.add(e),this.featureListeners.size===1&&this.gb.setRenderer(()=>{for(let a of this.featureListeners)a()}),()=>{this.featureListeners.delete(e),this.featureListeners.size===0&&this.gb.setRenderer(null)}}};function Mv(t={}){return new Rv(t)}var e1="syntro_session_metrics",Rf=class{constructor(e={}){$(this,"metrics",new Map);$(this,"experiments");$(this,"attributePrefix");$(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,a=1){let n=(this.metrics.get(e)??0)+a;return this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n),n}set(e,a){this.metrics.set(e,a),this.saveToStorage(),this.updateExperimentAttributes(e,a),this.onMetricChange?.(e,a)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,a){return this.get(e)>=a}getAll(){return Object.fromEntries(this.metrics)}reset(e){this.metrics.delete(e),this.saveToStorage(),this.updateExperimentAttributes(e,0),this.onMetricChange?.(e,0)}resetAll(){let e=Array.from(this.metrics.keys());this.metrics.clear(),this.saveToStorage();let a={};for(let r of e)a[`${this.attributePrefix}${r}`]=0,this.onMetricChange?.(r,0);this.experiments?.setAttributes?.(a)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,a){if(!this.experiments?.setAttributes)return;let r=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[r]:a})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[a,r]of this.metrics)e[`${this.attributePrefix}${a}`]=r;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(e1);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(e1,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function Dv(t={}){return new Rf(t)}var p={};DE(p,{BRAND:()=>AB,DIRTY:()=>$o,EMPTY_PATH:()=>oB,INVALID:()=>K,NEVER:()=>dF,OK:()=>Rt,ParseStatus:()=>wt,Schema:()=>le,ZodAny:()=>Jn,ZodArray:()=>Qr,ZodBigInt:()=>Go,ZodBoolean:()=>Wo,ZodBranded:()=>vu,ZodCatch:()=>ni,ZodDate:()=>Zo,ZodDefault:()=>ri,ZodDiscriminatedUnion:()=>Of,ZodEffects:()=>Ba,ZodEnum:()=>ti,ZodError:()=>Qt,ZodFirstPartyTypeKind:()=>J,ZodFunction:()=>Ff,ZodIntersection:()=>Qo,ZodIssueCode:()=>B,ZodLazy:()=>Jo,ZodLiteral:()=>ei,ZodMap:()=>Is,ZodNaN:()=>ks,ZodNativeEnum:()=>ai,ZodNever:()=>Qa,ZodNull:()=>Yo,ZodNullable:()=>hr,ZodNumber:()=>jo,ZodObject:()=>Jt,ZodOptional:()=>Da,ZodParsedType:()=>V,ZodPipeline:()=>yu,ZodPromise:()=>eo,ZodReadonly:()=>oi,ZodRecord:()=>Bf,ZodSchema:()=>le,ZodSet:()=>As,ZodString:()=>Qn,ZodSymbol:()=>ws,ZodTransformer:()=>Ba,ZodTuple:()=>pr,ZodType:()=>le,ZodUndefined:()=>Xo,ZodUnion:()=>Ko,ZodUnknown:()=>Kr,ZodVoid:()=>Ls,addIssueToContext:()=>H,any:()=>FB,array:()=>UB,bigint:()=>RB,boolean:()=>d1,coerce:()=>cF,custom:()=>l1,date:()=>MB,datetimeRegex:()=>i1,defaultErrorMap:()=>Xr,discriminatedUnion:()=>$B,effect:()=>aF,enum:()=>JB,function:()=>YB,getErrorMap:()=>Ss,getParsedType:()=>fr,instanceof:()=>EB,intersection:()=>jB,isAborted:()=>Mf,isAsync:()=>Cs,isDirty:()=>Df,isValid:()=>Kn,late:()=>kB,lazy:()=>KB,literal:()=>QB,makeIssue:()=>gu,map:()=>ZB,nan:()=>TB,nativeEnum:()=>eF,never:()=>PB,null:()=>BB,nullable:()=>nF,number:()=>c1,object:()=>qB,objectUtil:()=>Ov,oboolean:()=>uF,onumber:()=>lF,optional:()=>rF,ostring:()=>sF,pipeline:()=>iF,preprocess:()=>oF,promise:()=>tF,quotelessJson:()=>aB,record:()=>WB,set:()=>XB,setErrorMap:()=>nB,strictObject:()=>zB,string:()=>u1,symbol:()=>DB,transformer:()=>aF,tuple:()=>GB,undefined:()=>OB,union:()=>VB,unknown:()=>NB,util:()=>de,void:()=>HB});var de;(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function a(n){throw new Error}t.assertNever=a,t.arrayToEnum=n=>{let o={};for(let i of n)o[i]=i;return o},t.getValidEnumValues=n=>{let o=t.objectKeys(n).filter(s=>typeof n[n[s]]!="number"),i={};for(let s of o)i[s]=n[s];return t.objectValues(i)},t.objectValues=n=>t.objectKeys(n).map(function(o){return n[o]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&o.push(i);return o},t.find=(n,o)=>{for(let i of n)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,o=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(de||(de={}));var Ov;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ov||(Ov={}));var V=de.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fr=t=>{switch(typeof t){case"undefined":return V.undefined;case"string":return V.string;case"number":return Number.isNaN(t)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(t)?V.array:t===null?V.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?V.promise:typeof Map<"u"&&t instanceof Map?V.map:typeof Set<"u"&&t instanceof Set?V.set:typeof Date<"u"&&t instanceof Date?V.date:V.object;default:return V.unknown}};var B=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"]),aB=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Qt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){let a=e||function(o){return o.message},r={_errors:[]},n=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let s=r,l=0;for(;l<i.path.length;){let u=i.path[l];l===i.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(a(i))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return n(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,de.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){let a={},r=[];for(let n of this.issues)if(n.path.length>0){let o=n.path[0];a[o]=a[o]||[],a[o].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}};Qt.create=t=>new Qt(t);var rB=(t,e)=>{let a;switch(t.code){case B.invalid_type:t.received===V.undefined?a="Required":a=`Expected ${t.expected}, received ${t.received}`;break;case B.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,de.jsonStringifyReplacer)}`;break;case B.unrecognized_keys:a=`Unrecognized key(s) in object: ${de.joinValues(t.keys,", ")}`;break;case B.invalid_union:a="Invalid input";break;case B.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${de.joinValues(t.options)}`;break;case B.invalid_enum_value:a=`Invalid enum value. Expected ${de.joinValues(t.options)}, received '${t.received}'`;break;case B.invalid_arguments:a="Invalid function arguments";break;case B.invalid_return_type:a="Invalid function return type";break;case B.invalid_date:a="Invalid date";break;case B.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 B.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 B.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 B.custom:a="Invalid input";break;case B.invalid_intersection_types:a="Intersection results could not be merged";break;case B.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case B.not_finite:a="Number must be finite";break;default:a=e.defaultError,de.assertNever(t)}return{message:a}},Xr=rB;var t1=Xr;function nB(t){t1=t}function Ss(){return t1}var gu=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}},oB=[];function H(t,e){let a=Ss(),r=gu({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===Xr?void 0:Xr].filter(n=>!!n)});t.common.issues.push(r)}var wt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,a){let r=[];for(let n of a){if(n.status==="aborted")return K;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 K;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}}},K=Object.freeze({status:"aborted"}),$o=t=>({status:"dirty",value:t}),Rt=t=>({status:"valid",value:t}),Mf=t=>t.status==="aborted",Df=t=>t.status==="dirty",Kn=t=>t.status==="valid",Cs=t=>typeof Promise<"u"&&t instanceof Promise;var G;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(G||(G={}));var Oa=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}},a1=(t,e)=>{if(Kn(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let a=new Qt(t.common.issues);return this._error=a,this._error}}};function se(t){if(!t)return{};let{errorMap:e,invalid_type_error:a,required_error:r,description:n}=t;if(e&&(a||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,s)=>{let{message:l}=t;return i.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:l??a??s.defaultError}},description:n}}var le=class{get description(){return this._def.description}_getType(e){return fr(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:fr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wt,ctx:{common:e.parent.common,data:e.data,parsedType:fr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let a=this._parse(e);if(Cs(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:fr(e)},n=this._parseSync({data:e,path:r.path,parent:r});return a1(r,n)}"~validate"(e){let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fr(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:a});return Kn(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=>Kn(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:fr(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(Cs(n)?n:Promise.resolve(n));return a1(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:B.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 Ba({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 Da.create(this,this._def)}nullable(){return hr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qr.create(this)}promise(){return eo.create(this,this._def)}or(e){return Ko.create([this,e],this._def)}and(e){return Qo.create(this,e,this._def)}transform(e){return new Ba({...se(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let a=typeof e=="function"?e:()=>e;return new ri({...se(this._def),innerType:this,defaultValue:a,typeName:J.ZodDefault})}brand(){return new vu({typeName:J.ZodBranded,type:this,...se(this._def)})}catch(e){let a=typeof e=="function"?e:()=>e;return new ni({...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 yu.create(this,e)}readonly(){return oi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},iB=/^c[^\s-]{8,}$/i,sB=/^[0-9a-z]+$/,lB=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uB=/^[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,cB=/^[a-z0-9_-]{21}$/i,dB=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fB=/^[-+]?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)?)??$/,pB=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Bv,mB=/^(?:(?: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])$/,gB=/^(?:(?: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])$/,vB=/^(([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]))$/,yB=/^(([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])$/,xB=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bB=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,n1="((\\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])))",SB=new RegExp(`^${n1}$`);function o1(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 CB(t){return new RegExp(`^${o1(t)}$`)}function i1(t){let e=`${n1}T${o1(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 _B(t,e){return!!((e==="v4"||!e)&&mB.test(t)||(e==="v6"||!e)&&vB.test(t))}function wB(t,e){if(!dB.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 LB(t,e){return!!((e==="v4"||!e)&&gB.test(t)||(e==="v6"||!e)&&yB.test(t))}var Qn=class t extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){let o=this._getOrReturnCtx(e);return H(o,{code:B.invalid_type,expected:V.string,received:o.parsedType}),K}let r=new wt,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:B.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),H(n,{code:B.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?H(n,{code:B.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&H(n,{code:B.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")pB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"email",code:B.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Bv||(Bv=new RegExp(hB,"u")),Bv.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"emoji",code:B.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")uB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"uuid",code:B.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")cB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"nanoid",code:B.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")iB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid",code:B.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")sB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid2",code:B.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")lB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ulid",code:B.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),H(n,{validation:"url",code:B.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),H(n,{validation:"regex",code:B.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),H(n,{code:B.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),H(n,{code:B.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),H(n,{code:B.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?i1(o).test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:B.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?SB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:B.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?CB(o).test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:B.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?fB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"duration",code:B.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?_B(e.data,o.version)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ip",code:B.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?wB(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"jwt",code:B.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?LB(e.data,o.version)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cidr",code:B.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?xB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"base64",code:B.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?bB.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"base64url",code:B.invalid_string,message:o.message}),r.dirty()):de.assertNever(o);return{status:r.value,value:e.data}}_regex(e,a,r){return this.refinement(n=>e.test(n),{validation:a,code:B.invalid_string,...G.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...G.errToObj(e)})}url(e){return this._addCheck({kind:"url",...G.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...G.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...G.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...G.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...G.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...G.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...G.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...G.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...G.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...G.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...G.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...G.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,...G.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,...G.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...G.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...G.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a?.position,...G.errToObj(a?.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...G.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...G.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...G.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...G.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...G.errToObj(a)})}nonempty(e){return this.min(1,G.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}};Qn.create=t=>new Qn({checks:[],typeName:J.ZodString,coerce:t?.coerce??!1,...se(t)});function IB(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 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)!==V.number){let o=this._getOrReturnCtx(e);return H(o,{code:B.invalid_type,expected:V.number,received:o.parsedType}),K}let r,n=new wt;for(let o of this._def.checks)o.kind==="int"?de.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:B.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),H(r,{code:B.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),H(r,{code:B.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?IB(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),H(r,{code:B.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:B.not_finite,message:o.message}),n.dirty()):de.assertNever(o);return{status:n.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,G.toString(a))}gt(e,a){return this.setLimit("min",e,!1,G.toString(a))}lte(e,a){return this.setLimit("max",e,!0,G.toString(a))}lt(e,a){return this.setLimit("max",e,!1,G.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:G.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:G.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:G.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:G.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:G.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:G.toString(e)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&de.isInteger(e.value))}get isFinite(){let e=null,a=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(a===null||r.value>a)&&(a=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(a)&&Number.isFinite(e)}};jo.create=t=>new jo({checks:[],typeName:J.ZodNumber,coerce:t?.coerce||!1,...se(t)});var Go=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==V.bigint)return this._getInvalidInput(e);let r,n=new wt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:B.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),H(r,{code:B.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),H(r,{code:B.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):de.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let a=this._getOrReturnCtx(e);return H(a,{code:B.invalid_type,expected:V.bigint,received:a.parsedType}),K}gte(e,a){return this.setLimit("min",e,!0,G.toString(a))}gt(e,a){return this.setLimit("min",e,!1,G.toString(a))}lte(e,a){return this.setLimit("max",e,!0,G.toString(a))}lt(e,a){return this.setLimit("max",e,!1,G.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:G.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:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:G.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:G.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}};Go.create=t=>new Go({checks:[],typeName:J.ZodBigInt,coerce:t?.coerce??!1,...se(t)});var Wo=class extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let r=this._getOrReturnCtx(e);return H(r,{code:B.invalid_type,expected:V.boolean,received:r.parsedType}),K}return Rt(e.data)}};Wo.create=t=>new Wo({typeName:J.ZodBoolean,coerce:t?.coerce||!1,...se(t)});var Zo=class t extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){let o=this._getOrReturnCtx(e);return H(o,{code:B.invalid_type,expected:V.date,received:o.parsedType}),K}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return H(o,{code:B.invalid_date}),K}let r=new wt,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:B.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),H(n,{code:B.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):de.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,a){return this._addCheck({kind:"min",value:e.getTime(),message:G.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:G.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}};Zo.create=t=>new Zo({checks:[],coerce:t?.coerce||!1,typeName:J.ZodDate,...se(t)});var ws=class extends le{_parse(e){if(this._getType(e)!==V.symbol){let r=this._getOrReturnCtx(e);return H(r,{code:B.invalid_type,expected:V.symbol,received:r.parsedType}),K}return Rt(e.data)}};ws.create=t=>new ws({typeName:J.ZodSymbol,...se(t)});var Xo=class extends le{_parse(e){if(this._getType(e)!==V.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:B.invalid_type,expected:V.undefined,received:r.parsedType}),K}return Rt(e.data)}};Xo.create=t=>new Xo({typeName:J.ZodUndefined,...se(t)});var Yo=class extends le{_parse(e){if(this._getType(e)!==V.null){let r=this._getOrReturnCtx(e);return H(r,{code:B.invalid_type,expected:V.null,received:r.parsedType}),K}return Rt(e.data)}};Yo.create=t=>new Yo({typeName:J.ZodNull,...se(t)});var Jn=class extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return Rt(e.data)}};Jn.create=t=>new Jn({typeName:J.ZodAny,...se(t)});var Kr=class extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Rt(e.data)}};Kr.create=t=>new Kr({typeName:J.ZodUnknown,...se(t)});var Qa=class extends le{_parse(e){let a=this._getOrReturnCtx(e);return H(a,{code:B.invalid_type,expected:V.never,received:a.parsedType}),K}};Qa.create=t=>new Qa({typeName:J.ZodNever,...se(t)});var Ls=class extends le{_parse(e){if(this._getType(e)!==V.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:B.invalid_type,expected:V.void,received:r.parsedType}),K}return Rt(e.data)}};Ls.create=t=>new Ls({typeName:J.ZodVoid,...se(t)});var Qr=class t extends le{_parse(e){let{ctx:a,status:r}=this._processInputParams(e),n=this._def;if(a.parsedType!==V.array)return H(a,{code:B.invalid_type,expected:V.array,received:a.parsedType}),K;if(n.exactLength!==null){let i=a.data.length>n.exactLength.value,s=a.data.length<n.exactLength.value;(i||s)&&(H(a,{code:i?B.too_big:B.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&&(H(a,{code:B.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&&(H(a,{code:B.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 Oa(a,i,a.path,s)))).then(i=>wt.mergeArray(r,i));let o=[...a.data].map((i,s)=>n.type._parseSync(new Oa(a,i,a.path,s)));return wt.mergeArray(r,o)}get element(){return this._def.type}min(e,a){return new t({...this._def,minLength:{value:e,message:G.toString(a)}})}max(e,a){return new t({...this._def,maxLength:{value:e,message:G.toString(a)}})}length(e,a){return new t({...this._def,exactLength:{value:e,message:G.toString(a)}})}nonempty(e){return this.min(1,e)}};Qr.create=(t,e)=>new Qr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...se(e)});function _s(t){if(t instanceof Jt){let e={};for(let a in t.shape){let r=t.shape[a];e[a]=Da.create(_s(r))}return new Jt({...t._def,shape:()=>e})}else return t instanceof Qr?new Qr({...t._def,type:_s(t.element)}):t instanceof Da?Da.create(_s(t.unwrap())):t instanceof hr?hr.create(_s(t.unwrap())):t instanceof pr?pr.create(t.items.map(e=>_s(e))):t}var Jt=class t extends le{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),a=de.objectKeys(e);return this._cached={shape:e,keys:a},this._cached}_parse(e){if(this._getType(e)!==V.object){let u=this._getOrReturnCtx(e);return H(u,{code:B.invalid_type,expected:V.object,received:u.parsedType}),K}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof Qa&&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 Oa(n,d,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof Qa){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&&(H(n,{code:B.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 Oa(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,h=await c.value;u.push({key:d,value:h,alwaysSet:c.alwaysSet})}return u}).then(u=>wt.mergeObjectSync(r,u)):wt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return G.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:G.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:J.ZodObject})}setKey(e,a){return this.augment({[e]:a})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let a={};for(let r of de.objectKeys(e))e[r]&&this.shape[r]&&(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}omit(e){let a={};for(let r of de.objectKeys(this.shape))e[r]||(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}deepPartial(){return _s(this)}partial(e){let a={};for(let r of de.objectKeys(this.shape)){let n=this.shape[r];e&&!e[r]?a[r]=n:a[r]=n.optional()}return new t({...this._def,shape:()=>a})}required(e){let a={};for(let r of de.objectKeys(this.shape))if(e&&!e[r])a[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Da;)o=o._def.innerType;a[r]=o}return new t({...this._def,shape:()=>a})}keyof(){return s1(de.objectKeys(this.shape))}};Jt.create=(t,e)=>new Jt({shape:()=>t,unknownKeys:"strip",catchall:Qa.create(),typeName:J.ZodObject,...se(e)});Jt.strictCreate=(t,e)=>new Jt({shape:()=>t,unknownKeys:"strict",catchall:Qa.create(),typeName:J.ZodObject,...se(e)});Jt.lazycreate=(t,e)=>new Jt({shape:t,unknownKeys:"strip",catchall:Qa.create(),typeName:J.ZodObject,...se(e)});var Ko=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),r=this._def.options;function n(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return a.common.issues.push(...s.ctx.common.issues),s.result;let i=o.map(s=>new Qt(s.ctx.common.issues));return H(a,{code:B.invalid_union,unionErrors:i}),K}if(a.common.async)return Promise.all(r.map(async o=>{let i={...a,common:{...a.common,issues:[]},parent:null};return{result:await o._parseAsync({data:a.data,path:a.path,parent:i}),ctx:i}})).then(n);{let o,i=[];for(let l of r){let u={...a,common:{...a.common,issues:[]},parent:null},c=l._parseSync({data:a.data,path:a.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return a.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map(l=>new Qt(l));return H(a,{code:B.invalid_union,unionErrors:s}),K}}get options(){return this._def.options}};Ko.create=(t,e)=>new Ko({options:t,typeName:J.ZodUnion,...se(e)});var Yr=t=>t instanceof Jo?Yr(t.schema):t instanceof Ba?Yr(t.innerType()):t instanceof ei?[t.value]:t instanceof ti?t.options:t instanceof ai?de.objectValues(t.enum):t instanceof ri?Yr(t._def.innerType):t instanceof Xo?[void 0]:t instanceof Yo?[null]:t instanceof Da?[void 0,...Yr(t.unwrap())]:t instanceof hr?[null,...Yr(t.unwrap())]:t instanceof vu||t instanceof oi?Yr(t.unwrap()):t instanceof ni?Yr(t._def.innerType):[],Of=class t extends le{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.object)return H(a,{code:B.invalid_type,expected:V.object,received:a.parsedType}),K;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}):(H(a,{code:B.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),K)}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=Yr(o.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of i){if(n.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,o)}}return new t({typeName:J.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:n,...se(r)})}};function Fv(t,e){let a=fr(t),r=fr(e);if(t===e)return{valid:!0,data:t};if(a===V.object&&r===V.object){let n=de.objectKeys(e),o=de.objectKeys(t).filter(s=>n.indexOf(s)!==-1),i={...t,...e};for(let s of o){let l=Fv(t[s],e[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(a===V.array&&r===V.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let o=0;o<t.length;o++){let i=t[o],s=e[o],l=Fv(i,s);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return a===V.date&&r===V.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Qo=class extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(Mf(o)||Mf(i))return K;let s=Fv(o.value,i.value);return s.valid?((Df(o)||Df(i))&&a.dirty(),{status:a.value,value:s.data}):(H(r,{code:B.invalid_intersection_types}),K)};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}))}};Qo.create=(t,e,a)=>new Qo({left:t,right:e,typeName:J.ZodIntersection,...se(a)});var pr=class t extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.array)return H(r,{code:B.invalid_type,expected:V.array,received:r.parsedType}),K;if(r.data.length<this._def.items.length)return H(r,{code:B.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),K;!this._def.rest&&r.data.length>this._def.items.length&&(H(r,{code:B.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 Oa(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>wt.mergeArray(a,i)):wt.mergeArray(a,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};pr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pr({items:t,typeName:J.ZodTuple,rest:null,...se(e)})};var Bf=class t extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.object)return H(r,{code:B.invalid_type,expected:V.object,received:r.parsedType}),K;let n=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)n.push({key:o._parse(new Oa(r,s,r.path,s)),value:i._parse(new Oa(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?wt.mergeObjectAsync(a,n):wt.mergeObjectSync(a,n)}get element(){return this._def.valueType}static create(e,a,r){return a instanceof le?new t({keyType:e,valueType:a,typeName:J.ZodRecord,...se(r)}):new t({keyType:Qn.create(),valueType:e,typeName:J.ZodRecord,...se(a)})}},Is=class extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.map)return H(r,{code:B.invalid_type,expected:V.map,received:r.parsedType}),K;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,l],u)=>({key:n._parse(new Oa(r,s,r.path,[u,"key"])),value:o._parse(new Oa(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 K;(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 K;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}}}};Is.create=(t,e,a)=>new Is({valueType:e,keyType:t,typeName:J.ZodMap,...se(a)});var As=class t extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.set)return H(r,{code:B.invalid_type,expected:V.set,received:r.parsedType}),K;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(H(r,{code:B.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&&(H(r,{code:B.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 K;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 Oa(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:G.toString(a)}})}max(e,a){return new t({...this._def,maxSize:{value:e,message:G.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}};As.create=(t,e)=>new As({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...se(e)});var Ff=class t extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.function)return H(a,{code:B.invalid_type,expected:V.function,received:a.parsedType}),K;function r(s,l){return gu({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Ss(),Xr].filter(u=>!!u),issueData:{code:B.invalid_arguments,argumentsError:l}})}function n(s,l){return gu({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Ss(),Xr].filter(u=>!!u),issueData:{code:B.invalid_return_type,returnTypeError:l}})}let o={errorMap:a.common.contextualErrorMap},i=a.data;if(this._def.returns instanceof eo){let s=this;return Rt(async function(...l){let u=new Qt([]),c=await s._def.args.parseAsync(l,o).catch(g=>{throw u.addIssue(r(l,g)),u}),d=await Reflect.apply(i,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(g=>{throw u.addIssue(n(d,g)),u})})}else{let s=this;return Rt(function(...l){let u=s._def.args.safeParse(l,o);if(!u.success)throw new Qt([r(l,u.error)]);let c=Reflect.apply(i,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new Qt([n(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:pr.create(e).rest(Kr.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||pr.create([]).rest(Kr.create()),returns:a||Kr.create(),typeName:J.ZodFunction,...se(r)})}},Jo=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})}};Jo.create=(t,e)=>new Jo({getter:t,typeName:J.ZodLazy,...se(e)});var ei=class extends le{_parse(e){if(e.data!==this._def.value){let a=this._getOrReturnCtx(e);return H(a,{received:a.data,code:B.invalid_literal,expected:this._def.value}),K}return{status:"valid",value:e.data}}get value(){return this._def.value}};ei.create=(t,e)=>new ei({value:t,typeName:J.ZodLiteral,...se(e)});function s1(t,e){return new ti({values:t,typeName:J.ZodEnum,...se(e)})}var ti=class t extends le{_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),r=this._def.values;return H(a,{expected:de.joinValues(r),received:a.parsedType,code:B.invalid_type}),K}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 H(a,{received:a.data,code:B.invalid_enum_value,options:r}),K}return Rt(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})}};ti.create=s1;var ai=class extends le{_parse(e){let a=de.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==V.string&&r.parsedType!==V.number){let n=de.objectValues(a);return H(r,{expected:de.joinValues(n),received:r.parsedType,code:B.invalid_type}),K}if(this._cache||(this._cache=new Set(de.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=de.objectValues(a);return H(r,{received:r.data,code:B.invalid_enum_value,options:n}),K}return Rt(e.data)}get enum(){return this._def.values}};ai.create=(t,e)=>new ai({values:t,typeName:J.ZodNativeEnum,...se(e)});var eo=class extends le{unwrap(){return this._def.type}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.promise&&a.common.async===!1)return H(a,{code:B.invalid_type,expected:V.promise,received:a.parsedType}),K;let r=a.parsedType===V.promise?a.data:Promise.resolve(a.data);return Rt(r.then(n=>this._def.type.parseAsync(n,{path:a.path,errorMap:a.common.contextualErrorMap})))}};eo.create=(t,e)=>new eo({type:t,typeName:J.ZodPromise,...se(e)});var Ba=class extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:i=>{H(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 K;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?K:l.status==="dirty"?$o(l.value):a.value==="dirty"?$o(l.value):l});{if(a.value==="aborted")return K;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?K:s.status==="dirty"?$o(s.value):a.value==="dirty"?$o(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"?K:(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"?K:(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(!Kn(i))return K;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=>Kn(i)?Promise.resolve(n.transform(i.value,o)).then(s=>({status:a.value,value:s})):K);de.assertNever(n)}};Ba.create=(t,e,a)=>new Ba({schema:t,typeName:J.ZodEffects,effect:e,...se(a)});Ba.createWithPreprocess=(t,e,a)=>new Ba({schema:e,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...se(a)});var Da=class extends le{_parse(e){return this._getType(e)===V.undefined?Rt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Da.create=(t,e)=>new Da({innerType:t,typeName:J.ZodOptional,...se(e)});var hr=class extends le{_parse(e){return this._getType(e)===V.null?Rt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};hr.create=(t,e)=>new hr({innerType:t,typeName:J.ZodNullable,...se(e)});var ri=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return a.parsedType===V.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:a.path,parent:a})}removeDefault(){return this._def.innerType}};ri.create=(t,e)=>new ri({innerType:t,typeName:J.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...se(e)});var ni=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 Cs(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};ni.create=(t,e)=>new ni({innerType:t,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...se(e)});var ks=class extends le{_parse(e){if(this._getType(e)!==V.nan){let r=this._getOrReturnCtx(e);return H(r,{code:B.invalid_type,expected:V.nan,received:r.parsedType}),K}return{status:"valid",value:e.data}}};ks.create=t=>new ks({typeName:J.ZodNaN,...se(t)});var AB=Symbol("zod_brand"),vu=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"?K:o.status==="dirty"?(a.dirty(),$o(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"?K:n.status==="dirty"?(a.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,a){return new t({in:e,out:a,typeName:J.ZodPipeline})}},oi=class extends le{_parse(e){let a=this._def.innerType._parse(e),r=n=>(Kn(n)&&(n.value=Object.freeze(n.value)),n);return Cs(a)?a.then(n=>r(n)):r(a)}unwrap(){return this._def.innerType}};oi.create=(t,e)=>new oi({innerType:t,typeName:J.ZodReadonly,...se(e)});function r1(t,e){let a=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof a=="string"?{message:a}:a}function l1(t,e={},a){return t?Jn.create().superRefine((r,n)=>{let o=t(r);if(o instanceof Promise)return o.then(i=>{if(!i){let s=r1(e,r),l=s.fatal??a??!0;n.addIssue({code:"custom",...s,fatal:l})}});if(!o){let i=r1(e,r),s=i.fatal??a??!0;n.addIssue({code:"custom",...i,fatal:s})}}):Jn.create()}var kB={object:Jt.lazycreate},J;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(J||(J={}));var EB=(t,e={message:`Input not instance of ${t.name}`})=>l1(a=>a instanceof t,e),u1=Qn.create,c1=jo.create,TB=ks.create,RB=Go.create,d1=Wo.create,MB=Zo.create,DB=ws.create,OB=Xo.create,BB=Yo.create,FB=Jn.create,NB=Kr.create,PB=Qa.create,HB=Ls.create,UB=Qr.create,qB=Jt.create,zB=Jt.strictCreate,VB=Ko.create,$B=Of.create,jB=Qo.create,GB=pr.create,WB=Bf.create,ZB=Is.create,XB=As.create,YB=Ff.create,KB=Jo.create,QB=ei.create,JB=ti.create,eF=ai.create,tF=eo.create,aF=Ba.create,rF=Da.create,nF=hr.create,oF=Ba.createWithPreprocess,iF=yu.create,sF=()=>u1().optional(),lF=()=>c1().optional(),uF=()=>d1().optional(),cF={string:(t=>Qn.create({...t,coerce:!0})),number:(t=>jo.create({...t,coerce:!0})),boolean:(t=>Wo.create({...t,coerce:!0})),bigint:(t=>Go.create({...t,coerce:!0})),date:(t=>Zo.create({...t,coerce:!0}))};var dF=K;var f1=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()})]),fF=p.object({kind:p.literal("tooltip"),id:p.string(),anchor:f1,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()}),pF=p.object({kind:p.literal("highlight"),id:p.string(),anchor:f1,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()}),Nv=p.object({id:p.string(),version:p.number(),routes:p.array(p.string()).optional(),steps:p.array(p.union([fF,pF]))});function H5(t){return Nv.parse(t)}var V5=({configUri:t,experiments:e,featureKey:a="smart-canvas-overlay-uri",credentials:r="include"}={})=>async()=>{let n=Vg({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 Nv.parse(i)};var Nf=Y(Ge(),1),p1=Y(Vs(),1);function j5({element:t,children:e}){let[a,r]=(0,Nf.useState)(null);return(0,Nf.useLayoutEffect)(()=>{if(!t){r(null);return}return r(t.getMountNode()),()=>r(null)},[t]),a?(0,p1.createPortal)(e,a):null}function hF(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let a=0;a<16;a++)e+=t[Math.floor(Math.random()*t.length)];return e}var Pv=class{constructor(){$(this,"sessionId");this.sessionId=hF(),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 Hv(){return new Pv}var T=typeof window<"u"?window:void 0,It=typeof globalThis<"u"?globalThis:T;typeof self>"u"&&(It.self=It),typeof File>"u"&&(It.File=function(){});var uA=Array.prototype,h1=uA.forEach,m1=uA.indexOf,va=It?.navigator,q=It?.document,ta=It?.location,ty=It?.fetch,ay=It!=null&&It.XMLHttpRequest&&"withCredentials"in new It.XMLHttpRequest?It.XMLHttpRequest:void 0,g1=It?.AbortController,ea=va?.userAgent,te=T??{},en={DEBUG:!1,LIB_VERSION:"1.302.2"};function v1(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 y1(t){return function(){var e=this,a=arguments;return new Promise((function(r,n){var o=t.apply(e,a);function i(l){v1(o,r,n,i,s,"next",l)}function s(l){v1(o,r,n,i,s,"throw",l)}i(void 0)}))}}function j(){return j=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},j.apply(null,arguments)}function cA(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 mF=["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"],x1=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var a=t.toLowerCase();return mF.concat(e).some((r=>{var n=r.toLowerCase();return a.indexOf(n)!==-1}))},gF=["$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 mp=function(t){return t.trim()},ry=function(t){return t.replace(/^\$/,"")},vF=Array.isArray,dA=Object.prototype,fA=dA.hasOwnProperty,gp=dA.toString,Ee=vF||function(t){return gp.call(t)==="[object Array]"},io=t=>typeof t=="function",mt=t=>t===Object(t)&&!Ee(t),Ms=t=>{if(mt(t)){for(var e in t)if(fA.call(t,e))return!1;return!0}return!1},U=t=>t===void 0,ut=t=>gp.call(t)=="[object String]",ny=t=>ut(t)&&t.trim().length===0,nn=t=>t===null,Le=t=>U(t)||nn(t),yr=t=>gp.call(t)=="[object Number]",so=t=>gp.call(t)==="[object Boolean]",yF=t=>t instanceof FormData,xF=t=>fe(gF,t);function oy(t){return t===null||typeof t!="object"}function Zf(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function pA(t){return!U(Event)&&(function(e,a){try{return e instanceof a}catch{return!1}})(t,Event)}var bF=[!0,"true",1,"1","yes"],Uv=t=>fe(bF,t),SF=[!1,"false",0,"0","no"];function mr(t,e,a,r,n){return e>a&&(r.warn("min cannot be greater than max."),e=a),yr(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),mr(n||a,e,a,r))}var iy=class{constructor(e){this.t={},this.i=e.i,this.o=mr(e.bucketSize,0,100,e.h),this.m=mr(e.refillRate,0,this.o,e.h),this.S=mr(e.refillInterval,0,864e5,e.h)}$(e,a){var r=a-e.lastAccess,n=Math.floor(r/this.S);if(n>0){var o=n*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+n*this.S}}consumeRateLimit(e){var a,r=Date.now(),n=String(e),o=this.t[n];return o?this.$(o,r):(o={tokens:this.o,lastAccess:r},this.t[n]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((a=this.i)==null||a.call(this,e)),o.tokens===0)}stop(){this.t={}}},Pf,b1,qv,CF=t=>t instanceof Error;function _F(t){var e=globalThis._posthogChunkIds;if(e){var a=Object.keys(e);return qv&&a.length===b1||(b1=a.length,qv=a.reduce(((r,n)=>{Pf||(Pf={});var o=Pf[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,Pf[n]=[u,c];break}}return r}),{})),qv}}var sy=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 y1((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&Ee(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)),j({},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 y1((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,j({},a,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:_F(this.stackParser)}}buildCoercingContext(e,a,r){r===void 0&&(r=0);var n=(o,i)=>{if(i<=4){var s=this.buildCoercingContext(e,a,i);return this.applyCoercers(o,s)}};return j({},a,{syntheticException:r==0?a.syntheticException:void 0,mechanism:e,apply:o=>n(o,r),next:o=>n(o,r+1)})}},Fs="?";function ly(t,e,a,r,n){var o={platform:t,filename:e,function:a==="<anonymous>"?Fs:a,in_app:!0};return U(r)||(o.lineno=r),U(n)||(o.colno=n),o}var hA=(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]:Fs,a?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},wF=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,LF=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,IF=/\((\S*)(?::(\d+))(?::(\d+))\)/,AF=(t,e)=>{var a=wF.exec(t);if(a){var[,r,n,o]=a;return ly(e,r,Fs,+n,+o)}var i=LF.exec(t);if(i){if(i[2]&&i[2].indexOf("eval")===0){var s=IF.exec(i[2]);s&&(i[2]=s[1],i[3]=s[2],i[4]=s[3])}var[l,u]=hA(i[1]||Fs,i[2]);return ly(e,u,l,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},kF=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,EF=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,TF=(t,e)=>{var a=kF.exec(t);if(a){if(a[3]&&a[3].indexOf(" > eval")>-1){var r=EF.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]||Fs;return[o,n]=hA(o,n),ly(e,n,o,a[4]?+a[4]:void 0,a[5]?+a[5]:void 0)}},S1=/\(error: (.*)\)/,C1=50;function RF(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return function(n,o){o===void 0&&(o=0);for(var i=[],s=n.split(`
|
|
460
|
+
`),l=o;l<s.length;l++){var u=s[l];if(!(u.length>1024)){var c=S1.test(u)?u.replace(S1,"$1"):u;if(!c.match(/\S*Error: /)){for(var d of a){var h=d(c,t);if(h){i.push(h);break}}if(i.length>=C1)break}}}return(function(g){if(!g.length)return[];var S=Array.from(g);return S.reverse(),S.slice(0,C1).map((b=>{return j({},b,{filename:b.filename||(x=S,x[x.length-1]||{}).filename,function:b.function||Fs});var x}))})(i)}}var uy=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,a){var r=ut(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?a.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var a=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?a+": "+e.message:a}isDOMException(e){return Zf(e,"DOMException")}isDOMError(e){return Zf(e,"DOMError")}},cy=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}},dy=class{constructor(){}match(e){return Zf(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}}},MF=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,fy=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(MF);return n&&(a=n[1],r=n[2]),[a,r]}},DF=["fatal","error","warning","log","info","debug"];function mA(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 py=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 pA(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: "+mA(e)}isSeverityLevel(e){return ut(e)&&!ny(e)&&DF.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var r=e[a];if(CF(r))return r}}getObjectClassName(e){try{var a=Object.getPrototypeOf(e);return a?a.constructor.name:void 0}catch{return}}},hy=class{match(e){return pA(e)}coerce(e,a){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+mA(e),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},my=class{match(e){return oy(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}}},gy=class{match(e){return Zf(e,"PromiseRejectionEvent")}coerce(e,a){var r,n=this.getUnhandledRejectionReason(e);return oy(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(oy(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}},gA=function(t,e){var{debugEnabled:a}=e===void 0?{}:e,r={k:function(n){if(T&&(en.DEBUG||te.POSTHOG_DEBUG||a)&&!U(T.console)&&T.console){for(var o=("__rrweb_original__"in T.console[n])?T.console[n].__rrweb_original__:T.console[n],i=arguments.length,s=new Array(i>1?i-1:0),l=1;l<i;l++)s[l-1]=arguments[l];o(t,...s)}},info:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("log",...o)},warn:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("warn",...o)},error:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("error",...o)},critical:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];console.error(t,...o)},uninitializedWarning:n=>{r.error("You must initialize PostHog before calling "+n)},createLogger:(n,o)=>gA(t+" "+n,o)};return r},z=gA("[PostHog.js]"),ct=z.createLogger,OF=ct("[ExternalScriptsLoader]"),_1=(t,e,a)=>{if(t.config.disable_external_dependency_loading)return OF.warn(e+" was requested but loading of external scripts is disabled."),a("Loading of external scripts is disabled");var r=q?.querySelectorAll("script");if(r){for(var n,o=function(){if(r[i].src===e){var l=r[i];return l.__posthog_loading_callback_fired?{v:a()}:(l.addEventListener("load",(u=>{l.__posthog_loading_callback_fired=!0,a(void 0,u)})),l.onerror=u=>a(u),{v:void 0})}},i=0;i<r.length;i++)if(n=o())return n.v}var s=()=>{if(!q)return a("document not found");var l=q.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,a(void 0,d)},l.onerror=d=>a(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return a("prepare_external_dependency_script returned null");var u,c=q.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):q.body.appendChild(l)};q!=null&&q.body?s():q?.addEventListener("DOMContentLoaded",s)};te.__PosthogExtensions__=te.__PosthogExtensions__||{},te.__PosthogExtensions__.loadExternalDependency=(t,e,a)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var n=3e5;r=r+"&t="+Math.floor(Date.now()/n)*n}var o=t.requestRouter.endpointFor("assets",r);_1(t,o,a)},te.__PosthogExtensions__.loadSiteApp=(t,e,a)=>{var r=t.requestRouter.endpointFor("api",e);_1(t,r,a)};var Xf={};function lo(t,e,a){if(Ee(t)){if(h1&&t.forEach===h1)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)===Xf)return}}}function Me(t,e,a){if(!Le(t)){if(Ee(t))return lo(t,e,a);if(yF(t)){for(var r of t.entries())if(e.call(a,r[1],r[0])===Xf)return}else for(var n in t)if(fA.call(t,n)&&e.call(a,t[n],n)===Xf)return}}var Ke=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 lo(a,(function(n){for(var o in n)n[o]!==void 0&&(t[o]=n[o])})),t},Hs=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 lo(a,(function(n){lo(n,(function(o){t.push(o)}))})),t};function jf(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 w1=function(t){try{return t()}catch{return}},BF=function(t){return function(){try{for(var e=arguments.length,a=new Array(e),r=0;r<e;r++)a[r]=arguments[r];return t.apply(this,a)}catch(n){z.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),z.critical(n)}}},dx=function(t){var e={};return Me(t,(function(a,r){(ut(a)&&a.length>0||yr(a))&&(e[r]=a)})),e};function FF(t,e){return a=t,r=o=>ut(o)&&!nn(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),Ee(i)?(l=[],lo(i,(u=>{l.push(o(u))}))):(l={},Me(i,((u,c)=>{n.has(u)||(l[c]=o(u,c))}))),l);var l})(a);var a,r,n}var NF=["herokuapp.com","vercel.app","netlify.app"];function PF(t){var e=t?.hostname;if(!ut(e))return!1;var a=e.split(".").slice(-2).join(".");for(var r of NF)if(a===r)return!1;return!0}function vA(t,e){for(var a=0;a<t.length;a++)if(e(t[a]))return t[a]}function at(t,e,a,r){var{capture:n=!1,passive:o=!0}=r??{};t?.addEventListener(e,a,{capture:n,passive:o})}var yA="$people_distinct_id",ku="__alias",Eu="__timers",L1="$autocapture_disabled_server_side",vy="$heatmaps_enabled_server_side",I1="$exception_capture_enabled_server_side",yy="$error_tracking_suppression_rules",A1="$error_tracking_capture_extension_exceptions",k1="$web_vitals_enabled_server_side",xA="$dead_clicks_enabled_server_side",E1="$web_vitals_allowed_metrics",zv="$session_recording_remote_config",Yf="$sesid",bA="$session_is_sampled",Ds="$enabled_feature_flags",Tu="$early_access_features",xy="$feature_flag_details",Ru="$stored_person_properties",li="$stored_group_properties",by="$surveys",Hf="$surveys_activated",Kf="$flag_call_reported",tn="$user_state",Sy="$client_session_props",Cy="$capture_rate_limit",_y="$initial_campaign_params",wy="$initial_referrer_info",Qf="$initial_person_info",Jf="$epp",SA="__POSTHOG_TOOLBAR__",xu="$posthog_cookieless",HF=[yA,ku,"__cmpns",Eu,"$session_recording_enabled_server_side",vy,Yf,Ds,yy,tn,Tu,xy,li,Ru,by,Kf,Sy,Cy,_y,wy,Jf,Qf];function T1(t){return t instanceof Element&&(t.id===SA||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function vp(t){return!!t&&t.nodeType===1}function uo(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function CA(t){return!!t&&t.nodeType===3}function _A(t){return!!t&&t.nodeType===11}function fx(t){return t?mp(t).split(/\s+/):[]}function R1(t){var e=T?.location.href;return!!(e&&t&&t.some((a=>e.match(a))))}function ep(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 fx(e)}function wA(t){return Le(t)?null:mp(t).split(/(\s+)/).filter((e=>Pu(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function $u(t){var e="";return Ly(t)&&!EA(t)&&t.childNodes&&t.childNodes.length&&Me(t.childNodes,(function(a){var r;CA(a)&&a.textContent&&(e+=(r=wA(a.textContent))!==null&&r!==void 0?r:"")})),mp(e)}function LA(t){return U(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var px=["a","button","form","input","select","textarea","label"];function IA(t,e){if(U(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 AA(t){var e=t.parentNode;return!(!e||!vp(e))&&e}var UF=["next","previous","prev",">","<"],M1=10,D1=[".ph-no-rageclick",".ph-no-capture"];function qF(t,e){if(!T||hx(t))return!1;var a,r,n;if(so(e)?(a=!!e&&D1,r=void 0):(a=(n=e?.css_selector_ignorelist)!==null&&n!==void 0?n:D1,r=e?.content_ignorelist),a===!1)return!1;var{targetElementList:o}=kA(t,!1);return!(function(i,s){if(i===!1||U(i))return!1;var l;if(i===!0)l=UF;else{if(!Ee(i))return!1;if(i.length>M1)return z.error("[PostHog] content_ignorelist array cannot exceed "+M1+" 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((h=>c.includes(h)||d.includes(h)))}))})(r,o.map((i=>{var s;return{safeText:$u(i).toLowerCase(),ariaLabel:((s=i.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!IA(o,a)}var hx=t=>!t||uo(t,"html")||!vp(t),kA=(t,e)=>{if(!T||hx(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var a=!1,r=[t],n=t;n.parentNode&&!uo(n,"body");)if(_A(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=AA(n);if(!o)break;if(e||px.indexOf(o.tagName.toLowerCase())>-1)a=!0;else{var i=T.getComputedStyle(o);i&&i.getPropertyValue("cursor")==="pointer"&&(a=!0)}r.push(o),n=o}return{parentIsUsefulElement:a,targetElementList:r}};function zF(t,e,a,r,n){var o,i,s,l;if(a===void 0&&(a=void 0),!T||hx(t)||(o=a)!=null&&o.url_allowlist&&!R1(a.url_allowlist)||(i=a)!=null&&i.url_ignorelist&&R1(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,r);if(!(function(S,b){var x=b?.element_allowlist;if(U(x))return!0;var f,m=function(y){if(x.some((_=>y.tagName.toLowerCase()===_)))return{v:!0}};for(var v of S)if(f=m(v))return f.v;return!1})(d,a)||!IA(d,(l=a)==null?void 0:l.css_selector_allowlist))return!1;var h=T.getComputedStyle(t);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=t.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(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&&(px.indexOf(g)>-1||t.getAttribute("contenteditable")==="true")}}function Ly(t){for(var e=t;e.parentNode&&!uo(e,"body");e=e.parentNode){var a=ep(e);if(fe(a,"ph-sensitive")||fe(a,"ph-no-capture"))return!1}if(fe(ep(t),"ph-include"))return!0;var r=t.type||"";if(ut(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!(ut(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function EA(t){return!!(uo(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||uo(t,"select")||uo(t,"textarea")||t.getAttribute("contenteditable")==="true")}var TA="(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})",VF=new RegExp("^(?:"+TA+")$"),$F=new RegExp(TA),RA="\\d{3}-?\\d{2}-?\\d{4}",jF=new RegExp("^("+RA+")$"),GF=new RegExp("("+RA+")");function Pu(t,e){return e===void 0&&(e=!0),!(Le(t)||ut(t)&&(t=mp(t),(e?VF:$F).test((t||"").replace(/[- ]/g,""))||(e?jF:GF).test(t)))}function MA(t){var e=$u(t);return Pu(e=(e+" "+DA(t)).trim())?e:""}function DA(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Me(t.childNodes,(function(a){var r;if(a&&((r=a.tagName)==null?void 0:r.toLowerCase())==="span")try{var n=$u(a);e=(e+" "+n).trim(),a.childNodes&&a.childNodes.length&&(e=(e+" "+DA(a)).trim())}catch(o){z.error("[AutoCapture]",o)}})),e}function WF(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=j({},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 jf(l).sort(((c,d)=>{var[h]=c,[g]=d;return h.localeCompare(g)})).forEach((c=>{var[d,h]=c;return u[O1(d.toString())]=O1(h.toString())})),i+=":",i+=jf(u).map((c=>{var[d,h]=c;return d+'="'+h+'"'})).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:ZF(a),attr_id:a.attr__id,nth_child:a.nth_child,nth_of_type:a.nth_of_type,attributes:{}};return jf(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 O1(t){return t.replace(/"|\\"/g,'\\"')}function ZF(t){var e=t.attr__class;return e?Ee(e)?e:fx(e):void 0}var tp=class{constructor(e){this.disabled=e===!1;var a=mt(e)?e:{};this.thresholdPx=a.threshold_px||30,this.timeoutMs=a.timeout_ms||1e3,this.clickCount=a.click_count||3,this.clicks=[]}isRageClick(e,a,r){if(this.disabled)return!1;var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(a-n.y)<this.thresholdPx&&r-n.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:a,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:a,timestamp:r}];return!1}},Vv="$copy_autocapture",rn=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var ap=t=>{var e=q?.createElement("a");return U(e)?null:(e.href=t,e)},XF=function(t,e){var a,r;e===void 0&&(e="&");var n=[];return Me(t,(function(o,i){U(o)||U(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)},rp=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(!Ee(a)||a.length<2)return"";var i=a[1];try{i=decodeURIComponent(i)}catch{z.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},ju=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 h=u[d].split("=");Ee(h)&&(e.includes(h[0])?c.push(h[0]+"="+a):c.push(u[d]))}var g=l;return s!=null&&(g+="?"+c.join("&")),o!=null&&(g+="#"+o),g},np=function(t,e){var a=t.match(new RegExp(e+"=([^&]*)"));return a?a[1]:null},B1=ct("[AutoCapture]");function $v(t,e){return e.length>t?e.slice(0,t)+"...":e}function YF(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!vp(e));return e}function KF(t,e,a,r){var n=t.tagName.toLowerCase(),o={tag_name:n};px.indexOf(n)>-1&&!a&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?o.$el_text=$v(1024,MA(t)):o.$el_text=$v(1024,$u(t)));var i=ep(t);i.length>0&&(o.classes=i.filter((function(c){return c!==""}))),Me(t.attributes,(function(c){var d;if((!EA(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!e&&Pu(c.value)&&(d=c.name,!ut(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var h=c.value;c.name==="class"&&(h=fx(h).join(" ")),o["attr__"+c.name]=$v(1024,h)}}));for(var s=1,l=1,u=t;u=YF(u);)s++,u.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function QF(t,e){for(var a,r,{e:n,maskAllElementAttributes:o,maskAllText:i,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!uo(c,"body");)_A(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,h=[],g={},S=!1,b=!1;if(Me(u,(y=>{var _=Ly(y);y.tagName.toLowerCase()==="a"&&(S=y.getAttribute("href"),S=_&&S&&Pu(S)&&S),fe(ep(y),"ph-no-capture")&&(b=!0),h.push(KF(y,o,i,s));var w=(function(C){if(!Ly(C))return{};var A={};return Me(C.attributes,(function(E){if(E.name&&E.name.indexOf("data-ph-capture-attribute")===0){var L=E.name.replace("data-ph-capture-attribute-",""),k=E.value;L&&k&&Pu(k)&&(A[L]=k)}})),A})(y);Ke(g,w)})),b)return{props:{},explicitNoCapture:b};if(i||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=MA(t):h[0].$el_text=$u(t)),S){var x,f;h[0].attr__href=S;var m=(x=ap(S))==null?void 0:x.host,v=T==null||(f=T.location)==null?void 0:f.host;m&&v&&m!==v&&(d=S)}return{props:Ke({$event_type:n.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:WF(h)},(a=h[0])!=null&&a.$el_text?{$el_text:(r=h[0])==null?void 0:r.$el_text}:{},d&&n.type==="click"?{$external_click_url:d}:{},g)}}var Iy=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new tp(e.config.rageclick),this.I=null}get F(){var e,a,r=mt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)==null?void 0:e.map((n=>new RegExp(n))),r.url_ignorelist=(a=r.url_ignorelist)==null?void 0:a.map((n=>new RegExp(n))),r}C(){if(this.isBrowserSupported()){if(T&&q){var e=r=>{r=r||T?.event;try{this.M(r)}catch(n){B1.error("Failed to capture event",n)}};if(at(q,"submit",e,{capture:!0}),at(q,"change",e,{capture:!0}),at(q,"click",e,{capture:!0}),this.F.capture_copied_text){var a=r=>{r=r||T?.event,this.M(r,Vv)};at(q,"copy",a,{capture:!0}),at(q,"cut",a,{capture:!0})}}}else B1.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({[L1]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var a,r=[];return(a=this.I)==null||a.forEach((n=>{var o=q?.querySelectorAll(n);o?.forEach((i=>{e===i&&r.push(n)}))})),r}get isEnabled(){var e,a,r=(e=this.instance.persistence)==null?void 0:e.props[L1],n=this.T;if(nn(n)&&!so(r)&&!this.instance.O())return!1;var o=(a=this.T)!==null&&a!==void 0?a:!!r;return!!this.instance.config.autocapture&&!o}M(e,a){if(a===void 0&&(a="$autocapture"),this.isEnabled){var r,n=LA(e);CA(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())&&qF(n,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=a===Vv;if(n&&zF(n,e,this.F,o,o?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:s}=QF(n,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.F.element_attribute_ignorelist,elementsChainAsString:this.R});if(s)return!1;var l=this.getElementSelectors(n);if(l&&l.length>0&&(i.$element_selectors=l),a===Vv){var u,c=wA(T==null||(u=T.getSelection())==null?void 0:u.toString()),d=e.type||"clipboard";if(!c)return!1;i.$selected_content=c,i.$copy_type=d}return this.instance.capture(a,i),!0}}}isBrowserSupported(){return io(q?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return yr(t)&&isFinite(t)&&Math.floor(t)===t});var F1="0123456789abcdef",Ay=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+F1.charAt(this.bytes[a]>>>4)+F1.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}},ky=class{constructor(){this.A=0,this.D=0,this.j=new Ey}generate(){var e=this.generateOrAbort();if(U(e)){this.A=0;var a=this.generateOrAbort();if(U(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 Ay.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())}},N1,OA=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};T&&!U(T.crypto)&&crypto.getRandomValues&&(OA=t=>crypto.getRandomValues(t));var Ey=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(OA(this.N),this.U=0),this.N[this.U++]}},oo=()=>JF().toString(),JF=()=>(N1||(N1=new ky)).generate(),bu="",eN=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function tN(t,e){if(e){var a=(function(n,o){if(o===void 0&&(o=q),bu)return bu;if(!o||["localhost","127.0.0.1"].includes(n))return"";for(var i=n.split("."),s=Math.min(i.length,8),l="dmn_chk_"+oo();!bu&&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",bu=u)}return bu})(t);if(!a){var r=(n=>{var o=n.match(eN);return o?o[0]:""})(t);r!==a&&z.info("Warning: cookie subdomain discovery mismatch",r,a),a=r}return a?"; domain=."+a:""}return""}var vr={H:()=>!!q,B:function(t){z.error("cookieStore error: "+t)},q:function(t){if(q){try{for(var e=t+"=",a=q.cookie.split(";").filter((o=>o.length)),r=0;r<a.length;r++){for(var n=a[r];n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return decodeURIComponent(n.substring(e.length,n.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(vr.q(t))||{}}catch{}return e},G:function(t,e,a,r,n){if(q)try{var o="",i="",s=tN(q.location.hostname,r);if(a){var l=new Date;l.setTime(l.getTime()+24*a*60*60*1e3),o="; expires="+l.toUTCString()}n&&(i="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+i;return u.length>3686.4&&z.warn("cookieStore warning: large cookie, len="+u.length),q.cookie=u,u}catch{return}},V:function(t,e){if(q!=null&&q.cookie)try{vr.G(t,"",-1,e)}catch{return}}},jv=null,je={H:function(){if(!nn(jv))return jv;var t=!0;if(U(T))t=!1;else try{var e="__mplssupport__";je.G(e,"xyz"),je.q(e)!=='"xyz"'&&(t=!1),je.V(e)}catch{t=!1}return t||z.error("localStorage unsupported; falling back to cookie store"),jv=t,t},B:function(t){z.error("localStorage error: "+t)},q:function(t){try{return T?.localStorage.getItem(t)}catch(e){je.B(e)}return null},W:function(t){try{return JSON.parse(je.q(t))||{}}catch{}return null},G:function(t,e){try{T?.localStorage.setItem(t,JSON.stringify(e))}catch(a){je.B(a)}},V:function(t){try{T?.localStorage.removeItem(t)}catch(e){je.B(e)}}},aN=["distinct_id",Yf,bA,Jf,Qf],Uf=j({},je,{W:function(t){try{var e={};try{e=vr.W(t)||{}}catch{}var a=Ke(e,JSON.parse(je.q(t)||"{}"));return je.G(t,a),a}catch{}return null},G:function(t,e,a,r,n,o){try{je.G(t,e,void 0,void 0,o);var i={};aN.forEach((s=>{e[s]&&(i[s]=e[s])})),Object.keys(i).length&&vr.G(t,i,a,r,n,o)}catch(s){je.B(s)}},V:function(t,e){try{T?.localStorage.removeItem(t),vr.V(t,e)}catch(a){je.B(a)}}}),qf={},rN={H:function(){return!0},B:function(t){z.error("memoryStorage error: "+t)},q:function(t){return qf[t]||null},W:function(t){return qf[t]||null},G:function(t,e){qf[t]=e},V:function(t){delete qf[t]}},ii=null,Lt={H:function(){if(!nn(ii))return ii;if(ii=!0,U(T))ii=!1;else try{var t="__support__";Lt.G(t,"xyz"),Lt.q(t)!=='"xyz"'&&(ii=!1),Lt.V(t)}catch{ii=!1}return ii},B:function(t){z.error("sessionStorage error: ",t)},q:function(t){try{return T?.sessionStorage.getItem(t)}catch(e){Lt.B(e)}return null},W:function(t){try{return JSON.parse(Lt.q(t))||null}catch{}return null},G:function(t,e){try{T?.sessionStorage.setItem(t,JSON.stringify(e))}catch(a){Lt.B(a)}},V:function(t){try{T?.sessionStorage.removeItem(t)}catch(e){Lt.B(e)}}},an=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),Ty=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?an.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===an.DENIED||this.consent===an.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===an.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:a,consent_persistence_name:r}=this._instance.config;return r||(a?a+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return Uv(e)?an.GRANTED:fe(SF,e)?an.DENIED:an.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?je:vr;var a=e==="localStorage"?vr:je;a.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Uv(a.q(this.X))),a.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!vA([va?.doNotTrack,va?.msDoNotTrack,te.doNotTrack],(e=>Uv(e)))}},zf=ct("[Dead Clicks]"),nN=()=>!0,oN=t=>{var e,a=!((e=t.instance.persistence)==null||!e.get_property(xA)),r=t.instance.config.capture_dead_clicks;return so(r)?r:!!mt(r)||a},op=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({[xA]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.initDeadClicksAutocapture&&e(),(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(n=>{n?zf.error("failed to load script",n):e()}))}et(){var e;if(q){if(!this.tt&&(e=te.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var a=mt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};a.__onCapture=this.onCapture,this.tt=te.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,a),this.tt.start(q),zf.info("starting...")}}else zf.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,zf.info("stopping..."))}},Su=ct("[ExceptionAutocapture]"),Ry=class{constructor(e){var a,r,n;this.rt=()=>{var o;if(T&&this.isEnabled&&(o=te.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var i=te.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=te.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=te.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=i(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=s(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(u){Su.error("failed to start",u),this.lt()}}},this._instance=e,this.ut=!((a=this._instance.persistence)==null||!a.props[I1]),this.F=this.ht(),this.vt=new iy({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:Su}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,a={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return mt(e)?a=j({},a,e):(U(e)?this.ut:e)&&(a=j({},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&&(Su.info("enabled"),this.it(this.rt))}it(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.errorWrappingFunctions&&e(),(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(n=>{if(n)return Su.error("failed to load script",n);e()}))}lt(){var e,a,r;(e=this.st)==null||e.call(this),this.st=void 0,(a=this.nt)==null||a.call(this),this.nt=void 0,(r=this.ot)==null||r.call(this),this.ot=void 0}onRemoteConfig(e){var a=e.autocaptureExceptions;this.ut=!!a||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[I1]:this.ut}),this.startIfEnabled()}captureException(e){var a,r,n=(a=e==null||(r=e.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&a!==void 0?a:"Exception";this.vt.consumeRateLimit(n)?Su.info("Skipping exception capture because of client rate limiting.",{exception:n}):this._instance.exceptions.sendExceptionEvent(e)}};function P1(t,e,a){try{if(!(e in t))return()=>{};var r=t[e],n=a(r);return io(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=r}}catch{return()=>{}}}var My=class{constructor(e){var a;this._instance=e,this.dt=(T==null||(a=T.location)==null?void 0:a.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(z.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,z.info("History API monitoring stopped")}monitorHistoryChanges(){var e,a;if(T&&T.history){var r=this;(e=T.history.pushState)!=null&&e.__posthog_wrapped__||P1(T.history,"pushState",(n=>function(o,i,s){n.call(this,o,i,s),r.ft("pushState")})),(a=T.history.replaceState)!=null&&a.__posthog_wrapped__||P1(T.history,"replaceState",(n=>function(o,i,s){n.call(this,o,i,s),r.ft("replaceState")})),this.gt()}}ft(e){try{var a,r=T==null||(a=T.location)==null?void 0:a.pathname;if(!r)return;r!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=r}catch(n){z.error("Error capturing "+e+" pageview",n)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};at(T,"popstate",e),this.ct=()=>{T&&T.removeEventListener("popstate",e)}}}},Gv=ct("[SegmentIntegration]");function iN(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()||oo();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(tn,"identified")),n()},s=o.user();"then"in s&&io(s.then)?s.then((l=>i(l))):i(s)})(t,(()=>{a.register((r=>{Promise&&Promise.resolve||Gv.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()||(Gv.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(Gv.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 BA="posthog-js";function FA(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,h;if(!(o==="*"||o.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var g=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());s.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var S=((l=s.exception)==null?void 0:l.values)||[],b=S.map((f=>j({},f,{stacktrace:f.stacktrace?j({},f.stacktrace,{type:"raw",frames:(f.stacktrace.frames||[]).map((m=>j({},m,{platform:"web:javascript"})))}):void 0}))),x={$exception_message:((u=S[0])==null?void 0:u.value)||s.message,$exception_type:(c=S[0])==null?void 0:c.type,$exception_level:s.level,$exception_list:b,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((d=S[0])==null?void 0:d.value)||s.message,$sentry_exception_type:(h=S[0])==null?void 0:h.type,$sentry_tags:s.tags};return a&&r&&(x.$sentry_url=(n||"https://sentry.io/organizations/")+a+"/issues/?project="+r+"&query="+s.event_id),i&&t.exceptions.sendExceptionEvent(x),s}}var Dy=class{constructor(e,a,r,n,o,i){this.name=BA,this.setupOnce=function(s){s(FA(e,{organization:a,projectId:r,prefix:n,severityAllowList:o,sendExceptionsToPostHog:i==null||i}))}}},sN=T!=null&&T.location?np(T.location.hash,"__posthog")||np(location.hash,"state"):null,H1="_postHogToolbarParams",U1=ct("[Toolbar]"),no=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(no||{}),Oy=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:no.UNINITIALIZED}maybeLoadToolbar(e,a,r){if(e===void 0&&(e=void 0),a===void 0&&(a=void 0),r===void 0&&(r=void 0),!T||!q)return!1;e=e??T.location,r=r??T.history;try{if(!a){try{T.localStorage.setItem("test","test"),T.localStorage.removeItem("test")}catch{return!1}a=T?.localStorage}var n,o=sN||np(e.hash,"__posthog")||np(e.hash,"state"),i=o?w1((()=>JSON.parse(atob(decodeURIComponent(o)))))||w1((()=>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(H1)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token)&&(this.loadToolbar(n),!0)}catch{return!1}}bt(e){var a=te.ph_load_toolbar||te.ph_load_editor;!Le(a)&&io(a)?a(e,this.instance):U1.warn("No toolbar load function found")}loadToolbar(e){var a=!(q==null||!q.getElementById(SA));if(!T||a)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=j({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(T.localStorage.setItem(H1,JSON.stringify(j({},n,{source:void 0}))),this.yt()===no.LOADED)this.bt(n);else if(this.yt()===no.UNINITIALIZED){var o;this._t(no.LOADING),(o=te.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return U1.error("[Toolbar] Failed to load",i),void this._t(no.UNINITIALIZED);this._t(no.LOADED),this.bt(n)})),at(T,"turbolinks:load",(()=>{this._t(no.UNINITIALIZED),this.loadToolbar(n)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,a,r){return e===void 0&&(e=void 0),a===void 0&&(a=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,a,r)}},lN=ct("[TracingHeaders]"),By=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var a,r;U(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)),U(this.St)&&((r=te.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.tracingHeadersPatchFns&&e(),(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(n=>{if(n)return lN.error("failed to load script",n);e()}))}startIfEnabledOrStop(){var e,a;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(a=this.St)==null||a.call(this),this.xt=void 0,this.St=void 0)}},Fa="Mobile",ip="iOS",gr="Android",Hu="Tablet",NA=gr+" "+Hu,PA="iPad",HA="Apple",UA=HA+" Watch",Uu="Safari",Ns="BlackBerry",qA="Samsung",zA=qA+"Browser",VA=qA+" Internet",ui="Chrome",uN=ui+" OS",$A=ui+" "+ip,mx="Internet Explorer",jA=mx+" "+Fa,gx="Opera",cN=gx+" Mini",vx="Edge",GA="Microsoft "+vx,Os="Firefox",WA=Os+" "+ip,qu="Nintendo",zu="PlayStation",Bs="Xbox",ZA=gr+" "+Fa,XA=Fa+" "+Uu,Mu="Windows",Fy=Mu+" Phone",q1="Nokia",Ny="Ouya",YA="Generic",dN=YA+" "+Fa.toLowerCase(),KA=YA+" "+Hu.toLowerCase(),Py="Konqueror",Pt="(\\d+(\\.\\d+)?)",Wv=new RegExp("Version/"+Pt),fN=new RegExp(Bs,"i"),pN=new RegExp(zu+" \\w+","i"),hN=new RegExp(qu+" \\w+","i"),yx=new RegExp(Ns+"|PlayBook|BB10","i"),mN={"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"},gN=(t,e)=>e&&fe(e,HA)||(function(a){return fe(a,Uu)&&!fe(a,ui)&&!fe(a,gr)})(t),QA=function(t,e){return e=e||"",fe(t," OPR/")&&fe(t,"Mini")?cN:fe(t," OPR/")?gx:yx.test(t)?Ns:fe(t,"IE"+Fa)||fe(t,"WPDesktop")?jA:fe(t,zA)?VA:fe(t,vx)||fe(t,"Edg/")?GA:fe(t,"FBIOS")?"Facebook "+Fa:fe(t,"UCWEB")||fe(t,"UCBrowser")?"UC Browser":fe(t,"CriOS")?$A:fe(t,"CrMo")||fe(t,ui)?ui:fe(t,gr)&&fe(t,Uu)?ZA:fe(t,"FxiOS")?WA:fe(t.toLowerCase(),Py.toLowerCase())?Py:gN(t,e)?fe(t,Fa)?XA:Uu:fe(t,Os)?Os:fe(t,"MSIE")||fe(t,"Trident/")?mx:fe(t,"Gecko")?Os:""},vN={[jA]:[new RegExp("rv:"+Pt)],[GA]:[new RegExp(vx+"?\\/"+Pt)],[ui]:[new RegExp("("+ui+"|CrMo)\\/"+Pt)],[$A]:[new RegExp("CriOS\\/"+Pt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Pt)],[Uu]:[Wv],[XA]:[Wv],[gx]:[new RegExp("(Opera|OPR)\\/"+Pt)],[Os]:[new RegExp(Os+"\\/"+Pt)],[WA]:[new RegExp("FxiOS\\/"+Pt)],[Py]:[new RegExp("Konqueror[:/]?"+Pt,"i")],[Ns]:[new RegExp(Ns+" "+Pt),Wv],[ZA]:[new RegExp("android\\s"+Pt,"i")],[VA]:[new RegExp(zA+"\\/"+Pt)],[mx]:[new RegExp("(rv:|MSIE )"+Pt)],Mozilla:[new RegExp("rv:"+Pt)]},yN=function(t,e){var a=QA(t,e),r=vN[a];if(U(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},z1=[[new RegExp(Bs+"; "+Bs+" (.*?)[);]","i"),t=>[Bs,t&&t[1]||""]],[new RegExp(qu,"i"),[qu,""]],[new RegExp(zu,"i"),[zu,""]],[yx,[Ns,""]],[new RegExp(Mu,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Fy,""];if(new RegExp(Fa).test(e)&&!/IEMobile\b/.test(e))return[Mu+" "+Fa,""];var a=/Windows NT ([0-9.]+)/i.exec(e);if(a&&a[1]){var r=a[1],n=mN[r]||"";return/arm/i.test(e)&&(n="RT"),[Mu,n]}return[Mu,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[ip,e.join(".")]}return[ip,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=U(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+gr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+gr+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[gr,e.join(".")]}return[gr,""]}],[/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",""]]],V1=function(t){return hN.test(t)?qu:pN.test(t)?zu:fN.test(t)?Bs:new RegExp(Ny,"i").test(t)?Ny:new RegExp("("+Fy+"|WPDesktop)","i").test(t)?Fy:/iPad/.test(t)?PA:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?UA:yx.test(t)?Ns:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(q1,"i").test(t)?q1:/(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(Fa).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)?gr:NA:gr:new RegExp("(pda|"+Fa+")","i").test(t)?dN:new RegExp(Hu,"i").test(t)&&!new RegExp(Hu+" pc","i").test(t)?KA:""},Vf="https?://(.*)",Us=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],xN=Hs(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Us),Gu="<masked>",bN=["li_fat_id"];function JA(t,e,a){if(!q)return{};var r,n=e?Hs([],Us,a||[]):[],o=ek(ju(q.URL,n,Gu),t),i=(r={},Me(bN,(function(s){var l=vr.q(s);r[s]=l||null})),r);return Ke(i,o)}function ek(t,e){var a=xN.concat(e||[]),r={};return Me(a,(function(n){var o=rp(t,n);r[n]=o||null})),r}function tk(t){var e=(function(o){return o?o.search(Vf+"google.([^/?]*)")===0?"google":o.search(Vf+"bing.com")===0?"bing":o.search(Vf+"yahoo.com")===0?"yahoo":o.search(Vf+"duckduckgo.com")===0?"duckduckgo":null:null})(t),a=e!="yahoo"?"q":"p",r={};if(!nn(e)){r.$search_engine=e;var n=q?rp(q.referrer,a):"";n.length&&(r.ph_keyword=n)}return r}function $1(){return navigator.language||navigator.userLanguage}function ak(){return q?.referrer||"$direct"}function rk(t,e){var a=t?Hs([],Us,e||[]):[],r=ta?.href.substring(0,1e3);return{r:ak().substring(0,1e3),u:r?ju(r,a,Gu):void 0}}function nk(t){var e,{r:a,u:r}=t,n={$referrer:a,$referring_domain:a==null?void 0:a=="$direct"?"$direct":(e=ap(a))==null?void 0:e.host};if(r){n.$current_url=r;var o=ap(r);n.$host=o?.host,n.$pathname=o?.pathname;var i=ek(r);Ke(n,i)}if(a){var s=tk(a);Ke(n,s)}return n}function ok(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function SN(){try{return new Date().getTimezoneOffset()}catch{return}}function CN(t,e){if(!ea)return{};var a,r,n,o=t?Hs([],Us,e||[]):[],[i,s]=(function(l){for(var u=0;u<z1.length;u++){var[c,d]=z1[u],h=c.exec(l),g=h&&(io(d)?d(h,l):d);if(g)return g}return["",""]})(ea);return Ke(dx({$os:i,$os_version:s,$browser:QA(ea,navigator.vendor),$device:V1(ea),$device_type:(r=ea,n=V1(r),n===PA||n===NA||n==="Kobo"||n==="Kindle Fire"||n===KA?Hu:n===qu||n===Bs||n===zu||n===Ny?"Console":n===UA?"Wearable":n?Fa:"Desktop"),$timezone:ok(),$timezone_offset:SN()}),{$current_url:ju(ta?.href,o,Gu),$host:ta?.host,$pathname:ta?.pathname,$raw_user_agent:ea.length>1e3?ea.substring(0,997)+"...":ea,$browser_version:yN(ea,navigator.vendor),$browser_language:$1(),$browser_language_prefix:(a=$1(),typeof a=="string"?a.split("-")[0]:void 0),$screen_height:T?.screen.height,$screen_width:T?.screen.width,$viewport_height:T?.innerHeight,$viewport_width:T?.innerWidth,$lib:"web",$lib_version:en.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var to=ct("[Web Vitals]"),j1=9e5,Hy=class{constructor(e){var a;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((r,n)=>j({},r,{["$web_vitals_"+n.name+"_event"]:j({},n),["$web_vitals_"+n.name+"_value"]:n.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=r=>{var n,o=(n=this._instance.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0);if(U(o))to.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Tt();U(i)||(Le(r?.name)||Le(r?.value)?to.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?to.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==i&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),U(this.N.url)&&(this.N.url=i),this.N.firstMetricTimestamp=U(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(j({},r,{$current_url:i,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var r,n,o,i,s=te.__PosthogExtensions__;U(s)||U(s.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:n,onFCP:o,onINP:i}=s.postHogWebVitalsCallbacks),r&&n&&o&&i?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Pt.bind(this)),this.P=!0):to.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((a=this._instance.persistence)==null||!a.props[k1]),this.startIfEnabled()}get allowedMetrics(){var e,a,r=mt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return U(r)?((a=this._instance.persistence)==null?void 0:a.props[E1])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(mt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=mt(this._instance.config.capture_performance)&&yr(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:j1;return 0<e&&e<=6e4?j1:e}get isEnabled(){var e=ta?.protocol;if(e!=="http:"&&e!=="https:")return to.info("Web Vitals are disabled on non-http/https protocols"),!1;var a=mt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:so(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return so(a)?a:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(to.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var a=mt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=mt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[k1]:a}),this._instance.persistence.register({[E1]:r})),this.Et=a,this.startIfEnabled()}it(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.postHogWebVitalsCallbacks&&e(),(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",(n=>{n?to.error("failed to load script",n):e()}))}Tt(){var e=T?T.location.href:void 0;if(e){var a=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,n=a?Hs([],Us,r||[]):[];return ju(e,n,Gu)}to.error("Could not determine current URL")}},_N=ct("[Heatmaps]");function G1(t){return mt(t)&&"clientX"in t&&"clientY"in t&&yr(t.clientX)&&yr(t.clientY)}var Uy=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[vy]),this.rageclicks=new tp(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return mt(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return U(this.instance.config.capture_heatmaps)?U(this.instance.config.enable_heatmaps)?this.Et:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;_N.info("starting..."),this.Ft(),this.Ct()}else{var e;clearInterval((e=this.It)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var a=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[vy]:a}),this.Et=a,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ct(){this.It&&clearInterval(this.It),this.It=(function(e){return e?.visibilityState==="visible"})(q)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){T&&q&&(this.jt=this.Dt.bind(this),at(T,"beforeunload",this.jt),this.Lt=e=>this.At(e||T?.event),at(q,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||T?.event),at(q,"mousemove",this.Nt,{capture:!0}),this.zt=new op(this.instance,nN,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),at(q,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;T&&q&&(this.jt&&T.removeEventListener("beforeunload",this.jt),this.Lt&&q.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&q.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&q.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,a){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),i=(function(s,l,u){for(var c=s;c&&vp(c)&&!uo(c,"body");){if(c===u)return!1;if(fe(l,T?.getComputedStyle(c).position))return!0;c=AA(c)}return!1})(LA(e),["fixed","sticky"],o);return{x:e.clientX+(i?0:n),y:e.clientY+(i?0:r),target_fixed:i,type:a}}At(e,a){var r;if(a===void 0&&(a="click"),!T1(e.target)&&G1(e)){var n=this.qt(e,a);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(j({},n,{type:"rageclick"})),this.Wt(n)}}Ut(e){!T1(e.target)&&G1(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(T){var a=T.location.href,r=this.instance.config.mask_personal_data_properties,n=this.instance.config.custom_personal_data_properties,o=r?Hs([],Us,n||[]):[],i=ju(a,o,Gu);this.N=this.N||{},this.N[i]||(this.N[i]=[]),this.N[i].push(e)}}Dt(){this.N&&!Ms(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},qy=class{constructor(e){this._instance=e}doPageView(e,a){var r,n=this.Gt(e,a);return this.Vt={pathname:(r=T?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:a,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var a;return this.Gt(e,(a=this.Vt)==null?void 0:a.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,a){var r=this.Vt;if(!r)return{$pageview_id:a};var n={$pageview_id:a,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:i,lastScrollY:s,maxScrollY:l,maxContentHeight:u,lastContentY:c,maxContentY:d}=o;if(!(U(i)||U(s)||U(l)||U(u)||U(c)||U(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 h=i<=1?1:mr(s/i,0,1,z),g=i<=1?1:mr(l/i,0,1,z),S=u<=1?1:mr(c/u,0,1,z),b=u<=1?1:mr(d/u,0,1,z);n=Ke(n,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:S,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:b})}}return r.pathname&&(n.$prev_pageview_pathname=r.pathname),r.timestamp&&(n.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),n}},Na=Uint8Array,Ht=Uint16Array,Ps=Uint32Array,xx=new Na([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]),bx=new Na([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]),W1=new Na([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ik=function(t,e){for(var a=new Ht(31),r=0;r<31;++r)a[r]=e+=1<<t[r-1];var n=new Ps(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]},sk=ik(xx,2),wN=sk[0],zy=sk[1];wN[28]=258,zy[258]=28;for(Vy=ik(bx,0)[1],sp=new Ht(32768),De=0;De<32768;++De)ao=(43690&De)>>>1|(21845&De)<<1,ao=(61680&(ao=(52428&ao)>>>2|(13107&ao)<<2))>>>4|(3855&ao)<<4,sp[De]=((65280&ao)>>>8|(255&ao)<<8)>>>1;var ao,Vy,sp,De,Bu=function(t,e,a){for(var r=t.length,n=0,o=new Ht(e);n<r;++n)++o[t[n]-1];var i,s=new Ht(e);for(n=0;n<e;++n)s[n]=s[n-1]+o[n-1]<<1;if(a){i=new Ht(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,h=d|(1<<c)-1;d<=h;++d)i[sp[d]>>>l]=u}else for(i=new Ht(r),n=0;n<r;++n)i[n]=sp[s[t[n]-1]++]>>>15-t[n];return i},ci=new Na(288);for(De=0;De<144;++De)ci[De]=8;for(De=144;De<256;++De)ci[De]=9;for(De=256;De<280;++De)ci[De]=7;for(De=280;De<288;++De)ci[De]=8;var lp=new Na(32);for(De=0;De<32;++De)lp[De]=5;var LN=Bu(ci,9,0),IN=Bu(lp,5,0),lk=function(t){return(t/8>>0)+(7&t&&1)},uk=function(t,e,a){(a==null||a>t.length)&&(a=t.length);var r=new(t instanceof Ht?Ht:t instanceof Ps?Ps:Na)(a-e);return r.set(t.subarray(e,a)),r},Jr=function(t,e,a){a<<=7&e;var r=e/8>>0;t[r]|=a,t[r+1]|=a>>>8},Cu=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},Zv=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 Na(0),0];if(n==1){var i=new Na(a[0].s+1);return i[a[0].s]=1,[i,1]}a.sort((function(_,w){return _.f-w.f})),a.push({s:-1,f:25001});var s=a[0],l=a[1],u=0,c=1,d=2;for(a[0]={s:-1,f:s.f+l.f,l:s,r:l};c!=n-1;)s=a[a[u].f<a[d].f?u++:d++],l=a[u!=c&&a[u].f<a[d].f?u++:d++],a[c++]={s:-1,f:s.f+l.f,l:s,r:l};var h=o[0].s;for(r=1;r<n;++r)o[r].s>h&&(h=o[r].s);var g=new Ht(h+1),S=$y(a[c-1],g,0);if(S>e){r=0;var b=0,x=S-e,f=1<<x;for(o.sort((function(_,w){return g[w.s]-g[_.s]||_.f-w.f}));r<n;++r){var m=o[r].s;if(!(g[m]>e))break;b+=f-(1<<S-g[m]),g[m]=e}for(b>>>=x;b>0;){var v=o[r].s;g[v]<e?b-=1<<e-g[v]++-1:++r}for(;r>=0&&b;--r){var y=o[r].s;g[y]==e&&(--g[y],++b)}S=e}return[new Na(g),S]},$y=function(t,e,a){return t.s==-1?Math.max($y(t.l,e,a+1),$y(t.r,e,a+1)):e[t.s]=a},Z1=function(t){for(var e=t.length;e&&!t[--e];);for(var a=new Ht(++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]},_u=function(t,e){for(var a=0,r=0;r<e.length;++r)a+=t[r]*e[r];return a},jy=function(t,e,a){var r=a.length,n=lk(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)},X1=function(t,e,a,r,n,o,i,s,l,u,c){Jr(e,c++,a),++n[256];for(var d=Zv(n,15),h=d[0],g=d[1],S=Zv(o,15),b=S[0],x=S[1],f=Z1(h),m=f[0],v=f[1],y=Z1(b),_=y[0],w=y[1],C=new Ht(19),A=0;A<m.length;++A)C[31&m[A]]++;for(A=0;A<_.length;++A)C[31&_[A]]++;for(var E=Zv(C,7),L=E[0],k=E[1],O=19;O>4&&!L[W1[O-1]];--O);var R,N,P,F,Q=u+5<<3,D=_u(n,ci)+_u(o,lp)+i,W=_u(n,h)+_u(o,b)+i+14+3*O+_u(C,L)+(2*C[16]+3*C[17]+7*C[18]);if(Q<=D&&Q<=W)return jy(e,c,t.subarray(l,l+u));if(Jr(e,c,1+(W<D)),c+=2,W<D){R=Bu(h,g,0),N=h,P=Bu(b,x,0),F=b;var dt=Bu(L,k,0);for(Jr(e,c,v-257),Jr(e,c+5,w-1),Jr(e,c+10,O-4),c+=14,A=0;A<O;++A)Jr(e,c+3*A,L[W1[A]]);c+=3*O;for(var er=[m,_],rt=0;rt<2;++rt){var X=er[rt];for(A=0;A<X.length;++A){var oe=31&X[A];Jr(e,c,dt[oe]),c+=L[oe],oe>15&&(Jr(e,c,X[A]>>>5&127),c+=X[A]>>>12)}}}else R=LN,N=ci,P=IN,F=lp;for(A=0;A<s;++A)if(r[A]>255){oe=r[A]>>>18&31,Cu(e,c,R[oe+257]),c+=N[oe+257],oe>7&&(Jr(e,c,r[A]>>>23&31),c+=xx[oe]);var Ut=31&r[A];Cu(e,c,P[Ut]),c+=F[Ut],Ut>3&&(Cu(e,c,r[A]>>>5&8191),c+=bx[Ut])}else Cu(e,c,R[r[A]]),c+=N[r[A]];return Cu(e,c,R[256]),c+N[256]},AN=new Ps([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),kN=(function(){for(var t=new Ps(256),e=0;e<256;++e){for(var a=e,r=9;--r;)a=(1&a&&3988292384)^a>>>1;t[e]=a}return t})(),EN=function(t,e,a,r,n){return(function(o,i,s,l,u,c){var d=o.length,h=new Na(l+d+5*(1+Math.floor(d/7e3))+u),g=h.subarray(l,h.length-u),S=0;if(!i||d<8)for(var b=0;b<=d;b+=65535){var x=b+65535;x<d?S=jy(g,S,o.subarray(b,x)):(g[b]=c,S=jy(g,S,o.subarray(b,d)))}else{for(var f=AN[i-1],m=f>>>13,v=8191&f,y=(1<<s)-1,_=new Ht(32768),w=new Ht(y+1),C=Math.ceil(s/3),A=2*C,E=function(Rp){return(o[Rp]^o[Rp+1]<<C^o[Rp+2]<<A)&y},L=new Ps(25e3),k=new Ht(288),O=new Ht(32),R=0,N=0,P=(b=0,0),F=0,Q=0;b<d;++b){var D=E(b),W=32767&b,dt=w[D];if(_[W]=dt,w[D]=W,F<=b){var er=d-b;if((R>7e3||P>24576)&&er>423){S=X1(o,g,0,L,k,O,N,P,Q,b-Q,S),P=R=N=0,Q=b;for(var rt=0;rt<286;++rt)k[rt]=0;for(rt=0;rt<30;++rt)O[rt]=0}var X=2,oe=0,Ut=v,Mt=W-dt&32767;if(er>2&&D==E(b-Mt))for(var _E=Math.min(m,er)-1,wE=Math.min(32767,b),LE=Math.min(258,er);Mt<=wE&&--Ut&&W!=dt;){if(o[b+X]==o[b+X-Mt]){for(var ln=0;ln<LE&&o[b+ln]==o[b+ln-Mt];++ln);if(ln>X){if(X=ln,oe=Mt,ln>_E)break;var IE=Math.min(Mt,ln-2),gb=0;for(rt=0;rt<IE;++rt){var Tp=b-Mt+rt+32768&32767,vb=Tp-_[Tp]+32768&32767;vb>gb&&(gb=vb,dt=Tp)}}}Mt+=(W=dt)-(dt=_[W])+32768&32767}if(oe){L[P++]=268435456|zy[X]<<18|Vy[oe];var yb=31&zy[X],xb=31&Vy[oe];N+=xx[yb]+bx[xb],++k[257+yb],++O[xb],F=b+X,++R}else L[P++]=o[b],++k[o[b]]}}S=X1(o,g,c,L,k,O,N,P,Q,b-Q,S)}return uk(h,0,l+lk(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)},Xv=function(t,e,a){for(;a;++e)t[e]=a,a>>>=8};function TN(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=kN[255&u^l[c]]^u>>>8;s=u},d:function(){return 4294967295^s}}})(),r=t.length;a.p(t);var n,o=EN(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&&Xv(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),Xv(o,i-8,a.d()),Xv(o,i-4,r),o}var RN=function(t){var e,a,r,n,o="";for(e=a=0,r=(t=(t+"").replace(/\r\n/g,`
|
|
442
461
|
`).replace(/\r/g,`
|
|
443
|
-
`)).length,r=0;r<i;r++){var a=t.charCodeAt(r),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),tr(s)||(n>e&&(o+=t.substring(e,n)),o+=s,e=n=r+1)}return n>e&&(o+=t.substring(e,t.length)),o},J3=!!$v||!!Fv,TA="text/plain",Kf=function(t,e,n){var i;n===void 0&&(n=!0);var[r,o]=t.split("?"),a=q({},e),s=(i=o?.split("&").map((c=>{var u,[d,h]=c.split("="),m=n&&(u=a[d])!==null&&u!==void 0?u:h;return delete a[d],d+"="+m})))!==null&&i!==void 0?i:[],l=m3(a);return l&&s.push(l),r+"?"+s.join("&")},Ec=(t,e)=>JSON.stringify(t,((n,i)=>typeof i=="bigint"?i.toString():i),e),Lv=t=>{var{data:e,compression:n}=t;if(e){if(n===er.GZipJS){var i=K3((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new In(l.length+(l.length>>>1)),h=0,m=function(f){d[h++]=f},S=0;S<u;++S){if(h+5>d.length){var _=new In(h+8+(u-S<<1));_.set(d),d=_}var b=l.charCodeAt(S);b<128||c?m(b):b<2048?(m(192|b>>>6),m(128|63&b)):b>55295&&b<57344?(m(240|(b=65536+(1047552&b)|1023&l.charCodeAt(++S))>>>18),m(128|b>>>12&63),m(128|b>>>6&63),m(128|63&b)):(m(224|b>>>12),m(128|b>>>6&63),m(128|63&b))}return $T(d,0,h)})(Ec(e)),{mtime:0}),r=new Blob([i],{type:TA});return{contentType:TA,body:r,estimatedSize:r.size}}if(n===er.Base64){var o=(function(l){var c,u,d,h,m,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,b=0,f="",p=[];if(!l)return l;l=Q3(l);do c=(m=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,u=m>>12&63,d=m>>6&63,h=63&m,p[b++]=S.charAt(c)+S.charAt(u)+S.charAt(d)+S.charAt(h);while(_<l.length);switch(f=p.join(""),l.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"="}return f})(Ec(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Ec(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var s=Ec(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},Lf=[];Fv&&Lf.push({transport:"fetch",method:t=>{var e,n,{contentType:i,body:r,estimatedSize:o}=(e=Lv(t))!==null&&e!==void 0?e:{},a=new Headers;Me(t.headers,(function(u,d){a.append(d,u)})),i&&a.append("Content-Type",i);var s=t.url,l=null;if(GC){var c=new GC;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),t.timeout)}}Fv(s,q({method:t?.method||"GET",headers:a,keepalive:t.method==="POST"&&(o||0)<52428.8,body:r,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then((u=>u.text().then((d=>{var h={statusCode:u.status,text:d};if(u.status===200)try{h.json=JSON.parse(d)}catch(m){V.error(m)}t.callback==null||t.callback(h)})))).catch((u=>{V.error(u),t.callback==null||t.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),$v&&Lf.push({transport:"XHR",method:t=>{var e,n=new $v;n.open(t.method||"GET",t.url,!0);var{contentType:i,body:r}=(e=Lv(t))!==null&&e!==void 0?e:{};Me(t.headers,(function(o,a){n.setRequestHeader(a,o)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var o={statusCode:n.status,text:n.responseText};if(n.status===200)try{o.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(o)}},n.send(r)}}),hn!=null&&hn.sendBeacon&&Lf.push({transport:"sendBeacon",method:t=>{var e=Kf(t.url,{beacon:"1"});try{var n,{contentType:i,body:r}=(n=Lv(t))!==null&&n!==void 0?n:{},o=typeof r=="string"?new Blob([r],{type:i}):r;hn.sendBeacon(e,o)}catch{}}});var Qf=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function kA(t,e,n){return Ec({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var UT={exact:(t,e)=>e.some((n=>t.some((i=>n===i)))),is_not:(t,e)=>e.every((n=>t.every((i=>n!==i)))),regex:(t,e)=>e.some((n=>t.some((i=>Qf(n,i))))),not_regex:(t,e)=>e.every((n=>t.every((i=>!Qf(n,i))))),icontains:(t,e)=>e.map(Nf).some((n=>t.map(Nf).some((i=>n.includes(i))))),not_icontains:(t,e)=>e.map(Nf).every((n=>t.map(Nf).every((i=>!n.includes(i)))))},Nf=t=>t.toLowerCase();function VT(t,e){return!t||Object.entries(t).every((n=>{var[i,r]=n,o=e?.[i];if($(o)||tr(o))return!1;var a=[String(o)],s=UT[r.operator];return!!s&&s(r.values,a)}))}var Iv=ct("[Error tracking]"),Oy=class{constructor(e){var n,i;this.Jt=[],this.Kt=new qv([new Gv,new ey,new Wv,new Yv,new Qv,new Kv,new Xv,new Jv],QL("web:javascript",YL,KL)),this._instance=e,this.Jt=(n=(i=this._instance.persistence)==null?void 0:i.get_property(ny))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,i,r,o=(n=(i=e.errorTracking)==null?void 0:i.suppressionRules)!==null&&n!==void 0?n:[],a=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[ny]:this.Jt,[rA]:a})}get Yt(){var e,n=!!this._instance.get_property(rA),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.Kt.buildFromUnknown(e,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.Xt(n)){if(this.Qt(n))return void Iv.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void Iv.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))return void Iv.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var n=e.reduce(((i,r)=>{var{type:o,value:a}=r;return lt(o)&&o.length>0&&i.$exception_types.push(o),lt(a)&&a.length>0&&i.$exception_values.push(a),i}),{$exception_types:[],$exception_values:[]});return this.Jt.some((i=>{var r=i.values.map((o=>{var a,s=UT[o.operator],l=Re(o.value)?o.value:[o.value],c=(a=n[o.key])!==null&&a!==void 0?a:[];return l.length>0&&s(l,c)}));return i.type==="OR"?r.some(Boolean):r.every(Boolean)}))}Zt(e){return e.flatMap((n=>{var i,r;return(i=(r=n.stacktrace)==null?void 0:r.frames)!==null&&i!==void 0?i:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var n,i,r,o,a=(n=(i=e[0].stacktrace)==null?void 0:i.frames)!==null&&n!==void 0?n:[],s=a[a.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!Ce(e)&&Re(e)}},Xn=ct("[FeatureFlags]"),gc=ct("[FeatureFlags]",{debugEnabled:!0}),Hv="$active_feature_flags",Cs="$override_feature_flags",RA="$feature_flag_payloads",mc="$override_feature_flag_payloads",OA="$feature_flag_request_id",MA="$feature_flag_evaluated_at",NA=t=>{var e={};for(var[n,i]of Df(t||{}))i&&(e[n]=i);return e},e5=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((n=>{var i;return[n,(i=e[n].variant)!==null&&i!==void 0?i:e[n].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((n=>e[n].enabled)).filter((n=>{var i;return(i=e[n].metadata)==null?void 0:i.payload})).map((n=>{var i;return[n,(i=e[n].metadata)==null?void 0:i.payload]})))):Xn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},t5=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),My=class{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((n=>{var i=n&&typeof n=="string"&&n.trim().length>0;return i||Xn.error("Invalid evaluation environment found:",n,"Expected non-empty string"),i})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.vi({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(iy),n=this._instance.get_property(Cs),i=this._instance.get_property(mc);if(!i&&!n)return e||{};var r=Xe({},e||{}),o=[...new Set([...Object.keys(i||{}),...Object.keys(n||{})])];for(var a of o){var s,l,c=r[a],u=n?.[a],d=$(u)?(s=c?.enabled)!==null&&s!==void 0&&s:!!u,h=$(u)?c.variant:typeof u=="string"?u:void 0,m=i?.[a],S=q({},c,{enabled:d,variant:d?h??c?.variant:void 0});d!==c?.enabled&&(S.original_enabled=c?.enabled),h!==c?.variant&&(S.original_variant=c?.variant),m&&(S.metadata=q({},c?.metadata,{payload:m,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),r[a]=S}return this.ii||(Xn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var e=this._instance.get_property(Rs),n=this._instance.get_property(Cs);if(!n)return e||{};for(var i=Xe({},e),r=Object.keys(n),o=0;o<r.length;o++)i[r[o]]=n[r[o]];return this.ii||(Xn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property(RA),n=this._instance.get_property(mc);if(!n)return e||{};for(var i=Xe({},e||{}),r=Object.keys(n),o=0;o<r.length;o++)i[r[o]]=n[r[o]];return this.ii||(Xn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:i}),this.ii=!0),i}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.vi()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}vi(e){var n;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:q({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(xc)||{}),group_properties:this._instance.get_property(ia)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ui()&&(i.evaluation_environments=this.li());var r=this._instance.config.__preview_remote_config,o=r?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("flags",o+a);r&&(i.timezone=HT()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:i,compression:this._instance.config.disable_compression?void 0:er.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,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((u=l.json)!==null&&u!==void 0?u:{})),!i.disable_flags||this.ni)if(this.ai=!d,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(t5.FeatureFlags))Xn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var h;i.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},d),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],r=""+i,o=this._instance.get_property(OA)||void 0,a=this._instance.get_property(MA)||void 0,s=this._instance.get_property(Ff)||{};if((n.send_event||!("send_event"in n))&&(!(e in s)||!s[e].includes(r))){var l,c,u,d,h,m,S,_,b;Re(s[e])?s[e].push(r):s[e]=[r],(l=this._instance.persistence)==null||l.register({[Ff]:s});var f=this.getFeatureFlagDetails(e),p={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:a,$feature_flag_bootstrapped_response:((c=this._instance.config.bootstrap)==null||(c=c.featureFlags)==null?void 0:c[e])||null,$feature_flag_bootstrapped_payload:((u=this._instance.config.bootstrap)==null||(u=u.featureFlagPayloads)==null?void 0:u[e])||null,$used_bootstrap_value:!this.ai};$(f==null||(d=f.metadata)==null?void 0:d.version)||(p.$feature_flag_version=f.metadata.version);var v,y=(h=f==null||(m=f.reason)==null?void 0:m.description)!==null&&h!==void 0?h:f==null||(S=f.reason)==null?void 0:S.code;y&&(p.$feature_flag_reason=y),f!=null&&(_=f.metadata)!=null&&_.id&&(p.$feature_flag_id=f.metadata.id),$(f?.original_variant)&&$(f?.original_enabled)||(p.$feature_flag_original_response=$(f.original_variant)?f.original_enabled:f.original_variant),f!=null&&(b=f.metadata)!=null&&b.original_payload&&(p.$feature_flag_original_payload=f==null||(v=f.metadata)==null?void 0:v.original_payload),this._instance.capture("$feature_flag_called",p)}return i}Xn.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,n){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.ui()&&(r.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:er.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var a,s=(a=o.json)==null?void 0:a.featureFlagPayloads;n(s?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,n);return $(i)?void 0:!!i}Xn.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==e))}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ei=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(a,s,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var d=e5(a),h=d.flags,m=d.featureFlags,S=d.featureFlagPayloads;if(m){var _=a.requestId,b=a.evaluatedAt;if(Re(m)){Xn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(m)for(var p=0;p<m.length;p++)f[m[p]]=!0;s&&s.register({[Hv]:m,[Rs]:f})}else{var v=m,y=S,w=h;a.errorsWhileComputingFlags&&(v=q({},l,v),y=q({},c,y),w=q({},u,w)),s&&s.register(q({[Hv]:Object.keys(NA(v)),[Rs]:v||{},[RA]:y||{},[iy]:w||{}},_?{[OA]:_}:{},b?{[MA]:b}:{}))}}})(e,this._instance.persistence,i,r,o),this.pi(n)}}override(e,n){n===void 0&&(n=!1),Xn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Xn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Cs),this._instance.persistence.unregister(mc),this.pi(),gc.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,i=e;if(this.ii=!!((n=i.suppressWarning)!==null&&n!==void 0&&n),"flags"in i){if(i.flags===!1)this._instance.persistence.unregister(Cs),gc.info("Flag overrides cleared");else if(i.flags){if(Re(i.flags)){for(var r={},o=0;o<i.flags.length;o++)r[i.flags[o]]=!0;this._instance.persistence.register({[Cs]:r})}else this._instance.persistence.register({[Cs]:i.flags});gc.info("Flag overrides set",{flags:i.flags})}}return"payloads"in i&&(i.payloads===!1?(this._instance.persistence.unregister(mc),gc.info("Payload overrides cleared")):i.payloads&&(this._instance.persistence.register({[mc]:i.payloads}),gc.info("Payload overrides set",{payloads:i.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:n,flagVariants:i}=this.gi();e(n,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,i){var r,o=(this._instance.get_property(Sc)||[]).find((c=>c.flagKey===e)),a={["$feature_enrollment/"+e]:n},s={$feature_flag:e,$feature_enrollment:n,$set:a};o&&(s.$early_access_feature_name=o.name),i&&(s.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(a,!1);var l=q({},this.getFlagVariants(),{[e]:n});(r=this._instance.persistence)==null||r.register({[Hv]:Object.keys(NA(l)),[Rs]:l}),this.pi()}getEarlyAccessFeatures(e,n,i){n===void 0&&(n=!1);var r=this._instance.get_property(Sc),o=i?"&"+i.map((a=>"stage="+a)).join("&"):"";if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:a=>{var s,l;if(a.json){var c=a.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.unregister(Sc),(l=this._instance.persistence)==null||l.register({[Sc]:c}),e(c)}}})}gi(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter((i=>n[i])),flagVariants:Object.keys(n).filter((i=>n[i])).reduce(((i,r)=>(i[r]=n[r],i)),{})}}pi(e){var{flags:n,flagVariants:i}=this.gi();this.featureFlagEventHandlers.forEach((r=>r(n,i,{errorsLoading:e})))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(xc)||{};this._instance.register({[xc]:q({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(xc)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(ia)||{};Object.keys(i).length!==0&&Object.keys(i).forEach((r=>{i[r]=q({},i[r],e[r]),delete e[r]})),this._instance.register({[ia]:q({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(ia)||{};this._instance.register({[ia]:q({},n,{[e]:{}})})}else this._instance.unregister(ia)}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}},n5=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Tc=class{constructor(e,n){this.F=e,this.props={},this.mi=!1,this.yi=(i=>{var r="";return i.token&&(r=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+r+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&V.info("Persistence loaded",e.persistence,q({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.wi}bi(e){n5.indexOf(e.persistence.toLowerCase())===-1&&(V.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&qe.H()?qe:n==="localstorage+cookie"&&kf.H()?kf:n==="sessionstorage"&&Et.H()?Et:n==="memory"?E3:n==="cookie"?pi:kf.H()?kf:pi}properties(){var e={};return Me(this.props,(function(n,i){if(i===Rs&&pt(n))for(var r=Object.keys(n),o=0;o<r.length;o++)e["$feature/"+r[o]]=n[r[o]];else s=i,l=!1,(tr(a=a3)?l:ZC&&a.indexOf===ZC?a.indexOf(s)!=-1:(Me(a,(function(c){if(l||(l=c===s))return zf})),l))||(e[i]=n);var a,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Xe({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,n,i){if(pt(e)){$(n)&&(n="None"),this.xi=$(i)?this.$i:i;var r=!1;if(Me(e,((o,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.props[a]=o,r=!0)})),r)return this.save(),!0}return!1}register(e,n){if(pt(e)){this.xi=$(n)?this.$i:n;var i=!1;if(Me(e,((r,o)=>{e.hasOwnProperty(o)&&this.props[o]!==r&&(this.props[o]=r,i=!0)})),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=OT(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);ks(Wy(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=U?.referrer)?NT(e):{})}update_referrer_info(){var e;this.register_once({$referrer:DT(),$referring_domain:U!=null&&U.referrer&&((e=Pf(U.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[sy]||this.props[ly]||this.register_once({[$f]:LT(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Me([ly,sy],(a=>{var s=this.props[a];s&&Me(s,(function(l,c){e["$initial_"+Uv(c)]=l}))}));var n,i,r=this.props[$f];if(r){var o=(n=IT(r),i={},Me(n,(function(a,s){i["$initial_"+Uv(s)]=a})),i);Xe(e,o)}return e}safe_merge(e){return Me(this.props,(function(n,i){i in e||(e[i]=n)})),e}update_config(e,n,i){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence){var r=this.bi(e),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,n){var i=this.props[_c]||{};i[e]=n,this.props[_c]=i,this.save()}remove_event_timer(e){var n=(this.props[_c]||{})[e];return $(n)||(delete this.props[_c][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}},vc=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),TF=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),kF=(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})({}),RF=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),zv=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),OF=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),MF=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),NF=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),If=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),DA=(function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t})({}),jT=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),Lc=class{constructor(){this.ki={},this.ki={}}on(e,n){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(n),()=>{this.ki[e]=this.ki[e].filter((i=>i!==n))}}emit(e,n){for(var i of this.ki[e]||[])i(n);for(var r of this.ki["*"]||[])r(e,n)}};function As(t,e,n){if(Ce(t))return!1;switch(n){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var Ny=class{constructor(e){this.Pi=new Lc,this.Ti=(n,i)=>this.Ri(n,i)&&this.Ii(n,i)&&this.Fi(n,i)&&this.Ci(n,i),this.Ri=(n,i)=>i==null||!i.event||n?.event===i?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!$((e=this._instance)==null?void 0:e.Ai)){var n;(n=this._instance)==null||n.Ai(((i,r)=>{this.on(i,r)}))}}register(e){var n,i;if(!$((n=this._instance)==null?void 0:n.Ai)&&(e.forEach((a=>{var s,l;(s=this.Oi)==null||s.add(a),(l=a.steps)==null||l.forEach((c=>{var u;(u=this.Mi)==null||u.add(c?.event||"")}))})),(i=this._instance)!=null&&i.autocapture)){var r,o=new Set;e.forEach((a=>{var s;(s=a.steps)==null||s.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(r=this._instance)==null||r.autocapture.setElementSelectors(o)}}on(e,n){var i;n!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(n?.event))&&this.Oi&&((i=this.Oi)==null?void 0:i.size)>0&&this.Oi.forEach((r=>{this.Di(n,r)&&this.Pi.emit("actionCaptured",r.name)}))}ji(e){this.onAction("actionCaptured",(n=>e(n)))}Di(e,n){if(n?.steps==null)return!1;for(var i of n.steps)if(this.Ti(e,i))return!0;return!1}onAction(e,n){return this.Pi.on(e,n)}Ii(e,n){if(n!=null&&n.url){var i,r=e==null||(i=e.properties)==null?void 0:i.$current_url;if(!r||typeof r!="string"||!As(r,n.url,n.url_matching||"contains"))return!1}return!0}Fi(e,n){return!!this.Li(e,n)&&!!this.Ni(e,n)&&!!this.Ui(e,n)}Li(e,n){var i;if(n==null||!n.href)return!0;var r=this.zi(e);if(r.length>0)return r.some((s=>As(s.href,n.href,n.href_matching||"exact")));var o,a=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!a&&As((o=a.match(/(?::|")href="(.*?)"/))?o[1]:"",n.href,n.href_matching||"exact")}Ni(e,n){var i;if(n==null||!n.text)return!0;var r=this.zi(e);if(r.length>0)return r.some((c=>As(c.text,n.text,n.text_matching||"exact")||As(c.$el_text,n.text,n.text_matching||"exact")));var o,a,s,l=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!l&&(o=(function(c){for(var u,d=[],h=/(?::|")text="(.*?)"/g;!Ce(u=h.exec(c));)d.includes(u[1])||d.push(u[1]);return d})(l),a=n.text,s=n.text_matching||"exact",o.some((c=>As(c,a,s))))}Ui(e,n){var i,r;if(n==null||!n.selector)return!0;var o=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(o!=null&&o.includes(n.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}zi(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}Ci(e,n){return n==null||!n.properties||n.properties.length===0||VT(n.properties.reduce(((i,r)=>{var o=Re(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return i[r.key]={values:o,operator:r.operator||"exact"},i}),{}),e?.properties)}},xe=ct("[Surveys]"),Dy="seenSurvey_",i5=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},LA=t=>{var e=""+Dy+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Dy+t.id+"_"+t.current_iteration),e},r5=[zv.Popover,zv.Widget,zv.API],o5={ignoreConditions:!1,ignoreDelay:!1,displayType:jT.Popover},Ly=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,n){return!!e&&VT(e.propertyFilters,n?.properties)}Gi(e,n){var i=new Map;return e.forEach((r=>{var o;(o=r.conditions)==null||(o=o[n])==null||(o=o.values)==null||o.forEach((a=>{if(a!=null&&a.name){var s=i.get(a.name)||[];s.push(r.id),i.set(a.name,s)}}))})),i}Vi(e,n,i){var r,o=(i===vc.Activation?this.Hi:this.Bi).get(e),a=[];return(r=this._instance)==null||r.getSurveys((s=>{a=s.filter((l=>o?.includes(l.id)))})),a.filter((s=>{var l,c=(l=s.conditions)==null||(l=l[i])==null||(l=l.values)==null?void 0:l.find((u=>u.name===e));return this.Wi(c,n)}))}register(e){var n;$((n=this._instance)==null?void 0:n.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var n=e.filter((i=>{var r,o;return((r=i.conditions)==null?void 0:r.actions)&&((o=i.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));n.length!==0&&(this.Yi==null&&(this.Yi=new Ny(this._instance),this.Yi.init(),this.Yi.ji((i=>{this.onAction(i)}))),n.forEach((i=>{var r,o,a,s,l;i.conditions&&(r=i.conditions)!=null&&r.actions&&(o=i.conditions)!=null&&(o=o.actions)!=null&&o.values&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((s=this.Yi)==null||s.register(i.conditions.actions.values),(l=i.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((c=>{if(c&&c.name){var u=this.qi.get(c.name);u&&u.push(i.id),this.qi.set(c.name,u||[i.id])}})))})))}Ji(e){var n,i=e.filter((o=>{var a,s;return((a=o.conditions)==null?void 0:a.events)&&((s=o.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0})),r=e.filter((o=>{var a,s;return((a=o.conditions)==null?void 0:a.cancelEvents)&&((s=o.conditions)==null||(s=s.cancelEvents)==null||(s=s.values)==null?void 0:s.length)>0}));(i.length!==0||r.length!==0)&&((n=this._instance)==null||n.Ai(((o,a)=>{this.onEvent(o,a)})),this.Hi=this.Gi(e,vc.Activation),this.Bi=this.Gi(e,vc.Cancellation))}onEvent(e,n){var i,r=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[Tf])||[];if(If.SHOWN===e&&n&&r.length>0){var o;xe.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:r});var a=n==null||(o=n.properties)==null?void 0:o.$survey_id;if(a){var s=r.indexOf(a);s>=0&&(r.splice(s,1),this.Xi(r))}}else{if(this.Bi.has(e)){var l=this.Vi(e,n,vc.Cancellation);l.length>0&&(xe.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((u=>u.id))}),l.forEach((u=>{var d,h=r.indexOf(u.id);h>=0&&r.splice(h,1),(d=this._instance)==null||d.cancelPendingSurvey(u.id)})),this.Xi(r))}if(this.Hi.has(e)){xe.info("survey event name matched",{event:e,eventPayload:n,surveys:this.Hi.get(e)});var c=this.Vi(e,n,vc.Activation);this.Xi(r.concat(c.map((u=>u.id))||[]))}}}onAction(e){var n,i=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[Tf])||[];this.qi.has(e)&&this.Xi(i.concat(this.qi.get(e)||[]))}Xi(e){var n;xe.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[Tf]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[Tf];return n||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},Iy=class{constructor(e){this.Zi=void 0,this._surveyManager=null,this.te=!1,this.ie=!1,this.ee=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(Ce(n))return xe.warn("Flags not loaded yet. Not loading surveys.");var i=Re(n);this.Zi=i?n.length>0:n,xe.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var i=localStorage.key(n);(i!=null&&i.startsWith(Dy)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)xe.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)xe.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())xe.info("Not loading surveys in cookieless mode without consent.");else{var e=ee?.__PosthogExtensions__;if(e){if(!$(this.Zi)||this._instance.config.advanced_enable_surveys){var n=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var i=e.generateSurveys;if(i)return void this.re(i,n);var r=e.loadExternalDependency;if(!r)return void this.se("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,n)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else xe.error("PostHog Extensions not found.")}}re(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new Ly(this._instance),xe.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,n){xe.error(e,n),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((n=>n!==e))}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return xe.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(ry);if(i&&!n)return e(i,{isLoaded:!0});if(this.te)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var o;this.te=!1;var a=r.statusCode;if(a!==200||!r.json){var s="Surveys API could not be loaded, status: "+a;return xe.error(s),e([],{isLoaded:!1,error:s})}var l,c=r.json.surveys||[],u=c.filter((d=>(function(h){return!(!h.start_date||h.end_date)})(d)&&((function(h){var m;return!((m=h.conditions)==null||(m=m.events)==null||(m=m.values)==null||!m.length)})(d)||(function(h){var m;return!((m=h.conditions)==null||(m=m.actions)==null||(m=m.values)==null||!m.length)})(d))));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(o=this._instance.persistence)==null||o.register({[ry]:c}),e(c,{isLoaded:!0})}})}catch(r){throw this.te=!1,r}}ne(e){for(var n of this.ee)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(i){xe.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!Ce(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);xe.warn("init was not called")}oe(e){var n=null;return this.getSurveys((i=>{var r;n=(r=i.find((o=>o.id===e)))!==null&&r!==void 0?r:null})),n}ae(e){if(Ce(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.oe(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Ce(this._surveyManager))return xe.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.ae(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return Ce(this._surveyManager)?(xe.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((i=>{this.getSurveys((r=>{var o,a=(o=r.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(a){var s=this.ae(a);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n){var i;if(Ce(this._surveyManager))xe.warn("init was not called");else{var r=typeof e=="string"?this.oe(e):e;if(r!=null&&r.id)if(r5.includes(r.type)){var o=U?.querySelector(n);if(o)return(i=r.appearance)!=null&&i.surveyPopupDelaySeconds?(xe.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,s;xe.info("Rendering survey "+r.id+" with delay of "+((a=r.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(s=this._surveyManager)==null||s.renderSurvey(r,o),xe.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,o);xe.warn("Survey element not found")}else xe.warn("Surveys of type "+r.type+" cannot be rendered in the app");else xe.warn("Survey not found")}}displaySurvey(e,n){var i;if(Ce(this._surveyManager))xe.warn("init was not called");else{var r=this.oe(e);if(r){var o=r;if((i=r.appearance)!=null&&i.surveyPopupDelaySeconds&&n.ignoreDelay&&(o=q({},r,{appearance:q({},r.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var a=this.canRenderSurvey(r);if(!a.visible)return void xe.warn("Survey is not eligible to be displayed: ",a.disabledReason)}n.displayType!==jT.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,n.selector)}else xe.warn("Survey not found")}}cancelPendingSurvey(e){Ce(this._surveyManager)?xe.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},IA=ct("[RateLimiter]"),Hy=class{constructor(e){var n,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var o=r.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((a=>{IA.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4}))}catch(a){return void IA.warn('could not rate limit - continuing. Error: "'+a?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((n=e.config.rate_limiting)==null?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)==null?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var n,i,r;e===void 0&&(e=!1);var o=new Date().getTime(),a=(n=(i=this.instance.persistence)==null?void 0:i.get_property(ay))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:o};a.tokens+=(o-a.last)/1e3*this.captureEventsPerSecond,a.last=o,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var s=a.tokens<1;return s||e||(a.tokens=Math.max(0,a.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(ay,a),{isRateLimited:s,remainingTokens:a.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}},na=ct("[RemoteConfig]"),zy=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=ee._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var n,i;(n=ee.__PosthogExtensions__)!=null&&n.loadExternalDependency?(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(na.error("PostHog Extensions not found. Cannot load remote config."),e())}ue(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return na.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void na.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return na.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((n=>{this.fi(n)}));this.fi(e)}))}catch(e){na.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()):na.info("__preview_remote_config is disabled. Logging config instead",e):na.error("Failed to fetch remote config from PostHog.")}},By=3e3,Fy=class{constructor(e,n){this.he=!0,this.ve=[],this.de=di(n?.flush_interval_ms||By,250,5e3,V.createLogger("flush interval"),By),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},n=Object.values(e);[...n.filter((i=>i.url.indexOf("/e")===0)),...n.filter((i=>i.url.indexOf("/e")!==0))].map((i=>{this.ce(q({},i,{transport:"sendBeacon"}))}))}enable(){this.he=!1,this.pe()}pe(){var e=this;this.he||(this.fe=setTimeout((()=>{if(this.ge(),this.ve.length>0){var n=this._e(),i=function(){var o=n[r],a=new Date().getTime();o.data&&Re(o.data)&&Me(o.data,(s=>{s.offset=Math.abs(s.timestamp-a),delete s.timestamp})),e.ce(o)};for(var r in n)i()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return Me(this.ve,(n=>{var i,r=n,o=(r?r.batchKey:null)||r.url;$(e[o])&&(e[o]=q({},r,{data:[]})),(i=e[o].data)==null||i.push(r.data)})),this.ve=[],e}},a5=["retriesPerformedSoFar"],$y=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!$(O)&&"onLine"in O.navigator&&(this.be=O.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},it(O,"online",this.we),it(O,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,i=UA(e,a5);hi(n)&&n>0&&(i.url=Kf(i.url,{retry_count:n})),this._instance.ci(q({},i,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(n??0)<10?this.Se(q({retriesPerformedSoFar:n},i)):i.callback==null||i.callback(r)}}))}Se(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var i=(function(a){var s=3e3*Math.pow(2,a),l=s/2,c=Math.min(18e5,s),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(n),r=Date.now()+i;this.ve.push({retryAt:r,requestOptions:e});var o="Enqueued failed request for retry in "+i;navigator.onLine||(o+=" (Browser is offline)"),V.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(),n=[],i=this.ve.filter((o=>o.retryAt<e||(n.push(o),!1)));if(this.ve=n,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,$(O)||(this.we&&(O.removeEventListener("online",this.we),this.we=void 0),this.xe&&(O.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(q({},e,{transport:"sendBeacon"}))}catch(n){V.error(n)}this.ve=[]}},Uy=class{constructor(e){this.ke=()=>{var n,i,r,o;this.Pe||(this.Pe={});var a=this.scrollElement(),s=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=s+(a?.clientHeight||0),u=a?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(s),this.Pe.maxScrollY=Math.max(s,(n=this.Pe.maxScrollY)!==null&&n!==void 0?n:0),this.Pe.maxScrollHeight=Math.max(l,(i=this.Pe.maxScrollHeight)!==null&&i!==void 0?i:0),this.Pe.lastContentY=c,this.Pe.maxContentY=Math.max(c,(r=this.Pe.maxContentY)!==null&&r!==void 0?r:0),this.Pe.maxContentHeight=Math.max(u,(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(O,"scroll",this.ke,{capture:!0}),it(O,"scrollend",this.ke,{capture:!0}),it(O,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return O?.document.documentElement;var e=Re(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var i=O?.document.querySelector(n);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return O&&(O.scrollY||O.pageYOffset||O.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return O&&(O.scrollX||O.pageXOffset||O.document.documentElement.scrollLeft)||0}},s5=t=>LT(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),Jf=class{constructor(e,n,i,r){this.Te=o=>{var a=this.Re();if(!a||a.sessionId!==o){var s={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[oy]:s})}},this._instance=e,this.Ce=n,this.Fe=i,this.Ie=r||s5,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[oy]}getSetOnceProps(){var e,n=(e=this.Re())==null?void 0:e.props;return n?"r"in n?IT(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return Me(Wy(this.getSetOnceProps()),((n,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+Uv(i)]=n})),e}},Bv=ct("[SessionId]"),ep=class{on(e,n){return this.Me.on(e,n)}constructor(e,n,i){var r;if(this.Oe=[],this.Ae=void 0,this.Me=new Lc,this.De=(u,d)=>Math.abs(u-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=n||eo,this.Ue=i||eo;var o=this.F.persistence_name||this.F.token,a=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*di(a,60,36e3,Bv.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=Et.W(this.He),l=Et.W(this.Be);s&&!l?this.je=s:Et.V(this.He),Et.G(this.Be,!0)}if((r=this.F.bootstrap)!=null&&r.sessionID)try{var c=(u=>{var d=u.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(),c)}catch(u){Bv.error("Invalid sessionID in bootstrap",u)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return $(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((n=>n!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&Et.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Et.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Et.W(this.He):null}We(e,n,i){e===this.Le&&n===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=n,this.Le=e,this.Fe.register({[Bf]:[n,e,i]}))}Ke(){var e=this.Fe.props[Bf];return Re(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&&O&&(O.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Et.V(this.Be)},it(O,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=n||new Date().getTime(),[r,o,a]=this.Ke(),s=this.Je(),l=hi(a)&&a>0&&Math.abs(i-a)>864e5,c=!1,u=!o,d=!u&&!e&&this.De(i,r);u||d||l?(o=this.Ne(),s=this.Ue(),Bv.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}}),a=i,c=!0):s||(s=this.Ue(),c=!0);var h=r===0||!e||l?i:r,m=a===0?new Date().getTime():a;return this.Ve(s),this.We(o,h,m),e||this.ze(),c&&this.Oe.forEach((S=>S(o,s,c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:s,sessionStartTimestamp:m,changeReason:c?{noSessionId:u,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 n=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}},l5=["$set_once","$set"],Qr=ct("[SiteApps]"),Vy=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,n){if(n){var i=this.globalsForEvent(n);this.Xe.push(i),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=ee._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ai(this.Qe.bind(this));this.Ze=()=>{e(),this.Xe=[],this.Ze=void 0}}}globalsForEvent(e){var n,i,r,o,a,s,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[h,m]of Object.entries(d))c[h]={id:u[h],type:h,properties:m};var{$set_once:S,$set:_}=e;return{event:q({},UA(e,l5),{properties:q({},e.properties,_?{$set:q({},(n=(i=e.properties)==null?void 0:i.$set)!==null&&n!==void 0?n:{},_)}:{},S?{$set_once:q({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},S)}:{}),elements_chain:(a=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var n=this.apps[e.id],i=()=>{var s;!n.errored&&this.Xe.length&&(Qr.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>n.processEvent==null?void 0:n.processEvent(l))),n.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((s=this.Ze)==null||s.call(this))},r=!1,o=s=>{n.errored=!s,n.loaded=!0,Qr.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:s=>{o(s)}});a&&(n.processEvent=a),r=!0}catch(s){Qr.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(r&&n.loaded)try{i()}catch(s){Qr.error("Error while processing buffered events PostHog app with config id "+e.id,s),n.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var n of e)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}ir(e){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{i.processEvent==null||i.processEvent(n)}catch(r){Qr.error("Error while processing event "+e.event+" for site app "+i.id,r)}}}onRemoteConfig(e){var n,i,r,o=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(c=>this.ir(c)))):void Qr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.Ze)==null||i.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(c){var u;ee["__$$ph_site_app_"+c]=o._instance,(u=ee.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,l,(d=>{if(d)return Qr.error("Error while initializing PostHog app with config id "+c,d)}))};for(var{id:s,url:l}of e.siteApps)a(s)}else Qr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},PT=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&XC(n,e))return!0;try{var i=t?.userAgentData;if(i!=null&&i.brands&&i.brands.some((r=>XC(r?.brand,e))))return!0}catch{}return!!t.webdriver},Cc=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),HA="i.posthog.com",jy=class{constructor(e){this.er={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+HA,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Cc.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Cc.EU:this.er[this.apiHost]=Cc.CUSTOM),this.er[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Cc.CUSTOM)return this.apiHost+n;var i=HA+n;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}},c5={icontains:(t,e)=>!!O&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!O&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!O&&Qf(e.href,t),not_regex:(t,e)=>!!O&&!Qf(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},Py=class t{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),n.getWebExperiments((r=>{t.rr("retrieved web experiments from the server"),n.sr=new Map,r.forEach((o=>{if(o.feature_flag_key){var a;n.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(a=n.sr)==null||a.set(o.feature_flag_key,o));var s=n._instance.getFeatureFlag(o.feature_flag_key);lt(s)&&o.variants[s]&&n.nr(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var c=o.variants[l];t.ar(c)&&n.nr(o.name,l,c.transforms)}}))}),i)},this._instance=e,this._instance.onFeatureFlags((i=>{this.onFeatureFlags(i)}))}onFeatureFlags(e){if(this._is_bot())t.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Ce(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((n=>{var i;if(this.sr&&(i=this.sr)!=null&&i.has(n)){var r,o=this._instance.getFeatureFlag(n),a=(r=this.sr)==null?void 0:r.get(n);o&&a!=null&&a.variants[o]&&this.nr(a.name,o,a.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=qf(e?.search,"__experiment_id"),i=qf(e?.search,"__experiment_variant");n&&i&&(t.rr("previewing web experiments "+n+" && "+i),this.getWebExperiments((r=>{this.lr(parseInt(n),i,r)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var a=o.json.experiments||[];return e(a)}})}lr(e,n,i){var r=i.filter((o=>o.id===e));r&&r.length>0&&(t.rr("Previewing web experiment ["+r[0].name+"] with variant ["+n+"]"),this.nr(r[0].name,n,r[0].variants[n].transforms))}static ar(e){return!Ce(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var n;if(Ce(e.conditions)||Ce((n=e.conditions)==null?void 0:n.url))return!0;var i,r,o,a=t.getWindowLocation();return!!a&&((i=e.conditions)==null||!i.url||c5[(r=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}static getWindowLocation(){return O?.location}static hr(e){var n;if(Ce(e.conditions)||Ce((n=e.conditions)==null?void 0:n.utm))return!0;var i=OT();if(i.utm_source){var r,o,a,s,l,c,u,d,h=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==i.utm_campaign,m=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==i.utm_source,S=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==i.utm_medium,_=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==i.utm_term;return h&&S&&_&&m}return!1}static rr(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];V.info("[WebExperiments] "+e,i)}nr(e,n,i){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?i.forEach((r=>{if(r.selector){var o;t.rr("applying transform of variant "+n+" for experiment "+e+" ",r);var a=(o=document)==null?void 0:o.querySelectorAll(r.selector);a?.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 hn&&this._instance?PT(hn,this._instance.config.custom_blocked_useragents):void 0}},u5=ct("[PostHog ExternalIntegrations]"),d5={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},qy=class{constructor(e){this._instance=e}it(e,n){var i;(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,(r=>{if(r)return u5.error("failed to load script",r);n()}))}startIfEnabledOrStop(){var e=this,n=function(a){var s,l,c;!r||(s=ee.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[a]||e.it(d5[a],(()=>{var u;(u=ee.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)})),!r&&(l=ee.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=ee.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[i,r]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;n(i)}}},Zy="[SessionRecording]",yc=ct(Zy),tp=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 yc.error("started without valid sessionManager"),new Error(Zy+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Zy+' cannot be used with cookieless_mode="always"')}get cr(){var e,n=!((e=this._instance.get_property(Av))==null||!e.enabled),i=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return O&&n&&i&&!r}startIfEnabledOrStop(e){var n;if(!this.cr||(n=this.vr)==null||!n.isStarted){var i=!$(Object.assign)&&!$(Array.from);this.cr&&i?(this.gr(e),yc.info("starting")):this.stopRecording()}}gr(e){var n,i,r;this.cr&&(ee!=null&&(n=ee.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(i=ee.__PosthogExtensions__)!=null&&i.initSessionRecording?this._r(e):(r=ee.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return yc.error("could not load recorder",o);this._r(e)})))}stopRecording(){var e,n;(e=this.pr)==null||e.call(this),this.pr=void 0,(n=this.vr)==null||n.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(KA)}br(e){if(this._instance.persistence){var n,i,r=this._instance.persistence,o=()=>{var a=e.sessionRecording===!1?void 0:e.sessionRecording,s=a?.sampleRate,l=Ce(s)?null:parseFloat(s);Ce(l)&&this.yr();var c=a?.minimumDurationMilliseconds;r.register({[Av]:q({enabled:!!a},a,{networkPayloadCapture:q({capturePerformance:e.capturePerformance},a?.networkPayloadCapture),canvasRecording:{enabled:a?.recordCanvas,fps:a?.canvasFps,quality:a?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:$(c)?null:c,endpoint:a?.endpoint,triggerMatchType:a?.triggerMatchType,masking:a?.masking,urlTriggers:a?.urlTriggers})})};o(),(n=this.pr)==null||n.call(this),this.pr=(i=this._instance.sessionManager)==null?void 0:i.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:yc.info("skipping remote config with no sessionRecording",e)}log(e,n){var i;n===void 0&&(n="log"),(i=this.vr)!=null&&i.log?this.vr.log(e,n):yc.warn("log called before recorder was ready")}get mr(){var e,n,i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Av);return(i==null||(n=i.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}_r(e){var n,i;if((n=ee.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(i=ee.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var n;(n=this.vr)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var n,i;this.vr||(i=this._instance.persistence)==null||i.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(n=this.vr)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var i;return!((i=this.vr)==null||!i.tryAddCustomEvent(e,n))}},kc={},Gy=()=>{},Ts="posthog",qT=!J3&&Xt?.indexOf("MSIE")===-1&&Xt?.indexOf("Mozilla")===-1,zA=t=>{var e;return q({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:o3(U?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Gy,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:Kt&<(Kt?.search)&&Kt.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:(O==null||(e=O.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var i="Bad HTTP status: "+n.statusCode+" "+n.text;V.error(i)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:By},error_tracking:{},_onCapture:Gy,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},BA=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 n=Xe({},e,t);return Re(t.property_blacklist)&&($(t.property_denylist)?n.property_denylist=t.property_blacklist:Re(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:V.error("Invalid value for property_denylist config: "+t.property_denylist)),n},Yy=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){V.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},np=class t{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new Yy,this.Sr=!1,this.version=Ki.LIB_VERSION,this.Er=new Lc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=zA(),this.SentryIntegration=vy,this.sentryIntegration=e=>(function(n,i){var r=pT(n,i);return{name:fT,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 My(this),this.toolbar=new yy(this),this.scrollManager=new Uy(this),this.pageViewManager=new Cy(this),this.surveys=new Iy(this),this.experiments=new Py(this),this.exceptions=new Oy(this),this.rateLimiter=new Hy(this),this.requestRouter=new jy(this),this.consent=new hy(this),this.externalIntegrations=new qy(this),this.people={set:(e,n,i)=>{var r=lt(e)?{[e]:n}:e;this.setPersonProperties(r),i?.({})},set_once:(e,n,i)=>{var r=lt(e)?{[e]:n}:e;this.setPersonProperties(void 0,r),i?.({})}},this.on("eventCaptured",(e=>V.info('send "'+e?.event+'"',e)))}init(e,n,i){if(i&&i!==Ts){var r,o=(r=kc[i])!==null&&r!==void 0?r:new t;return o._init(e,n,i),kc[i]=o,kc[Ts][i]=o,o}return this._init(e,n,i)}_init(e,n,i){var r;if(n===void 0&&(n={}),$(e)||Vv(e))return V.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Rr(n.debug),this.Ir=n,this.Fr=[],n.person_profiles&&(this.Pr=n.person_profiles),this.set_config(Xe({},zA(n.defaults),BA(n),{name:i,token:e})),this.config.on_xhr_error&&V.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:er.GZipJS;var o=this.Cr();this.persistence=new Tc(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Tc(q({},this.config,{persistence:"sessionStorage"}),o);var a=q({},this.persistence.props),s=q({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new Fy((p=>this.Or(p)),this.config.request_queue_config),this.Ar=new $y(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 ep(this),this.sessionPropsManager=new Jf(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(V.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(V.info("Initializing extensions synchronously"),this.Dr(l)),Ki.DEBUG=Ki.DEBUG||this.config.debug,Ki.DEBUG&&V.info("Starting in debug mode",{this:this,config:n,thisC:q({},this.config),p:a,s}),((r=n.bootstrap)==null?void 0:r.distinctID)!==void 0){var c,u,d=this.config.get_device_id(eo()),h=(c=n.bootstrap)!=null&&c.isIdentifiedID?d:n.bootstrap.distinctID;this.persistence.set_property(Qi,(u=n.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:h})}if(this.jr()){var m,S,_=Object.keys(((m=n.bootstrap)==null?void 0:m.featureFlags)||{}).filter((p=>{var v;return!((v=n.bootstrap)==null||(v=v.featureFlags)==null||!v[p])})).reduce(((p,v)=>{var y;return p[v]=((y=n.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[v])||!1,p}),{}),b=Object.keys(((S=n.bootstrap)==null?void 0:S.featureFlagPayloads)||{}).filter((p=>_[p])).reduce(((p,v)=>{var y,w;return(y=n.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[v]&&(p[v]=(w=n.bootstrap)==null||(w=w.featureFlagPayloads)==null?void 0:w[v]),p}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:b})}if(l)this.register_once({distinct_id:uc,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(eo());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(Qi,"anonymous")}return it(O,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?T3(this,(()=>this.Lr())):this.Lr(),to(this.config._onCapture)&&this.config._onCapture!==Gy&&(V.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(p=>this.config._onCapture(p.event,p)))),this.config.ip&&V.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Dr(e){var n=performance.now();this.historyAutocapture=new my(this),this.historyAutocapture.startIfEnabled();var i=[];i.push((()=>{new by(this).startIfEnabledOrStop()})),i.push((()=>{var r;this.siteApps=new Vy(this),(r=this.siteApps)==null||r.init()})),e||i.push((()=>{this.sessionRecording=new tp(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),i.push((()=>{this.autocapture=new uy(this),this.autocapture.startIfEnabled()})),i.push((()=>{this.surveys.loadIfEnabled()})),i.push((()=>{this.heatmaps=new Ey(this),this.heatmaps.startIfEnabled()})),i.push((()=>{this.webVitalsAutocapture=new wy(this)})),i.push((()=>{this.exceptionObserver=new gy(this),this.exceptionObserver.startIfEnabled()})),i.push((()=>{this.deadClicksAutocapture=new Gf(this,A3),this.deadClicksAutocapture.startIfEnabled()})),i.push((()=>{if(this.Nr){var r=this.Nr;this.Nr=void 0,this.fi(r)}})),this.Ur(i,n)}Ur(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,n)}),0);var i=e.shift();if(i)try{i()}catch(o){V.error("Error initializing extension:",o)}}var r=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&V.info("PostHog extensions initialized ("+r+"ms)")}fi(e){var n,i,r,o,a,s,l,c;if(!U||!U.body)return V.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=de(e.supportedCompression,er.GZipJS)?er.GZipJS:de(e.supportedCompression,er.Base64)?er.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(i=this.siteApps)==null||i.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){V.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new zy(this).load(),this.featureFlags.flags()}zr(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Mr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&io(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,n;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(n=this.Ar)==null||n.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(qT?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Kf(e.url,{ip:this.config.ip?1:0}),e.headers=q({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var i,r,o,a=q({},n);a.timeout=a.timeout||6e4,a.url=Kf(a.url,{_:new Date().getTime().toString(),ver:Ki.LIB_VERSION,compression:a.compression});var s=(i=a.transport)!==null&&i!==void 0?i:"fetch",l=Lf.filter((u=>!a.disableTransport||!u.transport||!a.disableTransport.includes(u.transport))),c=(r=(o=YA(l,(u=>u.transport===s)))==null?void 0:o.method)!==null&&r!==void 0?r:l[0].method;if(!c)throw new Error("No available transport method");c(a)})(q({},e,{callback:n=>{var i,r;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((i=(r=this.config).on_request_error)==null||i.call(r,n)),e.callback==null||e.callback(n)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var n,i=[],r=[],o=[];io(e,(s=>{s&&(n=s[0],Re(n)?o.push(s):to(s)?s.call(this):Re(s)&&n==="alias"?i.push(s):Re(s)&&n.indexOf("capture")!==-1&&to(this[n])?o.push(s):r.push(s))}));var a=function(s,l){io(s,(function(c){if(Re(c[0])){var u=l;Me(c,(function(d){u=u[d[0]].apply(u,d.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};a(i,this),a(r,this),a(o,this)}jr(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!$(e)&<(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var a=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a==null||!a.isRateLimited){n!=null&&n.$current_url&&!lt(n?.$current_url)&&(V.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,l=i?.timestamp||s,c=eo(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,n||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),a&&(u.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),i?.$set&&(u.$set=i?.$set);var d,h=this.qr(i?.$set_once);if(h&&(u.$set_once=h),(u=i3(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,$(i?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=s),e===If.DISMISSED||e===If.SENT){var m=n?.[DA.SURVEY_ID],S=n?.[DA.SURVEY_ITERATION];d={id:m,current_iteration:S},localStorage.getItem(LA(d))||localStorage.setItem(LA(d),"true"),u.$set=q({},u.$set,{[i5({id:m,current_iteration:S},e===If.SENT?"responded":"dismissed")]:!0})}var _=q({},u.properties.$set,u.$set);if(ks(_)||this.setPersonPropertiesForFlags(_),!Ce(this.config.before_send)){var b=this.Wr(u);if(!b)return;u=b}this.Er.emit("eventCaptured",u);var f={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.Or(f):this.Mr.enqueue(f),u}V.critical("This capture call is ignored due to client rate limiting.")}}else V.error("No event name provided to posthog.capture")}else V.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,i,r,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return n;var a=o?void 0:this.persistence.remove_event_timer(e),s=q({},n);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(s.$cookieless_mode=!0),e==="$snapshot"){var l=q({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!lt(s.distinct_id)&&!hi(s.distinct_id)||Vv(s.distinct_id))&&V.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var c,u=j3(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime());s.$session_id=d,s.$window_id=h}this.sessionPropsManager&&Xe(s,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&Xe(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(m=this.Ar)==null?void 0:m.length}catch(f){s.$sdk_debug_error_capturing_properties=String(f)}if(this.requestRouter.region===Cc.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),s=Xe(s,c),e==="$pageview"&&U&&(s.title=U.title),!$(a)){var S=i.getTime()-a;s.$duration=parseFloat((S/1e3).toFixed(3))}Xt&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Xe({},u,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Re(this.config.property_denylist)?Me(this.config.property_denylist,(function(f){delete s[f]})):V.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(V.error("sanitize_properties is deprecated. Use before_send instead"),s=_(s,e));var b=this.Gr();return s.$process_person_profile=b,b&&!o&&this.Vr("_calculate_event_properties"),s}qr(e){var n;if(!this.persistence||!this.Gr()||this.Sr)return e;var i=this.persistence.get_initial_props(),r=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),o=Xe({},i,r||{},e||{}),a=this.config.sanitize_properties;return a&&(V.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),this.Sr=!0,ks(o)?void 0:o}register(e,n){var i;(i=this.persistence)==null||i.register(e,n)}register_once(e,n,i){var r;(r=this.persistence)==null||r.register_once(e,n,i)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}Jr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,n,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,i)}getEarlyAccessFeatures(e,n,i){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,i)}on(e,n){return this.Er.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,i;return(n=(i=this.sessionManager)==null?void 0:i.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=o5),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,i){if(!this.__loaded||!this.persistence)return V.uninitializedWarning("posthog.identify");if(hi(e)&&(e=e.toString(),V.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()))V.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!==uc){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(bc)&&(this.unregister(bc),this.register({distinct_id:e}));var a=(this.persistence.get_property(Qi)||"anonymous")==="anonymous";e!==r&&a?(this.persistence.set_property(Qi,"identified"),this.setPersonPropertiesForFlags(q({},i||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:n||{},$set_once:i||{}}),this.Tr=kA(e,n,i),this.featureFlags.setAnonymousDistinctId(r)):(n||i)&&this.setPersonProperties(n,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(Ff))}}else V.critical('The string "'+uc+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else V.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Vr("posthog.setPersonProperties")){var i=kA(this.get_distinct_id(),e,n);this.Tr!==i?(this.setPersonPropertiesForFlags(q({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Tr=i):V.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,i){if(e&&n){if(this.Vr("posthog.group")){var r=this.getGroups();r[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:q({},r,{[e]:n})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===n||i||this.reloadFeatureFlags()}}else V.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,i,r,o;if(V.info("reset"),!this.__loaded)return V.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(i=this.sessionPersistence)==null||i.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(Qi,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:uc,$device_id:null},"");else{var s=this.config.get_device_id(eo());this.register_once({distinct_id:s,$device_id:e?s:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&i){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!i)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-a,0)}return r}alias(e,n){return e===this.get_property(WA)?(V.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?($(n)&&(n=this.get_distinct_id()),e!==n?(this.Jr(bc,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(V.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=q({},this.config);if(pt(e)){var i,r,o,a,s;Xe(this.config,BA(e));var l=this.Cr();(i=this.persistence)==null||i.update_config(this.config,n,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Tc(q({},this.config,{persistence:"sessionStorage"}),l);var c=this.Rr(this.config.debug);no(c)&&(this.config.debug=c),no(this.config.debug)&&(this.config.debug?(Ki.DEBUG=!0,qe.H()&&qe.G("ph_debug","true"),V.info("set_config",{config:e,oldConfig:n,newConfig:q({},this.config)})):(Ki.DEBUG=!1,qe.H()&&qe.V("ph_debug"))),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,i={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var r,o,a,s,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),i.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),i.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),i.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),i.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(q({},r,n))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Ts;return n!==Ts&&(n=Ts+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Qi))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(Qi))==="identified"}Gr(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ks(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[bc])&&((n=this.persistence)==null||(n=n.props)==null||!n[Uf]))}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"?(V.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(Uf,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}Kr(){var e,n,i,r,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((i=this.persistence)==null||i.set_disabled(o)),((n=this.sessionPersistence)==null?void 0:n.wi)!==o&&((r=this.sessionPersistence)==null||r.set_disabled(o)),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var i,r;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(i=this.sessionManager)==null||i.destroy(),this.sessionManager=new ep(this),this.persistence&&(this.sessionPropsManager=new Jf(this,this.sessionManager,this.persistence)),this.sessionRecording=new tp(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),($(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 V.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:uc,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Hr())):V.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===Ji.GRANTED?"granted":e===Ji.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 hn?PT(hn,this.config.custom_blocked_useragents):void 0}Hr(){U&&(U.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:U.title},{send_instantly:!0}),this.kr&&(U.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),it(U,"visibilitychange",this.kr)))}debug(e){e===!1?(O?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(O?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,n,i,r,o,a,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?(V.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(i="advanced_disable_decide",r=!1,o=V,a=(n="advanced_disable_flags")in(e=l)&&!$(e[n]),s=i in e&&!$(e[i]),a?e[n]:s?(o&&o.warn("Config field '"+i+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[i]):r)}Wr(e){if(Ce(this.config.before_send))return e;var n=Re(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of n){if(i=r(i),Ce(i)){var o="Event '"+e.event+"' was rejected in beforeSend function";return $L(e.event)?V.warn(o+". This can cause unexpected behavior."):V.info(o),null}i.properties&&!ks(i.properties)||V.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(i)})}Rr(e){var n=no(e)&&!e,i=qe.H()&&qe.q("ph_debug")==="true";return!n&&(!!i||e)}};(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=n3(t.prototype[e[n]])})(np,["identify"]);var FA,ZT=(FA=kc[Ts]=new np,(function(){function t(){t.done||(t.done=!0,qT=!1,Me(kc,(function(e){e._dom_loaded()})))}U!=null&&U.addEventListener?U.readyState==="complete"?t():it(U,"DOMContentLoaded",t,{capture:!1}):O&&V.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),FA);var ob=class{constructor(e={}){this.options=e;P(this,"client");P(this,"featureFlagsCallback");P(this,"captureCallback");P(this,"consentUnsub");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&e.consent&&e.requireExplicitConsent&&typeof window<"u"&&e.apiKey){let n=e.consent;n.getStatus()==="granted"&&this.initPostHog(),this.consentUnsub=n.subscribe(r=>{r==="granted"?this.client?this.client.opt_in_capturing():this.initPostHog():r==="denied"&&this.client&&this.client.opt_out_capturing()});return}!this.client&&typeof window<"u"&&e.apiKey&&this.initPostHog()}initPostHog(){let e=this.options;if(!e.apiKey)return;let n=e.enableFeatureFlags??!0,i=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=ZT.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!n,advanced_disable_feature_flags_on_first_load:!n,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:r=>{if(n&&this.featureFlagsCallback){r.onFeatureFlags(()=>{let a=this.getAllFeatureFlags();a&&this.featureFlagsCallback&&this.featureFlagsCallback(a)});let o=this.getAllFeatureFlags();o&&Object.keys(o).length>0&&this.featureFlagsCallback(o)}this.captureCallback&&r.on("eventCaptured",o=>{let a=typeof o=="string"?o:o?.event,s=typeof o=="string"?void 0:o?.properties;typeof a=="string"&&this.captureCallback?.(a,s)})}},i)}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let n={};for(let[i,r]of Object.entries(e))i.startsWith("in_segment_")&&(n[i]=r===!0);return n}identify(e,n){this.client?.identify(e,n)}alias(e,n){this.client?.alias(e,n)}track(e,n){this.client?.capture(e,n)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,n){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:n})}trackAction(e,n,i){this.track("shadow_canvas_action",{action:e,rectangleId:n,surface:i})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,n,i){let r=`$experiment_${e}`;this.register({[r]:i??`variation_${n}`,[`${r}_id`]:n}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:n,$experiment_variation_name:i??`variation_${n}`})}setPersonProperties(e){this.client?.capture("$set",{$set:e})}setPersonPropertiesOnce(e){this.client?.capture("$set",{$set_once:e})}getDistinctId(){return this.client?.get_distinct_id?.()}};function ab(t={}){return new ob(t)}var sb=async(t,e)=>{let n=[];if(e.applyAction)for(let i of t.actions){let r=await e.applyAction(i);n.push(r)}return{cleanup:async()=>{for(let i=n.length-1;i>=0;i--)try{await n[i].revert()}catch{}}}},lb=async(t,e)=>{let n=[];if(e.applyAction){let i=t.actions.map(r=>e.applyAction(r));if(t.waitFor==="any"){let r=await Promise.race(i);n.push(r);let o=await Promise.allSettled(i);for(let a of o)a.status==="fulfilled"&&a.value!==r&&n.push(a.value)}else{let r=await Promise.all(i);n.push(...r)}}return{cleanup:async()=>{for(let i of n)try{await i.revert()}catch{}}}},cb=async(t,e)=>{let n,i,r=!1,o={cleanup:()=>{r=!0,i&&clearTimeout(i),n&&n()}};return t.event&&e.subscribeEvent?await new Promise(a=>{n=e.subscribeEvent(t.event,()=>{r||a()}),t.durationMs!==void 0&&(i=setTimeout(()=>{r||a()},t.durationMs))}):t.durationMs!==void 0&&await new Promise(a=>{i=setTimeout(()=>{r||a()},t.durationMs)}),o};var ap=class{constructor(){P(this,"executors",new Map);for(let{kind:e,executor:n}of rm)this.registerCore(e,n);for(let{kind:e,executor:n}of mm)this.registerCore(e,n);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",cb)}registerCore(e,n,i){this.executors.set(e,{kind:e,executor:n,schema:i,source:"core",isBuiltIn:!0})}register(e,n,i,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:n,schema:i,source:r,isBuiltIn:o})}unregister(e){let n=this.executors.get(e);return n?n.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[n,i]of this.executors.entries())i.source===e&&this.executors.delete(n)}get(e){return this.executors.get(e)?.executor}getRegistration(e){return this.executors.get(e)}has(e){return this.executors.has(e)}validate(e){let n=[];if(!e||typeof e!="object")return n.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:n,warnings:[]};let{kind:i}=e;if(!i||typeof i!="string")return n.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:n,warnings:[]};let r=this.executors.get(i);if(!r)return n.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:n,warnings:[]};if(r.schema){let o=r.schema.safeParse(e);if(!o.success){for(let a of o.error.issues)n.push({code:"SCHEMA_VALIDATION_ERROR",message:a.message,field:a.path.join(".")});return{valid:!1,errors:n,warnings:[]}}}return{valid:!0,errors:[],warnings:[]}}list(){return Array.from(this.executors.keys())}listRegistrations(){return Array.from(this.executors.values())}getBuiltInKinds(){return Array.from(this.executors.entries()).filter(([,e])=>e.isBuiltIn).map(([e])=>e)}getCustomKinds(){return Array.from(this.executors.entries()).filter(([,e])=>!e.isBuiltIn).map(([e])=>e)}},nr=new ap;function f5(t){return nr.get(t)}function ub(t){return nr.has(t)}var p5=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),GT=5e4,YT=50;function ao(t){let e=[],n=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:n};let{kind:i}=t;if(!i||typeof i!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:n};if(!ub(i)&&i!=="core:mountWidget"){let r=nr.list();return console.error(`[ActionValidation] Unknown action kind: "${i}". Registered kinds (${r.length}): [${r.join(", ")}]. This usually means the app that provides "${i}" hasn't been activated yet, or the executor was never registered in ExecutorRegistry.`),e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:e,warnings:n}}switch(i){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":oo(t,e,n);break;case"overlays:badge":oo(t,e,n),h5(t,e,n);break;case"overlays:tooltip":oo(t,e,n),g5(t,e,n);break;case"overlays:modal":A5(t,e,n);break;case"content:insertHtml":oo(t,e,n),m5(t,e,n);break;case"content:setText":oo(t,e,n),v5(t,e,n);break;case"content:setAttr":oo(t,e,n),y5(t,e,n);break;case"content:addClass":case"content:removeClass":oo(t,e,n),b5(t,e,n);break;case"content:setStyle":oo(t,e,n),_5(t,e,n);break;case"core:mountWidget":S5(t,e,n);break;case"core:wait":x5(t,e,n);break;case"core:sequence":w5(t,e,n);break;case"core:parallel":E5(t,e,n);break;case"core:tour":T5(t,e,n);break;case"navigation:navigate":C5(t,e,n);break}return{valid:e.length===0,errors:e,warnings:n}}function oo(t,e,n){let i=t.anchorId;if(!i||typeof i!="object"){e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' object with a 'selector' string",field:"anchorId"});return}if(!i.selector||typeof i.selector!="string"?e.push({code:"MISSING_ANCHOR_SELECTOR",message:"anchorId requires a 'selector' string",field:"anchorId.selector"}):i.selector.length>200&&n.push({code:"LONG_ANCHOR_ID",message:"Anchor selector is unusually long",suggestion:"Consider using a shorter, more descriptive selector"}),i.route===void 0||i.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(i.route)?i.route:[i.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 h5(t,e,n){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&n.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function g5(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Tooltip action requires 'content' object",field:"content"});return}(!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Tooltip content requires 'body' property",field:"content.body"})}function m5(t,e,n){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>GT&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${GT}`,field:"html"});let i=["before","after","prepend","append","replace"];(!t.position||!i.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${i.join(", ")}`,field:"position"})}function v5(t,e,n){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function y5(t,e,n){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(p5.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 b5(t,e,n){!t.className||typeof t.className!="string"?e.push({code:"MISSING_CLASS_NAME",message:"Class action requires 'className' property",field:"className"}):/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t.className)||n.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function _5(t,e,n){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let i=Object.keys(t.styles).length;i>YT&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${i}). Maximum is ${YT}`,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 S5(t,e,n){(!t.slot||typeof t.slot!="string")&&e.push({code:"MISSING_SLOT",message:"mountWidget action requires 'slot' property",field:"slot"}),!t.widget||typeof t.widget!="object"?e.push({code:"MISSING_WIDGET",message:"mountWidget action requires 'widget' object",field:"widget"}):(!t.widget.widgetId||typeof t.widget.widgetId!="string")&&e.push({code:"MISSING_WIDGET_ID",message:"Widget must have a 'widgetId' property",field:"widget.widgetId"})}function x5(t,e,n){t.durationMs===void 0&&!t.event&&e.push({code:"MISSING_WAIT_CONFIG",message:"wait action requires either 'durationMs' or 'event' property"}),t.durationMs!==void 0&&t.durationMs<0&&e.push({code:"INVALID_DURATION",message:"durationMs must be a positive number",field:"durationMs"}),t.event!==void 0&&typeof t.event!="string"&&e.push({code:"INVALID_EVENT",message:"event must be a string",field:"event"})}function w5(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"sequence action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let i=0;i<t.actions.length;i++){let r=ao(t.actions[i]);for(let o of r.errors)e.push({...o,field:`actions[${i}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)n.push(o)}}function E5(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"parallel action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_PARALLEL",message:"parallel has no actions",suggestion:"Add at least one action to the parallel group"}),t.waitFor&&!["all","any"].includes(t.waitFor)&&e.push({code:"INVALID_WAIT_FOR",message:"waitFor must be 'all' or 'any'",field:"waitFor"});for(let i=0;i<t.actions.length;i++){let r=ao(t.actions[i]);for(let o of r.errors)e.push({...o,field:`actions[${i}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)n.push(o)}}function C5(t,e,n){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let i=t.url.trim().toLowerCase();i.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),i.startsWith("data:")&&n.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function A5(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Modal action requires 'content' object",field:"content"});return}if((!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Modal content requires 'body' property",field:"content.body"}),t.size&&!["sm","md","lg"].includes(t.size)&&e.push({code:"INVALID_SIZE",message:"Modal size must be 'sm', 'md', or 'lg'",field:"size"}),t.ctaButtons)if(!Array.isArray(t.ctaButtons))e.push({code:"INVALID_CTA_BUTTONS",message:"ctaButtons must be an array",field:"ctaButtons"});else for(let i=0;i<t.ctaButtons.length;i++){let r=t.ctaButtons[i];(!r.label||typeof r.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${i} requires 'label' property`,field:`ctaButtons[${i}].label`}),(!r.actionId||typeof r.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${i} requires 'actionId' property`,field:`ctaButtons[${i}].actionId`})}}function T5(t,e,n){if((!t.tourId||typeof t.tourId!="string")&&e.push({code:"MISSING_TOUR_ID",message:"Tour action requires 'tourId' property",field:"tourId"}),!t.steps||!Array.isArray(t.steps)){e.push({code:"MISSING_STEPS",message:"Tour action requires 'steps' array",field:"steps"});return}t.steps.length===0&&e.push({code:"EMPTY_STEPS",message:"Tour must have at least one step",field:"steps"});let i=new Set;for(let r=0;r<t.steps.length;r++){let 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`}):(i.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${r}].id`}),i.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 a=ao(o.action);for(let s of a.errors)e.push({...s,field:`steps[${r}].action${s.field?`.${s.field}`:""}`});for(let s of a.warnings)n.push(s)}if(o.onAction)for(let[a,s]of Object.entries(o.onAction))s!=="end"&&!t.steps.some(l=>l.id===s)&&n.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=[],n=[];if(!Array.isArray(t))return console.error("[ActionValidation] validateActions called with non-array:",typeof t),e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:n};for(let i=0;i<t.length;i++){let r=ao(t[i]);if(!r.valid){let o=t[i];console.error(`[ActionValidation] Action [${i}] failed validation:`,`kind="${o?.kind??"undefined"}"`,r.errors.map(a=>`${a.code}: ${a.message}`).join("; "),o)}for(let o of r.errors)e.push({...o,field:o.field?`[${i}].${o.field}`:`[${i}]`});for(let o of r.warnings)n.push({...o,suggestion:o.suggestion?`Action ${i}: ${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(i=>`${i.field??"?"}: ${i.message}`).join(" | ")),{valid:e.length===0,errors:e,warnings:n}}var k5=0;function fb(t){let{overlayRoot:e,eventBus:n,surfaces:i,anchorResolver:r,waitForAnchor:o,adaptiveId:a,executorRegistry:s=nr,subscribeNavigation:l,runtime:c}=t,u=new Map,d=new Map;function h(){return`action-${++k5}`}function m(x,T){n&&n.publish(x,T)}function S(){return{overlayRoot:e,resolveAnchor:r,waitForAnchor:o,generateId:h,publishEvent:m,adaptiveId:a,applyAction:p,subscribeEvent:n?(x,T)=>n.subscribe({names:[x]},k=>T(k.props)):void 0,subscribeNavigation:l}}async function _(x,T){if(!i)throw new Error("Surfaces provider required for core:mountWidget actions");let k=i.mount(x.slot,{type:"widget",widgetId:x.widget.widgetId,config:x.widget.props},{priority:x.widget.priority});return T.publishEvent("action.applied",{id:T.generateId(),kind:"core:mountWidget",slot:x.slot,widgetId:x.widget.widgetId}),{cleanup:()=>{k.unmount()},updateFn:E=>{if("widget"in E&&E.widget){let R=E.widget;R.props&&k.update({type:"widget",widgetId:x.widget.widgetId,config:R.props})}}}}async function b(x,T){if(x.kind==="core:mountWidget")return _(x,T);let k=s.get(x.kind);if(!k){let E="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${x.kind}".`,`Registered: [${E}]`),new Error(`No executor for action kind: ${x.kind}`)}return k(x,T)}function f(x,T,k,E){if(!c)return;let R=[],D=async()=>{let N=u.get(x);if(!N)return;let B=c.evaluateSync(k).value;if(N.state==="applied"&&!B){try{await N.cleanup()}catch(z){console.error(`[ActionEngine] Error reverting conditional action ${x}:`,z)}N.state="deferred",N.cleanup=()=>{},N.updateFn=void 0,m("action.deferred",{id:x,kind:T.kind})}else if(N.state==="deferred"&&B)try{let z=S(),te=await b(T,z);N.state="applied",N.cleanup=te.cleanup,N.updateFn=te.updateFn,N.appliedTs=Date.now(),m("action.applied",{id:x,kind:T.kind,anchorId:"anchorId"in T?T.anchorId:void 0})}catch(z){console.error(`[ActionEngine] Error applying deferred action ${x}:`,z),N.state="failed"}};c.context&&R.push(c.context.subscribe(D)),c.accumulator&&R.push(c.accumulator.subscribe(D)),d.set(x,R)}async function p(x){let T=ao(x);if(!T.valid){let B=T.errors.map(z=>z.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${x?.kind}":`,B,x),new Error(`Action validation failed: ${B}`)}let k=h(),E=x.triggerWhen;if(E&&c&&!c.evaluateSync(E).value){let z={id:k,action:x,adaptiveId:a,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};u.set(k,z);let te={id:k,action:x,async revert(){let I=u.get(k);if(!I)return;let G=d.get(k);if(G){for(let J of G)J();d.delete(k)}I.state="reverted",u.delete(k)},isApplied(){return u.get(k)?.state==="applied"},async update(I){let G=u.get(k);if(!G||G.state!=="applied")throw new Error("Cannot update action that is not applied");if(G.updateFn)await G.updateFn(I);else throw new Error(`Action kind ${x.kind} does not support updates`)},getState(){return u.get(k)?.state??"reverted"}};return f(k,x,E,te),te}let R=S(),D=await b(x,R),N={id:k,action:x,adaptiveId:a,appliedTs:Date.now(),state:"applied",cleanup:D.cleanup,updateFn:D.updateFn};u.set(k,N),m("action.applied",{id:k,kind:x.kind,anchorId:"anchorId"in x?x.anchorId:void 0});let H={id:k,action:x,async revert(){let B=u.get(k);if(!B||B.state!=="applied")return;let z=d.get(k);if(z){for(let te of z)te();d.delete(k)}try{await B.cleanup(),B.state="reverted",m("action.reverted",{id:k,kind:x.kind})}catch(te){throw B.state="failed",m("action.failed",{id:k,kind:x.kind,error:String(te)}),te}finally{u.delete(k)}},isApplied(){return u.get(k)?.state==="applied"},async update(B){let z=u.get(k);if(!z||z.state!=="applied")throw new Error("Cannot update action that is not applied");if(z.updateFn)await z.updateFn(B);else throw new Error(`Action kind ${x.kind} does not support updates`)},getState(){return u.get(k)?.state??"reverted"}};return E&&c&&f(k,x,E,H),H}async function v(x){console.log(`[ActionEngine] applyBatch: ${x.length} action(s)`,x.map(N=>N.kind).join(", "));let T=db(x);if(!T.valid){let N=T.errors.map(H=>H.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${x.length} action(s):`,N,`
|
|
444
|
-
Actions:`,
|
|
445
|
-
`)),new Error(`Batch validation failed: ${N}`)}let k=h(),E=[],R=[];try{for(let N of x){let H=await p(N);E.push(H),R.push(H)}}catch(N){console.error(`[ActionEngine] Batch apply FAILED at action ${R.length+1}/${x.length}.`,`Successfully applied: ${R.length}. Rolling back...`,N);for(let H of R)try{await H.revert()}catch{}throw N}return{id:k,handles:E,async revertAll(){for(let N=E.length-1;N>=0;N--)try{await E[N].revert()}catch(H){console.error(`[ActionEngine] Error reverting action ${E[N].id}:`,H)}},isApplied(){return E.every(N=>N.isApplied())}}}function y(x){return ao(x)}function w(){return Array.from(u.values()).map(x=>({id:x.id,action:x.action,adaptiveId:x.adaptiveId,appliedTs:x.appliedTs,state:x.state}))}function A(){for(let x of d.values())for(let T of x)try{T()}catch{}d.clear();for(let x of u.values())if(x.state==="applied")try{x.cleanup()}catch(T){console.error("[ActionEngine] Error during cleanup:",T)}u.clear()}return{apply:p,applyBatch:v,validate:y,getActive:w,destroy:A}}var R5=g.object({selector:g.string(),route:g.union([g.string(),g.array(g.string())])}).strict(),pb=g.object({type:g.literal("page_url"),url:g.string()}),hb=g.object({type:g.literal("route"),routeId:g.string()}),gb=g.object({type:g.literal("anchor_visible"),anchorId:g.string(),state:g.enum(["visible","present","absent"])}),mb=g.object({type:g.literal("event_occurred"),eventName:g.string(),withinMs:g.number().optional()}),vb=g.object({type:g.literal("state_equals"),key:g.string(),value:g.unknown()}),yb=g.object({type:g.literal("viewport"),minWidth:g.number().optional(),maxWidth:g.number().optional(),minHeight:g.number().optional(),maxHeight:g.number().optional()}),bb=g.object({type:g.literal("session_metric"),key:g.string(),operator:g.enum(["gte","lte","eq","gt","lt"]),threshold:g.number()}),_b=g.object({type:g.literal("dismissed"),key:g.string(),inverted:g.boolean().optional()}),Sb=g.object({type:g.literal("cooldown_active"),key:g.string(),inverted:g.boolean().optional()}),xb=g.object({type:g.literal("frequency_limit"),key:g.string(),limit:g.number(),inverted:g.boolean().optional()}),Bc=g.object({equals:g.union([g.string(),g.number(),g.boolean()]).optional(),contains:g.string().optional()}),Fc=g.object({events:g.array(g.string()).min(1),match:g.record(g.string(),Bc).optional()}),wb=g.object({type:g.literal("event_count"),key:g.string(),operator:g.enum(["gte","lte","eq","gt","lt"]),count:g.number().int().min(0),withinMs:g.number().positive().optional(),counter:Fc.optional()}),zs=g.discriminatedUnion("type",[pb,hb,gb,mb,vb,yb,bb,_b,Sb,xb,wb]),$c=g.object({conditions:g.array(zs),value:g.unknown()}),Uc=g.object({type:g.literal("rules"),rules:g.array($c),default:g.unknown()}),Vc=g.object({type:g.literal("score"),field:g.string(),threshold:g.number(),above:g.unknown(),below:g.unknown()}),jc=g.object({type:g.literal("model"),modelId:g.string(),inputs:g.array(g.string()),outputMapping:g.record(g.string(),g.unknown()),default:g.unknown()}),Pc=g.object({type:g.literal("external"),endpoint:g.string(),method:g.enum(["GET","POST"]).optional(),default:g.unknown(),timeoutMs:g.number().optional()}),so=g.discriminatedUnion("type",[Uc,Vc,jc,Pc]),O5=so.nullable().optional(),M5=g.object({events:g.array(g.string()),urlContains:g.string().optional(),props:g.record(g.union([g.string(),g.number(),g.boolean()])).optional()}),N5=g.object({title:g.string().optional(),body:g.string().optional(),icon:g.string().optional()}).nullable().optional();var WT=g.object({include:g.array(g.string()).optional(),exclude:g.array(g.string()).optional()}),Bs=g.object({routes:WT,strategy:so.optional()});function a$(t){return zs.safeParse(t)}function s$(t){return so.safeParse(t)}function l$(t){return Bs.safeParse(t)}var c$=[{defName:"matchOp",schema:Bc},{defName:"counterDef",schema:Fc},{defName:"activationConfig",schema:Bs},{defName:"routeFilter",schema:WT},{defName:"ruleStrategy",schema:Uc},{defName:"scoreStrategy",schema:Vc},{defName:"modelStrategy",schema:jc},{defName:"externalStrategy",schema:Pc},{defName:"rule",schema:$c},{defName:"condition",schema:zs}];var Eb=g.object({tileId:g.string(),itemId:g.string().optional()}).strict(),D5=g.object({on:g.string(),title:g.string(),body:g.string().optional(),icon:g.string().optional(),ttl:g.number().optional(),cooldown:g.number().optional(),deepLink:Eb.optional()}).strict(),L5=g.object({id:g.string(),title:g.string().optional(),priority:g.number().optional(),widget:g.string(),props:g.record(g.unknown()).optional(),activation:Bs.optional(),notifications:g.array(D5).optional()}).strict(),I5=g.object({position:g.enum(["left","right"]).optional(),background:g.string().optional(),blur:g.string().optional(),border:g.string().optional(),width:g.string().optional()}),H5=g.object({background:g.string().optional(),backgroundHover:g.string().optional(),color:g.string().optional(),size:g.string().optional(),shadow:g.string().optional()}),z5=g.object({background:g.string().optional(),backgroundHover:g.string().optional(),border:g.string().optional(),borderRadius:g.string().optional(),shadow:g.string().optional(),titleColor:g.string().optional(),textColor:g.string().optional(),iconBackground:g.string().optional(),iconShadow:g.string().optional()}),B5=g.object({background:g.string().optional(),textColor:g.string().optional(),border:g.string().optional(),borderRadius:g.string().optional(),scrimOpacity:g.string().optional(),highlightRing:g.string().optional()}),F5=g.object({background:g.string().optional(),textColor:g.string().optional(),textSecondaryColor:g.string().optional(),border:g.string().optional(),borderRadius:g.string().optional(),successColor:g.string().optional(),warningColor:g.string().optional(),errorColor:g.string().optional(),iconBackground:g.string().optional(),progressGradient:g.string().optional()}),$5=g.object({mode:g.enum(["dark","light"]).optional(),fontFamily:g.string().optional(),colorPrimary:g.string().optional(),colorPrimaryHover:g.string().optional(),borderRadius:g.string().optional(),canvas:I5.optional(),launcher:H5.optional(),tile:z5.optional(),overlay:B5.optional(),notification:F5.optional()}).strict(),U5=g.object({enabled:g.boolean().optional(),label:g.string().optional(),position:g.string().optional(),animate:g.boolean().optional(),animationStyle:g.enum(["pulse","bounce","glow"]).optional(),notificationCount:g.number().optional()}).strict(),h$=g.object({schemaVersion:g.string().optional(),fetchedAt:g.string().datetime(),configVersion:g.string().optional(),canvasTitle:g.string().optional(),tiles:g.array(L5),actions:g.array(g.any()),theme:$5.optional(),launcher:U5.optional(),verificationSteps:g.array(g.string()).optional()}).strict();var ht={activation:Bs.optional(),triggerWhen:so.nullable().optional()},Hn=g.object({selector:g.string(),route:g.union([g.string(),g.array(g.string())])}).strict(),XT=g.object({color:g.string().optional(),scrimOpacity:g.number().min(0).max(1).optional(),paddingPx:g.number().optional(),radiusPx:g.number().optional()}).strict(),KT=g.enum(["top-left","top-right","bottom-left","bottom-right"]),QT=g.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),Ab=g.object({label:g.string(),actionId:g.string(),primary:g.boolean().optional()}).strict(),JT=g.object({title:g.string().optional(),body:g.string(),ctaButtons:g.array(Ab).optional()}).strict(),ek=g.object({title:g.string().optional(),body:g.string()}).strict(),tk=g.enum(["before","after","prepend","append","replace"]),nk=g.enum(["immediate","hover","click"]),ik=g.object({widgetId:g.string(),props:g.record(g.unknown()).optional(),priority:g.number().optional()}).strict(),rk=g.object({id:g.string(),action:g.any(),route:g.string().optional(),onAction:g.record(g.string()).optional()}).passthrough(),ok=g.enum(["auto","smooth","instant"]),Cb=g.enum(["start","center","end","nearest"]),ak=g.object({kind:g.literal("content:setText"),anchorId:Hn,text:g.string(),label:g.string().optional()}).extend(ht).strict(),sk=g.object({kind:g.literal("content:setAttr"),anchorId:Hn,attr:g.string(),value:g.string(),label:g.string().optional()}).extend(ht).strict(),lk=g.object({kind:g.literal("content:addClass"),anchorId:Hn,className:g.string(),label:g.string().optional()}).extend(ht).strict(),ck=g.object({kind:g.literal("content:removeClass"),anchorId:Hn,className:g.string(),label:g.string().optional()}).extend(ht).strict(),uk=g.object({kind:g.literal("content:setStyle"),anchorId:Hn,styles:g.record(g.string()),label:g.string().optional()}).extend(ht).strict(),dk=g.object({kind:g.literal("content:insertHtml"),anchorId:Hn,html:g.string(),position:tk,deepLink:Eb.optional(),label:g.string().optional()}).extend(ht).strict(),fk=g.object({kind:g.literal("overlays:highlight"),anchorId:Hn,style:XT.optional(),duration:g.number().optional(),label:g.string().optional()}).extend(ht).strict(),pk=g.object({kind:g.literal("overlays:pulse"),anchorId:Hn,duration:g.number().optional(),label:g.string().optional()}).extend(ht).strict(),hk=g.object({kind:g.literal("overlays:badge"),anchorId:Hn,content:g.string(),position:KT.optional(),label:g.string().optional()}).extend(ht).strict(),gk=g.object({kind:g.literal("overlays:tooltip"),anchorId:Hn,content:JT,trigger:nk.optional(),placement:QT.optional(),waitFor:g.string().optional(),label:g.string().optional()}).extend(ht).strict(),mk=g.object({kind:g.literal("overlays:modal"),content:ek,size:g.enum(["sm","md","lg"]).optional(),blocking:g.boolean().optional(),scrim:g.object({opacity:g.number().min(0).max(1).optional()}).strict().optional(),dismiss:g.object({onEsc:g.boolean().optional(),closeButton:g.boolean().optional(),timeoutMs:g.number().min(0).optional()}).strict().optional(),ctaButtons:g.array(Ab).optional(),waitFor:g.string().optional(),label:g.string().optional()}).extend(ht).strict(),vk=g.object({kind:g.literal("navigation:scrollTo"),anchorId:Hn,behavior:ok.optional(),block:Cb.optional(),inline:Cb.optional(),label:g.string().optional()}).extend(ht).strict(),yk=g.object({kind:g.literal("navigation:navigate"),url:g.string(),target:g.enum(["_self","_blank"]).optional(),label:g.string().optional()}).extend(ht).strict(),bk=g.object({kind:g.literal("core:mountWidget"),slot:g.string(),widget:ik,label:g.string().optional()}).extend(ht).strict(),_k=g.object({kind:g.literal("core:wait"),durationMs:g.number().min(0).optional(),event:g.string().optional(),label:g.string().optional()}).extend(ht).strict(),Sk=g.object({kind:g.literal("core:sequence"),actions:g.array(g.any()),label:g.string().optional()}).extend(ht).strict(),xk=g.object({kind:g.literal("core:parallel"),actions:g.array(g.any()),waitFor:g.enum(["all","any"]).optional(),label:g.string().optional()}).extend(ht).strict(),wk=g.object({kind:g.literal("core:tour"),tourId:g.string(),steps:g.array(rk).min(1),startStep:g.string().optional(),autoStart:g.boolean().optional(),label:g.string().optional()}).extend(ht).passthrough(),V5=[{defName:"setText",schema:ak},{defName:"setAttr",schema:sk},{defName:"addClass",schema:lk},{defName:"removeClass",schema:ck},{defName:"setStyle",schema:uk},{defName:"insertHtml",schema:dk},{defName:"highlight",schema:fk},{defName:"pulse",schema:pk},{defName:"badge",schema:hk},{defName:"tooltip",schema:gk},{defName:"modal",schema:mk},{defName:"scrollTo",schema:vk},{defName:"navigate",schema:yk},{defName:"mountWidget",schema:bk},{defName:"wait",schema:_k},{defName:"sequence",schema:Sk},{defName:"parallel",schema:xk},{defName:"tour",schema:wk}];function Tb(t){let e=t?.root??(typeof document<"u"?document.body:null),n=t?.defaultTimeoutMs??5e3,i=new Map,r=new Map,o=null,a=!1;function s(b){if(!e)return null;try{return e.querySelector(b)}catch{return null}}function l(){for(let[b,f]of i){let p=s(b);if(p){for(let v of f)clearTimeout(v.timer),v.resolve(p);i.delete(b)}}for(let[b,f]of r){let p=s(b);if(p){for(let v of f)v.cancelled||v.cb(p);r.delete(b)}}i.size===0&&r.size===0&&u()}function c(){o||a||typeof MutationObserver>"u"||!e||(o=new MutationObserver(()=>{l()}),o.observe(e,{childList:!0,subtree:!0}))}function u(){o&&(o.disconnect(),o=null)}function d(b,f){let p=i.get(b);p&&(p.delete(f),p.size===0&&i.delete(b)),i.size===0&&r.size===0&&u()}function h(b,f){if(a)return Promise.reject(new Error("AnchorResolver destroyed"));let p=s(b);if(p)return Promise.resolve(p);let v=f??n;return new Promise((y,w)=>{let A={resolve:y,reject:w,timer:setTimeout(()=>{d(b,A),w(new Error(`waitFor("${b}") timed out after ${v}ms`))},v)},x=i.get(b);x||(x=new Set,i.set(b,x)),x.add(A),c()})}function m(b,f){if(a)return()=>{};let p=s(b);if(p)return f(p),()=>{};let v={cb:f,cancelled:!1},y=r.get(b);return y||(y=new Set,r.set(b,y)),y.add(v),c(),()=>{v.cancelled=!0;let w=r.get(b);w&&(w.delete(v),w.size===0&&r.delete(b)),i.size===0&&r.size===0&&u()}}function S(){let b=0;for(let f of i.values())b+=f.size;return b}function _(){a=!0,u();let b=new Error("AnchorResolver destroyed");for(let f of i.values())for(let p of f)clearTimeout(p.timer),p.reject(b);i.clear(),r.clear()}return{resolve:s,waitFor:h,onAppear:m,pendingCount:S,destroy:_}}function j5(){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 kb(t,e){if(!e)return;let n;try{n=new URL(t).pathname}catch{n=t}if(e.exclude){for(let i of e.exclude)if(Ek(n,i))return}if(e.include){for(let i of e.include)if(Ek(n,i))return i;return}return n}function Ek(t,e){let n=t.replace(/\/$/,"")||"/",i=e.replace(/\/$/,"")||"/";if(n===i)return!0;let r=i.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${r}$`).test(n)}var sp=class{constructor(e={}){P(this,"context");P(this,"previousContext");P(this,"listeners",new Set);P(this,"telemetry");P(this,"routes");P(this,"navigation");P(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=j5(),this.previousContext={...this.context},e.telemetry?.getSessionId){let n=e.telemetry.getSessionId();n&&(this.context.session.sessionId=n)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=kb(this.context.page.url,this.routes),this.addPageToHistory(this.context.page.url),typeof window<"u"&&this.setupBrowserListeners()}get(){return{...this.context}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setRoutes(e){this.routes=e;let n=kb(this.context.page.url,this.routes);n!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:n}})}setAnchors(e){this.updateContext({anchors:e})}setSessionId(e){e!==this.context.session.sessionId&&this.updateContext({session:{...this.context.session,sessionId:e}})}destroy(){for(let e of this.cleanupFns)e();this.cleanupFns=[],this.listeners.clear()}setupBrowserListeners(){let e,n=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};if(window.addEventListener("resize",n),this.cleanupFns.push(()=>window.removeEventListener("resize",n)),this.navigation){let i=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(i)}else{let i=()=>{this.updatePage()};window.addEventListener("popstate",i),this.cleanupFns.push(()=>window.removeEventListener("popstate",i));let r=history.pushState.bind(history),o=history.replaceState.bind(history);history.pushState=(...a)=>{r(...a),queueMicrotask(()=>this.updatePage())},history.replaceState=(...a)=>{o(...a),queueMicrotask(()=>this.updatePage())},this.cleanupFns.push(()=>{history.pushState=r,history.replaceState=o})}}updateViewport(){let e={width:window.innerWidth,height:window.innerHeight};(e.width!==this.context.viewport.width||e.height!==this.context.viewport.height)&&this.updateContext({viewport:e})}updatePage(){let e=window.location.href,{title:n}=document,i=kb(e,this.routes),r={url:e,title:n,routeId:i};(r.url!==this.context.page.url||r.title!==this.context.page.title||r.routeId!==this.context.page.routeId)&&(r.url!==this.context.page.url&&this.addPageToHistory(r.url),this.updateContext({page:r}))}addPageToHistory(e){let n={url:e,ts:Date.now()},i=[...this.context.session.pageHistory||[],n];i.length>50&&i.shift(),this.context.session.pageHistory=i}updateContext(e){this.previousContext={...this.context},this.context={...this.context,...e},this.notifyListeners()}notifyListeners(){for(let e of this.listeners)try{e(this.context,this.previousContext)}catch(n){console.error("[ContextManager] Listener error:",n)}}};function Rb(t={}){return new sp(t)}var P5=g.object({url:g.string(),routeId:g.string().optional(),title:g.string().optional(),locale:g.string().optional()}),q5=g.object({url:g.string(),ts:g.number()}),Z5=g.object({sessionId:g.string(),startTs:g.number(),pageHistory:g.array(q5).optional()}),G5=g.object({width:g.number(),height:g.number()}),Y5=g.object({x:g.number(),y:g.number(),w:g.number(),h:g.number()}),W5=g.object({anchorId:g.string(),present:g.boolean(),visible:g.boolean().optional(),boundingBox:Y5.optional()}),X5=g.record(g.string(),g.union([g.number(),g.string(),g.boolean(),g.undefined()])),K5=g.object({page:P5,session:Z5,viewport:G5,anchors:g.array(W5).optional(),augmented:X5.optional()});function M$(t){return K5.safeParse(t)}function Ck(t,e){let{context:n,state:i,events:r}=e;switch(t.type){case"page_url":{let{url:o}=t,a=n.page.url,s=o.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(`^${s}$`).test(a)}case"route":return n.page.routeId===t.routeId;case"anchor_visible":{let o=typeof t.anchorId=="string"?t.anchorId:t.anchorId?.selector??"",a=n.anchors?.find(s=>s.anchorId===o);switch(t.state){case"visible":return a?.visible===!0;case"present":return a?.present===!0;case"absent":return!a?.present;default:return!1}}case"event_occurred":{if(!r)return!1;let o=t.withinMs??6e4;return r.hasRecentEvent(t.eventName,o)}case"state_equals":return!1;case"viewport":{let{width:o,height:a}=n.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&a<t.minHeight||t.maxHeight!==void 0&&a>t.maxHeight)}case"session_metric":{if(!i)return!1;let o=i.getSessionMetric(t.key),{operator:a,threshold:s}=t;switch(a){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(!i)return t.inverted??!1;let o=i.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!i)return t.inverted??!1;let o=i.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!i)return t.inverted??!1;let a=i.getFrequencyCount(t.key)>=t.limit;return t.inverted?!a:a}case"event_count":{if(!e.accumulator)return!1;let o=t,a=e.accumulator.getCount(o.key,o.withinMs);switch(o.operator){case"gte":return a>=o.count;case"lte":return a<=o.count;case"eq":return a===o.count;case"gt":return a>o.count;case"lt":return a<o.count;default:return!1}}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function Ak(t,e){let n=[];for(let i of t.conditions){let r=Ck(i,e);if(n.push({condition:i,result:r}),!r)return{matched:!1,conditionResults:n}}return{matched:!0,conditionResults:n}}function lp(t,e){for(let n=0;n<t.rules.length;n++){let i=t.rules[n],{matched:r,conditionResults:o}=Ak(i,e);if(r)return{value:i.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:n,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function cp(t,e){let{context:n}=e,i=n.augmented?.[t.field];return i===void 0||typeof i!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:i>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function Tk(t,e){let{state:n,events:i,sessionMetrics:r,accumulator:o}=e;return{context:t,state:n?{isDismissed:a=>n.dismissals.isDismissed(a),isCooldownActive:a=>n.cooldowns.isActive(a),getFrequencyCount:a=>n.frequency.count(a),getSessionMetric:a=>r?.get(a)??0}:void 0,events:i?{hasRecentEvent:(a,s)=>i.hasRecentEvent(a,s)}:void 0,accumulator:o?{getCount:(a,s)=>o.getCount(a,s)}:void 0}}async function kk(t,e,n={}){let i=Tk(e,n);switch(t.type){case"rules":return lp(t,i);case"score":return cp(t,i);case"model":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"model"}};case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"external"}};default:return console.warn("[DecisionEngine] Unknown strategy type:",t.type),{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function Rk(t,e,n={}){let i=Tk(e,n);switch(t.type){case"rules":return lp(t,i);case"score":return cp(t,i);case"model":case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:t.type}};default:return{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function Ob(t){return{evaluate:(e,n)=>kk(e,n,t),evaluateSync:(e,n)=>Rk(e,n,t)}}function Mb(t){let{eventBus:e,stateStore:n}=t,i=new Map,r=new Set,o=null,a=n.ns("accumulator");function s(c){let u=!1;for(let d of i.values()){if(!d.predicate(c))continue;let h=a.get(d.stateKey)||{count:0};h.count++,d.needsTimestamps&&(h.timestamps||(h.timestamps=[]),h.timestamps.push(c.ts),h.timestamps.length>200&&(h.timestamps=h.timestamps.slice(-200))),a.set(d.stateKey,h),u=!0}if(u)for(let d of r)try{d()}catch(h){console.error("[EventAccumulator] Subscriber error:",h)}}function l(){o||i.size===0||(o=e.subscribe(s))}return{register(c,u,d=!1){let h=`ev:${c}`,m=i.get(h);if(m){d&&!m.needsTimestamps&&(m.needsTimestamps=!0);return}i.set(h,{stateKey:h,needsTimestamps:d,predicate:u}),l()},getCount(c,u){let d=`ev:${c}`,h=a.get(d);if(!h)return 0;if(u===void 0||!h.timestamps)return h.count;let m=Date.now()-u;return h.timestamps.filter(S=>S>=m).length},subscribe(c){return r.add(c),()=>{r.delete(c)}},destroy(){o&&(o(),o=null),i.clear(),r.clear()}}}function Nb(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(i=>{try{return new RegExp(i).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var up=class{constructor(e={}){P(this,"subscriptions",new Set);P(this,"history",[]);P(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,n){let i,r;typeof e=="function"?(i=void 0,r=e):(i=e,r=n);let o={filter:i,callback:r};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,n,i="canvas"){let r={ts:Date.now(),name:e,source:i,props:n,schemaVersion:ls};this.publishEvent(r)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let n of this.subscriptions)if(Nb(e,n.filter))try{n.callback(e)}catch(i){console.error("[EventBus] Subscriber error:",i)}}getRecent(e,n){let i=this.history;return e&&(i=i.filter(r=>Nb(r,e))),n&&n>0&&(i=i.slice(-n)),i}hasRecentEvent(e,n,i){let r=Date.now()-n;return this.history.some(o=>o.name===e&&o.ts>=r&&(i===void 0||o.source===i))}countRecentEvents(e,n){let i=this.history.filter(r=>Nb(r,e));if(n!==void 0){let r=Date.now()-n;i=i.filter(o=>o.ts>=r)}return i.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function qc(t={}){return new up(t)}var Ok={$autocapture:"ui.click",$click:Se.UI_CLICK,$scroll:Se.UI_SCROLL,$input:Se.UI_INPUT,$change:Se.UI_CHANGE,$submit:Se.UI_SUBMIT,$pageview:Se.NAV_PAGE_VIEW,$pageleave:Se.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function Q5(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(Ok[e])return Ok[e];if(e==="$autocapture"){let n=t.properties?.$tag_name,i=t.properties?.$event_type;return i==="submit"?Se.UI_SUBMIT:i==="change"?Se.UI_CHANGE:n==="input"||n==="textarea"?Se.UI_INPUT:Se.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function J5(t){let e={},n=t.properties||{},i=n.$elements;return n.$tag_name?e.tagName=n.$tag_name:i?.[0]?.tag_name&&(e.tagName=i[0].tag_name),n.$el_text&&(e.elementText=n.$el_text),i&&(e.elements=i),n.$current_url&&(e.url=n.$current_url),n.$pathname&&(e.pathname=n.$pathname),n.$host&&(e.host=n.$host),n.$viewport_width&&(e.viewportWidth=n.$viewport_width),n.$viewport_height&&(e.viewportHeight=n.$viewport_height),n.$session_id&&(e.sessionId=n.$session_id),n.$scroll_depth&&(e.scrollDepth=n.$scroll_depth),n.$scroll_percentage&&(e.scrollPercentage=n.$scroll_percentage),e.originalEvent=t.event,e}function Mk(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:Q5(t),source:"posthog",props:J5(t),schemaVersion:ls}}function Nk(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,n)=>{if(typeof e!="string")return;let i={event:e,properties:n,timestamp:Date.now()};if(Nk(i)){let r=Mk(i);t(r)}}}var Dk=g.enum(["posthog","canvas","derived"]),eI=g.object({ts:g.number(),name:g.string(),source:Dk,props:g.record(g.string(),g.unknown()).optional(),schemaVersion:g.string()}),tI=g.object({names:g.array(g.string()).optional(),patterns:g.array(g.string()).optional(),sources:g.array(Dk).optional()});function t8(t){return eI.safeParse(t)}function n8(t){return tI.safeParse(t)}var Zc=class{constructor(){P(this,"listeners",new Set);P(this,"capturedPushState");P(this,"capturedReplaceState");P(this,"wasNative");P(this,"destroyed",!1);P(this,"onPopState",()=>{this.notify(window.location.href,"popstate")});this.wasNative=this.isNativeFunction(history.pushState),this.capturedPushState=history.pushState,this.capturedReplaceState=history.replaceState,history.pushState=(...e)=>{this.capturedPushState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"pushState"))},history.replaceState=(...e)=>{this.capturedReplaceState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"replaceState"))},window.addEventListener("popstate",this.onPopState)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}diagnose(){return{isNative:this.wasNative,subscriberCount:this.listeners.size}}destroy(){this.destroyed||(this.destroyed=!0,history.pushState=this.capturedPushState,history.replaceState=this.capturedReplaceState,window.removeEventListener("popstate",this.onPopState),this.listeners.clear())}notify(e,n){if(!this.destroyed)for(let i of this.listeners)try{i(e,n)}catch{}}isNativeFunction(e){try{return Function.prototype.toString.call(e).includes("[native code]")}catch{return!1}}};var Lb="cooldown:";function Lk(t){return{set(e,n){let i=Lb+e,r=Date.now()+n;t.set(i,r)},isActive(e){return this.remaining(e)>0},remaining(e){let n=Lb+e,i=t.get(n);if(i===void 0)return 0;let r=i-Date.now();return r<=0?(t.remove(n),0):r},clear(e){let n=Lb+e;t.remove(n)}}}var Gc="dismissed:";function Ik(t,e){return{mark(n,i=!1){let r=Gc+n;(i?e:t).set(r,!0)},isDismissed(n){let i=Gc+n;return t.has(i)||e.has(i)},clear(n){let i=Gc+n;t.remove(i),e.remove(i)},clearAll(){for(let n of t.keys())n.startsWith(Gc)&&t.remove(n);for(let n of e.keys())n.startsWith(Gc)&&e.remove(n)}}}var Ib="freq:";function Hk(t){function e(n){let i=Ib+n,r=t.get(i);if(r){if(r.resetAt&&Date.now()>=r.resetAt){t.remove(i);return}return r}}return{increment(n,i){let r=Ib+n,o=e(n),a=(o?.count??0)+1,s={count:a,resetAt:o?.resetAt??(i?Date.now()+i:void 0)};return t.set(r,s),a},count(n){return e(n)?.count??0},reset(n){let i=Ib+n;t.remove(i)},hasReachedLimit(n,i){return this.count(n)>=i}}}var nI="syntro";function Hb(t,e){let n=`${e}:`;return{get(i){if(t)try{let r=t.getItem(n+i);if(!r)return;let o=JSON.parse(r);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(n+i);return}return o.value}catch{return}},set(i,r,o){if(t)try{let a={value:r,expiresAt:o?Date.now()+o:void 0};t.setItem(n+i,JSON.stringify(a))}catch(a){console.warn("[StateStore] Failed to save:",a)}},remove(i){t&&t.removeItem(n+i)},has(i){return t?this.get(i)!==void 0:!1},keys(){if(!t)return[];let i=[];for(let r=0;r<t.length;r++){let o=t.key(r);o?.startsWith(n)&&i.push(o.slice(n.length))}return i},clear(){if(!t)return;let i=this.keys();for(let r of i)t.removeItem(n+r)}}}function zb(t){let e=new Map,n=`${t}:`;return{get(i){let r=e.get(n+i);if(r){if(r.expiresAt&&Date.now()>=r.expiresAt){e.delete(n+i);return}return r.value}},set(i,r,o){e.set(n+i,{value:r,expiresAt:o?Date.now()+o:void 0})},remove(i){e.delete(n+i)},has(i){return this.get(i)!==void 0},keys(){let i=[];for(let r of e.keys())r.startsWith(n)&&i.push(r.slice(n.length));return i},clear(){for(let i of e.keys())i.startsWith(n)&&e.delete(i)}}}var dp=class{constructor(e={}){P(this,"session");P(this,"user");P(this,"dismissals");P(this,"cooldowns");P(this,"frequency");P(this,"namespace");P(this,"namespacedStorages",new Map);this.namespace=e.namespace??nI,typeof window<"u"?(this.session=Hb(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=Hb(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=zb(this.namespace),this.user=zb(this.namespace)),this.dismissals=Ik(this.session,this.user),this.cooldowns=Lk(this.user),this.frequency=Hk(this.session)}ns(e){let n=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(n)){let i=typeof window<"u"&&typeof sessionStorage<"u"?Hb(sessionStorage,n):zb(n);this.namespacedStorages.set(n,i)}return this.namespacedStorages.get(n)}};function Bb(t={}){return new dp(t)}function Yc(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function fp(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var zk={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"}},Wc={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:[]},Bk={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function Fb(t,e,n){let i=zk[e];Object.assign(t.style,i),n&&(n.maxWidth&&(t.style.maxWidth=n.maxWidth),n.maxHeight&&(t.style.maxHeight=n.maxHeight),n.minWidth&&(t.style.minWidth=n.minWidth),n.minHeight&&(t.style.minHeight=n.minHeight))}function $b(t,e,n){let i=n.placement==="auto"?"bottom":n.placement,r=[$d(n.offset?{mainAxis:n.offset.y,crossAxis:n.offset.x}:8)];return n.flip!==!1&&r.push(Vd()),n.shift!==!1&&r.push(Ud({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",Fd(e,t,async()=>{let{x:a,y:s,strategy:l}=await jd(e,t,{placement:i,middleware:r});Object.assign(t.style,{position:l,left:`${a}px`,top:`${s}px`})})}function Ub(t,e,n="append"){return t.style.position="relative",t.style.display="inline-block",n==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function Vb(t,e){return e==="none"||Wc[e].length===0?null:t.animate(Wc[e],Bk)}function jb(t,e){if(e==="none"||Wc[e].length===0)return Promise.resolve();let n=[...Wc[e]].reverse(),i=t.animate(n,Bk);return new Promise(r=>{i.onfinish=()=>r(),i.oncancel=()=>r()})}function Pb(t,e){let n=document.createElement("div");return n.setAttribute("data-syntro-surface",t),n.setAttribute("data-syntro-mount-id",e),n.className="syntro-surface",Object.assign(n.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),n}function qb(t){switch(Yc(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 Fk(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),c=document.createElement("div");return c.append(l),c.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),o=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]),a=[];for(;r.nextNode();){let s=r.currentNode,l=s.tagName.toLowerCase();if(!o.has(l)){a.push(s);continue}for(let c of Array.from(s.attributes)){let u=c.name.toLowerCase(),d=c.value.trim().toLowerCase(),h=u.startsWith("on"),m=(u==="href"||u==="src")&&d.startsWith("javascript:");(h||m)&&s.removeAttribute(c.name)}}for(let s of a){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML=(i.firstChild,n.innerHTML)}var iI=0;function Zb(t){let{overlayRoot:e,eventBus:n,anchorResolver:i,defaultAnimation:r="fade",widgetRegistry:o}=t,a=new Map,s=new Map,l=new Map;function c(){return`mount-${++iI}`}function u(y,w){n&&n.publish(y,w)}function d(y){let w=l.get(y);if(w){let A=b(y);for(let x of w)try{x(A)}catch(T){console.error("[Surfaces] State callback error:",T)}}}let h=new Map;function m(y,w,A){switch(w.type){case"html":y.innerHTML=Fk(w.content);return;case"widget":{if(o?.has(w.widgetId)){let x=o.mount(w.widgetId,y,w.config);return A&&h.set(A,x),()=>{x.unmount(),A&&h.delete(A)}}console.warn(`[Surfaces] Widget not found: ${w.widgetId}`),y.innerHTML=`<div data-widget-id="${w.widgetId}" data-widget-missing="true">Widget: ${w.widgetId}</div>`;return}case"custom":return w.mount(y);case"react":y.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function S(y,w,A){let x=c(),T=Yc(y),k=A?.priority??0,E=A?.animation??r,R=A?.exclusive??!0,D=a.get(y);if(D&&R){if(D.options.priority>k)throw new Error(`Slot ${y} is occupied by higher priority content (${D.options.priority} > ${k})`);_(D)}let N=Pb(y,x);N.style.zIndex=String(qb(y));let H;if(T==="static")Fb(N,y,A?.constraints),e.appendChild(N);else if(T==="inline"){let I=fp(y);if(!I)throw new Error(`Invalid inline slot: ${y}`);if(!i)throw new Error("Anchor resolver required for inline slots");let G=i({selector:I,route:"**"});if(!G)throw new Error(`Anchor not found for inline slot: ${I}`);H=Ub(N,G)}else if(T==="adjacent"){let I=fp(y);if(!I)throw new Error(`Invalid adjacent slot: ${y}`);if(!i)throw new Error("Anchor resolver required for adjacent slots");let G=i({selector:I,route:"**"});if(!G)throw new Error(`Anchor not found for adjacent slot: ${I}`);e.appendChild(N),H=$b(N,G,A?.position??{placement:"bottom"})}let B=m(N,w,x);Vb(N,E);let z={id:x,slot:y,content:w,options:{priority:k,exclusive:R,animation:E,position:A?.position??{placement:"auto"},constraints:A?.constraints??{},adaptiveId:A?.adaptiveId,autoUnmountOnRouteChange:A?.autoUnmountOnRouteChange??!0},container:N,cleanup:()=>{H?.(),B?.()},mountedAt:Date.now()};return a.set(y,z),s.set(y,(s.get(y)??0)+1),u("surface.mounted",{slot:y,id:x,adaptiveId:A?.adaptiveId}),d(y),{id:x,update(I){let G=a.get(y);if(!G||G.id!==x)throw new Error("Mount no longer active");let J=h.get(x);if(J){if(I.type==="widget"){J.update(I.config),G.content=I;return}J.unmount(),h.delete(x)}G.container.innerHTML="";let me=m(G.container,I,x);if(G.content=I,me){let Ke=G.cleanup;G.cleanup=()=>{Ke?.(),me()}}},setOptions(I){let G=a.get(y);if(!G||G.id!==x)throw new Error("Mount no longer active");I.priority!==void 0&&(G.options.priority=I.priority),I.animation!==void 0&&(G.options.animation=I.animation),I.constraints&&T==="static"&&(I.constraints.maxWidth&&(G.container.style.maxWidth=I.constraints.maxWidth),I.constraints.maxHeight&&(G.container.style.maxHeight=I.constraints.maxHeight),I.constraints.minWidth&&(G.container.style.minWidth=I.constraints.minWidth),I.constraints.minHeight&&(G.container.style.minHeight=I.constraints.minHeight)),d(y)},async unmount(){let I=a.get(y);!I||I.id!==x||await _(I)},isMounted(){return a.get(y)?.id===x},getContainer(){let I=a.get(y);return I?.id===x?I.container:null}}}async function _(y){await jb(y.container,y.options.animation),y.cleanup?.(),y.container.remove(),a.delete(y.slot),u("surface.unmounted",{slot:y.slot,id:y.id}),d(y.slot)}function b(y){let w=a.get(y);return{slot:y,occupied:!!w,currentPriority:w?.options.priority,currentAdaptiveId:w?.options.adaptiveId,mountCount:s.get(y)??0,currentMountId:w?.id}}function f(y,w){let A=l.get(y);return A||(A=new Set,l.set(y,A)),A.add(w),()=>{A?.delete(w),A?.size===0&&l.delete(y)}}function p(y,w){let A=a.get(y);return A?w!==void 0?w>=A.options.priority:!1:!0}function v(){for(let y of a.values())try{y.cleanup?.(),y.container.remove()}catch(w){console.error("[Surfaces] Error during cleanup:",w)}a.clear(),l.clear()}return{mount:S,getState:b,onStateChange:f,canMount:p,destroy:v}}var pp=class{constructor(){P(this,"widgets",new Map);P(this,"mountedWidgets",new Map);P(this,"mountIdCounter",0);P(this,"runtimeRef");P(this,"listeners",new Set)}bindRuntime(e){this.runtimeRef=e}register(e,n,i="custom",r){if(this.widgets.has(e)){if(this.widgets.get(e).source==="built-in")throw new Error(`Cannot override built-in widget: ${e}`);console.warn(`[WidgetRegistry] Overriding widget: ${e}`)}this.widgets.set(e,{id:e,widget:n,source:i,metadata:r}),this.notify({type:"registered",widgetId:e})}unregister(e){let n=this.widgets.get(e);return n?n.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),this.notify({type:"unregistered",widgetId:e}),!0):!1}unregisterBySource(e){for(let[n,i]of this.widgets.entries())i.source===e&&this.widgets.delete(n)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,n,i){let r=this.widgets.get(e);if(!r)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;n.setAttribute("data-widget-mount-id",o),n.setAttribute("data-widget-id",e);let a={...i,runtime:this.runtimeRef},s=r.widget.mount(n,a);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:n}),{widgetId:e,container:n,unmount:()=>{let c=this.mountedWidgets.get(o);c&&(c.cleanup?.(),this.mountedWidgets.delete(o),n.removeAttribute("data-widget-mount-id"),n.removeAttribute("data-widget-id"),n.innerHTML="")},update:c=>{if(r.widget.update)r.widget.update(n,c);else{let u=this.mountedWidgets.get(o);if(u){u.cleanup?.(),n.innerHTML="";let d={...c,runtime:this.runtimeRef},h=r.widget.mount(n,d);u.cleanup=h??void 0}}}}}list(){return Array.from(this.widgets.keys())}listRegistrations(){return Array.from(this.widgets.values())}getBySource(e){return Array.from(this.widgets.values()).filter(n=>n.source===e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){for(let n of this.listeners)try{n(e)}catch(i){console.error("[WidgetRegistry] Listener error:",i)}}destroy(){for(let[e,n]of this.mountedWidgets.entries())n.cleanup?.(),n.container.innerHTML="";this.mountedWidgets.clear()}},Gb=new pp;var Uk="2.0.0";function rI(t,e){if(!e)return!0;let n;try{n=new URL(t).pathname}catch{n=t}let i=n.replace(/\/$/,"")||"/";if(e.exclude){for(let r of e.exclude)if(Yb(i,r))return!1}if(e.include&&e.include.length>0){for(let r of e.include)if(Yb(i,r))return!0;return!1}return!0}function Yb(t,e){let n=e.replace(/\/$/,"")||"/";if(t===n)return!0;let i=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${i}$`).test(t)}function $k(t){let n=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(r=>Yb(n,r))}function Wb(t={}){let{telemetry:e,sessionMetrics:n,routes:i,mode:r="production",namespace:o}=t,a=t.widgets??Gb,s=t.executors??nr,l=t.apps??Wl,c=new Zc,u=Rb({telemetry:e,routes:i,navigation:c}),d=t.events??qc(),h=Bb({namespace:o}),m=Mb({eventBus:d,stateStore:h}),S=Ob({state:h,events:d,sessionMetrics:n,accumulator:m}),_=RE(),b=Tb(),f=A=>$k(A)?b.resolve(A.selector):null,p=async(A,x)=>{if(!$k(A))return null;try{return await b.waitFor(A.selector,x)}catch{return null}},v=Zb({overlayRoot:_,eventBus:d,anchorResolver:f,widgetRegistry:a}),y=fb({overlayRoot:_,eventBus:d,surfaces:v,anchorResolver:f,waitForAnchor:p,executorRegistry:s,subscribeNavigation:A=>c.subscribe(A),runtime:{evaluateSync:A=>S.evaluateSync(A,u.get()),context:u,accumulator:m}}),w={telemetry:e,context:u,events:d,state:h,sessionMetrics:n,actions:y,surfaces:v,widgets:a,executors:s,apps:l,accumulator:m,anchorResolver:b,navigation:c,version:Uk,mode:r,async evaluate(A){return S.evaluate(A,u.get())},evaluateSync(A){return S.evaluateSync(A,u.get())},async filterTiles(A){let x=u.get().page.url,T=[];for(let k of A){let E=k.activation;if(!E){T.push(k);continue}if(!rI(x,E.routes))continue;if(!E.strategy){T.push(k);continue}(await this.evaluate(E.strategy)).value&&T.push(k)}return T},setRoutes(A){u.setRoutes(A)},destroy(){l.unbind().catch(A=>{console.error("[Runtime] Error unbinding apps registry:",A)}),b.destroy(),m.destroy(),c.destroy(),u.destroy(),y.destroy(),v.destroy()}};return l.bind(w),a.bindRuntime(w),w}var oI=g.object({value:g.unknown(),expiresAt:g.number().optional()}),aI=g.object({count:g.number(),resetAt:g.number().optional()});function oU(t){return oI.safeParse(t)}function aU(t){return aI.safeParse(t)}var Vk={growthbook:t=>mv({...t,autoInit:!0})};function jk(t,e){let n=Vk[t];if(!n)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(Vk).join(", ")}`);return n(e)}var sI=["cdn.syntrologie.com","localhost","127.0.0.1"];function lI(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):sI.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){P(this,"name","cdn");P(this,"url");P(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!lI(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),n=await fetch(this.url,{credentials:"omit",cache:"default"});if(!n.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${n.status})`);let i=await n.text();if(this.integrity){let l=await cI(i),c=this.integrity.replace("sha384-","");if(l!==c)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${c}, got ${l}`)}let r=JSON.parse(i),o=performance.now()-e,a=n.headers.get("cache-control"),s=n.headers.get("age");return{config:r,meta:{source:"cdn",fetchTimeMs:o,cached:a?.includes("public")??!1,cacheAge:s?parseInt(s,10):void 0}}}};async function cI(t){let n=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-384",n),r=new Uint8Array(i);return btoa(String.fromCharCode(...r))}function Pk(t){return new Xb(t)}var uI="syntro_exp",dI="syntro_var",Kb=class{constructor(e){P(this,"name","experiments");P(this,"client");P(this,"featureKey");P(this,"manifestKey");P(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(uI),a=r.get(dI);if(o&&a!==null&&this.client.setForcedVariations){let s=parseInt(a,10);Number.isNaN(s)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${s}`),this.client.setForcedVariations({[o]:s}))}}if(this.manifestKey||this.variantFlagPrefix){let r=this.fetchMultiFlag();if(r){let o=performance.now()-e;return{config:r,meta:{source:"experiments",fetchTimeMs:o,cached:!0}}}}let n=this.client.getFeatureValue?.(this.featureKey,null);if(!n||typeof n!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let i=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:i,cached:!0}}}fetchMultiFlag(){let e=this.getVariantFlagKeys();return!e||e.length===0?null:Yd(this.client,e)}getVariantFlagKeys(){if(this.manifestKey){let e=this.client.getFeatureValue?.(this.manifestKey,null);if(e&&typeof e=="object"){let n=e.variant_flags;if(n&&n.length>0)return n}}if(this.variantFlagPrefix&&this.client.getAllFeatures){let e=this.client.getAllFeatures();return Object.keys(e).filter(n=>n.startsWith(this.variantFlagPrefix))}return[]}};function qk(t){return new Kb(t)}var fI="https://cdn.syntrologie.com/configs",Zk={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return Pk({baseUrl:t.baseUrl??fI,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return qk({featureKey:t.featureKey})}};function Gk(t,e={}){let n=Zk[t];if(!n)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(Zk).join(", ")}`);return n(e)}var Yk={posthog:t=>ab(t),noop:()=>wv()};function Wk(t,e){let n=Yk[t];if(!n)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(Yk).join(", ")}`);return n(e)}var Qb="syn_";function hp(t){if(!t.startsWith(Qb))throw new Error("Invalid Syntro token: must start with 'syn_'");let n=t.slice(Qb.length).replace(/-/g,"+").replace(/_/g,"/"),i=atob(n),r=JSON.parse(i);if(r.v!==1)throw new Error(`Unsupported token version: ${r.v}`);return r}function Jb(t){let e=JSON.stringify(t),n=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return Qb+n}function ir(t){if(typeof process<"u"&&process.env)return process.env[t];try{let e=(0,eval)("import.meta");if(e?.env)return e.env[t]}catch{}}function pI(){if(typeof window>"u")return Y("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=Ho(),n=!!(Br()?.token&&t?.mode==="editor");return Y("Syntro Bootstrap","isEditorMode:",n),n}function hI(){if(typeof window>"u")return Y("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=Ho(),n=!!(Br()?.token&&t?.mode==="audit");return Y("Syntro Bootstrap","isAuditMode:",n),n}function gI(){if(typeof window>"u")return Y("Syntro Bootstrap","isReviewMode: not in browser"),!1;let t=Ho(),n=!!(Br()?.token&&t?.mode==="review");return Y("Syntro Bootstrap","isReviewMode:",n),n}var Xk="syntro_segment_attributes";function mI(){if(typeof window>"u")return{};try{let t=localStorage.getItem(Xk);if(t){let e=JSON.parse(t);return Y("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){fn("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function vI(t){if(!(typeof window>"u"))try{localStorage.setItem(Xk,JSON.stringify(t)),Y("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){fn("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function yI(t){if(!t)return{};let e={};for(let[n,i]of Object.entries(t))n.startsWith("in_segment_")&&(e[n]=i===!0);return e}async function bI(t){Tm(),Y("Syntro Bootstrap","====== INIT ======"),Y("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=pI(),n=hI(),i=gI(),r=e?"editor":n?"audit":i?"review":null;if(console.log(`[DIAG] Mode detection: editor=${e}, audit=${n}, review=${i}, sdkMode=${r}`),console.log("[DIAG] editorSource:",Br()),console.log("[DIAG] editorConf:",Ho()),Y("Syntro Bootstrap","SDK mode:",r??"normal"),!r&&typeof window<"u"){let E=!!window.__SYNTRO_EDITOR_PARAMS__,R=!!window.__SYNTRO_AUDIT_LEGEND__,D=!!window.__SYNTRO_REVIEW_DATA__;if(E||R||D){let N=[E&&"__SYNTRO_EDITOR_PARAMS__",R&&"__SYNTRO_AUDIT_LEGEND__",D&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${N.join(", ")}. This suggests URL params were lost (redirect?) but the service worker injected mode data. Check if replaceState failed or if page JS changed the URL before init().`)}}console.log(`[DIAG] Token resolution: options.token=${t.token?t.token.slice(0,15)+"...":"null"}`);let o=t.token;if(!o&&r){let R=Ho()?.syntro_token;R?.startsWith("syn_")&&(o=R,Y("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${r} mode)`))}let a;if(o)if(o.startsWith("syn_"))Y("Syntro Bootstrap","Token starts with syn_, decoding..."),a=hp(o),Tm(a.d);else if(r)Y("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${r} mode)`);else throw Wd("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),Wd("Syntro Bootstrap","Token received:",o),new Error("Invalid Syntro token: must start with 'syn_'");else if(r)Y("Syntro Bootstrap",`\u2713 No token, but ${r} mode - proceeding`);else throw Wd("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit/review mode!"),new Error("Syntro token is required (unless in editor, audit, or review mode)");let s=ir("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||ir("VITE_SYNTRO_EXPERIMENT_HOST")||a?.eh,l=ir("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||ir("VITE_SYNTRO_TELEMETRY_HOST")||a?.th,c=ir("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||ir("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,u=mI();Y("Syntro Bootstrap","Phase 1: Using cached segment attributes:",u);let d,h=qc();console.log("[Syntro Bootstrap] EventBus created");let m=Db(E=>{h.publishEvent(E)}),S=E=>{Y("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let R=yI(E);if(Y("Syntro Bootstrap","Segment flags from PostHog:",R),vI(R),d){let N={...b?.getAll?.()??{},...R};Y("Syntro Bootstrap","Updating GrowthBook with attributes:",N),d.setAttributes?.(N)}},_;if(a?.t){let E=a.t==="noop"?"noop":"posthog";_=Wk(E,{apiKey:a.t,apiHost:l,enableFeatureFlags:!0,onFeatureFlagsLoaded:S,onCapture:m}),console.log(`[Syntro Bootstrap] Telemetry client created (${E}) with EventBus wiring`)}let b;a?.e&&(d=jk("growthbook",{clientKey:a.e,apiHost:s,attributes:u,onExperimentViewed:_?.trackExperiment?(E,R,D)=>{_.trackExperiment(E,R,D)}:void 0})),t.enableSessionMetrics&&(b=vv({experiments:d,onMetricChange:(E,R)=>{Y("Syntro Bootstrap",`Session metric changed: ${E} = ${R}`)}}),Y("Syntro Bootstrap","SessionMetricTracker created"));let f="production";e?f="editor":n?f="audit":ir("NODE_ENV")==="development"&&(f="development");let p=Wb({telemetry:_,sessionMetrics:b,mode:f,events:h});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 v=t.cdnBase||ir("NEXT_PUBLIC_SYNTRO_CDN_BASE")||ir("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",y=Sm({cdnBase:v,registry:p.apps,onLoadStart:E=>{Y("Syntro Bootstrap",`Loading app from CDN: ${E}`)},onLoadEnd:(E,R,D)=>{R?Y("Syntro Bootstrap",`App loaded successfully: ${E}`):fn("Syntro Bootstrap",`Failed to load app: ${E}`,D)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:p.apps,runtime:p,version:p.version},Y("Syntro Bootstrap","Global SynOS object exposed"));let w=p.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${w.length} apps in registry:`,w.map(E=>`${E.manifest.id}(${E.state})`).join(", "));for(let E of w)if(E.state==="registered")try{await p.apps.activate(E.manifest.id),console.log(`[DIAG] Activated: ${E.manifest.id} \u2192 widgets: [${p.widgets.list().join(", ")}]`)}catch(R){console.error(`[DIAG] FAILED to activate: ${E.manifest.id}`,R),fn("Syntro Bootstrap",`Failed to auto-activate built-in app: ${E.manifest.id}`,R)}if(console.log(`[DIAG] Activation complete. Total widgets: [${p.widgets.list().join(", ")}]`),d?.refreshFeatures)try{await d.refreshFeatures(),Y("Syntro Bootstrap","GrowthBook features loaded")}catch(E){fn("Syntro Bootstrap","Failed to load GrowthBook features:",E)}let A;if(t.fetcher)A=t.fetcher;else if(a?.f){let E=Gk(a.f,a.o??{});A=async()=>{let R=await E.fetch();return{...R.config,tiles:R.config.tiles??[]}}}else d&&(A=rs({experiments:d}));let x=new Set,T=A?async()=>{let E=await A();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${E.tiles?.length??0},`,`actions=${E.actions?.length??0},`,`theme=${E.theme?.name??"none"}`),E.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",E.actions.map((N,H)=>`[${H}] ${N.kind}${N.anchorId?` anchor="${typeof N.anchorId=="string"?N.anchorId:N.anchorId.selector}"`:""}${N.label?` "${N.label}"`:""}`).join(", "));let R=E,D=y.getRequiredApps(R);return D.length>0?console.log("[Syntro Bootstrap] Required external apps:",D.join(", ")):Y("Syntro Bootstrap","No external apps required (all executors are built-in)"),D.length>0&&await y.loadAppsForConfig(R).then(async H=>{let B=H.filter(I=>I.success),z=H.filter(I=>!I.success);B.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${B.map(I=>I.appId).join(", ")}`);let te=z.filter(I=>!x.has(I.appId));te.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",te.map(I=>`${I.appId} (${I.error})`).join(", ")),te.forEach(I=>x.add(I.appId)));for(let I of D)if(p.apps.has(I))try{await p.apps.activate(I),console.log(`[Syntro Bootstrap] App activated: ${I}`)}catch(G){console.error(`[Syntro Bootstrap] Failed to activate app: ${I}`,G)}else console.error(`[Syntro Bootstrap] App "${I}" required by config but NOT registered.`,`Available apps: [${Array.from(p.apps.list?.()??[]).join(", ")}]`)}),E}:void 0;return{canvas:await Km({...t.canvas,fetcher:T,integrations:{experiments:d,telemetry:_},editorUrl:c,runtime:p}),runtime:p,experiments:d,telemetry:_,sessionMetrics:b,appLoader:y}}var Kk={init:bI,encodeToken:Jb,decodeToken:hp};typeof window<"u"&&(window.Syntro=Kk);var Qk="2026-03-03T18:45:20.063Z (2f42a46615)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${Qk}`);let t=window.SynOS,e=t?.appRegistry||Wl;window.SynOS={...t,appRegistry:e,_runtimeBuild:Qk,React:Jk.default,ReactDOM:{..._I,createPortal:gp.createPortal,flushSync:gp.flushSync}},mE(e)}export{Wc as ANIMATION_KEYFRAMES,Bs as ActivationConfigZ,lk as AddClassZ,Hn as AnchorIdZ,W5 as AnchorStateZ,gb as AnchorVisibleConditionZ,qd as AppRegistry,X5 as AugmentationZ,KT as BadgePositionZ,hk as BadgeZ,Y5 as BoundingBoxZ,Ql as CanvasEvents,Sv as CanvasRecipeZ,zs as ConditionZ,sp as ContextManager,Sb as CooldownActiveConditionZ,Fc as CounterDefZ,Ab as CtaButtonZ,Lm as DEFAULT_COOLDOWN,Dm as DEFAULT_TTL,so as DecisionStrategyZ,_b as DismissedConditionZ,ls as EVENT_SCHEMA_VERSION,up as EventBus,wb as EventCountConditionZ,tI as EventFilterZ,mb as EventOccurredConditionZ,Dk as EventSourceZ,ap as ExecutorRegistry,Pc as ExternalStrategyZ,aI as FrequencyEntryZ,xb as FrequencyLimitConditionZ,LL as HighlightStepZ,XT as HighlightStyleZ,fk as HighlightZ,dk as InsertHtmlZ,tk as InsertPositionZ,Nm as MAX_VISIBLE_TOASTS,Bc as MatchOpZ,ek as ModalContentZ,mk as ModalZ,jc as ModelStrategyZ,bk as MountWidgetZ,yk as NavigateZ,Zc as NavigationMonitor,eI as NormalizedEventZ,Mm as NotificationToastStack,P5 as PageContextZ,q5 as PageHistoryEntryZ,pb as PageUrlConditionZ,xk as ParallelZ,QT as PlacementZ,pk as PulseZ,Qk as RUNTIME_SDK_BUILD,Uk as RUNTIME_VERSION,ck as RemoveClassZ,hb as RouteConditionZ,WT as RouteFilterZ,Uc as RuleStrategyZ,$c as RuleZ,K5 as RuntimeContextZ,Fm as RuntimeProvider,zr as SDK_SCHEMA_VERSION,km as SDK_VERSION,zk as STATIC_SLOT_STYLES,Vc as ScoreStrategyZ,ok as ScrollBehaviorZ,Cb as ScrollLogicalPositionZ,vk as ScrollToZ,jC as SelectorZ,Sk as SequenceZ,Z5 as SessionContextZ,bb as SessionMetricConditionZ,bf as SessionMetricTracker,sk as SetAttrZ,uk as SetStyleZ,ak as SetTextZ,FE as ShadowCanvasOverlay,NE as ShadowRootProvider,VE as SmartCanvasApp,Om as SmartCanvasController,Wm as SmartCanvasElement,wF as SmartCanvasPortal,Se as StandardEvents,vb as StateEqualsConditionZ,dp as StateStore,oI as StoredValueZ,Kk as Syntro,Jl as TileCard,fB as TileWheel,JT as TooltipContentZ,DL as TooltipStepZ,nk as TooltipTriggerZ,gk as TooltipZ,rk as TourStepForSchemaZ,wk as TourZ,yb as ViewportConditionZ,G5 as ViewportContextZ,_k as WaitZ,ik as WidgetConfigZ,pp as WidgetRegistry,Wl as appRegistry,Fb as applyStaticSlotStyles,bm as cleanupAppContext,om as contentRuntime,V5 as coreActionStepSchemas,fb as createActionEngine,Tb as createAnchorResolver,ym as createAppContext,Sm as createAppLoader,rs as createCanvasConfigFetcher,Rb as createContextManager,Ob as createDecisionEngine,Mb as createEventAccumulator,qc as createEventBus,mv as createGrowthBookClient,wv as createNoopClient,SF as createOverlayRecipeFetcher,ab as createPostHogClient,Db as createPostHogNormalizer,vv as createSessionMetricTracker,Km as createSmartCanvas,OE as createSmartCanvasController,Wb as createSmartCanvasRuntime,Bb as createStateStore,Pb as createSurfaceContainer,Zb as createSurfaces,c$ as decisionSchemas,hp as decodeToken,Jb as encodeToken,kk as evaluate,Ck as evaluateCondition,Ak as evaluateRule,lp as evaluateRuleStrategy,cp as evaluateScoreStrategy,Rk as evaluateSync,nr as executorRegistry,RN as getAntiFlickerSnippet,tE as getAppIdFromActionKind,_m as getAppIdFromWidgetId,f5 as getExecutor,fp as getSlotAnchorId,Yc as getSlotType,qb as getSlotZIndex,ub as hasExecutor,Qd as interpolateTemplate,eE as isCoreActionKind,Im as matchEvent,mB as needsMigration,Mk as normalizePostHogEvent,vm as overlaysRuntime,ec as parseVersion,Vb as playEnterAnimation,jb as playExitAnimation,Xd as registerConfigPredicates,ZE as registerSmartCanvasElement,Rm as resolveConfigUri,$b as setupAdjacentPositioning,Ub as setupInlinePositioning,Nk as shouldNormalizeEvent,fD as useDecision,Hm as useNotifications,zm as useNotifyWatcher,$m as usePageContext,$i as useRuntime,ef as useRuntimeContext,uD as useRuntimeEvents,dD as useRuntimeState,lD as useSessionContext,$E as useShadowCanvasConfig,ss as useShadowRoot,cD as useViewportContext,ao as validateAction,db as validateActions,l$ as validateActivationConfig,a$ as validateCondition,gB as validateConfig,n8 as validateEventFilter,aU as validateFrequencyEntry,t8 as validateNormalizedEvent,vF as validateRecipe,M$ as validateRuntimeContext,oU as validateStoredValue,s$ as validateStrategy,Gb as widgetRegistry};
|
|
462
|
+
`)).length,n=0;n<r;n++){var i=t.charCodeAt(n),s=null;i<128?a++:s=i>127&&i<2048?String.fromCharCode(i>>6|192,63&i|128):String.fromCharCode(i>>12|224,i>>6&63|128,63&i|128),nn(s)||(a>e&&(o+=t.substring(e,a)),o+=s,e=a=n+1)}return a>e&&(o+=t.substring(e,t.length)),o},MN=!!ay||!!ty,Y1="text/plain",up=function(t,e,a){var r;a===void 0&&(a=!0);var[n,o]=t.split("?"),i=j({},e),s=(r=o?.split("&").map((u=>{var c,[d,h]=u.split("="),g=a&&(c=i[d])!==null&&c!==void 0?c:h;return delete i[d],d+"="+g})))!==null&&r!==void 0?r:[],l=XF(i);return l&&s.push(l),n+"?"+s.join("&")},Du=(t,e)=>JSON.stringify(t,((a,r)=>typeof r=="bigint"?r.toString():r),e),Yv=t=>{var{data:e,compression:a}=t;if(e){if(a===rn.GZipJS){var r=TN((function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new Na(l.length+(l.length>>>1)),h=0,g=function(f){d[h++]=f},S=0;S<c;++S){if(h+5>d.length){var b=new Na(h+8+(c-S<<1));b.set(d),d=b}var x=l.charCodeAt(S);x<128||u?g(x):x<2048?(g(192|x>>>6),g(128|63&x)):x>55295&&x<57344?(g(240|(x=65536+(1047552&x)|1023&l.charCodeAt(++S))>>>18),g(128|x>>>12&63),g(128|x>>>6&63),g(128|63&x)):(g(224|x>>>12),g(128|x>>>6&63),g(128|63&x))}return uk(d,0,h)})(Du(e)),{mtime:0}),n=new Blob([r],{type:Y1});return{contentType:Y1,body:n,estimatedSize:n.size}}if(a===rn.Base64){var o=(function(l){var u,c,d,h,g,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b=0,x=0,f="",m=[];if(!l)return l;l=RN(l);do u=(g=l.charCodeAt(b++)<<16|l.charCodeAt(b++)<<8|l.charCodeAt(b++))>>18&63,c=g>>12&63,d=g>>6&63,h=63&g,m[x++]=S.charAt(u)+S.charAt(c)+S.charAt(d)+S.charAt(h);while(b<l.length);switch(f=m.join(""),l.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"="}return f})(Du(e)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Du(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=Du(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},Gf=[];ty&&Gf.push({transport:"fetch",method:t=>{var e,a,{contentType:r,body:n,estimatedSize:o}=(e=Yv(t))!==null&&e!==void 0?e:{},i=new Headers;Me(t.headers,(function(c,d){i.append(d,c)})),r&&i.append("Content-Type",r);var s=t.url,l=null;if(g1){var u=new g1;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),t.timeout)}}ty(s,j({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 h={statusCode:c.status,text:d};if(c.status===200)try{h.json=JSON.parse(d)}catch(g){z.error(g)}t.callback==null||t.callback(h)})))).catch((c=>{z.error(c),t.callback==null||t.callback({statusCode:0,text:c})})).finally((()=>l?clearTimeout(l.timeout):null))}}),ay&&Gf.push({transport:"XHR",method:t=>{var e,a=new ay;a.open(t.method||"GET",t.url,!0);var{contentType:r,body:n}=(e=Yv(t))!==null&&e!==void 0?e:{};Me(t.headers,(function(o,i){a.setRequestHeader(i,o)})),r&&a.setRequestHeader("Content-Type",r),t.timeout&&(a.timeout=t.timeout),t.disableXHRCredentials||(a.withCredentials=!0),a.onreadystatechange=()=>{if(a.readyState===4){var o={statusCode:a.status,text:a.responseText};if(a.status===200)try{o.json=JSON.parse(a.responseText)}catch{}t.callback==null||t.callback(o)}},a.send(n)}}),va!=null&&va.sendBeacon&&Gf.push({transport:"sendBeacon",method:t=>{var e=up(t.url,{beacon:"1"});try{var a,{contentType:r,body:n}=(a=Yv(t))!==null&&a!==void 0?a:{},o=typeof n=="string"?new Blob([n],{type:r}):n;va.sendBeacon(e,o)}catch{}}});var cp=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 K1(t,e,a){return Du({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:a})}var ck={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=>cp(a,r))))),not_regex:(t,e)=>e.every((a=>t.every((r=>!cp(a,r))))),icontains:(t,e)=>e.map($f).some((a=>t.map($f).some((r=>a.includes(r))))),not_icontains:(t,e)=>e.map($f).every((a=>t.map($f).every((r=>!a.includes(r)))))},$f=t=>t.toLowerCase();function dk(t,e){return!t||Object.entries(t).every((a=>{var[r,n]=a,o=e?.[r];if(U(o)||nn(o))return!1;var i=[String(o)],s=ck[n.operator];return!!s&&s(n.values,i)}))}var Kv=ct("[Error tracking]"),Gy=class{constructor(e){var a,r;this.Jt=[],this.Kt=new sy([new uy,new gy,new dy,new cy,new hy,new py,new fy,new my],RF("web:javascript",AF,TF)),this._instance=e,this.Jt=(a=(r=this._instance.persistence)==null?void 0:r.get_property(yy))!==null&&a!==void 0?a:[]}onRemoteConfig(e){var a,r,n,o=(a=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&a!==void 0?a:[],i=(n=e.errorTracking)==null?void 0:n.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[yy]:this.Jt,[A1]:i})}get Yt(){var e,a=!!this._instance.get_property(A1),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??a)!==null&&e!==void 0&&e}buildProperties(e,a){return this.Kt.buildFromUnknown(e,{syntheticException:a?.syntheticException,mechanism:{handled:a?.handled}})}sendExceptionEvent(e){var a=e.$exception_list;if(this.Xt(a)){if(this.Qt(a))return void Kv.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(a))return void Kv.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(a))return void Kv.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var a=e.reduce(((r,n)=>{var{type:o,value:i}=n;return ut(o)&&o.length>0&&r.$exception_types.push(o),ut(i)&&i.length>0&&r.$exception_values.push(i),r}),{$exception_types:[],$exception_values:[]});return this.Jt.some((r=>{var n=r.values.map((o=>{var i,s=ck[o.operator],l=Ee(o.value)?o.value:[o.value],u=(i=a[o.key])!==null&&i!==void 0?i:[];return l.length>0&&s(l,u)}));return r.type==="OR"?n.some(Boolean):n.every(Boolean)}))}Zt(e){return e.flatMap((a=>{var r,n;return(r=(n=a.stacktrace)==null?void 0:n.frames)!==null&&r!==void 0?r:[]})).some((a=>a.filename&&a.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var a,r,n,o,i=(a=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&a!==void 0?a:[],s=i[i.length-1];return(n=s==null||(o=s.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&n!==void 0&&n}return!1}Xt(e){return!Le(e)&&Ee(e)}},Ja=ct("[FeatureFlags]"),wu=ct("[FeatureFlags]",{debugEnabled:!0}),Qv="$active_feature_flags",Es="$override_feature_flags",Q1="$feature_flag_payloads",Lu="$override_feature_flag_payloads",J1="$feature_flag_request_id",eA="$feature_flag_evaluated_at",tA=t=>{var e={};for(var[a,r]of jf(t||{}))r&&(e[a]=r);return e},DN=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]})))):Ja.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},ON=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),Wy=class{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((a=>{var r=a&&typeof a=="string"&&a.trim().length>0;return r||Ja.error("Invalid evaluation environment found:",a,"Expected non-empty string"),r})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.vi({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(xy),a=this._instance.get_property(Es),r=this._instance.get_property(Lu);if(!r&&!a)return e||{};var n=Ke({},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=U(c)?(s=u?.enabled)!==null&&s!==void 0&&s:!!c,h=U(c)?u.variant:typeof c=="string"?c:void 0,g=r?.[i],S=j({},u,{enabled:d,variant:d?h??u?.variant:void 0});d!==u?.enabled&&(S.original_enabled=u?.enabled),h!==u?.variant&&(S.original_variant=u?.variant),g&&(S.metadata=j({},u?.metadata,{payload:g,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),n[i]=S}return this.ii||(Ja.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:n}),this.ii=!0),n}getFlagVariants(){var e=this._instance.get_property(Ds),a=this._instance.get_property(Es);if(!a)return e||{};for(var r=Ke({},e),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.ii||(Ja.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:a,finalFlags:r}),this.ii=!0),r}getFlagPayloads(){var e=this._instance.get_property(Q1),a=this._instance.get_property(Lu);if(!a)return e||{};for(var r=Ke({},e||{}),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.ii||(Ja.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:a,finalPayloads:r}),this.ii=!0),r}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.vi()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}vi(e){var a;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var r={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:j({},((a=this._instance.persistence)==null?void 0:a.get_initial_props())||{},this._instance.get_property(Ru)||{}),group_properties:this._instance.get_property(li)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.ui()&&(r.evaluation_environments=this.li());var n=this._instance.config.__preview_remote_config,o=n?"/flags/?v=2":"/flags/?v=2&config=true",i=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("flags",o+i);n&&(r.timezone=ok()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:r,compression:this._instance.config.disable_compression?void 0:rn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,c,d=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),d=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((c=l.json)!==null&&c!==void 0?c:{})),!r.disable_flags||this.ni)if(this.ai=!d,l.json&&(u=l.json.quotaLimited)!=null&&u.includes(ON.FeatureFlags))Ja.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var h;r.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},d),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,a){if(a===void 0&&(a={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],n=""+r,o=this._instance.get_property(J1)||void 0,i=this._instance.get_property(eA)||void 0,s=this._instance.get_property(Kf)||{};if((a.send_event||!("send_event"in a))&&(!(e in s)||!s[e].includes(n))){var l,u,c,d,h,g,S,b,x;Ee(s[e])?s[e].push(n):s[e]=[n],(l=this._instance.persistence)==null||l.register({[Kf]:s});var f=this.getFeatureFlagDetails(e),m={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:i,$feature_flag_bootstrapped_response:((u=this._instance.config.bootstrap)==null||(u=u.featureFlags)==null?void 0:u[e])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[e])||null,$used_bootstrap_value:!this.ai};U(f==null||(d=f.metadata)==null?void 0:d.version)||(m.$feature_flag_version=f.metadata.version);var v,y=(h=f==null||(g=f.reason)==null?void 0:g.description)!==null&&h!==void 0?h:f==null||(S=f.reason)==null?void 0:S.code;y&&(m.$feature_flag_reason=y),f!=null&&(b=f.metadata)!=null&&b.id&&(m.$feature_flag_id=f.metadata.id),U(f?.original_variant)&&U(f?.original_enabled)||(m.$feature_flag_original_response=U(f.original_variant)?f.original_enabled:f.original_variant),f!=null&&(x=f.metadata)!=null&&x.original_payload&&(m.$feature_flag_original_payload=f==null||(v=f.metadata)==null?void 0:v.original_payload),this._instance.capture("$feature_flag_called",m)}return r}Ja.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,a){var r=this._instance.config.token,n={distinct_id:this._instance.get_distinct_id(),token:r};this.ui()&&(n.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:n,compression:this._instance.config.disable_compression?void 0:rn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var i,s=(i=o.json)==null?void 0:i.featureFlagPayloads;a(s?.[e]||void 0)}})}isFeatureEnabled(e,a){if(a===void 0&&(a={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,a);return U(r)?void 0:!!r}Ja.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((a=>a!==e))}receivedFeatureFlags(e,a){if(this._instance.persistence){this.ei=!0;var r=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(i,s,l,u,c){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var d=DN(i),h=d.flags,g=d.featureFlags,S=d.featureFlagPayloads;if(g){var b=i.requestId,x=i.evaluatedAt;if(Ee(g)){Ja.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(g)for(var m=0;m<g.length;m++)f[g[m]]=!0;s&&s.register({[Qv]:g,[Ds]:f})}else{var v=g,y=S,_=h;i.errorsWhileComputingFlags&&(v=j({},l,v),y=j({},u,y),_=j({},c,_)),s&&s.register(j({[Qv]:Object.keys(tA(v)),[Ds]:v||{},[Q1]:y||{},[xy]:_||{}},b?{[J1]:b}:{},x?{[eA]:x}:{}))}}})(e,this._instance.persistence,r,n,o),this.pi(a)}}override(e,a){a===void 0&&(a=!1),Ja.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:a})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Ja.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Es),this._instance.persistence.unregister(Lu),this.pi(),wu.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var a,r=e;if(this.ii=!!((a=r.suppressWarning)!==null&&a!==void 0&&a),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(Es),wu.info("Flag overrides cleared");else if(r.flags){if(Ee(r.flags)){for(var n={},o=0;o<r.flags.length;o++)n[r.flags[o]]=!0;this._instance.persistence.register({[Es]:n})}else this._instance.persistence.register({[Es]:r.flags});wu.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(Lu),wu.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Lu]:r.payloads}),wu.info("Payload overrides set",{payloads:r.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:a,flagVariants:r}=this.gi();e(a,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,a,r){var n,o=(this._instance.get_property(Tu)||[]).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=j({},this.getFlagVariants(),{[e]:a});(n=this._instance.persistence)==null||n.register({[Qv]:Object.keys(tA(l)),[Ds]:l}),this.pi()}getEarlyAccessFeatures(e,a,r){a===void 0&&(a=!1);var n=this._instance.get_property(Tu),o=r?"&"+r.map((i=>"stage="+i)).join("&"):"";if(n&&!a)return e(n);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:i=>{var s,l;if(i.json){var u=i.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.unregister(Tu),(l=this._instance.persistence)==null||l.register({[Tu]:u}),e(u)}}})}gi(){var e=this.getFlags(),a=this.getFlagVariants();return{flags:e.filter((r=>a[r])),flagVariants:Object.keys(a).filter((r=>a[r])).reduce(((r,n)=>(r[n]=a[n],r)),{})}}pi(e){var{flags:a,flagVariants:r}=this.gi();this.featureFlagEventHandlers.forEach((n=>n(a,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(Ru)||{};this._instance.register({[Ru]:j({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Ru)}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(li)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((n=>{r[n]=j({},r[n],e[n]),delete e[n]})),this._instance.register({[li]:j({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var a=this._instance.get_property(li)||{};this._instance.register({[li]:j({},a,{[e]:{}})})}else this._instance.unregister(li)}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}},BN=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Fu=class{constructor(e,a){this.F=e,this.props={},this.mi=!1,this.yi=(r=>{var n="";return r.token&&(n=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+n+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&z.info("Persistence loaded",e.persistence,j({},this.props)),this.update_config(e,e,a),this.save()}isDisabled(){return!!this.wi}bi(e){BN.indexOf(e.persistence.toLowerCase())===-1&&(z.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var a=e.persistence.toLowerCase();return a==="localstorage"&&je.H()?je:a==="localstorage+cookie"&&Uf.H()?Uf:a==="sessionstorage"&&Lt.H()?Lt:a==="memory"?rN:a==="cookie"?vr:Uf.H()?Uf:vr}properties(){var e={};return Me(this.props,(function(a,r){if(r===Ds&&mt(a))for(var n=Object.keys(a),o=0;o<n.length;o++)e["$feature/"+n[o]]=a[n[o]];else s=r,l=!1,(nn(i=HF)?l:m1&&i.indexOf===m1?i.indexOf(s)!=-1:(Me(i,(function(u){if(l||(l=u===s))return Xf})),l))||(e[r]=a);var i,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Ke({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,a,r){if(mt(e)){U(a)&&(a="None"),this.xi=U(r)?this.$i:r;var n=!1;if(Me(e,((o,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==a||(this.props[i]=o,n=!0)})),n)return this.save(),!0}return!1}register(e,a){if(mt(e)){this.xi=U(a)?this.$i:a;var r=!1;if(Me(e,((n,o)=>{e.hasOwnProperty(o)&&this.props[o]!==n&&(this.props[o]=n,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=JA(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);Ms(dx(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=q?.referrer)?tk(e):{})}update_referrer_info(){var e;this.register_once({$referrer:ak(),$referring_domain:q!=null&&q.referrer&&((e=ap(q.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[_y]||this.props[wy]||this.register_once({[Qf]:rk(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Me([wy,_y],(i=>{var s=this.props[i];s&&Me(s,(function(l,u){e["$initial_"+ry(u)]=l}))}));var a,r,n=this.props[Qf];if(n){var o=(a=nk(n),r={},Me(a,(function(i,s){r["$initial_"+ry(s)]=i})),r);Ke(e,o)}return e}safe_merge(e){return Me(this.props,(function(a,r){r in e||(e[r]=a)})),e}update_config(e,a,r){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==a.persistence){var n=this.bi(e),o=this.props;this.clear(),this.Y=n,this.props=o,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_secure(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_event_timer(e,a){var r=this.props[Eu]||{};r[e]=a,this.props[Eu]=r,this.save()}remove_event_timer(e){var a=(this.props[Eu]||{})[e];return U(a)||(delete this.props[Eu][e],this.save()),a}get_property(e){return this.props[e]}set_property(e,a){this.props[e]=a,this.save()}},Iu=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),X5=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),Y5=(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})({}),K5=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),Jv=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),Q5=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),J5=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),ez=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),Wf=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),aA=(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})({}),fk=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),Vu=class{constructor(){this.ki={},this.ki={}}on(e,a){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(a),()=>{this.ki[e]=this.ki[e].filter((r=>r!==a))}}emit(e,a){for(var r of this.ki[e]||[])r(a);for(var n of this.ki["*"]||[])n(e,a)}};function Ts(t,e,a){if(Le(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 Zy=class{constructor(e){this.Pi=new Vu,this.Ti=(a,r)=>this.Ri(a,r)&&this.Ii(a,r)&&this.Fi(a,r)&&this.Ci(a,r),this.Ri=(a,r)=>r==null||!r.event||a?.event===r?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!U((e=this._instance)==null?void 0:e.Ai)){var a;(a=this._instance)==null||a.Ai(((r,n)=>{this.on(r,n)}))}}register(e){var a,r;if(!U((a=this._instance)==null?void 0:a.Ai)&&(e.forEach((i=>{var s,l;(s=this.Oi)==null||s.add(i),(l=i.steps)==null||l.forEach((u=>{var c;(c=this.Mi)==null||c.add(u?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var n,o=new Set;e.forEach((i=>{var s;(s=i.steps)==null||s.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(n=this._instance)==null||n.autocapture.setElementSelectors(o)}}on(e,a){var r;a!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(a?.event))&&this.Oi&&((r=this.Oi)==null?void 0:r.size)>0&&this.Oi.forEach((n=>{this.Di(a,n)&&this.Pi.emit("actionCaptured",n.name)}))}ji(e){this.onAction("actionCaptured",(a=>e(a)))}Di(e,a){if(a?.steps==null)return!1;for(var r of a.steps)if(this.Ti(e,r))return!0;return!1}onAction(e,a){return this.Pi.on(e,a)}Ii(e,a){if(a!=null&&a.url){var r,n=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!n||typeof n!="string"||!Ts(n,a.url,a.url_matching||"contains"))return!1}return!0}Fi(e,a){return!!this.Li(e,a)&&!!this.Ni(e,a)&&!!this.Ui(e,a)}Li(e,a){var r;if(a==null||!a.href)return!0;var n=this.zi(e);if(n.length>0)return n.some((s=>Ts(s.href,a.href,a.href_matching||"exact")));var o,i=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!i&&Ts((o=i.match(/(?::|")href="(.*?)"/))?o[1]:"",a.href,a.href_matching||"exact")}Ni(e,a){var r;if(a==null||!a.text)return!0;var n=this.zi(e);if(n.length>0)return n.some((u=>Ts(u.text,a.text,a.text_matching||"exact")||Ts(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=[],h=/(?::|")text="(.*?)"/g;!Le(c=h.exec(u));)d.includes(c[1])||d.push(c[1]);return d})(l),i=a.text,s=a.text_matching||"exact",o.some((u=>Ts(u,i,s))))}Ui(e,a){var r,n;if(a==null||!a.selector)return!0;var o=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(o!=null&&o.includes(a.selector))return!0;var i=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";if(a.selector_regex&&i)try{return new RegExp(a.selector_regex).test(i)}catch{return!1}return!1}zi(e){var a;return(e==null||(a=e.properties)==null?void 0:a.$elements)==null?[]:e?.properties.$elements}Ci(e,a){return a==null||!a.properties||a.properties.length===0||dk(a.properties.reduce(((r,n)=>{var o=Ee(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)}},Ce=ct("[Surveys]"),Xy="seenSurvey_",FN=(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},rA=t=>{var e=""+Xy+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Xy+t.id+"_"+t.current_iteration),e},NN=[Jv.Popover,Jv.Widget,Jv.API],PN={ignoreConditions:!1,ignoreDelay:!1,displayType:fk.Popover},Yy=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,a){return!!e&&dk(e.propertyFilters,a?.properties)}Gi(e,a){var r=new Map;return e.forEach((n=>{var o;(o=n.conditions)==null||(o=o[a])==null||(o=o.values)==null||o.forEach((i=>{if(i!=null&&i.name){var s=r.get(i.name)||[];s.push(n.id),r.set(i.name,s)}}))})),r}Vi(e,a,r){var n,o=(r===Iu.Activation?this.Hi:this.Bi).get(e),i=[];return(n=this._instance)==null||n.getSurveys((s=>{i=s.filter((l=>o?.includes(l.id)))})),i.filter((s=>{var l,u=(l=s.conditions)==null||(l=l[r])==null||(l=l.values)==null?void 0:l.find((c=>c.name===e));return this.Wi(u,a)}))}register(e){var a;U((a=this._instance)==null?void 0:a.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var a=e.filter((r=>{var n,o;return((n=r.conditions)==null?void 0:n.actions)&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));a.length!==0&&(this.Yi==null&&(this.Yi=new Zy(this._instance),this.Yi.init(),this.Yi.ji((r=>{this.onAction(r)}))),a.forEach((r=>{var n,o,i,s,l;r.conditions&&(n=r.conditions)!=null&&n.actions&&(o=r.conditions)!=null&&(o=o.actions)!=null&&o.values&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0&&((s=this.Yi)==null||s.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((u=>{if(u&&u.name){var c=this.qi.get(u.name);c&&c.push(r.id),this.qi.set(u.name,c||[r.id])}})))})))}Ji(e){var a,r=e.filter((o=>{var i,s;return((i=o.conditions)==null?void 0:i.events)&&((s=o.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0})),n=e.filter((o=>{var i,s;return((i=o.conditions)==null?void 0:i.cancelEvents)&&((s=o.conditions)==null||(s=s.cancelEvents)==null||(s=s.values)==null?void 0:s.length)>0}));(r.length!==0||n.length!==0)&&((a=this._instance)==null||a.Ai(((o,i)=>{this.onEvent(o,i)})),this.Hi=this.Gi(e,Iu.Activation),this.Bi=this.Gi(e,Iu.Cancellation))}onEvent(e,a){var r,n=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[Hf])||[];if(Wf.SHOWN===e&&a&&n.length>0){var o;Ce.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:a,existingActivatedSurveys:n});var i=a==null||(o=a.properties)==null?void 0:o.$survey_id;if(i){var s=n.indexOf(i);s>=0&&(n.splice(s,1),this.Xi(n))}}else{if(this.Bi.has(e)){var l=this.Vi(e,a,Iu.Cancellation);l.length>0&&(Ce.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((c=>c.id))}),l.forEach((c=>{var d,h=n.indexOf(c.id);h>=0&&n.splice(h,1),(d=this._instance)==null||d.cancelPendingSurvey(c.id)})),this.Xi(n))}if(this.Hi.has(e)){Ce.info("survey event name matched",{event:e,eventPayload:a,surveys:this.Hi.get(e)});var u=this.Vi(e,a,Iu.Activation);this.Xi(n.concat(u.map((c=>c.id))||[]))}}}onAction(e){var a,r=((a=this._instance)==null||(a=a.persistence)==null?void 0:a.props[Hf])||[];this.qi.has(e)&&this.Xi(r.concat(this.qi.get(e)||[]))}Xi(e){var a;Ce.info("updating activated surveys",{activatedSurveys:e}),(a=this._instance)==null||(a=a.persistence)==null||a.register({[Hf]:[...new Set(e)]})}getSurveys(){var e,a=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[Hf];return a||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},Ky=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(Le(a))return Ce.warn("Flags not loaded yet. Not loading surveys.");var r=Ee(a);this.Zi=r?a.length>0:a,Ce.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],a=0;a<localStorage.length;a++){var r=localStorage.key(a);(r!=null&&r.startsWith(Xy)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((n=>localStorage.removeItem(n)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)Ce.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Ce.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Ce.info("Not loading surveys in cookieless mode without consent.");else{var e=te?.__PosthogExtensions__;if(e){if(!U(this.Zi)||this._instance.config.advanced_enable_surveys){var a=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var r=e.generateSurveys;if(r)return void this.re(r,a);var n=e.loadExternalDependency;if(!n)return void this.se("PostHog loadExternalDependency extension not found.");n(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,a)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else Ce.error("PostHog Extensions not found.")}}re(e,a){this._surveyManager=e(this._instance,a),this._surveyEventReceiver=new Yy(this._instance),Ce.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,a){Ce.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 Ce.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(by);if(r&&!a)return e(r,{isLoaded:!0});if(this.te)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:n=>{var o;this.te=!1;var i=n.statusCode;if(i!==200||!n.json){var s="Surveys API could not be loaded, status: "+i;return Ce.error(s),e([],{isLoaded:!1,error:s})}var l,u=n.json.surveys||[],c=u.filter((d=>(function(h){return!(!h.start_date||h.end_date)})(d)&&((function(h){var g;return!((g=h.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)})(d)||(function(h){var g;return!((g=h.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)})(d))));return c.length>0&&((l=this._surveyEventReceiver)==null||l.register(c)),(o=this._instance.persistence)==null||o.register({[by]:u}),e(u,{isLoaded:!0})}})}catch(n){throw this.te=!1,n}}ne(e){for(var a of this.ee)try{if(!e.isLoaded)return a([],e);this.getSurveys(a)}catch(r){Ce.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,a){if(a===void 0&&(a=!1),!Le(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,a);Ce.warn("init was not called")}oe(e){var a=null;return this.getSurveys((r=>{var n;a=(n=r.find((o=>o.id===e)))!==null&&n!==void 0?n:null})),a}ae(e){if(Le(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(Le(this._surveyManager))return Ce.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 Le(this._surveyManager)?(Ce.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((n=>{var o,i=(o=n.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(i){var s=this.ae(i);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),a)}))}renderSurvey(e,a){var r;if(Le(this._surveyManager))Ce.warn("init was not called");else{var n=typeof e=="string"?this.oe(e):e;if(n!=null&&n.id)if(NN.includes(n.type)){var o=q?.querySelector(a);if(o)return(r=n.appearance)!=null&&r.surveyPopupDelaySeconds?(Ce.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var i,s;Ce.info("Rendering survey "+n.id+" with delay of "+((i=n.appearance)==null?void 0:i.surveyPopupDelaySeconds)+" seconds"),(s=this._surveyManager)==null||s.renderSurvey(n,o),Ce.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,o);Ce.warn("Survey element not found")}else Ce.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Ce.warn("Survey not found")}}displaySurvey(e,a){var r;if(Le(this._surveyManager))Ce.warn("init was not called");else{var n=this.oe(e);if(n){var o=n;if((r=n.appearance)!=null&&r.surveyPopupDelaySeconds&&a.ignoreDelay&&(o=j({},n,{appearance:j({},n.appearance,{surveyPopupDelaySeconds:0})})),a.ignoreConditions===!1){var i=this.canRenderSurvey(n);if(!i.visible)return void Ce.warn("Survey is not eligible to be displayed: ",i.disabledReason)}a.displayType!==fk.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,a.selector)}else Ce.warn("Survey not found")}}cancelPendingSurvey(e){Le(this._surveyManager)?Ce.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},nA=ct("[RateLimiter]"),Qy=class{constructor(e){var a,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var o=n.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((i=>{nA.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void nA.warn('could not rate limit - continuing. Error: "'+i?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((a=e.config.rate_limiting)==null?void 0:a.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=e.config.rate_limiting)==null?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var a,r,n;e===void 0&&(e=!1);var o=new Date().getTime(),i=(a=(r=this.instance.persistence)==null?void 0:r.get_property(Cy))!==null&&a!==void 0?a:{tokens:this.captureEventsBurstLimit,last:o};i.tokens+=(o-i.last)/1e3*this.captureEventsPerSecond,i.last=o,i.tokens>this.captureEventsBurstLimit&&(i.tokens=this.captureEventsBurstLimit);var s=i.tokens<1;return s||e||(i.tokens=Math.max(0,i.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,(n=this.instance.persistence)==null||n.set_property(Cy,i),{isRateLimited:s,remainingTokens:i.tokens}}isServerRateLimited(e){var a=this.serverLimits[e||"events"]||!1;return a!==!1&&new Date().getTime()<a}},si=ct("[RemoteConfig]"),Jy=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=te._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.loadExternalDependency?(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(si.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 si.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void si.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return si.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){si.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()):si.info("__preview_remote_config is disabled. Logging config instead",e):si.error("Failed to fetch remote config from PostHog.")}},ex=3e3,tx=class{constructor(e,a){this.he=!0,this.ve=[],this.de=mr(a?.flush_interval_ms||ex,250,5e3,z.createLogger("flush interval"),ex),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},a=Object.values(e);[...a.filter((r=>r.url.indexOf("/e")===0)),...a.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ce(j({},r,{transport:"sendBeacon"}))}))}enable(){this.he=!1,this.pe()}pe(){var e=this;this.he||(this.fe=setTimeout((()=>{if(this.ge(),this.ve.length>0){var a=this._e(),r=function(){var o=a[n],i=new Date().getTime();o.data&&Ee(o.data)&&Me(o.data,(s=>{s.offset=Math.abs(s.timestamp-i),delete s.timestamp})),e.ce(o)};for(var n in a)r()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return Me(this.ve,(a=>{var r,n=a,o=(n?n.batchKey:null)||n.url;U(e[o])&&(e[o]=j({},n,{data:[]})),(r=e[o].data)==null||r.push(n.data)})),this.ve=[],e}},HN=["retriesPerformedSoFar"],ax=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!U(T)&&"onLine"in T.navigator&&(this.be=T.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},at(T,"online",this.we),at(T,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:a}=e,r=cA(e,HN);yr(a)&&a>0&&(r.url=up(r.url,{retry_count:a})),this._instance.ci(j({},r,{callback:n=>{n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(a??0)<10?this.Se(j({retriesPerformedSoFar:a},r)):r.callback==null||r.callback(n)}}))}Se(e){var a=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=a+1;var r=(function(i){var s=3e3*Math.pow(2,i),l=s/2,u=Math.min(18e5,s),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)})(a),n=Date.now()+r;this.ve.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),z.warn(o),this.me||(this.me=!0,this.Ee())}Ee(){if(this.$e&&clearTimeout(this.$e),this.ve.length===0)return this.me=!1,void(this.$e=void 0);this.$e=setTimeout((()=>{this.be&&this.ve.length>0&&this.Dt(),this.Ee()}),this.ye)}Dt(){var e=Date.now(),a=[],r=this.ve.filter((o=>o.retryAt<e||(a.push(o),!1)));if(this.ve=a,r.length>0)for(var{requestOptions:n}of r)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,U(T)||(this.we&&(T.removeEventListener("online",this.we),this.we=void 0),this.xe&&(T.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(j({},e,{transport:"sendBeacon"}))}catch(a){z.error(a)}this.ve=[]}},rx=class{constructor(e){this.ke=()=>{var a,r,n,o;this.Pe||(this.Pe={});var i=this.scrollElement(),s=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=s+(i?.clientHeight||0),c=i?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(s),this.Pe.maxScrollY=Math.max(s,(a=this.Pe.maxScrollY)!==null&&a!==void 0?a:0),this.Pe.maxScrollHeight=Math.max(l,(r=this.Pe.maxScrollHeight)!==null&&r!==void 0?r:0),this.Pe.lastContentY=u,this.Pe.maxContentY=Math.max(u,(n=this.Pe.maxContentY)!==null&&n!==void 0?n:0),this.Pe.maxContentHeight=Math.max(c,(o=this.Pe.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Pe}resetContext(){var e=this.Pe;return setTimeout(this.ke,0),e}startMeasuringScrollPosition(){at(T,"scroll",this.ke,{capture:!0}),at(T,"scrollend",this.ke,{capture:!0}),at(T,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return T?.document.documentElement;var e=Ee(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var a of e){var r=T?.document.querySelector(a);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return T&&(T.scrollY||T.pageYOffset||T.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return T&&(T.scrollX||T.pageXOffset||T.document.documentElement.scrollLeft)||0}},UN=t=>rk(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),dp=class{constructor(e,a,r,n){this.Te=o=>{var i=this.Re();if(!i||i.sessionId!==o){var s={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[Sy]:s})}},this._instance=e,this.Ce=a,this.Fe=r,this.Ie=n||UN,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[Sy]}getSetOnceProps(){var e,a=(e=this.Re())==null?void 0:e.props;return a?"r"in a?nk(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 Me(dx(this.getSetOnceProps()),((a,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+ry(r)]=a})),e}},ey=ct("[SessionId]"),fp=class{on(e,a){return this.Me.on(e,a)}constructor(e,a,r){var n;if(this.Oe=[],this.Ae=void 0,this.Me=new Vu,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||oo,this.Ue=r||oo;var o=this.F.persistence_name||this.F.token,i=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*mr(i,60,36e3,ey.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+o+"_window_id",this.Be="ph_"+o+"_primary_window_exists",this.qe()){var s=Lt.W(this.He),l=Lt.W(this.Be);s&&!l?this.je=s:Lt.V(this.He),Lt.G(this.Be,!0)}if((n=this.F.bootstrap)!=null&&n.sessionID)try{var u=(c=>{var d=c.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),u)}catch(c){ey.error("Invalid sessionID in bootstrap",c)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return U(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((a=>a!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&Lt.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Lt.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Lt.W(this.He):null}We(e,a,r){e===this.Le&&a===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=a,this.Le=e,this.Fe.register({[Yf]:[a,e,r]}))}Ke(){var e=this.Fe.props[Yf];return Ee(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.We(null,null,null)}destroy(){clearTimeout(this.Ye),this.Ye=void 0,this.Ae&&T&&(T.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Lt.V(this.Be)},at(T,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,a){if(e===void 0&&(e=!1),a===void 0&&(a=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=a||new Date().getTime(),[n,o,i]=this.Ke(),s=this.Je(),l=yr(i)&&i>0&&Math.abs(r-i)>864e5,u=!1,c=!o,d=!c&&!e&&this.De(r,n);c||d||l?(o=this.Ne(),s=this.Ue(),ey.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}}),i=r,u=!0):s||(s=this.Ue(),u=!0);var h=n===0||!e||l?r:n,g=i===0?new Date().getTime():i;return this.Ve(s),this.We(o,h,g),e||this.ze(),u&&this.Oe.forEach((S=>S(o,s,u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:s,sessionStartTimestamp:g,changeReason:u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:n}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var a=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:a})}}),1.1*this.sessionTimeoutMs)}},qN=["$set_once","$set"],ro=ct("[SiteApps]"),nx=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,a){if(a){var r=this.globalsForEvent(a);this.Xe.push(r),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=te._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ai(this.Qe.bind(this));this.Ze=()=>{e(),this.Xe=[],this.Ze=void 0}}}globalsForEvent(e){var a,r,n,o,i,s,l;if(!e)throw new Error("Event payload is required");var u={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[h,g]of Object.entries(d))u[h]={id:c[h],type:h,properties:g};var{$set_once:S,$set:b}=e;return{event:j({},cA(e,qN),{properties:j({},e.properties,b?{$set:j({},(a=(r=e.properties)==null?void 0:r.$set)!==null&&a!==void 0?a:{},b)}:{},S?{$set_once:j({},(n=(o=e.properties)==null?void 0:o.$set_once)!==null&&n!==void 0?n:{},S)}:{}),elements_chain:(i=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var a=this.apps[e.id],r=()=>{var s;!a.errored&&this.Xe.length&&(ro.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>a.processEvent==null?void 0:a.processEvent(l))),a.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((s=this.Ze)==null||s.call(this))},n=!1,o=s=>{a.errored=!s,a.loaded=!0,ro.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){ro.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(n&&a.loaded)try{r()}catch(s){ro.error("Error while processing buffered events PostHog app with config id "+e.id,s),a.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var a of e)this.apps[a.id]={id:a.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}ir(e){if(Object.keys(this.apps).length!==0){var a=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(a)}catch(n){ro.error("Error while processing event "+e.event+" for site app "+r.id,n)}}}onRemoteConfig(e){var a,r,n,o=this;if((a=this.siteAppLoaders)!=null&&a.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(u=>this.ir(u)))):void ro.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Ze)==null||r.call(this),(n=e.siteApps)!=null&&n.length)if(this.isEnabled){var i=function(u){var c;te["__$$ph_site_app_"+u]=o._instance,(c=te.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(o._instance,l,(d=>{if(d)return ro.error("Error while initializing PostHog app with config id "+u,d)}))};for(var{id:s,url:l}of e.siteApps)i(s)}else ro.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},pk=function(t,e){if(!t)return!1;var a=t.userAgent;if(a&&x1(a,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some((n=>x1(n?.brand,e))))return!0}catch{}return!!t.webdriver},Ou=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),oA="i.posthog.com",ox=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("."+oA,".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]=Ou.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Ou.EU:this.er[this.apiHost]=Ou.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===Ou.CUSTOM)return this.apiHost+a;var r=oA+a;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}},zN={icontains:(t,e)=>!!T&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!T&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!T&&cp(e.href,t),not_regex:(t,e)=>!!T&&!cp(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},ix=class t{constructor(e){var a=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),a.getWebExperiments((n=>{t.rr("retrieved web experiments from the server"),a.sr=new Map,n.forEach((o=>{if(o.feature_flag_key){var i;a.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(i=a.sr)==null||i.set(o.feature_flag_key,o));var s=a._instance.getFeatureFlag(o.feature_flag_key);ut(s)&&o.variants[s]&&a.nr(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var u=o.variants[l];t.ar(u)&&a.nr(o.name,l,u.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}onFeatureFlags(e){if(this._is_bot())t.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Le(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((a=>{var r;if(this.sr&&(r=this.sr)!=null&&r.has(a)){var n,o=this._instance.getFeatureFlag(a),i=(n=this.sr)==null?void 0:n.get(a);o&&i!=null&&i.variants[o]&&this.nr(i.name,o,i.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var a=rp(e?.search,"__experiment_id"),r=rp(e?.search,"__experiment_variant");a&&r&&(t.rr("previewing web experiments "+a+" && "+r),this.getWebExperiments((n=>{this.lr(parseInt(a),r,n)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,a,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var n=this._instance.get_property("$web_experiments");if(n&&!a)return e(n);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var i=o.json.experiments||[];return e(i)}})}lr(e,a,r){var n=r.filter((o=>o.id===e));n&&n.length>0&&(t.rr("Previewing web experiment ["+n[0].name+"] with variant ["+a+"]"),this.nr(n[0].name,a,n[0].variants[a].transforms))}static ar(e){return!Le(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var a;if(Le(e.conditions)||Le((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||zN[(n=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&n!==void 0?n:"icontains"](e.conditions.url,i))}static getWindowLocation(){return T?.location}static hr(e){var a;if(Le(e.conditions)||Le((a=e.conditions)==null?void 0:a.utm))return!0;var r=JA();if(r.utm_source){var n,o,i,s,l,u,c,d,h=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==r.utm_campaign,g=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==r.utm_source,S=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,b=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return h&&S&&b&&g}return!1}static rr(e){for(var a=arguments.length,r=new Array(a>1?a-1:0),n=1;n<a;n++)r[n-1]=arguments[n];z.info("[WebExperiments] "+e,r)}nr(e,a,r){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):a!=="control"?r.forEach((n=>{if(n.selector){var o;t.rr("applying transform of variant "+a+" for experiment "+e+" ",n);var i=(o=document)==null?void 0:o.querySelectorAll(n.selector);i?.forEach((s=>{var l=s;n.html&&(l.innerHTML=n.html),n.css&&l.setAttribute("style",n.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return va&&this._instance?pk(va,this._instance.config.custom_blocked_useragents):void 0}},VN=ct("[PostHog ExternalIntegrations]"),$N={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},sx=class{constructor(e){this._instance=e}it(e,a){var r;(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(n=>{if(n)return VN.error("failed to load script",n);a()}))}startIfEnabledOrStop(){var e=this,a=function(i){var s,l,u;!n||(s=te.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[i]||e.it($N[i],(()=>{var c;(c=te.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[i])==null||c.start(e._instance)})),!n&&(l=te.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[i]&&((u=te.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[i])==null||u.stop())};for(var[r,n]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;a(r)}}},lx="[SessionRecording]",Au=ct(lx),pp=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 Au.error("started without valid sessionManager"),new Error(lx+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(lx+' cannot be used with cookieless_mode="always"')}get cr(){var e,a=!((e=this._instance.get_property(zv))==null||!e.enabled),r=!this._instance.config.disable_session_recording,n=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return T&&a&&r&&!n}startIfEnabledOrStop(e){var a;if(!this.cr||(a=this.vr)==null||!a.isStarted){var r=!U(Object.assign)&&!U(Array.from);this.cr&&r?(this.gr(e),Au.info("starting")):this.stopRecording()}}gr(e){var a,r,n;this.cr&&(te!=null&&(a=te.__PosthogExtensions__)!=null&&(a=a.rrweb)!=null&&a.record&&(r=te.__PosthogExtensions__)!=null&&r.initSessionRecording?this._r(e):(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return Au.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(bA)}br(e){if(this._instance.persistence){var a,r,n=this._instance.persistence,o=()=>{var i=e.sessionRecording===!1?void 0:e.sessionRecording,s=i?.sampleRate,l=Le(s)?null:parseFloat(s);Le(l)&&this.yr();var u=i?.minimumDurationMilliseconds;n.register({[zv]:j({enabled:!!i},i,{networkPayloadCapture:j({capturePerformance:e.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:U(u)?null:u,endpoint:i?.endpoint,triggerMatchType:i?.triggerMatchType,masking:i?.masking,urlTriggers:i?.urlTriggers})})};o(),(a=this.pr)==null||a.call(this),this.pr=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:Au.info("skipping remote config with no sessionRecording",e)}log(e,a){var r;a===void 0&&(a="log"),(r=this.vr)!=null&&r.log?this.vr.log(e,a):Au.warn("log called before recorder was ready")}get mr(){var e,a,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(zv);return(r==null||(a=r.scriptConfig)==null?void 0:a.script)||"lazy-recorder"}_r(e){var a,r;if((a=te.__PosthogExtensions__)==null||!a.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(r=te.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var a;(a=this.vr)==null||a.onRRwebEmit==null||a.onRRwebEmit(e)}overrideLinkedFlag(){var e,a;this.vr||(a=this._instance.persistence)==null||a.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,a;this.vr||(a=this._instance.persistence)==null||a.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var a,r;this.vr||(r=this._instance.persistence)==null||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(a=this.vr)==null||a.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,a){var r;return!((r=this.vr)==null||!r.tryAddCustomEvent(e,a))}},Nu={},ux=()=>{},Rs="posthog",hk=!MN&&ea?.indexOf("MSIE")===-1&&ea?.indexOf("Mozilla")===-1,iA=t=>{var e;return j({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:PF(q?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:ux,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:ta&&ut(ta?.search)&&ta.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(T==null||(e=T.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:a=>{var r="Bad HTTP status: "+a.statusCode+" "+a.text;z.error(r)},get_device_id:a=>a,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:ex},error_tracking:{},_onCapture:ux,__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))},sA=t=>{var e={};U(t.process_person)||(e.person_profiles=t.process_person),U(t.xhr_headers)||(e.request_headers=t.xhr_headers),U(t.cookie_name)||(e.persistence_name=t.cookie_name),U(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),U(t.store_google)||(e.save_campaign_params=t.store_google),U(t.verbose)||(e.debug=t.verbose);var a=Ke({},e,t);return Ee(t.property_blacklist)&&(U(t.property_denylist)?a.property_denylist=t.property_blacklist:Ee(t.property_denylist)?a.property_denylist=[...t.property_blacklist,...t.property_denylist]:z.error("Invalid value for property_denylist config: "+t.property_denylist)),a},cx=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){z.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},hp=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 cx,this.Sr=!1,this.version=en.LIB_VERSION,this.Er=new Vu,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=iA(),this.SentryIntegration=Dy,this.sentryIntegration=e=>(function(a,r){var n=FA(a,r);return{name:BA,processEvent:o=>n(o)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.$r=!1,this.kr=null,this.Pr=null,this.Tr=null,this.featureFlags=new Wy(this),this.toolbar=new Oy(this),this.scrollManager=new rx(this),this.pageViewManager=new qy(this),this.surveys=new Ky(this),this.experiments=new ix(this),this.exceptions=new Gy(this),this.rateLimiter=new Qy(this),this.requestRouter=new ox(this),this.consent=new Ty(this),this.externalIntegrations=new sx(this),this.people={set:(e,a,r)=>{var n=ut(e)?{[e]:a}:e;this.setPersonProperties(n),r?.({})},set_once:(e,a,r)=>{var n=ut(e)?{[e]:a}:e;this.setPersonProperties(void 0,n),r?.({})}},this.on("eventCaptured",(e=>z.info('send "'+e?.event+'"',e)))}init(e,a,r){if(r&&r!==Rs){var n,o=(n=Nu[r])!==null&&n!==void 0?n:new t;return o._init(e,a,r),Nu[r]=o,Nu[Rs][r]=o,o}return this._init(e,a,r)}_init(e,a,r){var n;if(a===void 0&&(a={}),U(e)||ny(e))return z.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},a.debug=this.Rr(a.debug),this.Ir=a,this.Fr=[],a.person_profiles&&(this.Pr=a.person_profiles),this.set_config(Ke({},iA(a.defaults),sA(a),{name:r,token:e})),this.config.on_xhr_error&&z.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=a.disable_compression?void 0:rn.GZipJS;var o=this.Cr();this.persistence=new Fu(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Fu(j({},this.config,{persistence:"sessionStorage"}),o);var i=j({},this.persistence.props),s=j({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new tx((m=>this.Or(m)),this.config.request_queue_config),this.Ar=new ax(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 fp(this),this.sessionPropsManager=new dp(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(z.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(z.info("Initializing extensions synchronously"),this.Dr(l)),en.DEBUG=en.DEBUG||this.config.debug,en.DEBUG&&z.info("Starting in debug mode",{this:this,config:a,thisC:j({},this.config),p:i,s}),((n=a.bootstrap)==null?void 0:n.distinctID)!==void 0){var u,c,d=this.config.get_device_id(oo()),h=(u=a.bootstrap)!=null&&u.isIdentifiedID?d:a.bootstrap.distinctID;this.persistence.set_property(tn,(c=a.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:h})}if(this.jr()){var g,S,b=Object.keys(((g=a.bootstrap)==null?void 0:g.featureFlags)||{}).filter((m=>{var v;return!((v=a.bootstrap)==null||(v=v.featureFlags)==null||!v[m])})).reduce(((m,v)=>{var y;return m[v]=((y=a.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[v])||!1,m}),{}),x=Object.keys(((S=a.bootstrap)==null?void 0:S.featureFlagPayloads)||{}).filter((m=>b[m])).reduce(((m,v)=>{var y,_;return(y=a.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[v]&&(m[v]=(_=a.bootstrap)==null||(_=_.featureFlagPayloads)==null?void 0:_[v]),m}),{});this.featureFlags.receivedFeatureFlags({featureFlags:b,featureFlagPayloads:x})}if(l)this.register_once({distinct_id:xu,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(oo());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(tn,"anonymous")}return at(T,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),a.segment?iN(this,(()=>this.Lr())):this.Lr(),io(this.config._onCapture)&&this.config._onCapture!==ux&&(z.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(m=>this.config._onCapture(m.event,m)))),this.config.ip&&z.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Dr(e){var a=performance.now();this.historyAutocapture=new My(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new By(this).startIfEnabledOrStop()})),r.push((()=>{var n;this.siteApps=new nx(this),(n=this.siteApps)==null||n.init()})),e||r.push((()=>{this.sessionRecording=new pp(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Iy(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Uy(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Hy(this)})),r.push((()=>{this.exceptionObserver=new Ry(this),this.exceptionObserver.startIfEnabled()})),r.push((()=>{this.deadClicksAutocapture=new op(this,oN),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.Nr){var n=this.Nr;this.Nr=void 0,this.fi(n)}})),this.Ur(r,a)}Ur(e,a){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-a>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,a)}),0);var r=e.shift();if(r)try{r()}catch(o){z.error("Error initializing extension:",o)}}var n=Math.round(performance.now()-a);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:n}),this.config.__preview_deferred_init_extensions&&z.info("PostHog extensions initialized ("+n+"ms)")}fi(e){var a,r,n,o,i,s,l,u;if(!q||!q.body)return z.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Nr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=fe(e.supportedCompression,rn.GZipJS)?rn.GZipJS:fe(e.supportedCompression,rn.Base64)?rn.Base64:void 0),(a=e.analytics)!=null&&a.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(n=this.sessionRecording)==null||n.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(i=this.heatmaps)==null||i.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(u=this.deadClicksAutocapture)==null||u.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){z.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new Jy(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()&&lo(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&&(hk?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=up(e.url,{ip:this.config.ip?1:0}),e.headers=j({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(a=>{var r,n,o,i=j({},a);i.timeout=i.timeout||6e4,i.url=up(i.url,{_:new Date().getTime().toString(),ver:en.LIB_VERSION,compression:i.compression});var s=(r=i.transport)!==null&&r!==void 0?r:"fetch",l=Gf.filter((c=>!i.disableTransport||!c.transport||!i.disableTransport.includes(c.transport))),u=(n=(o=vA(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)})(j({},e,{callback:a=>{var r,n;this.rateLimiter.checkForLimiting(a),a.statusCode>=400&&((r=(n=this.config).on_request_error)==null||r.call(n,a)),e.callback==null||e.callback(a)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var a,r=[],n=[],o=[];lo(e,(s=>{s&&(a=s[0],Ee(a)?o.push(s):io(s)?s.call(this):Ee(s)&&a==="alias"?r.push(s):Ee(s)&&a.indexOf("capture")!==-1&&io(this[a])?o.push(s):n.push(s))}));var i=function(s,l){lo(s,(function(u){if(Ee(u[0])){var c=l;Me(u,(function(d){c=c[d[0]].apply(c,d.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),l)};i(r,this),i(n,this),i(o,this)}jr(){var e,a;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((a=this.config.bootstrap)==null?void 0:a.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,a,r){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!U(e)&&ut(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var i=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(i==null||!i.isRateLimited){a!=null&&a.$current_url&&!ut(a?.$current_url)&&(z.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),a==null||delete a.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,l=r?.timestamp||s,u=oo(),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,h=this.qr(r?.$set_once);if(h&&(c.$set_once=h),(c=FF(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,U(r?.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s),e===Wf.DISMISSED||e===Wf.SENT){var g=a?.[aA.SURVEY_ID],S=a?.[aA.SURVEY_ITERATION];d={id:g,current_iteration:S},localStorage.getItem(rA(d))||localStorage.setItem(rA(d),"true"),c.$set=j({},c.$set,{[FN({id:g,current_iteration:S},e===Wf.SENT?"responded":"dismissed")]:!0})}var b=j({},c.properties.$set,c.$set);if(Ms(b)||this.setPersonPropertiesForFlags(b),!Le(this.config.before_send)){var x=this.Wr(c);if(!x)return;c=x}this.Er.emit("eventCaptured",c);var f={method:"POST",url:(n=r?._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Or(f):this.Mr.enqueue(f),c}z.critical("This capture call is ignored due to client rate limiting.")}}else z.error("No event name provided to posthog.capture")}else z.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(a=>e(a.event,a)))}calculateEventProperties(e,a,r,n,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return a;var i=o?void 0:this.persistence.remove_event_timer(e),s=j({},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=j({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!ut(s.distinct_id)&&!yr(s.distinct_id)||ny(s.distinct_id))&&z.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,c=CN(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());s.$session_id=d,s.$window_id=h}this.sessionPropsManager&&Ke(s,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Ke(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(g=this.Ar)==null?void 0:g.length}catch(f){s.$sdk_debug_error_capturing_properties=String(f)}if(this.requestRouter.region===Ou.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=Ke(s,u),e==="$pageview"&&q&&(s.title=q.title),!U(i)){var S=r.getTime()-i;s.$duration=parseFloat((S/1e3).toFixed(3))}ea&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Ke({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Ee(this.config.property_denylist)?Me(this.config.property_denylist,(function(f){delete s[f]})):z.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(z.error("sanitize_properties is deprecated. Use before_send instead"),s=b(s,e));var x=this.Gr();return s.$process_person_profile=x,x&&!o&&this.Vr("_calculate_event_properties"),s}qr(e){var a;if(!this.persistence||!this.Gr()||this.Sr)return e;var r=this.persistence.get_initial_props(),n=(a=this.sessionPropsManager)==null?void 0:a.getSetOnceProps(),o=Ke({},r,n||{},e||{}),i=this.config.sanitize_properties;return i&&(z.error("sanitize_properties is deprecated. Use before_send instead"),o=i(o,"$set_once")),this.Sr=!0,Ms(o)?void 0:o}register(e,a){var r;(r=this.persistence)==null||r.register(e,a)}register_once(e,a,r){var n;(n=this.persistence)==null||n.register_once(e,a,r)}register_for_session(e){var a;(a=this.sessionPersistence)==null||a.register(e)}unregister(e){var a;(a=this.persistence)==null||a.unregister(e)}unregister_for_session(e){var a;(a=this.sessionPersistence)==null||a.unregister(e)}Jr(e,a){this.register({[e]:a})}getFeatureFlag(e,a){return this.featureFlags.getFeatureFlag(e,a)}getFeatureFlagPayload(e){var a=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(a)}catch{return a}}isFeatureEnabled(e,a){return this.featureFlags.isFeatureEnabled(e,a)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,a,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,a,r)}getEarlyAccessFeatures(e,a,r){return a===void 0&&(a=!1),this.featureFlags.getEarlyAccessFeatures(e,a,r)}on(e,a){return this.Er.on(e,a)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var a,r;return(a=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&a!==void 0?a:()=>{}}getSurveys(e,a){a===void 0&&(a=!1),this.surveys.getSurveys(e,a)}getActiveMatchingSurveys(e,a){a===void 0&&(a=!1),this.surveys.getActiveMatchingSurveys(e,a)}renderSurvey(e,a){this.surveys.renderSurvey(e,a)}displaySurvey(e,a){a===void 0&&(a=PN),this.surveys.displaySurvey(e,a)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,a){return a===void 0&&(a=!1),this.surveys.canRenderSurveyAsync(e,a)}identify(e,a,r){if(!this.__loaded||!this.persistence)return z.uninitializedWarning("posthog.identify");if(yr(e)&&(e=e.toString(),z.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))z.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==xu){if(this.Vr("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==n&&e!==this.get_property(ku)&&(this.unregister(ku),this.register({distinct_id:e}));var i=(this.persistence.get_property(tn)||"anonymous")==="anonymous";e!==n&&i?(this.persistence.set_property(tn,"identified"),this.setPersonPropertiesForFlags(j({},r||{},a||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:a||{},$set_once:r||{}}),this.Tr=K1(e,a,r),this.featureFlags.setAnonymousDistinctId(n)):(a||r)&&this.setPersonProperties(a,r),e!==n&&(this.reloadFeatureFlags(),this.unregister(Kf))}}else z.critical('The string "'+xu+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else z.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,a){if((e||a)&&this.Vr("posthog.setPersonProperties")){var r=K1(this.get_distinct_id(),e,a);this.Tr!==r?(this.setPersonPropertiesForFlags(j({},a||{},e||{})),this.capture("$set",{$set:e||{},$set_once:a||{}}),this.Tr=r):z.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,a,r){if(e&&a){if(this.Vr("posthog.group")){var n=this.getGroups();n[e]!==a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:j({},n,{[e]:a})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:a,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),n[e]===a||r||this.reloadFeatureFlags()}}else z.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0),this.featureFlags.setPersonPropertiesForFlags(e,a)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,a)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var a,r,n,o;if(z.info("reset"),!this.__loaded)return z.uninitializedWarning("posthog.reset");var i=this.get_property("$device_id");if(this.consent.reset(),(a=this.persistence)==null||a.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(n=this.persistence)==null||n.set_property(tn,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:xu,$device_id:null},"");else{var s=this.config.get_device_id(oo());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(yA)?(z.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(U(a)&&(a=this.get_distinct_id()),e!==a?(this.Jr(ku,e),this.capture("$create_alias",{alias:e,distinct_id:a})):(z.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var a=j({},this.config);if(mt(e)){var r,n,o,i,s;Ke(this.config,sA(e));var l=this.Cr();(r=this.persistence)==null||r.update_config(this.config,a,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Fu(j({},this.config,{persistence:"sessionStorage"}),l);var u=this.Rr(this.config.debug);so(u)&&(this.config.debug=u),so(this.config.debug)&&(this.config.debug?(en.DEBUG=!0,je.H()&&je.G("ph_debug","true"),z.info("set_config",{config:e,oldConfig:a,newConfig:j({},this.config)})):(en.DEBUG=!1,je.H()&&je.V("ph_debug"))),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(i=this.heatmaps)==null||i.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var a=e===!0,r={sampling:a||!(e==null||!e.sampling),linked_flag:a||!(e==null||!e.linked_flag),url_trigger:a||!(e==null||!e.url_trigger),event_trigger:a||!(e==null||!e.event_trigger)};if(Object.values(r).some(Boolean)){var n,o,i,s,l;(n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),r.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),r.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),r.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),r.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,a){var r=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(j({},n,a))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var a;return(a=this.persistence)==null?void 0:a.props[e]}getSessionProperty(e){var a;return(a=this.sessionPersistence)==null?void 0:a.props[e]}toString(){var e,a=(e=this.config.name)!==null&&e!==void 0?e:Rs;return a!==Rs&&(a=Rs+"."+a),a}_isIdentified(){var e,a;return((e=this.persistence)==null?void 0:e.get_property(tn))==="identified"||((a=this.sessionPersistence)==null?void 0:a.get_property(tn))==="identified"}Gr(){var e,a;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ms(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[ku])&&((a=this.persistence)==null||(a=a.props)==null||!a[Jf]))}Br(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Gr()||this.Vr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Vr(e){return this.config.person_profiles==="never"?(z.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(Jf,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),a=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!a}Kr(){var e,a,r,n,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((r=this.persistence)==null||r.set_disabled(o)),((a=this.sessionPersistence)==null?void 0:a.wi)!==o&&((n=this.sessionPersistence)==null||n.set_disabled(o)),o}opt_in_capturing(e){var a;if(this.config.cookieless_mode!=="always"){var r,n;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),this.sessionManager=new fp(this),this.persistence&&(this.sessionPropsManager=new dp(this,this.sessionManager,this.persistence)),this.sessionRecording=new pp(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(),(U(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((n=e?.captureEventName)!==null&&n!==void 0?n:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else z.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,a;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:xu,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(a=this.sessionRecording)==null||a.stopRecording(),this.sessionRecording=void 0,this.Hr())):z.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===an.GRANTED?"granted":e===an.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kr()}_is_bot(){return va?pk(va,this.config.custom_blocked_useragents):void 0}Hr(){q&&(q.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:q.title},{send_instantly:!0}),this.kr&&(q.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),at(q,"visibilitychange",this.kr)))}debug(e){e===!1?(T?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(T?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,a,r,n,o,i,s,l=this.Ir||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(z.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",n=!1,o=z,i=(a="advanced_disable_flags")in(e=l)&&!U(e[a]),s=r in e&&!U(e[r]),i?e[a]:s?(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+a+"' instead. The old field will be removed in a future major version."),e[r]):n)}Wr(e){if(Le(this.config.before_send))return e;var a=Ee(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of a){if(r=n(r),Le(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return xF(e.event)?z.warn(o+". This can cause unexpected behavior."):z.info(o),null}r.properties&&!Ms(r.properties)||z.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,a){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:a})}captureTraceMetric(e,a,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:a,$ai_metric_value:String(r)})}Rr(e){var a=so(e)&&!e,r=je.H()&&je.q("ph_debug")==="true";return!a&&(!!r||e)}};(function(t,e){for(var a=0;a<e.length;a++)t.prototype[e[a]]=BF(t.prototype[e[a]])})(hp,["identify"]);var lA,mk=(lA=Nu[Rs]=new hp,(function(){function t(){t.done||(t.done=!0,hk=!1,Me(Nu,(function(e){e._dom_loaded()})))}q!=null&&q.addEventListener?q.readyState==="complete"?t():at(q,"DOMContentLoaded",t,{capture:!1}):T&&z.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),lA);var Sx=class{constructor(e={}){this.options=e;$(this,"client");$(this,"featureFlagsCallback");$(this,"captureCallback");$(this,"consentUnsub");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&e.consent&&e.requireExplicitConsent&&typeof window<"u"&&e.apiKey){let a=e.consent;a.getStatus()==="granted"&&this.initPostHog(),this.consentUnsub=a.subscribe(n=>{n==="granted"?this.client?this.client.opt_in_capturing():this.initPostHog():n==="denied"&&this.client&&this.client.opt_out_capturing()});return}!this.client&&typeof window<"u"&&e.apiKey&&this.initPostHog()}initPostHog(){let e=this.options;if(!e.apiKey)return;let a=e.enableFeatureFlags??!0,r=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=mk.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!a,advanced_disable_feature_flags_on_first_load:!a,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:n=>{if(a&&this.featureFlagsCallback){n.onFeatureFlags(()=>{let i=this.getAllFeatureFlags();i&&this.featureFlagsCallback&&this.featureFlagsCallback(i)});let o=this.getAllFeatureFlags();o&&Object.keys(o).length>0&&this.featureFlagsCallback(o)}this.captureCallback&&n.on("eventCaptured",o=>{let i=typeof o=="string"?o:o?.event,s=typeof o=="string"?void 0:o?.properties;typeof i=="string"&&this.captureCallback?.(i,s)})}},r)}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let a={};for(let[r,n]of Object.entries(e))r.startsWith("in_segment_")&&(a[r]=n===!0);return a}identify(e,a){this.client?.identify(e,a)}alias(e,a){this.client?.alias(e,a)}track(e,a){this.client?.capture(e,a)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,a){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:a})}trackAction(e,a,r){this.track("shadow_canvas_action",{action:e,rectangleId:a,surface:r})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,a,r){let n=`$experiment_${e}`;this.register({[n]:r??`variation_${a}`,[`${n}_id`]:a}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:a,$experiment_variation_name:r??`variation_${a}`})}setPersonProperties(e){this.client?.capture("$set",{$set:e})}setPersonPropertiesOnce(e){this.client?.capture("$set",{$set_once:e})}getDistinctId(){return this.client?.get_distinct_id?.()}};function Cx(t={}){return new Sx(t)}var _x=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{}}}},wx=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{}}}},Lx=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 yp=class{constructor(){$(this,"executors",new Map);for(let{kind:e,executor:a}of yg)this.registerCore(e,a);for(let{kind:e,executor:a}of Tg)this.registerCore(e,a);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",_x),this.registerCore("core:parallel",wx),this.registerCore("core:wait",Lx)}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)}},on=new yp;function jN(t){return on.get(t)}function Ix(t){return on.has(t)}var GN=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),gk=5e4,vk=50;function fo(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(!Ix(r)&&r!=="core:mountWidget"){let n=on.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":co(t,e,a);break;case"overlays:badge":co(t,e,a),WN(t,e,a);break;case"overlays:tooltip":co(t,e,a),ZN(t,e,a);break;case"overlays:modal":oP(t,e,a);break;case"content:insertHtml":co(t,e,a),XN(t,e,a);break;case"content:setText":co(t,e,a),YN(t,e,a);break;case"content:setAttr":co(t,e,a),KN(t,e,a);break;case"content:addClass":case"content:removeClass":co(t,e,a),QN(t,e,a);break;case"content:setStyle":co(t,e,a),JN(t,e,a);break;case"core:mountWidget":eP(t,e,a);break;case"core:wait":tP(t,e,a);break;case"core:sequence":aP(t,e,a);break;case"core:parallel":rP(t,e,a);break;case"core:tour":iP(t,e,a);break;case"navigation:navigate":nP(t,e,a);break}return{valid:e.length===0,errors:e,warnings:a}}function co(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 WN(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 ZN(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 XN(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>gk&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${gk}`,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 YN(t,e,a){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function KN(t,e,a){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(GN.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 QN(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 JN(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>vk&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${r}). Maximum is ${vk}`,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 eP(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 tP(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 aP(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=fo(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 rP(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=fo(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 nP(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 oP(t,e,a){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Modal action requires 'content' object",field:"content"});return}if((!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Modal content requires 'body' property",field:"content.body"}),t.size&&!["sm","md","lg"].includes(t.size)&&e.push({code:"INVALID_SIZE",message:"Modal size must be 'sm', 'md', or 'lg'",field:"size"}),t.ctaButtons)if(!Array.isArray(t.ctaButtons))e.push({code:"INVALID_CTA_BUTTONS",message:"ctaButtons must be an array",field:"ctaButtons"});else for(let r=0;r<t.ctaButtons.length;r++){let n=t.ctaButtons[r];(!n.label||typeof n.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${r} requires 'label' property`,field:`ctaButtons[${r}].label`}),(!n.actionId||typeof n.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${r} requires 'actionId' property`,field:`ctaButtons[${r}].actionId`})}}function iP(t,e,a){if((!t.tourId||typeof t.tourId!="string")&&e.push({code:"MISSING_TOUR_ID",message:"Tour action requires 'tourId' property",field:"tourId"}),!t.steps||!Array.isArray(t.steps)){e.push({code:"MISSING_STEPS",message:"Tour action requires 'steps' array",field:"steps"});return}t.steps.length===0&&e.push({code:"EMPTY_STEPS",message:"Tour must have at least one step",field:"steps"});let r=new Set;for(let n=0;n<t.steps.length;n++){let o=t.steps[n];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${n} requires 'id' property`,field:`steps[${n}].id`}):(r.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${n}].id`}),r.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${n} requires 'action' property`,field:`steps[${n}].action`});else{let i=fo(o.action);for(let s of i.errors)e.push({...s,field:`steps[${n}].action${s.field?`.${s.field}`:""}`});for(let s of i.warnings)a.push(s)}if(o.onAction)for(let[i,s]of Object.entries(o.onAction))s!=="end"&&!t.steps.some(l=>l.id===s)&&a.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${s}`,suggestion:`Make sure step "${s}" exists in the tour`})}}function Ax(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=fo(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 sP=0;function kx(t){let{overlayRoot:e,eventBus:a,surfaces:r,anchorResolver:n,waitForAnchor:o,adaptiveId:i,executorRegistry:s=on,subscribeNavigation:l,runtime:u}=t,c=new Map,d=new Map;function h(){return`action-${++sP}`}function g(C,A){a&&a.publish(C,A)}function S(){return{overlayRoot:e,resolveAnchor:n,waitForAnchor:o,generateId:h,publishEvent:g,adaptiveId:i,applyAction:m,subscribeEvent:a?(C,A)=>a.subscribe({names:[C]},E=>A(E.props)):void 0,subscribeNavigation:l}}async function b(C,A){if(!r)throw new Error("Surfaces provider required for core:mountWidget actions");let E=r.mount(C.slot,{type:"widget",widgetId:C.widget.widgetId,config:C.widget.props},{priority:C.widget.priority});return A.publishEvent("action.applied",{id:A.generateId(),kind:"core:mountWidget",slot:C.slot,widgetId:C.widget.widgetId}),{cleanup:()=>{E.unmount()},updateFn:L=>{if("widget"in L&&L.widget){let k=L.widget;k.props&&E.update({type:"widget",widgetId:C.widget.widgetId,config:k.props})}}}}async function x(C,A){if(C.kind==="core:mountWidget")return b(C,A);let E=s.get(C.kind);if(!E){let L="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${C.kind}".`,`Registered: [${L}]`),new Error(`No executor for action kind: ${C.kind}`)}return E(C,A)}function f(C,A,E,L){if(!u)return;let k=[],O=async()=>{let R=c.get(C);if(!R)return;let P=u.evaluateSync(E).value;if(R.state==="applied"&&!P){try{await R.cleanup()}catch(F){console.error(`[ActionEngine] Error reverting conditional action ${C}:`,F)}R.state="deferred",R.cleanup=()=>{},R.updateFn=void 0,g("action.deferred",{id:C,kind:A.kind})}else if(R.state==="deferred"&&P)try{let F=S(),Q=await x(A,F);R.state="applied",R.cleanup=Q.cleanup,R.updateFn=Q.updateFn,R.appliedTs=Date.now(),g("action.applied",{id:C,kind:A.kind,anchorId:"anchorId"in A?A.anchorId:void 0})}catch(F){console.error(`[ActionEngine] Error applying deferred action ${C}:`,F),R.state="failed"}};u.context&&k.push(u.context.subscribe(O)),u.accumulator&&k.push(u.accumulator.subscribe(O)),d.set(C,k)}async function m(C){let A=fo(C);if(!A.valid){let P=A.errors.map(F=>F.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${C?.kind}":`,P,C),new Error(`Action validation failed: ${P}`)}let E=h(),L=C.triggerWhen;if(L&&u&&!u.evaluateSync(L).value){let F={id:E,action:C,adaptiveId:i,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};c.set(E,F);let Q={id:E,action:C,async revert(){let D=c.get(E);if(!D)return;let W=d.get(E);if(W){for(let dt of W)dt();d.delete(E)}D.state="reverted",c.delete(E)},isApplied(){return c.get(E)?.state==="applied"},async update(D){let W=c.get(E);if(!W||W.state!=="applied")throw new Error("Cannot update action that is not applied");if(W.updateFn)await W.updateFn(D);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(E)?.state??"reverted"}};return f(E,C,L,Q),Q}let k=S(),O=await x(C,k),R={id:E,action:C,adaptiveId:i,appliedTs:Date.now(),state:"applied",cleanup:O.cleanup,updateFn:O.updateFn};c.set(E,R),g("action.applied",{id:E,kind:C.kind,anchorId:"anchorId"in C?C.anchorId:void 0});let N={id:E,action:C,async revert(){let P=c.get(E);if(!P||P.state!=="applied")return;let F=d.get(E);if(F){for(let Q of F)Q();d.delete(E)}try{await P.cleanup(),P.state="reverted",g("action.reverted",{id:E,kind:C.kind})}catch(Q){throw P.state="failed",g("action.failed",{id:E,kind:C.kind,error:String(Q)}),Q}finally{c.delete(E)}},isApplied(){return c.get(E)?.state==="applied"},async update(P){let F=c.get(E);if(!F||F.state!=="applied")throw new Error("Cannot update action that is not applied");if(F.updateFn)await F.updateFn(P);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(E)?.state??"reverted"}};return L&&u&&f(E,C,L,N),N}async function v(C){console.log(`[ActionEngine] applyBatch: ${C.length} action(s)`,C.map(R=>R.kind).join(", "));let A=Ax(C);if(!A.valid){let R=A.errors.map(N=>N.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${C.length} action(s):`,R,`
|
|
463
|
+
Actions:`,C.map((N,P)=>` [${P}] ${N.kind} ${N.anchorId?`anchor="${typeof N.anchorId=="string"?N.anchorId:N.anchorId.selector}"`:""} ${N.label?`label="${N.label}"`:""}`).join(`
|
|
464
|
+
`)),new Error(`Batch validation failed: ${R}`)}let E=h(),L=[],k=[];try{for(let R of C){let N=await m(R);L.push(N),k.push(N)}}catch(R){console.error(`[ActionEngine] Batch apply FAILED at action ${k.length+1}/${C.length}.`,`Successfully applied: ${k.length}. Rolling back...`,R);for(let N of k)try{await N.revert()}catch{}throw R}return{id:E,handles:L,async revertAll(){for(let R=L.length-1;R>=0;R--)try{await L[R].revert()}catch(N){console.error(`[ActionEngine] Error reverting action ${L[R].id}:`,N)}},isApplied(){return L.every(R=>R.isApplied())}}}function y(C){return fo(C)}function _(){return Array.from(c.values()).map(C=>({id:C.id,action:C.action,adaptiveId:C.adaptiveId,appliedTs:C.appliedTs,state:C.state}))}function w(){for(let C of d.values())for(let A of C)try{A()}catch{}d.clear();for(let C of c.values())if(C.state==="applied")try{C.cleanup()}catch(A){console.error("[ActionEngine] Error during cleanup:",A)}c.clear()}return{apply:m,applyBatch:v,validate:y,getActive:_,destroy:w}}var lP=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),Ex=p.object({type:p.literal("page_url"),url:p.string()}),Tx=p.object({type:p.literal("route"),routeId:p.string()}),Rx=p.object({type:p.literal("anchor_visible"),anchorId:p.string(),state:p.enum(["visible","present","absent"])}),Mx=p.object({type:p.literal("event_occurred"),eventName:p.string(),withinMs:p.number().optional()}),Dx=p.object({type:p.literal("state_equals"),key:p.string(),value:p.unknown()}),Ox=p.object({type:p.literal("viewport"),minWidth:p.number().optional(),maxWidth:p.number().optional(),minHeight:p.number().optional(),maxHeight:p.number().optional()}),Bx=p.object({type:p.literal("session_metric"),key:p.string(),operator:p.enum(["gte","lte","eq","gt","lt"]),threshold:p.number()}),Fx=p.object({type:p.literal("dismissed"),key:p.string(),inverted:p.boolean().optional()}),Nx=p.object({type:p.literal("cooldown_active"),key:p.string(),inverted:p.boolean().optional()}),Px=p.object({type:p.literal("frequency_limit"),key:p.string(),limit:p.number(),inverted:p.boolean().optional()}),Wu=p.object({equals:p.union([p.string(),p.number(),p.boolean()]).optional(),contains:p.string().optional()}),Zu=p.object({events:p.array(p.string()).min(1),match:p.record(p.string(),Wu).optional()}),Hx=p.object({type:p.literal("event_count"),key:p.string(),operator:p.enum(["gte","lte","eq","gt","lt"]),count:p.number().int().min(0),withinMs:p.number().positive().optional(),counter:Zu.optional()}),qs=p.discriminatedUnion("type",[Ex,Tx,Rx,Mx,Dx,Ox,Bx,Fx,Nx,Px,Hx]),Xu=p.object({conditions:p.array(qs),value:p.unknown()}),Yu=p.object({type:p.literal("rules"),rules:p.array(Xu),default:p.unknown()}),Ku=p.object({type:p.literal("score"),field:p.string(),threshold:p.number(),above:p.unknown(),below:p.unknown()}),Qu=p.object({type:p.literal("model"),modelId:p.string(),inputs:p.array(p.string()),outputMapping:p.record(p.string(),p.unknown()),default:p.unknown()}),Ju=p.object({type:p.literal("external"),endpoint:p.string(),method:p.enum(["GET","POST"]).optional(),default:p.unknown(),timeoutMs:p.number().optional()}),ec=p.discriminatedUnion("type",[Yu,Ku,Qu,Ju]),xp=ec.nullable().optional(),uP=p.object({events:p.array(p.string()),urlContains:p.string().optional(),props:p.record(p.union([p.string(),p.number(),p.boolean()])).optional()}),cP=p.object({title:p.string().optional(),body:p.string().optional(),icon:p.string().optional()}).nullable().optional();var yk=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.")}),bp=p.object({routes:yk,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 kz(t){return qs.safeParse(t)}function Ez(t){return ec.safeParse(t)}function Tz(t){return bp.safeParse(t)}var Rz=[{defName:"matchOp",schema:Wu},{defName:"counterDef",schema:Zu},{defName:"activationConfig",schema:bp},{defName:"routeFilter",schema:yk},{defName:"ruleStrategy",schema:Yu},{defName:"scoreStrategy",schema:Ku},{defName:"modelStrategy",schema:Qu},{defName:"externalStrategy",schema:Ju},{defName:"rule",schema:Xu},{defName:"condition",schema:qs}];var Ux=p.object({tileId:p.string(),itemId:p.string().optional()}).strict(),dP=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:Ux.optional()}).strict(),fP=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:bp.optional(),notifications:p.array(dP).optional()}).strict(),pP=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()}),hP=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()}),mP=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()}),gP=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()}),vP=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()}),yP=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()}),xP=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:pP.optional(),launcher:hP.optional(),tile:mP.optional(),overlay:gP.optional(),notification:vP.optional(),content:yP.optional()}).strict(),bP=p.object({enabled:p.boolean().optional(),label:p.string().optional(),icon:p.string().optional(),position:p.string().optional(),animate:p.boolean().optional(),animationStyle:p.enum(["pulse","bounce","glow"]).optional(),notificationCount:p.number().optional()}).strict(),Fz=p.object({schemaVersion:p.string().optional(),fetchedAt:p.string().datetime(),configVersion:p.string().optional(),canvasTitle:p.string().optional(),tiles:p.array(fP),actions:p.array(p.any()),theme:xP.optional(),launcher:bP.optional(),verificationSteps:p.array(p.string()).optional()}).strict();var gt={triggerWhen:xp},Pa=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),xk=p.object({color:p.string().optional(),scrimOpacity:p.number().min(0).max(1).optional(),paddingPx:p.number().optional(),radiusPx:p.number().optional()}).strict(),bk=p.enum(["top-left","top-right","bottom-left","bottom-right"]),Sk=p.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),zx=p.object({label:p.string(),actionId:p.string(),primary:p.boolean().optional()}).strict(),Ck=p.object({title:p.string().optional(),body:p.string(),ctaButtons:p.array(zx).optional()}).strict(),_k=p.object({title:p.string().optional(),body:p.string()}).strict(),wk=p.enum(["before","after","prepend","append","replace"]),Lk=p.enum(["immediate","hover","click"]),Ik=p.object({widgetId:p.string(),props:p.record(p.unknown()).optional(),priority:p.number().optional()}).strict(),Ak=p.object({id:p.string(),action:p.any(),route:p.string().optional(),onAction:p.record(p.string()).optional()}).passthrough(),kk=p.enum(["auto","smooth","instant"]),qx=p.enum(["start","center","end","nearest"]),Ek=p.object({kind:p.literal("content:setText"),anchorId:Pa,text:p.string(),label:p.string().optional()}).extend(gt).strict(),Tk=p.object({kind:p.literal("content:setAttr"),anchorId:Pa,attr:p.string(),value:p.string(),label:p.string().optional()}).extend(gt).strict(),Rk=p.object({kind:p.literal("content:addClass"),anchorId:Pa,className:p.string(),label:p.string().optional()}).extend(gt).strict(),Mk=p.object({kind:p.literal("content:removeClass"),anchorId:Pa,className:p.string(),label:p.string().optional()}).extend(gt).strict(),Dk=p.object({kind:p.literal("content:setStyle"),anchorId:Pa,styles:p.record(p.string()),label:p.string().optional()}).extend(gt).strict(),Ok=p.object({kind:p.literal("content:insertHtml"),anchorId:Pa,html:p.string(),position:wk,deepLink:Ux.optional(),label:p.string().optional()}).extend(gt).strict(),Bk=p.object({kind:p.literal("overlays:highlight"),anchorId:Pa,style:xk.optional(),duration:p.number().optional(),label:p.string().optional()}).extend(gt).strict(),Fk=p.object({kind:p.literal("overlays:pulse"),anchorId:Pa,duration:p.number().optional(),label:p.string().optional()}).extend(gt).strict(),Nk=p.object({kind:p.literal("overlays:badge"),anchorId:Pa,content:p.string(),position:bk.optional(),label:p.string().optional()}).extend(gt).strict(),Pk=p.object({kind:p.literal("overlays:tooltip"),anchorId:Pa,content:Ck,trigger:Lk.optional(),placement:Sk.optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),Hk=p.object({kind:p.literal("overlays:modal"),content:_k,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(zx).optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),Uk=p.object({kind:p.literal("navigation:scrollTo"),anchorId:Pa,behavior:kk.optional(),block:qx.optional(),inline:qx.optional(),label:p.string().optional()}).extend(gt).strict(),qk=p.object({kind:p.literal("navigation:navigate"),url:p.string(),target:p.enum(["_self","_blank"]).optional(),label:p.string().optional()}).extend(gt).strict(),zk=p.object({kind:p.literal("core:mountWidget"),slot:p.string(),widget:Ik,label:p.string().optional()}).extend(gt).strict(),Vk=p.object({kind:p.literal("core:wait"),durationMs:p.number().min(0).optional(),event:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),$k=p.object({kind:p.literal("core:sequence"),actions:p.array(p.any()),label:p.string().optional()}).extend(gt).strict(),jk=p.object({kind:p.literal("core:parallel"),actions:p.array(p.any()),waitFor:p.enum(["all","any"]).optional(),label:p.string().optional()}).extend(gt).strict(),Gk=p.object({kind:p.literal("core:tour"),tourId:p.string(),steps:p.array(Ak).min(1),startStep:p.string().optional(),autoStart:p.boolean().optional(),label:p.string().optional()}).extend(gt).passthrough(),SP=[{defName:"setText",schema:Ek},{defName:"setAttr",schema:Tk},{defName:"addClass",schema:Rk},{defName:"removeClass",schema:Mk},{defName:"setStyle",schema:Dk},{defName:"insertHtml",schema:Ok},{defName:"highlight",schema:Bk},{defName:"pulse",schema:Fk},{defName:"badge",schema:Nk},{defName:"tooltip",schema:Pk},{defName:"modal",schema:Hk},{defName:"scrollTo",schema:Uk},{defName:"navigate",schema:qk},{defName:"mountWidget",schema:zk},{defName:"wait",schema:Vk},{defName:"sequence",schema:$k},{defName:"parallel",schema:jk},{defName:"tour",schema:Gk}];function Vx(t){let e=t?.root??(typeof document<"u"?document.body:null),a=t?.defaultTimeoutMs??5e3,r=new Map,n=new Map,o=null,i=!1;function s(x){if(!e)return null;try{return e.querySelector(x)}catch{return null}}function l(){for(let[x,f]of r){let m=s(x);if(m){for(let v of f)clearTimeout(v.timer),v.resolve(m);r.delete(x)}}for(let[x,f]of n){let m=s(x);if(m){for(let v of f)v.cancelled||v.cb(m);n.delete(x)}}r.size===0&&n.size===0&&c()}function u(){o||i||typeof MutationObserver>"u"||!e||(o=new MutationObserver(()=>{l()}),o.observe(e,{childList:!0,subtree:!0}))}function c(){o&&(o.disconnect(),o=null)}function d(x,f){let m=r.get(x);m&&(m.delete(f),m.size===0&&r.delete(x)),r.size===0&&n.size===0&&c()}function h(x,f){if(i)return Promise.reject(new Error("AnchorResolver destroyed"));let m=s(x);if(m)return Promise.resolve(m);let v=f??a;return new Promise((y,_)=>{let w={resolve:y,reject:_,timer:setTimeout(()=>{d(x,w),_(new Error(`waitFor("${x}") timed out after ${v}ms`))},v)},C=r.get(x);C||(C=new Set,r.set(x,C)),C.add(w),u()})}function g(x,f){if(i)return()=>{};let m=s(x);if(m)return f(m),()=>{};let v={cb:f,cancelled:!1},y=n.get(x);return y||(y=new Set,n.set(x,y)),y.add(v),u(),()=>{v.cancelled=!0;let _=n.get(x);_&&(_.delete(v),_.size===0&&n.delete(x)),r.size===0&&n.size===0&&c()}}function S(){let x=0;for(let f of r.values())x+=f.size;return x}function b(){i=!0,c();let x=new Error("AnchorResolver destroyed");for(let f of r.values())for(let m of f)clearTimeout(m.timer),m.reject(x);r.clear(),n.clear()}return{resolve:s,waitFor:h,onAppear:g,pendingCount:S,destroy:b}}function CP(){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 $x(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(Wk(a,r))return}if(e.include){for(let r of e.include)if(Wk(a,r))return r;return}return a}function Wk(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 Sp=class{constructor(e={}){$(this,"context");$(this,"previousContext");$(this,"listeners",new Set);$(this,"telemetry");$(this,"routes");$(this,"navigation");$(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=CP(),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=$x(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=$x(this.context.page.url,this.routes);a!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:a}})}setAnchors(e){this.updateContext({anchors:e})}setSessionId(e){e!==this.context.session.sessionId&&this.updateContext({session:{...this.context.session,sessionId:e}})}destroy(){for(let e of this.cleanupFns)e();this.cleanupFns=[],this.listeners.clear()}setupBrowserListeners(){let e,a=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};if(window.addEventListener("resize",a),this.cleanupFns.push(()=>window.removeEventListener("resize",a)),this.navigation){let r=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(r)}else{let r=()=>{this.updatePage()};window.addEventListener("popstate",r),this.cleanupFns.push(()=>window.removeEventListener("popstate",r));let n=history.pushState.bind(history),o=history.replaceState.bind(history);history.pushState=(...i)=>{n(...i),queueMicrotask(()=>this.updatePage())},history.replaceState=(...i)=>{o(...i),queueMicrotask(()=>this.updatePage())},this.cleanupFns.push(()=>{history.pushState=n,history.replaceState=o})}}updateViewport(){let e={width:window.innerWidth,height:window.innerHeight};(e.width!==this.context.viewport.width||e.height!==this.context.viewport.height)&&this.updateContext({viewport:e})}updatePage(){let e=window.location.href,{title:a}=document,r=$x(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 jx(t={}){return new Sp(t)}var _P=p.object({url:p.string(),routeId:p.string().optional(),title:p.string().optional(),locale:p.string().optional()}),wP=p.object({url:p.string(),ts:p.number()}),LP=p.object({sessionId:p.string(),startTs:p.number(),pageHistory:p.array(wP).optional()}),IP=p.object({width:p.number(),height:p.number()}),AP=p.object({x:p.number(),y:p.number(),w:p.number(),h:p.number()}),kP=p.object({anchorId:p.string(),present:p.boolean(),visible:p.boolean().optional(),boundingBox:AP.optional()}),EP=p.record(p.string(),p.union([p.number(),p.string(),p.boolean(),p.undefined()])),TP=p.object({page:_P,session:LP,viewport:IP,anchors:p.array(kP).optional(),augmented:EP.optional()});function Jz(t){return TP.safeParse(t)}function Zk(t,e){let{context:a,state:r,events:n}=e;switch(t.type){case"page_url":{let{url:o}=t,i=a.page.url,s=o.replace(/\*\*/g,"\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*");return new RegExp(`^${s}$`).test(i)}case"route":return a.page.routeId===t.routeId;case"anchor_visible":{let o=typeof t.anchorId=="string"?t.anchorId:t.anchorId?.selector??"",i=a.anchors?.find(s=>s.anchorId===o);switch(t.state){case"visible":return i?.visible===!0;case"present":return i?.present===!0;case"absent":return!i?.present;default:return!1}}case"event_occurred":{if(!n)return!1;let o=t.withinMs??6e4;return n.hasRecentEvent(t.eventName,o)}case"state_equals":return!1;case"viewport":{let{width:o,height:i}=a.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&i<t.minHeight||t.maxHeight!==void 0&&i>t.maxHeight)}case"session_metric":{if(!r)return!1;let o=r.getSessionMetric(t.key),{operator:i,threshold:s}=t;switch(i){case"gte":return o>=s;case"lte":return o<=s;case"eq":return o===s;case"gt":return o>s;case"lt":return o<s;default:return!1}}case"dismissed":{if(!r)return t.inverted??!1;let o=r.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!r)return t.inverted??!1;let o=r.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!r)return t.inverted??!1;let i=r.getFrequencyCount(t.key)>=t.limit;return t.inverted?!i:i}case"event_count":{if(!e.accumulator)return!1;let o=t,i=e.accumulator.getCount(o.key,o.withinMs);switch(o.operator){case"gte":return i>=o.count;case"lte":return i<=o.count;case"eq":return i===o.count;case"gt":return i>o.count;case"lt":return i<o.count;default:return!1}}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function Xk(t,e){let a=[];for(let r of t.conditions){let n=Zk(r,e);if(a.push({condition:r,result:n}),!n)return{matched:!1,conditionResults:a}}return{matched:!0,conditionResults:a}}function Cp(t,e){for(let a=0;a<t.rules.length;a++){let r=t.rules[a],{matched:n,conditionResults:o}=Xk(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 _p(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 Yk(t,e){let{state:a,events:r,sessionMetrics:n,accumulator:o}=e;return{context:t,state:a?{isDismissed:i=>a.dismissals.isDismissed(i),isCooldownActive:i=>a.cooldowns.isActive(i),getFrequencyCount:i=>a.frequency.count(i),getSessionMetric:i=>n?.get(i)??0}:void 0,events:r?{hasRecentEvent:(i,s)=>r.hasRecentEvent(i,s)}:void 0,accumulator:o?{getCount:(i,s)=>o.getCount(i,s)}:void 0}}async function Kk(t,e,a={}){let r=Yk(e,a);switch(t.type){case"rules":return Cp(t,r);case"score":return _p(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 Qk(t,e,a={}){let r=Yk(e,a);switch(t.type){case"rules":return Cp(t,r);case"score":return _p(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 Gx(t){return{evaluate:(e,a)=>Kk(e,a,t),evaluateSync:(e,a)=>Qk(e,a,t)}}function Wx(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 h=i.get(d.stateKey)||{count:0};h.count++,d.needsTimestamps&&(h.timestamps||(h.timestamps=[]),h.timestamps.push(u.ts),h.timestamps.length>200&&(h.timestamps=h.timestamps.slice(-200))),i.set(d.stateKey,h),c=!0}if(c)for(let d of n)try{d()}catch(h){console.error("[EventAccumulator] Subscriber error:",h)}}function l(){o||r.size===0||(o=e.subscribe(s))}return{register(u,c,d=!1){let h=`ev:${u}`,g=r.get(h);if(g){d&&!g.needsTimestamps&&(g.needsTimestamps=!0);return}r.set(h,{stateKey:h,needsTimestamps:d,predicate:c}),l()},getCount(u,c){let d=`ev:${u}`,h=i.get(d);if(!h)return 0;if(c===void 0||!h.timestamps)return h.count;let g=Date.now()-c;return h.timestamps.filter(S=>S>=g).length},subscribe(u){return n.add(u),()=>{n.delete(u)}},destroy(){o&&(o(),o=null),r.clear(),n.clear()}}}function Zx(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 wp=class{constructor(e={}){$(this,"subscriptions",new Set);$(this,"history",[]);$(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,a){let r,n;typeof e=="function"?(r=void 0,n=e):(r=e,n=a);let o={filter:r,callback:n};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,a,r="canvas"){let n={ts:Date.now(),name:e,source:r,props:a,schemaVersion:fs};this.publishEvent(n)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let a of this.subscriptions)if(Zx(e,a.filter))try{a.callback(e)}catch(r){console.error("[EventBus] Subscriber error:",r)}}getRecent(e,a){let r=this.history;return e&&(r=r.filter(n=>Zx(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=>Zx(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 tc(t={}){return new wp(t)}var Jk={$autocapture:"ui.click",$click:Se.UI_CLICK,$scroll:Se.UI_SCROLL,$input:Se.UI_INPUT,$change:Se.UI_CHANGE,$submit:Se.UI_SUBMIT,$pageview:Se.NAV_PAGE_VIEW,$pageleave:Se.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function RP(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(Jk[e])return Jk[e];if(e==="$autocapture"){let a=t.properties?.$tag_name,r=t.properties?.$event_type;return r==="submit"?Se.UI_SUBMIT:r==="change"?Se.UI_CHANGE:a==="input"||a==="textarea"?Se.UI_INPUT:Se.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function MP(t){let e={},a=t.properties||{},r=a.$elements;return a.$tag_name?e.tagName=a.$tag_name:r?.[0]?.tag_name&&(e.tagName=r[0].tag_name),a.$el_text&&(e.elementText=a.$el_text),r&&(e.elements=r),a.$current_url&&(e.url=a.$current_url),a.$pathname&&(e.pathname=a.$pathname),a.$host&&(e.host=a.$host),a.$viewport_width&&(e.viewportWidth=a.$viewport_width),a.$viewport_height&&(e.viewportHeight=a.$viewport_height),a.$session_id&&(e.sessionId=a.$session_id),a.$scroll_depth&&(e.scrollDepth=a.$scroll_depth),a.$scroll_percentage&&(e.scrollPercentage=a.$scroll_percentage),e.originalEvent=t.event,e}function eE(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:RP(t),source:"posthog",props:MP(t),schemaVersion:fs}}function tE(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 Xx(t){return(e,a)=>{if(typeof e!="string")return;let r={event:e,properties:a,timestamp:Date.now()};if(tE(r)){let n=eE(r);t(n)}}}var aE=p.enum(["posthog","canvas","derived"]),DP=p.object({ts:p.number(),name:p.string(),source:aE,props:p.record(p.string(),p.unknown()).optional(),schemaVersion:p.string()}),OP=p.object({names:p.array(p.string()).optional(),patterns:p.array(p.string()).optional(),sources:p.array(aE).optional()});function _6(t){return DP.safeParse(t)}function w6(t){return OP.safeParse(t)}var ac=class{constructor(){$(this,"listeners",new Set);$(this,"capturedPushState");$(this,"capturedReplaceState");$(this,"wasNative");$(this,"destroyed",!1);$(this,"onPopState",()=>{this.notify(window.location.href,"popstate")});this.wasNative=this.isNativeFunction(history.pushState),this.capturedPushState=history.pushState,this.capturedReplaceState=history.replaceState,history.pushState=(...e)=>{this.capturedPushState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"pushState"))},history.replaceState=(...e)=>{this.capturedReplaceState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"replaceState"))},window.addEventListener("popstate",this.onPopState)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}diagnose(){return{isNative:this.wasNative,subscriberCount:this.listeners.size}}destroy(){this.destroyed||(this.destroyed=!0,history.pushState=this.capturedPushState,history.replaceState=this.capturedReplaceState,window.removeEventListener("popstate",this.onPopState),this.listeners.clear())}notify(e,a){if(!this.destroyed)for(let r of this.listeners)try{r(e,a)}catch{}}isNativeFunction(e){try{return Function.prototype.toString.call(e).includes("[native code]")}catch{return!1}}};var Yx="cooldown:";function rE(t){return{set(e,a){let r=Yx+e,n=Date.now()+a;t.set(r,n)},isActive(e){return this.remaining(e)>0},remaining(e){let a=Yx+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=Yx+e;t.remove(a)}}}var rc="dismissed:";function nE(t,e){return{mark(a,r=!1){let n=rc+a;(r?e:t).set(n,!0)},isDismissed(a){let r=rc+a;return t.has(r)||e.has(r)},clear(a){let r=rc+a;t.remove(r),e.remove(r)},clearAll(){for(let a of t.keys())a.startsWith(rc)&&t.remove(a);for(let a of e.keys())a.startsWith(rc)&&e.remove(a)}}}var Kx="freq:";function oE(t){function e(a){let r=Kx+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=Kx+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=Kx+a;t.remove(r)},hasReachedLimit(a,r){return this.count(a)>=r}}}var BP="syntro";function Qx(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 Jx(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 Lp=class{constructor(e={}){$(this,"session");$(this,"user");$(this,"dismissals");$(this,"cooldowns");$(this,"frequency");$(this,"namespace");$(this,"namespacedStorages",new Map);this.namespace=e.namespace??BP,typeof window<"u"?(this.session=Qx(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=Qx(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=Jx(this.namespace),this.user=Jx(this.namespace)),this.dismissals=nE(this.session,this.user),this.cooldowns=rE(this.user),this.frequency=oE(this.session)}ns(e){let a=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(a)){let r=typeof window<"u"&&typeof sessionStorage<"u"?Qx(sessionStorage,a):Jx(a);this.namespacedStorages.set(a,r)}return this.namespacedStorages.get(a)}};function eb(t={}){return new Lp(t)}function nc(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function Ip(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var iE={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"}},oc={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:[]},sE={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function tb(t,e,a){let r=iE[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 ab(t,e,a){let r=a.placement==="auto"?"bottom":a.placement,n=[Yd(a.offset?{mainAxis:a.offset.y,crossAxis:a.offset.x}:8)];return a.flip!==!1&&n.push(Qd()),a.shift!==!1&&n.push(Kd({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",Xd(e,t,async()=>{let{x:i,y:s,strategy:l}=await Jd(e,t,{placement:r,middleware:n});Object.assign(t.style,{position:l,left:`${i}px`,top:`${s}px`})})}function rb(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 nb(t,e){return e==="none"||oc[e].length===0?null:t.animate(oc[e],sE)}function ob(t,e){if(e==="none"||oc[e].length===0)return Promise.resolve();let a=[...oc[e]].reverse(),r=t.animate(a,sE);return new Promise(n=>{r.onfinish=()=>n(),r.oncancel=()=>n()})}function ib(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 sb(t){switch(nc(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 lE(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(),h=c.startsWith("on"),g=(c==="href"||c==="src")&&d.startsWith("javascript:");(h||g)&&s.removeAttribute(u.name)}}for(let s of i){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return a.innerHTML=(r.firstChild,a.innerHTML)}var FP=0;function lb(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-${++FP}`}function c(y,_){a&&a.publish(y,_)}function d(y){let _=l.get(y);if(_){let w=x(y);for(let C of _)try{C(w)}catch(A){console.error("[Surfaces] State callback error:",A)}}}let h=new Map;function g(y,_,w){switch(_.type){case"html":y.innerHTML=lE(_.content);return;case"widget":{if(o?.has(_.widgetId)){let C=o.mount(_.widgetId,y,_.config);return w&&h.set(w,C),()=>{C.unmount(),w&&h.delete(w)}}console.warn(`[Surfaces] Widget not found: ${_.widgetId}`),y.innerHTML=`<div data-widget-id="${_.widgetId}" data-widget-missing="true">Widget: ${_.widgetId}</div>`;return}case"custom":return _.mount(y);case"react":y.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function S(y,_,w){let C=u(),A=nc(y),E=w?.priority??0,L=w?.animation??n,k=w?.exclusive??!0,O=i.get(y);if(O&&k){if(O.options.priority>E)throw new Error(`Slot ${y} is occupied by higher priority content (${O.options.priority} > ${E})`);b(O)}let R=ib(y,C);R.style.zIndex=String(sb(y));let N;if(A==="static")tb(R,y,w?.constraints),e.appendChild(R);else if(A==="inline"){let D=Ip(y);if(!D)throw new Error(`Invalid inline slot: ${y}`);if(!r)throw new Error("Anchor resolver required for inline slots");let W=r({selector:D,route:"**"});if(!W)throw new Error(`Anchor not found for inline slot: ${D}`);N=rb(R,W)}else if(A==="adjacent"){let D=Ip(y);if(!D)throw new Error(`Invalid adjacent slot: ${y}`);if(!r)throw new Error("Anchor resolver required for adjacent slots");let W=r({selector:D,route:"**"});if(!W)throw new Error(`Anchor not found for adjacent slot: ${D}`);e.appendChild(R),N=ab(R,W,w?.position??{placement:"bottom"})}let P=g(R,_,C);nb(R,L);let F={id:C,slot:y,content:_,options:{priority:E,exclusive:k,animation:L,position:w?.position??{placement:"auto"},constraints:w?.constraints??{},adaptiveId:w?.adaptiveId,autoUnmountOnRouteChange:w?.autoUnmountOnRouteChange??!0},container:R,cleanup:()=>{N?.(),P?.()},mountedAt:Date.now()};return i.set(y,F),s.set(y,(s.get(y)??0)+1),c("surface.mounted",{slot:y,id:C,adaptiveId:w?.adaptiveId}),d(y),{id:C,update(D){let W=i.get(y);if(!W||W.id!==C)throw new Error("Mount no longer active");let dt=h.get(C);if(dt){if(D.type==="widget"){dt.update(D.config),W.content=D;return}dt.unmount(),h.delete(C)}W.container.innerHTML="";let er=g(W.container,D,C);if(W.content=D,er){let rt=W.cleanup;W.cleanup=()=>{rt?.(),er()}}},setOptions(D){let W=i.get(y);if(!W||W.id!==C)throw new Error("Mount no longer active");D.priority!==void 0&&(W.options.priority=D.priority),D.animation!==void 0&&(W.options.animation=D.animation),D.constraints&&A==="static"&&(D.constraints.maxWidth&&(W.container.style.maxWidth=D.constraints.maxWidth),D.constraints.maxHeight&&(W.container.style.maxHeight=D.constraints.maxHeight),D.constraints.minWidth&&(W.container.style.minWidth=D.constraints.minWidth),D.constraints.minHeight&&(W.container.style.minHeight=D.constraints.minHeight)),d(y)},async unmount(){let D=i.get(y);!D||D.id!==C||await b(D)},isMounted(){return i.get(y)?.id===C},getContainer(){let D=i.get(y);return D?.id===C?D.container:null}}}async function b(y){await ob(y.container,y.options.animation),y.cleanup?.(),y.container.remove(),i.delete(y.slot),c("surface.unmounted",{slot:y.slot,id:y.id}),d(y.slot)}function x(y){let _=i.get(y);return{slot:y,occupied:!!_,currentPriority:_?.options.priority,currentAdaptiveId:_?.options.adaptiveId,mountCount:s.get(y)??0,currentMountId:_?.id}}function f(y,_){let w=l.get(y);return w||(w=new Set,l.set(y,w)),w.add(_),()=>{w?.delete(_),w?.size===0&&l.delete(y)}}function m(y,_){let w=i.get(y);return w?_!==void 0?_>=w.options.priority:!1:!0}function v(){for(let y of i.values())try{y.cleanup?.(),y.container.remove()}catch(_){console.error("[Surfaces] Error during cleanup:",_)}i.clear(),l.clear()}return{mount:S,getState:x,onStateChange:f,canMount:m,destroy:v}}var Ap=class{constructor(){$(this,"widgets",new Map);$(this,"mountedWidgets",new Map);$(this,"mountIdCounter",0);$(this,"runtimeRef");$(this,"listeners",new Set)}bindRuntime(e){this.runtimeRef=e}register(e,a,r="custom",n){if(this.widgets.has(e)){if(this.widgets.get(e).source==="built-in")throw new Error(`Cannot override built-in widget: ${e}`);console.warn(`[WidgetRegistry] Overriding widget: ${e}`)}this.widgets.set(e,{id:e,widget:a,source:r,metadata:n}),this.notify({type:"registered",widgetId:e})}unregister(e){let a=this.widgets.get(e);return a?a.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),this.notify({type:"unregistered",widgetId:e}),!0):!1}unregisterBySource(e){for(let[a,r]of this.widgets.entries())r.source===e&&this.widgets.delete(a)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,a,r){let n=this.widgets.get(e);if(!n)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;a.setAttribute("data-widget-mount-id",o),a.setAttribute("data-widget-id",e);let i={...r,runtime:this.runtimeRef},s=n.widget.mount(a,i);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:a}),{widgetId:e,container:a,unmount:()=>{let u=this.mountedWidgets.get(o);u&&(u.cleanup?.(),this.mountedWidgets.delete(o),a.removeAttribute("data-widget-mount-id"),a.removeAttribute("data-widget-id"),a.innerHTML="")},update:u=>{if(n.widget.update)n.widget.update(a,u);else{let c=this.mountedWidgets.get(o);if(c){c.cleanup?.(),a.innerHTML="";let d={...u,runtime:this.runtimeRef},h=n.widget.mount(a,d);c.cleanup=h??void 0}}}}}list(){return Array.from(this.widgets.keys())}listRegistrations(){return Array.from(this.widgets.values())}getBySource(e){return Array.from(this.widgets.values()).filter(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()}},ub=new Ap;var cE="2.0.0";function NP(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(cb(r,n))return!1}if(e.include&&e.include.length>0){for(let n of e.include)if(cb(r,n))return!0;return!1}return!0}function cb(t,e){let a=e.replace(/\/$/,"")||"/";if(t===a)return!0;let r=a.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${r}$`).test(t)}function uE(t){let a=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(n=>cb(a,n))}function db(t={}){let{telemetry:e,sessionMetrics:a,routes:r,mode:n="production",namespace:o}=t,i=t.widgets??ub,s=t.executors??on,l=t.apps??Ql,u=new ac,c=jx({telemetry:e,routes:r,navigation:u}),d=t.events??tc(),h=eb({namespace:o}),g=Wx({eventBus:d,stateStore:h}),S=Gx({state:h,events:d,sessionMetrics:a,accumulator:g}),b=jL(),x=Vx(),f=w=>uE(w)?x.resolve(w.selector):null,m=async(w,C)=>{if(!uE(w))return null;try{return await x.waitFor(w.selector,C)}catch{return null}},v=lb({overlayRoot:b,eventBus:d,anchorResolver:f,widgetRegistry:i}),y=kx({overlayRoot:b,eventBus:d,surfaces:v,anchorResolver:f,waitForAnchor:m,executorRegistry:s,subscribeNavigation:w=>u.subscribe(w),runtime:{evaluateSync:w=>S.evaluateSync(w,c.get()),context:c,accumulator:g}}),_={telemetry:e,context:c,events:d,state:h,sessionMetrics:a,actions:y,surfaces:v,widgets:i,executors:s,apps:l,accumulator:g,anchorResolver:x,navigation:u,version:cE,mode:n,async evaluate(w){return S.evaluate(w,c.get())},evaluateSync(w){return S.evaluateSync(w,c.get())},async filterTiles(w){let C=c.get().page.url,A=[];for(let E of w){let L=E.activation;if(!L){A.push(E);continue}if(NP(C,L.routes)){if(L.onlyIfPopulated){let k=E.props?.actions??[];if(k.length>0&&!k.some(R=>R.triggerWhen?S.evaluateSync(R.triggerWhen,c.get()).value:!0))continue}A.push(E)}}return A},setRoutes(w){c.setRoutes(w)},destroy(){l.unbind().catch(w=>{console.error("[Runtime] Error unbinding apps registry:",w)}),x.destroy(),g.destroy(),u.destroy(),c.destroy(),y.destroy(),v.destroy()}};return l.bind(_),i.bindRuntime(_),_}var PP=p.object({value:p.unknown(),expiresAt:p.number().optional()}),HP=p.object({count:p.number(),resetAt:p.number().optional()});function AV(t){return PP.safeParse(t)}function kV(t){return HP.safeParse(t)}var dE={growthbook:t=>Mv({...t,autoInit:!0})};function fE(t,e){let a=dE[t];if(!a)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(dE).join(", ")}`);return a(e)}var UP=["cdn.syntrologie.com","localhost","127.0.0.1"];function qP(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):UP.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 fb=class{constructor(e){$(this,"name","cdn");$(this,"url");$(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!qP(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 zP(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 zP(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 pE(t){return new fb(t)}var VP="syntro_exp",$P="syntro_var",pb=class{constructor(e){$(this,"name","experiments");$(this,"client");$(this,"featureKey");$(this,"manifestKey");$(this,"variantFlagPrefix");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config",this.manifestKey=e.manifestKey,this.variantFlagPrefix=e.variantFlagPrefix}async fetch(){let e=performance.now();if(typeof window<"u"){let n=new URLSearchParams(window.location.search),o=n.get(VP),i=n.get($P);if(o&&i!==null&&this.client.setForcedVariations){let s=parseInt(i,10);Number.isNaN(s)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${s}`),this.client.setForcedVariations({[o]:s}))}}if(this.manifestKey||this.variantFlagPrefix){let n=this.fetchMultiFlag();if(n){let o=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:o,cached:!0}}}}let a=this.client.getFeatureValue?.(this.featureKey,null);if(!a||typeof a!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let r=performance.now()-e;return{config:a,meta:{source:"experiments",fetchTimeMs:r,cached:!0}}}fetchMultiFlag(){let e=this.getVariantFlagKeys();return!e||e.length===0?null:nf(this.client,e)}getVariantFlagKeys(){if(this.manifestKey){let e=this.client.getFeatureValue?.(this.manifestKey,null);if(e&&typeof e=="object"){let a=e.variant_flags;if(a&&a.length>0)return a}}if(this.variantFlagPrefix&&this.client.getAllFeatures){let e=this.client.getAllFeatures();return Object.keys(e).filter(a=>a.startsWith(this.variantFlagPrefix))}return[]}};function hE(t){return new pb(t)}var jP="https://cdn.syntrologie.com/configs",mE={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return pE({baseUrl:t.baseUrl??jP,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return hE({featureKey:t.featureKey})}};function gE(t,e={}){let a=mE[t];if(!a)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(mE).join(", ")}`);return a(e)}var vE={posthog:t=>Cx(t),noop:()=>Hv()};function yE(t,e){let a=vE[t];if(!a)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(vE).join(", ")}`);return a(e)}var hb="syn_";function kp(t){if(!t.startsWith(hb))throw new Error("Invalid Syntro token: must start with 'syn_'");let a=t.slice(hb.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 mb(t){let e=JSON.stringify(t),a=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return hb+a}function sn(t){if(typeof process<"u"&&process.env)return process.env[t];try{let e=(0,eval)("import.meta");if(e?.env)return e.env[t]}catch{}}function GP(){if(typeof window>"u")return Z("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=qo(),a=!!(qn()?.token&&t?.mode==="editor");return Z("Syntro Bootstrap","isEditorMode:",a),a}function WP(){if(typeof window>"u")return Z("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=qo(),a=!!(qn()?.token&&t?.mode==="audit");return Z("Syntro Bootstrap","isAuditMode:",a),a}function ZP(){if(typeof window>"u")return Z("Syntro Bootstrap","isReviewMode: not in browser"),!1;let t=qo(),a=!!(qn()?.token&&t?.mode==="review");return Z("Syntro Bootstrap","isReviewMode:",a),a}var xE="syntro_segment_attributes";function XP(){if(typeof window>"u")return{};try{let t=localStorage.getItem(xE);if(t){let e=JSON.parse(t);return Z("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){ma("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function YP(t){if(!(typeof window>"u"))try{localStorage.setItem(xE,JSON.stringify(t)),Z("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){ma("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function KP(t){if(!t)return{};let e={};for(let[a,r]of Object.entries(t))a.startsWith("in_segment_")&&(e[a]=r===!0);return e}async function QP(t){qg(),Z("Syntro Bootstrap","====== INIT ======"),Z("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=GP(),a=WP(),r=ZP(),n=e?"editor":a?"audit":r?"review":null;if(console.log(`[DIAG] Mode detection: editor=${e}, audit=${a}, review=${r}, sdkMode=${n}`),console.log("[DIAG] editorSource:",qn()),console.log("[DIAG] editorConf:",qo()),Z("Syntro Bootstrap","SDK mode:",n??"normal"),!n&&typeof window<"u"){let L=!!window.__SYNTRO_EDITOR_PARAMS__,k=!!window.__SYNTRO_AUDIT_LEGEND__,O=!!window.__SYNTRO_REVIEW_DATA__;if(L||k||O){let R=[L&&"__SYNTRO_EDITOR_PARAMS__",k&&"__SYNTRO_AUDIT_LEGEND__",O&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${R.join(", ")}. This suggests URL params were lost (redirect?) but the service worker injected mode data. Check if replaceState failed or if page JS changed the URL before init().`)}}console.log(`[DIAG] Token resolution: options.token=${t.token?t.token.slice(0,15)+"...":"null"}`);let o=t.token;if(!o&&n){let k=qo()?.syntro_token;k?.startsWith("syn_")&&(o=k,Z("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${n} mode)`))}let i;if(o)if(o.startsWith("syn_"))Z("Syntro Bootstrap","Token starts with syn_, decoding..."),i=kp(o),qg(i.d);else if(n)Z("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${n} mode)`);else throw of("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),of("Syntro Bootstrap","Token received:",o),new Error("Invalid Syntro token: must start with 'syn_'");else if(n)Z("Syntro Bootstrap",`\u2713 No token, but ${n} mode - proceeding`);else throw of("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit/review mode!"),new Error("Syntro token is required (unless in editor, audit, or review mode)");let s=sn("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||sn("VITE_SYNTRO_EXPERIMENT_HOST")||i?.eh,l=sn("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||sn("VITE_SYNTRO_TELEMETRY_HOST")||i?.th,u=sn("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||sn("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,c=XP();Z("Syntro Bootstrap","Phase 1: Using cached segment attributes:",c);let d,h=tc();console.log("[Syntro Bootstrap] EventBus created");let g=Xx(L=>{h.publishEvent(L)}),S=L=>{Z("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let k=KP(L);if(Z("Syntro Bootstrap","Segment flags from PostHog:",k),YP(k),d){let R={...x?.getAll?.()??{},...k};Z("Syntro Bootstrap","Updating GrowthBook with attributes:",R),d.setAttributes?.(R)}},b;if(i?.t){let L=i.t==="noop"?"noop":"posthog";b=yE(L,{apiKey:i.t,apiHost:l,enableFeatureFlags:!0,onFeatureFlagsLoaded:S,onCapture:g}),console.log(`[Syntro Bootstrap] Telemetry client created (${L}) with EventBus wiring`)}let x;i?.e&&(d=fE("growthbook",{clientKey:i.e,apiHost:s,attributes:c,onExperimentViewed:b?.trackExperiment?(L,k,O)=>{b.trackExperiment(L,k,O)}:void 0})),t.enableSessionMetrics&&(x=Dv({experiments:d,onMetricChange:(L,k)=>{Z("Syntro Bootstrap",`Session metric changed: ${L} = ${k}`)}}),Z("Syntro Bootstrap","SessionMetricTracker created"));let f="production";e?f="editor":a?f="audit":sn("NODE_ENV")==="development"&&(f="development");let m=db({telemetry:b,sessionMetrics:x,mode:f,events:h});Z("Syntro Bootstrap","Runtime created:",{version:m.version,mode:m.mode,hasContext:!!m.context,hasEvents:!!m.events,hasState:!!m.state}),Z("Syntro Bootstrap","Core app executors already registered");let v=t.cdnBase||sn("NEXT_PUBLIC_SYNTRO_CDN_BASE")||sn("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",y=Bg({cdnBase:v,registry:m.apps,onLoadStart:L=>{Z("Syntro Bootstrap",`Loading app from CDN: ${L}`)},onLoadEnd:(L,k,O)=>{k?Z("Syntro Bootstrap",`App loaded successfully: ${L}`):ma("Syntro Bootstrap",`Failed to load app: ${L}`,O)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:m.apps,runtime:m,version:m.version},Z("Syntro Bootstrap","Global SynOS object exposed"));let _=m.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${_.length} apps in registry:`,_.map(L=>`${L.manifest.id}(${L.state})`).join(", "));for(let L of _)if(L.state==="registered")try{await m.apps.activate(L.manifest.id),console.log(`[DIAG] Activated: ${L.manifest.id} \u2192 widgets: [${m.widgets.list().join(", ")}]`)}catch(k){console.error(`[DIAG] FAILED to activate: ${L.manifest.id}`,k),ma("Syntro Bootstrap",`Failed to auto-activate built-in app: ${L.manifest.id}`,k)}if(console.log(`[DIAG] Activation complete. Total widgets: [${m.widgets.list().join(", ")}]`),d?.refreshFeatures)try{await d.refreshFeatures(),Z("Syntro Bootstrap","GrowthBook features loaded")}catch(L){ma("Syntro Bootstrap","Failed to load GrowthBook features:",L)}let w;if(t.fetcher)w=t.fetcher;else if(i?.f){let L=gE(i.f,i.o??{});w=async()=>{let k=await L.fetch();return{...k.config,tiles:k.config.tiles??[]}}}else d&&(w=ls({experiments:d}));let C=new Set,A=w?async()=>{let L=await w();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${L.tiles?.length??0},`,`actions=${L.actions?.length??0},`,`theme=${L.theme?.name??"none"}`),L.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",L.actions.map((R,N)=>`[${N}] ${R.kind}${R.anchorId?` anchor="${typeof R.anchorId=="string"?R.anchorId:R.anchorId.selector}"`:""}${R.label?` "${R.label}"`:""}`).join(", "));let k=L,O=y.getRequiredApps(k);return O.length>0?console.log("[Syntro Bootstrap] Required external apps:",O.join(", ")):Z("Syntro Bootstrap","No external apps required (all executors are built-in)"),O.length>0&&await y.loadAppsForConfig(k).then(async N=>{let P=N.filter(D=>D.success),F=N.filter(D=>!D.success);P.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${P.map(D=>D.appId).join(", ")}`);let Q=F.filter(D=>!C.has(D.appId));Q.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",Q.map(D=>`${D.appId} (${D.error})`).join(", ")),Q.forEach(D=>C.add(D.appId)));for(let D of O)if(m.apps.has(D))try{await m.apps.activate(D),console.log(`[Syntro Bootstrap] App activated: ${D}`)}catch(W){console.error(`[Syntro Bootstrap] Failed to activate app: ${D}`,W)}else console.error(`[Syntro Bootstrap] App "${D}" required by config but NOT registered.`,`Available apps: [${Array.from(m.apps.list?.()??[]).join(", ")}]`)}),L}:void 0;return{canvas:await pv({...t.canvas,fetcher:A,integrations:{experiments:d,telemetry:b},editorUrl:u,runtime:m}),runtime:m,experiments:d,telemetry:b,sessionMetrics:x,appLoader:y}}var bE={init:QP,encodeToken:mb,decodeToken:kp};typeof window<"u"&&(window.Syntro=bE);var SE="2026-03-04T00:05:33.583Z (00e3189890)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${SE}`);let t=window.SynOS,e=t?.appRegistry||Ql;window.SynOS={...t,appRegistry:e,_runtimeBuild:SE,React:CE.default,ReactDOM:{...JP,createPortal:Ep.createPortal,flushSync:Ep.flushSync}},ML(e)}export{oc as ANIMATION_KEYFRAMES,bp as ActivationConfigZ,Rk as AddClassZ,Pa as AnchorIdZ,kP as AnchorStateZ,Rx as AnchorVisibleConditionZ,tf as AppRegistry,EP as AugmentationZ,bk as BadgePositionZ,Nk as BadgeZ,AP as BoundingBoxZ,tu as CanvasEvents,Nv as CanvasRecipeZ,qs as ConditionZ,Sp as ContextManager,Nx as CooldownActiveConditionZ,Zu as CounterDefZ,zx as CtaButtonZ,Zg as DEFAULT_COOLDOWN,Wg as DEFAULT_TTL,ec as DecisionStrategyZ,Fx as DismissedConditionZ,fs as EVENT_SCHEMA_VERSION,wp as EventBus,Hx as EventCountConditionZ,OP as EventFilterZ,Mx as EventOccurredConditionZ,aE as EventSourceZ,yp as ExecutorRegistry,Ju as ExternalStrategyZ,HP as FrequencyEntryZ,Px as FrequencyLimitConditionZ,pF as HighlightStepZ,xk as HighlightStyleZ,Bk as HighlightZ,Ok as InsertHtmlZ,wk as InsertPositionZ,Gg as MAX_VISIBLE_TOASTS,Wu as MatchOpZ,_k as ModalContentZ,Hk as ModalZ,Qu as ModelStrategyZ,zk as MountWidgetZ,qk as NavigateZ,ac as NavigationMonitor,DP as NormalizedEventZ,jg as NotificationToastStack,_P as PageContextZ,wP as PageHistoryEntryZ,Ex as PageUrlConditionZ,jk as ParallelZ,Sk as PlacementZ,Fk as PulseZ,SE as RUNTIME_SDK_BUILD,cE as RUNTIME_VERSION,Mk as RemoveClassZ,Tx as RouteConditionZ,yk as RouteFilterZ,Yu as RuleStrategyZ,Xu as RuleZ,TP as RuntimeContextZ,Jg as RuntimeProvider,Un as SDK_SCHEMA_VERSION,zg as SDK_VERSION,iE as STATIC_SLOT_STYLES,Ku as ScoreStrategyZ,kk as ScrollBehaviorZ,qx as ScrollLogicalPositionZ,Uk as ScrollToZ,f1 as SelectorZ,$k as SequenceZ,LP as SessionContextZ,Bx as SessionMetricConditionZ,Rf as SessionMetricTracker,Tk as SetAttrZ,Dk as SetStyleZ,Ek as SetTextZ,sI as ShadowCanvasOverlay,ZL as ShadowRootProvider,dI as SmartCanvasApp,$g as SmartCanvasController,dv as SmartCanvasElement,j5 as SmartCanvasPortal,Se as StandardEvents,Dx as StateEqualsConditionZ,Lp as StateStore,PP as StoredValueZ,bE as Syntro,lu as TileCard,Oq as TileWheel,Ck as TooltipContentZ,fF as TooltipStepZ,Lk as TooltipTriggerZ,Pk as TooltipZ,Ak as TourStepForSchemaZ,Gk as TourZ,xp as TriggerWhenZ,Ox as ViewportConditionZ,IP as ViewportContextZ,Vk as WaitZ,Ik as WidgetConfigZ,Ap as WidgetRegistry,Ql as appRegistry,tb as applyStaticSlotStyles,Dg as cleanupAppContext,xg as contentRuntime,SP as coreActionStepSchemas,kx as createActionEngine,Vx as createAnchorResolver,Mg as createAppContext,Bg as createAppLoader,ls as createCanvasConfigFetcher,jx as createContextManager,Gx as createDecisionEngine,Wx as createEventAccumulator,tc as createEventBus,Mv as createGrowthBookClient,Hv as createNoopClient,V5 as createOverlayRecipeFetcher,Cx as createPostHogClient,Xx as createPostHogNormalizer,Dv as createSessionMetricTracker,pv as createSmartCanvas,GL as createSmartCanvasController,db as createSmartCanvasRuntime,eb as createStateStore,ib as createSurfaceContainer,lb as createSurfaces,Rz as decisionSchemas,kp as decodeToken,mb as encodeToken,Kk as evaluate,Zk as evaluateCondition,Xk as evaluateRule,Cp as evaluateRuleStrategy,_p as evaluateScoreStrategy,Qk as evaluateSync,on as executorRegistry,eD as getAntiFlickerSnippet,vL as getAppIdFromActionKind,Og as getAppIdFromWidgetId,jN as getExecutor,Ip as getSlotAnchorId,nc as getSlotType,sb as getSlotZIndex,Ix as hasExecutor,uf as interpolateTemplate,gL as isCoreActionKind,Xg as matchEvent,Pq as needsMigration,eE as normalizePostHogEvent,Rg as overlaysRuntime,uu as parseVersion,nb as playEnterAnimation,ob as playExitAnimation,sf as registerConfigPredicates,mI as registerSmartCanvasElement,Vg as resolveConfigUri,ab as setupAdjacentPositioning,rb as setupInlinePositioning,tE as shouldNormalizeEvent,ND as useDecision,Yg as useNotifications,Kg as useNotifyWatcher,ev as usePageContext,Vr as useRuntime,df as useRuntimeContext,BD as useRuntimeEvents,FD as useRuntimeState,DD as useSessionContext,uI as useShadowCanvasConfig,ds as useShadowRoot,OD as useViewportContext,fo as validateAction,Ax as validateActions,Tz as validateActivationConfig,kz as validateCondition,Nq as validateConfig,w6 as validateEventFilter,kV as validateFrequencyEntry,_6 as validateNormalizedEvent,H5 as validateRecipe,Jz as validateRuntimeContext,AV as validateStoredValue,Ez as validateStrategy,ub as widgetRegistry};
|
|
446
465
|
/*! Bundled license information:
|
|
447
466
|
|
|
448
467
|
react/cjs/react.production.js:
|
|
@@ -499,5 +518,29 @@ react/cjs/react-jsx-runtime.production.js:
|
|
|
499
518
|
* This source code is licensed under the MIT license found in the
|
|
500
519
|
* LICENSE file in the root directory of this source tree.
|
|
501
520
|
*)
|
|
521
|
+
|
|
522
|
+
lucide-react/dist/esm/shared/src/utils/mergeClasses.js:
|
|
523
|
+
lucide-react/dist/esm/shared/src/utils/toKebabCase.js:
|
|
524
|
+
lucide-react/dist/esm/shared/src/utils/toCamelCase.js:
|
|
525
|
+
lucide-react/dist/esm/shared/src/utils/toPascalCase.js:
|
|
526
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
|
527
|
+
lucide-react/dist/esm/shared/src/utils/hasA11yProp.js:
|
|
528
|
+
lucide-react/dist/esm/Icon.js:
|
|
529
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
|
530
|
+
lucide-react/dist/esm/icons/circle-question-mark.js:
|
|
531
|
+
lucide-react/dist/esm/icons/compass.js:
|
|
532
|
+
lucide-react/dist/esm/icons/file-text.js:
|
|
533
|
+
lucide-react/dist/esm/icons/gamepad-2.js:
|
|
534
|
+
lucide-react/dist/esm/icons/layers.js:
|
|
535
|
+
lucide-react/dist/esm/icons/message-circle.js:
|
|
536
|
+
lucide-react/dist/esm/icons/sparkles.js:
|
|
537
|
+
lucide-react/dist/esm/icons/trophy.js:
|
|
538
|
+
lucide-react/dist/esm/lucide-react.js:
|
|
539
|
+
(**
|
|
540
|
+
* @license lucide-react v0.576.0 - ISC
|
|
541
|
+
*
|
|
542
|
+
* This source code is licensed under the ISC license.
|
|
543
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
544
|
+
*)
|
|
502
545
|
*/
|
|
503
546
|
//# sourceMappingURL=smart-canvas.esm.js.map
|