@syntrologie/runtime-sdk 2.0.0-canary.1 → 2.0.0

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.
@@ -1,15 +1,14 @@
1
- var jA=Object.create;var fc=Object.defineProperty;var qA=Object.getOwnPropertyDescriptor;var PA=Object.getOwnPropertyNames;var GA=Object.getPrototypeOf,YA=Object.prototype.hasOwnProperty;var Ly=t=>{throw TypeError(t)};var ZA=(t,e,n)=>e in t?fc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Dn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),WA=(t,e)=>{for(var n in e)fc(t,n,{get:e[n],enumerable:!0})},XA=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of PA(e))!YA.call(t,r)&&r!==n&&fc(t,r,{get:()=>e[r],enumerable:!(i=qA(e,r))||i.enumerable});return t};var J=(t,e,n)=>(n=t!=null?jA(GA(t)):{},XA(e||!t||!t.__esModule?fc(n,"default",{value:t,enumerable:!0}):n,t));var F=(t,e,n)=>ZA(t,typeof e!="symbol"?e+"":e,n),zy=(t,e,n)=>e.has(t)||Ly("Cannot "+n);var Ne=(t,e,n)=>(zy(t,e,"read from private field"),n?n.call(t):e.get(t)),Gi=(t,e,n)=>e.has(t)?Ly("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ln=(t,e,n,i)=>(zy(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n);var Rb=Dn(X=>{"use strict";var Rh=Symbol.for("react.transitional.element"),TR=Symbol.for("react.portal"),RR=Symbol.for("react.fragment"),OR=Symbol.for("react.strict_mode"),MR=Symbol.for("react.profiler"),NR=Symbol.for("react.consumer"),DR=Symbol.for("react.context"),LR=Symbol.for("react.forward_ref"),zR=Symbol.for("react.suspense"),BR=Symbol.for("react.memo"),Eb=Symbol.for("react.lazy"),HR=Symbol.for("react.activity"),_b=Symbol.iterator;function UR(t){return t===null||typeof t!="object"?null:(t=_b&&t[_b]||t["@@iterator"],typeof t=="function"?t:null)}var wb={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Cb=Object.assign,Ab={};function la(t,e,n){this.props=t,this.context=e,this.refs=Ab,this.updater=n||wb}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 kb(){}kb.prototype=la.prototype;function Oh(t,e,n){this.props=t,this.context=e,this.refs=Ab,this.updater=n||wb}var Mh=Oh.prototype=new kb;Mh.constructor=Oh;Cb(Mh,la.prototype);Mh.isPureReactComponent=!0;var bb=Array.isArray;function Th(){}var Te={H:null,A:null,T:null,S:null},Tb=Object.prototype.hasOwnProperty;function Nh(t,e,n){var i=n.ref;return{$$typeof:Rh,type:t,key:e,ref:i!==void 0?i:null,props:n}}function $R(t,e){return Nh(t.type,e,t.props)}function Dh(t){return typeof t=="object"&&t!==null&&t.$$typeof===Rh}function VR(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Sb=/\/+/g;function kh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?VR(""+t.key):e.toString(36)}function IR(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Th,Th):(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 oa(t,e,n,i,r){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(s){case"bigint":case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case Rh:case TR:a=!0;break;case Eb:return a=t._init,oa(a(t._payload),e,n,i,r)}}if(a)return r=r(t),a=i===""?"."+kh(t,0):i,bb(r)?(n="",a!=null&&(n=a.replace(Sb,"$&/")+"/"),oa(r,e,n,"",function(c){return c})):r!=null&&(Dh(r)&&(r=$R(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(Sb,"$&/")+"/")+a)),e.push(r)),1;a=0;var o=i===""?".":i+":";if(bb(t))for(var l=0;l<t.length;l++)i=t[l],s=o+kh(i,l),a+=oa(i,e,n,s,r);else if(l=UR(t),typeof l=="function")for(t=l.call(t),l=0;!(i=t.next()).done;)i=i.value,s=o+kh(i,l++),a+=oa(i,e,n,s,r);else if(s==="object"){if(typeof t.then=="function")return oa(IR(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 du(t,e,n){if(t==null)return t;var i=[],r=0;return oa(t,i,"","",function(s){return e.call(n,s,r++)}),i}function FR(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 xb=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)},jR={map:du,forEach:function(t,e,n){du(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return du(t,function(){e++}),e},toArray:function(t){return du(t,function(e){return e})||[]},only:function(t){if(!Dh(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};X.Activity=HR;X.Children=jR;X.Component=la;X.Fragment=RR;X.Profiler=MR;X.PureComponent=Oh;X.StrictMode=OR;X.Suspense=zR;X.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Te;X.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Te.H.useMemoCache(t)}};X.cache=function(t){return function(){return t.apply(null,arguments)}};X.cacheSignal=function(){return null};X.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=Cb({},t.props),r=t.key;if(e!=null)for(s in e.key!==void 0&&(r=""+e.key),e)!Tb.call(e,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&e.ref===void 0||(i[s]=e[s]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var a=Array(s),o=0;o<s;o++)a[o]=arguments[o+2];i.children=a}return Nh(t.type,r,i)};X.createContext=function(t){return t={$$typeof:DR,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:NR,_context:t},t};X.createElement=function(t,e,n){var i,r={},s=null;if(e!=null)for(i in e.key!==void 0&&(s=""+e.key),e)Tb.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 o=Array(a),l=0;l<a;l++)o[l]=arguments[l+2];r.children=o}if(t&&t.defaultProps)for(i in a=t.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return Nh(t,s,r)};X.createRef=function(){return{current:null}};X.forwardRef=function(t){return{$$typeof:LR,render:t}};X.isValidElement=Dh;X.lazy=function(t){return{$$typeof:Eb,_payload:{_status:-1,_result:t},_init:FR}};X.memo=function(t,e){return{$$typeof:BR,type:t,compare:e===void 0?null:e}};X.startTransition=function(t){var e=Te.T,n={};Te.T=n;try{var i=t(),r=Te.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(Th,xb)}catch(s){xb(s)}finally{e!==null&&n.types!==null&&(e.types=n.types),Te.T=e}};X.unstable_useCacheRefresh=function(){return Te.H.useCacheRefresh()};X.use=function(t){return Te.H.use(t)};X.useActionState=function(t,e,n){return Te.H.useActionState(t,e,n)};X.useCallback=function(t,e){return Te.H.useCallback(t,e)};X.useContext=function(t){return Te.H.useContext(t)};X.useDebugValue=function(){};X.useDeferredValue=function(t,e){return Te.H.useDeferredValue(t,e)};X.useEffect=function(t,e){return Te.H.useEffect(t,e)};X.useEffectEvent=function(t){return Te.H.useEffectEvent(t)};X.useId=function(){return Te.H.useId()};X.useImperativeHandle=function(t,e,n){return Te.H.useImperativeHandle(t,e,n)};X.useInsertionEffect=function(t,e){return Te.H.useInsertionEffect(t,e)};X.useLayoutEffect=function(t,e){return Te.H.useLayoutEffect(t,e)};X.useMemo=function(t,e){return Te.H.useMemo(t,e)};X.useOptimistic=function(t,e){return Te.H.useOptimistic(t,e)};X.useReducer=function(t,e,n){return Te.H.useReducer(t,e,n)};X.useRef=function(t){return Te.H.useRef(t)};X.useState=function(t){return Te.H.useState(t)};X.useSyncExternalStore=function(t,e,n){return Te.H.useSyncExternalStore(t,e,n)};X.useTransition=function(){return Te.H.useTransition()};X.version="19.2.3"});var bt=Dn((OL,Ob)=>{"use strict";Ob.exports=Rb()});var Db=Dn(fu=>{"use strict";var ZR=Symbol.for("react.transitional.element"),WR=Symbol.for("react.fragment");function Nb(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:ZR,type:t,key:i,ref:e!==void 0?e:null,props:n}}fu.Fragment=WR;fu.jsx=Nb;fu.jsxs=Nb});var xe=Dn((YL,Lb)=>{"use strict";Lb.exports=Db()});var Vb=Dn(kt=>{"use strict";var R2=bt();function $b(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 At={d:{f:sr,r:function(){throw Error($b(522))},D:sr,C:sr,L:sr,m:sr,X:sr,S:sr,M:sr},p:0,findDOMNode:null},O2=Symbol.for("react.portal");function M2(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O2,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Ko=R2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function gu(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=At;kt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error($b(299));return M2(t,e,null,n)};kt.flushSync=function(t){var e=Ko.T,n=At.p;try{if(Ko.T=null,At.p=2,t)return t()}finally{Ko.T=e,At.p=n,At.d.f()}};kt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,At.d.C(t,e))};kt.prefetchDNS=function(t){typeof t=="string"&&At.d.D(t)};kt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=gu(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,s=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?At.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:s}):n==="script"&&At.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:s,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};kt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=gu(e.as,e.crossOrigin);At.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&&At.d.M(t)};kt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=gu(n,e.crossOrigin);At.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};kt.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=gu(e.as,e.crossOrigin);At.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 At.d.m(t)};kt.requestFormReset=function(t){At.d.r(t)};kt.unstable_batchedUpdates=function(t,e){return t(e)};kt.useFormState=function(t,e,n){return Ko.H.useFormState(t,e,n)};kt.useFormStatus=function(){return Ko.H.useHostTransitionStatus()};kt.version="19.2.3"});var mu=Dn((z4,Fb)=>{"use strict";function Ib(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ib)}catch(t){console.error(t)}}Ib(),Fb.exports=Vb()});var rS=Dn(Le=>{"use strict";function Kh(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<vu(r,e))t[i]=e,t[n]=r,n=i;else break e}}function Fn(t){return t.length===0?null:t[0]}function _u(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,s=r>>>1;i<s;){var a=2*(i+1)-1,o=t[a],l=a+1,c=t[l];if(0>vu(o,n))l<r&&0>vu(c,o)?(t[i]=c,t[l]=n,i=l):(t[i]=o,t[a]=n,i=a);else if(l<r&&0>vu(c,n))t[i]=c,t[l]=n,i=l;else break e}}return e}function vu(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}Le.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Wb=performance,Le.unstable_now=function(){return Wb.now()}):(Zh=Date,Xb=Zh.now(),Le.unstable_now=function(){return Zh.now()-Xb});var Wb,Zh,Xb,gi=[],lr=[],U2=1,cn=null,St=3,Qh=!1,Jo=!1,el=!1,Jh=!1,Jb=typeof setTimeout=="function"?setTimeout:null,eS=typeof clearTimeout=="function"?clearTimeout:null,Kb=typeof setImmediate<"u"?setImmediate:null;function yu(t){for(var e=Fn(lr);e!==null;){if(e.callback===null)_u(lr);else if(e.startTime<=t)_u(lr),e.sortIndex=e.expirationTime,Kh(gi,e);else break;e=Fn(lr)}}function eg(t){if(el=!1,yu(t),!Jo)if(Fn(gi)!==null)Jo=!0,pa||(pa=!0,fa());else{var e=Fn(lr);e!==null&&tg(eg,e.startTime-t)}}var pa=!1,tl=-1,tS=5,nS=-1;function iS(){return Jh?!0:!(Le.unstable_now()-nS<tS)}function Wh(){if(Jh=!1,pa){var t=Le.unstable_now();nS=t;var e=!0;try{e:{Jo=!1,el&&(el=!1,eS(tl),tl=-1),Qh=!0;var n=St;try{t:{for(yu(t),cn=Fn(gi);cn!==null&&!(cn.expirationTime>t&&iS());){var i=cn.callback;if(typeof i=="function"){cn.callback=null,St=cn.priorityLevel;var r=i(cn.expirationTime<=t);if(t=Le.unstable_now(),typeof r=="function"){cn.callback=r,yu(t),e=!0;break t}cn===Fn(gi)&&_u(gi),yu(t)}else _u(gi);cn=Fn(gi)}if(cn!==null)e=!0;else{var s=Fn(lr);s!==null&&tg(eg,s.startTime-t),e=!1}}break e}finally{cn=null,St=n,Qh=!1}e=void 0}}finally{e?fa():pa=!1}}}var fa;typeof Kb=="function"?fa=function(){Kb(Wh)}:typeof MessageChannel<"u"?(Xh=new MessageChannel,Qb=Xh.port2,Xh.port1.onmessage=Wh,fa=function(){Qb.postMessage(null)}):fa=function(){Jb(Wh,0)};var Xh,Qb;function tg(t,e){tl=Jb(function(){t(Le.unstable_now())},e)}Le.unstable_IdlePriority=5;Le.unstable_ImmediatePriority=1;Le.unstable_LowPriority=4;Le.unstable_NormalPriority=3;Le.unstable_Profiling=null;Le.unstable_UserBlockingPriority=2;Le.unstable_cancelCallback=function(t){t.callback=null};Le.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"):tS=0<t?Math.floor(1e3/t):5};Le.unstable_getCurrentPriorityLevel=function(){return St};Le.unstable_next=function(t){switch(St){case 1:case 2:case 3:var e=3;break;default:e=St}var n=St;St=e;try{return t()}finally{St=n}};Le.unstable_requestPaint=function(){Jh=!0};Le.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=St;St=t;try{return e()}finally{St=n}};Le.unstable_scheduleCallback=function(t,e,n){var i=Le.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:U2++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,Kh(lr,t),Fn(gi)===null&&t===Fn(lr)&&(el?(eS(tl),tl=-1):el=!0,tg(eg,n-i))):(t.sortIndex=r,Kh(gi,t),Jo||Qh||(Jo=!0,pa||(pa=!0,fa()))),t};Le.unstable_shouldYield=iS;Le.unstable_wrapCallback=function(t){var e=St;return function(){var n=St;St=e;try{return t.apply(this,arguments)}finally{St=n}}}});var aS=Dn((tz,sS)=>{"use strict";sS.exports=rS()});var yw=Dn(qd=>{"use strict";var rt=aS(),Nx=bt(),$2=mu();function k(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 Dx(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Il(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 Lx(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 zx(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function oS(t){if(Il(t)!==t)throw Error(k(188))}function V2(t){var e=t.alternate;if(!e){if(e=Il(t),e===null)throw Error(k(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var s=r.alternate;if(s===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return oS(r),t;if(s===i)return oS(r),e;s=s.sibling}throw Error(k(188))}if(n.return!==i.return)n=r,i=s;else{for(var a=!1,o=r.child;o;){if(o===n){a=!0,n=r,i=s;break}if(o===i){a=!0,i=r,n=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===n){a=!0,n=s,i=r;break}if(o===i){a=!0,i=s,n=r;break}o=o.sibling}if(!a)throw Error(k(189))}}if(n.alternate!==i)throw Error(k(190))}if(n.tag!==3)throw Error(k(188));return n.stateNode.current===n?t:e}function Bx(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=Bx(t),e!==null)return e;t=t.sibling}return null}var Me=Object.assign,I2=Symbol.for("react.element"),bu=Symbol.for("react.transitional.element"),cl=Symbol.for("react.portal"),_a=Symbol.for("react.fragment"),Hx=Symbol.for("react.strict_mode"),zg=Symbol.for("react.profiler"),Ux=Symbol.for("react.consumer"),Ei=Symbol.for("react.context"),Om=Symbol.for("react.forward_ref"),Bg=Symbol.for("react.suspense"),Hg=Symbol.for("react.suspense_list"),Mm=Symbol.for("react.memo"),cr=Symbol.for("react.lazy");Symbol.for("react.scope");var Ug=Symbol.for("react.activity");Symbol.for("react.legacy_hidden");Symbol.for("react.tracing_marker");var F2=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var lS=Symbol.iterator;function nl(t){return t===null||typeof t!="object"?null:(t=lS&&t[lS]||t["@@iterator"],typeof t=="function"?t:null)}var j2=Symbol.for("react.client.reference");function $g(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===j2?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case _a:return"Fragment";case zg:return"Profiler";case Hx:return"StrictMode";case Bg:return"Suspense";case Hg:return"SuspenseList";case Ug:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case cl:return"Portal";case Ei:return t.displayName||"Context";case Ux:return(t._context.displayName||"Context")+".Consumer";case Om:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Mm:return e=t.displayName||null,e!==null?e:$g(t.type)||"Memo";case cr:e=t._payload,t=t._init;try{return $g(t(e))}catch{}}return null}var ul=Array.isArray,Y=Nx.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe=$2.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,rs={pending:!1,data:null,method:null,action:null},Vg=[],ba=-1;function Yn(t){return{current:t}}function lt(t){0>ba||(t.current=Vg[ba],Vg[ba]=null,ba--)}function ke(t,e){ba++,Vg[ba]=t.current,t.current=e}var Gn=Yn(null),kl=Yn(null),br=Yn(null),Ju=Yn(null);function ed(t,e){switch(ke(br,e),ke(kl,t),ke(Gn,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?gx(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=gx(e),t=rw(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}lt(Gn),ke(Gn,t)}function Ua(){lt(Gn),lt(kl),lt(br)}function Ig(t){t.memoizedState!==null&&ke(Ju,t);var e=Gn.current,n=rw(e,t.type);e!==n&&(ke(kl,t),ke(Gn,n))}function td(t){kl.current===t&&(lt(Gn),lt(kl)),Ju.current===t&&(lt(Ju),Ul._currentValue=rs)}var ng,cS;function es(t){if(ng===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);ng=e&&e[1]||"",cS=-1<n.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ng+t+cS}var ig=!1;function rg(t,e){if(!t||ig)return"";ig=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(p){var h=p}Reflect.construct(t,[],f)}else{try{f.call()}catch(p){h=p}t.call(f.prototype)}}else{try{throw Error()}catch(p){h=p}(f=t())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(p){if(p&&h&&typeof p.stack=="string")return[p.stack,h.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=i.DetermineComponentFrameRoot(),a=s[0],o=s[1];if(a&&o){var l=a.split(`
4
- `),c=o.split(`
5
- `);for(r=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===l.length||r===c.length)for(i=l.length-1,r=c.length-1;1<=i&&0<=r&&l[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(l[i]!==c[r]){if(i!==1||r!==1)do if(i--,r--,0>r||l[i]!==c[r]){var u=`
6
- `+l[i].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=i&&0<=r);break}}}finally{ig=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?es(n):""}function q2(t,e){switch(t.tag){case 26:case 27:case 5:return es(t.type);case 16:return es("Lazy");case 13:return t.child!==e&&e!==null?es("Suspense Fallback"):es("Suspense");case 19:return es("SuspenseList");case 0:case 15:return rg(t.type,!1);case 11:return rg(t.type.render,!1);case 1:return rg(t.type,!0);case 31:return es("Activity");default:return""}}function uS(t){try{var e="",n=null;do e+=q2(t,n),n=t,t=t.return;while(t);return e}catch(i){return`
7
- Error generating stack: `+i.message+`
8
- `+i.stack}}var Fg=Object.prototype.hasOwnProperty,Nm=rt.unstable_scheduleCallback,sg=rt.unstable_cancelCallback,P2=rt.unstable_shouldYield,G2=rt.unstable_requestPaint,Kt=rt.unstable_now,Y2=rt.unstable_getCurrentPriorityLevel,$x=rt.unstable_ImmediatePriority,Vx=rt.unstable_UserBlockingPriority,nd=rt.unstable_NormalPriority,Z2=rt.unstable_LowPriority,Ix=rt.unstable_IdlePriority,W2=rt.log,X2=rt.unstable_setDisableYieldValue,Fl=null,Qt=null;function gr(t){if(typeof W2=="function"&&X2(t),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Fl,t)}catch{}}var Jt=Math.clz32?Math.clz32:J2,K2=Math.log,Q2=Math.LN2;function J2(t){return t>>>=0,t===0?32:31-(K2(t)/Q2|0)|0}var Su=256,xu=262144,Eu=4194304;function ts(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 Td(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,s=t.suspendedLanes,a=t.pingedLanes;t=t.warmLanes;var o=i&134217727;return o!==0?(i=o&~s,i!==0?r=ts(i):(a&=o,a!==0?r=ts(a):n||(n=o&~t,n!==0&&(r=ts(n))))):(o=i&~s,o!==0?r=ts(o):a!==0?r=ts(a):n||(n=i&~t,n!==0&&(r=ts(n)))),r===0?0:e!==0&&e!==r&&(e&s)===0&&(s=r&-r,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:r}function jl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function eO(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 Fx(){var t=Eu;return Eu<<=1,(Eu&62914560)===0&&(Eu=4194304),t}function ag(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function ql(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function tO(t,e,n,i,r,s){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 o=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(n=a&~n;0<n;){var u=31-Jt(n),f=1<<u;o[u]=0,l[u]=-1;var h=c[u];if(h!==null)for(c[u]=null,u=0;u<h.length;u++){var p=h[u];p!==null&&(p.lane&=-536870913)}n&=~f}i!==0&&jx(t,i,0),s!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=s&~(a&~e))}function jx(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-Jt(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&261930}function qx(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-Jt(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function Px(t,e){var n=e&-e;return n=(n&42)!==0?1:Dm(n),(n&(t.suspendedLanes|e))!==0?0:n}function Dm(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 Gx(){var t=pe.p;return t!==0?t:(t=window.event,t===void 0?32:gw(t.type))}function dS(t,e){var n=pe.p;try{return pe.p=t,e()}finally{pe.p=n}}var Dr=Math.random().toString(36).slice(2),ht="__reactFiber$"+Dr,Vt="__reactProps$"+Dr,Wa="__reactContainer$"+Dr,jg="__reactEvents$"+Dr,nO="__reactListeners$"+Dr,iO="__reactHandles$"+Dr,fS="__reactResources$"+Dr,Pl="__reactMarker$"+Dr;function zm(t){delete t[ht],delete t[Vt],delete t[jg],delete t[nO],delete t[iO]}function Sa(t){var e=t[ht];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Wa]||n[ht]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=bx(t);t!==null;){if(n=t[ht])return n;t=bx(t)}return e}t=n,n=t.parentNode}return null}function Xa(t){if(t=t[ht]||t[Wa]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function dl(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(k(33))}function Ma(t){var e=t[fS];return e||(e=t[fS]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function ot(t){t[Pl]=!0}var Yx=new Set,Zx={};function hs(t,e){$a(t,e),$a(t+"Capture",e)}function $a(t,e){for(Zx[t]=e,t=0;t<e.length;t++)Yx.add(e[t])}var rO=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]*$"),pS={},hS={};function sO(t){return Fg.call(hS,t)?!0:Fg.call(pS,t)?!1:rO.test(t)?hS[t]=!0:(pS[t]=!0,!1)}function Uu(t,e,n){if(sO(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 wu(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 dn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Wx(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function aO(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,s=i.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(a){n=""+a,s.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 qg(t){if(!t._valueTracker){var e=Wx(t)?"checked":"value";t._valueTracker=aO(t,e,""+t[e])}}function Xx(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=Wx(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function id(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 oO=/[\n"\\]/g;function hn(t){return t.replace(oO,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Pg(t,e,n,i,r,s,a,o){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=""+dn(e)):t.value!==""+dn(e)&&(t.value=""+dn(e)):a!=="submit"&&a!=="reset"||t.removeAttribute("value"),e!=null?Gg(t,a,dn(e)):n!=null?Gg(t,a,dn(n)):i!=null&&t.removeAttribute("value"),r==null&&s!=null&&(t.defaultChecked=!!s),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.name=""+dn(o):t.removeAttribute("name")}function Kx(t,e,n,i,r,s,a,o){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null)){qg(t);return}n=n!=null?""+dn(n):"",e=e!=null?""+dn(e):n,o||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=o?t.checked:!!i,t.defaultChecked=!!i,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.name=a),qg(t)}function Gg(t,e,n){e==="number"&&id(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Na(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=""+dn(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 Qx(t,e,n){if(e!=null&&(e=""+dn(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+dn(n):""}function Jx(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(k(92));if(ul(i)){if(1<i.length)throw Error(k(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=dn(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i),qg(t)}function Va(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var lO=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 gS(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||lO.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function e1(t,e,n){if(e!=null&&typeof e!="object")throw Error(k(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&&gS(t,r,i)}else for(var s in e)e.hasOwnProperty(s)&&gS(t,s,e[s])}function Bm(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 cO=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"]]),uO=/^[\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 $u(t){return uO.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function wi(){}var Yg=null;function Hm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var xa=null,Da=null;function mS(t){var e=Xa(t);if(e&&(t=e.stateNode)){var n=t[Vt]||null;e:switch(t=e.stateNode,e.type){case"input":if(Pg(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="'+hn(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[Vt]||null;if(!r)throw Error(k(90));Pg(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&&Xx(i)}break e;case"textarea":Qx(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&Na(t,!!n.multiple,e,!1)}}}var og=!1;function t1(t,e,n){if(og)return t(e,n);og=!0;try{var i=t(e);return i}finally{if(og=!1,(xa!==null||Da!==null)&&(Vd(),xa&&(e=xa,t=Da,Da=xa=null,mS(e),t)))for(e=0;e<t.length;e++)mS(t[e])}}function Tl(t,e){var n=t.stateNode;if(n===null)return null;var i=n[Vt]||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(k(231,e,typeof n));return n}var Ri=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zg=!1;if(Ri)try{ha={},Object.defineProperty(ha,"passive",{get:function(){Zg=!0}}),window.addEventListener("test",ha,ha),window.removeEventListener("test",ha,ha)}catch{Zg=!1}var ha,mr=null,Um=null,Vu=null;function n1(){if(Vu)return Vu;var t,e=Um,n=e.length,i,r="value"in mr?mr.value:mr.textContent,s=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[s-i];i++);return Vu=r.slice(t,1<i?1-i:void 0)}function Iu(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 Cu(){return!0}function vS(){return!1}function It(t){function e(n,i,r,s,a){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(n=t[o],this[o]=n?n(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Cu:vS,this.isPropagationStopped=vS,this}return Me(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=Cu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Cu)},persist:function(){},isPersistent:Cu}),e}var gs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rd=It(gs),Gl=Me({},gs,{view:0,detail:0}),dO=It(Gl),lg,cg,il,Od=Me({},Gl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$m,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!==il&&(il&&t.type==="mousemove"?(lg=t.screenX-il.screenX,cg=t.screenY-il.screenY):cg=lg=0,il=t),lg)},movementY:function(t){return"movementY"in t?t.movementY:cg}}),yS=It(Od),fO=Me({},Od,{dataTransfer:0}),pO=It(fO),hO=Me({},Gl,{relatedTarget:0}),ug=It(hO),gO=Me({},gs,{animationName:0,elapsedTime:0,pseudoElement:0}),mO=It(gO),vO=Me({},gs,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),yO=It(vO),_O=Me({},gs,{data:0}),_S=It(_O),bO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},SO={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"},xO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function EO(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=xO[t])?!!e[t]:!1}function $m(){return EO}var wO=Me({},Gl,{key:function(t){if(t.key){var e=bO[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Iu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?SO[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$m,charCode:function(t){return t.type==="keypress"?Iu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Iu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),CO=It(wO),AO=Me({},Od,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bS=It(AO),kO=Me({},Gl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$m}),TO=It(kO),RO=Me({},gs,{propertyName:0,elapsedTime:0,pseudoElement:0}),OO=It(RO),MO=Me({},Od,{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}),NO=It(MO),DO=Me({},gs,{newState:0,oldState:0}),LO=It(DO),zO=[9,13,27,32],Vm=Ri&&"CompositionEvent"in window,hl=null;Ri&&"documentMode"in document&&(hl=document.documentMode);var BO=Ri&&"TextEvent"in window&&!hl,i1=Ri&&(!Vm||hl&&8<hl&&11>=hl),SS=" ",xS=!1;function r1(t,e){switch(t){case"keyup":return zO.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function s1(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ea=!1;function HO(t,e){switch(t){case"compositionend":return s1(e);case"keypress":return e.which!==32?null:(xS=!0,SS);case"textInput":return t=e.data,t===SS&&xS?null:t;default:return null}}function UO(t,e){if(Ea)return t==="compositionend"||!Vm&&r1(t,e)?(t=n1(),Vu=Um=mr=null,Ea=!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 i1&&e.locale!=="ko"?null:e.data;default:return null}}var $O={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 ES(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!$O[t.type]:e==="textarea"}function a1(t,e,n,i){xa?Da?Da.push(i):Da=[i]:xa=i,e=Sd(e,"onChange"),0<e.length&&(n=new Rd("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var gl=null,Rl=null;function VO(t){tw(t,0)}function Md(t){var e=dl(t);if(Xx(e))return t}function wS(t,e){if(t==="change")return e}var o1=!1;Ri&&(Ri?(ku="oninput"in document,ku||(dg=document.createElement("div"),dg.setAttribute("oninput","return;"),ku=typeof dg.oninput=="function"),Au=ku):Au=!1,o1=Au&&(!document.documentMode||9<document.documentMode));var Au,ku,dg;function CS(){gl&&(gl.detachEvent("onpropertychange",l1),Rl=gl=null)}function l1(t){if(t.propertyName==="value"&&Md(Rl)){var e=[];a1(e,Rl,t,Hm(t)),t1(VO,e)}}function IO(t,e,n){t==="focusin"?(CS(),gl=e,Rl=n,gl.attachEvent("onpropertychange",l1)):t==="focusout"&&CS()}function FO(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Md(Rl)}function jO(t,e){if(t==="click")return Md(e)}function qO(t,e){if(t==="input"||t==="change")return Md(e)}function PO(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var tn=typeof Object.is=="function"?Object.is:PO;function Ol(t,e){if(tn(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(!Fg.call(e,r)||!tn(t[r],e[r]))return!1}return!0}function AS(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function kS(t,e){var n=AS(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=AS(n)}}function c1(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?c1(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function u1(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=id(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=id(t.document)}return e}function Im(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 GO=Ri&&"documentMode"in document&&11>=document.documentMode,wa=null,Wg=null,ml=null,Xg=!1;function TS(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xg||wa==null||wa!==id(i)||(i=wa,"selectionStart"in i&&Im(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}),ml&&Ol(ml,i)||(ml=i,i=Sd(Wg,"onSelect"),0<i.length&&(e=new Rd("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=wa)))}function Jr(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Ca={animationend:Jr("Animation","AnimationEnd"),animationiteration:Jr("Animation","AnimationIteration"),animationstart:Jr("Animation","AnimationStart"),transitionrun:Jr("Transition","TransitionRun"),transitionstart:Jr("Transition","TransitionStart"),transitioncancel:Jr("Transition","TransitionCancel"),transitionend:Jr("Transition","TransitionEnd")},fg={},d1={};Ri&&(d1=document.createElement("div").style,"AnimationEvent"in window||(delete Ca.animationend.animation,delete Ca.animationiteration.animation,delete Ca.animationstart.animation),"TransitionEvent"in window||delete Ca.transitionend.transition);function ms(t){if(fg[t])return fg[t];if(!Ca[t])return t;var e=Ca[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in d1)return fg[t]=e[n];return t}var f1=ms("animationend"),p1=ms("animationiteration"),h1=ms("animationstart"),YO=ms("transitionrun"),ZO=ms("transitionstart"),WO=ms("transitioncancel"),g1=ms("transitionend"),m1=new Map,Kg="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(" ");Kg.push("scrollEnd");function On(t,e){m1.set(t,e),hs(e,[t])}var rd=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)},un=[],Aa=0,Fm=0;function Nd(){for(var t=Aa,e=Fm=Aa=0;e<t;){var n=un[e];un[e++]=null;var i=un[e];un[e++]=null;var r=un[e];un[e++]=null;var s=un[e];if(un[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}s!==0&&v1(n,r,s)}}function Dd(t,e,n,i){un[Aa++]=t,un[Aa++]=e,un[Aa++]=n,un[Aa++]=i,Fm|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function jm(t,e,n,i){return Dd(t,e,n,i),sd(t)}function vs(t,e){return Dd(t,null,null,e),sd(t)}function v1(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,s=t.return;s!==null;)s.childLanes|=n,i=s.alternate,i!==null&&(i.childLanes|=n),s.tag===22&&(t=s.stateNode,t===null||t._visibility&1||(r=!0)),t=s,s=s.return;return t.tag===3?(s=t.stateNode,r&&e!==null&&(r=31-Jt(n),t=s.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),s):null}function sd(t){if(50<Cl)throw Cl=0,ym=null,Error(k(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var ka={};function XO(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 Wt(t,e,n,i){return new XO(t,e,n,i)}function qm(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ai(t,e){var n=t.alternate;return n===null?(n=Wt(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 y1(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 Fu(t,e,n,i,r,s){var a=0;if(i=t,typeof t=="function")qm(t)&&(a=1);else if(typeof t=="string")a=JM(t,n,Gn.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Ug:return t=Wt(31,n,e,r),t.elementType=Ug,t.lanes=s,t;case _a:return ss(n.children,r,s,e);case Hx:a=8,r|=24;break;case zg:return t=Wt(12,n,e,r|2),t.elementType=zg,t.lanes=s,t;case Bg:return t=Wt(13,n,e,r),t.elementType=Bg,t.lanes=s,t;case Hg:return t=Wt(19,n,e,r),t.elementType=Hg,t.lanes=s,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Ei:a=10;break e;case Ux:a=9;break e;case Om:a=11;break e;case Mm:a=14;break e;case cr:a=16,i=null;break e}a=29,n=Error(k(130,t===null?"null":typeof t,"")),i=null}return e=Wt(a,n,e,r),e.elementType=t,e.type=i,e.lanes=s,e}function ss(t,e,n,i){return t=Wt(7,t,i,e),t.lanes=n,t}function pg(t,e,n){return t=Wt(6,t,null,e),t.lanes=n,t}function _1(t){var e=Wt(18,null,null,0);return e.stateNode=t,e}function hg(t,e,n){return e=Wt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var RS=new WeakMap;function gn(t,e){if(typeof t=="object"&&t!==null){var n=RS.get(t);return n!==void 0?n:(e={value:t,source:e,stack:uS(e)},RS.set(t,e),e)}return{value:t,source:e,stack:uS(e)}}var Ta=[],Ra=0,ad=null,Ml=0,fn=[],pn=0,Rr=null,jn=1,qn="";function Si(t,e){Ta[Ra++]=Ml,Ta[Ra++]=ad,ad=t,Ml=e}function b1(t,e,n){fn[pn++]=jn,fn[pn++]=qn,fn[pn++]=Rr,Rr=t;var i=jn;t=qn;var r=32-Jt(i)-1;i&=~(1<<r),n+=1;var s=32-Jt(e)+r;if(30<s){var a=r-r%5;s=(i&(1<<a)-1).toString(32),i>>=a,r-=a,jn=1<<32-Jt(e)+r|n<<r|i,qn=s+t}else jn=1<<s|n<<r|i,qn=t}function Pm(t){t.return!==null&&(Si(t,1),b1(t,1,0))}function Gm(t){for(;t===ad;)ad=Ta[--Ra],Ta[Ra]=null,Ml=Ta[--Ra],Ta[Ra]=null;for(;t===Rr;)Rr=fn[--pn],fn[pn]=null,qn=fn[--pn],fn[pn]=null,jn=fn[--pn],fn[pn]=null}function S1(t,e){fn[pn++]=jn,fn[pn++]=qn,fn[pn++]=Rr,jn=e.id,qn=e.overflow,Rr=t}var gt=null,Oe=null,ue=!1,Sr=null,mn=!1,Qg=Error(k(519));function Or(t){var e=Error(k(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Nl(gn(e,t)),Qg}function OS(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[ht]=t,e[Vt]=i,n){case"dialog":re("cancel",e),re("close",e);break;case"iframe":case"object":case"embed":re("load",e);break;case"video":case"audio":for(n=0;n<Bl.length;n++)re(Bl[n],e);break;case"source":re("error",e);break;case"img":case"image":case"link":re("error",e),re("load",e);break;case"details":re("toggle",e);break;case"input":re("invalid",e),Kx(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":re("invalid",e);break;case"textarea":re("invalid",e),Jx(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||iw(e.textContent,n)?(i.popover!=null&&(re("beforetoggle",e),re("toggle",e)),i.onScroll!=null&&re("scroll",e),i.onScrollEnd!=null&&re("scrollend",e),i.onClick!=null&&(e.onclick=wi),e=!0):e=!1,e||Or(t,!0)}function MS(t){for(gt=t.return;gt;)switch(gt.tag){case 5:case 31:case 13:mn=!1;return;case 27:case 3:mn=!0;return;default:gt=gt.return}}function ga(t){if(t!==gt)return!1;if(!ue)return MS(t),ue=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Em(t.type,t.memoizedProps)),n=!n),n&&Oe&&Or(t),MS(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(k(317));Oe=_x(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(k(317));Oe=_x(t)}else e===27?(e=Oe,Lr(t.type)?(t=km,km=null,Oe=t):Oe=e):Oe=gt?yn(t.stateNode.nextSibling):null;return!0}function cs(){Oe=gt=null,ue=!1}function gg(){var t=Sr;return t!==null&&(Ut===null?Ut=t:Ut.push.apply(Ut,t),Sr=null),t}function Nl(t){Sr===null?Sr=[t]:Sr.push(t)}var Jg=Yn(null),ys=null,Ci=null;function dr(t,e,n){ke(Jg,e._currentValue),e._currentValue=n}function ki(t){t._currentValue=Jg.current,lt(Jg)}function em(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 tm(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var s=r.dependencies;if(s!==null){var a=r.child;s=s.firstContext;e:for(;s!==null;){var o=s;s=r;for(var l=0;l<e.length;l++)if(o.context===e[l]){s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),em(s.return,n,t),i||(a=null);break e}s=o.next}}else if(r.tag===18){if(a=r.return,a===null)throw Error(k(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),em(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 Ka(t,e,n,i){t=null;for(var r=e,s=!1;r!==null;){if(!s){if((r.flags&524288)!==0)s=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var a=r.alternate;if(a===null)throw Error(k(387));if(a=a.memoizedProps,a!==null){var o=r.type;tn(r.pendingProps.value,a.value)||(t!==null?t.push(o):t=[o])}}else if(r===Ju.current){if(a=r.alternate,a===null)throw Error(k(387));a.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(Ul):t=[Ul])}r=r.return}t!==null&&tm(e,t,n,i),e.flags|=262144}function od(t){for(t=t.firstContext;t!==null;){if(!tn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function us(t){ys=t,Ci=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function mt(t){return x1(ys,t)}function Tu(t,e){return ys===null&&us(t),x1(t,e)}function x1(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},Ci===null){if(t===null)throw Error(k(308));Ci=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Ci=Ci.next=e;return n}var KO=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()})}},QO=rt.unstable_scheduleCallback,JO=rt.unstable_NormalPriority,Qe={$$typeof:Ei,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ym(){return{controller:new KO,data:new Map,refCount:0}}function Yl(t){t.refCount--,t.refCount===0&&QO(JO,function(){t.controller.abort()})}var vl=null,nm=0,Ia=0,La=null;function eM(t,e){if(vl===null){var n=vl=[];nm=0,Ia=yv(),La={status:"pending",value:void 0,then:function(i){n.push(i)}}}return nm++,e.then(NS,NS),e}function NS(){if(--nm===0&&vl!==null){La!==null&&(La.status="fulfilled");var t=vl;vl=null,Ia=0,La=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function tM(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 DS=Y.S;Y.S=function(t,e){BE=Kt(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&eM(t,e),DS!==null&&DS(t,e)};var as=Yn(null);function Zm(){var t=as.current;return t!==null?t:Ee.pooledCache}function ju(t,e){e===null?ke(as,as.current):ke(as,e.pool)}function E1(){var t=Zm();return t===null?null:{parent:Qe._currentValue,pool:t}}var Qa=Error(k(460)),Wm=Error(k(474)),Ld=Error(k(542)),ld={then:function(){}};function LS(t){return t=t.status,t==="fulfilled"||t==="rejected"}function w1(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(wi,wi),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,BS(t),t;default:if(typeof e.status=="string")e.then(wi,wi);else{if(t=Ee,t!==null&&100<t.shellSuspendCounter)throw Error(k(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,BS(t),t}throw os=e,Qa}}function ns(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(os=n,Qa):n}}var os=null;function zS(){if(os===null)throw Error(k(459));var t=os;return os=null,t}function BS(t){if(t===Qa||t===Ld)throw Error(k(483))}var za=null,Dl=0;function Ru(t){var e=Dl;return Dl+=1,za===null&&(za=[]),w1(za,t,e)}function rl(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Ou(t,e){throw e.$$typeof===I2?Error(k(525)):(t=Object.prototype.toString.call(e),Error(k(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function C1(t){function e(d,g){if(t){var m=d.deletions;m===null?(d.deletions=[g],d.flags|=16):m.push(g)}}function n(d,g){if(!t)return null;for(;g!==null;)e(d,g),g=g.sibling;return null}function i(d){for(var g=new Map;d!==null;)d.key!==null?g.set(d.key,d):g.set(d.index,d),d=d.sibling;return g}function r(d,g){return d=Ai(d,g),d.index=0,d.sibling=null,d}function s(d,g,m){return d.index=m,t?(m=d.alternate,m!==null?(m=m.index,m<g?(d.flags|=67108866,g):m):(d.flags|=67108866,g)):(d.flags|=1048576,g)}function a(d){return t&&d.alternate===null&&(d.flags|=67108866),d}function o(d,g,m,v){return g===null||g.tag!==6?(g=pg(m,d.mode,v),g.return=d,g):(g=r(g,m),g.return=d,g)}function l(d,g,m,v){var S=m.type;return S===_a?u(d,g,m.props.children,v,m.key):g!==null&&(g.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===cr&&ns(S)===g.type)?(g=r(g,m.props),rl(g,m),g.return=d,g):(g=Fu(m.type,m.key,m.props,null,d.mode,v),rl(g,m),g.return=d,g)}function c(d,g,m,v){return g===null||g.tag!==4||g.stateNode.containerInfo!==m.containerInfo||g.stateNode.implementation!==m.implementation?(g=hg(m,d.mode,v),g.return=d,g):(g=r(g,m.children||[]),g.return=d,g)}function u(d,g,m,v,S){return g===null||g.tag!==7?(g=ss(m,d.mode,v,S),g.return=d,g):(g=r(g,m),g.return=d,g)}function f(d,g,m){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=pg(""+g,d.mode,m),g.return=d,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case bu:return m=Fu(g.type,g.key,g.props,null,d.mode,m),rl(m,g),m.return=d,m;case cl:return g=hg(g,d.mode,m),g.return=d,g;case cr:return g=ns(g),f(d,g,m)}if(ul(g)||nl(g))return g=ss(g,d.mode,m,null),g.return=d,g;if(typeof g.then=="function")return f(d,Ru(g),m);if(g.$$typeof===Ei)return f(d,Tu(d,g),m);Ou(d,g)}return null}function h(d,g,m,v){var S=g!==null?g.key:null;if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return S!==null?null:o(d,g,""+m,v);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case bu:return m.key===S?l(d,g,m,v):null;case cl:return m.key===S?c(d,g,m,v):null;case cr:return m=ns(m),h(d,g,m,v)}if(ul(m)||nl(m))return S!==null?null:u(d,g,m,v,null);if(typeof m.then=="function")return h(d,g,Ru(m),v);if(m.$$typeof===Ei)return h(d,g,Tu(d,m),v);Ou(d,m)}return null}function p(d,g,m,v,S){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return d=d.get(m)||null,o(g,d,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case bu:return d=d.get(v.key===null?m:v.key)||null,l(g,d,v,S);case cl:return d=d.get(v.key===null?m:v.key)||null,c(g,d,v,S);case cr:return v=ns(v),p(d,g,m,v,S)}if(ul(v)||nl(v))return d=d.get(m)||null,u(g,d,v,S,null);if(typeof v.then=="function")return p(d,g,m,Ru(v),S);if(v.$$typeof===Ei)return p(d,g,m,Tu(g,v),S);Ou(g,v)}return null}function y(d,g,m,v){for(var S=null,w=null,E=g,C=g=0,R=null;E!==null&&C<m.length;C++){E.index>C?(R=E,E=null):R=E.sibling;var T=h(d,E,m[C],v);if(T===null){E===null&&(E=R);break}t&&E&&T.alternate===null&&e(d,E),g=s(T,g,C),w===null?S=T:w.sibling=T,w=T,E=R}if(C===m.length)return n(d,E),ue&&Si(d,C),S;if(E===null){for(;C<m.length;C++)E=f(d,m[C],v),E!==null&&(g=s(E,g,C),w===null?S=E:w.sibling=E,w=E);return ue&&Si(d,C),S}for(E=i(E);C<m.length;C++)R=p(E,d,C,m[C],v),R!==null&&(t&&R.alternate!==null&&E.delete(R.key===null?C:R.key),g=s(R,g,C),w===null?S=R:w.sibling=R,w=R);return t&&E.forEach(function(I){return e(d,I)}),ue&&Si(d,C),S}function _(d,g,m,v){if(m==null)throw Error(k(151));for(var S=null,w=null,E=g,C=g=0,R=null,T=m.next();E!==null&&!T.done;C++,T=m.next()){E.index>C?(R=E,E=null):R=E.sibling;var I=h(d,E,T.value,v);if(I===null){E===null&&(E=R);break}t&&E&&I.alternate===null&&e(d,E),g=s(I,g,C),w===null?S=I:w.sibling=I,w=I,E=R}if(T.done)return n(d,E),ue&&Si(d,C),S;if(E===null){for(;!T.done;C++,T=m.next())T=f(d,T.value,v),T!==null&&(g=s(T,g,C),w===null?S=T:w.sibling=T,w=T);return ue&&Si(d,C),S}for(E=i(E);!T.done;C++,T=m.next())T=p(E,d,C,T.value,v),T!==null&&(t&&T.alternate!==null&&E.delete(T.key===null?C:T.key),g=s(T,g,C),w===null?S=T:w.sibling=T,w=T);return t&&E.forEach(function(G){return e(d,G)}),ue&&Si(d,C),S}function b(d,g,m,v){if(typeof m=="object"&&m!==null&&m.type===_a&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case bu:e:{for(var S=m.key;g!==null;){if(g.key===S){if(S=m.type,S===_a){if(g.tag===7){n(d,g.sibling),v=r(g,m.props.children),v.return=d,d=v;break e}}else if(g.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===cr&&ns(S)===g.type){n(d,g.sibling),v=r(g,m.props),rl(v,m),v.return=d,d=v;break e}n(d,g);break}else e(d,g);g=g.sibling}m.type===_a?(v=ss(m.props.children,d.mode,v,m.key),v.return=d,d=v):(v=Fu(m.type,m.key,m.props,null,d.mode,v),rl(v,m),v.return=d,d=v)}return a(d);case cl:e:{for(S=m.key;g!==null;){if(g.key===S)if(g.tag===4&&g.stateNode.containerInfo===m.containerInfo&&g.stateNode.implementation===m.implementation){n(d,g.sibling),v=r(g,m.children||[]),v.return=d,d=v;break e}else{n(d,g);break}else e(d,g);g=g.sibling}v=hg(m,d.mode,v),v.return=d,d=v}return a(d);case cr:return m=ns(m),b(d,g,m,v)}if(ul(m))return y(d,g,m,v);if(nl(m)){if(S=nl(m),typeof S!="function")throw Error(k(150));return m=S.call(m),_(d,g,m,v)}if(typeof m.then=="function")return b(d,g,Ru(m),v);if(m.$$typeof===Ei)return b(d,g,Tu(d,m),v);Ou(d,m)}return typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint"?(m=""+m,g!==null&&g.tag===6?(n(d,g.sibling),v=r(g,m),v.return=d,d=v):(n(d,g),v=pg(m,d.mode,v),v.return=d,d=v),a(d)):n(d,g)}return function(d,g,m,v){try{Dl=0;var S=b(d,g,m,v);return za=null,S}catch(E){if(E===Qa||E===Ld)throw E;var w=Wt(29,E,null,d.mode);return w.lanes=v,w.return=d,w}finally{}}}var ds=C1(!0),A1=C1(!1),ur=!1;function Xm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function im(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 Er(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(fe&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=sd(t),v1(t,null,n),e}return Dd(t,i,e,n),sd(t)}function yl(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,qx(t,n)}}function mg(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?r=s=e:s=s.next=e}else r=s=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,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 rm=!1;function _l(){if(rm){var t=La;if(t!==null)throw t}}function bl(t,e,n,i){rm=!1;var r=t.updateQueue;ur=!1;var s=r.firstBaseUpdate,a=r.lastBaseUpdate,o=r.shared.pending;if(o!==null){r.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?s=c:a.next=c,a=l;var u=t.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==a&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(s!==null){var f=r.baseState;a=0,u=c=l=null,o=s;do{var h=o.lane&-536870913,p=h!==o.lane;if(p?(oe&h)===h:(i&h)===h){h!==0&&h===Ia&&(rm=!0),u!==null&&(u=u.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var y=t,_=o;h=e;var b=n;switch(_.tag){case 1:if(y=_.payload,typeof y=="function"){f=y.call(b,f,h);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=_.payload,h=typeof y=="function"?y.call(b,f,h):y,h==null)break e;f=Me({},f,h);break e;case 2:ur=!0}}h=o.callback,h!==null&&(t.flags|=64,p&&(t.flags|=8192),p=r.callbacks,p===null?r.callbacks=[h]:p.push(h))}else p={lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=p,l=f):u=u.next=p,a|=h;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;p=o,o=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);u===null&&(l=f),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,s===null&&(r.shared.lanes=0),Nr|=a,t.lanes=a,t.memoizedState=f}}function k1(t,e){if(typeof t!="function")throw Error(k(191,t));t.call(e)}function T1(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)k1(n[t],e)}var Fa=Yn(null),cd=Yn(0);function HS(t,e){t=Di,ke(cd,t),ke(Fa,e),Di=t|e.baseLanes}function sm(){ke(cd,Di),ke(Fa,Fa.current)}function Km(){Di=cd.current,lt(Fa),lt(cd)}var nn=Yn(null),vn=null;function fr(t){var e=t.alternate;ke(Ge,Ge.current&1),ke(nn,t),vn===null&&(e===null||Fa.current!==null||e.memoizedState!==null)&&(vn=t)}function am(t){ke(Ge,Ge.current),ke(nn,t),vn===null&&(vn=t)}function R1(t){t.tag===22?(ke(Ge,Ge.current),ke(nn,t),vn===null&&(vn=t)):pr(t)}function pr(){ke(Ge,Ge.current),ke(nn,nn.current)}function Zt(t){lt(nn),vn===t&&(vn=null),lt(Ge)}var Ge=Yn(0);function ud(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Cm(n)||Am(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,ee=null,be=null,Xe=null,dd=!1,Ba=!1,fs=!1,fd=0,Ll=0,Ha=null,nM=0;function $e(){throw Error(k(321))}function Qm(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!tn(t[n],e[n]))return!1;return!0}function Jm(t,e,n,i,r,s){return Oi=s,ee=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Y.H=t===null||t.memoizedState===null?aE:uv,fs=!1,s=n(i,r),fs=!1,Ba&&(s=M1(e,n,i,r)),O1(t),s}function O1(t){Y.H=zl;var e=be!==null&&be.next!==null;if(Oi=0,Xe=be=ee=null,dd=!1,Ll=0,Ha=null,e)throw Error(k(300));t===null||Je||(t=t.dependencies,t!==null&&od(t)&&(Je=!0))}function M1(t,e,n,i){ee=t;var r=0;do{if(Ba&&(Ha=null),Ll=0,Ba=!1,25<=r)throw Error(k(301));if(r+=1,Xe=be=null,t.updateQueue!=null){var s=t.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}Y.H=oE,s=e(n,i)}while(Ba);return s}function iM(){var t=Y.H,e=t.useState()[0];return e=typeof e.then=="function"?Zl(e):e,t=t.useState()[0],(be!==null?be.memoizedState:null)!==t&&(ee.flags|=1024),e}function ev(){var t=fd!==0;return fd=0,t}function tv(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function nv(t){if(dd){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}dd=!1}Oi=0,Xe=be=ee=null,Ba=!1,Ll=fd=0,Ha=null}function Tt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?ee.memoizedState=Xe=t:Xe=Xe.next=t,Xe}function Ye(){if(be===null){var t=ee.alternate;t=t!==null?t.memoizedState:null}else t=be.next;var e=Xe===null?ee.memoizedState:Xe.next;if(e!==null)Xe=e,be=t;else{if(t===null)throw ee.alternate===null?Error(k(467)):Error(k(310));be=t,t={memoizedState:be.memoizedState,baseState:be.baseState,baseQueue:be.baseQueue,queue:be.queue,next:null},Xe===null?ee.memoizedState=Xe=t:Xe=Xe.next=t}return Xe}function zd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zl(t){var e=Ll;return Ll+=1,Ha===null&&(Ha=[]),t=w1(Ha,t,e),e=ee,(Xe===null?e.memoizedState:Xe.next)===null&&(e=e.alternate,Y.H=e===null||e.memoizedState===null?aE:uv),t}function Bd(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Zl(t);if(t.$$typeof===Ei)return mt(t)}throw Error(k(438,String(t)))}function iv(t){var e=null,n=ee.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=ee.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=zd(),ee.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]=F2;return e.index++,n}function Mi(t,e){return typeof e=="function"?e(t):e}function qu(t){var e=Ye();return rv(e,be,t)}function rv(t,e,n){var i=t.queue;if(i===null)throw Error(k(311));i.lastRenderedReducer=n;var r=t.baseQueue,s=i.pending;if(s!==null){if(r!==null){var a=r.next;r.next=s.next,s.next=a}e.baseQueue=r=s,i.pending=null}if(s=t.baseState,r===null)t.memoizedState=s;else{e=r.next;var o=a=null,l=null,c=e,u=!1;do{var f=c.lane&-536870913;if(f!==c.lane?(oe&f)===f:(Oi&f)===f){var h=c.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),f===Ia&&(u=!0);else if((Oi&h)===h){c=c.next,h===Ia&&(u=!0);continue}else f={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=f,a=s):l=l.next=f,ee.lanes|=h,Nr|=h;f=c.action,fs&&n(s,f),s=c.hasEagerState?c.eagerState:n(s,f)}else h={lane:f,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=h,a=s):l=l.next=h,ee.lanes|=f,Nr|=f;c=c.next}while(c!==null&&c!==e);if(l===null?a=s:l.next=o,!tn(s,t.memoizedState)&&(Je=!0,u&&(n=La,n!==null)))throw n;t.memoizedState=s,t.baseState=a,t.baseQueue=l,i.lastRenderedState=s}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function vg(t){var e=Ye(),n=e.queue;if(n===null)throw Error(k(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(r!==null){n.pending=null;var a=r=r.next;do s=t(s,a.action),a=a.next;while(a!==r);tn(s,e.memoizedState)||(Je=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function N1(t,e,n){var i=ee,r=Ye(),s=ue;if(s){if(n===void 0)throw Error(k(407));n=n()}else n=e();var a=!tn((be||r).memoizedState,n);if(a&&(r.memoizedState=n,Je=!0),r=r.queue,sv(z1.bind(null,i,r,t),[t]),r.getSnapshot!==e||a||Xe!==null&&Xe.memoizedState.tag&1){if(i.flags|=2048,ja(9,{destroy:void 0},L1.bind(null,i,r,n,e),null),Ee===null)throw Error(k(349));s||(Oi&127)!==0||D1(i,e,n)}return n}function D1(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=ee.updateQueue,e===null?(e=zd(),ee.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function L1(t,e,n,i){e.value=n,e.getSnapshot=i,B1(e)&&H1(t)}function z1(t,e,n){return n(function(){B1(e)&&H1(t)})}function B1(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!tn(t,n)}catch{return!0}}function H1(t){var e=vs(t,2);e!==null&&$t(e,t,2)}function om(t){var e=Tt();if(typeof t=="function"){var n=t;if(t=n(),fs){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 U1(t,e,n,i){return t.baseState=n,rv(t,be,typeof i=="function"?i:Mi)}function rM(t,e,n,i,r){if(Ud(t))throw Error(k(485));if(t=e.action,t!==null){var s={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){s.listeners.push(a)}};Y.T!==null?n(!0):s.isTransition=!1,i(s),n=e.pending,n===null?(s.next=e.pending=s,$1(e,s)):(s.next=n.next,e.pending=n.next=s)}}function $1(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var s=Y.T,a={};Y.T=a;try{var o=n(r,i),l=Y.S;l!==null&&l(a,o),US(t,e,o)}catch(c){lm(t,e,c)}finally{s!==null&&a.types!==null&&(s.types=a.types),Y.T=s}}else try{s=n(r,i),US(t,e,s)}catch(c){lm(t,e,c)}}function US(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){$S(t,e,i)},function(i){return lm(t,e,i)}):$S(t,e,n)}function $S(t,e,n){e.status="fulfilled",e.value=n,V1(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,$1(t,n)))}function lm(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,V1(e),e=e.next;while(e!==i)}t.action=null}function V1(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function I1(t,e){return e}function VS(t,e){if(ue){var n=Ee.formState;if(n!==null){e:{var i=ee;if(ue){if(Oe){t:{for(var r=Oe,s=mn;r.nodeType!==8;){if(!s){r=null;break t}if(r=yn(r.nextSibling),r===null){r=null;break t}}s=r.data,r=s==="F!"||s==="F"?r:null}if(r){Oe=yn(r.nextSibling),i=r.data==="F!";break e}}Or(i)}i=!1}i&&(e=n[0])}}return n=Tt(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:I1,lastRenderedState:e},n.queue=i,n=iE.bind(null,ee,i),i.dispatch=n,i=om(!1),s=cv.bind(null,ee,!1,i.queue),i=Tt(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=rM.bind(null,ee,r,s,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function IS(t){var e=Ye();return F1(e,be,t)}function F1(t,e,n){if(e=rv(t,e,I1)[0],t=qu(Mi)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Zl(e)}catch(a){throw a===Qa?Ld:a}else i=e;e=Ye();var r=e.queue,s=r.dispatch;return n!==e.memoizedState&&(ee.flags|=2048,ja(9,{destroy:void 0},sM.bind(null,r,n),null)),[i,s,t]}function sM(t,e){t.action=e}function FS(t){var e=Ye(),n=be;if(n!==null)return F1(e,n,t);Ye(),e=e.memoizedState,n=Ye();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function ja(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=ee.updateQueue,e===null&&(e=zd(),ee.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 j1(){return Ye().memoizedState}function Pu(t,e,n,i){var r=Tt();ee.flags|=t,r.memoizedState=ja(1|e,{destroy:void 0},n,i===void 0?null:i)}function Hd(t,e,n,i){var r=Ye();i=i===void 0?null:i;var s=r.memoizedState.inst;be!==null&&i!==null&&Qm(i,be.memoizedState.deps)?r.memoizedState=ja(e,s,n,i):(ee.flags|=t,r.memoizedState=ja(1|e,s,n,i))}function jS(t,e){Pu(8390656,8,t,e)}function sv(t,e){Hd(2048,8,t,e)}function aM(t){ee.flags|=4;var e=ee.updateQueue;if(e===null)e=zd(),ee.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function q1(t){var e=Ye().memoizedState;return aM({ref:e,nextImpl:t}),function(){if((fe&2)!==0)throw Error(k(440));return e.impl.apply(void 0,arguments)}}function P1(t,e){return Hd(4,2,t,e)}function G1(t,e){return Hd(4,4,t,e)}function Y1(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 Z1(t,e,n){n=n!=null?n.concat([t]):null,Hd(4,4,Y1.bind(null,e,t),n)}function av(){}function W1(t,e){var n=Ye();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&Qm(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function X1(t,e){var n=Ye();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&Qm(e,i[1]))return i[0];if(i=t(),fs){gr(!0);try{t()}finally{gr(!1)}}return n.memoizedState=[i,e],i}function ov(t,e,n){return n===void 0||(Oi&1073741824)!==0&&(oe&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=UE(),ee.lanes|=t,Nr|=t,n)}function K1(t,e,n,i){return tn(n,e)?n:Fa.current!==null?(t=ov(t,n,i),tn(t,e)||(Je=!0),t):(Oi&42)===0||(Oi&1073741824)!==0&&(oe&261930)===0?(Je=!0,t.memoizedState=n):(t=UE(),ee.lanes|=t,Nr|=t,e)}function Q1(t,e,n,i,r){var s=pe.p;pe.p=s!==0&&8>s?s:8;var a=Y.T,o={};Y.T=o,cv(t,!1,e,n);try{var l=r(),c=Y.S;if(c!==null&&c(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=tM(l,i);Sl(t,e,u,en(t))}else Sl(t,e,i,en(t))}catch(f){Sl(t,e,{then:function(){},status:"rejected",reason:f},en())}finally{pe.p=s,a!==null&&o.types!==null&&(a.types=o.types),Y.T=a}}function oM(){}function cm(t,e,n,i){if(t.tag!==5)throw Error(k(476));var r=J1(t).queue;Q1(t,r,e,rs,n===null?oM:function(){return eE(t),n(i)})}function J1(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:rs,baseState:rs,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:rs},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 eE(t){var e=J1(t);e.next===null&&(e=t.alternate.memoizedState),Sl(t,e.next.queue,{},en())}function lv(){return mt(Ul)}function tE(){return Ye().memoizedState}function nE(){return Ye().memoizedState}function lM(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=en();t=xr(n);var i=Er(e,t,n);i!==null&&($t(i,e,n),yl(i,e,n)),e={cache:Ym()},t.payload=e;return}e=e.return}}function cM(t,e,n){var i=en();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ud(t)?rE(e,n):(n=jm(t,e,n,i),n!==null&&($t(n,t,i),sE(n,e,i)))}function iE(t,e,n){var i=en();Sl(t,e,n,i)}function Sl(t,e,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ud(t))rE(e,r);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var a=e.lastRenderedState,o=s(a,n);if(r.hasEagerState=!0,r.eagerState=o,tn(o,a))return Dd(t,e,r,0),Ee===null&&Nd(),!1}catch{}finally{}if(n=jm(t,e,r,i),n!==null)return $t(n,t,i),sE(n,e,i),!0}return!1}function cv(t,e,n,i){if(i={lane:2,revertLane:yv(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ud(t)){if(e)throw Error(k(479))}else e=jm(t,n,i,2),e!==null&&$t(e,t,2)}function Ud(t){var e=t.alternate;return t===ee||e!==null&&e===ee}function rE(t,e){Ba=dd=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function sE(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,qx(t,n)}}var zl={readContext:mt,use:Bd,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useLayoutEffect:$e,useInsertionEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useSyncExternalStore:$e,useId:$e,useHostTransitionStatus:$e,useFormState:$e,useActionState:$e,useOptimistic:$e,useMemoCache:$e,useCacheRefresh:$e};zl.useEffectEvent=$e;var aE={readContext:mt,use:Bd,useCallback:function(t,e){return Tt().memoizedState=[t,e===void 0?null:e],t},useContext:mt,useEffect:jS,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Pu(4194308,4,Y1.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Pu(4194308,4,t,e)},useInsertionEffect:function(t,e){Pu(4,2,t,e)},useMemo:function(t,e){var n=Tt();e=e===void 0?null:e;var i=t();if(fs){gr(!0);try{t()}finally{gr(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Tt();if(n!==void 0){var r=n(e);if(fs){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=cM.bind(null,ee,t),[i.memoizedState,t]},useRef:function(t){var e=Tt();return t={current:t},e.memoizedState=t},useState:function(t){t=om(t);var e=t.queue,n=iE.bind(null,ee,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:av,useDeferredValue:function(t,e){var n=Tt();return ov(n,t,e)},useTransition:function(){var t=om(!1);return t=Q1.bind(null,ee,t.queue,!0,!1),Tt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=ee,r=Tt();if(ue){if(n===void 0)throw Error(k(407));n=n()}else{if(n=e(),Ee===null)throw Error(k(349));(oe&127)!==0||D1(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,jS(z1.bind(null,i,s,t),[t]),i.flags|=2048,ja(9,{destroy:void 0},L1.bind(null,i,s,n,e),null),n},useId:function(){var t=Tt(),e=Ee.identifierPrefix;if(ue){var n=qn,i=jn;n=(i&~(1<<32-Jt(i)-1)).toString(32)+n,e="_"+e+"R_"+n,n=fd++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=nM++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:lv,useFormState:VS,useActionState:VS,useOptimistic:function(t){var e=Tt();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=cv.bind(null,ee,!0,n),n.dispatch=e,[t,e]},useMemoCache:iv,useCacheRefresh:function(){return Tt().memoizedState=lM.bind(null,ee)},useEffectEvent:function(t){var e=Tt(),n={impl:t};return e.memoizedState=n,function(){if((fe&2)!==0)throw Error(k(440));return n.impl.apply(void 0,arguments)}}},uv={readContext:mt,use:Bd,useCallback:W1,useContext:mt,useEffect:sv,useImperativeHandle:Z1,useInsertionEffect:P1,useLayoutEffect:G1,useMemo:X1,useReducer:qu,useRef:j1,useState:function(){return qu(Mi)},useDebugValue:av,useDeferredValue:function(t,e){var n=Ye();return K1(n,be.memoizedState,t,e)},useTransition:function(){var t=qu(Mi)[0],e=Ye().memoizedState;return[typeof t=="boolean"?t:Zl(t),e]},useSyncExternalStore:N1,useId:tE,useHostTransitionStatus:lv,useFormState:IS,useActionState:IS,useOptimistic:function(t,e){var n=Ye();return U1(n,be,t,e)},useMemoCache:iv,useCacheRefresh:nE};uv.useEffectEvent=q1;var oE={readContext:mt,use:Bd,useCallback:W1,useContext:mt,useEffect:sv,useImperativeHandle:Z1,useInsertionEffect:P1,useLayoutEffect:G1,useMemo:X1,useReducer:vg,useRef:j1,useState:function(){return vg(Mi)},useDebugValue:av,useDeferredValue:function(t,e){var n=Ye();return be===null?ov(n,t,e):K1(n,be.memoizedState,t,e)},useTransition:function(){var t=vg(Mi)[0],e=Ye().memoizedState;return[typeof t=="boolean"?t:Zl(t),e]},useSyncExternalStore:N1,useId:tE,useHostTransitionStatus:lv,useFormState:FS,useActionState:FS,useOptimistic:function(t,e){var n=Ye();return be!==null?U1(n,be,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:iv,useCacheRefresh:nE};oE.useEffectEvent=q1;function yg(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:Me({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var um={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=en(),r=xr(i);r.payload=e,n!=null&&(r.callback=n),e=Er(t,r,i),e!==null&&($t(e,t,i),yl(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=en(),r=xr(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=Er(t,r,i),e!==null&&($t(e,t,i),yl(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=en(),i=xr(n);i.tag=2,e!=null&&(i.callback=e),e=Er(t,i,n),e!==null&&($t(e,t,n),yl(e,t,n))}};function qS(t,e,n,i,r,s,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,s,a):e.prototype&&e.prototype.isPureReactComponent?!Ol(n,i)||!Ol(r,s):!0}function PS(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&&um.enqueueReplaceState(e,e.state,null)}function ps(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=Me({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}function lE(t){rd(t)}function cE(t){console.error(t)}function uE(t){rd(t)}function pd(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function GS(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 dm(t,e,n){return n=xr(n),n.tag=3,n.payload={element:null},n.callback=function(){pd(t,e)},n}function dE(t){return t=xr(t),t.tag=3,t}function fE(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var s=i.value;t.payload=function(){return r(s)},t.callback=function(){GS(e,n,i)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(t.callback=function(){GS(e,n,i),typeof r!="function"&&(wr===null?wr=new Set([this]):wr.add(this));var o=i.stack;this.componentDidCatch(i.value,{componentStack:o!==null?o:""})})}function uM(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Ka(e,n,r,!0),n=nn.current,n!==null){switch(n.tag){case 31:case 13:return vn===null?yd():n.alternate===null&&Ve===0&&(Ve=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===ld?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),Rg(t,i,r)),!1;case 22:return n.flags|=65536,i===ld?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)),Rg(t,i,r)),!1}throw Error(k(435,n.tag))}return Rg(t,i,r),yd(),!1}if(ue)return e=nn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==Qg&&(t=Error(k(422),{cause:i}),Nl(gn(t,n)))):(i!==Qg&&(e=Error(k(423),{cause:i}),Nl(gn(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=gn(i,n),r=dm(t.stateNode,i,r),mg(t,r),Ve!==4&&(Ve=2)),!1;var s=Error(k(520),{cause:i});if(s=gn(s,n),wl===null?wl=[s]:wl.push(s),Ve!==4&&(Ve=2),e===null)return!0;i=gn(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=dm(n.stateNode,i,t),mg(n,t),!1;case 1:if(e=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(wr===null||!wr.has(s))))return n.flags|=65536,r&=-r,n.lanes|=r,r=dE(r),fE(r,t,n,i),mg(n,r),!1}n=n.return}while(n!==null);return!1}var dv=Error(k(461)),Je=!1;function pt(t,e,n,i){e.child=t===null?A1(e,null,n,i):ds(e,t.child,n,i)}function YS(t,e,n,i,r){n=n.render;var s=e.ref;if("ref"in i){var a={};for(var o in i)o!=="ref"&&(a[o]=i[o])}else a=i;return us(e),i=Jm(t,e,n,a,s,r),o=ev(),t!==null&&!Je?(tv(t,e,r),Ni(t,e,r)):(ue&&o&&Pm(e),e.flags|=1,pt(t,e,i,r),e.child)}function ZS(t,e,n,i,r){if(t===null){var s=n.type;return typeof s=="function"&&!qm(s)&&s.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=s,pE(t,e,s,i,r)):(t=Fu(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!fv(t,r)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:Ol,n(a,i)&&t.ref===e.ref)return Ni(t,e,r)}return e.flags|=1,t=Ai(s,i),t.ref=e.ref,t.return=e,e.child=t}function pE(t,e,n,i,r){if(t!==null){var s=t.memoizedProps;if(Ol(s,i)&&t.ref===e.ref)if(Je=!1,e.pendingProps=i=s,fv(t,r))(t.flags&131072)!==0&&(Je=!0);else return e.lanes=t.lanes,Ni(t,e,r)}return fm(t,e,n,i,r)}function hE(t,e,n,i){var r=i.children,s=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(s=s!==null?s.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&~s}else i=0,e.child=null;return WS(t,e,s,n,i)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&ju(e,s!==null?s.cachePool:null),s!==null?HS(e,s):sm(),R1(e);else return i=e.lanes=536870912,WS(t,e,s!==null?s.baseLanes|n:n,n,i)}else s!==null?(ju(e,s.cachePool),HS(e,s),pr(e),e.memoizedState=null):(t!==null&&ju(e,null),sm(),pr(e));return pt(t,e,r,n),e.child}function fl(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function WS(t,e,n,i,r){var s=Zm();return s=s===null?null:{parent:Qe._currentValue,pool:s},e.memoizedState={baseLanes:n,cachePool:s},t!==null&&ju(e,null),sm(),R1(e),t!==null&&Ka(t,e,i,!0),e.childLanes=r,null}function Gu(t,e){return e=hd({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function XS(t,e,n){return ds(e,t.child,null,n),t=Gu(e,e.pendingProps),t.flags|=2,Zt(e),e.memoizedState=null,t}function dM(t,e,n){var i=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(ue){if(i.mode==="hidden")return t=Gu(e,i),e.lanes=536870912,fl(null,t);if(am(e),(t=Oe)?(t=aw(t,mn),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Rr!==null?{id:jn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},n=_1(t),n.return=e,e.child=n,gt=e,Oe=null)):t=null,t===null)throw Or(e);return e.lanes=536870912,null}return Gu(e,i)}var s=t.memoizedState;if(s!==null){var a=s.dehydrated;if(am(e),r)if(e.flags&256)e.flags&=-257,e=XS(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(k(558));else if(Je||Ka(t,e,n,!1),r=(n&t.childLanes)!==0,Je||r){if(i=Ee,i!==null&&(a=Px(i,n),a!==0&&a!==s.retryLane))throw s.retryLane=a,vs(t,a),$t(i,t,a),dv;yd(),e=XS(t,e,n)}else t=s.treeContext,Oe=yn(a.nextSibling),gt=e,ue=!0,Sr=null,mn=!1,t!==null&&S1(e,t),e=Gu(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 Yu(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(k(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function fm(t,e,n,i,r){return us(e),n=Jm(t,e,n,i,void 0,r),i=ev(),t!==null&&!Je?(tv(t,e,r),Ni(t,e,r)):(ue&&i&&Pm(e),e.flags|=1,pt(t,e,n,r),e.child)}function KS(t,e,n,i,r,s){return us(e),e.updateQueue=null,n=M1(e,i,n,r),O1(t),i=ev(),t!==null&&!Je?(tv(t,e,s),Ni(t,e,s)):(ue&&i&&Pm(e),e.flags|=1,pt(t,e,n,s),e.child)}function QS(t,e,n,i,r){if(us(e),e.stateNode===null){var s=ka,a=n.contextType;typeof a=="object"&&a!==null&&(s=mt(a)),s=new n(i,s),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=um,e.stateNode=s,s._reactInternals=e,s=e.stateNode,s.props=i,s.state=e.memoizedState,s.refs={},Xm(e),a=n.contextType,s.context=typeof a=="object"&&a!==null?mt(a):ka,s.state=e.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(yg(e,n,a,i),s.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(a=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),a!==s.state&&um.enqueueReplaceState(s,s.state,null),bl(e,i,s,r),_l(),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){s=e.stateNode;var o=e.memoizedProps,l=ps(n,o);s.props=l;var c=s.context,u=n.contextType;a=ka,typeof u=="object"&&u!==null&&(a=mt(u));var f=n.getDerivedStateFromProps;u=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function",o=e.pendingProps!==o,u||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o||c!==a)&&PS(e,s,i,a),ur=!1;var h=e.memoizedState;s.state=h,bl(e,i,s,r),_l(),c=e.memoizedState,o||h!==c||ur?(typeof f=="function"&&(yg(e,n,f,i),c=e.memoizedState),(l=ur||qS(e,n,l,i,h,c,a))?(u||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),s.props=i,s.state=c,s.context=a,i=l):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{s=e.stateNode,im(t,e),a=e.memoizedProps,u=ps(n,a),s.props=u,f=e.pendingProps,h=s.context,c=n.contextType,l=ka,typeof c=="object"&&c!==null&&(l=mt(c)),o=n.getDerivedStateFromProps,(c=typeof o=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||h!==l)&&PS(e,s,i,l),ur=!1,h=e.memoizedState,s.state=h,bl(e,i,s,r),_l();var p=e.memoizedState;a!==f||h!==p||ur||t!==null&&t.dependencies!==null&&od(t.dependencies)?(typeof o=="function"&&(yg(e,n,o,i),p=e.memoizedState),(u=ur||qS(e,n,u,i,h,p,l)||t!==null&&t.dependencies!==null&&od(t.dependencies))?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(i,p,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(i,p,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=p),s.props=i,s.state=p,s.context=l,i=u):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return s=i,Yu(t,e),i=(e.flags&128)!==0,s||i?(s=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:s.render(),e.flags|=1,t!==null&&i?(e.child=ds(e,t.child,null,r),e.child=ds(e,null,n,r)):pt(t,e,n,r),e.memoizedState=s.state,t=e.child):t=Ni(t,e,r),t}function JS(t,e,n,i){return cs(),e.flags|=256,pt(t,e,n,i),e.child}var _g={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bg(t){return{baseLanes:t,cachePool:E1()}}function Sg(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Xt),t}function gE(t,e,n){var i=e.pendingProps,r=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=t!==null&&t.memoizedState===null?!1:(Ge.current&2)!==0),a&&(r=!0,e.flags&=-129),a=(e.flags&32)!==0,e.flags&=-33,t===null){if(ue){if(r?fr(e):pr(e),(t=Oe)?(t=aw(t,mn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Rr!==null?{id:jn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},n=_1(t),n.return=e,e.child=n,gt=e,Oe=null)):t=null,t===null)throw Or(e);return Am(t)?e.lanes=32:e.lanes=536870912,null}var o=i.children;return i=i.fallback,r?(pr(e),r=e.mode,o=hd({mode:"hidden",children:o},r),i=ss(i,r,n,null),o.return=e,i.return=e,o.sibling=i,e.child=o,i=e.child,i.memoizedState=bg(n),i.childLanes=Sg(t,a,n),e.memoizedState=_g,fl(null,i)):(fr(e),pm(e,o))}var l=t.memoizedState;if(l!==null&&(o=l.dehydrated,o!==null)){if(s)e.flags&256?(fr(e),e.flags&=-257,e=xg(t,e,n)):e.memoizedState!==null?(pr(e),e.child=t.child,e.flags|=128,e=null):(pr(e),o=i.fallback,r=e.mode,i=hd({mode:"visible",children:i.children},r),o=ss(o,r,n,null),o.flags|=2,i.return=e,o.return=e,i.sibling=o,e.child=i,ds(e,t.child,null,n),i=e.child,i.memoizedState=bg(n),i.childLanes=Sg(t,a,n),e.memoizedState=_g,e=fl(null,i));else if(fr(e),Am(o)){if(a=o.nextSibling&&o.nextSibling.dataset,a)var c=a.dgst;a=c,i=Error(k(419)),i.stack="",i.digest=a,Nl({value:i,source:null,stack:null}),e=xg(t,e,n)}else if(Je||Ka(t,e,n,!1),a=(n&t.childLanes)!==0,Je||a){if(a=Ee,a!==null&&(i=Px(a,n),i!==0&&i!==l.retryLane))throw l.retryLane=i,vs(t,i),$t(a,t,i),dv;Cm(o)||yd(),e=xg(t,e,n)}else Cm(o)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Oe=yn(o.nextSibling),gt=e,ue=!0,Sr=null,mn=!1,t!==null&&S1(e,t),e=pm(e,i.children),e.flags|=4096);return e}return r?(pr(e),o=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?o=Ai(c,o):(o=ss(o,r,n,null),o.flags|=2),o.return=e,i.return=e,i.sibling=o,e.child=i,fl(null,i),i=e.child,o=t.child.memoizedState,o===null?o=bg(n):(r=o.cachePool,r!==null?(l=Qe._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=E1(),o={baseLanes:o.baseLanes|n,cachePool:r}),i.memoizedState=o,i.childLanes=Sg(t,a,n),e.memoizedState=_g,fl(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 pm(t,e){return e=hd({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function hd(t,e){return t=Wt(22,t,null,e),t.lanes=0,t}function xg(t,e,n){return ds(e,t.child,null,n),t=pm(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function ex(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),em(t.return,e,n)}function Eg(t,e,n,i,r,s){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:s}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r,a.treeForkCount=s)}function mE(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;i=i.children;var a=Ge.current,o=(a&2)!==0;if(o?(a=a&1|2,e.flags|=128):a&=1,ke(Ge,a),pt(t,e,i,n),i=ue?Ml:0,!o&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ex(t,n,e);else if(t.tag===19)ex(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&&ud(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Eg(e,!1,r,n,s,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&&ud(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Eg(e,!0,n,null,s,i);break;case"together":Eg(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(Ka(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(k(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 fv(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&od(t)))}function fM(t,e,n){switch(e.tag){case 3:ed(e,e.stateNode.containerInfo),dr(e,Qe,t.memoizedState.cache),cs();break;case 27:case 5:Ig(e);break;case 4:ed(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,am(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?gE(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||(Ka(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return mE(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ke(Ge,Ge.current),i)break;return null;case 22:return e.lanes=0,hE(t,e,n,e.pendingProps);case 24:dr(e,Qe,t.memoizedState.cache)}return Ni(t,e,n)}function vE(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)Je=!0;else{if(!fv(t,n)&&(e.flags&128)===0)return Je=!1,fM(t,e,n);Je=(t.flags&131072)!==0}else Je=!1,ue&&(e.flags&1048576)!==0&&b1(e,Ml,e.index);switch(e.lanes=0,e.tag){case 16:e:{var i=e.pendingProps;if(t=ns(e.elementType),e.type=t,typeof t=="function")qm(t)?(i=ps(t,i),e.tag=1,e=QS(null,e,t,i,n)):(e.tag=0,e=fm(null,e,t,i,n));else{if(t!=null){var r=t.$$typeof;if(r===Om){e.tag=11,e=YS(null,e,t,i,n);break e}else if(r===Mm){e.tag=14,e=ZS(null,e,t,i,n);break e}}throw e=$g(t)||t,Error(k(306,e,""))}}return e;case 0:return fm(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=ps(i,e.pendingProps),QS(t,e,i,r,n);case 3:e:{if(ed(e,e.stateNode.containerInfo),t===null)throw Error(k(387));i=e.pendingProps;var s=e.memoizedState;r=s.element,im(t,e),bl(e,i,null,n);var a=e.memoizedState;if(i=a.cache,dr(e,Qe,i),i!==s.cache&&tm(e,[Qe],n,!0),_l(),i=a.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:a.cache},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){e=JS(t,e,i,n);break e}else if(i!==r){r=gn(Error(k(424)),e),Nl(r),e=JS(t,e,i,n);break e}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Oe=yn(t.firstChild),gt=e,ue=!0,Sr=null,mn=!0,n=A1(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(cs(),i===r){e=Ni(t,e,n);break e}pt(t,e,i,n)}e=e.child}return e;case 26:return Yu(t,e),t===null?(n=xx(e.type,null,e.pendingProps,null))?e.memoizedState=n:ue||(n=e.type,t=e.pendingProps,i=xd(br.current).createElement(n),i[ht]=e,i[Vt]=t,vt(i,n,t),ot(i),e.stateNode=i):e.memoizedState=xx(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Ig(e),t===null&&ue&&(i=e.stateNode=ow(e.type,e.pendingProps,br.current),gt=e,mn=!0,r=Oe,Lr(e.type)?(km=r,Oe=yn(i.firstChild)):Oe=r),pt(t,e,e.pendingProps.children,n),Yu(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&ue&&((r=i=Oe)&&(i=VM(i,e.type,e.pendingProps,mn),i!==null?(e.stateNode=i,gt=e,Oe=yn(i.firstChild),mn=!1,r=!0):r=!1),r||Or(e)),Ig(e),r=e.type,s=e.pendingProps,a=t!==null?t.memoizedProps:null,i=s.children,Em(r,s)?i=null:a!==null&&Em(r,a)&&(e.flags|=32),e.memoizedState!==null&&(r=Jm(t,e,iM,null,null,n),Ul._currentValue=r),Yu(t,e),pt(t,e,i,n),e.child;case 6:return t===null&&ue&&((t=n=Oe)&&(n=IM(n,e.pendingProps,mn),n!==null?(e.stateNode=n,gt=e,Oe=null,t=!0):t=!1),t||Or(e)),null;case 13:return gE(t,e,n);case 4:return ed(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=ds(e,null,i,n):pt(t,e,i,n),e.child;case 11:return YS(t,e,e.type,e.pendingProps,n);case 7:return pt(t,e,e.pendingProps,n),e.child;case 8:return pt(t,e,e.pendingProps.children,n),e.child;case 12:return pt(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,dr(e,e.type,i.value),pt(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,us(e),r=mt(r),i=i(r),e.flags|=1,pt(t,e,i,n),e.child;case 14:return ZS(t,e,e.type,e.pendingProps,n);case 15:return pE(t,e,e.type,e.pendingProps,n);case 19:return mE(t,e,n);case 31:return dM(t,e,n);case 22:return hE(t,e,n,e.pendingProps);case 24:return us(e),i=mt(Qe),t===null?(r=Zm(),r===null&&(r=Ee,s=Ym(),r.pooledCache=s,s.refCount++,s!==null&&(r.pooledCacheLanes|=n),r=s),e.memoizedState={parent:i,cache:r},Xm(e),dr(e,Qe,r)):((t.lanes&n)!==0&&(im(t,e),bl(e,null,null,n),_l()),r=t.memoizedState,s=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),dr(e,Qe,i)):(i=s.cache,dr(e,Qe,i),i!==r.cache&&tm(e,[Qe],n,!0))),pt(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(k(156,e.tag))}function vi(t){t.flags|=4}function wg(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(IE())t.flags|=8192;else throw os=ld,Wm}else t.flags&=-16777217}function tx(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!uw(e))if(IE())t.flags|=8192;else throw os=ld,Wm}function Mu(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?Fx():536870912,t.lanes|=e,qa|=e)}function sl(t,e){if(!ue)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 Re(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 pM(t,e,n){var i=e.pendingProps;switch(Gm(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Re(e),null;case 1:return Re(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),ki(Qe),Ua(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(ga(e)?vi(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,gg())),Re(e),null;case 26:var r=e.type,s=e.memoizedState;return t===null?(vi(e),s!==null?(Re(e),tx(e,s)):(Re(e),wg(e,r,null,i,n))):s?s!==t.memoizedState?(vi(e),Re(e),tx(e,s)):(Re(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&vi(e),Re(e),wg(e,r,t,i,n)),null;case 27:if(td(e),n=br.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&vi(e);else{if(!i){if(e.stateNode===null)throw Error(k(166));return Re(e),null}t=Gn.current,ga(e)?OS(e,t):(t=ow(r,i,n),e.stateNode=t,vi(e))}return Re(e),null;case 5:if(td(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&vi(e);else{if(!i){if(e.stateNode===null)throw Error(k(166));return Re(e),null}if(s=Gn.current,ga(e))OS(e,s);else{var a=xd(br.current);switch(s){case 1:s=a.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:s=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":s=a.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":s=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":s=a.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof i.is=="string"?a.createElement("select",{is:i.is}):a.createElement("select"),i.multiple?s.multiple=!0:i.size&&(s.size=i.size);break;default:s=typeof i.is=="string"?a.createElement(r,{is:i.is}):a.createElement(r)}}s[ht]=e,s[Vt]=i;e:for(a=e.child;a!==null;){if(a.tag===5||a.tag===6)s.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=s;e:switch(vt(s,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 Re(e),wg(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(k(166));if(t=br.current,ga(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=gt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[ht]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||iw(t.nodeValue,n)),t||Or(e,!0)}else t=xd(t).createTextNode(i),t[ht]=e,e.stateNode=t}return Re(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(i=ga(e),n!==null){if(t===null){if(!i)throw Error(k(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(k(557));t[ht]=e}else cs(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Re(e),t=!1}else n=gg(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(Zt(e),e):(Zt(e),null);if((e.flags&128)!==0)throw Error(k(558))}return Re(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=ga(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(k(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(k(317));r[ht]=e}else cs(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Re(e),r=!1}else r=gg(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(Zt(e),e):(Zt(e),null)}return Zt(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),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Mu(e,e.updateQueue),Re(e),null);case 4:return Ua(),t===null&&_v(e.stateNode.containerInfo),Re(e),null;case 10:return ki(e.type),Re(e),null;case 19:if(lt(Ge),i=e.memoizedState,i===null)return Re(e),null;if(r=(e.flags&128)!==0,s=i.rendering,s===null)if(r)sl(i,!1);else{if(Ve!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=ud(t),s!==null){for(e.flags|=128,sl(i,!1),t=s.updateQueue,e.updateQueue=t,Mu(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)y1(n,t),n=n.sibling;return ke(Ge,Ge.current&1|2),ue&&Si(e,i.treeForkCount),e.child}t=t.sibling}i.tail!==null&&Kt()>md&&(e.flags|=128,r=!0,sl(i,!1),e.lanes=4194304)}else{if(!r)if(t=ud(s),t!==null){if(e.flags|=128,r=!0,t=t.updateQueue,e.updateQueue=t,Mu(e,t),sl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ue)return Re(e),null}else 2*Kt()-i.renderingStartTime>md&&n!==536870912&&(e.flags|=128,r=!0,sl(i,!1),e.lanes=4194304);i.isBackwards?(s.sibling=e.child,e.child=s):(t=i.last,t!==null?t.sibling=s:e.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Kt(),t.sibling=null,n=Ge.current,ke(Ge,r?n&1|2:n&1),ue&&Si(e,i.treeForkCount),t):(Re(e),null);case 22:case 23:return Zt(e),Km(),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&&(Re(e),e.subtreeFlags&6&&(e.flags|=8192)):Re(e),n=e.updateQueue,n!==null&&Mu(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&&lt(as),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),ki(Qe),Re(e),null;case 25:return null;case 30:return null}throw Error(k(156,e.tag))}function hM(t,e){switch(Gm(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return ki(Qe),Ua(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return td(e),null;case 31:if(e.memoizedState!==null){if(Zt(e),e.alternate===null)throw Error(k(340));cs()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Zt(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(k(340));cs()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return lt(Ge),null;case 4:return Ua(),null;case 10:return ki(e.type),null;case 22:case 23:return Zt(e),Km(),t!==null&&lt(as),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return ki(Qe),null;case 25:return null;default:return null}}function yE(t,e){switch(Gm(e),e.tag){case 3:ki(Qe),Ua();break;case 26:case 27:case 5:td(e);break;case 4:Ua();break;case 31:e.memoizedState!==null&&Zt(e);break;case 13:Zt(e);break;case 19:lt(Ge);break;case 10:ki(e.type);break;case 22:case 23:Zt(e),Km(),t!==null&&lt(as);break;case 24:ki(Qe)}}function Wl(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 s=n.create,a=n.inst;i=s(),a.destroy=i}n=n.next}while(n!==r)}}catch(o){ve(e,e.return,o)}}function Mr(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&t)===t){var a=i.inst,o=a.destroy;if(o!==void 0){a.destroy=void 0,r=e;var l=n,c=o;try{c()}catch(u){ve(r,l,u)}}}i=i.next}while(i!==s)}}catch(u){ve(e,e.return,u)}}function _E(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{T1(e,n)}catch(i){ve(t,t.return,i)}}}function bE(t,e,n){n.props=ps(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){ve(t,e,i)}}function xl(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){ve(t,e,r)}}function Pn(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){ve(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){ve(t,e,r)}else n.current=null}function SE(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){ve(t,t.return,r)}}function Cg(t,e,n){try{var i=t.stateNode;LM(i,t.type,n,e),i[Vt]=e}catch(r){ve(t,t.return,r)}}function xE(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Lr(t.type)||t.tag===4}function Ag(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||xE(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 hm(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=wi));else if(i!==4&&(i===27&&Lr(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(hm(t,e,n),t=t.sibling;t!==null;)hm(t,e,n),t=t.sibling}function gd(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(gd(t,e,n),t=t.sibling;t!==null;)gd(t,e,n),t=t.sibling}function EE(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);vt(e,i,n),e[ht]=t,e[Vt]=n}catch(s){ve(t,t.return,s)}}var xi=!1,Ke=!1,kg=!1,nx=typeof WeakSet=="function"?WeakSet:Set,at=null;function gM(t,e){if(t=t.containerInfo,Sm=Ad,t=u1(t),Im(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,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var p;f!==n||r!==0&&f.nodeType!==3||(o=a+r),f!==s||i!==0&&f.nodeType!==3||(l=a+i),f.nodeType===3&&(a+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===t)break t;if(h===n&&++c===r&&(o=a),h===s&&++u===i&&(l=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(xm={focusedElem:t,selectionRange:n},Ad=!1,at=e;at!==null;)if(e=at,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,at=t;else for(;at!==null;){switch(e=at,s=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&&s!==null){t=void 0,n=e,r=s.memoizedProps,s=s.memoizedState,i=n.stateNode;try{var y=ps(n.type,r);t=i.getSnapshotBeforeUpdate(y,s),i.__reactInternalSnapshotBeforeUpdate=t}catch(_){ve(n,n.return,_)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)wm(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":wm(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(k(163))}if(t=e.sibling,t!==null){t.return=e.return,at=t;break}at=e.return}}function wE(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:_i(t,n),i&4&&Wl(5,n);break;case 1:if(_i(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(a){ve(n,n.return,a)}else{var r=ps(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(a){ve(n,n.return,a)}}i&64&&_E(n),i&512&&xl(n,n.return);break;case 3:if(_i(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{T1(t,e)}catch(a){ve(n,n.return,a)}}break;case 27:e===null&&i&4&&EE(n);case 26:case 5:_i(t,n),e===null&&i&4&&SE(n),i&512&&xl(n,n.return);break;case 12:_i(t,n);break;case 31:_i(t,n),i&4&&kE(t,n);break;case 13:_i(t,n),i&4&&TE(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=wM.bind(null,n),FM(t,n))));break;case 22:if(i=n.memoizedState!==null||xi,!i){e=e!==null&&e.memoizedState!==null||Ke,r=xi;var s=Ke;xi=i,(Ke=e)&&!s?bi(t,n,(n.subtreeFlags&8772)!==0):_i(t,n),xi=r,Ke=s}break;case 30:break;default:_i(t,n)}}function CE(t){var e=t.alternate;e!==null&&(t.alternate=null,CE(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&zm(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ze=null,Ht=!1;function yi(t,e,n){for(n=n.child;n!==null;)AE(t,e,n),n=n.sibling}function AE(t,e,n){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Fl,n)}catch{}switch(n.tag){case 26:Ke||Pn(n,e),yi(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ke||Pn(n,e);var i=ze,r=Ht;Lr(n.type)&&(ze=n.stateNode,Ht=!1),yi(t,e,n),Al(n.stateNode),ze=i,Ht=r;break;case 5:Ke||Pn(n,e);case 6:if(i=ze,r=Ht,ze=null,yi(t,e,n),ze=i,Ht=r,ze!==null)if(Ht)try{(ze.nodeType===9?ze.body:ze.nodeName==="HTML"?ze.ownerDocument.body:ze).removeChild(n.stateNode)}catch(s){ve(n,e,s)}else try{ze.removeChild(n.stateNode)}catch(s){ve(n,e,s)}break;case 18:ze!==null&&(Ht?(t=ze,vx(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Za(t)):vx(ze,n.stateNode));break;case 4:i=ze,r=Ht,ze=n.stateNode.containerInfo,Ht=!0,yi(t,e,n),ze=i,Ht=r;break;case 0:case 11:case 14:case 15:Mr(2,n,e),Ke||Mr(4,n,e),yi(t,e,n);break;case 1:Ke||(Pn(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&bE(n,e,i)),yi(t,e,n);break;case 21:yi(t,e,n);break;case 22:Ke=(i=Ke)||n.memoizedState!==null,yi(t,e,n),Ke=i;break;default:yi(t,e,n)}}function kE(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Za(t)}catch(n){ve(e,e.return,n)}}}function TE(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Za(t)}catch(n){ve(e,e.return,n)}}function mM(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new nx),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new nx),e;default:throw Error(k(435,t.tag))}}function Nu(t,e){var n=mM(t);e.forEach(function(i){if(!n.has(i)){n.add(i);var r=CM.bind(null,t,i);i.then(r,r)}})}function zt(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],s=t,a=e,o=a;e:for(;o!==null;){switch(o.tag){case 27:if(Lr(o.type)){ze=o.stateNode,Ht=!1;break e}break;case 5:ze=o.stateNode,Ht=!1;break e;case 3:case 4:ze=o.stateNode.containerInfo,Ht=!0;break e}o=o.return}if(ze===null)throw Error(k(160));AE(s,a,r),ze=null,Ht=!1,s=r.alternate,s!==null&&(s.return=null),r.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)RE(e,t),e=e.sibling}var Rn=null;function RE(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:zt(e,t),Bt(t),i&4&&(Mr(3,t,t.return),Wl(3,t),Mr(5,t,t.return));break;case 1:zt(e,t),Bt(t),i&512&&(Ke||n===null||Pn(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=Rn;if(zt(e,t),Bt(t),i&512&&(Ke||n===null||Pn(n,n.return)),i&4){var s=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":s=r.getElementsByTagName("title")[0],(!s||s[Pl]||s[ht]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(i),r.head.insertBefore(s,r.querySelector("head > title"))),vt(s,i,n),s[ht]=t,ot(s),i=s;break e;case"link":var a=wx("link","href",r).get(i+(n.href||""));if(a){for(var o=0;o<a.length;o++)if(s=a[o],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(o,1);break t}}s=r.createElement(i),vt(s,i,n),r.head.appendChild(s);break;case"meta":if(a=wx("meta","content",r).get(i+(n.content||""))){for(o=0;o<a.length;o++)if(s=a[o],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(o,1);break t}}s=r.createElement(i),vt(s,i,n),r.head.appendChild(s);break;default:throw Error(k(468,i))}s[ht]=t,ot(s),i=s}t.stateNode=i}else Cx(r,t.type,t.stateNode);else t.stateNode=Ex(r,i,t.memoizedProps);else s!==i?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,i===null?Cx(r,t.type,t.stateNode):Ex(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&Cg(t,t.memoizedProps,n.memoizedProps)}break;case 27:zt(e,t),Bt(t),i&512&&(Ke||n===null||Pn(n,n.return)),n!==null&&i&4&&Cg(t,t.memoizedProps,n.memoizedProps);break;case 5:if(zt(e,t),Bt(t),i&512&&(Ke||n===null||Pn(n,n.return)),t.flags&32){r=t.stateNode;try{Va(r,"")}catch(y){ve(t,t.return,y)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,Cg(t,r,n!==null?n.memoizedProps:r)),i&1024&&(kg=!0);break;case 6:if(zt(e,t),Bt(t),i&4){if(t.stateNode===null)throw Error(k(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(y){ve(t,t.return,y)}}break;case 3:if(Xu=null,r=Rn,Rn=Ed(e.containerInfo),zt(e,t),Rn=r,Bt(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Za(e.containerInfo)}catch(y){ve(t,t.return,y)}kg&&(kg=!1,OE(t));break;case 4:i=Rn,Rn=Ed(t.stateNode.containerInfo),zt(e,t),Bt(t),Rn=i;break;case 12:zt(e,t),Bt(t);break;case 31:zt(e,t),Bt(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Nu(t,i)));break;case 13:zt(e,t),Bt(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($d=Kt()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Nu(t,i)));break;case 22:r=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=xi,u=Ke;if(xi=c||r,Ke=u||l,zt(e,t),Ke=u,xi=c,Bt(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||l||xi||Ke||is(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(s=l.stateNode,r)a=s.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{o=l.stateNode;var f=l.memoizedProps.style,h=f!=null&&f.hasOwnProperty("display")?f.display:null;o.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(y){ve(l,l.return,y)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(y){ve(l,l.return,y)}}}else if(e.tag===18){if(n===null){l=e;try{var p=l.stateNode;r?yx(p,!0):yx(l.stateNode,!1)}catch(y){ve(l,l.return,y)}}}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,Nu(t,n))));break;case 19:zt(e,t),Bt(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Nu(t,i)));break;case 30:break;case 21:break;default:zt(e,t),Bt(t)}}function Bt(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(xE(i)){n=i;break}i=i.return}if(n==null)throw Error(k(160));switch(n.tag){case 27:var r=n.stateNode,s=Ag(t);gd(t,s,r);break;case 5:var a=n.stateNode;n.flags&32&&(Va(a,""),n.flags&=-33);var o=Ag(t);gd(t,o,a);break;case 3:case 4:var l=n.stateNode.containerInfo,c=Ag(t);hm(t,c,l);break;default:throw Error(k(161))}}catch(u){ve(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function OE(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;OE(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function _i(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)wE(t,e.alternate,e),e=e.sibling}function is(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),is(e);break;case 1:Pn(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&bE(e,e.return,n),is(e);break;case 27:Al(e.stateNode);case 26:case 5:Pn(e,e.return),is(e);break;case 22:e.memoizedState===null&&is(e);break;case 30:is(e);break;default:is(e)}t=t.sibling}}function bi(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,s=e,a=s.flags;switch(s.tag){case 0:case 11:case 15:bi(r,s,n),Wl(4,s);break;case 1:if(bi(r,s,n),i=s,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){ve(i,i.return,c)}if(i=s,r=i.updateQueue,r!==null){var o=i.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)k1(l[r],o)}catch(c){ve(i,i.return,c)}}n&&a&64&&_E(s),xl(s,s.return);break;case 27:EE(s);case 26:case 5:bi(r,s,n),n&&i===null&&a&4&&SE(s),xl(s,s.return);break;case 12:bi(r,s,n);break;case 31:bi(r,s,n),n&&a&4&&kE(r,s);break;case 13:bi(r,s,n),n&&a&4&&TE(r,s);break;case 22:s.memoizedState===null&&bi(r,s,n),xl(s,s.return);break;case 30:break;default:bi(r,s,n)}e=e.sibling}}function pv(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&&Yl(n))}function hv(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Yl(t))}function Tn(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ME(t,e,n,i),e=e.sibling}function ME(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:Tn(t,e,n,i),r&2048&&Wl(9,e);break;case 1:Tn(t,e,n,i);break;case 3:Tn(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&&Yl(t)));break;case 12:if(r&2048){Tn(t,e,n,i),t=e.stateNode;try{var s=e.memoizedProps,a=s.id,o=s.onPostCommit;typeof o=="function"&&o(a,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){ve(e,e.return,l)}}else Tn(t,e,n,i);break;case 31:Tn(t,e,n,i);break;case 13:Tn(t,e,n,i);break;case 23:break;case 22:s=e.stateNode,a=e.alternate,e.memoizedState!==null?s._visibility&2?Tn(t,e,n,i):El(t,e):s._visibility&2?Tn(t,e,n,i):(s._visibility|=2,va(t,e,n,i,(e.subtreeFlags&10256)!==0||!1)),r&2048&&pv(a,e);break;case 24:Tn(t,e,n,i),r&2048&&hv(e.alternate,e);break;default:Tn(t,e,n,i)}}function va(t,e,n,i,r){for(r=r&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var s=t,a=e,o=n,l=i,c=a.flags;switch(a.tag){case 0:case 11:case 15:va(s,a,o,l,r),Wl(8,a);break;case 23:break;case 22:var u=a.stateNode;a.memoizedState!==null?u._visibility&2?va(s,a,o,l,r):El(s,a):(u._visibility|=2,va(s,a,o,l,r)),r&&c&2048&&pv(a.alternate,a);break;case 24:va(s,a,o,l,r),r&&c&2048&&hv(a.alternate,a);break;default:va(s,a,o,l,r)}e=e.sibling}}function El(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:El(n,i),r&2048&&pv(i.alternate,i);break;case 24:El(n,i),r&2048&&hv(i.alternate,i);break;default:El(n,i)}e=e.sibling}}var pl=8192;function ma(t,e,n){if(t.subtreeFlags&pl)for(t=t.child;t!==null;)NE(t,e,n),t=t.sibling}function NE(t,e,n){switch(t.tag){case 26:ma(t,e,n),t.flags&pl&&t.memoizedState!==null&&eN(n,Rn,t.memoizedState,t.memoizedProps);break;case 5:ma(t,e,n);break;case 3:case 4:var i=Rn;Rn=Ed(t.stateNode.containerInfo),ma(t,e,n),Rn=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=pl,pl=16777216,ma(t,e,n),pl=i):ma(t,e,n));break;default:ma(t,e,n)}}function DE(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 al(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];at=i,zE(i,t)}DE(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)LE(t),t=t.sibling}function LE(t){switch(t.tag){case 0:case 11:case 15:al(t),t.flags&2048&&Mr(9,t,t.return);break;case 3:al(t);break;case 12:al(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Zu(t)):al(t);break;default:al(t)}}function Zu(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];at=i,zE(i,t)}DE(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Mr(8,e,e.return),Zu(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Zu(e));break;default:Zu(e)}t=t.sibling}}function zE(t,e){for(;at!==null;){var n=at;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:Yl(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,at=i;else e:for(n=t;at!==null;){i=at;var r=i.sibling,s=i.return;if(CE(i),i===n){at=null;break e}if(r!==null){r.return=s,at=r;break e}at=s}}}var vM={getCacheForType:function(t){var e=mt(Qe),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return mt(Qe).controller.signal}},yM=typeof WeakMap=="function"?WeakMap:Map,fe=0,Ee=null,se=null,oe=0,me=0,Yt=null,vr=!1,Ja=!1,gv=!1,Di=0,Ve=0,Nr=0,ls=0,mv=0,Xt=0,qa=0,wl=null,Ut=null,gm=!1,$d=0,BE=0,md=1/0,vd=null,wr=null,it=0,Cr=null,Pa=null,Ti=0,mm=0,vm=null,HE=null,Cl=0,ym=null;function en(){return(fe&2)!==0&&oe!==0?oe&-oe:Y.T!==null?yv():Gx()}function UE(){if(Xt===0)if((oe&536870912)===0||ue){var t=xu;xu<<=1,(xu&3932160)===0&&(xu=262144),Xt=t}else Xt=536870912;return t=nn.current,t!==null&&(t.flags|=32),Xt}function $t(t,e,n){(t===Ee&&(me===2||me===9)||t.cancelPendingCommit!==null)&&(Ga(t,0),yr(t,oe,Xt,!1)),ql(t,n),((fe&2)===0||t!==Ee)&&(t===Ee&&((fe&2)===0&&(ls|=n),Ve===4&&yr(t,oe,Xt,!1)),Zn(t))}function $E(t,e,n){if((fe&6)!==0)throw Error(k(327));var i=!n&&(e&127)===0&&(e&t.expiredLanes)===0||jl(t,e),r=i?SM(t,e):Tg(t,e,!0),s=i;do{if(r===0){Ja&&!i&&yr(t,e,0,!1);break}else{if(n=t.current.alternate,s&&!_M(n)){r=Tg(t,e,!1),s=!1;continue}if(r===2){if(s=e,t.errorRecoveryDisabledLanes&s)var a=0;else a=t.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){e=a;e:{var o=t;r=wl;var l=o.current.memoizedState.isDehydrated;if(l&&(Ga(o,a).flags|=256),a=Tg(o,a,!1),a!==2){if(gv&&!l){o.errorRecoveryDisabledLanes|=s,ls|=s,r=4;break e}s=Ut,Ut=r,s!==null&&(Ut===null?Ut=s:Ut.push.apply(Ut,s))}r=a}if(s=!1,r!==2)continue}}if(r===1){Ga(t,0),yr(t,e,0,!0);break}e:{switch(i=t,s=r,s){case 0:case 1:throw Error(k(345));case 4:if((e&4194048)!==e)break;case 6:yr(i,e,Xt,!vr);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(k(329))}if((e&62914560)===e&&(r=$d+300-Kt(),10<r)){if(yr(i,e,Xt,!vr),Td(i,0,!0)!==0)break e;Ti=e,i.timeoutHandle=sw(ix.bind(null,i,n,Ut,vd,gm,e,Xt,ls,qa,vr,s,"Throttled",-0,0),r);break e}ix(i,n,Ut,vd,gm,e,Xt,ls,qa,vr,s,null,-0,0)}}break}while(!0);Zn(t)}function ix(t,e,n,i,r,s,a,o,l,c,u,f,h,p){if(t.timeoutHandle=-1,f=e.subtreeFlags,f&8192||(f&16785408)===16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wi},NE(e,s,f);var y=(s&62914560)===s?$d-Kt():(s&4194048)===s?BE-Kt():0;if(y=tN(f,y),y!==null){Ti=s,t.cancelPendingCommit=y(sx.bind(null,t,e,s,n,i,r,a,o,l,u,f,null,h,p)),yr(t,s,a,!c);return}}sx(t,e,s,n,i,r,a,o,l)}function _M(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],s=r.getSnapshot;r=r.value;try{if(!tn(s(),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&=~mv,e&=~ls,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var s=31-Jt(r),a=1<<s;i[s]=-1,r&=~a}n!==0&&jx(t,n,e)}function Vd(){return(fe&6)===0?(Xl(0,!1),!1):!0}function vv(){if(se!==null){if(me===0)var t=se.return;else t=se,Ci=ys=null,nv(t),za=null,Dl=0,t=se;for(;t!==null;)yE(t.alternate,t),t=t.return;se=null}}function Ga(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,HM(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),Ti=0,vv(),Ee=t,se=n=Ai(t.current,null),oe=e,me=0,Yt=null,vr=!1,Ja=jl(t,e),gv=!1,qa=Xt=mv=ls=Nr=Ve=0,Ut=wl=null,gm=!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-Jt(i),s=1<<r;e|=t[r],i&=~s}return Di=e,Nd(),n}function VE(t,e){ee=null,Y.H=zl,e===Qa||e===Ld?(e=zS(),me=3):e===Wm?(e=zS(),me=4):me=e===dv?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Yt=e,se===null&&(Ve=1,pd(t,gn(e,t.current)))}function IE(){var t=nn.current;return t===null?!0:(oe&4194048)===oe?vn===null:(oe&62914560)===oe||(oe&536870912)!==0?t===vn:!1}function FE(){var t=Y.H;return Y.H=zl,t===null?zl:t}function jE(){var t=Y.A;return Y.A=vM,t}function yd(){Ve=4,vr||(oe&4194048)!==oe&&nn.current!==null||(Ja=!0),(Nr&134217727)===0&&(ls&134217727)===0||Ee===null||yr(Ee,oe,Xt,!1)}function Tg(t,e,n){var i=fe;fe|=2;var r=FE(),s=jE();(Ee!==t||oe!==e)&&(vd=null,Ga(t,e)),e=!1;var a=Ve;e:do try{if(me!==0&&se!==null){var o=se,l=Yt;switch(me){case 8:vv(),a=6;break e;case 3:case 2:case 9:case 6:nn.current===null&&(e=!0);var c=me;if(me=0,Yt=null,Oa(t,o,l,c),n&&Ja){a=0;break e}break;default:c=me,me=0,Yt=null,Oa(t,o,l,c)}}bM(),a=Ve;break}catch(u){VE(t,u)}while(!0);return e&&t.shellSuspendCounter++,Ci=ys=null,fe=i,Y.H=r,Y.A=s,se===null&&(Ee=null,oe=0,Nd()),a}function bM(){for(;se!==null;)qE(se)}function SM(t,e){var n=fe;fe|=2;var i=FE(),r=jE();Ee!==t||oe!==e?(vd=null,md=Kt()+500,Ga(t,e)):Ja=jl(t,e);e:do try{if(me!==0&&se!==null){e=se;var s=Yt;t:switch(me){case 1:me=0,Yt=null,Oa(t,e,s,1);break;case 2:case 9:if(LS(s)){me=0,Yt=null,rx(e);break}e=function(){me!==2&&me!==9||Ee!==t||(me=7),Zn(t)},s.then(e,e);break e;case 3:me=7;break e;case 4:me=5;break e;case 7:LS(s)?(me=0,Yt=null,rx(e)):(me=0,Yt=null,Oa(t,e,s,7));break;case 5:var a=null;switch(se.tag){case 26:a=se.memoizedState;case 5:case 27:var o=se;if(a?uw(a):o.stateNode.complete){me=0,Yt=null;var l=o.sibling;if(l!==null)se=l;else{var c=o.return;c!==null?(se=c,Id(c)):se=null}break t}}me=0,Yt=null,Oa(t,e,s,5);break;case 6:me=0,Yt=null,Oa(t,e,s,6);break;case 8:vv(),Ve=6;break e;default:throw Error(k(462))}}xM();break}catch(u){VE(t,u)}while(!0);return Ci=ys=null,Y.H=i,Y.A=r,fe=n,se!==null?0:(Ee=null,oe=0,Nd(),Ve)}function xM(){for(;se!==null&&!P2();)qE(se)}function qE(t){var e=vE(t.alternate,t,Di);t.memoizedProps=t.pendingProps,e===null?Id(t):se=e}function rx(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=KS(n,e,e.pendingProps,e.type,void 0,oe);break;case 11:e=KS(n,e,e.pendingProps,e.type.render,e.ref,oe);break;case 5:nv(e);default:yE(n,e),e=se=y1(e,Di),e=vE(n,e,Di)}t.memoizedProps=t.pendingProps,e===null?Id(t):se=e}function Oa(t,e,n,i){Ci=ys=null,nv(e),za=null,Dl=0;var r=e.return;try{if(uM(t,r,e,n,oe)){Ve=1,pd(t,gn(n,t.current)),se=null;return}}catch(s){if(r!==null)throw se=r,s;Ve=1,pd(t,gn(n,t.current)),se=null;return}e.flags&32768?(ue||i===1?t=!0:Ja||(oe&536870912)!==0?t=!1:(vr=t=!0,(i===2||i===9||i===3||i===6)&&(i=nn.current,i!==null&&i.tag===13&&(i.flags|=16384))),PE(e,t)):Id(e)}function Id(t){var e=t;do{if((e.flags&32768)!==0){PE(e,vr);return}t=e.return;var n=pM(e.alternate,e,Di);if(n!==null){se=n;return}if(e=e.sibling,e!==null){se=e;return}se=e=t}while(e!==null);Ve===0&&(Ve=5)}function PE(t,e){do{var n=hM(t.alternate,t);if(n!==null){n.flags&=32767,se=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){se=t;return}se=t=n}while(t!==null);Ve=6,se=null}function sx(t,e,n,i,r,s,a,o,l){t.cancelPendingCommit=null;do Fd();while(it!==0);if((fe&6)!==0)throw Error(k(327));if(e!==null){if(e===t.current)throw Error(k(177));if(s=e.lanes|e.childLanes,s|=Fm,tO(t,n,s,a,o,l),t===Ee&&(se=Ee=null,oe=0),Pa=e,Cr=t,Ti=n,mm=s,vm=r,HE=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,AM(nd,function(){return XE(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=Y.T,Y.T=null,r=pe.p,pe.p=2,a=fe,fe|=4;try{gM(t,e,n)}finally{fe=a,pe.p=r,Y.T=i}}it=1,GE(),YE(),ZE()}}function GE(){if(it===1){it=0;var t=Cr,e=Pa,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=Y.T,Y.T=null;var i=pe.p;pe.p=2;var r=fe;fe|=4;try{RE(e,t);var s=xm,a=u1(t.containerInfo),o=s.focusedElem,l=s.selectionRange;if(a!==o&&o&&o.ownerDocument&&c1(o.ownerDocument.documentElement,o)){if(l!==null&&Im(o)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in o)o.selectionStart=c,o.selectionEnd=Math.min(u,o.value.length);else{var f=o.ownerDocument||document,h=f&&f.defaultView||window;if(h.getSelection){var p=h.getSelection(),y=o.textContent.length,_=Math.min(l.start,y),b=l.end===void 0?_:Math.min(l.end,y);!p.extend&&_>b&&(a=b,b=_,_=a);var d=kS(o,_),g=kS(o,b);if(d&&g&&(p.rangeCount!==1||p.anchorNode!==d.node||p.anchorOffset!==d.offset||p.focusNode!==g.node||p.focusOffset!==g.offset)){var m=f.createRange();m.setStart(d.node,d.offset),p.removeAllRanges(),_>b?(p.addRange(m),p.extend(g.node,g.offset)):(m.setEnd(g.node,g.offset),p.addRange(m))}}}}for(f=[],p=o;p=p.parentNode;)p.nodeType===1&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<f.length;o++){var v=f[o];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}Ad=!!Sm,xm=Sm=null}finally{fe=r,pe.p=i,Y.T=n}}t.current=e,it=2}}function YE(){if(it===2){it=0;var t=Cr,e=Pa,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=Y.T,Y.T=null;var i=pe.p;pe.p=2;var r=fe;fe|=4;try{wE(t,e.alternate,e)}finally{fe=r,pe.p=i,Y.T=n}}it=3}}function ZE(){if(it===4||it===3){it=0,G2();var t=Cr,e=Pa,n=Ti,i=HE;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?it=5:(it=0,Pa=Cr=null,WE(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(wr=null),Lm(n),e=e.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Fl,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Y.T,r=pe.p,pe.p=2,Y.T=null;try{for(var s=t.onRecoverableError,a=0;a<i.length;a++){var o=i[a];s(o.value,{componentStack:o.stack})}}finally{Y.T=e,pe.p=r}}(Ti&3)!==0&&Fd(),Zn(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===ym?Cl++:(Cl=0,ym=t):Cl=0,Xl(0,!1)}}function WE(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Yl(e)))}function Fd(){return GE(),YE(),ZE(),XE()}function XE(){if(it!==5)return!1;var t=Cr,e=mm;mm=0;var n=Lm(Ti),i=Y.T,r=pe.p;try{pe.p=32>n?32:n,Y.T=null,n=vm,vm=null;var s=Cr,a=Ti;if(it=0,Pa=Cr=null,Ti=0,(fe&6)!==0)throw Error(k(331));var o=fe;if(fe|=4,LE(s.current),ME(s,s.current,a,n),fe=o,Xl(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Fl,s)}catch{}return!0}finally{pe.p=r,Y.T=i,WE(t,e)}}function ax(t,e,n){e=gn(n,e),e=dm(t.stateNode,e,2),t=Er(t,e,2),t!==null&&(ql(t,2),Zn(t))}function ve(t,e,n){if(t.tag===3)ax(t,t,n);else for(;e!==null;){if(e.tag===3){ax(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(wr===null||!wr.has(i))){t=gn(n,t),n=dE(2),i=Er(e,n,2),i!==null&&(fE(n,i,e,t),ql(i,2),Zn(i));break}}e=e.return}}function Rg(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new yM;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)||(gv=!0,r.add(n),t=EM.bind(null,t,e,n),e.then(t,t))}function EM(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ee===t&&(oe&n)===n&&(Ve===4||Ve===3&&(oe&62914560)===oe&&300>Kt()-$d?(fe&2)===0&&Ga(t,0):mv|=n,qa===oe&&(qa=0)),Zn(t)}function KE(t,e){e===0&&(e=Fx()),t=vs(t,e),t!==null&&(ql(t,e),Zn(t))}function wM(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),KE(t,n)}function CM(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(k(314))}i!==null&&i.delete(e),KE(t,n)}function AM(t,e){return Nm(t,e)}var _d=null,ya=null,_m=!1,bd=!1,Og=!1,_r=0;function Zn(t){t!==ya&&t.next===null&&(ya===null?_d=ya=t:ya=ya.next=t),bd=!0,_m||(_m=!0,TM())}function Xl(t,e){if(!Og&&bd){Og=!0;do for(var n=!1,i=_d;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var a=i.suspendedLanes,o=i.pingedLanes;s=(1<<31-Jt(42|t)+1)-1,s&=r&~(a&~o),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,ox(i,s))}else s=oe,s=Td(i,i===Ee?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(s&3)===0||jl(i,s)||(n=!0,ox(i,s));i=i.next}while(n);Og=!1}}function kM(){QE()}function QE(){bd=_m=!1;var t=0;_r!==0&&BM()&&(t=_r);for(var e=Kt(),n=null,i=_d;i!==null;){var r=i.next,s=JE(i,e);s===0?(i.next=null,n===null?_d=r:n.next=r,r===null&&(ya=n)):(n=i,(t!==0||(s&3)!==0)&&(bd=!0)),i=r}it!==0&&it!==5||Xl(t,!1),_r!==0&&(_r=0)}function JE(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes&-62914561;0<s;){var a=31-Jt(s),o=1<<a,l=r[a];l===-1?((o&n)===0||(o&i)!==0)&&(r[a]=eO(o,e)):l<=e&&(t.expiredLanes|=o),s&=~o}if(e=Ee,n=oe,n=Td(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(me===2||me===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&sg(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||jl(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&sg(i),Lm(n)){case 2:case 8:n=Vx;break;case 32:n=nd;break;case 268435456:n=Ix;break;default:n=nd}return i=ew.bind(null,t),n=Nm(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&sg(i),t.callbackPriority=2,t.callbackNode=null,2}function ew(t,e){if(it!==0&&it!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(Fd()&&t.callbackNode!==n)return null;var i=oe;return i=Td(t,t===Ee?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:($E(t,i,e),JE(t,Kt()),t.callbackNode!=null&&t.callbackNode===n?ew.bind(null,t):null)}function ox(t,e){if(Fd())return null;$E(t,e,!0)}function TM(){UM(function(){(fe&6)!==0?Nm($x,kM):QE()})}function yv(){if(_r===0){var t=Ia;t===0&&(t=Su,Su<<=1,(Su&261888)===0&&(Su=256)),_r=t}return _r}function lx(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:$u(""+t)}function cx(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 RM(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var s=lx((r[Vt]||null).action),a=i.submitter;a&&(e=(e=a[Vt]||null)?lx(e.formAction):a.getAttribute("formAction"),e!==null&&(s=e,a=null));var o=new Rd("action","action",null,i,r);t.push({event:o,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(_r!==0){var l=a?cx(r,a):new FormData(r);cm(n,{pending:!0,data:l,method:r.method,action:s},null,l)}}else typeof s=="function"&&(o.preventDefault(),l=a?cx(r,a):new FormData(r),cm(n,{pending:!0,data:l,method:r.method,action:s},s,l))},currentTarget:r}]})}}for(Du=0;Du<Kg.length;Du++)Lu=Kg[Du],ux=Lu.toLowerCase(),dx=Lu[0].toUpperCase()+Lu.slice(1),On(ux,"on"+dx);var Lu,ux,dx,Du;On(f1,"onAnimationEnd");On(p1,"onAnimationIteration");On(h1,"onAnimationStart");On("dblclick","onDoubleClick");On("focusin","onFocus");On("focusout","onBlur");On(YO,"onTransitionRun");On(ZO,"onTransitionStart");On(WO,"onTransitionCancel");On(g1,"onTransitionEnd");$a("onMouseEnter",["mouseout","mouseover"]);$a("onMouseLeave",["mouseout","mouseover"]);$a("onPointerEnter",["pointerout","pointerover"]);$a("onPointerLeave",["pointerout","pointerover"]);hs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));hs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));hs("onBeforeInput",["compositionend","keypress","textInput","paste"]);hs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));hs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));hs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bl="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(" "),OM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bl));function tw(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 s=void 0;if(e)for(var a=i.length-1;0<=a;a--){var o=i[a],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==s&&r.isPropagationStopped())break e;s=o,r.currentTarget=c;try{s(r)}catch(u){rd(u)}r.currentTarget=null,s=l}else for(a=0;a<i.length;a++){if(o=i[a],l=o.instance,c=o.currentTarget,o=o.listener,l!==s&&r.isPropagationStopped())break e;s=o,r.currentTarget=c;try{s(r)}catch(u){rd(u)}r.currentTarget=null,s=l}}}}function re(t,e){var n=e[jg];n===void 0&&(n=e[jg]=new Set);var i=t+"__bubble";n.has(i)||(nw(e,t,2,!1),n.add(i))}function Mg(t,e,n){var i=0;e&&(i|=4),nw(n,t,i,e)}var zu="_reactListening"+Math.random().toString(36).slice(2);function _v(t){if(!t[zu]){t[zu]=!0,Yx.forEach(function(n){n!=="selectionchange"&&(OM.has(n)||Mg(n,!1,t),Mg(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[zu]||(e[zu]=!0,Mg("selectionchange",!1,e))}}function nw(t,e,n,i){switch(gw(e)){case 2:var r=rN;break;case 8:r=sN;break;default:r=Ev}n=r.bind(null,e,n,t),r=void 0,!Zg||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 Ng(t,e,n,i,r){var s=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 o=i.stateNode.containerInfo;if(o===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(;o!==null;){if(a=Sa(o),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){i=s=a;continue e}o=o.parentNode}}i=i.return}t1(function(){var c=s,u=Hm(n),f=[];e:{var h=m1.get(t);if(h!==void 0){var p=Rd,y=t;switch(t){case"keypress":if(Iu(n)===0)break e;case"keydown":case"keyup":p=CO;break;case"focusin":y="focus",p=ug;break;case"focusout":y="blur",p=ug;break;case"beforeblur":case"afterblur":p=ug;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":p=yS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=pO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=TO;break;case f1:case p1:case h1:p=mO;break;case g1:p=OO;break;case"scroll":case"scrollend":p=dO;break;case"wheel":p=NO;break;case"copy":case"cut":case"paste":p=yO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=bS;break;case"toggle":case"beforetoggle":p=LO}var _=(e&4)!==0,b=!_&&(t==="scroll"||t==="scrollend"),d=_?h!==null?h+"Capture":null:h;_=[];for(var g=c,m;g!==null;){var v=g;if(m=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||m===null||d===null||(v=Tl(g,d),v!=null&&_.push(Hl(g,v,m))),b)break;g=g.return}0<_.length&&(h=new p(h,y,null,n,u),f.push({event:h,listeners:_}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",h&&n!==Yg&&(y=n.relatedTarget||n.fromElement)&&(Sa(y)||y[Wa]))break e;if((p||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,p?(y=n.relatedTarget||n.toElement,p=c,y=y?Sa(y):null,y!==null&&(b=Il(y),_=y.tag,y!==b||_!==5&&_!==27&&_!==6)&&(y=null)):(p=null,y=c),p!==y)){if(_=yS,v="onMouseLeave",d="onMouseEnter",g="mouse",(t==="pointerout"||t==="pointerover")&&(_=bS,v="onPointerLeave",d="onPointerEnter",g="pointer"),b=p==null?h:dl(p),m=y==null?h:dl(y),h=new _(v,g+"leave",p,n,u),h.target=b,h.relatedTarget=m,v=null,Sa(u)===c&&(_=new _(d,g+"enter",y,n,u),_.target=m,_.relatedTarget=b,v=_),b=v,p&&y)t:{for(_=MM,d=p,g=y,m=0,v=d;v;v=_(v))m++;v=0;for(var S=g;S;S=_(S))v++;for(;0<m-v;)d=_(d),m--;for(;0<v-m;)g=_(g),v--;for(;m--;){if(d===g||g!==null&&d===g.alternate){_=d;break t}d=_(d),g=_(g)}_=null}else _=null;p!==null&&fx(f,h,p,_,!1),y!==null&&b!==null&&fx(f,b,y,_,!0)}}e:{if(h=c?dl(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var w=wS;else if(ES(h))if(o1)w=qO;else{w=FO;var E=IO}else p=h.nodeName,!p||p.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&Bm(c.elementType)&&(w=wS):w=jO;if(w&&(w=w(t,c))){a1(f,w,n,u);break e}E&&E(t,h,c),t==="focusout"&&c&&h.type==="number"&&c.memoizedProps.value!=null&&Gg(h,"number",h.value)}switch(E=c?dl(c):window,t){case"focusin":(ES(E)||E.contentEditable==="true")&&(wa=E,Wg=c,ml=null);break;case"focusout":ml=Wg=wa=null;break;case"mousedown":Xg=!0;break;case"contextmenu":case"mouseup":case"dragend":Xg=!1,TS(f,n,u);break;case"selectionchange":if(GO)break;case"keydown":case"keyup":TS(f,n,u)}var C;if(Vm)e:{switch(t){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else Ea?r1(t,n)&&(R="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(R="onCompositionStart");R&&(i1&&n.locale!=="ko"&&(Ea||R!=="onCompositionStart"?R==="onCompositionEnd"&&Ea&&(C=n1()):(mr=u,Um="value"in mr?mr.value:mr.textContent,Ea=!0)),E=Sd(c,R),0<E.length&&(R=new _S(R,t,null,n,u),f.push({event:R,listeners:E}),C?R.data=C:(C=s1(n),C!==null&&(R.data=C)))),(C=BO?HO(t,n):UO(t,n))&&(R=Sd(c,"onBeforeInput"),0<R.length&&(E=new _S("onBeforeInput","beforeinput",null,n,u),f.push({event:E,listeners:R}),E.data=C)),RM(f,t,c,n,u)}tw(f,e)})}function Hl(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Sd(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,s=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||s===null||(r=Tl(t,n),r!=null&&i.unshift(Hl(t,r,s)),r=Tl(t,e),r!=null&&i.push(Hl(t,r,s))),t.tag===3)return i;t=t.return}return[]}function MM(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function fx(t,e,n,i,r){for(var s=e._reactName,a=[];n!==null&&n!==i;){var o=n,l=o.alternate,c=o.stateNode;if(o=o.tag,l!==null&&l===i)break;o!==5&&o!==26&&o!==27||c===null||(l=c,r?(c=Tl(n,s),c!=null&&a.unshift(Hl(n,c,l))):r||(c=Tl(n,s),c!=null&&a.push(Hl(n,c,l)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var NM=/\r\n?/g,DM=/\u0000|\uFFFD/g;function px(t){return(typeof t=="string"?t:""+t).replace(NM,`
9
- `).replace(DM,"")}function iw(t,e){return e=px(e),px(t)===e}function _e(t,e,n,i,r,s){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||Va(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&Va(t,""+i);break;case"className":wu(t,"class",i);break;case"tabIndex":wu(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":wu(t,n,i);break;case"style":e1(t,i,s);break;case"data":if(e!=="object"){wu(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=$u(""+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 s=="function"&&(n==="formAction"?(e!=="input"&&_e(t,e,"name",r.name,r,null),_e(t,e,"formEncType",r.formEncType,r,null),_e(t,e,"formMethod",r.formMethod,r,null),_e(t,e,"formTarget",r.formTarget,r,null)):(_e(t,e,"encType",r.encType,r,null),_e(t,e,"method",r.method,r,null),_e(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=$u(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=wi);break;case"onScroll":i!=null&&re("scroll",t);break;case"onScrollEnd":i!=null&&re("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(k(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(k(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=$u(""+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":re("beforetoggle",t),re("toggle",t),Uu(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":Uu(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=cO.get(n)||n,Uu(t,n,i))}}function bm(t,e,n,i,r,s){switch(n){case"style":e1(t,i,s);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(k(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(k(60));t.innerHTML=n}}break;case"children":typeof i=="string"?Va(t,i):(typeof i=="number"||typeof i=="bigint")&&Va(t,""+i);break;case"onScroll":i!=null&&re("scroll",t);break;case"onScrollEnd":i!=null&&re("scrollend",t);break;case"onClick":i!=null&&(t.onclick=wi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Zx.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),s=t[Vt]||null,s=s!=null?s[n]:null,typeof s=="function"&&t.removeEventListener(e,s,r),typeof i=="function")){typeof s!="function"&&s!==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,""):Uu(t,n,i)}}}function vt(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":re("error",t),re("load",t);var i=!1,r=!1,s;for(s in n)if(n.hasOwnProperty(s)){var a=n[s];if(a!=null)switch(s){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(k(137,e));default:_e(t,e,s,a,n,null)}}r&&_e(t,e,"srcSet",n.srcSet,n,null),i&&_e(t,e,"src",n.src,n,null);return;case"input":re("invalid",t);var o=s=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":s=u;break;case"defaultValue":o=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(k(137,e));break;default:_e(t,e,i,u,n,null)}}Kx(t,s,o,l,c,a,r,!1);return;case"select":re("invalid",t),i=a=s=null;for(r in n)if(n.hasOwnProperty(r)&&(o=n[r],o!=null))switch(r){case"value":s=o;break;case"defaultValue":a=o;break;case"multiple":i=o;default:_e(t,e,r,o,n,null)}e=s,n=a,t.multiple=!!i,e!=null?Na(t,!!i,e,!1):n!=null&&Na(t,!!i,n,!0);return;case"textarea":re("invalid",t),s=r=i=null;for(a in n)if(n.hasOwnProperty(a)&&(o=n[a],o!=null))switch(a){case"value":i=o;break;case"defaultValue":r=o;break;case"children":s=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(k(91));break;default:_e(t,e,a,o,n,null)}Jx(t,i,r,s);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(i=n[l],i!=null))switch(l){case"selected":t.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:_e(t,e,l,i,n,null)}return;case"dialog":re("beforetoggle",t),re("toggle",t),re("cancel",t),re("close",t);break;case"iframe":case"object":re("load",t);break;case"video":case"audio":for(i=0;i<Bl.length;i++)re(Bl[i],t);break;case"image":re("error",t),re("load",t);break;case"details":re("toggle",t);break;case"embed":case"source":case"link":re("error",t),re("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(k(137,e));default:_e(t,e,c,i,n,null)}return;default:if(Bm(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&bm(t,e,u,i,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(i=n[o],i!=null&&_e(t,e,o,i,n,null))}function LM(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,s=null,a=null,o=null,l=null,c=null,u=null;for(p in n){var f=n[p];if(n.hasOwnProperty(p)&&f!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":l=f;default:i.hasOwnProperty(p)||_e(t,e,p,null,i,f)}}for(var h in i){var p=i[h];if(f=n[h],i.hasOwnProperty(h)&&(p!=null||f!=null))switch(h){case"type":s=p;break;case"name":r=p;break;case"checked":c=p;break;case"defaultChecked":u=p;break;case"value":a=p;break;case"defaultValue":o=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(k(137,e));break;default:p!==f&&_e(t,e,h,p,i,f)}}Pg(t,a,o,l,c,u,s,r);return;case"select":p=a=o=h=null;for(s in n)if(l=n[s],n.hasOwnProperty(s)&&l!=null)switch(s){case"value":break;case"multiple":p=l;default:i.hasOwnProperty(s)||_e(t,e,s,null,i,l)}for(r in i)if(s=i[r],l=n[r],i.hasOwnProperty(r)&&(s!=null||l!=null))switch(r){case"value":h=s;break;case"defaultValue":o=s;break;case"multiple":a=s;default:s!==l&&_e(t,e,r,s,i,l)}e=o,n=a,i=p,h!=null?Na(t,!!n,h,!1):!!i!=!!n&&(e!=null?Na(t,!!n,e,!0):Na(t,!!n,n?[]:"",!1));return;case"textarea":p=h=null;for(o in n)if(r=n[o],n.hasOwnProperty(o)&&r!=null&&!i.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:_e(t,e,o,null,i,r)}for(a in i)if(r=i[a],s=n[a],i.hasOwnProperty(a)&&(r!=null||s!=null))switch(a){case"value":h=r;break;case"defaultValue":p=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(k(91));break;default:r!==s&&_e(t,e,a,r,i,s)}Qx(t,h,p);return;case"option":for(var y in n)if(h=n[y],n.hasOwnProperty(y)&&h!=null&&!i.hasOwnProperty(y))switch(y){case"selected":t.selected=!1;break;default:_e(t,e,y,null,i,h)}for(l in i)if(h=i[l],p=n[l],i.hasOwnProperty(l)&&h!==p&&(h!=null||p!=null))switch(l){case"selected":t.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:_e(t,e,l,h,i,p)}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(_)&&_e(t,e,_,null,i,h);for(c in i)if(h=i[c],p=n[c],i.hasOwnProperty(c)&&h!==p&&(h!=null||p!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(k(137,e));break;default:_e(t,e,c,h,i,p)}return;default:if(Bm(e)){for(var b in n)h=n[b],n.hasOwnProperty(b)&&h!==void 0&&!i.hasOwnProperty(b)&&bm(t,e,b,void 0,i,h);for(u in i)h=i[u],p=n[u],!i.hasOwnProperty(u)||h===p||h===void 0&&p===void 0||bm(t,e,u,h,i,p);return}}for(var d in n)h=n[d],n.hasOwnProperty(d)&&h!=null&&!i.hasOwnProperty(d)&&_e(t,e,d,null,i,h);for(f in i)h=i[f],p=n[f],!i.hasOwnProperty(f)||h===p||h==null&&p==null||_e(t,e,f,h,i,p)}function hx(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function zM(){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],s=r.transferSize,a=r.initiatorType,o=r.duration;if(s&&o&&hx(a)){for(a=0,o=r.responseEnd,i+=1;i<n.length;i++){var l=n[i],c=l.startTime;if(c>o)break;var u=l.transferSize,f=l.initiatorType;u&&hx(f)&&(l=l.responseEnd,a+=u*(l<o?1:(o-c)/(l-c)))}if(--i,e+=8*(s+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 Sm=null,xm=null;function xd(t){return t.nodeType===9?t:t.ownerDocument}function gx(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 rw(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 Em(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 Dg=null;function BM(){var t=window.event;return t&&t.type==="popstate"?t===Dg?!1:(Dg=t,!0):(Dg=null,!1)}var sw=typeof setTimeout=="function"?setTimeout:void 0,HM=typeof clearTimeout=="function"?clearTimeout:void 0,mx=typeof Promise=="function"?Promise:void 0,UM=typeof queueMicrotask=="function"?queueMicrotask:typeof mx<"u"?function(t){return mx.resolve(null).then(t).catch($M)}:sw;function $M(t){setTimeout(function(){throw t})}function Lr(t){return t==="head"}function vx(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),Za(e);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")Al(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,Al(n);for(var s=n.firstChild;s;){var a=s.nextSibling,o=s.nodeName;s[Pl]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=a}}else n==="body"&&Al(t.ownerDocument.body);n=r}while(n);Za(e)}function yx(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 wm(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":wm(n),zm(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function VM(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[Pl])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(s=t.getAttribute("rel"),s==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(s!==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(s=t.getAttribute("src"),(s!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&s&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var s=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===s)return t}else return t;if(t=yn(t.nextSibling),t===null)break}return null}function IM(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=yn(t.nextSibling),t===null))return null;return t}function aw(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=yn(t.nextSibling),t===null))return null;return t}function Cm(t){return t.data==="$?"||t.data==="$~"}function Am(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function FM(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 yn(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 km=null;function _x(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return yn(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function bx(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 ow(t,e,n){switch(e=xd(n),t){case"html":if(t=e.documentElement,!t)throw Error(k(452));return t;case"head":if(t=e.head,!t)throw Error(k(453));return t;case"body":if(t=e.body,!t)throw Error(k(454));return t;default:throw Error(k(451))}}function Al(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);zm(t)}var _n=new Map,Sx=new Set;function Ed(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Li=pe.d;pe.d={f:jM,r:qM,D:PM,C:GM,L:YM,m:ZM,X:XM,S:WM,M:KM};function jM(){var t=Li.f(),e=Vd();return t||e}function qM(t){var e=Xa(t);e!==null&&e.tag===5&&e.type==="form"?eE(e):Li.r(t)}var eo=typeof document>"u"?null:document;function lw(t,e,n){var i=eo;if(i&&typeof e=="string"&&e){var r=hn(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Sx.has(r)||(Sx.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),vt(e,"link",t),ot(e),i.head.appendChild(e)))}}function PM(t){Li.D(t),lw("dns-prefetch",t,null)}function GM(t,e){Li.C(t,e),lw("preconnect",t,e)}function YM(t,e,n){Li.L(t,e,n);var i=eo;if(i&&t&&e){var r='link[rel="preload"][as="'+hn(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+hn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+hn(n.imageSizes)+'"]')):r+='[href="'+hn(t)+'"]';var s=r;switch(e){case"style":s=Ya(t);break;case"script":s=to(t)}_n.has(s)||(t=Me({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),_n.set(s,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(Kl(s))||e==="script"&&i.querySelector(Ql(s))||(e=i.createElement("link"),vt(e,"link",t),ot(e),i.head.appendChild(e)))}}function ZM(t,e){Li.m(t,e);var n=eo;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+hn(i)+'"][href="'+hn(t)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=to(t)}if(!_n.has(s)&&(t=Me({rel:"modulepreload",href:t},e),_n.set(s,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ql(s)))return}i=n.createElement("link"),vt(i,"link",t),ot(i),n.head.appendChild(i)}}}function WM(t,e,n){Li.S(t,e,n);var i=eo;if(i&&t){var r=Ma(i).hoistableStyles,s=Ya(t);e=e||"default";var a=r.get(s);if(!a){var o={loading:0,preload:null};if(a=i.querySelector(Kl(s)))o.loading=5;else{t=Me({rel:"stylesheet",href:t,"data-precedence":e},n),(n=_n.get(s))&&bv(t,n);var l=a=i.createElement("link");ot(l),vt(l,"link",t),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,Wu(a,e,i)}a={type:"stylesheet",instance:a,count:1,state:o},r.set(s,a)}}}function XM(t,e){Li.X(t,e);var n=eo;if(n&&t){var i=Ma(n).hoistableScripts,r=to(t),s=i.get(r);s||(s=n.querySelector(Ql(r)),s||(t=Me({src:t,async:!0},e),(e=_n.get(r))&&Sv(t,e),s=n.createElement("script"),ot(s),vt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function KM(t,e){Li.M(t,e);var n=eo;if(n&&t){var i=Ma(n).hoistableScripts,r=to(t),s=i.get(r);s||(s=n.querySelector(Ql(r)),s||(t=Me({src:t,async:!0,type:"module"},e),(e=_n.get(r))&&Sv(t,e),s=n.createElement("script"),ot(s),vt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function xx(t,e,n,i){var r=(r=br.current)?Ed(r):null;if(!r)throw Error(k(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Ya(n.href),n=Ma(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=Ya(n.href);var s=Ma(r).hoistableStyles,a=s.get(t);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,a),(s=r.querySelector(Kl(t)))&&!s._p&&(a.instance=s,a.state.loading=5),_n.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},_n.set(t,n),s||QM(r,t,n,a.state))),e&&i===null)throw Error(k(528,""));return a}if(e&&i!==null)throw Error(k(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=to(n),n=Ma(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(k(444,t))}}function Ya(t){return'href="'+hn(t)+'"'}function Kl(t){return'link[rel="stylesheet"]['+t+"]"}function cw(t){return Me({},t,{"data-precedence":t.precedence,precedence:null})}function QM(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}),vt(e,"link",n),ot(e),t.head.appendChild(e))}function to(t){return'[src="'+hn(t)+'"]'}function Ql(t){return"script[async]"+t}function Ex(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+hn(n.href)+'"]');if(i)return e.instance=i,ot(i),i;var r=Me({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),ot(i),vt(i,"style",r),Wu(i,n.precedence,t),e.instance=i;case"stylesheet":r=Ya(n.href);var s=t.querySelector(Kl(r));if(s)return e.state.loading|=4,e.instance=s,ot(s),s;i=cw(n),(r=_n.get(r))&&bv(i,r),s=(t.ownerDocument||t).createElement("link"),ot(s);var a=s;return a._p=new Promise(function(o,l){a.onload=o,a.onerror=l}),vt(s,"link",i),e.state.loading|=4,Wu(s,n.precedence,t),e.instance=s;case"script":return s=to(n.src),(r=t.querySelector(Ql(s)))?(e.instance=r,ot(r),r):(i=n,(r=_n.get(s))&&(i=Me({},n),Sv(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),ot(r),vt(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(k(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,Wu(i,n.precedence,t));return e.instance}function Wu(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,a=0;a<i.length;a++){var o=i[a];if(o.dataset.precedence===e)s=o;else if(s!==r)break}s?s.parentNode.insertBefore(t,s.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function bv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Sv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Xu=null;function wx(t,e,n){if(Xu===null){var i=new Map,r=Xu=new Map;r.set(n,i)}else r=Xu,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 s=n[r];if(!(s[Pl]||s[ht]||t==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var a=s.getAttribute(e)||"";a=t+a;var o=i.get(a);o?o.push(s):i.set(a,[s])}}return i}function Cx(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function JM(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;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!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 uw(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function eN(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=Ya(i.href),s=e.querySelector(Kl(r));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=wd.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,ot(s);return}s=e.ownerDocument||e,i=cw(i),(r=_n.get(r))&&bv(i,r),s=s.createElement("link"),ot(s);var a=s;a._p=new Promise(function(o,l){a.onload=o,a.onerror=l}),vt(s,"link",i),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=wd.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var Lg=0;function tN(t,e){return t.stylesheets&&t.count===0&&Ku(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var i=setTimeout(function(){if(t.stylesheets&&Ku(t,t.stylesheets),t.unsuspend){var s=t.unsuspend;t.unsuspend=null,s()}},6e4+e);0<t.imgBytes&&Lg===0&&(Lg=62500*zM());var r=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ku(t,t.stylesheets),t.unsuspend)){var s=t.unsuspend;t.unsuspend=null,s()}},(t.imgBytes>Lg?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function wd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ku(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Cd=null;function Ku(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Cd=new Map,e.forEach(nN,t),Cd=null,wd.call(t))}function nN(t,e){if(!(e.state.loading&4)){var n=Cd.get(t);if(n)var i=n.get(null);else{n=new Map,Cd.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<r.length;s++){var a=r[s];(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"),s=n.get(a)||i,s===i&&n.set(null,r),n.set(a,r),this.count++,i=wd.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),s?s.parentNode.insertBefore(r,s.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var Ul={$$typeof:Ei,Provider:null,Consumer:null,_currentValue:rs,_currentValue2:rs,_threadCount:0};function iN(t,e,n,i,r,s,a,o,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=ag(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ag(0),this.hiddenUpdates=ag(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=s,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function dw(t,e,n,i,r,s,a,o,l,c,u,f){return t=new iN(t,e,n,a,l,c,u,f,o),e=1,s===!0&&(e|=24),s=Wt(3,null,null,e),t.current=s,s.stateNode=t,e=Ym(),e.refCount++,t.pooledCache=e,e.refCount++,s.memoizedState={element:i,isDehydrated:n,cache:e},Xm(s),t}function fw(t){return t?(t=ka,t):ka}function pw(t,e,n,i,r,s){r=fw(r),i.context===null?i.context=r:i.pendingContext=r,i=xr(e),i.payload={element:n},s=s===void 0?null:s,s!==null&&(i.callback=s),n=Er(t,i,e),n!==null&&($t(n,t,e),yl(n,t,e))}function Ax(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function xv(t,e){Ax(t,e),(t=t.alternate)&&Ax(t,e)}function hw(t){if(t.tag===13||t.tag===31){var e=vs(t,67108864);e!==null&&$t(e,t,67108864),xv(t,67108864)}}function kx(t){if(t.tag===13||t.tag===31){var e=en();e=Dm(e);var n=vs(t,e);n!==null&&$t(n,t,e),xv(t,e)}}var Ad=!0;function rN(t,e,n,i){var r=Y.T;Y.T=null;var s=pe.p;try{pe.p=2,Ev(t,e,n,i)}finally{pe.p=s,Y.T=r}}function sN(t,e,n,i){var r=Y.T;Y.T=null;var s=pe.p;try{pe.p=8,Ev(t,e,n,i)}finally{pe.p=s,Y.T=r}}function Ev(t,e,n,i){if(Ad){var r=Tm(i);if(r===null)Ng(t,e,i,kd,n),Tx(t,i);else if(oN(r,t,e,n,i))i.stopPropagation();else if(Tx(t,i),e&4&&-1<aN.indexOf(t)){for(;r!==null;){var s=Xa(r);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var a=ts(s.pendingLanes);if(a!==0){var o=s;for(o.pendingLanes|=2,o.entangledLanes|=2;a;){var l=1<<31-Jt(a);o.entanglements[1]|=l,a&=~l}Zn(s),(fe&6)===0&&(md=Kt()+500,Xl(0,!1))}}break;case 31:case 13:o=vs(s,2),o!==null&&$t(o,s,2),Vd(),xv(s,2)}if(s=Tm(i),s===null&&Ng(t,e,i,kd,n),s===r)break;r=s}r!==null&&i.stopPropagation()}else Ng(t,e,i,null,n)}}function Tm(t){return t=Hm(t),wv(t)}var kd=null;function wv(t){if(kd=null,t=Sa(t),t!==null){var e=Il(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=Lx(e),t!==null)return t;t=null}else if(n===31){if(t=zx(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 kd=t,null}function gw(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(Y2()){case $x:return 2;case Vx:return 8;case nd:case Z2:return 32;case Ix:return 268435456;default:return 32}default:return 32}}var Rm=!1,Ar=null,kr=null,Tr=null,$l=new Map,Vl=new Map,hr=[],aN="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 Tx(t,e){switch(t){case"focusin":case"focusout":Ar=null;break;case"dragenter":case"dragleave":kr=null;break;case"mouseover":case"mouseout":Tr=null;break;case"pointerover":case"pointerout":$l.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vl.delete(e.pointerId)}}function ol(t,e,n,i,r,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:s,targetContainers:[r]},e!==null&&(e=Xa(e),e!==null&&hw(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function oN(t,e,n,i,r){switch(e){case"focusin":return Ar=ol(Ar,t,e,n,i,r),!0;case"dragenter":return kr=ol(kr,t,e,n,i,r),!0;case"mouseover":return Tr=ol(Tr,t,e,n,i,r),!0;case"pointerover":var s=r.pointerId;return $l.set(s,ol($l.get(s)||null,t,e,n,i,r)),!0;case"gotpointercapture":return s=r.pointerId,Vl.set(s,ol(Vl.get(s)||null,t,e,n,i,r)),!0}return!1}function mw(t){var e=Sa(t.target);if(e!==null){var n=Il(e);if(n!==null){if(e=n.tag,e===13){if(e=Lx(n),e!==null){t.blockedOn=e,dS(t.priority,function(){kx(n)});return}}else if(e===31){if(e=zx(n),e!==null){t.blockedOn=e,dS(t.priority,function(){kx(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 Qu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Tm(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);Yg=i,n.target.dispatchEvent(i),Yg=null}else return e=Xa(n),e!==null&&hw(e),t.blockedOn=n,!1;e.shift()}return!0}function Rx(t,e,n){Qu(t)&&n.delete(e)}function lN(){Rm=!1,Ar!==null&&Qu(Ar)&&(Ar=null),kr!==null&&Qu(kr)&&(kr=null),Tr!==null&&Qu(Tr)&&(Tr=null),$l.forEach(Rx),Vl.forEach(Rx)}function Bu(t,e){t.blockedOn===e&&(t.blockedOn=null,Rm||(Rm=!0,rt.unstable_scheduleCallback(rt.unstable_NormalPriority,lN)))}var Hu=null;function Ox(t){Hu!==t&&(Hu=t,rt.unstable_scheduleCallback(rt.unstable_NormalPriority,function(){Hu===t&&(Hu=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(wv(i||n)===null)continue;break}var s=Xa(n);s!==null&&(t.splice(e,3),e-=3,cm(s,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Za(t){function e(l){return Bu(l,t)}Ar!==null&&Bu(Ar,t),kr!==null&&Bu(kr,t),Tr!==null&&Bu(Tr,t),$l.forEach(e),Vl.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);)mw(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],s=n[i+1],a=r[Vt]||null;if(typeof s=="function")a||Ox(n);else if(a){var o=null;if(s&&s.hasAttribute("formAction")){if(r=s,a=s[Vt]||null)o=a.formAction;else if(wv(r)!==null)continue}else o=a.action;typeof o=="function"?n[i+1]=o:(n.splice(i,3),i-=3),Ox(n)}}}function vw(){function t(s){s.canIntercept&&s.info==="react-transition"&&s.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 s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.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 Cv(t){this._internalRoot=t}jd.prototype.render=Cv.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(k(409));var n=e.current,i=en();pw(n,i,t,e,null,null)};jd.prototype.unmount=Cv.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;pw(t.current,2,null,t,null,null),Vd(),e[Wa]=null}};function jd(t){this._internalRoot=t}jd.prototype.unstable_scheduleHydration=function(t){if(t){var e=Gx();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&&mw(t)}};var Mx=Nx.version;if(Mx!=="19.2.3")throw Error(k(527,Mx,"19.2.3"));pe.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(k(188)):(t=Object.keys(t).join(","),Error(k(268,t)));return t=V2(e),t=t!==null?Bx(t):null,t=t===null?null:t.stateNode,t};var cN={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(ll=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ll.isDisabled&&ll.supportsFiber))try{Fl=ll.inject(cN),Qt=ll}catch{}var ll;qd.createRoot=function(t,e){if(!Dx(t))throw Error(k(299));var n=!1,i="",r=lE,s=cE,a=uE;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&&(s=e.onCaughtError),e.onRecoverableError!==void 0&&(a=e.onRecoverableError)),e=dw(t,1,!1,null,null,n,i,null,r,s,a,vw),t[Wa]=e.current,_v(t),new Cv(e)};qd.hydrateRoot=function(t,e,n){if(!Dx(t))throw Error(k(299));var i=!1,r="",s=lE,a=cE,o=uE,l=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),e=dw(t,1,!0,e,n??null,i,r,l,s,a,o,vw),e.context=fw(null),n=e.current,i=en(),i=Dm(i),r=xr(i),r.callback=null,Er(n,r,i),n=i,e.current.lanes=n,ql(e,n),Zn(e),t[Wa]=e.current,_v(t),new jd(e)};qd.version="19.2.3"});var Sw=Dn((iz,bw)=>{"use strict";function _w(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_w)}catch(t){console.error(t)}}_w(),bw.exports=yw()});var A=typeof window<"u"?window:void 0,dt=typeof globalThis<"u"?globalThis:A;typeof self>"u"&&(dt.self=dt),typeof File>"u"&&(dt.File=function(){});var M0=Array.prototype,By=M0.forEach,Hy=M0.indexOf,Pt=dt?.navigator,D=dt?.document,Nt=dt?.location,Vf=dt?.fetch,If=dt!=null&&dt.XMLHttpRequest&&"withCredentials"in new dt.XMLHttpRequest?dt.XMLHttpRequest:void 0,Uy=dt?.AbortController,Mt=Pt?.userAgent,Z=A??{},ai={DEBUG:!1,LIB_VERSION:"1.302.2"};function $y(t,e,n,i,r,s,a){try{var o=t[s](a),l=o.value}catch(c){return void n(c)}o.done?e(l):Promise.resolve(l).then(i,r)}function Vy(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var s=t.apply(e,n);function a(l){$y(s,i,r,a,o,"next",l)}function o(l){$y(s,i,r,a,o,"throw",l)}a(void 0)}))}}function B(){return B=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},B.apply(null,arguments)}function N0(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 KA=["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"],Iy=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return KA.concat(e).some((i=>{var r=i.toLowerCase();return n.indexOf(r)!==-1}))},QA=["$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 ie(t,e){return t.indexOf(e)!==-1}var qc=function(t){return t.trim()},Ff=function(t){return t.replace(/^\$/,"")},JA=Array.isArray,D0=Object.prototype,L0=D0.hasOwnProperty,Pc=D0.toString,Se=JA||function(t){return Pc.call(t)==="[object Array]"},Qi=t=>typeof t=="function",st=t=>t===Object(t)&&!Se(t),Gs=t=>{if(st(t)){for(var e in t)if(L0.call(t,e))return!1;return!0}return!1},N=t=>t===void 0,tt=t=>Pc.call(t)=="[object String]",jf=t=>tt(t)&&t.trim().length===0,ui=t=>t===null,ye=t=>N(t)||ui(t),Un=t=>Pc.call(t)=="[object Number]",Ji=t=>Pc.call(t)==="[object Boolean]",ek=t=>t instanceof FormData,tk=t=>ie(QA,t);function qf(t){return t===null||typeof t!="object"}function Ec(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function z0(t){return!N(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var nk=[!0,"true",1,"1","yes"],Cf=t=>ie(nk,t),ik=[!1,"false",0,"0","no"];function zn(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),Un(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),zn(r||n,e,n,i))}var Pf=class{constructor(e){this.t={},this.i=e.i,this.o=zn(e.bucketSize,0,100,e.h),this.m=zn(e.refillRate,0,this.o,e.h),this.S=zn(e.refillInterval,0,864e5,e.h)}$(e,n){var i=n-e.lastAccess,r=Math.floor(i/this.S);if(r>0){var s=r*this.m;e.tokens=Math.min(e.tokens+s,this.o),e.lastAccess=e.lastAccess+r*this.S}}consumeRateLimit(e){var n,i=Date.now(),r=String(e),s=this.t[r];return s?this.$(s,i):(s={tokens:this.o,lastAccess:i},this.t[r]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.i)==null||n.call(this,e)),s.tokens===0)}stop(){this.t={}}},pc,Fy,Af,rk=t=>t instanceof Error;function sk(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return Af&&n.length===Fy||(Fy=n.length,Af=n.reduce(((i,r)=>{pc||(pc={});var s=pc[r];if(s)i[s[0]]=s[1];else for(var a=t(r),o=a.length-1;o>=0;o--){var l=a[o],c=l?.filename,u=e[r];if(c&&u){i[c]=u,pc[r]=[c,u];break}}return i}),{})),Af}}var Gf=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),s=this.buildParsingContext(),a=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(a,i),$exception_level:"error"}}modifyFrames(e){var n=this;return Vy((function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&Se(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)),B({},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 Vy((function*(){var i=e;for(var r of n.modifiers)i=yield r(i);return i}))()}convertToExceptionList(e,n){var i,r,s,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:(s=e.synthetic)!==null&&s!==void 0&&s}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return e.cause!=null&&o.push(...this.convertToExceptionList(e.cause,B({},n,{handled:!0}))),o}buildParsingContext(){return{chunkIdMap:sk(this.stackParser)}}buildCoercingContext(e,n,i){i===void 0&&(i=0);var r=(s,a)=>{if(a<=4){var o=this.buildCoercingContext(e,n,a);return this.applyCoercers(s,o)}};return B({},n,{syntheticException:i==0?n.syntheticException:void 0,mechanism:e,apply:s=>r(s,i),next:s=>r(s,i+1)})}},Xs="?";function Yf(t,e,n,i,r){var s={platform:t,filename:e,function:n==="<anonymous>"?Xs:n,in_app:!0};return N(i)||(s.lineno=i),N(r)||(s.colno=r),s}var B0=(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]:Xs,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},ak=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ok=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,lk=/\((\S*)(?::(\d+))(?::(\d+))\)/,ck=(t,e)=>{var n=ak.exec(t);if(n){var[,i,r,s]=n;return Yf(e,i,Xs,+r,+s)}var a=ok.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var o=lk.exec(a[2]);o&&(a[2]=o[1],a[3]=o[2],a[4]=o[3])}var[l,c]=B0(a[1]||Xs,a[2]);return Yf(e,c,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},uk=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,dk=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,fk=(t,e)=>{var n=uk.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var i=dk.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}var r=n[3],s=n[1]||Xs;return[s,r]=B0(s,r),Yf(e,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},jy=/\(error: (.*)\)/,qy=50;function pk(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,s){s===void 0&&(s=0);for(var a=[],o=r.split(`
10
- `),l=s;l<o.length;l++){var c=o[l];if(!(c.length>1024)){var u=jy.test(c)?c.replace(jy,"$1"):c;if(!u.match(/\S*Error: /)){for(var f of n){var h=f(u,t);if(h){a.push(h);break}}if(a.length>=qy)break}}}return(function(p){if(!p.length)return[];var y=Array.from(p);return y.reverse(),y.slice(0,qy).map((_=>{return B({},_,{filename:_.filename||(b=y,b[b.length-1]||{}).filename,function:_.function||Xs});var b}))})(a)}}var Zf=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var i=tt(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 Ec(e,"DOMException")}isDOMError(e){return Ec(e,"DOMError")}},Wf=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}},Xf=class{constructor(){}match(e){return Ec(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}}},hk=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Kf=class{match(e){return typeof e=="string"}coerce(e,n){var i,[r,s]=this.getInfos(e);return{type:r??"Error",value:s??e,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}getInfos(e){var n="Error",i=e,r=e.match(hk);return r&&(n=r[1],i=r[2]),[n,i]}},gk=["fatal","error","warning","log","info","debug"];function H0(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 Qf=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 z0(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: "+H0(e)}isSeverityLevel(e){return tt(e)&&!jf(e)&&gk.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=e[n];if(rk(i))return i}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},Jf=class{match(e){return z0(e)}coerce(e,n){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+H0(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},ep=class{match(e){return qf(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}}},tp=class{match(e){return Ec(e,"PromiseRejectionEvent")}coerce(e,n){var i,r=this.getUnhandledRejectionReason(e);return qf(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(qf(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}},U0=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,i={k:function(r){if(A&&(ai.DEBUG||Z.POSTHOG_DEBUG||n)&&!N(A.console)&&A.console){for(var s=("__rrweb_original__"in A.console[r])?A.console[r].__rrweb_original__:A.console[r],a=arguments.length,o=new Array(a>1?a-1:0),l=1;l<a;l++)o[l-1]=arguments[l];s(t,...o)}},info:function(){for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];i.k("log",...s)},warn:function(){for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];i.k("warn",...s)},error:function(){for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];i.k("error",...s)},critical:function(){for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];console.error(t,...s)},uninitializedWarning:r=>{i.error("You must initialize PostHog before calling "+r)},createLogger:(r,s)=>U0(t+" "+r,s)};return i},L=U0("[PostHog.js]"),nt=L.createLogger,mk=nt("[ExternalScriptsLoader]"),Py=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return mk.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var i=D?.querySelectorAll("script");if(i){for(var r,s=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=s())return r.v}var o=()=>{if(!D)return n("document not found");var l=D.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=f=>{l.__posthog_loading_callback_fired=!0,n(void 0,f)},l.onerror=f=>n(f),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");var c,u=D.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):D.body.appendChild(l)};D!=null&&D.body?o():D?.addEventListener("DOMContentLoaded",o)};Z.__PosthogExtensions__=Z.__PosthogExtensions__||{},Z.__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 s=t.requestRouter.endpointFor("assets",i);Py(t,s,n)},Z.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var i=t.requestRouter.endpointFor("api",e);Py(t,i,n)};var wc={};function er(t,e,n){if(Se(t)){if(By&&t.forEach===By)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)===wc)return}}}function we(t,e,n){if(!ye(t)){if(Se(t))return er(t,e,n);if(ek(t)){for(var i of t.entries())if(e.call(n,i[1],i[0])===wc)return}else for(var r in t)if(L0.call(t,r)&&e.call(n,t[r],r)===wc)return}}var Pe=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 er(n,(function(r){for(var s in r)r[s]!==void 0&&(t[s]=r[s])})),t},Js=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 er(n,(function(r){er(r,(function(s){t.push(s)}))})),t};function bc(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 Gy=function(t){try{return t()}catch{return}},vk=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){L.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),L.critical(r)}}},Xp=function(t){var e={};return we(t,(function(n,i){(tt(n)&&n.length>0||Un(n))&&(e[i]=n)})),e};function yk(t,e){return n=t,i=s=>tt(s)&&!ui(e)?s.slice(0,e):s,r=new Set,(function s(a,o){return a!==Object(a)?i?i(a,o):a:r.has(a)?void 0:(r.add(a),Se(a)?(l=[],er(a,(c=>{l.push(s(c))}))):(l={},we(a,((c,u)=>{r.has(c)||(l[u]=s(c,u))}))),l);var l})(n);var n,i,r}var _k=["herokuapp.com","vercel.app","netlify.app"];function bk(t){var e=t?.hostname;if(!tt(e))return!1;var n=e.split(".").slice(-2).join(".");for(var i of _k)if(n===i)return!1;return!0}function $0(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function We(t,e,n,i){var{capture:r=!1,passive:s=!0}=i??{};t?.addEventListener(e,n,{capture:r,passive:s})}var V0="$people_distinct_id",Co="__alias",Ao="__timers",Yy="$autocapture_disabled_server_side",np="$heatmaps_enabled_server_side",Zy="$exception_capture_enabled_server_side",ip="$error_tracking_suppression_rules",Wy="$error_tracking_capture_extension_exceptions",Xy="$web_vitals_enabled_server_side",I0="$dead_clicks_enabled_server_side",Ky="$web_vitals_allowed_metrics",kf="$session_recording_remote_config",Cc="$sesid",F0="$session_is_sampled",Ys="$enabled_feature_flags",ko="$early_access_features",rp="$feature_flag_details",To="$stored_person_properties",Yr="$stored_group_properties",sp="$surveys",hc="$surveys_activated",Ac="$flag_call_reported",oi="$user_state",ap="$client_session_props",op="$capture_rate_limit",lp="$initial_campaign_params",cp="$initial_referrer_info",kc="$initial_person_info",Tc="$epp",j0="__POSTHOG_TOOLBAR__",mo="$posthog_cookieless",Sk=[V0,Co,"__cmpns",Ao,"$session_recording_enabled_server_side",np,Cc,Ys,ip,oi,ko,rp,Yr,To,sp,Ac,ap,op,lp,cp,Tc,kc];function Qy(t){return t instanceof Element&&(t.id===j0||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Gc(t){return!!t&&t.nodeType===1}function tr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function q0(t){return!!t&&t.nodeType===3}function P0(t){return!!t&&t.nodeType===11}function Kp(t){return t?qc(t).split(/\s+/):[]}function Jy(t){var e=A?.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function Rc(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 Kp(e)}function G0(t){return ye(t)?null:qc(t).split(/(\s+)/).filter((e=>zo(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Io(t){var e="";return up(t)&&!K0(t)&&t.childNodes&&t.childNodes.length&&we(t.childNodes,(function(n){var i;q0(n)&&n.textContent&&(e+=(i=G0(n.textContent))!==null&&i!==void 0?i:"")})),qc(e)}function Y0(t){return N(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Qp=["a","button","form","input","select","textarea","label"];function Z0(t,e){if(N(e))return!0;var n,i=function(s){if(e.some((a=>s.matches(a))))return{v:!0}};for(var r of t)if(n=i(r))return n.v;return!1}function W0(t){var e=t.parentNode;return!(!e||!Gc(e))&&e}var xk=["next","previous","prev",">","<"],e0=10,t0=[".ph-no-rageclick",".ph-no-capture"];function Ek(t,e){if(!A||Jp(t))return!1;var n,i,r;if(Ji(e)?(n=!!e&&t0,i=void 0):(n=(r=e?.css_selector_ignorelist)!==null&&r!==void 0?r:t0,i=e?.content_ignorelist),n===!1)return!1;var{targetElementList:s}=X0(t,!1);return!(function(a,o){if(a===!1||N(a))return!1;var l;if(a===!0)l=xk;else{if(!Se(a))return!1;if(a.length>e0)return L.error("[PostHog] content_ignorelist array cannot exceed "+e0+" items. Use css_selector_ignorelist for more complex matching."),!1;l=a.map((c=>c.toLowerCase()))}return o.some((c=>{var{safeText:u,ariaLabel:f}=c;return l.some((h=>u.includes(h)||f.includes(h)))}))})(i,s.map((a=>{var o;return{safeText:Io(a).toLowerCase(),ariaLabel:((o=a.getAttribute("aria-label"))==null?void 0:o.toLowerCase().trim())||""}})))&&!Z0(s,n)}var Jp=t=>!t||tr(t,"html")||!Gc(t),X0=(t,e)=>{if(!A||Jp(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,i=[t],r=t;r.parentNode&&!tr(r,"body");)if(P0(r.parentNode))i.push(r.parentNode.host),r=r.parentNode.host;else{var s=W0(r);if(!s)break;if(e||Qp.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var a=A.getComputedStyle(s);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}i.push(s),r=s}return{parentIsUsefulElement:n,targetElementList:i}};function wk(t,e,n,i,r){var s,a,o,l;if(n===void 0&&(n=void 0),!A||Jp(t)||(s=n)!=null&&s.url_allowlist&&!Jy(n.url_allowlist)||(a=n)!=null&&a.url_ignorelist&&Jy(n.url_ignorelist))return!1;if((o=n)!=null&&o.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some((y=>e.type===y)))return!1}var{parentIsUsefulElement:u,targetElementList:f}=X0(t,i);if(!(function(y,_){var b=_?.element_allowlist;if(N(b))return!0;var d,g=function(v){if(b.some((S=>v.tagName.toLowerCase()===S)))return{v:!0}};for(var m of y)if(d=g(m))return d.v;return!1})(f,n)||!Z0(f,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var h=A.getComputedStyle(t);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var p=t.tagName.toLowerCase();switch(p){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&&(Qp.indexOf(p)>-1||t.getAttribute("contenteditable")==="true")}}function up(t){for(var e=t;e.parentNode&&!tr(e,"body");e=e.parentNode){var n=Rc(e);if(ie(n,"ph-sensitive")||ie(n,"ph-no-capture"))return!1}if(ie(Rc(t),"ph-include"))return!0;var i=t.type||"";if(tt(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";return!(tt(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 K0(t){return!!(tr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||tr(t,"select")||tr(t,"textarea")||t.getAttribute("contenteditable")==="true")}var Q0="(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})",Ck=new RegExp("^(?:"+Q0+")$"),Ak=new RegExp(Q0),J0="\\d{3}-?\\d{2}-?\\d{4}",kk=new RegExp("^("+J0+")$"),Tk=new RegExp("("+J0+")");function zo(t,e){return e===void 0&&(e=!0),!(ye(t)||tt(t)&&(t=qc(t),(e?Ck:Ak).test((t||"").replace(/[- ]/g,""))||(e?kk:Tk).test(t)))}function e_(t){var e=Io(t);return zo(e=(e+" "+t_(t)).trim())?e:""}function t_(t){var e="";return t&&t.childNodes&&t.childNodes.length&&we(t.childNodes,(function(n){var i;if(n&&((i=n.tagName)==null?void 0:i.toLowerCase())==="span")try{var r=Io(n);e=(e+" "+r).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+t_(n)).trim())}catch(s){L.error("[AutoCapture]",s)}})),e}function Rk(t){return(function(e){var n=e.map((i=>{var r,s,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class)for(var o of(i.attr_class.sort(),i.attr_class))a+="."+o.replace(/"/g,"");var l=B({},i.text?{text:i.text}:{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(s=i.nth_of_type)!==null&&s!==void 0?s:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),c={};return bc(l).sort(((u,f)=>{var[h]=u,[p]=f;return h.localeCompare(p)})).forEach((u=>{var[f,h]=u;return c[n0(f.toString())]=n0(h.toString())})),a+=":",a+=bc(c).map((u=>{var[f,h]=u;return f+'="'+h+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var i,r,s={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:Ok(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return bc(n).filter((a=>{var[o]=a;return o.indexOf("attr__")===0})).forEach((a=>{var[o,l]=a;return s.attributes[o]=l})),s}))})(t))}function n0(t){return t.replace(/"|\\"/g,'\\"')}function Ok(t){var e=t.attr__class;return e?Se(e)?e:Kp(e):void 0}var Oc=class{constructor(e){this.disabled=e===!1;var n=st(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}},Tf="$copy_autocapture",ci=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var Mc=t=>{var e=D?.createElement("a");return N(e)?null:(e.href=t,e)},Mk=function(t,e){var n,i;e===void 0&&(e="&");var r=[];return we(t,(function(s,a){N(s)||N(a)||a==="undefined"||(n=encodeURIComponent((o=>o instanceof File)(s)?s.name:s.toString()),i=encodeURIComponent(a),r[r.length]=i+"="+n)})),r.join(e)},Nc=function(t,e){for(var n,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var s=i[r].split("=");if(s[0]===e){n=s;break}}if(!Se(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{L.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Fo=function(t,e,n){if(!t||!e||!e.length)return t;for(var i=t.split("#"),r=i[0]||"",s=i[1],a=r.split("?"),o=a[1],l=a[0],c=(o||"").split("&"),u=[],f=0;f<c.length;f++){var h=c[f].split("=");Se(h)&&(e.includes(h[0])?u.push(h[0]+"="+n):u.push(c[f]))}var p=l;return o!=null&&(p+="?"+u.join("&")),s!=null&&(p+="#"+s),p},Dc=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},i0=nt("[AutoCapture]");function Rf(t,e){return e.length>t?e.slice(0,t)+"...":e}function Nk(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Gc(e));return e}function Dk(t,e,n,i){var r=t.tagName.toLowerCase(),s={tag_name:r};Qp.indexOf(r)>-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?s.$el_text=Rf(1024,e_(t)):s.$el_text=Rf(1024,Io(t)));var a=Rc(t);a.length>0&&(s.classes=a.filter((function(u){return u!==""}))),we(t.attributes,(function(u){var f;if((!K0(t)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(i==null||!i.includes(u.name))&&!e&&zo(u.value)&&(f=u.name,!tt(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var h=u.value;u.name==="class"&&(h=Kp(h).join(" ")),s["attr__"+u.name]=Rf(1024,h)}}));for(var o=1,l=1,c=t;c=Nk(c);)o++,c.tagName===t.tagName&&l++;return s.nth_child=o,s.nth_of_type=l,s}function Lk(t,e){for(var n,i,{e:r,maskAllElementAttributes:s,maskAllText:a,elementAttributeIgnoreList:o,elementsChainAsString:l}=e,c=[t],u=t;u.parentNode&&!tr(u,"body");)P0(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var f,h=[],p={},y=!1,_=!1;if(we(c,(v=>{var S=up(v);v.tagName.toLowerCase()==="a"&&(y=v.getAttribute("href"),y=S&&y&&zo(y)&&y),ie(Rc(v),"ph-no-capture")&&(_=!0),h.push(Dk(v,s,a,o));var w=(function(E){if(!up(E))return{};var C={};return we(E.attributes,(function(R){if(R.name&&R.name.indexOf("data-ph-capture-attribute")===0){var T=R.name.replace("data-ph-capture-attribute-",""),I=R.value;T&&I&&zo(I)&&(C[T]=I)}})),C})(v);Pe(p,w)})),_)return{props:{},explicitNoCapture:_};if(a||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=e_(t):h[0].$el_text=Io(t)),y){var b,d;h[0].attr__href=y;var g=(b=Mc(y))==null?void 0:b.host,m=A==null||(d=A.location)==null?void 0:d.host;g&&m&&g!==m&&(f=y)}return{props:Pe({$event_type:r.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:Rk(h)},(n=h[0])!=null&&n.$el_text?{$el_text:(i=h[0])==null?void 0:i.$el_text}:{},f&&r.type==="click"?{$external_click_url:f}:{},p)}}var dp=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new Oc(e.config.rageclick),this.I=null}get F(){var e,n,i=st(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(A&&D){var e=i=>{i=i||A?.event;try{this.M(i)}catch(r){i0.error("Failed to capture event",r)}};if(We(D,"submit",e,{capture:!0}),We(D,"change",e,{capture:!0}),We(D,"click",e,{capture:!0}),this.F.capture_copied_text){var n=i=>{i=i||A?.event,this.M(i,Tf)};We(D,"copy",n,{capture:!0}),We(D,"cut",n,{capture:!0})}}}else i0.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({[Yy]:!!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 s=D?.querySelectorAll(r);s?.forEach((a=>{e===a&&i.push(r)}))})),i}get isEnabled(){var e,n,i=(e=this.instance.persistence)==null?void 0:e.props[Yy],r=this.T;if(ui(r)&&!Ji(i)&&!this.instance.O())return!1;var s=(n=this.T)!==null&&n!==void 0?n:!!i;return!!this.instance.config.autocapture&&!s}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var i,r=Y0(e);q0(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())&&Ek(r,this.instance.config.rageclick)&&this.M(e,"$rageclick");var s=n===Tf;if(r&&wk(r,e,this.F,s,s?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=Lk(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(o)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),n===Tf){var c,u=G0(A==null||(c=A.getSelection())==null?void 0:c.toString()),f=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=f}return this.instance.capture(n,a),!0}}}isBrowserSupported(){return Qi(D?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Un(t)&&isFinite(t)&&Math.floor(t)===t});var r0="0123456789abcdef",fp=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 s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|n>>>8,s[7]=n,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new t(s)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+r0.charAt(this.bytes[n]>>>4)+r0.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}},pp=class{constructor(){this.A=0,this.D=0,this.j=new hp}generate(){var e=this.generateOrAbort();if(N(e)){this.A=0;var n=this.generateOrAbort();if(N(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 fp.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())}},s0,n_=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};A&&!N(A.crypto)&&crypto.getRandomValues&&(n_=t=>crypto.getRandomValues(t));var hp=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(n_(this.N),this.U=0),this.N[this.U++]}},Ki=()=>zk().toString(),zk=()=>(s0||(s0=new pp)).generate(),vo="",Bk=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Hk(t,e){if(e){var n=(function(r,s){if(s===void 0&&(s=D),vo)return vo;if(!s||["localhost","127.0.0.1"].includes(r))return"";for(var a=r.split("."),o=Math.min(a.length,8),l="dmn_chk_"+Ki();!vo&&o--;){var c=a.slice(o).join("."),u=l+"=1;domain=."+c+";path=/";s.cookie=u+";max-age=3",s.cookie.includes(l)&&(s.cookie=u+";max-age=0",vo=c)}return vo})(t);if(!n){var i=(r=>{var s=r.match(Bk);return s?s[0]:""})(t);i!==n&&L.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}var Hn={H:()=>!!D,B:function(t){L.error("cookieStore error: "+t)},q:function(t){if(D){try{for(var e=t+"=",n=D.cookie.split(";").filter((s=>s.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(Hn.q(t))||{}}catch{}return e},G:function(t,e,n,i,r){if(D)try{var s="",a="",o=Hk(D.location.hostname,i);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),s="; expires="+l.toUTCString()}r&&(a="; secure");var c=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+o+a;return c.length>3686.4&&L.warn("cookieStore warning: large cookie, len="+c.length),D.cookie=c,c}catch{return}},V:function(t,e){if(D!=null&&D.cookie)try{Hn.G(t,"",-1,e)}catch{return}}},Of=null,Be={H:function(){if(!ui(Of))return Of;var t=!0;if(N(A))t=!1;else try{var e="__mplssupport__";Be.G(e,"xyz"),Be.q(e)!=='"xyz"'&&(t=!1),Be.V(e)}catch{t=!1}return t||L.error("localStorage unsupported; falling back to cookie store"),Of=t,t},B:function(t){L.error("localStorage error: "+t)},q:function(t){try{return A?.localStorage.getItem(t)}catch(e){Be.B(e)}return null},W:function(t){try{return JSON.parse(Be.q(t))||{}}catch{}return null},G:function(t,e){try{A?.localStorage.setItem(t,JSON.stringify(e))}catch(n){Be.B(n)}},V:function(t){try{A?.localStorage.removeItem(t)}catch(e){Be.B(e)}}},Uk=["distinct_id",Cc,F0,Tc,kc],gc=B({},Be,{W:function(t){try{var e={};try{e=Hn.W(t)||{}}catch{}var n=Pe(e,JSON.parse(Be.q(t)||"{}"));return Be.G(t,n),n}catch{}return null},G:function(t,e,n,i,r,s){try{Be.G(t,e,void 0,void 0,s);var a={};Uk.forEach((o=>{e[o]&&(a[o]=e[o])})),Object.keys(a).length&&Hn.G(t,a,n,i,r,s)}catch(o){Be.B(o)}},V:function(t,e){try{A?.localStorage.removeItem(t),Hn.V(t,e)}catch(n){Be.B(n)}}}),mc={},$k={H:function(){return!0},B:function(t){L.error("memoryStorage error: "+t)},q:function(t){return mc[t]||null},W:function(t){return mc[t]||null},G:function(t,e){mc[t]=e},V:function(t){delete mc[t]}},Pr=null,ut={H:function(){if(!ui(Pr))return Pr;if(Pr=!0,N(A))Pr=!1;else try{var t="__support__";ut.G(t,"xyz"),ut.q(t)!=='"xyz"'&&(Pr=!1),ut.V(t)}catch{Pr=!1}return Pr},B:function(t){L.error("sessionStorage error: ",t)},q:function(t){try{return A?.sessionStorage.getItem(t)}catch(e){ut.B(e)}return null},W:function(t){try{return JSON.parse(ut.q(t))||null}catch{}return null},G:function(t,e){try{A?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){ut.B(n)}},V:function(t){try{A?.sessionStorage.removeItem(t)}catch(e){ut.B(e)}}},li=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),gp=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?li.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===li.DENIED||this.consent===li.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===li.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 Cf(e)?li.GRANTED:ie(ik,e)?li.DENIED:li.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Be:Hn;var n=e==="localStorage"?Hn:Be;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Cf(n.q(this.X))),n.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!$0([Pt?.doNotTrack,Pt?.msDoNotTrack,Z.doNotTrack],(e=>Cf(e)))}},vc=nt("[Dead Clicks]"),Vk=()=>!0,Ik=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(I0)),i=t.instance.config.capture_dead_clicks;return Ji(i)?i:!!st(i)||n},Lc=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({[I0]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var n,i;(n=Z.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(i=Z.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(r=>{r?vc.error("failed to load script",r):e()}))}et(){var e;if(D){if(!this.tt&&(e=Z.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=st(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=Z.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(D),vc.info("starting...")}}else vc.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,vc.info("stopping..."))}},yo=nt("[ExceptionAutocapture]"),mp=class{constructor(e){var n,i,r;this.rt=()=>{var s;if(A&&this.isEnabled&&(s=Z.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var a=Z.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=Z.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=Z.__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=o(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){yo.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((n=this._instance.persistence)==null||!n.props[Zy]),this.F=this.ht(),this.vt=new Pf({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:yo}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return st(e)?n=B({},n,e):(N(e)?this.ut:e)&&(n=B({},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&&(yo.info("enabled"),this.it(this.rt))}it(e){var n,i;(n=Z.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(i=Z.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return yo.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({[Zy]: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)?yo.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}};function a0(t,e,n){try{if(!(e in t))return()=>{};var i=t[e],r=n(i);return Qi(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=r,()=>{t[e]=i}}catch{return()=>{}}}var vp=class{constructor(e){var n;this._instance=e,this.dt=(A==null||(n=A.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(L.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,L.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(A&&A.history){var i=this;(e=A.history.pushState)!=null&&e.__posthog_wrapped__||a0(A.history,"pushState",(r=>function(s,a,o){r.call(this,s,a,o),i.ft("pushState")})),(n=A.history.replaceState)!=null&&n.__posthog_wrapped__||a0(A.history,"replaceState",(r=>function(s,a,o){r.call(this,s,a,o),i.ft("replaceState")})),this.gt()}}ft(e){try{var n,i=A==null||(n=A.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){L.error("Error capturing "+e+" pageview",r)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};We(A,"popstate",e),this.ct=()=>{A&&A.removeEventListener("popstate",e)}}}},Mf=nt("[SegmentIntegration]");function Fk(t,e){var n=t.config.segment;if(!n)return e();(function(i,r){var s=i.config.segment;if(!s)return r();var a=l=>{var c=()=>l.anonymousId()||Ki();i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(oi,"identified")),r()},o=s.user();"then"in o&&Qi(o.then)?o.then((l=>a(l))):a(o)})(t,(()=>{n.register((i=>{Promise&&Promise.resolve||Mf.warn("This browser does not have Promise support, and can not use the segment integration");var r=(s,a)=>{if(!a)return s;s.event.userId||s.event.anonymousId===i.get_distinct_id()||(Mf.info("No userId set, resetting PostHog"),i.reset()),s.event.userId&&s.event.userId!==i.get_distinct_id()&&(Mf.info("UserId set, identifying with PostHog"),i.identify(s.event.userId));var o=i.calculateEventProperties(a,s.event.properties);return s.event.properties=Object.assign({},o,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:s=>r(s,s.event.event),page:s=>r(s,"$pageview"),identify:s=>r(s,"$identify"),screen:s=>r(s,"$screen")}})(t)).then((()=>{e()}))}))}var i_="posthog-js";function r_(t,e){var{organization:n,projectId:i,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return o=>{var l,c,u,f,h;if(!(s==="*"||s.includes(o.level))||!t.__loaded)return o;o.tags||(o.tags={});var p=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());o.tags["PostHog Person URL"]=p,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var y=((l=o.exception)==null?void 0:l.values)||[],_=y.map((d=>B({},d,{stacktrace:d.stacktrace?B({},d.stacktrace,{type:"raw",frames:(d.stacktrace.frames||[]).map((g=>B({},g,{platform:"web:javascript"})))}):void 0}))),b={$exception_message:((c=y[0])==null?void 0:c.value)||o.message,$exception_type:(u=y[0])==null?void 0:u.type,$exception_level:o.level,$exception_list:_,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((f=y[0])==null?void 0:f.value)||o.message,$sentry_exception_type:(h=y[0])==null?void 0:h.type,$sentry_tags:o.tags};return n&&i&&(b.$sentry_url=(r||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+o.event_id),a&&t.exceptions.sendExceptionEvent(b),o}}var yp=class{constructor(e,n,i,r,s,a){this.name=i_,this.setupOnce=function(o){o(r_(e,{organization:n,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:a==null||a}))}}},jk=A!=null&&A.location?Dc(A.location.hash,"__posthog")||Dc(location.hash,"state"):null,o0="_postHogToolbarParams",l0=nt("[Toolbar]"),Xi=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(Xi||{}),_p=class{constructor(e){this.instance=e}_t(e){Z.ph_toolbar_state=e}yt(){var e;return(e=Z.ph_toolbar_state)!==null&&e!==void 0?e:Xi.UNINITIALIZED}maybeLoadToolbar(e,n,i){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),!A||!D)return!1;e=e??A.location,i=i??A.history;try{if(!n){try{A.localStorage.setItem("test","test"),A.localStorage.removeItem("test")}catch{return!1}n=A?.localStorage}var r,s=jk||Dc(e.hash,"__posthog")||Dc(e.hash,"state"),a=s?Gy((()=>JSON.parse(atob(decodeURIComponent(s)))))||Gy((()=>JSON.parse(decodeURIComponent(s)))):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(o0)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}bt(e){var n=Z.ph_load_toolbar||Z.ph_load_editor;!ye(n)&&Qi(n)?n(e,this.instance):l0.warn("No toolbar load function found")}loadToolbar(e){var n=!(D==null||!D.getElementById(j0));if(!A||n)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=B({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(A.localStorage.setItem(o0,JSON.stringify(B({},r,{source:void 0}))),this.yt()===Xi.LOADED)this.bt(r);else if(this.yt()===Xi.UNINITIALIZED){var s;this._t(Xi.LOADING),(s=Z.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(a=>{if(a)return l0.error("[Toolbar] Failed to load",a),void this._t(Xi.UNINITIALIZED);this._t(Xi.LOADED),this.bt(r)})),We(A,"turbolinks:load",(()=>{this._t(Xi.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)}},qk=nt("[TracingHeaders]"),bp=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var n,i;N(this.xt)&&((n=Z.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),N(this.St)&&((i=Z.__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=Z.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(i=Z.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return qk.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)}},on="Mobile",zc="iOS",Bn="Android",Bo="Tablet",s_=Bn+" "+Bo,a_="iPad",o_="Apple",l_=o_+" Watch",Ho="Safari",Ks="BlackBerry",c_="Samsung",u_=c_+"Browser",d_=c_+" Internet",Zr="Chrome",Pk=Zr+" OS",f_=Zr+" "+zc,eh="Internet Explorer",p_=eh+" "+on,th="Opera",Gk=th+" Mini",nh="Edge",h_="Microsoft "+nh,Zs="Firefox",g_=Zs+" "+zc,Uo="Nintendo",$o="PlayStation",Ws="Xbox",m_=Bn+" "+on,v_=on+" "+Ho,Ro="Windows",Sp=Ro+" Phone",c0="Nokia",xp="Ouya",y_="Generic",Yk=y_+" "+on.toLowerCase(),__=y_+" "+Bo.toLowerCase(),Ep="Konqueror",wt="(\\d+(\\.\\d+)?)",Nf=new RegExp("Version/"+wt),Zk=new RegExp(Ws,"i"),Wk=new RegExp($o+" \\w+","i"),Xk=new RegExp(Uo+" \\w+","i"),ih=new RegExp(Ks+"|PlayBook|BB10","i"),Kk={"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"},Qk=(t,e)=>e&&ie(e,o_)||(function(n){return ie(n,Ho)&&!ie(n,Zr)&&!ie(n,Bn)})(t),b_=function(t,e){return e=e||"",ie(t," OPR/")&&ie(t,"Mini")?Gk:ie(t," OPR/")?th:ih.test(t)?Ks:ie(t,"IE"+on)||ie(t,"WPDesktop")?p_:ie(t,u_)?d_:ie(t,nh)||ie(t,"Edg/")?h_:ie(t,"FBIOS")?"Facebook "+on:ie(t,"UCWEB")||ie(t,"UCBrowser")?"UC Browser":ie(t,"CriOS")?f_:ie(t,"CrMo")||ie(t,Zr)?Zr:ie(t,Bn)&&ie(t,Ho)?m_:ie(t,"FxiOS")?g_:ie(t.toLowerCase(),Ep.toLowerCase())?Ep:Qk(t,e)?ie(t,on)?v_:Ho:ie(t,Zs)?Zs:ie(t,"MSIE")||ie(t,"Trident/")?eh:ie(t,"Gecko")?Zs:""},Jk={[p_]:[new RegExp("rv:"+wt)],[h_]:[new RegExp(nh+"?\\/"+wt)],[Zr]:[new RegExp("("+Zr+"|CrMo)\\/"+wt)],[f_]:[new RegExp("CriOS\\/"+wt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+wt)],[Ho]:[Nf],[v_]:[Nf],[th]:[new RegExp("(Opera|OPR)\\/"+wt)],[Zs]:[new RegExp(Zs+"\\/"+wt)],[g_]:[new RegExp("FxiOS\\/"+wt)],[Ep]:[new RegExp("Konqueror[:/]?"+wt,"i")],[Ks]:[new RegExp(Ks+" "+wt),Nf],[m_]:[new RegExp("android\\s"+wt,"i")],[d_]:[new RegExp(u_+"\\/"+wt)],[eh]:[new RegExp("(rv:|MSIE )"+wt)],Mozilla:[new RegExp("rv:"+wt)]},eT=function(t,e){var n=b_(t,e),i=Jk[n];if(N(i))return null;for(var r=0;r<i.length;r++){var s=i[r],a=t.match(s);if(a)return parseFloat(a[a.length-2])}return null},u0=[[new RegExp(Ws+"; "+Ws+" (.*?)[);]","i"),t=>[Ws,t&&t[1]||""]],[new RegExp(Uo,"i"),[Uo,""]],[new RegExp($o,"i"),[$o,""]],[ih,[Ks,""]],[new RegExp(Ro,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Sp,""];if(new RegExp(on).test(e)&&!/IEMobile\b/.test(e))return[Ro+" "+on,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var i=n[1],r=Kk[i]||"";return/arm/i.test(e)&&(r="RT"),[Ro,r]}return[Ro,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[zc,e.join(".")]}return[zc,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=N(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Bn+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Bn+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Bn,e.join(".")]}return[Bn,""]}],[/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/,[Pk,""]],[/Linux|debian/i,["Linux",""]]],d0=function(t){return Xk.test(t)?Uo:Wk.test(t)?$o:Zk.test(t)?Ws:new RegExp(xp,"i").test(t)?xp:new RegExp("("+Sp+"|WPDesktop)","i").test(t)?Sp:/iPad/.test(t)?a_:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?l_:ih.test(t)?Ks:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(c0,"i").test(t)?c0:/(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(on).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)?Bn:s_:Bn:new RegExp("(pda|"+on+")","i").test(t)?Yk:new RegExp(Bo,"i").test(t)&&!new RegExp(Bo+" pc","i").test(t)?__:""},yc="https?://(.*)",ea=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],tT=Js(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ea),jo="<masked>",nT=["li_fat_id"];function S_(t,e,n){if(!D)return{};var i,r=e?Js([],ea,n||[]):[],s=x_(Fo(D.URL,r,jo),t),a=(i={},we(nT,(function(o){var l=Hn.q(o);i[o]=l||null})),i);return Pe(a,s)}function x_(t,e){var n=tT.concat(e||[]),i={};return we(n,(function(r){var s=Nc(t,r);i[r]=s||null})),i}function E_(t){var e=(function(s){return s?s.search(yc+"google.([^/?]*)")===0?"google":s.search(yc+"bing.com")===0?"bing":s.search(yc+"yahoo.com")===0?"yahoo":s.search(yc+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",i={};if(!ui(e)){i.$search_engine=e;var r=D?Nc(D.referrer,n):"";r.length&&(i.ph_keyword=r)}return i}function f0(){return navigator.language||navigator.userLanguage}function w_(){return D?.referrer||"$direct"}function C_(t,e){var n=t?Js([],ea,e||[]):[],i=Nt?.href.substring(0,1e3);return{r:w_().substring(0,1e3),u:i?Fo(i,n,jo):void 0}}function A_(t){var e,{r:n,u:i}=t,r={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=Mc(n))==null?void 0:e.host};if(i){r.$current_url=i;var s=Mc(i);r.$host=s?.host,r.$pathname=s?.pathname;var a=x_(i);Pe(r,a)}if(n){var o=E_(n);Pe(r,o)}return r}function k_(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function iT(){try{return new Date().getTimezoneOffset()}catch{return}}function rT(t,e){if(!Mt)return{};var n,i,r,s=t?Js([],ea,e||[]):[],[a,o]=(function(l){for(var c=0;c<u0.length;c++){var[u,f]=u0[c],h=u.exec(l),p=h&&(Qi(f)?f(h,l):f);if(p)return p}return["",""]})(Mt);return Pe(Xp({$os:a,$os_version:o,$browser:b_(Mt,navigator.vendor),$device:d0(Mt),$device_type:(i=Mt,r=d0(i),r===a_||r===s_||r==="Kobo"||r==="Kindle Fire"||r===__?Bo:r===Uo||r===Ws||r===$o||r===xp?"Console":r===l_?"Wearable":r?on:"Desktop"),$timezone:k_(),$timezone_offset:iT()}),{$current_url:Fo(Nt?.href,s,jo),$host:Nt?.host,$pathname:Nt?.pathname,$raw_user_agent:Mt.length>1e3?Mt.substring(0,997)+"...":Mt,$browser_version:eT(Mt,navigator.vendor),$browser_language:f0(),$browser_language_prefix:(n=f0(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:A?.screen.height,$screen_width:A?.screen.width,$viewport_height:A?.innerHeight,$viewport_width:A?.innerWidth,$lib:"web",$lib_version:ai.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Yi=nt("[Web Vitals]"),p0=9e5,wp=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)=>B({},i,{["$web_vitals_"+r.name+"_event"]:B({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=i=>{var r,s=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(N(s))Yi.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Tt();N(a)||(ye(i?.name)||ye(i?.value)?Yi.error("Invalid metric received",i):this.Rt&&i.value>=this.Rt?Yi.error("Ignoring metric with value >= "+this.Rt,i):(this.N.url!==a&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),N(this.N.url)&&(this.N.url=a),this.N.firstMetricTimestamp=N(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.N.metrics.push(B({},i,{$current_url:a,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var i,r,s,a,o=Z.__PosthogExtensions__;N(o)||N(o.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:r,onFCP:s,onINP:a}=o.postHogWebVitalsCallbacks),i&&r&&s&&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&&s(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Pt.bind(this)),this.P=!0):Yi.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((n=this._instance.persistence)==null||!n.props[Xy]),this.startIfEnabled()}get allowedMetrics(){var e,n,i=st(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return N(i)?((n=this._instance.persistence)==null?void 0:n.props[Ky])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(st(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=st(this._instance.config.capture_performance)&&Un(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:p0;return 0<e&&e<=6e4?p0:e}get isEnabled(){var e=Nt?.protocol;if(e!=="http:"&&e!=="https:")return Yi.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=st(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Ji(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Ji(n)?n:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(Yi.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=st(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=st(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Xy]:n}),this._instance.persistence.register({[Ky]:i})),this.Et=n,this.startIfEnabled()}it(e){var n,i;(n=Z.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(i=Z.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",(r=>{r?Yi.error("failed to load script",r):e()}))}Tt(){var e=A?A.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?Js([],ea,i||[]):[];return Fo(e,r,jo)}Yi.error("Could not determine current URL")}},sT=nt("[Heatmaps]");function h0(t){return st(t)&&"clientX"in t&&"clientY"in t&&Un(t.clientX)&&Un(t.clientY)}var Cp=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[np]),this.rageclicks=new Oc(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return st(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 N(this.instance.config.capture_heatmaps)?N(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;sT.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({[np]: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"})(D)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){A&&D&&(this.jt=this.Dt.bind(this),We(A,"beforeunload",this.jt),this.Lt=e=>this.At(e||A?.event),We(D,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||A?.event),We(D,"mousemove",this.Nt,{capture:!0}),this.zt=new Lc(this.instance,Vk,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),We(D,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;A&&D&&(this.jt&&A.removeEventListener("beforeunload",this.jt),this.Lt&&D.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&D.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&D.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(),s=this.instance.scrollManager.scrollElement(),a=(function(o,l,c){for(var u=o;u&&Gc(u)&&!tr(u,"body");){if(u===c)return!1;if(ie(l,A?.getComputedStyle(u).position))return!0;u=W0(u)}return!1})(Y0(e),["fixed","sticky"],s);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"),!Qy(e.target)&&h0(e)){var r=this.qt(e,n);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(B({},r,{type:"rageclick"})),this.Wt(r)}}Ut(e){!Qy(e.target)&&h0(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(A){var n=A.location.href,i=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,s=i?Js([],ea,r||[]):[],a=Fo(n,s,jo);this.N=this.N||{},this.N[a]||(this.N[a]=[]),this.N[a].push(e)}}Dt(){this.N&&!Gs(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},Ap=class{constructor(e){this._instance=e}doPageView(e,n){var i,r=this.Gt(e,n);return this.Vt={pathname:(i=A?.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},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:f}=s;if(!(N(a)||N(o)||N(l)||N(c)||N(u)||N(f))){a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),f=Math.ceil(f);var h=a<=1?1:zn(o/a,0,1,L),p=a<=1?1:zn(l/a,0,1,L),y=c<=1?1:zn(u/c,0,1,L),_=c<=1?1:zn(f/c,0,1,L);r=Pe(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:y,$prev_pageview_max_content:f,$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}},ln=Uint8Array,Ct=Uint16Array,Qs=Uint32Array,rh=new ln([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),sh=new ln([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),g0=new ln([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),T_=function(t,e){for(var n=new Ct(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new Qs(n[30]);for(i=1;i<30;++i)for(var s=n[i];s<n[i+1];++s)r[s]=s-n[i]<<5|i;return[n,r]},R_=T_(rh,2),aT=R_[0],kp=R_[1];aT[28]=258,kp[258]=28;for(Tp=T_(sh,0)[1],Bc=new Ct(32768),Ce=0;Ce<32768;++Ce)Zi=(43690&Ce)>>>1|(21845&Ce)<<1,Zi=(61680&(Zi=(52428&Zi)>>>2|(13107&Zi)<<2))>>>4|(3855&Zi)<<4,Bc[Ce]=((65280&Zi)>>>8|(255&Zi)<<8)>>>1;var Zi,Tp,Bc,Ce,No=function(t,e,n){for(var i=t.length,r=0,s=new Ct(e);r<i;++r)++s[t[r]-1];var a,o=new Ct(e);for(r=0;r<e;++r)o[r]=o[r-1]+s[r-1]<<1;if(n){a=new Ct(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],u=e-t[r],f=o[t[r]-1]++<<u,h=f|(1<<u)-1;f<=h;++f)a[Bc[f]>>>l]=c}else for(a=new Ct(i),r=0;r<i;++r)a[r]=Bc[o[t[r]-1]++]>>>15-t[r];return a},Wr=new ln(288);for(Ce=0;Ce<144;++Ce)Wr[Ce]=8;for(Ce=144;Ce<256;++Ce)Wr[Ce]=9;for(Ce=256;Ce<280;++Ce)Wr[Ce]=7;for(Ce=280;Ce<288;++Ce)Wr[Ce]=8;var Hc=new ln(32);for(Ce=0;Ce<32;++Ce)Hc[Ce]=5;var oT=No(Wr,9,0),lT=No(Hc,5,0),O_=function(t){return(t/8>>0)+(7&t&&1)},M_=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var i=new(t instanceof Ct?Ct:t instanceof Qs?Qs:ln)(n-e);return i.set(t.subarray(e,n)),i},si=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8},_o=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},Df=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,s=n.slice();if(!r)return[new ln(0),0];if(r==1){var a=new ln(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(S,w){return S.f-w.f})),n.push({s:-1,f:25001});var o=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=r-1;)o=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:o.f+l.f,l:o,r:l};var h=s[0].s;for(i=1;i<r;++i)s[i].s>h&&(h=s[i].s);var p=new Ct(h+1),y=Rp(n[u-1],p,0);if(y>e){i=0;var _=0,b=y-e,d=1<<b;for(s.sort((function(S,w){return p[w.s]-p[S.s]||S.f-w.f}));i<r;++i){var g=s[i].s;if(!(p[g]>e))break;_+=d-(1<<y-p[g]),p[g]=e}for(_>>>=b;_>0;){var m=s[i].s;p[m]<e?_-=1<<e-p[m]++-1:++i}for(;i>=0&&_;--i){var v=s[i].s;p[v]==e&&(--p[v],++_)}y=e}return[new ln(p),y]},Rp=function(t,e,n){return t.s==-1?Math.max(Rp(t.l,e,n+1),Rp(t.r,e,n+1)):e[t.s]=n},m0=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Ct(++e),i=0,r=t[0],s=1,a=function(l){n[i++]=l},o=1;o<=e;++o)if(t[o]==r&&o!=e)++s;else{if(!r&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(r),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(r);s=1,r=t[o]}return[n.subarray(0,i),e]},bo=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},Op=function(t,e,n){var i=n.length,r=O_(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 s=0;s<i;++s)t[r+s+4]=n[s];return 8*(r+4+i)},v0=function(t,e,n,i,r,s,a,o,l,c,u){si(e,u++,n),++r[256];for(var f=Df(r,15),h=f[0],p=f[1],y=Df(s,15),_=y[0],b=y[1],d=m0(h),g=d[0],m=d[1],v=m0(_),S=v[0],w=v[1],E=new Ct(19),C=0;C<g.length;++C)E[31&g[C]]++;for(C=0;C<S.length;++C)E[31&S[C]]++;for(var R=Df(E,7),T=R[0],I=R[1],G=19;G>4&&!T[g0[G-1]];--G);var K,q,he,U,Q=c+5<<3,H=bo(r,Wr)+bo(s,Hc)+a,W=bo(r,h)+bo(s,_)+a+14+3*G+bo(E,T)+(2*E[16]+3*E[17]+7*E[18]);if(Q<=H&&Q<=W)return Op(e,u,t.subarray(l,l+c));if(si(e,u,1+(W<H)),u+=2,W<H){K=No(h,p,0),q=h,he=No(_,b,0),U=_;var Ot=No(T,I,0);for(si(e,u,m-257),si(e,u+5,w-1),si(e,u+10,G-4),u+=14,C=0;C<G;++C)si(e,u+3*C,T[g0[C]]);u+=3*G;for(var ri=[g,S],ct=0;ct<2;++ct){var an=ri[ct];for(C=0;C<an.length;++C){var qt=31&an[C];si(e,u,Ot[qt]),u+=T[qt],qt>15&&(si(e,u,an[C]>>>5&127),u+=an[C]>>>12)}}}else K=oT,q=Wr,he=lT,U=Hc;for(C=0;C<o;++C)if(i[C]>255){qt=i[C]>>>18&31,_o(e,u,K[qt+257]),u+=q[qt+257],qt>7&&(si(e,u,i[C]>>>23&31),u+=rh[qt]);var Fs=31&i[C];_o(e,u,he[Fs]),u+=U[Fs],Fs>3&&(_o(e,u,i[C]>>>5&8191),u+=sh[Fs])}else _o(e,u,K[i[C]]),u+=q[i[C]];return _o(e,u,K[256]),u+q[256]},cT=new Qs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),uT=(function(){for(var t=new Qs(256),e=0;e<256;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),dT=function(t,e,n,i,r){return(function(s,a,o,l,c,u){var f=s.length,h=new ln(l+f+5*(1+Math.floor(f/7e3))+c),p=h.subarray(l,h.length-c),y=0;if(!a||f<8)for(var _=0;_<=f;_+=65535){var b=_+65535;b<f?y=Op(p,y,s.subarray(_,b)):(p[_]=u,y=Op(p,y,s.subarray(_,f)))}else{for(var d=cT[a-1],g=d>>>13,m=8191&d,v=(1<<o)-1,S=new Ct(32768),w=new Ct(v+1),E=Math.ceil(o/3),C=2*E,R=function(wf){return(s[wf]^s[wf+1]<<E^s[wf+2]<<C)&v},T=new Qs(25e3),I=new Ct(288),G=new Ct(32),K=0,q=0,he=(_=0,0),U=0,Q=0;_<f;++_){var H=R(_),W=32767&_,Ot=w[H];if(S[W]=Ot,w[H]=W,U<=_){var ri=f-_;if((K>7e3||he>24576)&&ri>423){y=v0(s,p,0,T,I,G,q,he,Q,_-Q,y),he=K=q=0,Q=_;for(var ct=0;ct<286;++ct)I[ct]=0;for(ct=0;ct<30;++ct)G[ct]=0}var an=2,qt=0,Fs=m,qi=W-Ot&32767;if(ri>2&&H==R(_-qi))for(var $A=Math.min(g,ri)-1,VA=Math.min(32767,_),IA=Math.min(258,ri);qi<=VA&&--Fs&&W!=Ot;){if(s[_+an]==s[_+an-qi]){for(var Pi=0;Pi<IA&&s[_+Pi]==s[_+Pi-qi];++Pi);if(Pi>an){if(an=Pi,qt=qi,Pi>$A)break;var FA=Math.min(qi,Pi-2),Oy=0;for(ct=0;ct<FA;++ct){var Ef=_-qi+ct+32768&32767,My=Ef-S[Ef]+32768&32767;My>Oy&&(Oy=My,Ot=Ef)}}}qi+=(W=Ot)-(Ot=S[W])+32768&32767}if(qt){T[he++]=268435456|kp[an]<<18|Tp[qt];var Ny=31&kp[an],Dy=31&Tp[qt];q+=rh[Ny]+sh[Dy],++I[257+Ny],++G[Dy],U=_+an,++K}else T[he++]=s[_],++I[s[_]]}}y=v0(s,p,u,T,I,G,q,he,Q,_-Q,y)}return M_(h,0,l+O_(y)+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)},Lf=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function fT(t,e){e===void 0&&(e={});var n=(function(){var o=4294967295;return{p:function(l){for(var c=o,u=0;u<l.length;++u)c=uT[255&c^l[u]]^c>>>8;o=c},d:function(){return 4294967295^o}}})(),i=t.length;n.p(t);var r,s=dT(t,e,10+((r=e).filename&&r.filename.length+1||0),8),a=s.length;return(function(o,l){var c=l.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=l.level<2?4:l.level==9?2:0,o[9]=3,l.mtime!=0&&Lf(o,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){o[3]=8;for(var u=0;u<=c.length;++u)o[u+10]=c.charCodeAt(u)}})(s,e),Lf(s,a-8,n.d()),Lf(s,a-4,i),s}var pT=function(t){var e,n,i,r,s="";for(e=n=0,i=(t=(t+"").replace(/\r\n/g,`
1
+ var Bk=Object.create;var Ja=Object.defineProperty;var Vk=Object.getOwnPropertyDescriptor;var zk=Object.getOwnPropertyNames;var Hk=Object.getPrototypeOf,jk=Object.prototype.hasOwnProperty;var qm=t=>{throw TypeError(t)};var Uk=(t,e,n)=>e in t?Ja(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Vn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Wk=(t,e)=>{for(var n in e)Ja(t,n,{get:e[n],enumerable:!0})},qk=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of zk(e))!jk.call(t,i)&&i!==n&&Ja(t,i,{get:()=>e[i],enumerable:!(r=Vk(e,i))||r.enumerable});return t};var ee=(t,e,n)=>(n=t!=null?Bk(Hk(t)):{},qk(e||!t||!t.__esModule?Ja(n,"default",{value:t,enumerable:!0}):n,t));var j=(t,e,n)=>Uk(t,typeof e!="symbol"?e+"":e,n),Km=(t,e,n)=>e.has(t)||qm("Cannot "+n);var xe=(t,e,n)=>(Km(t,e,"read from private field"),n?n.call(t):e.get(t)),yr=(t,e,n)=>e.has(t)?qm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),mn=(t,e,n,r)=>(Km(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);var H_=Vn(ne=>{"use strict";var Ks=Symbol.for("react.element"),kC=Symbol.for("react.portal"),EC=Symbol.for("react.fragment"),CC=Symbol.for("react.strict_mode"),AC=Symbol.for("react.profiler"),RC=Symbol.for("react.provider"),TC=Symbol.for("react.context"),PC=Symbol.for("react.forward_ref"),IC=Symbol.for("react.suspense"),OC=Symbol.for("react.memo"),NC=Symbol.for("react.lazy"),I_=Symbol.iterator;function LC(t){return t===null||typeof t!="object"?null:(t=I_&&t[I_]||t["@@iterator"],typeof t=="function"?t:null)}var L_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M_=Object.assign,F_={};function So(t,e,n){this.props=t,this.context=e,this.refs=F_,this.updater=n||L_}So.prototype.isReactComponent={};So.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): 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")};So.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function $_(){}$_.prototype=So.prototype;function ap(t,e,n){this.props=t,this.context=e,this.refs=F_,this.updater=n||L_}var lp=ap.prototype=new $_;lp.constructor=ap;M_(lp,So.prototype);lp.isPureReactComponent=!0;var O_=Array.isArray,D_=Object.prototype.hasOwnProperty,cp={current:null},B_={key:!0,ref:!0,__self:!0,__source:!0};function V_(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)D_.call(e,r)&&!B_.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Ks,type:t,key:o,ref:s,props:i,_owner:cp.current}}function MC(t,e){return{$$typeof:Ks,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function up(t){return typeof t=="object"&&t!==null&&t.$$typeof===Ks}function FC(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var N_=/\/+/g;function sp(t,e){return typeof t=="object"&&t!==null&&t.key!=null?FC(""+t.key):e.toString(36)}function Jl(t,e,n,r,i){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case Ks:case kC:s=!0}}if(s)return s=t,i=i(s),t=r===""?"."+sp(s,0):r,O_(i)?(n="",t!=null&&(n=t.replace(N_,"$&/")+"/"),Jl(i,e,n,"",function(c){return c})):i!=null&&(up(i)&&(i=MC(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(N_,"$&/")+"/")+t)),e.push(i)),1;if(s=0,r=r===""?".":r+":",O_(t))for(var a=0;a<t.length;a++){o=t[a];var l=r+sp(o,a);s+=Jl(o,e,n,l,i)}else if(l=LC(t),typeof l=="function")for(t=l.call(t),a=0;!(o=t.next()).done;)o=o.value,l=r+sp(o,a++),s+=Jl(o,e,n,l,i);else if(o==="object")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 s}function Ql(t,e,n){if(t==null)return t;var r=[],i=0;return Jl(t,r,"","",function(o){return e.call(n,o,i++)}),r}function $C(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 ft={current:null},ec={transition:null},DC={ReactCurrentDispatcher:ft,ReactCurrentBatchConfig:ec,ReactCurrentOwner:cp};function z_(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:Ql,forEach:function(t,e,n){Ql(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Ql(t,function(){e++}),e},toArray:function(t){return Ql(t,function(e){return e})||[]},only:function(t){if(!up(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ne.Component=So;ne.Fragment=EC;ne.Profiler=AC;ne.PureComponent=ap;ne.StrictMode=CC;ne.Suspense=IC;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=DC;ne.act=z_;ne.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=M_({},t.props),i=t.key,o=t.ref,s=t._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,s=cp.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)D_.call(e,l)&&!B_.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Ks,type:t.type,key:i,ref:o,props:r,_owner:s}};ne.createContext=function(t){return t={$$typeof:TC,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:RC,_context:t},t.Consumer=t};ne.createElement=V_;ne.createFactory=function(t){var e=V_.bind(null,t);return e.type=t,e};ne.createRef=function(){return{current:null}};ne.forwardRef=function(t){return{$$typeof:PC,render:t}};ne.isValidElement=up;ne.lazy=function(t){return{$$typeof:NC,_payload:{_status:-1,_result:t},_init:$C}};ne.memo=function(t,e){return{$$typeof:OC,type:t,compare:e===void 0?null:e}};ne.startTransition=function(t){var e=ec.transition;ec.transition={};try{t()}finally{ec.transition=e}};ne.unstable_act=z_;ne.useCallback=function(t,e){return ft.current.useCallback(t,e)};ne.useContext=function(t){return ft.current.useContext(t)};ne.useDebugValue=function(){};ne.useDeferredValue=function(t){return ft.current.useDeferredValue(t)};ne.useEffect=function(t,e){return ft.current.useEffect(t,e)};ne.useId=function(){return ft.current.useId()};ne.useImperativeHandle=function(t,e,n){return ft.current.useImperativeHandle(t,e,n)};ne.useInsertionEffect=function(t,e){return ft.current.useInsertionEffect(t,e)};ne.useLayoutEffect=function(t,e){return ft.current.useLayoutEffect(t,e)};ne.useMemo=function(t,e){return ft.current.useMemo(t,e)};ne.useReducer=function(t,e,n){return ft.current.useReducer(t,e,n)};ne.useRef=function(t){return ft.current.useRef(t)};ne.useState=function(t){return ft.current.useState(t)};ne.useSyncExternalStore=function(t,e,n){return ft.current.useSyncExternalStore(t,e,n)};ne.useTransition=function(){return ft.current.useTransition()};ne.version="18.3.1"});var wt=Vn((XO,j_)=>{"use strict";j_.exports=H_()});var q_=Vn(tc=>{"use strict";var jC=wt(),UC=Symbol.for("react.element"),WC=Symbol.for("react.fragment"),qC=Object.prototype.hasOwnProperty,KC=jC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,GC={key:!0,ref:!0,__self:!0,__source:!0};function W_(t,e,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)qC.call(e,r)&&!GC.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:UC,type:t,key:o,ref:s,props:i,_owner:KC.current}}tc.Fragment=WC;tc.jsx=W_;tc.jsxs=W_});var ye=Vn((hN,K_)=>{"use strict";K_.exports=q_()});var a0=Vn(ge=>{"use strict";function Ep(t,e){var n=t.length;t.push(e);e:for(;0<n;){var r=n-1>>>1,i=t[r];if(0<ic(i,e))t[r]=e,t[n]=i,n=r;else break e}}function on(t){return t.length===0?null:t[0]}function sc(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var r=0,i=t.length,o=i>>>1;r<o;){var s=2*(r+1)-1,a=t[s],l=s+1,c=t[l];if(0>ic(a,n))l<i&&0>ic(c,a)?(t[r]=c,t[l]=n,r=l):(t[r]=a,t[s]=n,r=s);else if(l<i&&0>ic(c,n))t[r]=c,t[l]=n,r=l;else break e}}return e}function ic(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}typeof performance=="object"&&typeof performance.now=="function"?(Q_=performance,ge.unstable_now=function(){return Q_.now()}):(Sp=Date,J_=Sp.now(),ge.unstable_now=function(){return Sp.now()-J_});var Q_,Sp,J_,kn=[],Ir=[],RA=1,Ut=null,rt=3,ac=!1,yi=!1,Xs=!1,n0=typeof setTimeout=="function"?setTimeout:null,r0=typeof clearTimeout=="function"?clearTimeout:null,e0=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Cp(t){for(var e=on(Ir);e!==null;){if(e.callback===null)sc(Ir);else if(e.startTime<=t)sc(Ir),e.sortIndex=e.expirationTime,Ep(kn,e);else break;e=on(Ir)}}function Ap(t){if(Xs=!1,Cp(t),!yi)if(on(kn)!==null)yi=!0,Tp(Rp);else{var e=on(Ir);e!==null&&Pp(Ap,e.startTime-t)}}function Rp(t,e){yi=!1,Xs&&(Xs=!1,r0(Qs),Qs=-1),ac=!0;var n=rt;try{for(Cp(e),Ut=on(kn);Ut!==null&&(!(Ut.expirationTime>e)||t&&!s0());){var r=Ut.callback;if(typeof r=="function"){Ut.callback=null,rt=Ut.priorityLevel;var i=r(Ut.expirationTime<=e);e=ge.unstable_now(),typeof i=="function"?Ut.callback=i:Ut===on(kn)&&sc(kn),Cp(e)}else sc(kn);Ut=on(kn)}if(Ut!==null)var o=!0;else{var s=on(Ir);s!==null&&Pp(Ap,s.startTime-e),o=!1}return o}finally{Ut=null,rt=n,ac=!1}}var lc=!1,oc=null,Qs=-1,i0=5,o0=-1;function s0(){return!(ge.unstable_now()-o0<i0)}function bp(){if(oc!==null){var t=ge.unstable_now();o0=t;var e=!0;try{e=oc(!0,t)}finally{e?Ys():(lc=!1,oc=null)}}else lc=!1}var Ys;typeof e0=="function"?Ys=function(){e0(bp)}:typeof MessageChannel<"u"?(kp=new MessageChannel,t0=kp.port2,kp.port1.onmessage=bp,Ys=function(){t0.postMessage(null)}):Ys=function(){n0(bp,0)};var kp,t0;function Tp(t){oc=t,lc||(lc=!0,Ys())}function Pp(t,e){Qs=n0(function(){t(ge.unstable_now())},e)}ge.unstable_IdlePriority=5;ge.unstable_ImmediatePriority=1;ge.unstable_LowPriority=4;ge.unstable_NormalPriority=3;ge.unstable_Profiling=null;ge.unstable_UserBlockingPriority=2;ge.unstable_cancelCallback=function(t){t.callback=null};ge.unstable_continueExecution=function(){yi||ac||(yi=!0,Tp(Rp))};ge.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):i0=0<t?Math.floor(1e3/t):5};ge.unstable_getCurrentPriorityLevel=function(){return rt};ge.unstable_getFirstCallbackNode=function(){return on(kn)};ge.unstable_next=function(t){switch(rt){case 1:case 2:case 3:var e=3;break;default:e=rt}var n=rt;rt=e;try{return t()}finally{rt=n}};ge.unstable_pauseExecution=function(){};ge.unstable_requestPaint=function(){};ge.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=rt;rt=t;try{return e()}finally{rt=n}};ge.unstable_scheduleCallback=function(t,e,n){var r=ge.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,t){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=n+i,t={id:RA++,callback:e,priorityLevel:t,startTime:n,expirationTime:i,sortIndex:-1},n>r?(t.sortIndex=n,Ep(Ir,t),on(kn)===null&&t===on(Ir)&&(Xs?(r0(Qs),Qs=-1):Xs=!0,Pp(Ap,n-r))):(t.sortIndex=i,Ep(kn,t),yi||ac||(yi=!0,Tp(Rp))),t};ge.unstable_shouldYield=s0;ge.unstable_wrapCallback=function(t){var e=rt;return function(){var n=rt;rt=e;try{return t.apply(this,arguments)}finally{rt=n}}}});var c0=Vn((nL,l0)=>{"use strict";l0.exports=a0()});var pS=Vn(Dt=>{"use strict";var TA=wt(),Ft=c0();function T(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;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."}var mw=new Set,wa={};function Ii(t,e){Wo(t,e),Wo(t+"Capture",e)}function Wo(t,e){for(wa[t]=e,t=0;t<e.length;t++)mw.add(e[t])}var tr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jp=Object.prototype.hasOwnProperty,PA=/^[: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]*$/,u0={},d0={};function IA(t){return Jp.call(d0,t)?!0:Jp.call(u0,t)?!1:PA.test(t)?d0[t]=!0:(u0[t]=!0,!1)}function OA(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function NA(t,e,n,r){if(e===null||typeof e>"u"||OA(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function gt(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var et={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){et[t]=new gt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];et[e]=new gt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){et[t]=new gt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){et[t]=new gt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){et[t]=new gt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){et[t]=new gt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){et[t]=new gt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){et[t]=new gt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){et[t]=new gt(t,5,!1,t.toLowerCase(),null,!1,!1)});var Wh=/[\-:]([a-z])/g;function qh(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Wh,qh);et[e]=new gt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Wh,qh);et[e]=new gt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Wh,qh);et[e]=new gt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){et[t]=new gt(t,1,!1,t.toLowerCase(),null,!1,!1)});et.xlinkHref=new gt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){et[t]=new gt(t,1,!1,t.toLowerCase(),null,!0,!0)});function Kh(t,e,n,r){var i=et.hasOwnProperty(e)?et[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(NA(e,n,i,r)&&(n=null),r||i===null?IA(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var or=TA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,cc=Symbol.for("react.element"),Ao=Symbol.for("react.portal"),Ro=Symbol.for("react.fragment"),Gh=Symbol.for("react.strict_mode"),eh=Symbol.for("react.profiler"),vw=Symbol.for("react.provider"),yw=Symbol.for("react.context"),Zh=Symbol.for("react.forward_ref"),th=Symbol.for("react.suspense"),nh=Symbol.for("react.suspense_list"),Yh=Symbol.for("react.memo"),Nr=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var _w=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var f0=Symbol.iterator;function Js(t){return t===null||typeof t!="object"?null:(t=f0&&t[f0]||t["@@iterator"],typeof t=="function"?t:null)}var Te=Object.assign,Ip;function aa(t){if(Ip===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Ip=e&&e[1]||""}return`
2
+ `+Ip+t}var Op=!1;function Np(t,e){if(!t||Op)return"";Op=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var r=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){r=c}t.call(e.prototype)}else{try{throw Error()}catch(c){r=c}t()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
3
+ `),o=r.stack.split(`
4
+ `),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==o[a]){var l=`
5
+ `+i[s].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{Op=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?aa(t):""}function LA(t){switch(t.tag){case 5:return aa(t.type);case 16:return aa("Lazy");case 13:return aa("Suspense");case 19:return aa("SuspenseList");case 0:case 2:case 15:return t=Np(t.type,!1),t;case 11:return t=Np(t.type.render,!1),t;case 1:return t=Np(t.type,!0),t;default:return""}}function rh(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ro:return"Fragment";case Ao:return"Portal";case eh:return"Profiler";case Gh:return"StrictMode";case th:return"Suspense";case nh:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case yw:return(t.displayName||"Context")+".Consumer";case vw:return(t._context.displayName||"Context")+".Provider";case Zh:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Yh:return e=t.displayName||null,e!==null?e:rh(t.type)||"Memo";case Nr:e=t._payload,t=t._init;try{return rh(t(e))}catch{}}return null}function MA(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return rh(e);case 8:return e===Gh?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Kr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ww(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function FA(t){var e=ww(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function uc(t){t._valueTracker||(t._valueTracker=FA(t))}function xw(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=ww(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Dc(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}}function ih(t,e){var n=e.checked;return Te({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function p0(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Kr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Sw(t,e){e=e.checked,e!=null&&Kh(t,"checked",e,!1)}function oh(t,e){Sw(t,e);var n=Kr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?sh(t,e.type,n):e.hasOwnProperty("defaultValue")&&sh(t,e.type,Kr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function h0(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function sh(t,e,n){(e!=="number"||Dc(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var la=Array.isArray;function Bo(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Kr(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function ah(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(T(91));return Te({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function g0(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(T(92));if(la(n)){if(1<n.length)throw Error(T(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Kr(n)}}function bw(t,e){var n=Kr(e.value),r=Kr(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function m0(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function kw(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function lh(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?kw(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var dc,Ew=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t})(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(dc=dc||document.createElement("div"),dc.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=dc.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function xa(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var da={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$A=["Webkit","ms","Moz","O"];Object.keys(da).forEach(function(t){$A.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),da[e]=da[t]})});function Cw(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||da.hasOwnProperty(t)&&da[t]?(""+e).trim():e+"px"}function Aw(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Cw(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var DA=Te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ch(t,e){if(e){if(DA[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(T(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(T(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(T(61))}if(e.style!=null&&typeof e.style!="object")throw Error(T(62))}}function uh(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";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 dh=null;function Xh(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var fh=null,Vo=null,zo=null;function v0(t){if(t=Ba(t)){if(typeof fh!="function")throw Error(T(280));var e=t.stateNode;e&&(e=fu(e),fh(t.stateNode,t.type,e))}}function Rw(t){Vo?zo?zo.push(t):zo=[t]:Vo=t}function Tw(){if(Vo){var t=Vo,e=zo;if(zo=Vo=null,v0(t),e)for(t=0;t<e.length;t++)v0(e[t])}}function Pw(t,e){return t(e)}function Iw(){}var Lp=!1;function Ow(t,e,n){if(Lp)return t(e,n);Lp=!0;try{return Pw(t,e,n)}finally{Lp=!1,(Vo!==null||zo!==null)&&(Iw(),Tw())}}function Sa(t,e){var n=t.stateNode;if(n===null)return null;var r=fu(n);if(r===null)return null;n=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(n&&typeof n!="function")throw Error(T(231,e,typeof n));return n}var ph=!1;if(tr)try{Eo={},Object.defineProperty(Eo,"passive",{get:function(){ph=!0}}),window.addEventListener("test",Eo,Eo),window.removeEventListener("test",Eo,Eo)}catch{ph=!1}var Eo;function BA(t,e,n,r,i,o,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(u){this.onError(u)}}var fa=!1,Bc=null,Vc=!1,hh=null,VA={onError:function(t){fa=!0,Bc=t}};function zA(t,e,n,r,i,o,s,a,l){fa=!1,Bc=null,BA.apply(VA,arguments)}function HA(t,e,n,r,i,o,s,a,l){if(zA.apply(this,arguments),fa){if(fa){var c=Bc;fa=!1,Bc=null}else throw Error(T(198));Vc||(Vc=!0,hh=c)}}function Oi(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 Nw(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 y0(t){if(Oi(t)!==t)throw Error(T(188))}function jA(t){var e=t.alternate;if(!e){if(e=Oi(t),e===null)throw Error(T(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return y0(i),t;if(o===r)return y0(i),e;o=o.sibling}throw Error(T(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s)throw Error(T(189))}}if(n.alternate!==r)throw Error(T(190))}if(n.tag!==3)throw Error(T(188));return n.stateNode.current===n?t:e}function Lw(t){return t=jA(t),t!==null?Mw(t):null}function Mw(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Mw(t);if(e!==null)return e;t=t.sibling}return null}var Fw=Ft.unstable_scheduleCallback,_0=Ft.unstable_cancelCallback,UA=Ft.unstable_shouldYield,WA=Ft.unstable_requestPaint,Fe=Ft.unstable_now,qA=Ft.unstable_getCurrentPriorityLevel,Qh=Ft.unstable_ImmediatePriority,$w=Ft.unstable_UserBlockingPriority,zc=Ft.unstable_NormalPriority,KA=Ft.unstable_LowPriority,Dw=Ft.unstable_IdlePriority,lu=null,Rn=null;function GA(t){if(Rn&&typeof Rn.onCommitFiberRoot=="function")try{Rn.onCommitFiberRoot(lu,t,void 0,(t.current.flags&128)===128)}catch{}}var un=Math.clz32?Math.clz32:XA,ZA=Math.log,YA=Math.LN2;function XA(t){return t>>>=0,t===0?32:31-(ZA(t)/YA|0)|0}var fc=64,pc=4194304;function ca(t){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Hc(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=ca(a):(o&=s,o!==0&&(r=ca(o)))}else s=n&~i,s!==0?r=ca(s):o!==0&&(r=ca(o));if(r===0)return 0;if(e!==0&&e!==r&&(e&i)===0&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if((r&4)!==0&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-un(e),i=1<<n,r|=t[n],e&=~i;return r}function QA(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function JA(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,o=t.pendingLanes;0<o;){var s=31-un(o),a=1<<s,l=i[s];l===-1?((a&n)===0||(a&r)!==0)&&(i[s]=QA(a,e)):l<=e&&(t.expiredLanes|=a),o&=~a}}function gh(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Bw(){var t=fc;return fc<<=1,(fc&4194240)===0&&(fc=64),t}function Mp(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function $a(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-un(e),t[e]=n}function eR(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-un(n),o=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~o}}function Jh(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-un(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var ue=0;function Vw(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var zw,eg,Hw,jw,Uw,mh=!1,hc=[],Br=null,Vr=null,zr=null,ba=new Map,ka=new Map,Mr=[],tR="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 submit".split(" ");function w0(t,e){switch(t){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":Vr=null;break;case"mouseover":case"mouseout":zr=null;break;case"pointerover":case"pointerout":ba.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":ka.delete(e.pointerId)}}function ea(t,e,n,r,i,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},e!==null&&(e=Ba(e),e!==null&&eg(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function nR(t,e,n,r,i){switch(e){case"focusin":return Br=ea(Br,t,e,n,r,i),!0;case"dragenter":return Vr=ea(Vr,t,e,n,r,i),!0;case"mouseover":return zr=ea(zr,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return ba.set(o,ea(ba.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,ka.set(o,ea(ka.get(o)||null,t,e,n,r,i)),!0}return!1}function Ww(t){var e=xi(t.target);if(e!==null){var n=Oi(e);if(n!==null){if(e=n.tag,e===13){if(e=Nw(n),e!==null){t.blockedOn=e,Uw(t.priority,function(){Hw(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 Rc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=vh(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);dh=r,n.target.dispatchEvent(r),dh=null}else return e=Ba(n),e!==null&&eg(e),t.blockedOn=n,!1;e.shift()}return!0}function x0(t,e,n){Rc(t)&&n.delete(e)}function rR(){mh=!1,Br!==null&&Rc(Br)&&(Br=null),Vr!==null&&Rc(Vr)&&(Vr=null),zr!==null&&Rc(zr)&&(zr=null),ba.forEach(x0),ka.forEach(x0)}function ta(t,e){t.blockedOn===e&&(t.blockedOn=null,mh||(mh=!0,Ft.unstable_scheduleCallback(Ft.unstable_NormalPriority,rR)))}function Ea(t){function e(i){return ta(i,t)}if(0<hc.length){ta(hc[0],t);for(var n=1;n<hc.length;n++){var r=hc[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Br!==null&&ta(Br,t),Vr!==null&&ta(Vr,t),zr!==null&&ta(zr,t),ba.forEach(e),ka.forEach(e),n=0;n<Mr.length;n++)r=Mr[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Mr.length&&(n=Mr[0],n.blockedOn===null);)Ww(n),n.blockedOn===null&&Mr.shift()}var Ho=or.ReactCurrentBatchConfig,jc=!0;function iR(t,e,n,r){var i=ue,o=Ho.transition;Ho.transition=null;try{ue=1,tg(t,e,n,r)}finally{ue=i,Ho.transition=o}}function oR(t,e,n,r){var i=ue,o=Ho.transition;Ho.transition=null;try{ue=4,tg(t,e,n,r)}finally{ue=i,Ho.transition=o}}function tg(t,e,n,r){if(jc){var i=vh(t,e,n,r);if(i===null)Hp(t,e,r,Uc,n),w0(t,r);else if(nR(i,t,e,n,r))r.stopPropagation();else if(w0(t,r),e&4&&-1<tR.indexOf(t)){for(;i!==null;){var o=Ba(i);if(o!==null&&zw(o),o=vh(t,e,n,r),o===null&&Hp(t,e,r,Uc,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Hp(t,e,r,null,n)}}var Uc=null;function vh(t,e,n,r){if(Uc=null,t=Xh(r),t=xi(t),t!==null)if(e=Oi(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Nw(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 Uc=t,null}function qw(t){switch(t){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(qA()){case Qh:return 1;case $w:return 4;case zc:case KA:return 16;case Dw:return 536870912;default:return 16}default:return 16}}var $r=null,ng=null,Tc=null;function Kw(){if(Tc)return Tc;var t,e=ng,n=e.length,r,i="value"in $r?$r.value:$r.textContent,o=i.length;for(t=0;t<n&&e[t]===i[t];t++);var s=n-t;for(r=1;r<=s&&e[n-r]===i[o-r];r++);return Tc=i.slice(t,1<r?1-r:void 0)}function Pc(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 gc(){return!0}function S0(){return!1}function $t(t){function e(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?gc:S0,this.isPropagationStopped=S0,this}return Te(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=gc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=gc)},persist:function(){},isPersistent:gc}),e}var Qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rg=$t(Qo),Da=Te({},Qo,{view:0,detail:0}),sR=$t(Da),Fp,$p,na,cu=Te({},Da,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ig,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!==na&&(na&&t.type==="mousemove"?(Fp=t.screenX-na.screenX,$p=t.screenY-na.screenY):$p=Fp=0,na=t),Fp)},movementY:function(t){return"movementY"in t?t.movementY:$p}}),b0=$t(cu),aR=Te({},cu,{dataTransfer:0}),lR=$t(aR),cR=Te({},Da,{relatedTarget:0}),Dp=$t(cR),uR=Te({},Qo,{animationName:0,elapsedTime:0,pseudoElement:0}),dR=$t(uR),fR=Te({},Qo,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),pR=$t(fR),hR=Te({},Qo,{data:0}),k0=$t(hR),gR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mR={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},vR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yR(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=vR[t])?!!e[t]:!1}function ig(){return yR}var _R=Te({},Da,{key:function(t){if(t.key){var e=gR[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Pc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?mR[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ig,charCode:function(t){return t.type==="keypress"?Pc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Pc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),wR=$t(_R),xR=Te({},cu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),E0=$t(xR),SR=Te({},Da,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ig}),bR=$t(SR),kR=Te({},Qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),ER=$t(kR),CR=Te({},cu,{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}),AR=$t(CR),RR=[9,13,27,32],og=tr&&"CompositionEvent"in window,pa=null;tr&&"documentMode"in document&&(pa=document.documentMode);var TR=tr&&"TextEvent"in window&&!pa,Gw=tr&&(!og||pa&&8<pa&&11>=pa),C0=" ",A0=!1;function Zw(t,e){switch(t){case"keyup":return RR.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yw(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var To=!1;function PR(t,e){switch(t){case"compositionend":return Yw(e);case"keypress":return e.which!==32?null:(A0=!0,C0);case"textInput":return t=e.data,t===C0&&A0?null:t;default:return null}}function IR(t,e){if(To)return t==="compositionend"||!og&&Zw(t,e)?(t=Kw(),Tc=ng=$r=null,To=!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 Gw&&e.locale!=="ko"?null:e.data;default:return null}}var OR={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 R0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!OR[t.type]:e==="textarea"}function Xw(t,e,n,r){Rw(r),e=Wc(e,"onChange"),0<e.length&&(n=new rg("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var ha=null,Ca=null;function NR(t){lx(t,0)}function uu(t){var e=Oo(t);if(xw(e))return t}function LR(t,e){if(t==="change")return e}var Qw=!1;tr&&(tr?(vc="oninput"in document,vc||(Bp=document.createElement("div"),Bp.setAttribute("oninput","return;"),vc=typeof Bp.oninput=="function"),mc=vc):mc=!1,Qw=mc&&(!document.documentMode||9<document.documentMode));var mc,vc,Bp;function T0(){ha&&(ha.detachEvent("onpropertychange",Jw),Ca=ha=null)}function Jw(t){if(t.propertyName==="value"&&uu(Ca)){var e=[];Xw(e,Ca,t,Xh(t)),Ow(NR,e)}}function MR(t,e,n){t==="focusin"?(T0(),ha=e,Ca=n,ha.attachEvent("onpropertychange",Jw)):t==="focusout"&&T0()}function FR(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return uu(Ca)}function $R(t,e){if(t==="click")return uu(e)}function DR(t,e){if(t==="input"||t==="change")return uu(e)}function BR(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var fn=typeof Object.is=="function"?Object.is:BR;function Aa(t,e){if(fn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Jp.call(e,i)||!fn(t[i],e[i]))return!1}return!0}function P0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function I0(t,e){var n=P0(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=P0(n)}}function ex(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?ex(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function tx(){for(var t=window,e=Dc();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Dc(t.document)}return e}function sg(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")}function VR(t){var e=tx(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&ex(n.ownerDocument.documentElement,n)){if(r!==null&&sg(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=I0(n,o);var s=I0(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var zR=tr&&"documentMode"in document&&11>=document.documentMode,Po=null,yh=null,ga=null,_h=!1;function O0(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_h||Po==null||Po!==Dc(r)||(r=Po,"selectionStart"in r&&sg(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}),ga&&Aa(ga,r)||(ga=r,r=Wc(yh,"onSelect"),0<r.length&&(e=new rg("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Po)))}function yc(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Io={animationend:yc("Animation","AnimationEnd"),animationiteration:yc("Animation","AnimationIteration"),animationstart:yc("Animation","AnimationStart"),transitionend:yc("Transition","TransitionEnd")},Vp={},nx={};tr&&(nx=document.createElement("div").style,"AnimationEvent"in window||(delete Io.animationend.animation,delete Io.animationiteration.animation,delete Io.animationstart.animation),"TransitionEvent"in window||delete Io.transitionend.transition);function du(t){if(Vp[t])return Vp[t];if(!Io[t])return t;var e=Io[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in nx)return Vp[t]=e[n];return t}var rx=du("animationend"),ix=du("animationiteration"),ox=du("animationstart"),sx=du("transitionend"),ax=new Map,N0="abort auxClick 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(" ");function Zr(t,e){ax.set(t,e),Ii(e,[t])}for(_c=0;_c<N0.length;_c++)wc=N0[_c],L0=wc.toLowerCase(),M0=wc[0].toUpperCase()+wc.slice(1),Zr(L0,"on"+M0);var wc,L0,M0,_c;Zr(rx,"onAnimationEnd");Zr(ix,"onAnimationIteration");Zr(ox,"onAnimationStart");Zr("dblclick","onDoubleClick");Zr("focusin","onFocus");Zr("focusout","onBlur");Zr(sx,"onTransitionEnd");Wo("onMouseEnter",["mouseout","mouseover"]);Wo("onMouseLeave",["mouseout","mouseover"]);Wo("onPointerEnter",["pointerout","pointerover"]);Wo("onPointerLeave",["pointerout","pointerover"]);Ii("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ii("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ii("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ii("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ii("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ii("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ua="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(" "),HR=new Set("cancel close invalid load scroll toggle".split(" ").concat(ua));function F0(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,HA(r,e,void 0,t),t.currentTarget=null}function lx(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;F0(i,a,c),o=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;F0(i,a,c),o=l}}}if(Vc)throw t=hh,Vc=!1,hh=null,t}function _e(t,e){var n=e[kh];n===void 0&&(n=e[kh]=new Set);var r=t+"__bubble";n.has(r)||(cx(e,t,2,!1),n.add(r))}function zp(t,e,n){var r=0;e&&(r|=4),cx(n,t,r,e)}var xc="_reactListening"+Math.random().toString(36).slice(2);function Ra(t){if(!t[xc]){t[xc]=!0,mw.forEach(function(n){n!=="selectionchange"&&(HR.has(n)||zp(n,!1,t),zp(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[xc]||(e[xc]=!0,zp("selectionchange",!1,e))}}function cx(t,e,n,r){switch(qw(e)){case 1:var i=iR;break;case 4:i=oR;break;default:i=tg}n=i.bind(null,e,n,t),i=void 0,!ph||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function Hp(t,e,n,r,i){var o=r;if((e&1)===0&&(e&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;s=s.return}for(;a!==null;){if(s=xi(a),s===null)return;if(l=s.tag,l===5||l===6){r=o=s;continue e}a=a.parentNode}}r=r.return}Ow(function(){var c=o,u=Xh(n),f=[];e:{var h=ax.get(t);if(h!==void 0){var g=rg,v=t;switch(t){case"keypress":if(Pc(n)===0)break e;case"keydown":case"keyup":g=wR;break;case"focusin":v="focus",g=Dp;break;case"focusout":v="blur",g=Dp;break;case"beforeblur":case"afterblur":g=Dp;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=b0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=lR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=bR;break;case rx:case ix:case ox:g=dR;break;case sx:g=ER;break;case"scroll":g=sR;break;case"wheel":g=AR;break;case"copy":case"cut":case"paste":g=pR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=E0}var _=(e&4)!==0,x=!_&&t==="scroll",d=_?h!==null?h+"Capture":null:h;_=[];for(var p=c,m;p!==null;){m=p;var y=m.stateNode;if(m.tag===5&&y!==null&&(m=y,d!==null&&(y=Sa(p,d),y!=null&&_.push(Ta(p,y,m)))),x)break;p=p.return}0<_.length&&(h=new g(h,v,null,n,u),f.push({event:h,listeners:_}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",g=t==="mouseout"||t==="pointerout",h&&n!==dh&&(v=n.relatedTarget||n.fromElement)&&(xi(v)||v[nr]))break e;if((g||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,g?(v=n.relatedTarget||n.toElement,g=c,v=v?xi(v):null,v!==null&&(x=Oi(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(g=null,v=c),g!==v)){if(_=b0,y="onMouseLeave",d="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(_=E0,y="onPointerLeave",d="onPointerEnter",p="pointer"),x=g==null?h:Oo(g),m=v==null?h:Oo(v),h=new _(y,p+"leave",g,n,u),h.target=x,h.relatedTarget=m,y=null,xi(u)===c&&(_=new _(d,p+"enter",v,n,u),_.target=m,_.relatedTarget=x,y=_),x=y,g&&v)t:{for(_=g,d=v,p=0,m=_;m;m=Co(m))p++;for(m=0,y=d;y;y=Co(y))m++;for(;0<p-m;)_=Co(_),p--;for(;0<m-p;)d=Co(d),m--;for(;p--;){if(_===d||d!==null&&_===d.alternate)break t;_=Co(_),d=Co(d)}_=null}else _=null;g!==null&&$0(f,h,g,_,!1),v!==null&&x!==null&&$0(f,x,v,_,!0)}}e:{if(h=c?Oo(c):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var w=LR;else if(R0(h))if(Qw)w=DR;else{w=FR;var k=MR}else(g=h.nodeName)&&g.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(w=$R);if(w&&(w=w(t,c))){Xw(f,w,n,u);break e}k&&k(t,h,c),t==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&sh(h,"number",h.value)}switch(k=c?Oo(c):window,t){case"focusin":(R0(k)||k.contentEditable==="true")&&(Po=k,yh=c,ga=null);break;case"focusout":ga=yh=Po=null;break;case"mousedown":_h=!0;break;case"contextmenu":case"mouseup":case"dragend":_h=!1,O0(f,n,u);break;case"selectionchange":if(zR)break;case"keydown":case"keyup":O0(f,n,u)}var b;if(og)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 To?Zw(t,n)&&(E="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Gw&&n.locale!=="ko"&&(To||E!=="onCompositionStart"?E==="onCompositionEnd"&&To&&(b=Kw()):($r=u,ng="value"in $r?$r.value:$r.textContent,To=!0)),k=Wc(c,E),0<k.length&&(E=new k0(E,t,null,n,u),f.push({event:E,listeners:k}),b?E.data=b:(b=Yw(n),b!==null&&(E.data=b)))),(b=TR?PR(t,n):IR(t,n))&&(c=Wc(c,"onBeforeInput"),0<c.length&&(u=new k0("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=b))}lx(f,e)})}function Ta(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Wc(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=Sa(t,n),o!=null&&r.unshift(Ta(t,o,i)),o=Sa(t,e),o!=null&&r.push(Ta(t,o,i))),t=t.return}return r}function Co(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function $0(t,e,n,r,i){for(var o=e._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=Sa(n,o),l!=null&&s.unshift(Ta(n,l,a))):i||(l=Sa(n,o),l!=null&&s.push(Ta(n,l,a)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var jR=/\r\n?/g,UR=/\u0000|\uFFFD/g;function D0(t){return(typeof t=="string"?t:""+t).replace(jR,`
6
+ `).replace(UR,"")}function Sc(t,e,n){if(e=D0(e),D0(t)!==e&&n)throw Error(T(425))}function qc(){}var wh=null,xh=null;function Sh(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var bh=typeof setTimeout=="function"?setTimeout:void 0,WR=typeof clearTimeout=="function"?clearTimeout:void 0,B0=typeof Promise=="function"?Promise:void 0,qR=typeof queueMicrotask=="function"?queueMicrotask:typeof B0<"u"?function(t){return B0.resolve(null).then(t).catch(KR)}:bh;function KR(t){setTimeout(function(){throw t})}function jp(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Ea(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ea(e)}function Hr(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==="$?")break;if(e==="/$")return null}}return t}function V0(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Jo=Math.random().toString(36).slice(2),An="__reactFiber$"+Jo,Pa="__reactProps$"+Jo,nr="__reactContainer$"+Jo,kh="__reactEvents$"+Jo,GR="__reactListeners$"+Jo,ZR="__reactHandles$"+Jo;function xi(t){var e=t[An];if(e)return e;for(var n=t.parentNode;n;){if(e=n[nr]||n[An]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=V0(t);t!==null;){if(n=t[An])return n;t=V0(t)}return e}t=n,n=t.parentNode}return null}function Ba(t){return t=t[An]||t[nr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Oo(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(T(33))}function fu(t){return t[Pa]||null}var Eh=[],No=-1;function Yr(t){return{current:t}}function we(t){0>No||(t.current=Eh[No],Eh[No]=null,No--)}function me(t,e){No++,Eh[No]=t.current,t.current=e}var Gr={},at=Yr(Gr),Et=Yr(!1),Ci=Gr;function qo(t,e){var n=t.type.contextTypes;if(!n)return Gr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ct(t){return t=t.childContextTypes,t!=null}function Kc(){we(Et),we(at)}function z0(t,e,n){if(at.current!==Gr)throw Error(T(168));me(at,e),me(Et,n)}function ux(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(T(108,MA(t)||"Unknown",i));return Te({},n,r)}function Gc(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Gr,Ci=at.current,me(at,t),me(Et,Et.current),!0}function H0(t,e,n){var r=t.stateNode;if(!r)throw Error(T(169));n?(t=ux(t,e,Ci),r.__reactInternalMemoizedMergedChildContext=t,we(Et),we(at),me(at,t)):we(Et),me(Et,n)}var Xn=null,pu=!1,Up=!1;function dx(t){Xn===null?Xn=[t]:Xn.push(t)}function YR(t){pu=!0,dx(t)}function Xr(){if(!Up&&Xn!==null){Up=!0;var t=0,e=ue;try{var n=Xn;for(ue=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Xn=null,pu=!1}catch(i){throw Xn!==null&&(Xn=Xn.slice(t+1)),Fw(Qh,Xr),i}finally{ue=e,Up=!1}}return null}var Lo=[],Mo=0,Zc=null,Yc=0,Wt=[],qt=0,Ai=null,Qn=1,Jn="";function _i(t,e){Lo[Mo++]=Yc,Lo[Mo++]=Zc,Zc=t,Yc=e}function fx(t,e,n){Wt[qt++]=Qn,Wt[qt++]=Jn,Wt[qt++]=Ai,Ai=t;var r=Qn;t=Jn;var i=32-un(r)-1;r&=~(1<<i),n+=1;var o=32-un(e)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Qn=1<<32-un(e)+i|n<<i|r,Jn=o+t}else Qn=1<<o|n<<i|r,Jn=t}function ag(t){t.return!==null&&(_i(t,1),fx(t,1,0))}function lg(t){for(;t===Zc;)Zc=Lo[--Mo],Lo[Mo]=null,Yc=Lo[--Mo],Lo[Mo]=null;for(;t===Ai;)Ai=Wt[--qt],Wt[qt]=null,Jn=Wt[--qt],Wt[qt]=null,Qn=Wt[--qt],Wt[qt]=null}var Mt=null,Lt=null,be=!1,cn=null;function px(t,e){var n=Kt(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function j0(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Mt=t,Lt=Hr(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Mt=t,Lt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Ai!==null?{id:Qn,overflow:Jn}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Kt(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Mt=t,Lt=null,!0):!1;default:return!1}}function Ch(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Ah(t){if(be){var e=Lt;if(e){var n=e;if(!j0(t,e)){if(Ch(t))throw Error(T(418));e=Hr(n.nextSibling);var r=Mt;e&&j0(t,e)?px(r,n):(t.flags=t.flags&-4097|2,be=!1,Mt=t)}}else{if(Ch(t))throw Error(T(418));t.flags=t.flags&-4097|2,be=!1,Mt=t}}}function U0(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Mt=t}function bc(t){if(t!==Mt)return!1;if(!be)return U0(t),be=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Sh(t.type,t.memoizedProps)),e&&(e=Lt)){if(Ch(t))throw hx(),Error(T(418));for(;e;)px(t,e),e=Hr(e.nextSibling)}if(U0(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(T(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Lt=Hr(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Lt=null}}else Lt=Mt?Hr(t.stateNode.nextSibling):null;return!0}function hx(){for(var t=Lt;t;)t=Hr(t.nextSibling)}function Ko(){Lt=Mt=null,be=!1}function cg(t){cn===null?cn=[t]:cn.push(t)}var XR=or.ReactCurrentBatchConfig;function ra(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(T(309));var r=n.stateNode}if(!r)throw Error(T(147,t));var i=r,o=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===o?e.ref:(e=function(s){var a=i.refs;s===null?delete a[o]:a[o]=s},e._stringRef=o,e)}if(typeof t!="string")throw Error(T(284));if(!n._owner)throw Error(T(290,t))}return t}function kc(t,e){throw t=Object.prototype.toString.call(e),Error(T(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function W0(t){var e=t._init;return e(t._payload)}function gx(t){function e(d,p){if(t){var m=d.deletions;m===null?(d.deletions=[p],d.flags|=16):m.push(p)}}function n(d,p){if(!t)return null;for(;p!==null;)e(d,p),p=p.sibling;return null}function r(d,p){for(d=new Map;p!==null;)p.key!==null?d.set(p.key,p):d.set(p.index,p),p=p.sibling;return d}function i(d,p){return d=qr(d,p),d.index=0,d.sibling=null,d}function o(d,p,m){return d.index=m,t?(m=d.alternate,m!==null?(m=m.index,m<p?(d.flags|=2,p):m):(d.flags|=2,p)):(d.flags|=1048576,p)}function s(d){return t&&d.alternate===null&&(d.flags|=2),d}function a(d,p,m,y){return p===null||p.tag!==6?(p=Xp(m,d.mode,y),p.return=d,p):(p=i(p,m),p.return=d,p)}function l(d,p,m,y){var w=m.type;return w===Ro?u(d,p,m.props.children,y,m.key):p!==null&&(p.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Nr&&W0(w)===p.type)?(y=i(p,m.props),y.ref=ra(d,p,m),y.return=d,y):(y=$c(m.type,m.key,m.props,null,d.mode,y),y.ref=ra(d,p,m),y.return=d,y)}function c(d,p,m,y){return p===null||p.tag!==4||p.stateNode.containerInfo!==m.containerInfo||p.stateNode.implementation!==m.implementation?(p=Qp(m,d.mode,y),p.return=d,p):(p=i(p,m.children||[]),p.return=d,p)}function u(d,p,m,y,w){return p===null||p.tag!==7?(p=Ei(m,d.mode,y,w),p.return=d,p):(p=i(p,m),p.return=d,p)}function f(d,p,m){if(typeof p=="string"&&p!==""||typeof p=="number")return p=Xp(""+p,d.mode,m),p.return=d,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case cc:return m=$c(p.type,p.key,p.props,null,d.mode,m),m.ref=ra(d,null,p),m.return=d,m;case Ao:return p=Qp(p,d.mode,m),p.return=d,p;case Nr:var y=p._init;return f(d,y(p._payload),m)}if(la(p)||Js(p))return p=Ei(p,d.mode,m,null),p.return=d,p;kc(d,p)}return null}function h(d,p,m,y){var w=p!==null?p.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return w!==null?null:a(d,p,""+m,y);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case cc:return m.key===w?l(d,p,m,y):null;case Ao:return m.key===w?c(d,p,m,y):null;case Nr:return w=m._init,h(d,p,w(m._payload),y)}if(la(m)||Js(m))return w!==null?null:u(d,p,m,y,null);kc(d,m)}return null}function g(d,p,m,y,w){if(typeof y=="string"&&y!==""||typeof y=="number")return d=d.get(m)||null,a(p,d,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case cc:return d=d.get(y.key===null?m:y.key)||null,l(p,d,y,w);case Ao:return d=d.get(y.key===null?m:y.key)||null,c(p,d,y,w);case Nr:var k=y._init;return g(d,p,m,k(y._payload),w)}if(la(y)||Js(y))return d=d.get(m)||null,u(p,d,y,w,null);kc(p,y)}return null}function v(d,p,m,y){for(var w=null,k=null,b=p,E=p=0,P=null;b!==null&&E<m.length;E++){b.index>E?(P=b,b=null):P=b.sibling;var A=h(d,b,m[E],y);if(A===null){b===null&&(b=P);break}t&&b&&A.alternate===null&&e(d,b),p=o(A,p,E),k===null?w=A:k.sibling=A,k=A,b=P}if(E===m.length)return n(d,b),be&&_i(d,E),w;if(b===null){for(;E<m.length;E++)b=f(d,m[E],y),b!==null&&(p=o(b,p,E),k===null?w=b:k.sibling=b,k=b);return be&&_i(d,E),w}for(b=r(d,b);E<m.length;E++)P=g(b,d,E,m[E],y),P!==null&&(t&&P.alternate!==null&&b.delete(P.key===null?E:P.key),p=o(P,p,E),k===null?w=P:k.sibling=P,k=P);return t&&b.forEach(function(H){return e(d,H)}),be&&_i(d,E),w}function _(d,p,m,y){var w=Js(m);if(typeof w!="function")throw Error(T(150));if(m=w.call(m),m==null)throw Error(T(151));for(var k=w=null,b=p,E=p=0,P=null,A=m.next();b!==null&&!A.done;E++,A=m.next()){b.index>E?(P=b,b=null):P=b.sibling;var H=h(d,b,A.value,y);if(H===null){b===null&&(b=P);break}t&&b&&H.alternate===null&&e(d,b),p=o(H,p,E),k===null?w=H:k.sibling=H,k=H,b=P}if(A.done)return n(d,b),be&&_i(d,E),w;if(b===null){for(;!A.done;E++,A=m.next())A=f(d,A.value,y),A!==null&&(p=o(A,p,E),k===null?w=A:k.sibling=A,k=A);return be&&_i(d,E),w}for(b=r(d,b);!A.done;E++,A=m.next())A=g(b,d,E,A.value,y),A!==null&&(t&&A.alternate!==null&&b.delete(A.key===null?E:A.key),p=o(A,p,E),k===null?w=A:k.sibling=A,k=A);return t&&b.forEach(function(K){return e(d,K)}),be&&_i(d,E),w}function x(d,p,m,y){if(typeof m=="object"&&m!==null&&m.type===Ro&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case cc:e:{for(var w=m.key,k=p;k!==null;){if(k.key===w){if(w=m.type,w===Ro){if(k.tag===7){n(d,k.sibling),p=i(k,m.props.children),p.return=d,d=p;break e}}else if(k.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Nr&&W0(w)===k.type){n(d,k.sibling),p=i(k,m.props),p.ref=ra(d,k,m),p.return=d,d=p;break e}n(d,k);break}else e(d,k);k=k.sibling}m.type===Ro?(p=Ei(m.props.children,d.mode,y,m.key),p.return=d,d=p):(y=$c(m.type,m.key,m.props,null,d.mode,y),y.ref=ra(d,p,m),y.return=d,d=y)}return s(d);case Ao:e:{for(k=m.key;p!==null;){if(p.key===k)if(p.tag===4&&p.stateNode.containerInfo===m.containerInfo&&p.stateNode.implementation===m.implementation){n(d,p.sibling),p=i(p,m.children||[]),p.return=d,d=p;break e}else{n(d,p);break}else e(d,p);p=p.sibling}p=Qp(m,d.mode,y),p.return=d,d=p}return s(d);case Nr:return k=m._init,x(d,p,k(m._payload),y)}if(la(m))return v(d,p,m,y);if(Js(m))return _(d,p,m,y);kc(d,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,p!==null&&p.tag===6?(n(d,p.sibling),p=i(p,m),p.return=d,d=p):(n(d,p),p=Xp(m,d.mode,y),p.return=d,d=p),s(d)):n(d,p)}return x}var Go=gx(!0),mx=gx(!1),Xc=Yr(null),Qc=null,Fo=null,ug=null;function dg(){ug=Fo=Qc=null}function fg(t){var e=Xc.current;we(Xc),t._currentValue=e}function Rh(t,e,n){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===n)break;t=t.return}}function jo(t,e){Qc=t,ug=Fo=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&e)!==0&&(kt=!0),t.firstContext=null)}function Zt(t){var e=t._currentValue;if(ug!==t)if(t={context:t,memoizedValue:e,next:null},Fo===null){if(Qc===null)throw Error(T(308));Fo=t,Qc.dependencies={lanes:0,firstContext:t}}else Fo=Fo.next=t;return e}var Si=null;function pg(t){Si===null?Si=[t]:Si.push(t)}function vx(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,pg(e)):(n.next=i.next,i.next=n),e.interleaved=n,rr(t,r)}function rr(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Lr=!1;function hg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yx(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function er(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function jr(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(se&2)!==0){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,rr(t,n)}return i=r.interleaved,i===null?(e.next=e,pg(r)):(e.next=i.next,i.next=e),r.interleaved=e,rr(t,n)}function Ic(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Jh(t,n)}}function q0(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Jc(t,e,n,r){var i=t.updateQueue;Lr=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,u=c=l=null,a=o;do{var h=a.lane,g=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=t,_=a;switch(h=e,g=n,_.tag){case 1:if(v=_.payload,typeof v=="function"){f=v.call(g,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=_.payload,h=typeof v=="function"?v.call(g,f,h):v,h==null)break e;f=Te({},f,h);break e;case 2:Lr=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else g={eventTime:g,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=g,l=f):u=u.next=g,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Ti|=s,t.lanes=s,t.memoizedState=f}}function K0(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(T(191,i));i.call(r)}}}var Va={},Tn=Yr(Va),Ia=Yr(Va),Oa=Yr(Va);function bi(t){if(t===Va)throw Error(T(174));return t}function gg(t,e){switch(me(Oa,e),me(Ia,t),me(Tn,Va),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:lh(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=lh(e,t)}we(Tn),me(Tn,e)}function Zo(){we(Tn),we(Ia),we(Oa)}function _x(t){bi(Oa.current);var e=bi(Tn.current),n=lh(e,t.type);e!==n&&(me(Ia,t),me(Tn,n))}function mg(t){Ia.current===t&&(we(Tn),we(Ia))}var Ae=Yr(0);function eu(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){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 Wp=[];function vg(){for(var t=0;t<Wp.length;t++)Wp[t]._workInProgressVersionPrimary=null;Wp.length=0}var Oc=or.ReactCurrentDispatcher,qp=or.ReactCurrentBatchConfig,Ri=0,Re=null,je=null,qe=null,tu=!1,ma=!1,Na=0,QR=0;function it(){throw Error(T(321))}function yg(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!fn(t[n],e[n]))return!1;return!0}function _g(t,e,n,r,i,o){if(Ri=o,Re=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Oc.current=t===null||t.memoizedState===null?nT:rT,t=n(r,i),ma){o=0;do{if(ma=!1,Na=0,25<=o)throw Error(T(301));o+=1,qe=je=null,e.updateQueue=null,Oc.current=iT,t=n(r,i)}while(ma)}if(Oc.current=nu,e=je!==null&&je.next!==null,Ri=0,qe=je=Re=null,tu=!1,e)throw Error(T(300));return t}function wg(){var t=Na!==0;return Na=0,t}function Cn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qe===null?Re.memoizedState=qe=t:qe=qe.next=t,qe}function Yt(){if(je===null){var t=Re.alternate;t=t!==null?t.memoizedState:null}else t=je.next;var e=qe===null?Re.memoizedState:qe.next;if(e!==null)qe=e,je=t;else{if(t===null)throw Error(T(310));je=t,t={memoizedState:je.memoizedState,baseState:je.baseState,baseQueue:je.baseQueue,queue:je.queue,next:null},qe===null?Re.memoizedState=qe=t:qe=qe.next=t}return qe}function La(t,e){return typeof e=="function"?e(t):e}function Kp(t){var e=Yt(),n=e.queue;if(n===null)throw Error(T(311));n.lastRenderedReducer=t;var r=je,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var a=s=null,l=null,c=o;do{var u=c.lane;if((Ri&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:t(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,Re.lanes|=u,Ti|=u}c=c.next}while(c!==null&&c!==o);l===null?s=r:l.next=a,fn(r,e.memoizedState)||(kt=!0),e.memoizedState=r,e.baseState=s,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do o=i.lane,Re.lanes|=o,Ti|=o,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Gp(t){var e=Yt(),n=e.queue;if(n===null)throw Error(T(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=t(o,s.action),s=s.next;while(s!==i);fn(o,e.memoizedState)||(kt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function wx(){}function xx(t,e){var n=Re,r=Yt(),i=e(),o=!fn(r.memoizedState,i);if(o&&(r.memoizedState=i,kt=!0),r=r.queue,xg(kx.bind(null,n,r,t),[t]),r.getSnapshot!==e||o||qe!==null&&qe.memoizedState.tag&1){if(n.flags|=2048,Ma(9,bx.bind(null,n,r,i,e),void 0,null),Ke===null)throw Error(T(349));(Ri&30)!==0||Sx(n,e,i)}return i}function Sx(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Re.updateQueue,e===null?(e={lastEffect:null,stores:null},Re.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function bx(t,e,n,r){e.value=n,e.getSnapshot=r,Ex(e)&&Cx(t)}function kx(t,e,n){return n(function(){Ex(e)&&Cx(t)})}function Ex(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!fn(t,n)}catch{return!0}}function Cx(t){var e=rr(t,1);e!==null&&dn(e,t,1,-1)}function G0(t){var e=Cn();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:t},e.queue=t,t=t.dispatch=tT.bind(null,Re,t),[e.memoizedState,t]}function Ma(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Re.updateQueue,e===null?(e={lastEffect:null,stores:null},Re.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function Ax(){return Yt().memoizedState}function Nc(t,e,n,r){var i=Cn();Re.flags|=t,i.memoizedState=Ma(1|e,n,void 0,r===void 0?null:r)}function hu(t,e,n,r){var i=Yt();r=r===void 0?null:r;var o=void 0;if(je!==null){var s=je.memoizedState;if(o=s.destroy,r!==null&&yg(r,s.deps)){i.memoizedState=Ma(e,n,o,r);return}}Re.flags|=t,i.memoizedState=Ma(1|e,n,o,r)}function Z0(t,e){return Nc(8390656,8,t,e)}function xg(t,e){return hu(2048,8,t,e)}function Rx(t,e){return hu(4,2,t,e)}function Tx(t,e){return hu(4,4,t,e)}function Px(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function Ix(t,e,n){return n=n!=null?n.concat([t]):null,hu(4,4,Px.bind(null,e,t),n)}function Sg(){}function Ox(t,e){var n=Yt();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&yg(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function Nx(t,e){var n=Yt();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&yg(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function Lx(t,e,n){return(Ri&21)===0?(t.baseState&&(t.baseState=!1,kt=!0),t.memoizedState=n):(fn(n,e)||(n=Bw(),Re.lanes|=n,Ti|=n,t.baseState=!0),e)}function JR(t,e){var n=ue;ue=n!==0&&4>n?n:4,t(!0);var r=qp.transition;qp.transition={};try{t(!1),e()}finally{ue=n,qp.transition=r}}function Mx(){return Yt().memoizedState}function eT(t,e,n){var r=Wr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Fx(t))$x(e,n);else if(n=vx(t,e,n,r),n!==null){var i=ht();dn(n,t,r,i),Dx(n,e,r)}}function tT(t,e,n){var r=Wr(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fx(t))$x(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,fn(a,s)){var l=e.interleaved;l===null?(i.next=i,pg(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=vx(t,e,i,r),n!==null&&(i=ht(),dn(n,t,r,i),Dx(n,e,r))}}function Fx(t){var e=t.alternate;return t===Re||e!==null&&e===Re}function $x(t,e){ma=tu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Dx(t,e,n){if((n&4194240)!==0){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Jh(t,n)}}var nu={readContext:Zt,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useInsertionEffect:it,useLayoutEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useMutableSource:it,useSyncExternalStore:it,useId:it,unstable_isNewReconciler:!1},nT={readContext:Zt,useCallback:function(t,e){return Cn().memoizedState=[t,e===void 0?null:e],t},useContext:Zt,useEffect:Z0,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Nc(4194308,4,Px.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Nc(4194308,4,t,e)},useInsertionEffect:function(t,e){return Nc(4,2,t,e)},useMemo:function(t,e){var n=Cn();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Cn();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=eT.bind(null,Re,t),[r.memoizedState,t]},useRef:function(t){var e=Cn();return t={current:t},e.memoizedState=t},useState:G0,useDebugValue:Sg,useDeferredValue:function(t){return Cn().memoizedState=t},useTransition:function(){var t=G0(!1),e=t[0];return t=JR.bind(null,t[1]),Cn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Re,i=Cn();if(be){if(n===void 0)throw Error(T(407));n=n()}else{if(n=e(),Ke===null)throw Error(T(349));(Ri&30)!==0||Sx(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,Z0(kx.bind(null,r,o,t),[t]),r.flags|=2048,Ma(9,bx.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Cn(),e=Ke.identifierPrefix;if(be){var n=Jn,r=Qn;n=(r&~(1<<32-un(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Na++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=QR++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},rT={readContext:Zt,useCallback:Ox,useContext:Zt,useEffect:xg,useImperativeHandle:Ix,useInsertionEffect:Rx,useLayoutEffect:Tx,useMemo:Nx,useReducer:Kp,useRef:Ax,useState:function(){return Kp(La)},useDebugValue:Sg,useDeferredValue:function(t){var e=Yt();return Lx(e,je.memoizedState,t)},useTransition:function(){var t=Kp(La)[0],e=Yt().memoizedState;return[t,e]},useMutableSource:wx,useSyncExternalStore:xx,useId:Mx,unstable_isNewReconciler:!1},iT={readContext:Zt,useCallback:Ox,useContext:Zt,useEffect:xg,useImperativeHandle:Ix,useInsertionEffect:Rx,useLayoutEffect:Tx,useMemo:Nx,useReducer:Gp,useRef:Ax,useState:function(){return Gp(La)},useDebugValue:Sg,useDeferredValue:function(t){var e=Yt();return je===null?e.memoizedState=t:Lx(e,je.memoizedState,t)},useTransition:function(){var t=Gp(La)[0],e=Yt().memoizedState;return[t,e]},useMutableSource:wx,useSyncExternalStore:xx,useId:Mx,unstable_isNewReconciler:!1};function an(t,e){if(t&&t.defaultProps){e=Te({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Th(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Te({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var gu={isMounted:function(t){return(t=t._reactInternals)?Oi(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=ht(),i=Wr(t),o=er(r,i);o.payload=e,n!=null&&(o.callback=n),e=jr(t,o,i),e!==null&&(dn(e,t,i,r),Ic(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=ht(),i=Wr(t),o=er(r,i);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=jr(t,o,i),e!==null&&(dn(e,t,i,r),Ic(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=ht(),r=Wr(t),i=er(n,r);i.tag=2,e!=null&&(i.callback=e),e=jr(t,i,r),e!==null&&(dn(e,t,r,n),Ic(e,t,r))}};function Y0(t,e,n,r,i,o,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,s):e.prototype&&e.prototype.isPureReactComponent?!Aa(n,r)||!Aa(i,o):!0}function Bx(t,e,n){var r=!1,i=Gr,o=e.contextType;return typeof o=="object"&&o!==null?o=Zt(o):(i=Ct(e)?Ci:at.current,r=e.contextTypes,o=(r=r!=null)?qo(t,i):Gr),e=new e(n,o),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=gu,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function X0(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&gu.enqueueReplaceState(e,e.state,null)}function Ph(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},hg(t);var o=e.contextType;typeof o=="object"&&o!==null?i.context=Zt(o):(o=Ct(e)?Ci:at.current,i.context=qo(t,o)),i.state=t.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(Th(t,e,o,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&gu.enqueueReplaceState(i,i.state,null),Jc(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Yo(t,e){try{var n="",r=e;do n+=LA(r),r=r.return;while(r);var i=n}catch(o){i=`
7
+ Error generating stack: `+o.message+`
8
+ `+o.stack}return{value:t,source:e,stack:i,digest:null}}function Zp(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Ih(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var oT=typeof WeakMap=="function"?WeakMap:Map;function Vx(t,e,n){n=er(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){iu||(iu=!0,zh=r),Ih(t,e)},n}function zx(t,e,n){n=er(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){Ih(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Ih(t,e),typeof r!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),n}function Q0(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new oT;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=_T.bind(null,t,e,n),e.then(t,t))}function J0(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function ew(t,e,n,r,i){return(t.mode&1)===0?(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=er(-1,1),e.tag=2,jr(n,e,1))),n.lanes|=1),t):(t.flags|=65536,t.lanes=i,t)}var sT=or.ReactCurrentOwner,kt=!1;function pt(t,e,n,r){e.child=t===null?mx(e,null,n,r):Go(e,t.child,n,r)}function tw(t,e,n,r,i){n=n.render;var o=e.ref;return jo(e,i),r=_g(t,e,n,r,o,i),n=wg(),t!==null&&!kt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ir(t,e,i)):(be&&n&&ag(e),e.flags|=1,pt(t,e,r,i),e.child)}function nw(t,e,n,r,i){if(t===null){var o=n.type;return typeof o=="function"&&!Pg(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=o,Hx(t,e,o,r,i)):(t=$c(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,(t.lanes&i)===0){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:Aa,n(s,r)&&t.ref===e.ref)return ir(t,e,i)}return e.flags|=1,t=qr(o,r),t.ref=e.ref,t.return=e,e.child=t}function Hx(t,e,n,r,i){if(t!==null){var o=t.memoizedProps;if(Aa(o,r)&&t.ref===e.ref)if(kt=!1,e.pendingProps=r=o,(t.lanes&i)!==0)(t.flags&131072)!==0&&(kt=!0);else return e.lanes=t.lanes,ir(t,e,i)}return Oh(t,e,n,r,i)}function jx(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden")if((e.mode&1)===0)e.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(Do,Nt),Nt|=n;else{if((n&1073741824)===0)return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,me(Do,Nt),Nt|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,me(Do,Nt),Nt|=r}else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,me(Do,Nt),Nt|=r;return pt(t,e,i,n),e.child}function Ux(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Oh(t,e,n,r,i){var o=Ct(n)?Ci:at.current;return o=qo(e,o),jo(e,i),n=_g(t,e,n,r,o,i),r=wg(),t!==null&&!kt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ir(t,e,i)):(be&&r&&ag(e),e.flags|=1,pt(t,e,n,i),e.child)}function rw(t,e,n,r,i){if(Ct(n)){var o=!0;Gc(e)}else o=!1;if(jo(e,i),e.stateNode===null)Lc(t,e),Bx(e,n,r),Ph(e,n,r,i),r=!0;else if(t===null){var s=e.stateNode,a=e.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Zt(c):(c=Ct(n)?Ci:at.current,c=qo(e,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&X0(e,s,r,c),Lr=!1;var h=e.memoizedState;s.state=h,Jc(e,r,s,i),l=e.memoizedState,a!==r||h!==l||Et.current||Lr?(typeof u=="function"&&(Th(e,n,u,r),l=e.memoizedState),(a=Lr||Y0(e,n,a,r,h,l,c))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,yx(t,e),a=e.memoizedProps,c=e.type===e.elementType?a:an(e.type,a),s.props=c,f=e.pendingProps,h=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Zt(l):(l=Ct(n)?Ci:at.current,l=qo(e,l));var g=n.getDerivedStateFromProps;(u=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||h!==l)&&X0(e,s,r,l),Lr=!1,h=e.memoizedState,s.state=h,Jc(e,r,s,i);var v=e.memoizedState;a!==f||h!==v||Et.current||Lr?(typeof g=="function"&&(Th(e,n,g,r),v=e.memoizedState),(c=Lr||Y0(e,n,c,r,h,v,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=v),s.props=r,s.state=v,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),r=!1)}return Nh(t,e,n,r,o,i)}function Nh(t,e,n,r,i,o){Ux(t,e);var s=(e.flags&128)!==0;if(!r&&!s)return i&&H0(e,n,!1),ir(t,e,o);r=e.stateNode,sT.current=e;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&s?(e.child=Go(e,t.child,null,o),e.child=Go(e,null,a,o)):pt(t,e,a,o),e.memoizedState=r.state,i&&H0(e,n,!0),e.child}function Wx(t){var e=t.stateNode;e.pendingContext?z0(t,e.pendingContext,e.pendingContext!==e.context):e.context&&z0(t,e.context,!1),gg(t,e.containerInfo)}function iw(t,e,n,r,i){return Ko(),cg(i),e.flags|=256,pt(t,e,n,r),e.child}var Lh={dehydrated:null,treeContext:null,retryLane:0};function Mh(t){return{baseLanes:t,cachePool:null,transitions:null}}function qx(t,e,n){var r=e.pendingProps,i=Ae.current,o=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),me(Ae,i&1),t===null)return Ah(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((e.mode&1)===0?e.lanes=1:t.data==="$!"?e.lanes=8:e.lanes=1073741824,null):(s=r.children,t=r.fallback,o?(r=e.mode,o=e.child,s={mode:"hidden",children:s},(r&1)===0&&o!==null?(o.childLanes=0,o.pendingProps=s):o=yu(s,r,0,null),t=Ei(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=Mh(n),e.memoizedState=Lh,t):bg(e,s));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return aT(t,e,s,r,a,i,n);if(o){o=r.fallback,s=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:r.children};return(s&1)===0&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=qr(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=qr(a,o):(o=Ei(o,s,n,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,s=t.child.memoizedState,s=s===null?Mh(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=t.childLanes&~n,e.memoizedState=Lh,r}return o=t.child,t=o.sibling,r=qr(o,{mode:"visible",children:r.children}),(e.mode&1)===0&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function bg(t,e){return e=yu({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Ec(t,e,n,r){return r!==null&&cg(r),Go(e,t.child,null,n),t=bg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function aT(t,e,n,r,i,o,s){if(n)return e.flags&256?(e.flags&=-257,r=Zp(Error(T(422))),Ec(t,e,s,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=r.fallback,i=e.mode,r=yu({mode:"visible",children:r.children},i,0,null),o=Ei(o,i,s,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,(e.mode&1)!==0&&Go(e,t.child,null,s),e.child.memoizedState=Mh(s),e.memoizedState=Lh,o);if((e.mode&1)===0)return Ec(t,e,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(T(419)),r=Zp(o,r,void 0),Ec(t,e,s,r)}if(a=(s&t.childLanes)!==0,kt||a){if(r=Ke,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=(i&(r.suspendedLanes|s))!==0?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,rr(t,i),dn(r,t,i,-1))}return Tg(),r=Zp(Error(T(421))),Ec(t,e,s,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=wT.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,Lt=Hr(i.nextSibling),Mt=e,be=!0,cn=null,t!==null&&(Wt[qt++]=Qn,Wt[qt++]=Jn,Wt[qt++]=Ai,Qn=t.id,Jn=t.overflow,Ai=e),e=bg(e,r.children),e.flags|=4096,e)}function ow(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Rh(t.return,e,n)}function Yp(t,e,n,r,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Kx(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(pt(t,e,r.children,n),r=Ae.current,(r&2)!==0)r=r&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ow(t,n,e);else if(t.tag===19)ow(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}r&=1}if(me(Ae,r),(e.mode&1)===0)e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&eu(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Yp(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&eu(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Yp(e,!0,n,null,o);break;case"together":Yp(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Lc(t,e){(e.mode&1)===0&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function ir(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Ti|=e.lanes,(n&e.childLanes)===0)return null;if(t!==null&&e.child!==t.child)throw Error(T(153));if(e.child!==null){for(t=e.child,n=qr(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=qr(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function lT(t,e,n){switch(e.tag){case 3:Wx(e),Ko();break;case 5:_x(e);break;case 1:Ct(e.type)&&Gc(e);break;case 4:gg(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;me(Xc,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(me(Ae,Ae.current&1),e.flags|=128,null):(n&e.child.childLanes)!==0?qx(t,e,n):(me(Ae,Ae.current&1),t=ir(t,e,n),t!==null?t.sibling:null);me(Ae,Ae.current&1);break;case 19:if(r=(n&e.childLanes)!==0,(t.flags&128)!==0){if(r)return Kx(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),me(Ae,Ae.current),r)break;return null;case 22:case 23:return e.lanes=0,jx(t,e,n)}return ir(t,e,n)}var Gx,Fh,Zx,Yx;Gx=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Fh=function(){};Zx=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,bi(Tn.current);var o=null;switch(n){case"input":i=ih(t,i),r=ih(t,r),o=[];break;case"select":i=Te({},i,{value:void 0}),r=Te({},r,{value:void 0}),o=[];break;case"textarea":i=ah(t,i),r=ah(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=qc)}ch(n,r);var s;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(wa.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var l=r[c];if(a=i?.[c],r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(wa.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&_e("scroll",t),o||a===l||(o=[])):(o=o||[]).push(c,l))}n&&(o=o||[]).push("style",n);var c=o;(e.updateQueue=c)&&(e.flags|=4)}};Yx=function(t,e,n,r){n!==r&&(e.flags|=4)};function ia(t,e){if(!be)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function ot(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function cT(t,e,n){var r=e.pendingProps;switch(lg(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(e),null;case 1:return Ct(e.type)&&Kc(),ot(e),null;case 3:return r=e.stateNode,Zo(),we(Et),we(at),vg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(bc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,cn!==null&&(Uh(cn),cn=null))),Fh(t,e),ot(e),null;case 5:mg(e);var i=bi(Oa.current);if(n=e.type,t!==null&&e.stateNode!=null)Zx(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(T(166));return ot(e),null}if(t=bi(Tn.current),bc(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[An]=e,r[Pa]=o,t=(e.mode&1)!==0,n){case"dialog":_e("cancel",r),_e("close",r);break;case"iframe":case"object":case"embed":_e("load",r);break;case"video":case"audio":for(i=0;i<ua.length;i++)_e(ua[i],r);break;case"source":_e("error",r);break;case"img":case"image":case"link":_e("error",r),_e("load",r);break;case"details":_e("toggle",r);break;case"input":p0(r,o),_e("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},_e("invalid",r);break;case"textarea":g0(r,o),_e("invalid",r)}ch(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&Sc(r.textContent,a,t),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&Sc(r.textContent,a,t),i=["children",""+a]):wa.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&_e("scroll",r)}switch(n){case"input":uc(r),h0(r,o,!0);break;case"textarea":uc(r),m0(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=qc)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=kw(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=s.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[An]=e,t[Pa]=r,Gx(t,e,!1,!1),e.stateNode=t;e:{switch(s=uh(n,r),n){case"dialog":_e("cancel",t),_e("close",t),i=r;break;case"iframe":case"object":case"embed":_e("load",t),i=r;break;case"video":case"audio":for(i=0;i<ua.length;i++)_e(ua[i],t);i=r;break;case"source":_e("error",t),i=r;break;case"img":case"image":case"link":_e("error",t),_e("load",t),i=r;break;case"details":_e("toggle",t),i=r;break;case"input":p0(t,r),i=ih(t,r),_e("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=Te({},r,{value:void 0}),_e("invalid",t);break;case"textarea":g0(t,r),i=ah(t,r),_e("invalid",t);break;default:i=r}ch(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?Aw(t,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Ew(t,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&xa(t,l):typeof l=="number"&&xa(t,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(wa.hasOwnProperty(o)?l!=null&&o==="onScroll"&&_e("scroll",t):l!=null&&Kh(t,o,l,s))}switch(n){case"input":uc(t),h0(t,r,!1);break;case"textarea":uc(t),m0(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Kr(r.value));break;case"select":t.multiple=!!r.multiple,o=r.value,o!=null?Bo(t,!!r.multiple,o,!1):r.defaultValue!=null&&Bo(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=qc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return ot(e),null;case 6:if(t&&e.stateNode!=null)Yx(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(T(166));if(n=bi(Oa.current),bi(Tn.current),bc(e)){if(r=e.stateNode,n=e.memoizedProps,r[An]=e,(o=r.nodeValue!==n)&&(t=Mt,t!==null))switch(t.tag){case 3:Sc(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Sc(r.nodeValue,n,(t.mode&1)!==0)}o&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[An]=e,e.stateNode=r}return ot(e),null;case 13:if(we(Ae),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(be&&Lt!==null&&(e.mode&1)!==0&&(e.flags&128)===0)hx(),Ko(),e.flags|=98560,o=!1;else if(o=bc(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(T(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(T(317));o[An]=e}else Ko(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;ot(e),o=!1}else cn!==null&&(Uh(cn),cn=null),o=!0;if(!o)return e.flags&65536?e:null}return(e.flags&128)!==0?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,(e.mode&1)!==0&&(t===null||(Ae.current&1)!==0?Ue===0&&(Ue=3):Tg())),e.updateQueue!==null&&(e.flags|=4),ot(e),null);case 4:return Zo(),Fh(t,e),t===null&&Ra(e.stateNode.containerInfo),ot(e),null;case 10:return fg(e.type._context),ot(e),null;case 17:return Ct(e.type)&&Kc(),ot(e),null;case 19:if(we(Ae),o=e.memoizedState,o===null)return ot(e),null;if(r=(e.flags&128)!==0,s=o.rendering,s===null)if(r)ia(o,!1);else{if(Ue!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=eu(t),s!==null){for(e.flags|=128,ia(o,!1),r=s.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)o=n,t=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=t,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,t=s.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return me(Ae,Ae.current&1|2),e.child}t=t.sibling}o.tail!==null&&Fe()>Xo&&(e.flags|=128,r=!0,ia(o,!1),e.lanes=4194304)}else{if(!r)if(t=eu(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),ia(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!be)return ot(e),null}else 2*Fe()-o.renderingStartTime>Xo&&n!==1073741824&&(e.flags|=128,r=!0,ia(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Fe(),e.sibling=null,n=Ae.current,me(Ae,r?n&1|2:n&1),e):(ot(e),null);case 22:case 23:return Rg(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&(e.mode&1)!==0?(Nt&1073741824)!==0&&(ot(e),e.subtreeFlags&6&&(e.flags|=8192)):ot(e),null;case 24:return null;case 25:return null}throw Error(T(156,e.tag))}function uT(t,e){switch(lg(e),e.tag){case 1:return Ct(e.type)&&Kc(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Zo(),we(Et),we(at),vg(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 5:return mg(e),null;case 13:if(we(Ae),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(T(340));Ko()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return we(Ae),null;case 4:return Zo(),null;case 10:return fg(e.type._context),null;case 22:case 23:return Rg(),null;case 24:return null;default:return null}}var Cc=!1,st=!1,dT=typeof WeakSet=="function"?WeakSet:Set,$=null;function $o(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Pe(t,e,r)}else n.current=null}function $h(t,e,n){try{n()}catch(r){Pe(t,e,r)}}var sw=!1;function fT(t,e){if(wh=jc,t=tx(),sg(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var g;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===t)break t;if(h===n&&++c===i&&(a=s),h===o&&++u===r&&(l=s),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(xh={focusedElem:t,selectionRange:n},jc=!1,$=e;$!==null;)if(e=$,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,$=t;else for(;$!==null;){e=$;try{var v=e.alternate;if((e.flags&1024)!==0)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var _=v.memoizedProps,x=v.memoizedState,d=e.stateNode,p=d.getSnapshotBeforeUpdate(e.elementType===e.type?_:an(e.type,_),x);d.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var m=e.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(T(163))}}catch(y){Pe(e,e.return,y)}if(t=e.sibling,t!==null){t.return=e.return,$=t;break}$=e.return}return v=sw,sw=!1,v}function va(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&$h(e,n,o)}i=i.next}while(i!==r)}}function mu(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Dh(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function Xx(t){var e=t.alternate;e!==null&&(t.alternate=null,Xx(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[An],delete e[Pa],delete e[kh],delete e[GR],delete e[ZR])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Qx(t){return t.tag===5||t.tag===3||t.tag===4}function aw(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Qx(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.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 Bh(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=qc));else if(r!==4&&(t=t.child,t!==null))for(Bh(t,e,n),t=t.sibling;t!==null;)Bh(t,e,n),t=t.sibling}function Vh(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Vh(t,e,n),t=t.sibling;t!==null;)Vh(t,e,n),t=t.sibling}var Qe=null,ln=!1;function Or(t,e,n){for(n=n.child;n!==null;)Jx(t,e,n),n=n.sibling}function Jx(t,e,n){if(Rn&&typeof Rn.onCommitFiberUnmount=="function")try{Rn.onCommitFiberUnmount(lu,n)}catch{}switch(n.tag){case 5:st||$o(n,e);case 6:var r=Qe,i=ln;Qe=null,Or(t,e,n),Qe=r,ln=i,Qe!==null&&(ln?(t=Qe,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Qe.removeChild(n.stateNode));break;case 18:Qe!==null&&(ln?(t=Qe,n=n.stateNode,t.nodeType===8?jp(t.parentNode,n):t.nodeType===1&&jp(t,n),Ea(t)):jp(Qe,n.stateNode));break;case 4:r=Qe,i=ln,Qe=n.stateNode.containerInfo,ln=!0,Or(t,e,n),Qe=r,ln=i;break;case 0:case 11:case 14:case 15:if(!st&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&((o&2)!==0||(o&4)!==0)&&$h(n,e,s),i=i.next}while(i!==r)}Or(t,e,n);break;case 1:if(!st&&($o(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Pe(n,e,a)}Or(t,e,n);break;case 21:Or(t,e,n);break;case 22:n.mode&1?(st=(r=st)||n.memoizedState!==null,Or(t,e,n),st=r):Or(t,e,n);break;default:Or(t,e,n)}}function lw(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new dT),e.forEach(function(r){var i=xT.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function sn(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=t,s=e,a=s;e:for(;a!==null;){switch(a.tag){case 5:Qe=a.stateNode,ln=!1;break e;case 3:Qe=a.stateNode.containerInfo,ln=!0;break e;case 4:Qe=a.stateNode.containerInfo,ln=!0;break e}a=a.return}if(Qe===null)throw Error(T(160));Jx(o,s,i),Qe=null,ln=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Pe(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)eS(e,t),e=e.sibling}function eS(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(sn(e,t),En(t),r&4){try{va(3,t,t.return),mu(3,t)}catch(_){Pe(t,t.return,_)}try{va(5,t,t.return)}catch(_){Pe(t,t.return,_)}}break;case 1:sn(e,t),En(t),r&512&&n!==null&&$o(n,n.return);break;case 5:if(sn(e,t),En(t),r&512&&n!==null&&$o(n,n.return),t.flags&32){var i=t.stateNode;try{xa(i,"")}catch(_){Pe(t,t.return,_)}}if(r&4&&(i=t.stateNode,i!=null)){var o=t.memoizedProps,s=n!==null?n.memoizedProps:o,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&Sw(i,o),uh(a,s);var c=uh(a,o);for(s=0;s<l.length;s+=2){var u=l[s],f=l[s+1];u==="style"?Aw(i,f):u==="dangerouslySetInnerHTML"?Ew(i,f):u==="children"?xa(i,f):Kh(i,u,f,c)}switch(a){case"input":oh(i,o);break;case"textarea":bw(i,o);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var g=o.value;g!=null?Bo(i,!!o.multiple,g,!1):h!==!!o.multiple&&(o.defaultValue!=null?Bo(i,!!o.multiple,o.defaultValue,!0):Bo(i,!!o.multiple,o.multiple?[]:"",!1))}i[Pa]=o}catch(_){Pe(t,t.return,_)}}break;case 6:if(sn(e,t),En(t),r&4){if(t.stateNode===null)throw Error(T(162));i=t.stateNode,o=t.memoizedProps;try{i.nodeValue=o}catch(_){Pe(t,t.return,_)}}break;case 3:if(sn(e,t),En(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ea(e.containerInfo)}catch(_){Pe(t,t.return,_)}break;case 4:sn(e,t),En(t);break;case 13:sn(e,t),En(t),i=t.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(Cg=Fe())),r&4&&lw(t);break;case 22:if(u=n!==null&&n.memoizedState!==null,t.mode&1?(st=(c=st)||u,sn(e,t),st=c):sn(e,t),En(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!u&&(t.mode&1)!==0)for($=t,u=t.child;u!==null;){for(f=$=u;$!==null;){switch(h=$,g=h.child,h.tag){case 0:case 11:case 14:case 15:va(4,h,h.return);break;case 1:$o(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){r=h,n=h.return;try{e=r,v.props=e.memoizedProps,v.state=e.memoizedState,v.componentWillUnmount()}catch(_){Pe(r,n,_)}}break;case 5:$o(h,h.return);break;case 22:if(h.memoizedState!==null){uw(f);continue}}g!==null?(g.return=h,$=g):uw(f)}u=u.sibling}e:for(u=null,f=t;;){if(f.tag===5){if(u===null){u=f;try{i=f.stateNode,c?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Cw("display",s))}catch(_){Pe(t,t.return,_)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(_){Pe(t,t.return,_)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===t)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:sn(e,t),En(t),r&4&&lw(t);break;case 21:break;default:sn(e,t),En(t)}}function En(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(Qx(n)){var r=n;break e}n=n.return}throw Error(T(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(xa(i,""),r.flags&=-33);var o=aw(t);Vh(t,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=aw(t);Bh(t,a,s);break;default:throw Error(T(161))}}catch(l){Pe(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function pT(t,e,n){$=t,tS(t,e,n)}function tS(t,e,n){for(var r=(t.mode&1)!==0;$!==null;){var i=$,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||Cc;if(!s){var a=i.alternate,l=a!==null&&a.memoizedState!==null||st;a=Cc;var c=st;if(Cc=s,(st=l)&&!c)for($=i;$!==null;)s=$,l=s.child,s.tag===22&&s.memoizedState!==null?dw(i):l!==null?(l.return=s,$=l):dw(i);for(;o!==null;)$=o,tS(o,e,n),o=o.sibling;$=i,Cc=a,st=c}cw(t,e,n)}else(i.subtreeFlags&8772)!==0&&o!==null?(o.return=i,$=o):cw(t,e,n)}}function cw(t){for(;$!==null;){var e=$;if((e.flags&8772)!==0){var n=e.alternate;try{if((e.flags&8772)!==0)switch(e.tag){case 0:case 11:case 15:st||mu(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!st)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:an(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&K0(e,o,r);break;case 3:var s=e.updateQueue;if(s!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}K0(e,s,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&Ea(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(T(163))}st||e.flags&512&&Dh(e)}catch(h){Pe(e,e.return,h)}}if(e===t){$=null;break}if(n=e.sibling,n!==null){n.return=e.return,$=n;break}$=e.return}}function uw(t){for(;$!==null;){var e=$;if(e===t){$=null;break}var n=e.sibling;if(n!==null){n.return=e.return,$=n;break}$=e.return}}function dw(t){for(;$!==null;){var e=$;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{mu(4,e)}catch(l){Pe(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){Pe(e,i,l)}}var o=e.return;try{Dh(e)}catch(l){Pe(e,o,l)}break;case 5:var s=e.return;try{Dh(e)}catch(l){Pe(e,s,l)}}}catch(l){Pe(e,e.return,l)}if(e===t){$=null;break}var a=e.sibling;if(a!==null){a.return=e.return,$=a;break}$=e.return}}var hT=Math.ceil,ru=or.ReactCurrentDispatcher,kg=or.ReactCurrentOwner,Gt=or.ReactCurrentBatchConfig,se=0,Ke=null,Be=null,Je=0,Nt=0,Do=Yr(0),Ue=0,Fa=null,Ti=0,vu=0,Eg=0,ya=null,bt=null,Cg=0,Xo=1/0,Yn=null,iu=!1,zh=null,Ur=null,Ac=!1,Dr=null,ou=0,_a=0,Hh=null,Mc=-1,Fc=0;function ht(){return(se&6)!==0?Fe():Mc!==-1?Mc:Mc=Fe()}function Wr(t){return(t.mode&1)===0?1:(se&2)!==0&&Je!==0?Je&-Je:XR.transition!==null?(Fc===0&&(Fc=Bw()),Fc):(t=ue,t!==0||(t=window.event,t=t===void 0?16:qw(t.type)),t)}function dn(t,e,n,r){if(50<_a)throw _a=0,Hh=null,Error(T(185));$a(t,n,r),((se&2)===0||t!==Ke)&&(t===Ke&&((se&2)===0&&(vu|=n),Ue===4&&Fr(t,Je)),At(t,r),n===1&&se===0&&(e.mode&1)===0&&(Xo=Fe()+500,pu&&Xr()))}function At(t,e){var n=t.callbackNode;JA(t,e);var r=Hc(t,t===Ke?Je:0);if(r===0)n!==null&&_0(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&_0(n),e===1)t.tag===0?YR(fw.bind(null,t)):dx(fw.bind(null,t)),qR(function(){(se&6)===0&&Xr()}),n=null;else{switch(Vw(r)){case 1:n=Qh;break;case 4:n=$w;break;case 16:n=zc;break;case 536870912:n=Dw;break;default:n=zc}n=cS(n,nS.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function nS(t,e){if(Mc=-1,Fc=0,(se&6)!==0)throw Error(T(327));var n=t.callbackNode;if(Uo()&&t.callbackNode!==n)return null;var r=Hc(t,t===Ke?Je:0);if(r===0)return null;if((r&30)!==0||(r&t.expiredLanes)!==0||e)e=su(t,r);else{e=r;var i=se;se|=2;var o=iS();(Ke!==t||Je!==e)&&(Yn=null,Xo=Fe()+500,ki(t,e));do try{vT();break}catch(a){rS(t,a)}while(!0);dg(),ru.current=o,se=i,Be!==null?e=0:(Ke=null,Je=0,e=Ue)}if(e!==0){if(e===2&&(i=gh(t),i!==0&&(r=i,e=jh(t,i))),e===1)throw n=Fa,ki(t,0),Fr(t,r),At(t,Fe()),n;if(e===6)Fr(t,r);else{if(i=t.current.alternate,(r&30)===0&&!gT(i)&&(e=su(t,r),e===2&&(o=gh(t),o!==0&&(r=o,e=jh(t,o))),e===1))throw n=Fa,ki(t,0),Fr(t,r),At(t,Fe()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(T(345));case 2:wi(t,bt,Yn);break;case 3:if(Fr(t,r),(r&130023424)===r&&(e=Cg+500-Fe(),10<e)){if(Hc(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){ht(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=bh(wi.bind(null,t,bt,Yn),e);break}wi(t,bt,Yn);break;case 4:if(Fr(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var s=31-un(r);o=1<<s,s=e[s],s>i&&(i=s),r&=~o}if(r=i,r=Fe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*hT(r/1960))-r,10<r){t.timeoutHandle=bh(wi.bind(null,t,bt,Yn),r);break}wi(t,bt,Yn);break;case 5:wi(t,bt,Yn);break;default:throw Error(T(329))}}}return At(t,Fe()),t.callbackNode===n?nS.bind(null,t):null}function jh(t,e){var n=ya;return t.current.memoizedState.isDehydrated&&(ki(t,e).flags|=256),t=su(t,e),t!==2&&(e=bt,bt=n,e!==null&&Uh(e)),t}function Uh(t){bt===null?bt=t:bt.push.apply(bt,t)}function gT(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!fn(o(),i))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 Fr(t,e){for(e&=~Eg,e&=~vu,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-un(e),r=1<<n;t[n]=-1,e&=~r}}function fw(t){if((se&6)!==0)throw Error(T(327));Uo();var e=Hc(t,0);if((e&1)===0)return At(t,Fe()),null;var n=su(t,e);if(t.tag!==0&&n===2){var r=gh(t);r!==0&&(e=r,n=jh(t,r))}if(n===1)throw n=Fa,ki(t,0),Fr(t,e),At(t,Fe()),n;if(n===6)throw Error(T(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,wi(t,bt,Yn),At(t,Fe()),null}function Ag(t,e){var n=se;se|=1;try{return t(e)}finally{se=n,se===0&&(Xo=Fe()+500,pu&&Xr())}}function Pi(t){Dr!==null&&Dr.tag===0&&(se&6)===0&&Uo();var e=se;se|=1;var n=Gt.transition,r=ue;try{if(Gt.transition=null,ue=1,t)return t()}finally{ue=r,Gt.transition=n,se=e,(se&6)===0&&Xr()}}function Rg(){Nt=Do.current,we(Do)}function ki(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,WR(n)),Be!==null)for(n=Be.return;n!==null;){var r=n;switch(lg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Kc();break;case 3:Zo(),we(Et),we(at),vg();break;case 5:mg(r);break;case 4:Zo();break;case 13:we(Ae);break;case 19:we(Ae);break;case 10:fg(r.type._context);break;case 22:case 23:Rg()}n=n.return}if(Ke=t,Be=t=qr(t.current,null),Je=Nt=e,Ue=0,Fa=null,Eg=vu=Ti=0,bt=ya=null,Si!==null){for(e=0;e<Si.length;e++)if(n=Si[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}Si=null}return t}function rS(t,e){do{var n=Be;try{if(dg(),Oc.current=nu,tu){for(var r=Re.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}tu=!1}if(Ri=0,qe=je=Re=null,ma=!1,Na=0,kg.current=null,n===null||n.return===null){Ue=1,Fa=e,Be=null;break}e:{var o=t,s=n.return,a=n,l=e;if(e=Je,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if((u.mode&1)===0&&(f===0||f===11||f===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var g=J0(s);if(g!==null){g.flags&=-257,ew(g,s,a,o,e),g.mode&1&&Q0(o,c,e),e=g,l=c;var v=e.updateQueue;if(v===null){var _=new Set;_.add(l),e.updateQueue=_}else v.add(l);break e}else{if((e&1)===0){Q0(o,c,e),Tg();break e}l=Error(T(426))}}else if(be&&a.mode&1){var x=J0(s);if(x!==null){(x.flags&65536)===0&&(x.flags|=256),ew(x,s,a,o,e),cg(Yo(l,a));break e}}o=l=Yo(l,a),Ue!==4&&(Ue=2),ya===null?ya=[o]:ya.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var d=Vx(o,l,e);q0(o,d);break e;case 1:a=l;var p=o.type,m=o.stateNode;if((o.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Ur===null||!Ur.has(m)))){o.flags|=65536,e&=-e,o.lanes|=e;var y=zx(o,a,e);q0(o,y);break e}}o=o.return}while(o!==null)}sS(n)}catch(w){e=w,Be===n&&n!==null&&(Be=n=n.return);continue}break}while(!0)}function iS(){var t=ru.current;return ru.current=nu,t===null?nu:t}function Tg(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),Ke===null||(Ti&268435455)===0&&(vu&268435455)===0||Fr(Ke,Je)}function su(t,e){var n=se;se|=2;var r=iS();(Ke!==t||Je!==e)&&(Yn=null,ki(t,e));do try{mT();break}catch(i){rS(t,i)}while(!0);if(dg(),se=n,ru.current=r,Be!==null)throw Error(T(261));return Ke=null,Je=0,Ue}function mT(){for(;Be!==null;)oS(Be)}function vT(){for(;Be!==null&&!UA();)oS(Be)}function oS(t){var e=lS(t.alternate,t,Nt);t.memoizedProps=t.pendingProps,e===null?sS(t):Be=e,kg.current=null}function sS(t){var e=t;do{var n=e.alternate;if(t=e.return,(e.flags&32768)===0){if(n=cT(n,e,Nt),n!==null){Be=n;return}}else{if(n=uT(n,e),n!==null){n.flags&=32767,Be=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ue=6,Be=null;return}}if(e=e.sibling,e!==null){Be=e;return}Be=e=t}while(e!==null);Ue===0&&(Ue=5)}function wi(t,e,n){var r=ue,i=Gt.transition;try{Gt.transition=null,ue=1,yT(t,e,n,r)}finally{Gt.transition=i,ue=r}return null}function yT(t,e,n,r){do Uo();while(Dr!==null);if((se&6)!==0)throw Error(T(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(T(177));t.callbackNode=null,t.callbackPriority=0;var o=n.lanes|n.childLanes;if(eR(t,o),t===Ke&&(Be=Ke=null,Je=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Ac||(Ac=!0,cS(zc,function(){return Uo(),null})),o=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||o){o=Gt.transition,Gt.transition=null;var s=ue;ue=1;var a=se;se|=4,kg.current=null,fT(t,n),eS(n,t),VR(xh),jc=!!wh,xh=wh=null,t.current=n,pT(n,t,i),WA(),se=a,ue=s,Gt.transition=o}else t.current=n;if(Ac&&(Ac=!1,Dr=t,ou=i),o=t.pendingLanes,o===0&&(Ur=null),GA(n.stateNode,r),At(t,Fe()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(iu)throw iu=!1,t=zh,zh=null,t;return(ou&1)!==0&&t.tag!==0&&Uo(),o=t.pendingLanes,(o&1)!==0?t===Hh?_a++:(_a=0,Hh=t):_a=0,Xr(),null}function Uo(){if(Dr!==null){var t=Vw(ou),e=Gt.transition,n=ue;try{if(Gt.transition=null,ue=16>t?16:t,Dr===null)var r=!1;else{if(t=Dr,Dr=null,ou=0,(se&6)!==0)throw Error(T(331));var i=se;for(se|=4,$=t.current;$!==null;){var o=$,s=o.child;if(($.flags&16)!==0){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for($=c;$!==null;){var u=$;switch(u.tag){case 0:case 11:case 15:va(8,u,o)}var f=u.child;if(f!==null)f.return=u,$=f;else for(;$!==null;){u=$;var h=u.sibling,g=u.return;if(Xx(u),u===c){$=null;break}if(h!==null){h.return=g,$=h;break}$=g}}}var v=o.alternate;if(v!==null){var _=v.child;if(_!==null){v.child=null;do{var x=_.sibling;_.sibling=null,_=x}while(_!==null)}}$=o}}if((o.subtreeFlags&2064)!==0&&s!==null)s.return=o,$=s;else e:for(;$!==null;){if(o=$,(o.flags&2048)!==0)switch(o.tag){case 0:case 11:case 15:va(9,o,o.return)}var d=o.sibling;if(d!==null){d.return=o.return,$=d;break e}$=o.return}}var p=t.current;for($=p;$!==null;){s=$;var m=s.child;if((s.subtreeFlags&2064)!==0&&m!==null)m.return=s,$=m;else e:for(s=p;$!==null;){if(a=$,(a.flags&2048)!==0)try{switch(a.tag){case 0:case 11:case 15:mu(9,a)}}catch(w){Pe(a,a.return,w)}if(a===s){$=null;break e}var y=a.sibling;if(y!==null){y.return=a.return,$=y;break e}$=a.return}}if(se=i,Xr(),Rn&&typeof Rn.onPostCommitFiberRoot=="function")try{Rn.onPostCommitFiberRoot(lu,t)}catch{}r=!0}return r}finally{ue=n,Gt.transition=e}}return!1}function pw(t,e,n){e=Yo(n,e),e=Vx(t,e,1),t=jr(t,e,1),e=ht(),t!==null&&($a(t,1,e),At(t,e))}function Pe(t,e,n){if(t.tag===3)pw(t,t,n);else for(;e!==null;){if(e.tag===3){pw(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ur===null||!Ur.has(r))){t=Yo(n,t),t=zx(e,t,1),e=jr(e,t,1),t=ht(),e!==null&&($a(e,1,t),At(e,t));break}}e=e.return}}function _T(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=ht(),t.pingedLanes|=t.suspendedLanes&n,Ke===t&&(Je&n)===n&&(Ue===4||Ue===3&&(Je&130023424)===Je&&500>Fe()-Cg?ki(t,0):Eg|=n),At(t,e)}function aS(t,e){e===0&&((t.mode&1)===0?e=1:(e=pc,pc<<=1,(pc&130023424)===0&&(pc=4194304)));var n=ht();t=rr(t,e),t!==null&&($a(t,e,n),At(t,n))}function wT(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),aS(t,n)}function xT(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(T(314))}r!==null&&r.delete(e),aS(t,n)}var lS;lS=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Et.current)kt=!0;else{if((t.lanes&n)===0&&(e.flags&128)===0)return kt=!1,lT(t,e,n);kt=(t.flags&131072)!==0}else kt=!1,be&&(e.flags&1048576)!==0&&fx(e,Yc,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Lc(t,e),t=e.pendingProps;var i=qo(e,at.current);jo(e,n),i=_g(null,e,r,t,i,n);var o=wg();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ct(r)?(o=!0,Gc(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,hg(e),i.updater=gu,e.stateNode=i,i._reactInternals=e,Ph(e,r,t,n),e=Nh(null,e,r,!0,o,n)):(e.tag=0,be&&o&&ag(e),pt(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Lc(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=bT(r),t=an(r,t),i){case 0:e=Oh(null,e,r,t,n);break e;case 1:e=rw(null,e,r,t,n);break e;case 11:e=tw(null,e,r,t,n);break e;case 14:e=nw(null,e,r,an(r.type,t),n);break e}throw Error(T(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:an(r,i),Oh(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:an(r,i),rw(t,e,r,i,n);case 3:e:{if(Wx(e),t===null)throw Error(T(387));r=e.pendingProps,o=e.memoizedState,i=o.element,yx(t,e),Jc(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Yo(Error(T(423)),e),e=iw(t,e,r,n,i);break e}else if(r!==i){i=Yo(Error(T(424)),e),e=iw(t,e,r,n,i);break e}else for(Lt=Hr(e.stateNode.containerInfo.firstChild),Mt=e,be=!0,cn=null,n=mx(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ko(),r===i){e=ir(t,e,n);break e}pt(t,e,r,n)}e=e.child}return e;case 5:return _x(e),t===null&&Ah(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,Sh(r,i)?s=null:o!==null&&Sh(r,o)&&(e.flags|=32),Ux(t,e),pt(t,e,s,n),e.child;case 6:return t===null&&Ah(e),null;case 13:return qx(t,e,n);case 4:return gg(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Go(e,null,r,n):pt(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:an(r,i),tw(t,e,r,i,n);case 7:return pt(t,e,e.pendingProps,n),e.child;case 8:return pt(t,e,e.pendingProps.children,n),e.child;case 12:return pt(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,me(Xc,r._currentValue),r._currentValue=s,o!==null)if(fn(o.value,s)){if(o.children===i.children&&!Et.current){e=ir(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=er(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Rh(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(T(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Rh(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}pt(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,jo(e,n),i=Zt(i),r=r(i),e.flags|=1,pt(t,e,r,n),e.child;case 14:return r=e.type,i=an(r,e.pendingProps),i=an(r.type,i),nw(t,e,r,i,n);case 15:return Hx(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:an(r,i),Lc(t,e),e.tag=1,Ct(r)?(t=!0,Gc(e)):t=!1,jo(e,n),Bx(e,r,i),Ph(e,r,i,n),Nh(null,e,r,!0,t,n);case 19:return Kx(t,e,n);case 22:return jx(t,e,n)}throw Error(T(156,e.tag))};function cS(t,e){return Fw(t,e)}function ST(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,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 Kt(t,e,n,r){return new ST(t,e,n,r)}function Pg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function bT(t){if(typeof t=="function")return Pg(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Zh)return 11;if(t===Yh)return 14}return 2}function qr(t,e){var n=t.alternate;return n===null?(n=Kt(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&14680064,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}function $c(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")Pg(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Ro:return Ei(n.children,i,o,e);case Gh:s=8,i|=8;break;case eh:return t=Kt(12,n,e,i|2),t.elementType=eh,t.lanes=o,t;case th:return t=Kt(13,n,e,i),t.elementType=th,t.lanes=o,t;case nh:return t=Kt(19,n,e,i),t.elementType=nh,t.lanes=o,t;case _w:return yu(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case vw:s=10;break e;case yw:s=9;break e;case Zh:s=11;break e;case Yh:s=14;break e;case Nr:s=16,r=null;break e}throw Error(T(130,t==null?t:typeof t,""))}return e=Kt(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Ei(t,e,n,r){return t=Kt(7,t,r,e),t.lanes=n,t}function yu(t,e,n,r){return t=Kt(22,t,r,e),t.elementType=_w,t.lanes=n,t.stateNode={isHidden:!1},t}function Xp(t,e,n){return t=Kt(6,t,null,e),t.lanes=n,t}function Qp(t,e,n){return e=Kt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function kT(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Mp(0),this.expirationTimes=Mp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mp(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ig(t,e,n,r,i,o,s,a,l){return t=new kT(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Kt(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},hg(o),t}function ET(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ao,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function uS(t){if(!t)return Gr;t=t._reactInternals;e:{if(Oi(t)!==t||t.tag!==1)throw Error(T(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Ct(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(T(171))}if(t.tag===1){var n=t.type;if(Ct(n))return ux(t,n,e)}return e}function dS(t,e,n,r,i,o,s,a,l){return t=Ig(n,r,!0,t,i,o,s,a,l),t.context=uS(null),n=t.current,r=ht(),i=Wr(n),o=er(r,i),o.callback=e??null,jr(n,o,i),t.current.lanes=i,$a(t,i,r),At(t,r),t}function _u(t,e,n,r){var i=e.current,o=ht(),s=Wr(i);return n=uS(n),e.context===null?e.context=n:e.pendingContext=n,e=er(o,s),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=jr(i,e,s),t!==null&&(dn(t,i,s,o),Ic(t,i,s)),s}function au(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function hw(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Og(t,e){hw(t,e),(t=t.alternate)&&hw(t,e)}function CT(){return null}var fS=typeof reportError=="function"?reportError:function(t){console.error(t)};function Ng(t){this._internalRoot=t}wu.prototype.render=Ng.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(T(409));_u(t,e,null,null)};wu.prototype.unmount=Ng.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Pi(function(){_u(null,t,null,null)}),e[nr]=null}};function wu(t){this._internalRoot=t}wu.prototype.unstable_scheduleHydration=function(t){if(t){var e=jw();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Mr.length&&e!==0&&e<Mr[n].priority;n++);Mr.splice(n,0,t),n===0&&Ww(t)}};function Lg(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function xu(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function gw(){}function AT(t,e,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var c=au(s);o.call(c)}}var s=dS(e,r,t,0,null,!1,!1,"",gw);return t._reactRootContainer=s,t[nr]=s.current,Ra(t.nodeType===8?t.parentNode:t),Pi(),s}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=au(l);a.call(c)}}var l=Ig(t,0,!1,null,null,!1,!1,"",gw);return t._reactRootContainer=l,t[nr]=l.current,Ra(t.nodeType===8?t.parentNode:t),Pi(function(){_u(e,l,n,r)}),l}function Su(t,e,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var a=i;i=function(){var l=au(s);a.call(l)}}_u(e,s,t,i)}else s=AT(n,e,t,i,r);return au(s)}zw=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=ca(e.pendingLanes);n!==0&&(Jh(e,n|1),At(e,Fe()),(se&6)===0&&(Xo=Fe()+500,Xr()))}break;case 13:Pi(function(){var r=rr(t,1);if(r!==null){var i=ht();dn(r,t,1,i)}}),Og(t,1)}};eg=function(t){if(t.tag===13){var e=rr(t,134217728);if(e!==null){var n=ht();dn(e,t,134217728,n)}Og(t,134217728)}};Hw=function(t){if(t.tag===13){var e=Wr(t),n=rr(t,e);if(n!==null){var r=ht();dn(n,t,e,r)}Og(t,e)}};jw=function(){return ue};Uw=function(t,e){var n=ue;try{return ue=t,e()}finally{ue=n}};fh=function(t,e,n){switch(e){case"input":if(oh(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=fu(r);if(!i)throw Error(T(90));xw(r),oh(r,i)}}}break;case"textarea":bw(t,n);break;case"select":e=n.value,e!=null&&Bo(t,!!n.multiple,e,!1)}};Pw=Ag;Iw=Pi;var RT={usingClientEntryPoint:!1,Events:[Ba,Oo,fu,Rw,Tw,Ag]},oa={findFiberByHostInstance:xi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},TT={bundleType:oa.bundleType,version:oa.version,rendererPackageName:oa.rendererPackageName,rendererConfig:oa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:or.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Lw(t),t===null?null:t.stateNode},findFiberByHostInstance:oa.findFiberByHostInstance||CT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(sa=__REACT_DEVTOOLS_GLOBAL_HOOK__,!sa.isDisabled&&sa.supportsFiber))try{lu=sa.inject(TT),Rn=sa}catch{}var sa;Dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=RT;Dt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Lg(e))throw Error(T(200));return ET(t,e,null,n)};Dt.createRoot=function(t,e){if(!Lg(t))throw Error(T(299));var n=!1,r="",i=fS;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Ig(t,1,!1,null,null,n,!1,r,i),t[nr]=e.current,Ra(t.nodeType===8?t.parentNode:t),new Ng(e)};Dt.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(T(188)):(t=Object.keys(t).join(","),Error(T(268,t)));return t=Lw(e),t=t===null?null:t.stateNode,t};Dt.flushSync=function(t){return Pi(t)};Dt.hydrate=function(t,e,n){if(!xu(e))throw Error(T(200));return Su(null,t,e,!0,n)};Dt.hydrateRoot=function(t,e,n){if(!Lg(t))throw Error(T(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=fS;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),e=dS(e,null,t,1,n??null,i,!1,o,s),t[nr]=e.current,Ra(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new wu(e)};Dt.render=function(t,e,n){if(!xu(e))throw Error(T(200));return Su(null,t,e,!1,n)};Dt.unmountComponentAtNode=function(t){if(!xu(t))throw Error(T(40));return t._reactRootContainer?(Pi(function(){Su(null,null,t,!1,function(){t._reactRootContainer=null,t[nr]=null})}),!0):!1};Dt.unstable_batchedUpdates=Ag;Dt.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!xu(n))throw Error(T(200));if(t==null||t._reactInternals===void 0)throw Error(T(38));return Su(t,e,n,!1,r)};Dt.version="18.3.1-next-f1338f8080-20240426"});var bu=Vn((iL,gS)=>{"use strict";function hS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hS)}catch(t){console.error(t)}}hS(),gS.exports=pS()});var bS=Vn(Dg=>{"use strict";var SS=bu();Dg.createRoot=SS.createRoot,Dg.hydrateRoot=SS.hydrateRoot;var bL});var C=typeof window<"u"?window:void 0,Ye=typeof globalThis<"u"?globalThis:C;typeof self>"u"&&(Ye.self=Ye),typeof File>"u"&&(Ye.File=function(){});var jv=Array.prototype,Gm=jv.forEach,Zm=jv.indexOf,It=Ye?.navigator,N=Ye?.document,_t=Ye?.location,yd=Ye?.fetch,_d=Ye!=null&&Ye.XMLHttpRequest&&"withCredentials"in new Ye.XMLHttpRequest?Ye.XMLHttpRequest:void 0,Ym=Ye?.AbortController,yt=It?.userAgent,G=C??{},Hn={DEBUG:!1,LIB_VERSION:"1.302.2"};function Xm(t,e,n,r,i,o,s){try{var a=t[o](s),l=a.value}catch(c){return void n(c)}a.done?e(l):Promise.resolve(l).then(r,i)}function Qm(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(l){Xm(o,r,i,s,a,"next",l)}function a(l){Xm(o,r,i,s,a,"throw",l)}s(void 0)}))}}function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},F.apply(null,arguments)}function Uv(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var Kk=["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"],Jm=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return Kk.concat(e).some((r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1}))},Gk=["$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 te(t,e){return t.indexOf(e)!==-1}var Il=function(t){return t.trim()},wd=function(t){return t.replace(/^\$/,"")},Zk=Array.isArray,Wv=Object.prototype,qv=Wv.hasOwnProperty,Ol=Wv.toString,fe=Zk||function(t){return Ol.call(t)==="[object Array]"},kr=t=>typeof t=="function",We=t=>t===Object(t)&&!fe(t),so=t=>{if(We(t)){for(var e in t)if(qv.call(t,e))return!1;return!0}return!1},O=t=>t===void 0,ze=t=>Ol.call(t)=="[object String]",xd=t=>ze(t)&&t.trim().length===0,qn=t=>t===null,de=t=>O(t)||qn(t),wn=t=>Ol.call(t)=="[object Number]",Er=t=>Ol.call(t)==="[object Boolean]",Yk=t=>t instanceof FormData,Xk=t=>te(Gk,t);function Sd(t){return t===null||typeof t!="object"}function ul(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function Kv(t){return!O(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var Qk=[!0,"true",1,"1","yes"],rd=t=>te(Qk,t),Jk=[!1,"false",0,"0","no"];function vn(t,e,n,r,i){return e>n&&(r.warn("min cannot be greater than max."),e=n),wn(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):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: "+n+", fallback: "+i),vn(i||n,e,n,r))}var bd=class{constructor(e){this.t={},this.i=e.i,this.o=vn(e.bucketSize,0,100,e.h),this.m=vn(e.refillRate,0,this.o,e.h),this.S=vn(e.refillInterval,0,864e5,e.h)}$(e,n){var r=n-e.lastAccess,i=Math.floor(r/this.S);if(i>0){var o=i*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+i*this.S}}consumeRateLimit(e){var n,r=Date.now(),i=String(e),o=this.t[i];return o?this.$(o,r):(o={tokens:this.o,lastAccess:r},this.t[i]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((n=this.i)==null||n.call(this,e)),o.tokens===0)}stop(){this.t={}}},el,ev,id,e1=t=>t instanceof Error;function t1(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return id&&n.length===ev||(ev=n.length,id=n.reduce(((r,i)=>{el||(el={});var o=el[i];if(o)r[o[0]]=o[1];else for(var s=t(i),a=s.length-1;a>=0;a--){var l=s[a],c=l?.filename,u=e[i];if(c&&u){r[c]=u,el[i]=[c,u];break}}return r}),{})),id}}var kd=class{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,n,0).apply(e),o=this.buildParsingContext(),s=this.parseStacktrace(i,o);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var n=this;return Qm((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&fe(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.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 r,i;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),n.chunkIdMap)),F({},e,{cause:r,stack:i})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return Qm((function*(){var r=e;for(var i of n.modifiers)r=yield i(r);return r}))()}convertToExceptionList(e,n){var r,i,o,s={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(i=n.handled)===null||i===void 0||i,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var a=[s];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,F({},n,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:t1(this.stackParser)}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var i=(o,s)=>{if(s<=4){var a=this.buildCoercingContext(e,n,s);return this.applyCoercers(o,a)}};return F({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:o=>i(o,r),next:o=>i(o,r+1)})}},uo="?";function Ed(t,e,n,r,i){var o={platform:t,filename:e,function:n==="<anonymous>"?uo:n,in_app:!0};return O(r)||(o.lineno=r),O(i)||(o.colno=i),o}var Gv=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:uo,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},n1=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,r1=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,i1=/\((\S*)(?::(\d+))(?::(\d+))\)/,o1=(t,e)=>{var n=n1.exec(t);if(n){var[,r,i,o]=n;return Ed(e,r,uo,+i,+o)}var s=r1.exec(t);if(s){if(s[2]&&s[2].indexOf("eval")===0){var a=i1.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3])}var[l,c]=Gv(s[1]||uo,s[2]);return Ed(e,c,l,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},s1=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,a1=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,l1=(t,e)=>{var n=s1.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=a1.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],o=n[1]||uo;return[o,i]=Gv(o,i),Ed(e,i,o,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},tv=/\(error: (.*)\)/,nv=50;function c1(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(i,o){o===void 0&&(o=0);for(var s=[],a=i.split(`
9
+ `),l=o;l<a.length;l++){var c=a[l];if(!(c.length>1024)){var u=tv.test(c)?c.replace(tv,"$1"):c;if(!u.match(/\S*Error: /)){for(var f of n){var h=f(u,t);if(h){s.push(h);break}}if(s.length>=nv)break}}}return(function(g){if(!g.length)return[];var v=Array.from(g);return v.reverse(),v.slice(0,nv).map((_=>{return F({},_,{filename:_.filename||(x=v,x[x.length-1]||{}).filename,function:_.function||uo});var x}))})(s)}}var Cd=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=ze(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?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 ul(e,"DOMException")}isDOMError(e){return ul(e,"DOMError")}},Ad=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 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}},Rd=class{constructor(){}match(e){return ul(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r,i=n.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},u1=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Td=class{match(e){return typeof e=="string"}coerce(e,n){var r,[i,o]=this.getInfos(e);return{type:i??"Error",value:o??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,i=e.match(u1);return i&&(n=i[1],r=i[2]),[n,r]}},d1=["fatal","error","warning","log","info","debug"];function Zv(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length||i.length<=e?i:i.slice(0,e)+"..."}return""}var Pd=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,i=this.getErrorPropertyFromObject(e);return i?n.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Kv(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 r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+Zv(e)}isSeverityLevel(e){return ze(e)&&!xd(e)&&d1.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(e1(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},Id=class{match(e){return Kv(e)}coerce(e,n){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Zv(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},Od=class{match(e){return Sd(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},Nd=class{match(e){return ul(e,"PromiseRejectionEvent")}coerce(e,n){var r,i=this.getUnhandledRejectionReason(e);return Sd(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(i)}getUnhandledRejectionReason(e){if(Sd(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}},Yv=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,r={k:function(i){if(C&&(Hn.DEBUG||G.POSTHOG_DEBUG||n)&&!O(C.console)&&C.console){for(var o=("__rrweb_original__"in C.console[i])?C.console[i].__rrweb_original__:C.console[i],s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];o(t,...a)}},info:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];r.k("log",...o)},warn:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];r.k("warn",...o)},error:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];r.k("error",...o)},critical:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];console.error(t,...o)},uninitializedWarning:i=>{r.error("You must initialize PostHog before calling "+i)},createLogger:(i,o)=>Yv(t+" "+i,o)};return r},L=Yv("[PostHog.js]"),He=L.createLogger,f1=He("[ExternalScriptsLoader]"),rv=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return f1.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=N?.querySelectorAll("script");if(r){for(var i,o=function(){if(r[s].src===e){var l=r[s];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})}},s=0;s<r.length;s++)if(i=o())return i.v}var a=()=>{if(!N)return n("document not found");var l=N.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=f=>{l.__posthog_loading_callback_fired=!0,n(void 0,f)},l.onerror=f=>n(f),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");var c,u=N.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):N.body.appendChild(l)};N!=null&&N.body?a():N?.addEventListener("DOMContentLoaded",a)};G.__PosthogExtensions__=G.__PosthogExtensions__||{},G.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var i=3e5;r=r+"&t="+Math.floor(Date.now()/i)*i}var o=t.requestRouter.endpointFor("assets",r);rv(t,o,n)},G.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);rv(t,r,n)};var dl={};function Cr(t,e,n){if(fe(t)){if(Gm&&t.forEach===Gm)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r)===dl)return}}}function pe(t,e,n){if(!de(t)){if(fe(t))return Cr(t,e,n);if(Yk(t)){for(var r of t.entries())if(e.call(n,r[1],r[0])===dl)return}else for(var i in t)if(qv.call(t,i)&&e.call(n,t[i],i)===dl)return}}var Me=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Cr(n,(function(i){for(var o in i)i[o]!==void 0&&(t[o]=i[o])})),t},ho=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Cr(n,(function(i){Cr(i,(function(o){t.push(o)}))})),t};function al(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var iv=function(t){try{return t()}catch{return}},p1=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.apply(this,n)}catch(i){L.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),L.critical(i)}}},Tf=function(t){var e={};return pe(t,(function(n,r){(ze(n)&&n.length>0||wn(n))&&(e[r]=n)})),e};function h1(t,e){return n=t,r=o=>ze(o)&&!qn(e)?o.slice(0,e):o,i=new Set,(function o(s,a){return s!==Object(s)?r?r(s,a):s:i.has(s)?void 0:(i.add(s),fe(s)?(l=[],Cr(s,(c=>{l.push(o(c))}))):(l={},pe(s,((c,u)=>{i.has(c)||(l[u]=o(c,u))}))),l);var l})(n);var n,r,i}var g1=["herokuapp.com","vercel.app","netlify.app"];function m1(t){var e=t?.hostname;if(!ze(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of g1)if(n===r)return!1;return!0}function Xv(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function De(t,e,n,r){var{capture:i=!1,passive:o=!0}=r??{};t?.addEventListener(e,n,{capture:i,passive:o})}var Qv="$people_distinct_id",bs="__alias",ks="__timers",ov="$autocapture_disabled_server_side",Ld="$heatmaps_enabled_server_side",sv="$exception_capture_enabled_server_side",Md="$error_tracking_suppression_rules",av="$error_tracking_capture_extension_exceptions",lv="$web_vitals_enabled_server_side",Jv="$dead_clicks_enabled_server_side",cv="$web_vitals_allowed_metrics",od="$session_recording_remote_config",fl="$sesid",ey="$session_is_sampled",ao="$enabled_feature_flags",Es="$early_access_features",Fd="$feature_flag_details",Cs="$stored_person_properties",fi="$stored_group_properties",$d="$surveys",tl="$surveys_activated",pl="$flag_call_reported",jn="$user_state",Dd="$client_session_props",Bd="$capture_rate_limit",Vd="$initial_campaign_params",zd="$initial_referrer_info",hl="$initial_person_info",gl="$epp",ty="__POSTHOG_TOOLBAR__",hs="$posthog_cookieless",v1=[Qv,bs,"__cmpns",ks,"$session_recording_enabled_server_side",Ld,fl,ao,Md,jn,Es,Fd,fi,Cs,$d,pl,Dd,Bd,Vd,zd,gl,hl];function uv(t){return t instanceof Element&&(t.id===ty||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Nl(t){return!!t&&t.nodeType===1}function Ar(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function ny(t){return!!t&&t.nodeType===3}function ry(t){return!!t&&t.nodeType===11}function Pf(t){return t?Il(t).split(/\s+/):[]}function dv(t){var e=C?.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function ml(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 Pf(e)}function iy(t){return de(t)?null:Il(t).split(/(\s+)/).filter((e=>Ns(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Bs(t){var e="";return Hd(t)&&!cy(t)&&t.childNodes&&t.childNodes.length&&pe(t.childNodes,(function(n){var r;ny(n)&&n.textContent&&(e+=(r=iy(n.textContent))!==null&&r!==void 0?r:"")})),Il(e)}function oy(t){return O(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var If=["a","button","form","input","select","textarea","label"];function sy(t,e){if(O(e))return!0;var n,r=function(o){if(e.some((s=>o.matches(s))))return{v:!0}};for(var i of t)if(n=r(i))return n.v;return!1}function ay(t){var e=t.parentNode;return!(!e||!Nl(e))&&e}var y1=["next","previous","prev",">","<"],fv=10,pv=[".ph-no-rageclick",".ph-no-capture"];function _1(t,e){if(!C||Of(t))return!1;var n,r,i;if(Er(e)?(n=!!e&&pv,r=void 0):(n=(i=e?.css_selector_ignorelist)!==null&&i!==void 0?i:pv,r=e?.content_ignorelist),n===!1)return!1;var{targetElementList:o}=ly(t,!1);return!(function(s,a){if(s===!1||O(s))return!1;var l;if(s===!0)l=y1;else{if(!fe(s))return!1;if(s.length>fv)return L.error("[PostHog] content_ignorelist array cannot exceed "+fv+" items. Use css_selector_ignorelist for more complex matching."),!1;l=s.map((c=>c.toLowerCase()))}return a.some((c=>{var{safeText:u,ariaLabel:f}=c;return l.some((h=>u.includes(h)||f.includes(h)))}))})(r,o.map((s=>{var a;return{safeText:Bs(s).toLowerCase(),ariaLabel:((a=s.getAttribute("aria-label"))==null?void 0:a.toLowerCase().trim())||""}})))&&!sy(o,n)}var Of=t=>!t||Ar(t,"html")||!Nl(t),ly=(t,e)=>{if(!C||Of(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],i=t;i.parentNode&&!Ar(i,"body");)if(ry(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var o=ay(i);if(!o)break;if(e||If.indexOf(o.tagName.toLowerCase())>-1)n=!0;else{var s=C.getComputedStyle(o);s&&s.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(o),i=o}return{parentIsUsefulElement:n,targetElementList:r}};function w1(t,e,n,r,i){var o,s,a,l;if(n===void 0&&(n=void 0),!C||Of(t)||(o=n)!=null&&o.url_allowlist&&!dv(n.url_allowlist)||(s=n)!=null&&s.url_ignorelist&&dv(n.url_ignorelist))return!1;if((a=n)!=null&&a.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some((v=>e.type===v)))return!1}var{parentIsUsefulElement:u,targetElementList:f}=ly(t,r);if(!(function(v,_){var x=_?.element_allowlist;if(O(x))return!0;var d,p=function(y){if(x.some((w=>y.tagName.toLowerCase()===w)))return{v:!0}};for(var m of v)if(d=p(m))return d.v;return!1})(f,n)||!sy(f,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var h=C.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(i||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(e.type)>=0;default:return u?(i||["click"]).indexOf(e.type)>=0:(i||["click"]).indexOf(e.type)>=0&&(If.indexOf(g)>-1||t.getAttribute("contenteditable")==="true")}}function Hd(t){for(var e=t;e.parentNode&&!Ar(e,"body");e=e.parentNode){var n=ml(e);if(te(n,"ph-sensitive")||te(n,"ph-no-capture"))return!1}if(te(ml(t),"ph-include"))return!0;var r=t.type||"";if(ze(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.id||"";return!(ze(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function cy(t){return!!(Ar(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Ar(t,"select")||Ar(t,"textarea")||t.getAttribute("contenteditable")==="true")}var uy="(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})",x1=new RegExp("^(?:"+uy+")$"),S1=new RegExp(uy),dy="\\d{3}-?\\d{2}-?\\d{4}",b1=new RegExp("^("+dy+")$"),k1=new RegExp("("+dy+")");function Ns(t,e){return e===void 0&&(e=!0),!(de(t)||ze(t)&&(t=Il(t),(e?x1:S1).test((t||"").replace(/[- ]/g,""))||(e?b1:k1).test(t)))}function fy(t){var e=Bs(t);return Ns(e=(e+" "+py(t)).trim())?e:""}function py(t){var e="";return t&&t.childNodes&&t.childNodes.length&&pe(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var i=Bs(n);e=(e+" "+i).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+py(n)).trim())}catch(o){L.error("[AutoCapture]",o)}})),e}function E1(t){return(function(e){var n=e.map((r=>{var i,o,s="";if(r.tag_name&&(s+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))s+="."+a.replace(/"/g,"");var l=F({},r.text?{text:r.text}:{},{"nth-child":(i=r.nth_child)!==null&&i!==void 0?i: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),c={};return al(l).sort(((u,f)=>{var[h]=u,[g]=f;return h.localeCompare(g)})).forEach((u=>{var[f,h]=u;return c[hv(f.toString())]=hv(h.toString())})),s+=":",s+=al(c).map((u=>{var[f,h]=u;return f+'="'+h+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var r,i,o={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(i=n.attr__href)==null?void 0:i.slice(0,2048),attr_class:C1(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return al(n).filter((s=>{var[a]=s;return a.indexOf("attr__")===0})).forEach((s=>{var[a,l]=s;return o.attributes[a]=l})),o}))})(t))}function hv(t){return t.replace(/"|\\"/g,'\\"')}function C1(t){var e=t.attr__class;return e?fe(e)?e:Pf(e):void 0}var vl=class{constructor(e){this.disabled=e===!1;var n=We(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,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(n-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}},sd="$copy_autocapture",Wn=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var yl=t=>{var e=N?.createElement("a");return O(e)?null:(e.href=t,e)},A1=function(t,e){var n,r;e===void 0&&(e="&");var i=[];return pe(t,(function(o,s){O(o)||O(s)||s==="undefined"||(n=encodeURIComponent((a=>a instanceof File)(o)?o.name:o.toString()),r=encodeURIComponent(s),i[i.length]=r+"="+n)})),i.join(e)},_l=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===e){n=o;break}}if(!fe(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch{L.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Vs=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),i=r[0]||"",o=r[1],s=i.split("?"),a=s[1],l=s[0],c=(a||"").split("&"),u=[],f=0;f<c.length;f++){var h=c[f].split("=");fe(h)&&(e.includes(h[0])?u.push(h[0]+"="+n):u.push(c[f]))}var g=l;return a!=null&&(g+="?"+u.join("&")),o!=null&&(g+="#"+o),g},wl=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},gv=He("[AutoCapture]");function ad(t,e){return e.length>t?e.slice(0,t)+"...":e}function R1(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Nl(e));return e}function T1(t,e,n,r){var i=t.tagName.toLowerCase(),o={tag_name:i};If.indexOf(i)>-1&&!n&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?o.$el_text=ad(1024,fy(t)):o.$el_text=ad(1024,Bs(t)));var s=ml(t);s.length>0&&(o.classes=s.filter((function(u){return u!==""}))),pe(t.attributes,(function(u){var f;if((!cy(t)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(r==null||!r.includes(u.name))&&!e&&Ns(u.value)&&(f=u.name,!ze(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var h=u.value;u.name==="class"&&(h=Pf(h).join(" ")),o["attr__"+u.name]=ad(1024,h)}}));for(var a=1,l=1,c=t;c=R1(c);)a++,c.tagName===t.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function P1(t,e){for(var n,r,{e:i,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,c=[t],u=t;u.parentNode&&!Ar(u,"body");)ry(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var f,h=[],g={},v=!1,_=!1;if(pe(c,(y=>{var w=Hd(y);y.tagName.toLowerCase()==="a"&&(v=y.getAttribute("href"),v=w&&v&&Ns(v)&&v),te(ml(y),"ph-no-capture")&&(_=!0),h.push(T1(y,o,s,a));var k=(function(b){if(!Hd(b))return{};var E={};return pe(b.attributes,(function(P){if(P.name&&P.name.indexOf("data-ph-capture-attribute")===0){var A=P.name.replace("data-ph-capture-attribute-",""),H=P.value;A&&H&&Ns(H)&&(E[A]=H)}})),E})(y);Me(g,k)})),_)return{props:{},explicitNoCapture:_};if(s||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=fy(t):h[0].$el_text=Bs(t)),v){var x,d;h[0].attr__href=v;var p=(x=yl(v))==null?void 0:x.host,m=C==null||(d=C.location)==null?void 0:d.host;p&&m&&p!==m&&(f=v)}return{props:Me({$event_type:i.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:E1(h)},(n=h[0])!=null&&n.$el_text?{$el_text:(r=h[0])==null?void 0:r.$el_text}:{},f&&i.type==="click"?{$external_click_url:f}:{},g)}}var jd=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new vl(e.config.rageclick),this.I=null}get F(){var e,n,r=We(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)==null?void 0:e.map((i=>new RegExp(i))),r.url_ignorelist=(n=r.url_ignorelist)==null?void 0:n.map((i=>new RegExp(i))),r}C(){if(this.isBrowserSupported()){if(C&&N){var e=r=>{r=r||C?.event;try{this.M(r)}catch(i){gv.error("Failed to capture event",i)}};if(De(N,"submit",e,{capture:!0}),De(N,"change",e,{capture:!0}),De(N,"click",e,{capture:!0}),this.F.capture_copied_text){var n=r=>{r=r||C?.event,this.M(r,sd)};De(N,"copy",n,{capture:!0}),De(N,"cut",n,{capture:!0})}}}else gv.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({[ov]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var n,r=[];return(n=this.I)==null||n.forEach((i=>{var o=N?.querySelectorAll(i);o?.forEach((s=>{e===s&&r.push(i)}))})),r}get isEnabled(){var e,n,r=(e=this.instance.persistence)==null?void 0:e.props[ov],i=this.T;if(qn(i)&&!Er(r)&&!this.instance.O())return!1;var o=(n=this.T)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!o}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r,i=oy(e);ny(i)&&(i=i.parentNode||null),n==="$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())&&_1(i,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=n===sd;if(i&&w1(i,e,this.F,o,o?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:a}=P1(i,{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(a)return!1;var l=this.getElementSelectors(i);if(l&&l.length>0&&(s.$element_selectors=l),n===sd){var c,u=iy(C==null||(c=C.getSelection())==null?void 0:c.toString()),f=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=f}return this.instance.capture(n,s),!0}}}isBrowserSupported(){return kr(N?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return wn(t)&&isFinite(t)&&Math.floor(t)===t});var mv="0123456789abcdef",Ud=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,i){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||n<0||r<0||i<0||e>0xffffffffffff||n>4095||r>1073741823||i>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|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new t(o)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+mv.charAt(this.bytes[n]>>>4)+mv.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 r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},Wd=class{constructor(){this.A=0,this.D=0,this.j=new qd}generate(){var e=this.generateOrAbort();if(O(e)){this.A=0;var n=this.generateOrAbort();if(O(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 Ud.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())}},vv,hy=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};C&&!O(C.crypto)&&crypto.getRandomValues&&(hy=t=>crypto.getRandomValues(t));var qd=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(hy(this.N),this.U=0),this.N[this.U++]}},br=()=>I1().toString(),I1=()=>(vv||(vv=new Wd)).generate(),gs="",O1=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function N1(t,e){if(e){var n=(function(i,o){if(o===void 0&&(o=N),gs)return gs;if(!o||["localhost","127.0.0.1"].includes(i))return"";for(var s=i.split("."),a=Math.min(s.length,8),l="dmn_chk_"+br();!gs&&a--;){var c=s.slice(a).join("."),u=l+"=1;domain=."+c+";path=/";o.cookie=u+";max-age=3",o.cookie.includes(l)&&(o.cookie=u+";max-age=0",gs=c)}return gs})(t);if(!n){var r=(i=>{var o=i.match(O1);return o?o[0]:""})(t);r!==n&&L.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var _n={H:()=>!!N,B:function(t){L.error("cookieStore error: "+t)},q:function(t){if(N){try{for(var e=t+"=",n=N.cookie.split(";").filter((o=>o.length)),r=0;r<n.length;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(_n.q(t))||{}}catch{}return e},G:function(t,e,n,r,i){if(N)try{var o="",s="",a=N1(N.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}i&&(s="; secure");var c=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return c.length>3686.4&&L.warn("cookieStore warning: large cookie, len="+c.length),N.cookie=c,c}catch{return}},V:function(t,e){if(N!=null&&N.cookie)try{_n.G(t,"",-1,e)}catch{return}}},ld=null,ke={H:function(){if(!qn(ld))return ld;var t=!0;if(O(C))t=!1;else try{var e="__mplssupport__";ke.G(e,"xyz"),ke.q(e)!=='"xyz"'&&(t=!1),ke.V(e)}catch{t=!1}return t||L.error("localStorage unsupported; falling back to cookie store"),ld=t,t},B:function(t){L.error("localStorage error: "+t)},q:function(t){try{return C?.localStorage.getItem(t)}catch(e){ke.B(e)}return null},W:function(t){try{return JSON.parse(ke.q(t))||{}}catch{}return null},G:function(t,e){try{C?.localStorage.setItem(t,JSON.stringify(e))}catch(n){ke.B(n)}},V:function(t){try{C?.localStorage.removeItem(t)}catch(e){ke.B(e)}}},L1=["distinct_id",fl,ey,gl,hl],nl=F({},ke,{W:function(t){try{var e={};try{e=_n.W(t)||{}}catch{}var n=Me(e,JSON.parse(ke.q(t)||"{}"));return ke.G(t,n),n}catch{}return null},G:function(t,e,n,r,i,o){try{ke.G(t,e,void 0,void 0,o);var s={};L1.forEach((a=>{e[a]&&(s[a]=e[a])})),Object.keys(s).length&&_n.G(t,s,n,r,i,o)}catch(a){ke.B(a)}},V:function(t,e){try{C?.localStorage.removeItem(t),_n.V(t,e)}catch(n){ke.B(n)}}}),rl={},M1={H:function(){return!0},B:function(t){L.error("memoryStorage error: "+t)},q:function(t){return rl[t]||null},W:function(t){return rl[t]||null},G:function(t,e){rl[t]=e},V:function(t){delete rl[t]}},ui=null,Ze={H:function(){if(!qn(ui))return ui;if(ui=!0,O(C))ui=!1;else try{var t="__support__";Ze.G(t,"xyz"),Ze.q(t)!=='"xyz"'&&(ui=!1),Ze.V(t)}catch{ui=!1}return ui},B:function(t){L.error("sessionStorage error: ",t)},q:function(t){try{return C?.sessionStorage.getItem(t)}catch(e){Ze.B(e)}return null},W:function(t){try{return JSON.parse(Ze.q(t))||null}catch{}return null},G:function(t,e){try{C?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Ze.B(n)}},V:function(t){try{C?.sessionStorage.removeItem(t)}catch(e){Ze.B(e)}}},Un=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),Kd=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?Un.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===Un.DENIED||this.consent===Un.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Un.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:r}=this._instance.config;return r||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return rd(e)?Un.GRANTED:te(Jk,e)?Un.DENIED:Un.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?ke:_n;var n=e==="localStorage"?_n:ke;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(rd(n.q(this.X))),n.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!Xv([It?.doNotTrack,It?.msDoNotTrack,G.doNotTrack],(e=>rd(e)))}},il=He("[Dead Clicks]"),F1=()=>!0,$1=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(Jv)),r=t.instance.config.capture_dead_clicks;return Er(r)?r:!!We(r)||n},xl=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Jv]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(i=>{i?il.error("failed to load script",i):e()}))}et(){var e;if(N){if(!this.tt&&(e=G.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=We(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=G.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(N),il.info("starting...")}}else il.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,il.info("stopping..."))}},ms=He("[ExceptionAutocapture]"),Gd=class{constructor(e){var n,r,i;this.rt=()=>{var o;if(C&&this.isEnabled&&(o=G.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var s=G.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=G.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=G.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=s(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=a(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){ms.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((n=this._instance.persistence)==null||!n.props[sv]),this.F=this.ht(),this.vt=new bd({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10,refillInterval:1e4,h:ms}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return We(e)?n=F({},n,e):(O(e)?this.ut:e)&&(n=F({},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&&(ms.info("enabled"),this.it(this.rt))}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(i=>{if(i)return ms.error("failed to load script",i);e()}))}lt(){var e,n,r;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(r=this.ot)==null||r.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({[sv]:this.ut}),this.startIfEnabled()}captureException(e){var n,r,i=(n=e==null||(r=e.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&n!==void 0?n:"Exception";this.vt.consumeRateLimit(i)?ms.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e)}};function yv(t,e,n){try{if(!(e in t))return()=>{};var r=t[e],i=n(r);return kr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}var Zd=class{constructor(e){var n;this._instance=e,this.dt=(C==null||(n=C.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(L.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,L.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(C&&C.history){var r=this;(e=C.history.pushState)!=null&&e.__posthog_wrapped__||yv(C.history,"pushState",(i=>function(o,s,a){i.call(this,o,s,a),r.ft("pushState")})),(n=C.history.replaceState)!=null&&n.__posthog_wrapped__||yv(C.history,"replaceState",(i=>function(o,s,a){i.call(this,o,s,a),r.ft("replaceState")})),this.gt()}}ft(e){try{var n,r=C==null||(n=C.location)==null?void 0:n.pathname;if(!r)return;r!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=r}catch(i){L.error("Error capturing "+e+" pageview",i)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};De(C,"popstate",e),this.ct=()=>{C&&C.removeEventListener("popstate",e)}}}},cd=He("[SegmentIntegration]");function D1(t,e){var n=t.config.segment;if(!n)return e();(function(r,i){var o=r.config.segment;if(!o)return i();var s=l=>{var c=()=>l.anonymousId()||br();r.config.get_device_id=c,l.id()&&(r.register({distinct_id:l.id(),$device_id:c()}),r.persistence.set_property(jn,"identified")),i()},a=o.user();"then"in a&&kr(a.then)?a.then((l=>s(l))):s(a)})(t,(()=>{n.register((r=>{Promise&&Promise.resolve||cd.warn("This browser does not have Promise support, and can not use the segment integration");var i=(o,s)=>{if(!s)return o;o.event.userId||o.event.anonymousId===r.get_distinct_id()||(cd.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(cd.info("UserId set, identifying with PostHog"),r.identify(o.event.userId));var a=r.calculateEventProperties(s,o.event.properties);return o.event.properties=Object.assign({},a,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>i(o,o.event.event),page:o=>i(o,"$pageview"),identify:o=>i(o,"$identify"),screen:o=>i(o,"$screen")}})(t)).then((()=>{e()}))}))}var gy="posthog-js";function my(t,e){var{organization:n,projectId:r,prefix:i,severityAllowList:o=["error"],sendExceptionsToPostHog:s=!0}=e===void 0?{}:e;return a=>{var l,c,u,f,h;if(!(o==="*"||o.includes(a.level))||!t.__loaded)return a;a.tags||(a.tags={});var g=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());a.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var v=((l=a.exception)==null?void 0:l.values)||[],_=v.map((d=>F({},d,{stacktrace:d.stacktrace?F({},d.stacktrace,{type:"raw",frames:(d.stacktrace.frames||[]).map((p=>F({},p,{platform:"web:javascript"})))}):void 0}))),x={$exception_message:((c=v[0])==null?void 0:c.value)||a.message,$exception_type:(u=v[0])==null?void 0:u.type,$exception_level:a.level,$exception_list:_,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((f=v[0])==null?void 0:f.value)||a.message,$sentry_exception_type:(h=v[0])==null?void 0:h.type,$sentry_tags:a.tags};return n&&r&&(x.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+a.event_id),s&&t.exceptions.sendExceptionEvent(x),a}}var Yd=class{constructor(e,n,r,i,o,s){this.name=gy,this.setupOnce=function(a){a(my(e,{organization:n,projectId:r,prefix:i,severityAllowList:o,sendExceptionsToPostHog:s==null||s}))}}},B1=C!=null&&C.location?wl(C.location.hash,"__posthog")||wl(location.hash,"state"):null,_v="_postHogToolbarParams",wv=He("[Toolbar]"),Sr=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(Sr||{}),Xd=class{constructor(e){this.instance=e}_t(e){G.ph_toolbar_state=e}yt(){var e;return(e=G.ph_toolbar_state)!==null&&e!==void 0?e:Sr.UNINITIALIZED}maybeLoadToolbar(e,n,r){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),!C||!N)return!1;e=e??C.location,r=r??C.history;try{if(!n){try{C.localStorage.setItem("test","test"),C.localStorage.removeItem("test")}catch{return!1}n=C?.localStorage}var i,o=B1||wl(e.hash,"__posthog")||wl(e.hash,"state"),s=o?iv((()=>JSON.parse(atob(decodeURIComponent(o)))))||iv((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action==="ph_authorize"?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(n.getItem(_v)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}bt(e){var n=G.ph_load_toolbar||G.ph_load_editor;!de(n)&&kr(n)?n(e,this.instance):wv.warn("No toolbar load function found")}loadToolbar(e){var n=!(N==null||!N.getElementById(ty));if(!C||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=F({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(C.localStorage.setItem(_v,JSON.stringify(F({},i,{source:void 0}))),this.yt()===Sr.LOADED)this.bt(i);else if(this.yt()===Sr.UNINITIALIZED){var o;this._t(Sr.LOADING),(o=G.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return wv.error("[Toolbar] Failed to load",s),void this._t(Sr.UNINITIALIZED);this._t(Sr.LOADED),this.bt(i)})),De(C,"turbolinks:load",(()=>{this._t(Sr.UNINITIALIZED),this.loadToolbar(i)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,r){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,n,r)}},V1=He("[TracingHeaders]"),Qd=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var n,r;O(this.xt)&&((n=G.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),O(this.St)&&((r=G.__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 n,r;(n=G.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(i=>{if(i)return V1.error("failed to load script",i);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)}},Ht="Mobile",Sl="iOS",yn="Android",Ls="Tablet",vy=yn+" "+Ls,yy="iPad",_y="Apple",wy=_y+" Watch",Ms="Safari",fo="BlackBerry",xy="Samsung",Sy=xy+"Browser",by=xy+" Internet",pi="Chrome",z1=pi+" OS",ky=pi+" "+Sl,Nf="Internet Explorer",Ey=Nf+" "+Ht,Lf="Opera",H1=Lf+" Mini",Mf="Edge",Cy="Microsoft "+Mf,lo="Firefox",Ay=lo+" "+Sl,Fs="Nintendo",$s="PlayStation",co="Xbox",Ry=yn+" "+Ht,Ty=Ht+" "+Ms,As="Windows",Jd=As+" Phone",xv="Nokia",ef="Ouya",Py="Generic",j1=Py+" "+Ht.toLowerCase(),Iy=Py+" "+Ls.toLowerCase(),tf="Konqueror",ut="(\\d+(\\.\\d+)?)",ud=new RegExp("Version/"+ut),U1=new RegExp(co,"i"),W1=new RegExp($s+" \\w+","i"),q1=new RegExp(Fs+" \\w+","i"),Ff=new RegExp(fo+"|PlayBook|BB10","i"),K1={"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"},G1=(t,e)=>e&&te(e,_y)||(function(n){return te(n,Ms)&&!te(n,pi)&&!te(n,yn)})(t),Oy=function(t,e){return e=e||"",te(t," OPR/")&&te(t,"Mini")?H1:te(t," OPR/")?Lf:Ff.test(t)?fo:te(t,"IE"+Ht)||te(t,"WPDesktop")?Ey:te(t,Sy)?by:te(t,Mf)||te(t,"Edg/")?Cy:te(t,"FBIOS")?"Facebook "+Ht:te(t,"UCWEB")||te(t,"UCBrowser")?"UC Browser":te(t,"CriOS")?ky:te(t,"CrMo")||te(t,pi)?pi:te(t,yn)&&te(t,Ms)?Ry:te(t,"FxiOS")?Ay:te(t.toLowerCase(),tf.toLowerCase())?tf:G1(t,e)?te(t,Ht)?Ty:Ms:te(t,lo)?lo:te(t,"MSIE")||te(t,"Trident/")?Nf:te(t,"Gecko")?lo:""},Z1={[Ey]:[new RegExp("rv:"+ut)],[Cy]:[new RegExp(Mf+"?\\/"+ut)],[pi]:[new RegExp("("+pi+"|CrMo)\\/"+ut)],[ky]:[new RegExp("CriOS\\/"+ut)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ut)],[Ms]:[ud],[Ty]:[ud],[Lf]:[new RegExp("(Opera|OPR)\\/"+ut)],[lo]:[new RegExp(lo+"\\/"+ut)],[Ay]:[new RegExp("FxiOS\\/"+ut)],[tf]:[new RegExp("Konqueror[:/]?"+ut,"i")],[fo]:[new RegExp(fo+" "+ut),ud],[Ry]:[new RegExp("android\\s"+ut,"i")],[by]:[new RegExp(Sy+"\\/"+ut)],[Nf]:[new RegExp("(rv:|MSIE )"+ut)],Mozilla:[new RegExp("rv:"+ut)]},Y1=function(t,e){var n=Oy(t,e),r=Z1[n];if(O(r))return null;for(var i=0;i<r.length;i++){var o=r[i],s=t.match(o);if(s)return parseFloat(s[s.length-2])}return null},Sv=[[new RegExp(co+"; "+co+" (.*?)[);]","i"),t=>[co,t&&t[1]||""]],[new RegExp(Fs,"i"),[Fs,""]],[new RegExp($s,"i"),[$s,""]],[Ff,[fo,""]],[new RegExp(As,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Jd,""];if(new RegExp(Ht).test(e)&&!/IEMobile\b/.test(e))return[As+" "+Ht,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=n[1],i=K1[r]||"";return/arm/i.test(e)&&(i="RT"),[As,i]}return[As,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Sl,e.join(".")]}return[Sl,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=O(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+yn+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+yn+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[yn,e.join(".")]}return[yn,""]}],[/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/,[z1,""]],[/Linux|debian/i,["Linux",""]]],bv=function(t){return q1.test(t)?Fs:W1.test(t)?$s:U1.test(t)?co:new RegExp(ef,"i").test(t)?ef:new RegExp("("+Jd+"|WPDesktop)","i").test(t)?Jd:/iPad/.test(t)?yy:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?wy:Ff.test(t)?fo:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(xv,"i").test(t)?xv:/(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(Ht).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)?yn:vy:yn:new RegExp("(pda|"+Ht+")","i").test(t)?j1:new RegExp(Ls,"i").test(t)&&!new RegExp(Ls+" pc","i").test(t)?Iy:""},ol="https?://(.*)",go=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],X1=ho(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],go),zs="<masked>",Q1=["li_fat_id"];function Ny(t,e,n){if(!N)return{};var r,i=e?ho([],go,n||[]):[],o=Ly(Vs(N.URL,i,zs),t),s=(r={},pe(Q1,(function(a){var l=_n.q(a);r[a]=l||null})),r);return Me(s,o)}function Ly(t,e){var n=X1.concat(e||[]),r={};return pe(n,(function(i){var o=_l(t,i);r[i]=o||null})),r}function My(t){var e=(function(o){return o?o.search(ol+"google.([^/?]*)")===0?"google":o.search(ol+"bing.com")===0?"bing":o.search(ol+"yahoo.com")===0?"yahoo":o.search(ol+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!qn(e)){r.$search_engine=e;var i=N?_l(N.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function kv(){return navigator.language||navigator.userLanguage}function Fy(){return N?.referrer||"$direct"}function $y(t,e){var n=t?ho([],go,e||[]):[],r=_t?.href.substring(0,1e3);return{r:Fy().substring(0,1e3),u:r?Vs(r,n,zs):void 0}}function Dy(t){var e,{r:n,u:r}=t,i={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=yl(n))==null?void 0:e.host};if(r){i.$current_url=r;var o=yl(r);i.$host=o?.host,i.$pathname=o?.pathname;var s=Ly(r);Me(i,s)}if(n){var a=My(n);Me(i,a)}return i}function By(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function J1(){try{return new Date().getTimezoneOffset()}catch{return}}function eE(t,e){if(!yt)return{};var n,r,i,o=t?ho([],go,e||[]):[],[s,a]=(function(l){for(var c=0;c<Sv.length;c++){var[u,f]=Sv[c],h=u.exec(l),g=h&&(kr(f)?f(h,l):f);if(g)return g}return["",""]})(yt);return Me(Tf({$os:s,$os_version:a,$browser:Oy(yt,navigator.vendor),$device:bv(yt),$device_type:(r=yt,i=bv(r),i===yy||i===vy||i==="Kobo"||i==="Kindle Fire"||i===Iy?Ls:i===Fs||i===co||i===$s||i===ef?"Console":i===wy?"Wearable":i?Ht:"Desktop"),$timezone:By(),$timezone_offset:J1()}),{$current_url:Vs(_t?.href,o,zs),$host:_t?.host,$pathname:_t?.pathname,$raw_user_agent:yt.length>1e3?yt.substring(0,997)+"...":yt,$browser_version:Y1(yt,navigator.vendor),$browser_language:kv(),$browser_language_prefix:(n=kv(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:C?.screen.height,$screen_width:C?.screen.width,$viewport_height:C?.innerHeight,$viewport_width:C?.innerWidth,$lib:"web",$lib_version:Hn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var _r=He("[Web Vitals]"),Ev=9e5,nf=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(((r,i)=>F({},r,{["$web_vitals_"+i.name+"_event"]:F({},i),["$web_vitals_"+i.name+"_value"]:i.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=r=>{var i,o=(i=this._instance.sessionManager)==null?void 0:i.checkAndGetSessionAndWindowId(!0);if(O(o))_r.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.Tt();O(s)||(de(r?.name)||de(r?.value)?_r.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?_r.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==s&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),O(this.N.url)&&(this.N.url=s),this.N.firstMetricTimestamp=O(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(F({},r,{$current_url:s,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var r,i,o,s,a=G.__PosthogExtensions__;O(a)||O(a.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:i,onFCP:o,onINP:s}=a.postHogWebVitalsCallbacks),r&&i&&o&&s?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.Pt.bind(this)),this.P=!0):_r.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((n=this._instance.persistence)==null||!n.props[lv]),this.startIfEnabled()}get allowedMetrics(){var e,n,r=We(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return O(r)?((n=this._instance.persistence)==null?void 0:n.props[cv])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(We(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=We(this._instance.config.capture_performance)&&wn(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Ev;return 0<e&&e<=6e4?Ev:e}get isEnabled(){var e=_t?.protocol;if(e!=="http:"&&e!=="https:")return _r.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=We(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Er(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Er(n)?n:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(_r.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=We(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=We(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[lv]:n}),this._instance.persistence.register({[cv]:r})),this.Et=n,this.startIfEnabled()}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",(i=>{i?_r.error("failed to load script",i):e()}))}Tt(){var e=C?C.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=n?ho([],go,r||[]):[];return Vs(e,i,zs)}_r.error("Could not determine current URL")}},tE=He("[Heatmaps]");function Cv(t){return We(t)&&"clientX"in t&&"clientY"in t&&wn(t.clientX)&&wn(t.clientY)}var rf=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[Ld]),this.rageclicks=new vl(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return We(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 O(this.instance.config.capture_heatmaps)?O(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;tE.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({[Ld]: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"})(N)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){C&&N&&(this.jt=this.Dt.bind(this),De(C,"beforeunload",this.jt),this.Lt=e=>this.At(e||C?.event),De(N,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||C?.event),De(N,"mousemove",this.Nt,{capture:!0}),this.zt=new xl(this.instance,F1,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),De(N,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;C&&N&&(this.jt&&C.removeEventListener("beforeunload",this.jt),this.Lt&&N.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&N.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&N.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),s=(function(a,l,c){for(var u=a;u&&Nl(u)&&!Ar(u,"body");){if(u===c)return!1;if(te(l,C?.getComputedStyle(u).position))return!0;u=ay(u)}return!1})(oy(e),["fixed","sticky"],o);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:n}}At(e,n){var r;if(n===void 0&&(n="click"),!uv(e.target)&&Cv(e)){var i=this.qt(e,n);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(F({},i,{type:"rageclick"})),this.Wt(i)}}Ut(e){!uv(e.target)&&Cv(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(C){var n=C.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,o=r?ho([],go,i||[]):[],s=Vs(n,o,zs);this.N=this.N||{},this.N[s]||(this.N[s]=[]),this.N[s].push(e)}}Dt(){this.N&&!so(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},of=class{constructor(e){this._instance=e}doPageView(e,n){var r,i=this.Gt(e,n);return this.Vt={pathname:(r=C?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),i}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 r=this.Vt;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:a,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:f}=o;if(!(O(s)||O(a)||O(l)||O(c)||O(u)||O(f))){s=Math.ceil(s),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),f=Math.ceil(f);var h=s<=1?1:vn(a/s,0,1,L),g=s<=1?1:vn(l/s,0,1,L),v=c<=1?1:vn(u/c,0,1,L),_=c<=1?1:vn(f/c,0,1,L);i=Me(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:_})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}},jt=Uint8Array,dt=Uint16Array,po=Uint32Array,$f=new jt([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]),Df=new jt([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]),Av=new jt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Vy=function(t,e){for(var n=new dt(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new po(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},zy=Vy($f,2),nE=zy[0],sf=zy[1];nE[28]=258,sf[258]=28;for(af=Vy(Df,0)[1],bl=new dt(32768),he=0;he<32768;++he)wr=(43690&he)>>>1|(21845&he)<<1,wr=(61680&(wr=(52428&wr)>>>2|(13107&wr)<<2))>>>4|(3855&wr)<<4,bl[he]=((65280&wr)>>>8|(255&wr)<<8)>>>1;var wr,af,bl,he,Ps=function(t,e,n){for(var r=t.length,i=0,o=new dt(e);i<r;++i)++o[t[i]-1];var s,a=new dt(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new dt(1<<e);var l=15-e;for(i=0;i<r;++i)if(t[i])for(var c=i<<4|t[i],u=e-t[i],f=a[t[i]-1]++<<u,h=f|(1<<u)-1;f<=h;++f)s[bl[f]>>>l]=c}else for(s=new dt(r),i=0;i<r;++i)s[i]=bl[a[t[i]-1]++]>>>15-t[i];return s},hi=new jt(288);for(he=0;he<144;++he)hi[he]=8;for(he=144;he<256;++he)hi[he]=9;for(he=256;he<280;++he)hi[he]=7;for(he=280;he<288;++he)hi[he]=8;var kl=new jt(32);for(he=0;he<32;++he)kl[he]=5;var rE=Ps(hi,9,0),iE=Ps(kl,5,0),Hy=function(t){return(t/8>>0)+(7&t&&1)},jy=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof dt?dt:t instanceof po?po:jt)(n-e);return r.set(t.subarray(e,n)),r},zn=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8},vs=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},dd=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,o=n.slice();if(!i)return[new jt(0),0];if(i==1){var s=new jt(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(w,k){return w.f-k.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(r=1;r<i;++r)o[r].s>h&&(h=o[r].s);var g=new dt(h+1),v=lf(n[u-1],g,0);if(v>e){r=0;var _=0,x=v-e,d=1<<x;for(o.sort((function(w,k){return g[k.s]-g[w.s]||w.f-k.f}));r<i;++r){var p=o[r].s;if(!(g[p]>e))break;_+=d-(1<<v-g[p]),g[p]=e}for(_>>>=x;_>0;){var m=o[r].s;g[m]<e?_-=1<<e-g[m]++-1:++r}for(;r>=0&&_;--r){var y=o[r].s;g[y]==e&&(--g[y],++_)}v=e}return[new jt(g),v]},lf=function(t,e,n){return t.s==-1?Math.max(lf(t.l,e,n+1),lf(t.r,e,n+1)):e[t.s]=n},Rv=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new dt(++e),r=0,i=t[0],o=1,s=function(l){n[r++]=l},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[n.subarray(0,r),e]},ys=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},cf=function(t,e,n){var r=n.length,i=Hy(e+2);t[i]=255&r,t[i+1]=r>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o<r;++o)t[i+o+4]=n[o];return 8*(i+4+r)},Tv=function(t,e,n,r,i,o,s,a,l,c,u){zn(e,u++,n),++i[256];for(var f=dd(i,15),h=f[0],g=f[1],v=dd(o,15),_=v[0],x=v[1],d=Rv(h),p=d[0],m=d[1],y=Rv(_),w=y[0],k=y[1],b=new dt(19),E=0;E<p.length;++E)b[31&p[E]]++;for(E=0;E<w.length;++E)b[31&w[E]]++;for(var P=dd(b,7),A=P[0],H=P[1],K=19;K>4&&!A[Av[K-1]];--K);var Y,W,le,B,X=c+5<<3,D=ys(i,hi)+ys(o,kl)+s,Z=ys(i,h)+ys(o,_)+s+14+3*K+ys(b,A)+(2*b[16]+3*b[17]+7*b[18]);if(X<=D&&X<=Z)return cf(e,u,t.subarray(l,l+c));if(zn(e,u,1+(Z<D)),u+=2,Z<D){Y=Ps(h,g,0),W=h,le=Ps(_,x,0),B=_;var vt=Ps(A,H,0);for(zn(e,u,m-257),zn(e,u+5,k-1),zn(e,u+10,K-4),u+=14,E=0;E<K;++E)zn(e,u+3*E,A[Av[E]]);u+=3*K;for(var Bn=[p,w],Ge=0;Ge<2;++Ge){var zt=Bn[Ge];for(E=0;E<zt.length;++E){var Pt=31&zt[E];zn(e,u,vt[Pt]),u+=A[Pt],Pt>15&&(zn(e,u,zt[E]>>>5&127),u+=zt[E]>>>12)}}}else Y=rE,W=hi,le=iE,B=kl;for(E=0;E<a;++E)if(r[E]>255){Pt=r[E]>>>18&31,vs(e,u,Y[Pt+257]),u+=W[Pt+257],Pt>7&&(zn(e,u,r[E]>>>23&31),u+=$f[Pt]);var no=31&r[E];vs(e,u,le[no]),u+=B[no],no>3&&(vs(e,u,r[E]>>>5&8191),u+=Df[no])}else vs(e,u,Y[r[E]]),u+=W[r[E]];return vs(e,u,Y[256]),u+W[256]},oE=new po([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sE=(function(){for(var t=new po(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),aE=function(t,e,n,r,i){return(function(o,s,a,l,c,u){var f=o.length,h=new jt(l+f+5*(1+Math.floor(f/7e3))+c),g=h.subarray(l,h.length-c),v=0;if(!s||f<8)for(var _=0;_<=f;_+=65535){var x=_+65535;x<f?v=cf(g,v,o.subarray(_,x)):(g[_]=u,v=cf(g,v,o.subarray(_,f)))}else{for(var d=oE[s-1],p=d>>>13,m=8191&d,y=(1<<a)-1,w=new dt(32768),k=new dt(y+1),b=Math.ceil(a/3),E=2*b,P=function(nd){return(o[nd]^o[nd+1]<<b^o[nd+2]<<E)&y},A=new po(25e3),H=new dt(288),K=new dt(32),Y=0,W=0,le=(_=0,0),B=0,X=0;_<f;++_){var D=P(_),Z=32767&_,vt=k[D];if(w[Z]=vt,k[D]=Z,B<=_){var Bn=f-_;if((Y>7e3||le>24576)&&Bn>423){v=Tv(o,g,0,A,H,K,W,le,X,_-X,v),le=Y=W=0,X=_;for(var Ge=0;Ge<286;++Ge)H[Ge]=0;for(Ge=0;Ge<30;++Ge)K[Ge]=0}var zt=2,Pt=0,no=m,mr=Z-vt&32767;if(Bn>2&&D==P(_-mr))for(var Mk=Math.min(p,Bn)-1,Fk=Math.min(32767,_),$k=Math.min(258,Bn);mr<=Fk&&--no&&Z!=vt;){if(o[_+zt]==o[_+zt-mr]){for(var vr=0;vr<$k&&o[_+vr]==o[_+vr-mr];++vr);if(vr>zt){if(zt=vr,Pt=mr,vr>Mk)break;var Dk=Math.min(mr,vr-2),Hm=0;for(Ge=0;Ge<Dk;++Ge){var td=_-mr+Ge+32768&32767,jm=td-w[td]+32768&32767;jm>Hm&&(Hm=jm,vt=td)}}}mr+=(Z=vt)-(vt=w[Z])+32768&32767}if(Pt){A[le++]=268435456|sf[zt]<<18|af[Pt];var Um=31&sf[zt],Wm=31&af[Pt];W+=$f[Um]+Df[Wm],++H[257+Um],++K[Wm],B=_+zt,++Y}else A[le++]=o[_],++H[o[_]]}}v=Tv(o,g,u,A,H,K,W,le,X,_-X,v)}return jy(h,0,l+Hy(v)+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,r,!0)},fd=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function lE(t,e){e===void 0&&(e={});var n=(function(){var a=4294967295;return{p:function(l){for(var c=a,u=0;u<l.length;++u)c=sE[255&c^l[u]]^c>>>8;a=c},d:function(){return 4294967295^a}}})(),r=t.length;n.p(t);var i,o=aE(t,e,10+((i=e).filename&&i.filename.length+1||0),8),s=o.length;return(function(a,l){var c=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&fd(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){a[3]=8;for(var u=0;u<=c.length;++u)a[u+10]=c.charCodeAt(u)}})(o,e),fd(o,s-8,n.d()),fd(o,s-4,r),o}var cE=function(t){var e,n,r,i,o="";for(e=n=0,r=(t=(t+"").replace(/\r\n/g,`
11
10
  `).replace(/\r/g,`
12
- `)).length,r=0;r<i;r++){var a=t.charCodeAt(r),o=null;a<128?n++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),ui(o)||(n>e&&(s+=t.substring(e,n)),s+=o,e=n=r+1)}return n>e&&(s+=t.substring(e,t.length)),s},hT=!!If||!!Vf,y0="text/plain",Uc=function(t,e,n){var i;n===void 0&&(n=!0);var[r,s]=t.split("?"),a=B({},e),o=(i=s?.split("&").map((c=>{var u,[f,h]=c.split("="),p=n&&(u=a[f])!==null&&u!==void 0?u:h;return delete a[f],f+"="+p})))!==null&&i!==void 0?i:[],l=Mk(a);return l&&o.push(l),r+"?"+o.join("&")},Oo=(t,e)=>JSON.stringify(t,((n,i)=>typeof i=="bigint"?i.toString():i),e),zf=t=>{var{data:e,compression:n}=t;if(e){if(n===ci.GZipJS){var i=fT((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var f=new ln(l.length+(l.length>>>1)),h=0,p=function(d){f[h++]=d},y=0;y<u;++y){if(h+5>f.length){var _=new ln(h+8+(u-y<<1));_.set(f),f=_}var b=l.charCodeAt(y);b<128||c?p(b):b<2048?(p(192|b>>>6),p(128|63&b)):b>55295&&b<57344?(p(240|(b=65536+(1047552&b)|1023&l.charCodeAt(++y))>>>18),p(128|b>>>12&63),p(128|b>>>6&63),p(128|63&b)):(p(224|b>>>12),p(128|b>>>6&63),p(128|63&b))}return M_(f,0,h)})(Oo(e)),{mtime:0}),r=new Blob([i],{type:y0});return{contentType:y0,body:r,estimatedSize:r.size}}if(n===ci.Base64){var s=(function(l){var c,u,f,h,p,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,b=0,d="",g=[];if(!l)return l;l=pT(l);do c=(p=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,u=p>>12&63,f=p>>6&63,h=63&p,g[b++]=y.charAt(c)+y.charAt(u)+y.charAt(f)+y.charAt(h);while(_<l.length);switch(d=g.join(""),l.length%3){case 1:d=d.slice(0,-2)+"==";break;case 2:d=d.slice(0,-1)+"="}return d})(Oo(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Oo(l)))(s);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var o=Oo(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Sc=[];Vf&&Sc.push({transport:"fetch",method:t=>{var e,n,{contentType:i,body:r,estimatedSize:s}=(e=zf(t))!==null&&e!==void 0?e:{},a=new Headers;we(t.headers,(function(u,f){a.append(f,u)})),i&&a.append("Content-Type",i);var o=t.url,l=null;if(Uy){var c=new Uy;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),t.timeout)}}Vf(o,B({method:t?.method||"GET",headers:a,keepalive:t.method==="POST"&&(s||0)<52428.8,body:r,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then((u=>u.text().then((f=>{var h={statusCode:u.status,text:f};if(u.status===200)try{h.json=JSON.parse(f)}catch(p){L.error(p)}t.callback==null||t.callback(h)})))).catch((u=>{L.error(u),t.callback==null||t.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),If&&Sc.push({transport:"XHR",method:t=>{var e,n=new If;n.open(t.method||"GET",t.url,!0);var{contentType:i,body:r}=(e=zf(t))!==null&&e!==void 0?e:{};we(t.headers,(function(s,a){n.setRequestHeader(a,s)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var s={statusCode:n.status,text:n.responseText};if(n.status===200)try{s.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(s)}},n.send(r)}}),Pt!=null&&Pt.sendBeacon&&Sc.push({transport:"sendBeacon",method:t=>{var e=Uc(t.url,{beacon:"1"});try{var n,{contentType:i,body:r}=(n=zf(t))!==null&&n!==void 0?n:{},s=typeof r=="string"?new Blob([r],{type:i}):r;Pt.sendBeacon(e,s)}catch{}}});var $c=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 _0(t,e,n){return Oo({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var N_={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=>$c(n,i))))),not_regex:(t,e)=>e.every((n=>t.every((i=>!$c(n,i))))),icontains:(t,e)=>e.map(_c).some((n=>t.map(_c).some((i=>n.includes(i))))),not_icontains:(t,e)=>e.map(_c).every((n=>t.map(_c).every((i=>!n.includes(i)))))},_c=t=>t.toLowerCase();function D_(t,e){return!t||Object.entries(t).every((n=>{var[i,r]=n,s=e?.[i];if(N(s)||ui(s))return!1;var a=[String(s)],o=N_[r.operator];return!!o&&o(r.values,a)}))}var Bf=nt("[Error tracking]"),Mp=class{constructor(e){var n,i;this.Jt=[],this.Kt=new Gf([new Zf,new tp,new Xf,new Wf,new Jf,new Qf,new Kf,new ep],pk("web:javascript",ck,fk)),this._instance=e,this.Jt=(n=(i=this._instance.persistence)==null?void 0:i.get_property(ip))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,i,r,s=(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=s,this._instance.persistence&&this._instance.persistence.register({[ip]:this.Jt,[Wy]:a})}get Yt(){var e,n=!!this._instance.get_property(Wy),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 Bf.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void Bf.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))return void Bf.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:s,value:a}=r;return tt(s)&&s.length>0&&i.$exception_types.push(s),tt(a)&&a.length>0&&i.$exception_values.push(a),i}),{$exception_types:[],$exception_values:[]});return this.Jt.some((i=>{var r=i.values.map((s=>{var a,o=N_[s.operator],l=Se(s.value)?s.value:[s.value],c=(a=n[s.key])!==null&&a!==void 0?a:[];return l.length>0&&o(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,s,a=(n=(i=e[0].stacktrace)==null?void 0:i.frames)!==null&&n!==void 0?n:[],o=a[a.length-1];return(r=o==null||(s=o.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Xt(e){return!ye(e)&&Se(e)}},Cn=nt("[FeatureFlags]"),So=nt("[FeatureFlags]",{debugEnabled:!0}),Hf="$active_feature_flags",js="$override_feature_flags",b0="$feature_flag_payloads",xo="$override_feature_flag_payloads",S0="$feature_flag_request_id",x0="$feature_flag_evaluated_at",E0=t=>{var e={};for(var[n,i]of bc(t||{}))i&&(e[n]=i);return e},gT=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]})))):Cn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},mT=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),Np=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||Cn.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(rp),n=this._instance.get_property(js),i=this._instance.get_property(xo);if(!i&&!n)return e||{};var r=Pe({},e||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(n||{})])];for(var a of s){var o,l,c=r[a],u=n?.[a],f=N(u)?(o=c?.enabled)!==null&&o!==void 0&&o:!!u,h=N(u)?c.variant:typeof u=="string"?u:void 0,p=i?.[a],y=B({},c,{enabled:f,variant:f?h??c?.variant:void 0});f!==c?.enabled&&(y.original_enabled=c?.enabled),h!==c?.variant&&(y.original_variant=c?.variant),p&&(y.metadata=B({},c?.metadata,{payload:p,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),r[a]=y}return this.ii||(Cn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var e=this._instance.get_property(Ys),n=this._instance.get_property(js);if(!n)return e||{};for(var i=Pe({},e),r=Object.keys(n),s=0;s<r.length;s++)i[r[s]]=n[r[s]];return this.ii||(Cn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property(b0),n=this._instance.get_property(xo);if(!n)return e||{};for(var i=Pe({},e||{}),r=Object.keys(n),s=0;s<r.length;s++)i[r[s]]=n[r[s]];return this.ii||(Cn.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:B({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(To)||{}),group_properties:this._instance.get_property(Yr)};(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,s=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":"",o=this._instance.requestRouter.endpointFor("flags",s+a);r&&(i.timezone=k_()),this.ri=!0,this._instance.ci({method:"POST",url:o,data:i,compression:this._instance.config.disable_compression?void 0:ci.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,f=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),f=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((u=l.json)!==null&&u!==void 0?u:{})),!i.disable_flags||this.ni)if(this.ai=!f,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(mT.FeatureFlags))Cn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var h;i.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},f),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],r=""+i,s=this._instance.get_property(S0)||void 0,a=this._instance.get_property(x0)||void 0,o=this._instance.get_property(Ac)||{};if((n.send_event||!("send_event"in n))&&(!(e in o)||!o[e].includes(r))){var l,c,u,f,h,p,y,_,b;Se(o[e])?o[e].push(r):o[e]=[r],(l=this._instance.persistence)==null||l.register({[Ac]:o});var d=this.getFeatureFlagDetails(e),g={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:s,$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};N(d==null||(f=d.metadata)==null?void 0:f.version)||(g.$feature_flag_version=d.metadata.version);var m,v=(h=d==null||(p=d.reason)==null?void 0:p.description)!==null&&h!==void 0?h:d==null||(y=d.reason)==null?void 0:y.code;v&&(g.$feature_flag_reason=v),d!=null&&(_=d.metadata)!=null&&_.id&&(g.$feature_flag_id=d.metadata.id),N(d?.original_variant)&&N(d?.original_enabled)||(g.$feature_flag_original_response=N(d.original_variant)?d.original_enabled:d.original_variant),d!=null&&(b=d.metadata)!=null&&b.original_payload&&(g.$feature_flag_original_payload=d==null||(m=d.metadata)==null?void 0:m.original_payload),this._instance.capture("$feature_flag_called",g)}return i}Cn.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:ci.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:s=>{var a,o=(a=s.json)==null?void 0:a.featureFlagPayloads;n(o?.[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 N(i)?void 0:!!i}Cn.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(),s=this.getFlagsWithDetails();(function(a,o,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var f=gT(a),h=f.flags,p=f.featureFlags,y=f.featureFlagPayloads;if(p){var _=a.requestId,b=a.evaluatedAt;if(Se(p)){Cn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(p)for(var g=0;g<p.length;g++)d[p[g]]=!0;o&&o.register({[Hf]:p,[Ys]:d})}else{var m=p,v=y,S=h;a.errorsWhileComputingFlags&&(m=B({},l,m),v=B({},c,v),S=B({},u,S)),o&&o.register(B({[Hf]:Object.keys(E0(m)),[Ys]:m||{},[b0]:v||{},[rp]:S||{}},_?{[S0]:_}:{},b?{[x0]:b}:{}))}}})(e,this._instance.persistence,i,r,s),this.pi(n)}}override(e,n){n===void 0&&(n=!1),Cn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Cn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(js),this._instance.persistence.unregister(xo),this.pi(),So.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(js),So.info("Flag overrides cleared");else if(i.flags){if(Se(i.flags)){for(var r={},s=0;s<i.flags.length;s++)r[i.flags[s]]=!0;this._instance.persistence.register({[js]:r})}else this._instance.persistence.register({[js]:i.flags});So.info("Flag overrides set",{flags:i.flags})}}return"payloads"in i&&(i.payloads===!1?(this._instance.persistence.unregister(xo),So.info("Payload overrides cleared")):i.payloads&&(this._instance.persistence.register({[xo]:i.payloads}),So.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,s=(this._instance.get_property(ko)||[]).find((c=>c.flagKey===e)),a={["$feature_enrollment/"+e]:n},o={$feature_flag:e,$feature_enrollment:n,$set:a};s&&(o.$early_access_feature_name=s.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(a,!1);var l=B({},this.getFlagVariants(),{[e]:n});(r=this._instance.persistence)==null||r.register({[Hf]:Object.keys(E0(l)),[Ys]:l}),this.pi()}getEarlyAccessFeatures(e,n,i){n===void 0&&(n=!1);var r=this._instance.get_property(ko),s=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+s),method:"GET",callback:a=>{var o,l;if(a.json){var c=a.json.earlyAccessFeatures;return(o=this._instance.persistence)==null||o.unregister(ko),(l=this._instance.persistence)==null||l.register({[ko]: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(To)||{};this._instance.register({[To]:B({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(To)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(Yr)||{};Object.keys(i).length!==0&&Object.keys(i).forEach((r=>{i[r]=B({},i[r],e[r]),delete e[r]})),this._instance.register({[Yr]:B({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(Yr)||{};this._instance.register({[Yr]:B({},n,{[e]:{}})})}else this._instance.unregister(Yr)}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}},vT=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Do=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&&L.info("Persistence loaded",e.persistence,B({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.wi}bi(e){vT.indexOf(e.persistence.toLowerCase())===-1&&(L.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&Be.H()?Be:n==="localstorage+cookie"&&gc.H()?gc:n==="sessionstorage"&&ut.H()?ut:n==="memory"?$k:n==="cookie"?Hn:gc.H()?gc:Hn}properties(){var e={};return we(this.props,(function(n,i){if(i===Ys&&st(n))for(var r=Object.keys(n),s=0;s<r.length;s++)e["$feature/"+r[s]]=n[r[s]];else o=i,l=!1,(ui(a=Sk)?l:Hy&&a.indexOf===Hy?a.indexOf(o)!=-1:(we(a,(function(c){if(l||(l=c===o))return wc})),l))||(e[i]=n);var a,o,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Pe({},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(st(e)){N(n)&&(n="None"),this.xi=N(i)?this.$i:i;var r=!1;if(we(e,((s,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.props[a]=s,r=!0)})),r)return this.save(),!0}return!1}register(e,n){if(st(e)){this.xi=N(n)?this.$i:n;var i=!1;if(we(e,((r,s)=>{e.hasOwnProperty(s)&&this.props[s]!==r&&(this.props[s]=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=S_(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);Gs(Xp(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=D?.referrer)?E_(e):{})}update_referrer_info(){var e;this.register_once({$referrer:w_(),$referring_domain:D!=null&&D.referrer&&((e=Mc(D.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[lp]||this.props[cp]||this.register_once({[kc]:C_(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};we([cp,lp],(a=>{var o=this.props[a];o&&we(o,(function(l,c){e["$initial_"+Ff(c)]=l}))}));var n,i,r=this.props[kc];if(r){var s=(n=A_(r),i={},we(n,(function(a,o){i["$initial_"+Ff(o)]=a})),i);Pe(e,s)}return e}safe_merge(e){return we(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),s=this.props;this.clear(),this.Y=r,this.props=s,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[Ao]||{};i[e]=n,this.props[Ao]=i,this.save()}remove_event_timer(e){var n=(this.props[Ao]||{})[e];return N(n)||(delete this.props[Ao][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}},Eo=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),tL=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),nL=(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})({}),iL=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),Uf=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),rL=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),sL=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),aL=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),xc=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),w0=(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})({}),L_=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),Vo=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 qs(t,e,n){if(ye(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 Dp=class{constructor(e){this.Pi=new Vo,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(!N((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((n=this._instance)==null?void 0:n.Ai)&&(e.forEach((a=>{var o,l;(o=this.Oi)==null||o.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,s=new Set;e.forEach((a=>{var o;(o=a.steps)==null||o.forEach((l=>{l!=null&&l.selector&&s.add(l?.selector)}))})),(r=this._instance)==null||r.autocapture.setElementSelectors(s)}}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"||!qs(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((o=>qs(o.href,n.href,n.href_matching||"exact")));var s,a=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!a&&qs((s=a.match(/(?::|")href="(.*?)"/))?s[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=>qs(c.text,n.text,n.text_matching||"exact")||qs(c.$el_text,n.text,n.text_matching||"exact")));var s,a,o,l=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!l&&(s=(function(c){for(var u,f=[],h=/(?::|")text="(.*?)"/g;!ye(u=h.exec(c));)f.includes(u[1])||f.push(u[1]);return f})(l),a=n.text,o=n.text_matching||"exact",s.some((c=>qs(c,a,o))))}Ui(e,n){var i,r;if(n==null||!n.selector)return!0;var s=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(s!=null&&s.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||D_(n.properties.reduce(((i,r)=>{var s=Se(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return i[r.key]={values:s,operator:r.operator||"exact"},i}),{}),e?.properties)}},ge=nt("[Surveys]"),Lp="seenSurvey_",yT=(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},C0=t=>{var e=""+Lp+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Lp+t.id+"_"+t.current_iteration),e},_T=[Uf.Popover,Uf.Widget,Uf.API],bT={ignoreConditions:!1,ignoreDelay:!1,displayType:L_.Popover},zp=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,n){return!!e&&D_(e.propertyFilters,n?.properties)}Gi(e,n){var i=new Map;return e.forEach((r=>{var s;(s=r.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach((a=>{if(a!=null&&a.name){var o=i.get(a.name)||[];o.push(r.id),i.set(a.name,o)}}))})),i}Vi(e,n,i){var r,s=(i===Eo.Activation?this.Hi:this.Bi).get(e),a=[];return(r=this._instance)==null||r.getSurveys((o=>{a=o.filter((l=>s?.includes(l.id)))})),a.filter((o=>{var l,c=(l=o.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((n=this._instance)==null?void 0:n.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var n=e.filter((i=>{var r,s;return((r=i.conditions)==null?void 0:r.actions)&&((s=i.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0}));n.length!==0&&(this.Yi==null&&(this.Yi=new Dp(this._instance),this.Yi.init(),this.Yi.ji((i=>{this.onAction(i)}))),n.forEach((i=>{var r,s,a,o,l;i.conditions&&(r=i.conditions)!=null&&r.actions&&(s=i.conditions)!=null&&(s=s.actions)!=null&&s.values&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((o=this.Yi)==null||o.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((s=>{var a,o;return((a=s.conditions)==null?void 0:a.events)&&((o=s.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0})),r=e.filter((s=>{var a,o;return((a=s.conditions)==null?void 0:a.cancelEvents)&&((o=s.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0}));(i.length!==0||r.length!==0)&&((n=this._instance)==null||n.Ai(((s,a)=>{this.onEvent(s,a)})),this.Hi=this.Gi(e,Eo.Activation),this.Bi=this.Gi(e,Eo.Cancellation))}onEvent(e,n){var i,r=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[hc])||[];if(xc.SHOWN===e&&n&&r.length>0){var s;ge.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:r});var a=n==null||(s=n.properties)==null?void 0:s.$survey_id;if(a){var o=r.indexOf(a);o>=0&&(r.splice(o,1),this.Xi(r))}}else{if(this.Bi.has(e)){var l=this.Vi(e,n,Eo.Cancellation);l.length>0&&(ge.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((u=>u.id))}),l.forEach((u=>{var f,h=r.indexOf(u.id);h>=0&&r.splice(h,1),(f=this._instance)==null||f.cancelPendingSurvey(u.id)})),this.Xi(r))}if(this.Hi.has(e)){ge.info("survey event name matched",{event:e,eventPayload:n,surveys:this.Hi.get(e)});var c=this.Vi(e,n,Eo.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[hc])||[];this.qi.has(e)&&this.Xi(i.concat(this.qi.get(e)||[]))}Xi(e){var n;ge.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[hc]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[hc];return n||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},Bp=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(ye(n))return ge.warn("Flags not loaded yet. Not loading surveys.");var i=Se(n);this.Zi=i?n.length>0:n,ge.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(Lp)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)ge.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ge.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())ge.info("Not loading surveys in cookieless mode without consent.");else{var e=Z?.__PosthogExtensions__;if(e){if(!N(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",(s=>{s||!e.generateSurveys?this.se("Could not load surveys script",s):this.re(e.generateSurveys,n)}))}catch(s){throw this.se("Error initializing surveys",s),s}finally{this.ie=!1}}}else ge.error("PostHog Extensions not found.")}}re(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new zp(this._instance),ge.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,n){ge.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 ge.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(sp);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 s;this.te=!1;var a=r.statusCode;if(a!==200||!r.json){var o="Surveys API could not be loaded, status: "+a;return ge.error(o),e([],{isLoaded:!1,error:o})}var l,c=r.json.surveys||[],u=c.filter((f=>(function(h){return!(!h.start_date||h.end_date)})(f)&&((function(h){var p;return!((p=h.conditions)==null||(p=p.events)==null||(p=p.values)==null||!p.length)})(f)||(function(h){var p;return!((p=h.conditions)==null||(p=p.actions)==null||(p=p.values)==null||!p.length)})(f))));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(s=this._instance.persistence)==null||s.register({[sp]: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){ge.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!ye(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);ge.warn("init was not called")}oe(e){var n=null;return this.getSurveys((i=>{var r;n=(r=i.find((s=>s.id===e)))!==null&&r!==void 0?r:null})),n}ae(e){if(ye(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(ye(this._surveyManager))return ge.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 ye(this._surveyManager)?(ge.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 s,a=(s=r.find((l=>l.id===e)))!==null&&s!==void 0?s:null;if(a){var o=this.ae(a);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n){var i;if(ye(this._surveyManager))ge.warn("init was not called");else{var r=typeof e=="string"?this.oe(e):e;if(r!=null&&r.id)if(_T.includes(r.type)){var s=D?.querySelector(n);if(s)return(i=r.appearance)!=null&&i.surveyPopupDelaySeconds?(ge.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,o;ge.info("Rendering survey "+r.id+" with delay of "+((a=r.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(r,s),ge.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,s);ge.warn("Survey element not found")}else ge.warn("Surveys of type "+r.type+" cannot be rendered in the app");else ge.warn("Survey not found")}}displaySurvey(e,n){var i;if(ye(this._surveyManager))ge.warn("init was not called");else{var r=this.oe(e);if(r){var s=r;if((i=r.appearance)!=null&&i.surveyPopupDelaySeconds&&n.ignoreDelay&&(s=B({},r,{appearance:B({},r.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var a=this.canRenderSurvey(r);if(!a.visible)return void ge.warn("Survey is not eligible to be displayed: ",a.disabledReason)}n.displayType!==L_.Inline?this._surveyManager.handlePopoverSurvey(s):this.renderSurvey(s,n.selector)}else ge.warn("Survey not found")}}cancelPendingSurvey(e){ye(this._surveyManager)?ge.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},A0=nt("[RateLimiter]"),Hp=class{constructor(e){var n,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var s=r.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach((a=>{A0.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4}))}catch(a){return void A0.warn('could not rate limit - continuing. Error: "'+a?.message+'"',{text:s})}},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 s=new Date().getTime(),a=(n=(i=this.instance.persistence)==null?void 0:i.get_property(op))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:s};a.tokens+=(s-a.last)/1e3*this.captureEventsPerSecond,a.last=s,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var o=a.tokens<1;return o||e||(a.tokens=Math.max(0,a.tokens-1)),!o||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=o,(r=this.instance.persistence)==null||r.set_property(op,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}},Gr=nt("[RemoteConfig]"),Up=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Z._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var n,i;(n=Z.__PosthogExtensions__)!=null&&n.loadExternalDependency?(i=Z.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(Gr.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 Gr.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void Gr.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return Gr.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){Gr.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()):Gr.info("__preview_remote_config is disabled. Logging config instead",e):Gr.error("Failed to fetch remote config from PostHog.")}},$p=3e3,Vp=class{constructor(e,n){this.he=!0,this.ve=[],this.de=zn(n?.flush_interval_ms||$p,250,5e3,L.createLogger("flush interval"),$p),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(B({},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 s=n[r],a=new Date().getTime();s.data&&Se(s.data)&&we(s.data,(o=>{o.offset=Math.abs(o.timestamp-a),delete o.timestamp})),e.ce(s)};for(var r in n)i()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return we(this.ve,(n=>{var i,r=n,s=(r?r.batchKey:null)||r.url;N(e[s])&&(e[s]=B({},r,{data:[]})),(i=e[s].data)==null||i.push(r.data)})),this.ve=[],e}},ST=["retriesPerformedSoFar"],Ip=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!N(A)&&"onLine"in A.navigator&&(this.be=A.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},We(A,"online",this.we),We(A,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,i=N0(e,ST);Un(n)&&n>0&&(i.url=Uc(i.url,{retry_count:n})),this._instance.ci(B({},i,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(n??0)<10?this.Se(B({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 o=3e3*Math.pow(2,a),l=o/2,c=Math.min(18e5,o),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(n),r=Date.now()+i;this.ve.push({retryAt:r,requestOptions:e});var s="Enqueued failed request for retry in "+i;navigator.onLine||(s+=" (Browser is offline)"),L.warn(s),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((s=>s.retryAt<e||(n.push(s),!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,N(A)||(this.we&&(A.removeEventListener("online",this.we),this.we=void 0),this.xe&&(A.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(B({},e,{transport:"sendBeacon"}))}catch(n){L.error(n)}this.ve=[]}},Fp=class{constructor(e){this.ke=()=>{var n,i,r,s;this.Pe||(this.Pe={});var a=this.scrollElement(),o=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=o+(a?.clientHeight||0),u=a?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(o),this.Pe.maxScrollY=Math.max(o,(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,(s=this.Pe.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=e}getContext(){return this.Pe}resetContext(){var e=this.Pe;return setTimeout(this.ke,0),e}startMeasuringScrollPosition(){We(A,"scroll",this.ke,{capture:!0}),We(A,"scrollend",this.ke,{capture:!0}),We(A,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return A?.document.documentElement;var e=Se(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=A?.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 A&&(A.scrollY||A.pageYOffset||A.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return A&&(A.scrollX||A.pageXOffset||A.document.documentElement.scrollLeft)||0}},xT=t=>C_(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),Vc=class{constructor(e,n,i,r){this.Te=s=>{var a=this.Re();if(!a||a.sessionId!==s){var o={sessionId:s,props:this.Ie(this._instance)};this.Fe.register({[ap]:o})}},this._instance=e,this.Ce=n,this.Fe=i,this.Ie=r||xT,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[ap]}getSetOnceProps(){var e,n=(e=this.Re())==null?void 0:e.props;return n?"r"in n?A_(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 we(Xp(this.getSetOnceProps()),((n,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+Ff(i)]=n})),e}},$f=nt("[SessionId]"),Ic=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 Vo,this.De=(u,f)=>Math.abs(u-f)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.F=e.config,this.Fe=e.persistence,this.je=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ne=n||Ki,this.Ue=i||Ki;var s=this.F.persistence_name||this.F.token,a=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*zn(a,60,36e3,$f.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+s+"_window_id",this.Be="ph_"+s+"_primary_window_exists",this.qe()){var o=ut.W(this.He),l=ut.W(this.Be);o&&!l?this.je=o:ut.V(this.He),ut.G(this.Be,!0)}if((r=this.F.bootstrap)!=null&&r.sessionID)try{var c=(u=>{var f=u.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),c)}catch(u){$f.error("Invalid sessionID in bootstrap",u)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return N(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&&ut.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&ut.G(this.He,e))}Je(){return this.je?this.je:this.qe()?ut.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({[Cc]:[n,e,i]}))}Ke(){var e=this.Fe.props[Cc];return Se(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&&A&&(A.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&ut.V(this.Be)},We(A,"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,s,a]=this.Ke(),o=this.Je(),l=Un(a)&&a>0&&Math.abs(i-a)>864e5,c=!1,u=!s,f=!u&&!e&&this.De(i,r);u||f||l?(s=this.Ne(),o=this.Ue(),$f.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}}),a=i,c=!0):o||(o=this.Ue(),c=!0);var h=r===0||!e||l?i:r,p=a===0?new Date().getTime():a;return this.Ve(o),this.We(s,h,p),e||this.ze(),c&&this.Oe.forEach((y=>y(s,o,c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0))),{sessionId:s,windowId:o,sessionStartTimestamp:p,changeReason:c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var n=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}},ET=["$set_once","$set"],Wi=nt("[SiteApps]"),jp=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=Z._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,s,a,o,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(var[h,p]of Object.entries(f))c[h]={id:u[h],type:h,properties:p};var{$set_once:y,$set:_}=e;return{event:B({},N0(e,ET),{properties:B({},e.properties,_?{$set:B({},(n=(i=e.properties)==null?void 0:i.$set)!==null&&n!==void 0?n:{},_)}:{},y?{$set_once:B({},(r=(s=e.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},y)}:{}),elements_chain:(a=(o=e.properties)==null?void 0:o.$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 o;!n.errored&&this.Xe.length&&(Wi.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))&&((o=this.Ze)==null||o.call(this))},r=!1,s=o=>{n.errored=!o,n.loaded=!0,Wi.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),r&&i()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:o=>{s(o)}});a&&(n.processEvent=a),r=!0}catch(o){Wi.error("Error while initializing PostHog app with config id "+e.id,o),s(!1)}if(r&&n.loaded)try{i()}catch(o){Wi.error("Error while processing buffered events PostHog app with config id "+e.id,o),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){Wi.error("Error while processing event "+e.event+" for site app "+i.id,r)}}}onRemoteConfig(e){var n,i,r,s=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(c=>this.ir(c)))):void Wi.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;Z["__$$ph_site_app_"+c]=s._instance,(u=Z.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(s._instance,l,(f=>{if(f)return Wi.error("Error while initializing PostHog app with config id "+c,f)}))};for(var{id:o,url:l}of e.siteApps)a(o)}else Wi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},z_=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&Iy(n,e))return!0;try{var i=t?.userAgentData;if(i!=null&&i.brands&&i.brands.some((r=>Iy(r?.brand,e))))return!0}catch{}return!!t.webdriver},Mo=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),k0="i.posthog.com",qp=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("."+k0,".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]=Mo.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Mo.EU:this.er[this.apiHost]=Mo.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===Mo.CUSTOM)return this.apiHost+n;var i=k0+n;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}},wT={icontains:(t,e)=>!!A&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!A&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!A&&$c(e.href,t),not_regex:(t,e)=>!!A&&!$c(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},Pp=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((s=>{if(s.feature_flag_key){var a;n.sr&&(t.rr("setting flag key ",s.feature_flag_key," to web experiment ",s),(a=n.sr)==null||a.set(s.feature_flag_key,s));var o=n._instance.getFeatureFlag(s.feature_flag_key);tt(o)&&s.variants[o]&&n.nr(s.name,o,s.variants[o].transforms)}else if(s.variants)for(var l in s.variants){var c=s.variants[l];t.ar(c)&&n.nr(s.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(ye(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,s=this._instance.getFeatureFlag(n),a=(r=this.sr)==null?void 0:r.get(n);s&&a!=null&&a.variants[s]&&this.nr(a.name,s,a.variants[s].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=Nc(e?.search,"__experiment_id"),i=Nc(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:s=>{if(s.statusCode!==200||!s.json)return e([]);var a=s.json.experiments||[];return e(a)}})}lr(e,n,i){var r=i.filter((s=>s.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!ye(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var n;if(ye(e.conditions)||ye((n=e.conditions)==null?void 0:n.url))return!0;var i,r,s,a=t.getWindowLocation();return!!a&&((i=e.conditions)==null||!i.url||wT[(r=(s=e.conditions)==null?void 0:s.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}static getWindowLocation(){return A?.location}static hr(e){var n;if(ye(e.conditions)||ye((n=e.conditions)==null?void 0:n.utm))return!0;var i=S_();if(i.utm_source){var r,s,a,o,l,c,u,f,h=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==i.utm_campaign,p=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==i.utm_source,y=(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||((f=e.conditions)==null||(f=f.utm)==null?void 0:f.utm_term)==i.utm_term;return h&&y&&_&&p}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];L.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 s;t.rr("applying transform of variant "+n+" for experiment "+e+" ",r);var a=(s=document)==null?void 0:s.querySelectorAll(r.selector);a?.forEach((o=>{var l=o;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return Pt&&this._instance?z_(Pt,this._instance.config.custom_blocked_useragents):void 0}},CT=nt("[PostHog ExternalIntegrations]"),AT={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Gp=class{constructor(e){this._instance=e}it(e,n){var i;(i=Z.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,(r=>{if(r)return CT.error("failed to load script",r);n()}))}startIfEnabledOrStop(){var e=this,n=function(a){var o,l,c;!r||(o=Z.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[a]||e.it(AT[a],(()=>{var u;(u=Z.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)})),!r&&(l=Z.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=Z.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[i,r]of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n(i)}}},Yp="[SessionRecording]",wo=nt(Yp),Fc=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 wo.error("started without valid sessionManager"),new Error(Yp+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Yp+' cannot be used with cookieless_mode="always"')}get cr(){var e,n=!((e=this._instance.get_property(kf))==null||!e.enabled),i=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return A&&n&&i&&!r}startIfEnabledOrStop(e){var n;if(!this.cr||(n=this.vr)==null||!n.isStarted){var i=!N(Object.assign)&&!N(Array.from);this.cr&&i?(this.gr(e),wo.info("starting")):this.stopRecording()}}gr(e){var n,i,r;this.cr&&(Z!=null&&(n=Z.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(i=Z.__PosthogExtensions__)!=null&&i.initSessionRecording?this._r(e):(r=Z.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.mr,(s=>{if(s)return wo.error("could not load recorder",s);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(F0)}br(e){if(this._instance.persistence){var n,i,r=this._instance.persistence,s=()=>{var a=e.sessionRecording===!1?void 0:e.sessionRecording,o=a?.sampleRate,l=ye(o)?null:parseFloat(o);ye(l)&&this.yr();var c=a?.minimumDurationMilliseconds;r.register({[kf]:B({enabled:!!a},a,{networkPayloadCapture:B({capturePerformance:e.capturePerformance},a?.networkPayloadCapture),canvasRecording:{enabled:a?.recordCanvas,fps:a?.canvasFps,quality:a?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:N(c)?null:c,endpoint:a?.endpoint,triggerMatchType:a?.triggerMatchType,masking:a?.masking,urlTriggers:a?.urlTriggers})})};s(),(n=this.pr)==null||n.call(this),this.pr=(i=this._instance.sessionManager)==null?void 0:i.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:wo.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):wo.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(kf);return(i==null||(n=i.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}_r(e){var n,i;if((n=Z.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(i=Z.__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))}},Lo={},Zp=()=>{},Ps="posthog",B_=!hT&&Mt?.indexOf("MSIE")===-1&&Mt?.indexOf("Mozilla")===-1,T0=t=>{var e;return B({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:bk(D?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Zp,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:Nt&&tt(Nt?.search)&&Nt.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(A==null||(e=A.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;L.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:$p},error_tracking:{},_onCapture:Zp,__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))},R0=t=>{var e={};N(t.process_person)||(e.person_profiles=t.process_person),N(t.xhr_headers)||(e.request_headers=t.xhr_headers),N(t.cookie_name)||(e.persistence_name=t.cookie_name),N(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),N(t.store_google)||(e.save_campaign_params=t.store_google),N(t.verbose)||(e.debug=t.verbose);var n=Pe({},e,t);return Se(t.property_blacklist)&&(N(t.property_denylist)?n.property_denylist=t.property_blacklist:Se(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:L.error("Invalid value for property_denylist config: "+t.property_denylist)),n},Wp=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){L.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},jc=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 Wp,this.Sr=!1,this.version=ai.LIB_VERSION,this.Er=new Vo,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=T0(),this.SentryIntegration=yp,this.sentryIntegration=e=>(function(n,i){var r=r_(n,i);return{name:i_,processEvent:s=>r(s)}})(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 Np(this),this.toolbar=new _p(this),this.scrollManager=new Fp(this),this.pageViewManager=new Ap(this),this.surveys=new Bp(this),this.experiments=new Pp(this),this.exceptions=new Mp(this),this.rateLimiter=new Hp(this),this.requestRouter=new qp(this),this.consent=new gp(this),this.externalIntegrations=new Gp(this),this.people={set:(e,n,i)=>{var r=tt(e)?{[e]:n}:e;this.setPersonProperties(r),i?.({})},set_once:(e,n,i)=>{var r=tt(e)?{[e]:n}:e;this.setPersonProperties(void 0,r),i?.({})}},this.on("eventCaptured",(e=>L.info('send "'+e?.event+'"',e)))}init(e,n,i){if(i&&i!==Ps){var r,s=(r=Lo[i])!==null&&r!==void 0?r:new t;return s._init(e,n,i),Lo[i]=s,Lo[Ps][i]=s,s}return this._init(e,n,i)}_init(e,n,i){var r;if(n===void 0&&(n={}),N(e)||jf(e))return L.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(Pe({},T0(n.defaults),R0(n),{name:i,token:e})),this.config.on_xhr_error&&L.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:ci.GZipJS;var s=this.Cr();this.persistence=new Do(this.config,s),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Do(B({},this.config,{persistence:"sessionStorage"}),s);var a=B({},this.persistence.props),o=B({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new Vp((g=>this.Or(g)),this.config.request_queue_config),this.Ar=new Ip(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 Ic(this),this.sessionPropsManager=new Vc(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(L.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(L.info("Initializing extensions synchronously"),this.Dr(l)),ai.DEBUG=ai.DEBUG||this.config.debug,ai.DEBUG&&L.info("Starting in debug mode",{this:this,config:n,thisC:B({},this.config),p:a,s:o}),((r=n.bootstrap)==null?void 0:r.distinctID)!==void 0){var c,u,f=this.config.get_device_id(Ki()),h=(c=n.bootstrap)!=null&&c.isIdentifiedID?f:n.bootstrap.distinctID;this.persistence.set_property(oi,(u=n.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:h})}if(this.jr()){var p,y,_=Object.keys(((p=n.bootstrap)==null?void 0:p.featureFlags)||{}).filter((g=>{var m;return!((m=n.bootstrap)==null||(m=m.featureFlags)==null||!m[g])})).reduce(((g,m)=>{var v;return g[m]=((v=n.bootstrap)==null||(v=v.featureFlags)==null?void 0:v[m])||!1,g}),{}),b=Object.keys(((y=n.bootstrap)==null?void 0:y.featureFlagPayloads)||{}).filter((g=>_[g])).reduce(((g,m)=>{var v,S;return(v=n.bootstrap)!=null&&(v=v.featureFlagPayloads)!=null&&v[m]&&(g[m]=(S=n.bootstrap)==null||(S=S.featureFlagPayloads)==null?void 0:S[m]),g}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:b})}if(l)this.register_once({distinct_id:mo,$device_id:null},"");else if(!this.get_distinct_id()){var d=this.config.get_device_id(Ki());this.register_once({distinct_id:d,$device_id:d},""),this.persistence.set_property(oi,"anonymous")}return We(A,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?Fk(this,(()=>this.Lr())):this.Lr(),Qi(this.config._onCapture)&&this.config._onCapture!==Zp&&(L.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(g=>this.config._onCapture(g.event,g)))),this.config.ip&&L.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 vp(this),this.historyAutocapture.startIfEnabled();var i=[];i.push((()=>{new bp(this).startIfEnabledOrStop()})),i.push((()=>{var r;this.siteApps=new jp(this),(r=this.siteApps)==null||r.init()})),e||i.push((()=>{this.sessionRecording=new Fc(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),i.push((()=>{this.autocapture=new dp(this),this.autocapture.startIfEnabled()})),i.push((()=>{this.surveys.loadIfEnabled()})),i.push((()=>{this.heatmaps=new Cp(this),this.heatmaps.startIfEnabled()})),i.push((()=>{this.webVitalsAutocapture=new wp(this)})),i.push((()=>{this.exceptionObserver=new mp(this),this.exceptionObserver.startIfEnabled()})),i.push((()=>{this.deadClicksAutocapture=new Lc(this,Ik),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(s){L.error("Error initializing extension:",s)}}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&&L.info("PostHog extensions initialized ("+r+"ms)")}fi(e){var n,i,r,s,a,o,l,c;if(!D||!D.body)return L.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=ie(e.supportedCompression,ci.GZipJS)?ci.GZipJS:ie(e.supportedCompression,ci.Base64)?ci.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),(s=this.autocapture)==null||s.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(o=this.webVitalsAutocapture)==null||o.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){L.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new Up(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()&&er(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&&(B_?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Uc(e.url,{ip:this.config.ip?1:0}),e.headers=B({},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,s,a=B({},n);a.timeout=a.timeout||6e4,a.url=Uc(a.url,{_:new Date().getTime().toString(),ver:ai.LIB_VERSION,compression:a.compression});var o=(i=a.transport)!==null&&i!==void 0?i:"fetch",l=Sc.filter((u=>!a.disableTransport||!u.transport||!a.disableTransport.includes(u.transport))),c=(r=(s=$0(l,(u=>u.transport===o)))==null?void 0:s.method)!==null&&r!==void 0?r:l[0].method;if(!c)throw new Error("No available transport method");c(a)})(B({},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=[],s=[];er(e,(o=>{o&&(n=o[0],Se(n)?s.push(o):Qi(o)?o.call(this):Se(o)&&n==="alias"?i.push(o):Se(o)&&n.indexOf("capture")!==-1&&Qi(this[n])?s.push(o):r.push(o))}));var a=function(o,l){er(o,(function(c){if(Se(c[0])){var u=l;we(c,(function(f){u=u[f[0]].apply(u,f.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};a(i,this),a(r,this),a(s,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(!N(e)&&tt(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!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&&!tt(n?.$current_url)&&(L.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 o=new Date,l=i?.timestamp||o,c=Ki(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,n||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&s&&(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 f,h=this.qr(i?.$set_once);if(h&&(u.$set_once=h),(u=yk(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,N(i?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o),e===xc.DISMISSED||e===xc.SENT){var p=n?.[w0.SURVEY_ID],y=n?.[w0.SURVEY_ITERATION];f={id:p,current_iteration:y},localStorage.getItem(C0(f))||localStorage.setItem(C0(f),"true"),u.$set=B({},u.$set,{[yT({id:p,current_iteration:y},e===xc.SENT?"responded":"dismissed")]:!0})}var _=B({},u.properties.$set,u.$set);if(Gs(_)||this.setPersonPropertiesForFlags(_),!ye(this.config.before_send)){var b=this.Wr(u);if(!b)return;u=b}this.Er.emit("eventCaptured",u);var d={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.Or(d):this.Mr.enqueue(d),u}L.critical("This capture call is ignored due to client rate limiting.")}}else L.error("No event name provided to posthog.capture")}else L.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,i,r,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return n;var a=s?void 0:this.persistence.remove_event_timer(e),o=B({},n);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),e==="$snapshot"){var l=B({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!tt(o.distinct_id)&&!Un(o.distinct_id)||jf(o.distinct_id))&&L.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var c,u=rT(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());o.$session_id=f,o.$window_id=h}this.sessionPropsManager&&Pe(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&Pe(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(p=this.Ar)==null?void 0:p.length}catch(d){o.$sdk_debug_error_capturing_properties=String(d)}if(this.requestRouter.region===Mo.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||s?e!=="$pageleave"||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),o=Pe(o,c),e==="$pageview"&&D&&(o.title=D.title),!N(a)){var y=i.getTime()-a;o.$duration=parseFloat((y/1e3).toFixed(3))}Mt&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=Pe({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),Se(this.config.property_denylist)?we(this.config.property_denylist,(function(d){delete o[d]})):L.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(L.error("sanitize_properties is deprecated. Use before_send instead"),o=_(o,e));var b=this.Gr();return o.$process_person_profile=b,b&&!s&&this.Vr("_calculate_event_properties"),o}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(),s=Pe({},i,r||{},e||{}),a=this.config.sanitize_properties;return a&&(L.error("sanitize_properties is deprecated. Use before_send instead"),s=a(s,"$set_once")),this.Sr=!0,Gs(s)?void 0:s}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=bT),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 L.uninitializedWarning("posthog.identify");if(Un(e)&&(e=e.toString(),L.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()))L.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!==mo){if(this.Vr("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==r&&e!==this.get_property(Co)&&(this.unregister(Co),this.register({distinct_id:e}));var a=(this.persistence.get_property(oi)||"anonymous")==="anonymous";e!==r&&a?(this.persistence.set_property(oi,"identified"),this.setPersonPropertiesForFlags(B({},i||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:n||{},$set_once:i||{}}),this.Tr=_0(e,n,i),this.featureFlags.setAnonymousDistinctId(r)):(n||i)&&this.setPersonProperties(n,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(Ac))}}else L.critical('The string "'+mo+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else L.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Vr("posthog.setPersonProperties")){var i=_0(this.get_distinct_id(),e,n);this.Tr!==i?(this.setPersonPropertiesForFlags(B({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Tr=i):L.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:B({},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 L.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,s;if(L.info("reset"),!this.__loaded)return L.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(oi,"anonymous"),(s=this.sessionManager)==null||s.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:mo,$device_id:null},"");else{var o=this.config.get_device_id(Ki());this.register_once({distinct_id:o,$device_id:e?o: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 s,a=(s=e.timestampLookBack)!==null&&s!==void 0?s: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(V0)?(L.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(N(n)&&(n=this.get_distinct_id()),e!==n?(this.Jr(Co,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(L.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=B({},this.config);if(st(e)){var i,r,s,a,o;Pe(this.config,R0(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 Do(B({},this.config,{persistence:"sessionStorage"}),l);var c=this.Rr(this.config.debug);Ji(c)&&(this.config.debug=c),Ji(this.config.debug)&&(this.config.debug?(ai.DEBUG=!0,Be.H()&&Be.G("ph_debug","true"),L.info("set_config",{config:e,oldConfig:n,newConfig:B({},this.config)})):(ai.DEBUG=!1,Be.H()&&Be.V("ph_debug"))),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(s=this.autocapture)==null||s.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(o=this.externalIntegrations)==null||o.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,s,a,o,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),i.sampling&&((s=this.sessionRecording)==null||s.overrideSampling()),i.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),i.url_trigger&&((o=this.sessionRecording)==null||o.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(B({},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:Ps;return n!==Ps&&(n=Ps+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(oi))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(oi))==="identified"}Gr(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Gs(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Co])&&((n=this.persistence)==null||(n=n.props)==null||!n[Tc]))}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"?(L.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(Tc,!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,s=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==s&&((i=this.persistence)==null||i.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.wi)!==s&&((r=this.sessionPersistence)==null||r.set_disabled(s)),s}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 Ic(this),this.persistence&&(this.sessionPropsManager=new Vc(this,this.sessionManager,this.persistence)),this.sessionRecording=new Fc(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(),(N(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 L.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:mo,$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())):L.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===li.GRANTED?"granted":e===li.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 Pt?z_(Pt,this.config.custom_blocked_useragents):void 0}Hr(){D&&(D.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:D.title},{send_instantly:!0}),this.kr&&(D.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),We(D,"visibilitychange",this.kr)))}debug(e){e===!1?(A?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(A?.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,s,a,o,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?(L.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,s=L,a=(n="advanced_disable_flags")in(e=l)&&!N(e[n]),o=i in e&&!N(e[i]),a?e[n]:o?(s&&s.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(ye(this.config.before_send))return e;var n=Se(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of n){if(i=r(i),ye(i)){var s="Event '"+e.event+"' was rejected in beforeSend function";return tk(e.event)?L.warn(s+". This can cause unexpected behavior."):L.info(s),null}i.properties&&!Gs(i.properties)||L.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=Ji(e)&&!e,i=Be.H()&&Be.q("ph_debug")==="true";return!n&&(!!i||e)}};(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=vk(t.prototype[e[n]])})(jc,["identify"]);var O0,H_=(O0=Lo[Ps]=new jc,(function(){function t(){t.done||(t.done=!0,B_=!1,we(Lo,(function(e){e._dom_loaded()})))}D!=null&&D.addEventListener?D.readyState==="complete"?t():We(D,"DOMContentLoaded",t,{capture:!1}):A&&L.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),O0);var ah=class{constructor(e={}){this.options=e;F(this,"client");F(this,"featureFlagsCallback");F(this,"captureCallback");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&typeof window<"u"&&e.apiKey){this.client=H_;let n=e.enableFeatureFlags??!0;this.client.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:i=>{n&&this.featureFlagsCallback&&i.onFeatureFlags(()=>{let r=this.getAllFeatureFlags();r&&this.featureFlagsCallback&&this.featureFlagsCallback(r)}),this.captureCallback&&i.on("eventCaptured",(r,s)=>{this.captureCallback?.(r,s)})}})}}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 oh(t={}){return new ah(t)}var $_={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function uh(){return $_}function lh(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 qo(t,e,n){return n===2?lh(lh(t+e)+"")%1e4/1e4:n===1?lh(e+t)%1e3/1e3:null}function kT(t){return t<=0?[]:new Array(t).fill(1/t)}function Yc(t,e){return t>=e[0]&&t<e[1]}function V_(t,e){let n=qo("__"+e[0],t,1);return n===null?!1:n>=e[1]&&n<e[2]}function I_(t,e){for(let n=0;n<e.length;n++)if(Yc(t,e[n]))return n;return-1}function dh(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function Zc(t,e){if(!e.length)return!1;let n=!1,i=!1;for(let r=0;r<e.length;r++){let s=OT(t,e[r].type,e[r].pattern);if(e[r].include===!1){if(s)return!1}else n=!0,s&&(i=!0)}return i||!n}function TT(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 RT(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,s)=>{i.push([t.searchParams.get(s)||"",r,!1])}),!i.some(r=>!TT(r[0],r[1],r[2]))}catch{return!1}}function OT(t,e,n){try{let i=new URL(t,"https://_");if(e==="regex"){let r=dh(n);return r?r.test(i.href)||r.test(i.href.substring(i.origin.length)):!1}else if(e==="simple")return RT(i,n);return!1}catch{return!1}}function F_(t,e,n){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let i=kT(t);n=n||i,n.length!==t&&(n=i);let r=n.reduce((a,o)=>o+a,0);(r<.99||r>1.01)&&(n=i);let s=0;return n.map(a=>{let o=s;return s+=a,[o,o+e*a]})}function j_(t,e,n){if(!e)return null;let i=e.split("?")[1];if(!i)return null;let r=i.replace(/#.*/,"").split("&").map(s=>s.split("=",2)).filter(([s])=>s===t).map(([,s])=>parseInt(s));return r.length>0&&r[0]>=0&&r[0]<n?r[0]:null}function q_(t){try{return t()}catch(e){return console.error(e),!1}}var ch=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function Xr(t,e,n){if(e=e||"",n=n||globalThis.crypto&&globalThis.crypto.subtle||$_.SubtleCrypto,!n)throw new Error("No SubtleCrypto implementation found");try{let i=await n.importKey("raw",ch(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[r,s]=t.split("."),a=await n.decrypt({name:"AES-CBC",iv:ch(r)},i,ch(s));return new TextDecoder().decode(a)}catch{throw new Error("Failed to decrypt")}}function Po(t){return typeof t=="string"?t:JSON.stringify(t)}function Gt(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 P_(){let t;try{t="1.6.3"}catch{t=""}return t}function G_(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,s)=>{i.searchParams.has(s)||i.searchParams.set(s,r)}),i.toString()}function U_(t){return typeof t=="object"&&t!==null}function Wc(t){return t.urlPatterns&&t.variations.some(e=>U_(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>U_(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function Xc(t,e){return new Promise(n=>{let i=!1,r,s=a=>{i||(i=!0,r&&clearTimeout(r),n(a||null))};e&&(r=setTimeout(()=>s(),e)),t.then(a=>s(a)).catch(()=>s())})}var _t={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},$n=uh(),Kr={fetchFeaturesCall:({host:t,clientKey:e,headers:n})=>$n.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 $n.fetch(`${t}/api/eval/${e}`,r)},eventSourceCall:({host:t,clientKey:e,headers:n})=>n?new $n.EventSource(`${t}/sub/${e}`,{headers:n}):new $n.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let n=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),DT()):document.visibilityState==="hidden"&&(t=window.setTimeout(NT,_t.idleStreamInterval))};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},stopIdleListener:()=>{}};try{globalThis.localStorage&&($n.localStorage=globalThis.localStorage)}catch{}var ta=new Map,Y_=!1,di=new Map,Kc=new Map,na=new Map,ia=new Set;function ph(t){Object.assign(_t,t),_t.backgroundSync||yh()}async function W_({instance:t,timeout:e,skipCache:n,allowStale:i,backgroundSync:r}){return r||(_t.backgroundSync=!1),LT({instance:t,allowStale:i,timeout:e,skipCache:n})}function MT(t){let e=Go(t),n=ta.get(e)||new Set;n.add(t),ta.set(e,n)}function X_(t){ta.forEach(e=>e.delete(t))}function NT(){na.forEach(t=>{t&&(t.state="idle",mh(t))})}function DT(){na.forEach(t=>{t&&t.state==="idle"&&vh(t)})}async function Z_(){try{if(!$n.localStorage)return;await $n.localStorage.setItem(_t.cacheKey,JSON.stringify(Array.from(di.entries())))}catch{}}async function LT({instance:t,allowStale:e,timeout:n,skipCache:i}){let r=Go(t),s=hh(t),a=new Date,o=new Date(a.getTime()-_t.maxAge+_t.staleTTL);await zT();let l=!_t.disableCache&&!i?di.get(s):void 0;return l&&(e||l.staleAt>a)&&l.staleAt>o?(l.sse&&ia.add(r),l.staleAt<a?fh(t):gh(t),{data:l.data,success:!0,source:"cache"}):await Xc(fh(t),n)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function Go(t){let[e,n]=t.getApiInfo();return`${e}||${n}`}function hh(t){let e=Go(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let n=t.getAttributes(),i=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),r={};i.forEach(o=>{r[o]=n[o]});let s=t.getForcedVariations(),a=t.getUrl();return`${e}||${JSON.stringify({ca:r,fv:s,url:a})}`}async function zT(){if(!Y_){Y_=!0;try{if($n.localStorage){let t=await $n.localStorage.getItem(_t.cacheKey);if(!_t.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([n,i])=>{di.set(n,{...i,staleAt:new Date(i.staleAt)})}),K_()}}}catch{}if(!_t.disableIdleStreams){let t=Kr.startIdleListener();t&&(Kr.stopIdleListener=t)}}}function K_(){let t=Array.from(di.entries()).map(([n,i])=>({key:n,staleAt:i.staleAt.getTime()})).sort((n,i)=>n.staleAt-i.staleAt),e=Math.min(Math.max(0,di.size-_t.maxEntries),di.size);for(let n=0;n<e;n++)di.delete(t[n].key)}function Q_(t,e,n){let i=n.dateUpdated||"",r=new Date(Date.now()+_t.staleTTL),s=_t.disableCache?void 0:di.get(e);if(s&&i&&s.version===i){s.staleAt=r,Z_();return}_t.disableCache||(di.set(e,{data:n,version:i,staleAt:r,sse:ia.has(t)}),K_()),Z_();let a=ta.get(t);a&&a.forEach(o=>BT(o,n))}async function BT(t,e){await t.setPayload(e||t.getPayload())}async function fh(t){let{apiHost:e,apiRequestHeaders:n}=t.getApiHosts(),i=t.getClientKey(),r="isRemoteEval"in t&&t.isRemoteEval(),s=Go(t),a=hh(t),o=Kc.get(a);return o||(o=(r?Kr.fetchRemoteEvalCall({host:e,clientKey:i,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:n}):Kr.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"&&ia.add(s),c.json()}).then(c=>(Q_(s,a,c),gh(t),Kc.delete(a),{data:c,success:!0,source:"network"})).catch(c=>(Kc.delete(a),{data:null,source:"error",success:!1,error:c})),Kc.set(a,o)),o}function gh(t,e=!1){let n=Go(t),i=hh(t),{streamingHost:r,streamingHostRequestHeaders:s}=t.getApiHosts(),a=t.getClientKey();if(e&&ia.add(n),_t.backgroundSync&&ia.has(n)&&$n.EventSource){if(na.has(n))return;let o={src:null,host:r,clientKey:a,headers:s,cb:l=>{try{if(l.type==="features-updated"){let c=ta.get(n);c&&c.forEach(u=>{fh(u)})}else if(l.type==="features"){let c=JSON.parse(l.data);Q_(n,i,c)}o.errors=0}catch{J_(o)}},errors:0,state:"active"};na.set(n,o),vh(o)}}function J_(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);mh(t),setTimeout(()=>{["idle","active"].includes(t.state)||vh(t)},Math.min(e,3e5))}}function mh(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function vh(t){t.src=Kr.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=()=>J_(t),t.src.onopen=()=>{t.errors=0}}function HT(t,e){mh(t),na.delete(e)}function yh(){ia.clear(),na.forEach(HT),ta.clear(),Kr.stopIdleListener()}function Qc(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&gh(t,!0),MT(t)}}var UT=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Sh={revert:function(){}},nu=new Map,xh=new Set;function $T(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function iu(t){var e=nu.get(t);return e||(e={element:t,attributes:{}},nu.set(t,e)),e}function ru(t,e,n,i,r){var s=n(t),a={isDirty:!1,originalValue:s,virtualValue:s,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 o=n(t);e==="position"&&o.parentNode===a.virtualValue.parentNode&&o.insertBeforeNode===a.virtualValue.insertBeforeNode||o!==a.virtualValue&&(a.originalValue=o,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,$T(e)),a}function su(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,eb()):t!==n&&(e.isDirty=!0,eb())}function VT(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),su(eR(e),t)}function IT(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(n){return n.mutate(e)}),su(Array.from(e).filter(Boolean).join(" "),t)}function FT(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),su(e,t)}function jT(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 qT(t){var e=t.originalValue;t.mutations.forEach(function(n){var i=n.mutate(),r=jT(i);e=r||e}),su(e,t)}var PT=function(e){return e.innerHTML},GT=function(e,n){return e.innerHTML=n};function nb(t){var e=iu(t);return e.html||(e.html=ru(t,"html",PT,GT,VT)),e.html}var YT=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},ZT=function(e,n){n.insertBeforeNode&&!n.parentNode.contains(n.insertBeforeNode)||n.parentNode.insertBefore(e,n.insertBeforeNode)};function ib(t){var e=iu(t);return e.position||(e.position=ru(t,"position",YT,ZT,qT)),e.position}var WT=function(e,n){return n?e.className=n:e.removeAttribute("class")},XT=function(e){return e.className};function rb(t){var e=iu(t);return e.classes||(e.classes=ru(t,"class",XT,WT,IT)),e.classes}var KT=function(e){return function(n){var i;return(i=n.getAttribute(e))!=null?i:null}},QT=function(e){return function(n,i){return i!==null?n.setAttribute(e,i):n.removeAttribute(e)}};function sb(t,e){var n=iu(t);return n.attributes[e]||(n.attributes[e]=ru(t,e,KT(e),QT(e),FT)),n.attributes[e]}function JT(t,e){var n=nu.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 s,a;(s=n.classes)==null||(a=s.observer)==null||a.disconnect(),delete n.classes}else if(e==="position"){var o,l;(o=n.position)==null||(l=o.observer)==null||l.disconnect(),delete n.position}else{var c,u,f;(c=n.attributes)==null||(u=c[e])==null||(f=u.observer)==null||f.disconnect(),delete n.attributes[e]}}var Jc;function eR(t){return Jc||(Jc=document.createElement("div")),Jc.innerHTML=t,Jc.innerHTML}function eu(t,e,n){if(n.isDirty){n.isDirty=!1;var i=n.virtualValue;n.mutations.length||JT(t,e),n.setValue(t,i)}}function tR(t,e){t.html&&eu(e,"html",t.html),t.classes&&eu(e,"class",t.classes),t.position&&eu(e,"position",t.position),Object.keys(t.attributes).forEach(function(n){eu(e,n,t.attributes[n])})}function eb(){nu.forEach(tR)}function nR(t,e){var n=null;t.kind==="html"?n=nb(e):t.kind==="class"?n=rb(e):t.kind==="attribute"?n=sb(e,t.attribute):t.kind==="position"&&(n=ib(e)),n&&(n.mutations.push(t),n.mutationRunner(n))}function iR(t,e){var n=null;if(t.kind==="html"?n=nb(e):t.kind==="class"?n=rb(e):t.kind==="attribute"?n=sb(e,t.attribute):t.kind==="position"&&(n=ib(e)),!!n){var i=n.mutations.indexOf(t);i!==-1&&n.mutations.splice(i,1),n.mutationRunner(n)}}function ab(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),nR(t,i))})}}function rR(t){t.elements.forEach(function(e){return iR(t,e)}),t.elements.clear(),xh.delete(t)}function tb(){xh.forEach(ab)}var _h;function sR(){typeof document>"u"||(_h||(_h=new MutationObserver(function(){tb()})),tb(),_h.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}sR();function au(t){return typeof document>"u"?Sh:(xh.add(t),ab(t),{revert:function(){rR(t)}})}function bh(t,e){return au({kind:"html",elements:new Set,mutate:e,selector:t})}function ob(t,e){return au({kind:"position",elements:new Set,mutate:e,selector:t})}function Yo(t,e){return au({kind:"class",elements:new Set,mutate:e,selector:t})}function tu(t,e,n){return UT.test(e)?e==="class"||e==="className"?Yo(t,function(i){var r=n(Array.from(i).join(" "));i.clear(),r&&r.split(/\s+/g).filter(Boolean).forEach(function(s){return i.add(s)})}):au({kind:"attribute",attribute:e,elements:new Set,mutate:n,selector:t}):Sh}function aR(t){var e=t.selector,n=t.action,i=t.value,r=t.attribute,s=t.parentSelector,a=t.insertBeforeSelector;if(r==="html"){if(n==="append")return bh(e,function(o){return o+(i??"")});if(n==="set")return bh(e,function(){return i??""})}else if(r==="class"){if(n==="append")return Yo(e,function(o){i&&o.add(i)});if(n==="remove")return Yo(e,function(o){i&&o.delete(i)});if(n==="set")return Yo(e,function(o){o.clear(),i&&o.add(i)})}else if(r==="position"){if(n==="set"&&s)return ob(e,function(){return{insertBeforeSelector:a,parentSelector:s}})}else{if(n==="append")return tu(e,r,function(o){return o!==null?o+(i??""):i??""});if(n==="set")return tu(e,r,function(){return i??""});if(n==="remove")return tu(e,r,function(){return null})}return Sh}var oR={html:bh,classes:Yo,attribute:tu,position:ob,declarative:aR},lb=oR;var Eh={};function nr(t,e,n){n=n||{};for(let[i,r]of Object.entries(e))switch(i){case"$or":if(!ub(t,r,n))return!1;break;case"$nor":if(ub(t,r,n))return!1;break;case"$and":if(!fR(t,r,n))return!1;break;case"$not":if(nr(t,r,n))return!1;break;default:if(!Zo(r,lR(t,i),n))return!1}return!0}function lR(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 cb(t,e=!1){let n=`${t}${e?"/i":""}`;return Eh[n]||(Eh[n]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),Eh[n]}function Zo(t,e,n){if(typeof t=="string")return 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)||!db(t))return JSON.stringify(e)===JSON.stringify(t);for(let i in t)if(!dR(i,e,t[i],n))return!1;return!0}function db(t){let e=Object.keys(t);return e.length>0&&e.filter(n=>n[0]==="$").length===e.length}function cR(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 uR(t,e,n){if(!Array.isArray(t))return!1;let i=db(e)?r=>Zo(e,r,n):r=>nr(r,e,n);for(let r=0;r<t.length;r++)if(t[r]&&i(t[r]))return!0;return!1}function ou(t,e){return Array.isArray(t)?t.some(n=>e.includes(n)):e.includes(t)}function dR(t,e,n,i){switch(t){case"$veq":return Gt(e)===Gt(n);case"$vne":return Gt(e)!==Gt(n);case"$vgt":return Gt(e)>Gt(n);case"$vgte":return Gt(e)>=Gt(n);case"$vlt":return Gt(e)<Gt(n);case"$vlte":return Gt(e)<=Gt(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)?ou(e,n):!1;case"$inGroup":return ou(e,i[n]||[]);case"$notInGroup":return!ou(e,i[n]||[]);case"$nin":return Array.isArray(n)?!ou(e,n):!1;case"$not":return!Zo(n,e,i);case"$size":return Array.isArray(e)?Zo(n,e.length,i):!1;case"$elemMatch":return uR(e,n,i);case"$all":if(!Array.isArray(e))return!1;for(let r=0;r<n.length;r++){let s=!1;for(let a=0;a<e.length;a++)if(Zo(n[r],e[a],i)){s=!0;break}if(!s)return!1}return!0;case"$regex":try{return cb(n).test(e)}catch{return!1}case"$regexi":try{return cb(n,!0).test(e)}catch{return!1}case"$type":return cR(e)===n;default:return console.error("Unknown operator: "+t),!1}}function ub(t,e,n){if(!e.length)return!0;for(let i=0;i<e.length;i++)if(nr(t,e[i],n))return!0;return!1}function fR(t,e,n){for(let i=0;i<e.length;i++)if(!nr(t,e[i],n))return!1;return!0}var pR="Feature Evaluated",hR="Experiment Viewed";function gR(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 mR(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 ra(t){try{await t()}catch{}}function fb(t,e,n){if(t.user.trackedExperiments){let r=uu(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(ra(()=>r(e,n,t.user)))}if(t.user.trackingCallback){let r=t.user.trackingCallback;i.push(ra(()=>r(e,n)))}if(t.global.eventLogger){let r=t.global.eventLogger;i.push(ra(()=>r(hR,{experimentId:e.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},t.user)))}return i}function vR(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;ra(()=>i(e,n,t.user))}if(t.user.onFeatureUsage){let i=t.user.onFeatureUsage;ra(()=>i(e,n))}if(t.global.eventLogger){let i=t.global.eventLogger;ra(()=>i(pR,{feature:e,source:n.source,value:n.value,ruleId:n.source==="defaultValue"?"$default":n.ruleId||"",variationId:n.experimentResult?n.experimentResult.key:""},t.user))}}function lu(t,e){if(e.stack.evaluatedFeatures.has(t))return ir(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let n=gR(e);if(n.has(t))return ir(e,t,n.get(t),"override");if(!e.global.features||!e.global.features[t])return ir(e,t,null,"unknownFeature");let i=e.global.features[t];if(i.rules){let r=new Set(e.stack.evaluatedFeatures);e:for(let s of i.rules){if(s.parentConditions)for(let l of s.parentConditions){e.stack.evaluatedFeatures=new Set(r);let c=lu(l.id,e);if(c.source==="cyclicPrerequisite")return ir(e,t,null,"cyclicPrerequisite");let u={value:c.value};if(!nr(u,l.condition||{})){if(l.gate)return ir(e,t,null,"prerequisite");continue e}}if(s.filters&&gb(s.filters,e))continue;if("force"in s){if(s.condition&&!hb(s.condition,e)||!yR(e,s.seed||t,s.hashAttribute,e.user.saveStickyBucketAssignmentDoc&&!s.disableStickyBucketing?s.fallbackAttribute:void 0,s.range,s.coverage,s.hashVersion))continue;return s.tracks&&s.tracks.forEach(l=>{!fb(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),ir(e,t,s.force,"force",s.id)}if(!s.variations)continue;let a={variations:s.variations,key:s.key||t};"coverage"in s&&(a.coverage=s.coverage),s.weights&&(a.weights=s.weights),s.hashAttribute&&(a.hashAttribute=s.hashAttribute),s.fallbackAttribute&&(a.fallbackAttribute=s.fallbackAttribute),s.disableStickyBucketing&&(a.disableStickyBucketing=s.disableStickyBucketing),s.bucketVersion!==void 0&&(a.bucketVersion=s.bucketVersion),s.minBucketVersion!==void 0&&(a.minBucketVersion=s.minBucketVersion),s.namespace&&(a.namespace=s.namespace),s.meta&&(a.meta=s.meta),s.ranges&&(a.ranges=s.ranges),s.name&&(a.name=s.name),s.phase&&(a.phase=s.phase),s.seed&&(a.seed=s.seed),s.hashVersion&&(a.hashVersion=s.hashVersion),s.filters&&(a.filters=s.filters),s.condition&&(a.condition=s.condition);let{result:o}=cu(a,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(a,o),o.inExperiment&&!o.passthrough)return ir(e,t,o.value,"experiment",s.id,a,o)}}return ir(e,t,i.defaultValue===void 0?null:i.defaultValue,"defaultValue")}function cu(t,e,n){let i=t.key,r=t.variations.length;if(r<2)return{result:De(n,t,-1,!1,e)};if(n.global.enabled===!1||n.user.enabled===!1)return{result:De(n,t,-1,!1,e)};if(t=_R(t,n),t.urlPatterns&&!Zc(n.user.url||"",t.urlPatterns))return{result:De(n,t,-1,!1,e)};let s=j_(i,n.user.url||"",r);if(s!==null)return{result:De(n,t,s,!1,e)};let a=mR(n);if(i in a){let b=a[i];return{result:De(n,t,b,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:De(n,t,-1,!1,e)};let{hashAttribute:o,hashValue:l}=Qr(n,t.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:De(n,t,-1,!1,e)};let c=-1,u=!1,f=!1;if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:b,versionIsBlocked:d}=xR({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,f=!!d}if(!u){if(t.filters){if(gb(t.filters,n))return{result:De(n,t,-1,!1,e)}}else if(t.namespace&&!V_(l,t.namespace))return{result:De(n,t,-1,!1,e)};if(t.include&&!q_(t.include))return{result:De(n,t,-1,!1,e)};if(t.condition&&!hb(t.condition,n))return{result:De(n,t,-1,!1,e)};if(t.parentConditions){let b=new Set(n.stack.evaluatedFeatures);for(let d of t.parentConditions){n.stack.evaluatedFeatures=new Set(b);let g=lu(d.id,n);if(g.source==="cyclicPrerequisite")return{result:De(n,t,-1,!1,e)};let m={value:g.value};if(!nr(m,d.condition||{}))return{result:De(n,t,-1,!1,e)}}}if(t.groups&&!SR(t.groups,n))return{result:De(n,t,-1,!1,e)}}if(t.url&&!bR(t.url,n))return{result:De(n,t,-1,!1,e)};let h=qo(t.seed||i,l,t.hashVersion||1);if(h===null)return{result:De(n,t,-1,!1,e)};if(!u){let b=t.ranges||F_(r,t.coverage===void 0?1:t.coverage,t.weights);c=I_(h,b)}if(f)return{result:De(n,t,-1,!1,e,void 0,!0)};if(c<0)return{result:De(n,t,-1,!1,e)};if("force"in t)return{result:De(n,t,t.force===void 0?-1:t.force,!1,e)};if(n.global.qaMode||n.user.qaMode)return{result:De(n,t,-1,!1,e)};if(t.status==="stopped")return{result:De(n,t,-1,!1,e)};let p=De(n,t,c,!0,e,h,u);if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:b,key:d,doc:g}=wR(n,o,Po(l),{[wh(t.key,t.bucketVersion)]:p.key});b&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[d]=g,n.user.saveStickyBucketAssignmentDoc(g))}let y=fb(n,t,p);y.length===0&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:t,result:p});let _=y.length?y.length===1?y[0]:Promise.all(y).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&n.global.recordChangeId&&n.global.recordChangeId(t.changeId),{result:p,trackingCall:_}}function ir(t,e,n,i,r,s,a){let o={value:n,on:!!n,off:!n,source:i,ruleId:r||""};return s&&(o.experiment=s),a&&(o.experimentResult=a),i!=="override"&&vR(t,e,o),o}function pb(t){return{...t.user.attributes,...t.user.attributeOverrides}}function hb(t,e){return nr(pb(e),t,e.global.savedGroups||{})}function gb(t,e){return t.some(n=>{let{hashValue:i}=Qr(e,n.attribute);if(!i)return!0;let r=qo(n.seed,i,n.hashVersion||2);return r===null?!0:!n.ranges.some(s=>Yc(r,s))})}function yR(t,e,n,i,r,s,a){if(!r&&s===void 0)return!0;if(!r&&s===0)return!1;let{hashValue:o}=Qr(t,n,i);if(!o)return!1;let l=qo(e,o,a||1);return l===null?!1:r?Yc(l,r):s!==void 0?l<=s:!0}function De(t,e,n,i,r,s,a){let o=!0;(n<0||n>=e.variations.length)&&(n=0,o=!1);let{hashAttribute:l,hashValue:c}=Qr(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),u=e.meta?e.meta[n]:{},f={key:u.key||""+n,featureId:r,inExperiment:o,hashUsed:i,variationId:n,value:e.variations[n],hashAttribute:l,hashValue:c,stickyBucketUsed:!!a};return u.name&&(f.name=u.name),s!==void 0&&(f.bucket=s),u.passthrough&&(f.passthrough=u.passthrough),f}function _R(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=dh(t.url))),t}function Qr(t,e,n){let i=e||"id",r="",s=pb(t);return s[i]&&(r=s[i]),!r&&n&&(s[n]&&(r=s[n]),r&&(i=n)),{hashAttribute:i,hashValue:r}}function bR(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 SR(t,e){let n=e.global.groups||{};for(let i=0;i<t.length;i++)if(n[t[i]])return!0;return!1}function xR({ctx:t,expKey:e,expBucketVersion:n,expHashAttribute:i,expFallbackAttribute:r,expMinBucketVersion:s,expMeta:a}){n=n||0,s=s||0,i=i||"id",a=a||[];let o=wh(e,n),l=ER(t,i,r);if(s>0)for(let f=0;f<s;f++){let h=wh(e,f);if(l[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let c=l[o];if(c===void 0)return{variation:-1};let u=a.findIndex(f=>f.key===c);return u<0?{variation:-1}:{variation:u}}function wh(t,e){return e=e||0,`${t}__${e}`}function Ch(t,e){return`${t}||${e}`}function ER(t,e,n){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:i,hashValue:r}=Qr(t,e),s=Ch(i,Po(r)),{hashAttribute:a,hashValue:o}=Qr(t,n),l=o?Ch(a,Po(o)):null,c={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[s]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[s].assignments||{}),c}function wR(t,e,n,i){let r=Ch(e,n),s=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[r]?t.user.stickyBucketAssignmentDocs[r].assignments||{}:{},a={...s,...i},o=JSON.stringify(s)!==JSON.stringify(a);return{key:r,doc:{attributeName:e,attributeValue:n,assignments:a},changed:o}}function CR(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(s=>{let a=i[s];if(a.rules)for(let o of a.rules)o.variations&&(n.add(o.hashAttribute||"id"),o.fallbackAttribute&&n.add(o.fallbackAttribute))}),r.map(s=>{n.add(s.hashAttribute||"id"),s.fallbackAttribute&&n.add(s.fallbackAttribute)}),Array.from(n)}async function mb(t,e,n){let i=Ah(t,n);return e.getAllAssignments(i)}function Ah(t,e){let n={};return CR(t,e).forEach(r=>{let{hashValue:s}=Qr(t,r);n[r]=Po(s)}),n}async function vb(t,e,n){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await Xr(t.encryptedFeatures,e,n))}catch(i){console.error(i)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await Xr(t.encryptedExperiments,e,n))}catch(i){console.error(i)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await Xr(t.encryptedSavedGroups,e,n))}catch(i){console.error(i)}delete t.encryptedSavedGroups}return t}function yb(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 uu(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var sa=typeof window<"u"&&typeof document<"u",AR=P_(),aa=class{constructor(e){if(e=e||{},this.version=AR,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),sa&&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 vb(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,Qc(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&ph(e.cacheSettings),e.payload)return await this.setPayload(e.payload),Qc(this,e),{success:!0,source:"init"};{let{data:n,...i}=await this._refresh({...e,allowStale:!0});return Qc(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 yb(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 W_({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 Xr(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 Xr(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,X_(this),e.destroyAllStreams&&yh(),this.logs=[],sa&&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}=cu(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),s,a;r?s=De(this._getEvalContext(),e,-1,!1,""):({result:s,trackingCall:a}=cu(e,null,this._getEvalContext()),this._onExperimentEval(e,s));let o=JSON.stringify(s.value);if(!n&&s.inExperiment&&i&&i.valueHash===o)return s;if(i&&this._undoActiveAutoExperiment(e),s.inExperiment){let l=Wc(e);if(l==="redirect"&&s.value.urlRedirect&&e.urlPatterns){let c=e.persistQueryString?G_(this._getContextUrl(),s.value.urlRedirect):s.value.urlRedirect;if(Zc(c,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),s;this._redirectedUrl=c;let{navigate:u,delay:f}=this._getNavigateFunction();if(u)if(sa)Promise.all([...a?[Xc(a,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??f))]).then(()=>{try{u(c)}catch(h){console.error(h)}});else try{u(c)}catch(h){console.error(h)}}else if(l==="visual"){let c=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(s.value):this._applyDOMChanges(s.value);c&&this._activeAutoExperiments.set(e,{undo:c,valueHash:o})}}return s}_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,s)=>{i.has(s)||(r.undo(),this._activeAutoExperiments.delete(s))});for(let r of n){let s=this._runAutoExperiment(r,e);if(s&&s.inExperiment&&Wc(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(s){console.error(s)}})}_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 lu(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=>[uu(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(uu(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(sa?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let n=Wc(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 s=new URL(r.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(s.protocol!==i.protocol||s.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}:sa?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!sa)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(lb.declarative(i).revert)}),()=>{n.forEach(i=>i())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let n=this._getEvalContext(),i=await mb(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=Ah(i,n);return e.getAllAssignmentsSync(r)}inDevMode(){return!!this._options.enableDevMode}};var Vn=J(bt());function Lh(){return Lh=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},Lh.apply(null,arguments)}var qR=Vn.createContext({});var PR=t=>n=>Vn.createElement(qR.Consumer,null,({growthbook:i})=>Vn.createElement(t,Lh({},n,{runExperiment:r=>i.run(r)})));PR.displayName="WithRunExperiment";var GR="https://experiment.syntrologie.com",zh=class{constructor(e={}){F(this,"gb");if(e.client)this.gb=e.client;else{let n=e.onExperimentViewed?(i,r)=>{e.onExperimentViewed(i.key,r.variationId,typeof r.value=="string"?r.value:`variation_${r.variationId}`)}:void 0;this.gb=new aa({...e,apiHost:e.apiHost??GR,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)}shouldRenderRectangle(e){let n=e.experiment;if(!n||!n.featureKey)return!0;let i=this.gb.getFeatureValue(n.featureKey,null);if(i==null)return!1;if(typeof n.variationId=="number")return Number(i)===n.variationId;if(typeof n.variationValue<"u")return i===n.variationValue;if(n.predicate)try{return n.predicate(i)}catch{return!1}return!!i}};function Bh(t={}){return new zh(t)}var rr=J(bt(),1),YR=t=>[...t].sort((e,n)=>(e.order??0)-(n.order??0));function Mb({fetcher:t,pollIntervalMs:e=3e4,experiments:n,runtime:i}){let[r,s]=(0,rr.useState)({tiles:[],actions:[],isLoading:!0}),a=(0,rr.useCallback)(async()=>{try{s(c=>({...c,isLoading:!0,error:void 0}));let o=await t(),l=o.tiles||[];i&&o.routes&&i.setRoutes(o.routes),i?(l=await i.filterTiles(l),n&&(l=l.filter(c=>n.shouldRenderRectangle(c)))):n&&(l=l.filter(c=>n.shouldRenderRectangle(c))),s({tiles:YR(l),actions:o.actions||[],isLoading:!1,fetchedAt:o.fetchedAt,canvasTitle:o.canvasTitle,configVersion:o.configVersion,theme:o.theme,launcher:o.launcher,routes:o.routes})}catch(o){s(l=>({...l,isLoading:!1,error:o instanceof Error?o.message:"Unknown error"}))}},[n,t,i]);return(0,rr.useEffect)(()=>{if(a(),!e)return;let o=setInterval(a,e);return()=>clearInterval(o)},[a,e]),(0,rr.useMemo)(()=>r,[r])}var pi=J(bt(),1);var Wo=J(bt(),1),le=J(xe(),1),XR={success:()=>(0,le.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,le.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,le.jsx)("path",{d:"M6 10l2.5 2.5L14 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),warning:()=>(0,le.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,le.jsx)("path",{d:"M10 2L18 17H2L10 2Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,le.jsx)("path",{d:"M10 8v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,le.jsx)("circle",{cx:"10",cy:"14",r:"0.75",fill:"currentColor"})]}),error:()=>(0,le.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,le.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,le.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),info:()=>(0,le.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,le.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,le.jsx)("path",{d:"M10 9v5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,le.jsx)("circle",{cx:"10",cy:"6",r:"0.75",fill:"currentColor"})]}),alert:()=>(0,le.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,le.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,le.jsx)("path",{d:"M10 5v6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,le.jsx)("circle",{cx:"10",cy:"14",r:"0.75",fill:"currentColor"})]})};function KR({onClick:t,color:e}){return(0,le.jsx)("button",{onClick:n=>{n.stopPropagation(),t()},style:{position:"absolute",top:"8px",right:"8px",width:"20px",height:"20px",padding:0,border:"none",background:"rgba(255, 255, 255, 0.1)",borderRadius:"50%",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:e,opacity:.6,transition:"opacity 0.15s ease"},onMouseEnter:n=>{n.currentTarget.style.opacity="1"},onMouseLeave:n=>{n.currentTarget.style.opacity="0.6"},"aria-label":"Dismiss",children:(0,le.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,le.jsx)("path",{d:"M1 1l8 8M9 1l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})}function QR(t){let e={success:{bg:"var(--sc-color-success-muted, rgba(52, 199, 89, 0.15))",border:"var(--sc-color-success, #34c759)",icon:"var(--sc-color-success, #34c759)",text:"var(--sc-color-text, #f5f5f7)"},warning:{bg:"var(--sc-color-warning-muted, rgba(255, 159, 10, 0.15))",border:"var(--sc-color-warning, #ff9f0a)",icon:"var(--sc-color-warning, #ff9f0a)",text:"var(--sc-color-text, #f5f5f7)"},error:{bg:"var(--sc-color-error-muted, rgba(255, 69, 58, 0.15))",border:"var(--sc-color-error, #ff453a)",icon:"var(--sc-color-error, #ff453a)",text:"var(--sc-color-text, #f5f5f7)"},info:{bg:"var(--sc-color-info-muted, rgba(10, 132, 255, 0.15))",border:"var(--sc-color-info, #0a84ff)",icon:"var(--sc-color-info, #0a84ff)",text:"var(--sc-color-text, #f5f5f7)"},alert:{bg:"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))",border:"var(--sc-color-primary, #6366f1)",icon:"var(--sc-color-primary, #6366f1)",text:"var(--sc-color-text, #f5f5f7)"}};return e[t]||e.info}function Hh({content:t,onDismiss:e,accentColor:n}){let[i,r]=(0,Wo.useState)(!1),[s,a]=(0,Wo.useState)(t.type==="warning"?t.countdown??null:null);(0,Wo.useEffect)(()=>{if(s===null||s<=0)return;let d=setInterval(()=>{a(g=>g!==null&&g>0?g-1:null)},1e3);return()=>clearInterval(d)},[s]);let o=()=>{r(!0),setTimeout(()=>e?.(),200)},l=QR(t.type),c=XR[t.type],u={position:"relative",padding:"var(--sc-spacing-md, 0.75rem)",borderRadius:"var(--sc-border-radius-md, 10px)",background:l.bg,borderLeft:`3px solid ${l.border}`,opacity:i?0:1,transform:i?"translateX(10px)":"translateX(0)",transition:"opacity 0.2s ease, transform 0.2s ease"},f={display:"flex",alignItems:"flex-start",gap:"var(--sc-spacing-sm, 0.5rem)"},h={color:l.icon,flexShrink:0,marginTop:"1px"},p={flex:1,minWidth:0,paddingRight:t.dismissible?"24px":0},y={fontSize:"var(--sc-font-size-md, 0.9rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:l.text,margin:0,lineHeight:"var(--sc-line-height-tight, 1.25)"},_={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",margin:"var(--sc-spacing-xs, 0.25rem) 0 0",lineHeight:"var(--sc-line-height-normal, 1.5)"},b={fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)",marginTop:"var(--sc-spacing-sm, 0.5rem)"};return(0,le.jsxs)("div",{style:u,children:[(0,le.jsxs)("div",{style:f,children:[(0,le.jsx)("div",{style:h,children:(0,le.jsx)(c,{})}),(0,le.jsxs)("div",{style:p,children:[(0,le.jsx)("h4",{style:y,children:t.title}),t.body&&(0,le.jsx)("p",{style:_,children:t.body}),t.type==="error"&&t.errorCode&&(0,le.jsxs)("p",{style:{..._,fontFamily:"var(--sc-font-family-mono, monospace)"},children:["Code: ",t.errorCode]}),t.type==="info"&&t.learnMoreUrl&&(0,le.jsx)("a",{href:t.learnMoreUrl,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"var(--sc-spacing-sm, 0.5rem)",fontSize:"var(--sc-font-size-sm, 0.8rem)",color:l.icon,textDecoration:"none"},onClick:d=>d.stopPropagation(),children:"Learn more \u2192"}),s!==null&&s>0&&(0,le.jsxs)("p",{style:{..._,color:l.icon},children:["Action required in ",s,"s"]}),t.timestamp&&(0,le.jsx)("p",{style:b,children:t.timestamp})]})]}),t.dismissible&&(0,le.jsx)(KR,{onClick:o,color:l.text})]})}var zb=J(bt(),1),He=J(xe(),1);function JR({trend:t}){let e=t.direction==="up",n=t.direction==="down";return(0,He.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"var(--sc-border-radius-full, 9999px)",background:e?"var(--sc-color-success-muted, rgba(52, 199, 89, 0.15))":n?"var(--sc-color-error-muted, rgba(255, 69, 58, 0.15))":"rgba(142, 142, 147, 0.15)",color:e?"var(--sc-color-success, #34c759)":n?"var(--sc-color-error, #ff453a)":"var(--sc-color-text-muted, #8e8e93)",fontSize:"var(--sc-font-size-xs, 0.7rem)",fontWeight:"var(--sc-font-weight-medium, 500)"},children:[(0,He.jsx)(()=>(0,He.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",style:{transform:e?"rotate(0deg)":n?"rotate(180deg)":"rotate(90deg)"},children:(0,He.jsx)("path",{d:"M5 1v8M5 1L2 4M5 1l3 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),{}),t.value,t.timeframe&&(0,He.jsx)("span",{style:{color:"var(--sc-color-text-muted, #8e8e93)"},children:t.timeframe})]})}function e2({data:t,color:e}){let{path:n,width:i,height:r}=(0,zb.useMemo)(()=>{if(t.length<2)return{path:"",width:60,height:24};let l=Math.min(...t),u=Math.max(...t)-l||1;return{path:t.map((p,y)=>{let _=2+y/(t.length-1)*56,b=22-(p-l)/u*20;return{x:_,y:b}}).reduce((p,y,_)=>p+(_===0?`M ${y.x} ${y.y}`:` L ${y.x} ${y.y}`),""),width:60,height:24}},[t]);return n?(0,He.jsxs)("svg",{width:i,height:r,viewBox:`0 0 ${i} ${r}`,style:{overflow:"visible"},children:[(0,He.jsx)("path",{d:n,stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),(0,He.jsx)("defs",{children:(0,He.jsxs)("linearGradient",{id:"sparkline-gradient",x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,He.jsx)("stop",{offset:"0%",stopColor:e,stopOpacity:"0.3"}),(0,He.jsx)("stop",{offset:"100%",stopColor:e,stopOpacity:"0"})]})}),(0,He.jsx)("path",{d:`${n} L ${i-2} ${r} L 2 ${r} Z`,fill:"url(#sparkline-gradient)"})]}):null}function Uh({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",i={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0"},r={display:"flex",alignItems:"baseline",gap:"var(--sc-spacing-xs, 0.25rem)"},s={fontSize:"var(--sc-font-size-xxl, 1.5rem)",fontWeight:"var(--sc-font-weight-bold, 700)",color:n,letterSpacing:"-0.02em",lineHeight:1},a={fontSize:"var(--sc-font-size-md, 0.9rem)",fontWeight:"var(--sc-font-weight-normal, 400)",color:"var(--sc-color-text-muted, #8e8e93)"},o={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",margin:0},l={display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"var(--sc-spacing-xs, 0.25rem)"};return(0,He.jsxs)("div",{style:i,children:[(0,He.jsxs)("div",{style:r,children:[t.prefix&&(0,He.jsx)("span",{style:a,children:t.prefix}),(0,He.jsx)("span",{style:s,children:t.value}),t.suffix&&(0,He.jsx)("span",{style:a,children:t.suffix})]}),(0,He.jsx)("p",{style:o,children:t.label}),(t.trend||t.sparkline)&&(0,He.jsxs)("div",{style:l,children:[t.trend&&(0,He.jsx)(JR,{trend:t.trend}),t.sparkline&&t.sparkline.length>1&&(0,He.jsx)(e2,{data:t.sparkline,color:n})]})]})}var Dt=J(xe(),1);function t2({item:t,accentColor:e,layout:n}){let i=t.highlight,r={display:"flex",flexDirection:n==="list"?"row":"column",alignItems:n==="list"?"center":"flex-start",gap:n==="list"?"var(--sc-spacing-md, 0.75rem)":"var(--sc-spacing-xs, 0.25rem)",padding:"var(--sc-spacing-md, 0.75rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",background:i?"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))":"var(--sc-color-background-subtle, rgba(0, 0, 0, 0.2))",border:i?`1px solid ${e}`:"1px solid var(--sc-color-border-subtle, rgba(255, 255, 255, 0.06))",transition:"all 0.15s ease"},s={fontSize:"1.25rem",marginBottom:n==="list"?0:"var(--sc-spacing-xs, 0.25rem)"},a={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",flex:n==="list"?1:void 0},o={fontSize:"var(--sc-font-size-lg, 1rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:i?e:"var(--sc-color-text, #f5f5f7)"};return(0,Dt.jsxs)("div",{style:r,children:[t.icon&&(0,Dt.jsx)("span",{style:s,children:t.icon}),(0,Dt.jsx)("span",{style:a,children:t.label}),(0,Dt.jsx)("span",{style:o,children:t.value})]})}function $h({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",i=t.layout||"grid",r=t.columns||2,s=t.items;if(t.highlightBest&&!t.items.some(o=>o.highlight)){let o=t.items.map(c=>({...c,numericValue:typeof c.value=="number"?c.value:parseFloat(String(c.value))})),l=Math.max(...o.map(c=>c.numericValue||0));s=o.map(c=>({...c,highlight:c.numericValue===l}))}let a={display:i==="table"?"block":i==="list"?"flex":"grid",flexDirection:i==="list"?"column":void 0,gridTemplateColumns:i==="grid"?`repeat(${r}, 1fr)`:void 0,gap:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0"};return i==="table"?(0,Dt.jsx)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--sc-font-size-sm, 0.8rem)"},children:(0,Dt.jsx)("tbody",{children:s.map((o,l)=>(0,Dt.jsxs)("tr",{style:{borderBottom:l<s.length-1?"1px solid var(--sc-color-border-subtle, rgba(255, 255, 255, 0.06))":void 0},children:[(0,Dt.jsxs)("td",{style:{padding:"var(--sc-spacing-sm, 0.5rem) 0",color:"var(--sc-color-text-secondary, #a1a1a6)",display:"flex",alignItems:"center",gap:"var(--sc-spacing-sm, 0.5rem)"},children:[o.icon&&(0,Dt.jsx)("span",{children:o.icon}),o.label]}),(0,Dt.jsx)("td",{style:{padding:"var(--sc-spacing-sm, 0.5rem) 0",textAlign:"right",fontWeight:"var(--sc-font-weight-semibold, 600)",color:o.highlight?n:"var(--sc-color-text, #f5f5f7)"},children:o.value})]},l))})}):(0,Dt.jsx)("div",{style:a,children:s.map((o,l)=>(0,Dt.jsx)(t2,{item:o,accentColor:n,layout:i},l))})}var pu=J(bt(),1),de=J(xe(),1);function n2({value:t,maxValue:e,onChange:n,color:i}){let[r,s]=(0,pu.useState)(null);return(0,de.jsx)("div",{style:{display:"flex",gap:"4px"},children:Array.from({length:e},(a,o)=>{let l=o+1,c=(r??t??0)>=l;return(0,de.jsx)("button",{onClick:()=>n(l),onMouseEnter:()=>s(l),onMouseLeave:()=>s(null),style:{width:"28px",height:"28px",padding:0,border:"none",background:"none",cursor:"pointer",color:c?i:"var(--sc-color-text-muted, #8e8e93)",transition:"color 0.15s ease, transform 0.1s ease",transform:r===l?"scale(1.15)":"scale(1)"},"aria-label":`Rate ${l} out of ${e}`,children:(0,de.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:c?"currentColor":"none",children:(0,de.jsx)("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})},o)})})}function i2({value:t,onChange:e,color:n}){let i=r=>({width:"48px",height:"48px",padding:"8px",border:"none",borderRadius:"var(--sc-border-radius-md, 10px)",background:r?n:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",cursor:"pointer",color:r?"white":"var(--sc-color-text-muted, #8e8e93)",transition:"all 0.15s ease"});return(0,de.jsxs)("div",{style:{display:"flex",gap:"12px"},children:[(0,de.jsx)("button",{onClick:()=>e(1),style:i(t===1),"aria-label":"Thumbs up",children:(0,de.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:(0,de.jsx)("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3H14zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:t===1?"currentColor":"none"})})}),(0,de.jsx)("button",{onClick:()=>e(0),style:i(t===0),"aria-label":"Thumbs down",children:(0,de.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",style:{transform:"rotate(180deg)"},children:(0,de.jsx)("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3H14zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:t===0?"currentColor":"none"})})})]})}function r2({value:t,maxValue:e,onChange:n,color:i}){return(0,de.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)"},children:[(0,de.jsx)("div",{style:{display:"flex",gap:"4px",justifyContent:"center"},children:Array.from({length:e+1},(r,s)=>{let a=t===s;return(0,de.jsx)("button",{onClick:()=>n(s),style:{width:"28px",height:"32px",padding:0,border:a?`2px solid ${i}`:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.12))",borderRadius:"var(--sc-border-radius-sm, 6px)",background:a?i:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",cursor:"pointer",color:a?"white":"var(--sc-color-text, #f5f5f7)",fontSize:"var(--sc-font-size-sm, 0.8rem)",fontWeight:"var(--sc-font-weight-medium, 500)",transition:"all 0.15s ease"},"aria-label":`Rate ${s}`,children:s},s)})}),(0,de.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"0 2px"},children:[(0,de.jsx)("span",{style:{fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)"},children:"Not likely"}),(0,de.jsx)("span",{style:{fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)"},children:"Very likely"})]})]})}function s2({value:t,onChange:e,color:n}){return(0,de.jsx)("div",{style:{display:"flex",gap:"8px",justifyContent:"center"},children:["\u{1F622}","\u{1F615}","\u{1F610}","\u{1F642}","\u{1F604}"].map((r,s)=>{let a=t===s;return(0,de.jsx)("button",{onClick:()=>e(s),style:{width:"44px",height:"44px",padding:0,border:a?`2px solid ${n}`:"1px solid transparent",borderRadius:"var(--sc-border-radius-md, 10px)",background:a?"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))":"transparent",cursor:"pointer",fontSize:"1.75rem",transition:"all 0.15s ease",transform:a?"scale(1.1)":"scale(1)"},"aria-label":`Rate ${s+1} out of 5`,children:r},s)})})}function Vh({content:t,onSubmit:e,accentColor:n}){let[i,r]=(0,pu.useState)(null),[s,a]=(0,pu.useState)(!1),o=n||"var(--sc-color-primary, #6366f1)",l=t.maxValue??(t.variant==="nps"?10:5),c=p=>{r(p)},u=()=>{i!==null&&(a(!0),e?.(i))},f={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-md, 0.75rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0",alignItems:"center"},h={fontSize:"var(--sc-font-size-md, 0.9rem)",color:"var(--sc-color-text, #f5f5f7)",textAlign:"center",margin:0};return s?(0,de.jsxs)("div",{style:{...f,padding:"var(--sc-spacing-lg, 1rem)"},children:[(0,de.jsx)("span",{style:{fontSize:"2rem"},children:"\u2713"}),(0,de.jsx)("p",{style:{...h,color:"var(--sc-color-success, #34c759)"},children:"Thanks for your feedback!"})]}):(0,de.jsxs)("div",{style:f,children:[t.question&&(0,de.jsx)("p",{style:h,children:t.question}),t.variant==="stars"&&(0,de.jsx)(n2,{value:i,maxValue:l,onChange:c,color:o}),t.variant==="thumbs"&&(0,de.jsx)(i2,{value:i,onChange:c,color:o}),t.variant==="nps"&&(0,de.jsx)(r2,{value:i,maxValue:l,onChange:c,color:o}),t.variant==="emoji"&&(0,de.jsx)(s2,{value:i,onChange:c,color:o}),i!==null&&t.submitActionId&&(0,de.jsx)("button",{onClick:u,style:{marginTop:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) var(--sc-spacing-lg, 1rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",border:"none",background:o,color:"white",fontSize:"var(--sc-font-size-sm, 0.8rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",cursor:"pointer",transition:"opacity 0.15s ease"},children:"Submit"})]})}var ft=J(xe(),1);function Ih({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",i=t.items.filter(b=>b.completed).length,r=t.items.length,s={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)"},a={display:"flex",alignItems:"center",gap:"var(--sc-spacing-sm, 0.5rem)",marginBottom:"var(--sc-spacing-sm, 0.5rem)",fontSize:"var(--sc-font-size-xs, 0.75rem)",color:"var(--sc-color-text-muted, #8e8e93)"},o={flex:1,height:"4px",background:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",borderRadius:"2px",overflow:"hidden"},l={height:"100%",width:`${r>0?i/r*100:0}%`,background:n,borderRadius:"2px",transition:"width 0.3s ease"},c=b=>({display:"flex",alignItems:"flex-start",gap:"var(--sc-spacing-md, 0.75rem)",padding:"var(--sc-spacing-md, 0.75rem)",background:"var(--sc-color-surface, rgba(58, 58, 60, 0.5))",borderRadius:"var(--sc-border-radius-md, 10px)",border:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.08))",opacity:b?.6:1,transition:"all 0.15s ease"}),u=b=>({width:"20px",height:"20px",borderRadius:"50%",border:b?"none":"2px solid var(--sc-color-border, rgba(255, 255, 255, 0.2))",background:b?"#34c759":"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:"2px"}),f={flex:1,minWidth:0},h=b=>({fontSize:"var(--sc-font-size-sm, 0.85rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:"var(--sc-color-text, #f5f5f7)",margin:0,textDecoration:b?"line-through":"none"}),p={fontSize:"var(--sc-font-size-xs, 0.75rem)",color:"var(--sc-color-text-muted, #8e8e93)",margin:"var(--sc-spacing-xs, 0.25rem) 0 0",lineHeight:1.4},y={display:"inline-flex",alignItems:"center",gap:"var(--sc-spacing-xs, 0.25rem)",padding:"var(--sc-spacing-xs, 0.25rem) var(--sc-spacing-sm, 0.5rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",border:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.15))",background:"transparent",color:"var(--sc-color-text, #f5f5f7)",fontSize:"var(--sc-font-size-xs, 0.75rem)",fontWeight:"var(--sc-font-weight-medium, 500)",cursor:"pointer",textDecoration:"none",transition:"all 0.15s ease",flexShrink:0},_=b=>{b&&typeof window<"u"&&(window.location.href=b)};return(0,ft.jsxs)("div",{style:s,children:[t.showProgress!==!1&&r>0&&(0,ft.jsxs)("div",{style:a,children:[(0,ft.jsxs)("span",{children:[i," of ",r]}),(0,ft.jsx)("div",{style:o,children:(0,ft.jsx)("div",{style:l})})]}),t.items.map(b=>(0,ft.jsxs)("div",{style:c(b.completed??!1),children:[(0,ft.jsx)("div",{style:u(b.completed??!1),children:b.completed&&(0,ft.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:(0,ft.jsx)("path",{d:"M20 6L9 17l-5-5",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,ft.jsxs)("div",{style:f,children:[(0,ft.jsx)("p",{style:h(b.completed??!1),children:b.title}),b.description&&(0,ft.jsx)("p",{style:p,children:b.description})]}),b.href&&!b.completed&&(0,ft.jsxs)("button",{style:y,onClick:d=>{d.stopPropagation(),_(b.href)},onMouseEnter:d=>{d.currentTarget.style.background="var(--sc-color-surface, rgba(58, 58, 60, 0.8))"},onMouseLeave:d=>{d.currentTarget.style.background="transparent"},children:[b.linkLabel||"Go",(0,ft.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:(0,ft.jsx)("path",{d:"M5 12h14M12 5l7 7-7 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]},b.id))]})}var ca=J(xe(),1);function a2(t){return["alert","success","warning","info","error"].includes(t.type)}function o2(t){return t.type==="stats"}function l2(t){return t.type==="comparison"}function c2(t){return t.type==="rating"}function u2(t){return t.type==="checklist"}function Bb(t,e={}){return a2(t)?(0,ca.jsx)(Hh,{content:t,accentColor:e.accentColor,onDismiss:e.onDismiss}):o2(t)?(0,ca.jsx)(Uh,{content:t,accentColor:e.accentColor}):l2(t)?(0,ca.jsx)($h,{content:t,accentColor:e.accentColor}):c2(t)?(0,ca.jsx)(Vh,{content:t,accentColor:e.accentColor,onSubmit:e.onRatingSubmit}):u2(t)?(0,ca.jsx)(Ih,{content:t,accentColor:e.accentColor}):null}function Hb(t){return["alert","success","warning","info","error","stats","comparison","chart","table","form","rating","progress","survey","checklist","video","gallery","code"].includes(t)}var Lt=J(bt(),1),Ub=J(xe(),1),Fh=(0,Lt.createContext)({runtime:null,context:null});function jh({runtime:t,children:e}){let[n,i]=(0,Lt.useState)(t?t.context.get():null);(0,Lt.useEffect)(()=>t?(i(t.context.get()),t.context.subscribe(a=>{i(a)})):void 0,[t]);let r=(0,Lt.useMemo)(()=>({runtime:t,context:n}),[t,n]);return(0,Ub.jsx)(Fh.Provider,{value:r,children:e})}function fi(){let{runtime:t}=(0,Lt.useContext)(Fh);return t}function hu(){let{context:t}=(0,Lt.useContext)(Fh);return t}function qh(){return hu()?.page??null}function d2(){return hu()?.session??null}function f2(){return hu()?.viewport??null}function p2(t,e,n=[]){let i=fi();(0,Lt.useEffect)(()=>i?t?i.events.subscribe(t,e):i.events.subscribe(e):void 0,[i,...n])}function h2(){return fi()?.state??null}function g2(t,e){let n=fi(),[i,r]=(0,Lt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Lt.useEffect)(()=>{if(!n||!t){r({value:e,isFallback:!0,isLoading:!1});return}let s=!1;return n.evaluate(t).then(a=>{s||r({value:a.value,isFallback:a.isFallback,isLoading:!1})}),()=>{s=!0}},[n,t,e]),i}var Ue={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",SURFACE_MOUNTED:"surface.mounted",SURFACE_UNMOUNTED:"surface.unmounted"},ua="1.0.0";function An(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:ua}}function m2(t){return An(Ue.CANVAS_OPENED,{surface:t})}function v2(t){return An(Ue.CANVAS_CLOSED,{surface:t})}function y2(t,e){return An(Ue.TILE_VIEWED,{tileId:t,surface:e})}function _2(t,e){return An(Ue.TILE_EXPANDED,{tileId:t,surface:e})}function b2(t,e){return An(Ue.TILE_COLLAPSED,{tileId:t,surface:e})}function S2(t,e,n){return An(Ue.TILE_ACTION,{tileId:t,actionId:e,surface:n})}function x2(t,e){return An(Ue.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function E2(t,e){return An(Ue.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function w2(t,e,n){return An(Ue.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:n})}function C2(t,e,n){return An(Ue.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:n})}function A2(t,e){let n=t.startsWith("canvas.")?t:`canvas.${t}`;return An(n,e)}var In={canvasOpened:m2,canvasClosed:v2,tileViewed:y2,tileExpanded:_2,tileCollapsed:b2,tileAction:S2,overlayStarted:x2,overlayCompleted:E2,overlayDismissed:w2,overlayStepViewed:C2,custom:A2};var ce=J(xe(),1);function k2({config:t,telemetry:e,surface:n}){let[i,r]=(0,pi.useState)([{author:"Lumi",text:"Hi! Need clarity on a deduction?"}]),[s,a]=(0,pi.useState)(""),o=fi(),l=c=>{if(c.preventDefault(),!!s.trim()){if(r(u=>[...u,{author:"You",text:s.trim()}]),setTimeout(()=>{r(u=>[...u,{author:"Lumi",text:"I will route that to the experimentation server stub for now."}])},600),e?.trackAction("chatbot_message",t.id,n),o){let u=In.tileAction(t.id,"chatbot_message",n);o.events.publish(u.name,u.props,u.source)}a("")}};return(0,ce.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",height:"100%"},children:[(0,ce.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"0.75rem",background:"rgba(0, 0, 0, 0.2)",borderRadius:"8px",fontSize:"0.85rem"},children:i.map((c,u)=>(0,ce.jsxs)("p",{style:{margin:"0 0 0.5rem"},children:[(0,ce.jsxs)("span",{style:{fontWeight:600,color:"#94a3b8"},children:[c.author,":"]})," ",(0,ce.jsx)("span",{style:{color:"#e2e8f0"},children:c.text})]},`${c.author}-${u}`))}),(0,ce.jsxs)("form",{onSubmit:l,style:{display:"flex",gap:"0.5rem"},children:[(0,ce.jsx)("input",{style:{flex:1,padding:"0.5rem 0.75rem",borderRadius:"6px",border:"1px solid rgba(255, 255, 255, 0.1)",background:"rgba(0, 0, 0, 0.3)",color:"#f1f5f9",fontSize:"0.85rem",outline:"none"},value:s,onChange:c=>a(c.target.value),placeholder:"Ask anything..."}),(0,ce.jsx)("button",{style:{padding:"0.5rem 0.75rem",borderRadius:"6px",border:"none",background:"#6366f1",color:"white",fontWeight:600,fontSize:"0.8rem",cursor:"pointer"},type:"submit",children:"Send"})]})]})}function T2({renderer:t,config:e,surface:n,telemetry:i,isExpanded:r}){let s=(0,pi.useRef)(null);return(0,pi.useEffect)(()=>{if(!s.current)return;let a=t.mount(s.current,{config:e,surface:n,telemetry:i,isExpanded:r});return()=>{a&&a()}},[t,e,n,i,r]),(0,ce.jsx)("div",{ref:s,style:{width:"100%",height:"100%"}})}function Xo({config:t,surface:e,telemetry:n,style:i,customRenderers:r,isExpanded:s=!1,onToggleExpand:a}){let{title:o,subtitle:l,content:c,style:u}=t,f=fi(),h=(0,pi.useCallback)(S=>{if(n?.trackAction(S,t.id,e),f){let w=In.tileAction(t.id,S,e);f.events.publish(w.name,w.props,w.source)}},[n,f,t.id,e]),p=u?.accentColor??"#6366f1",y="72px",_={display:"flex",flexDirection:"column",borderRadius:"14px",background:u?.background??"rgba(28, 28, 30, 0.95)",border:"1px solid rgba(255, 255, 255, 0.08)",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.3)",color:u?.textColor??"#f5f5f7",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif",overflow:"hidden",cursor:a?"pointer":"default",transition:"all 0.25s ease",...i},b={display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.875rem 1rem",minHeight:y},d={width:"40px",height:"40px",borderRadius:"10px",background:`linear-gradient(135deg, ${p} 0%, ${p}cc 100%)`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.25rem",flexShrink:0,boxShadow:`0 2px 8px ${p}40`},g=()=>{switch(c.type){case"chatbot":return"\u{1F4AC}";case"metric":return"\u{1F4CA}";case"embed":return"\u{1F517}";case"custom":return"\u2699\uFE0F";case"checklist":return"\u{1F4CB}";default:return"\u{1F4C4}"}},m=()=>{switch(c.type){case"metric":return`${c.metricValue}${c.metricUnit?` ${c.metricUnit}`:""}`;case"text":return c.headline||c.body?.slice(0,50)||"";case"chatbot":return"Tap to chat";case"embed":return"Tap to view";case"custom":return"Tap to expand";case"checklist":{let S=c.items||[];return`${S.filter(E=>E.completed).length} of ${S.length} complete`}default:return""}},v=()=>{if(Hb(c.type)){let S=Bb(c,{accentColor:p,onDismiss:()=>{h("block_dismissed")},onRatingSubmit:w=>{h("rating_submitted")}});if(S)return S}switch(c.type){case"chatbot":return(0,ce.jsx)("div",{style:{height:"200px"},children:(0,ce.jsx)(k2,{config:t,surface:e,telemetry:n})});case"metric":return(0,ce.jsxs)("div",{style:{textAlign:"center",padding:"0.5rem 0"},children:[(0,ce.jsxs)("p",{style:{fontSize:"3rem",fontWeight:700,color:p,margin:0,letterSpacing:"-0.02em"},children:[c.metricValue,c.metricUnit&&(0,ce.jsx)("span",{style:{fontSize:"1.25rem",fontWeight:400,color:"#8e8e93",marginLeft:"0.5rem"},children:c.metricUnit})]}),c.headline&&(0,ce.jsx)("p",{style:{fontSize:"0.85rem",color:"#8e8e93",margin:"0.5rem 0 0"},children:c.headline})]});case"embed":return c.embedUrl?(0,ce.jsx)("iframe",{src:c.embedUrl,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",style:{width:"100%",height:"200px",borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.1)",background:"rgba(0, 0, 0, 0.2)"},title:c.headline??t.title}):null;case"custom":{let S=c.component||c.customRendererKey;return!S||!r||!r[S]?(0,ce.jsxs)("div",{style:{color:"#ff6b6b",fontSize:"0.85rem",padding:"0.5rem 0"},children:["Unknown component: ",S]}):(0,ce.jsx)(T2,{renderer:r[S],config:t,surface:e,telemetry:n,isExpanded:s})}case"text":default:{let S=c;return(0,ce.jsxs)("div",{style:{padding:"0.25rem 0"},children:[S.headline&&(0,ce.jsx)("p",{style:{fontSize:"1rem",fontWeight:600,color:"#f5f5f7",margin:"0 0 0.5rem"},children:S.headline}),S.body&&(0,ce.jsx)("p",{style:{fontSize:"0.9rem",color:"#8e8e93",margin:0,lineHeight:1.5},children:S.body})]})}}};return(0,ce.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:_,onClick:S=>{s&&S.target.closest("[data-expanded-content]")||a?.()},children:[(0,ce.jsxs)("div",{style:b,children:[(0,ce.jsx)("div",{style:d,children:g()}),(0,ce.jsxs)("div",{style:{flex:1,minWidth:0},children:[l&&(0,ce.jsx)("p",{style:{fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.05em",color:"#8e8e93",margin:0},children:l}),(0,ce.jsx)("h3",{style:{fontSize:"0.95rem",fontWeight:600,color:"#f5f5f7",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o}),!s&&(0,ce.jsx)("p",{style:{fontSize:"0.8rem",color:"#8e8e93",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m()})]}),(0,ce.jsx)("div",{style:{color:"#8e8e93",fontSize:"0.85rem",transform:s?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"},children:"\u25BC"})]}),s&&(0,ce.jsxs)("div",{"data-expanded-content":!0,style:{padding:"0 1rem 1rem",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},onClick:S=>S.stopPropagation(),children:[(0,ce.jsx)("div",{style:{paddingTop:"0.875rem"},children:v()}),"actions"in c&&c.actions&&c.actions.length>0&&(0,ce.jsx)("div",{style:{marginTop:"1rem",paddingTop:"0.75rem",borderTop:"1px solid rgba(255, 255, 255, 0.06)",display:"flex",gap:"0.5rem"},children:c.actions.map((S,w)=>(0,ce.jsx)("button",{onClick:E=>{if(E.stopPropagation(),S.href&&typeof window<"u"&&window.open(S.href,"_blank","noreferrer"),S.onClickId&&(h(S.onClickId),S.onClickId.startsWith("syntro:restart-tour:")||S.onClickId.startsWith("syntro:start-tour:"))){let C=S.onClickId.replace("syntro:restart-tour:","").replace("syntro:start-tour:","");try{localStorage.removeItem("syntro_active_tour"),localStorage.setItem("syntro_active_tour",JSON.stringify({tourId:C,currentStepId:"",startedAt:Date.now()})),console.log(`[SmartCanvas] Starting tour "${C}"...`),window.location.reload()}catch(R){console.warn("[SmartCanvas] Failed to start tour:",R)}}},style:{flex:1,padding:"0.625rem 1rem",borderRadius:"8px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",border:"none",background:w===0?p:"rgba(255, 255, 255, 0.1)",color:"#fff",transition:"opacity 0.15s ease"},onMouseEnter:E=>{E.currentTarget.style.opacity="0.85"},onMouseLeave:E=>{E.currentTarget.style.opacity="1"},children:S.label},S.label))})]})]})}var hi=J(bt(),1),Ph=J(mu(),1);var Ae=J(xe(),1),jb="syntro-launcher-styles";function N2(){if(typeof document>"u"||document.getElementById(jb))return;let t=document.createElement("style");t.id=jb,t.textContent=`
11
+ `)).length,i=0;i<r;i++){var s=t.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),qn(a)||(n>e&&(o+=t.substring(e,n)),o+=a,e=n=i+1)}return n>e&&(o+=t.substring(e,t.length)),o},uE=!!_d||!!yd,Pv="text/plain",El=function(t,e,n){var r;n===void 0&&(n=!0);var[i,o]=t.split("?"),s=F({},e),a=(r=o?.split("&").map((c=>{var u,[f,h]=c.split("="),g=n&&(u=s[f])!==null&&u!==void 0?u:h;return delete s[f],f+"="+g})))!==null&&r!==void 0?r:[],l=A1(s);return l&&a.push(l),i+"?"+a.join("&")},Rs=(t,e)=>JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e),pd=t=>{var{data:e,compression:n}=t;if(e){if(n===Wn.GZipJS){var r=lE((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var f=new jt(l.length+(l.length>>>1)),h=0,g=function(d){f[h++]=d},v=0;v<u;++v){if(h+5>f.length){var _=new jt(h+8+(u-v<<1));_.set(f),f=_}var x=l.charCodeAt(v);x<128||c?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(++v))>>>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 jy(f,0,h)})(Rs(e)),{mtime:0}),i=new Blob([r],{type:Pv});return{contentType:Pv,body:i,estimatedSize:i.size}}if(n===Wn.Base64){var o=(function(l){var c,u,f,h,g,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,x=0,d="",p=[];if(!l)return l;l=cE(l);do c=(g=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,u=g>>12&63,f=g>>6&63,h=63&g,p[x++]=v.charAt(c)+v.charAt(u)+v.charAt(f)+v.charAt(h);while(_<l.length);switch(d=p.join(""),l.length%3){case 1:d=d.slice(0,-2)+"==";break;case 2:d=d.slice(0,-1)+"="}return d})(Rs(e)),s=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Rs(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Rs(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},ll=[];yd&&ll.push({transport:"fetch",method:t=>{var e,n,{contentType:r,body:i,estimatedSize:o}=(e=pd(t))!==null&&e!==void 0?e:{},s=new Headers;pe(t.headers,(function(u,f){s.append(f,u)})),r&&s.append("Content-Type",r);var a=t.url,l=null;if(Ym){var c=new Ym;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),t.timeout)}}yd(a,F({method:t?.method||"GET",headers:s,keepalive:t.method==="POST"&&(o||0)<52428.8,body:i,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then((u=>u.text().then((f=>{var h={statusCode:u.status,text:f};if(u.status===200)try{h.json=JSON.parse(f)}catch(g){L.error(g)}t.callback==null||t.callback(h)})))).catch((u=>{L.error(u),t.callback==null||t.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),_d&&ll.push({transport:"XHR",method:t=>{var e,n=new _d;n.open(t.method||"GET",t.url,!0);var{contentType:r,body:i}=(e=pd(t))!==null&&e!==void 0?e:{};pe(t.headers,(function(o,s){n.setRequestHeader(s,o)})),r&&n.setRequestHeader("Content-Type",r),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(i)}}),It!=null&&It.sendBeacon&&ll.push({transport:"sendBeacon",method:t=>{var e=El(t.url,{beacon:"1"});try{var n,{contentType:r,body:i}=(n=pd(t))!==null&&n!==void 0?n:{},o=typeof i=="string"?new Blob([i],{type:r}):i;It.sendBeacon(e,o)}catch{}}});var Cl=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 Iv(t,e,n){return Rs({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var Uy={exact:(t,e)=>e.some((n=>t.some((r=>n===r)))),is_not:(t,e)=>e.every((n=>t.every((r=>n!==r)))),regex:(t,e)=>e.some((n=>t.some((r=>Cl(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!Cl(n,r))))),icontains:(t,e)=>e.map(sl).some((n=>t.map(sl).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(sl).every((n=>t.map(sl).every((r=>!n.includes(r)))))},sl=t=>t.toLowerCase();function Wy(t,e){return!t||Object.entries(t).every((n=>{var[r,i]=n,o=e?.[r];if(O(o)||qn(o))return!1;var s=[String(o)],a=Uy[i.operator];return!!a&&a(i.values,s)}))}var hd=He("[Error tracking]"),uf=class{constructor(e){var n,r;this.Jt=[],this.Kt=new kd([new Cd,new Nd,new Rd,new Ad,new Id,new Pd,new Td,new Od],c1("web:javascript",o1,l1)),this._instance=e,this.Jt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(Md))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,r,i,o=(n=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],s=(i=e.errorTracking)==null?void 0:i.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[Md]:this.Jt,[av]:s})}get Yt(){var e,n=!!this._instance.get_property(av),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??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 hd.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void hd.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))return void hd.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(((r,i)=>{var{type:o,value:s}=i;return ze(o)&&o.length>0&&r.$exception_types.push(o),ze(s)&&s.length>0&&r.$exception_values.push(s),r}),{$exception_types:[],$exception_values:[]});return this.Jt.some((r=>{var i=r.values.map((o=>{var s,a=Uy[o.operator],l=fe(o.value)?o.value:[o.value],c=(s=n[o.key])!==null&&s!==void 0?s:[];return l.length>0&&a(l,c)}));return r.type==="OR"?i.some(Boolean):i.every(Boolean)}))}Zt(e){return e.flatMap((n=>{var r,i;return(r=(i=n.stacktrace)==null?void 0:i.frames)!==null&&r!==void 0?r:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var n,r,i,o,s=(n=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],a=s[s.length-1];return(i=a==null||(o=a.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&i!==void 0&&i}return!1}Xt(e){return!de(e)&&fe(e)}},nn=He("[FeatureFlags]"),_s=He("[FeatureFlags]",{debugEnabled:!0}),gd="$active_feature_flags",ro="$override_feature_flags",Ov="$feature_flag_payloads",ws="$override_feature_flag_payloads",Nv="$feature_flag_request_id",Lv="$feature_flag_evaluated_at",Mv=t=>{var e={};for(var[n,r]of al(t||{}))r&&(e[n]=r);return e},dE=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((n=>{var r;return[n,(r=e[n].variant)!==null&&r!==void 0?r:e[n].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((n=>e[n].enabled)).filter((n=>{var r;return(r=e[n].metadata)==null?void 0:r.payload})).map((n=>{var r;return[n,(r=e[n].metadata)==null?void 0:r.payload]})))):nn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},fE=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),df=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 r=n&&typeof n=="string"&&n.trim().length>0;return r||nn.error("Invalid evaluation environment found:",n,"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(Fd),n=this._instance.get_property(ro),r=this._instance.get_property(ws);if(!r&&!n)return e||{};var i=Me({},e||{}),o=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var s of o){var a,l,c=i[s],u=n?.[s],f=O(u)?(a=c?.enabled)!==null&&a!==void 0&&a:!!u,h=O(u)?c.variant:typeof u=="string"?u:void 0,g=r?.[s],v=F({},c,{enabled:f,variant:f?h??c?.variant:void 0});f!==c?.enabled&&(v.original_enabled=c?.enabled),h!==c?.variant&&(v.original_variant=c?.variant),g&&(v.metadata=F({},c?.metadata,{payload:g,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),i[s]=v}return this.ii||(nn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:i}),this.ii=!0),i}getFlagVariants(){var e=this._instance.get_property(ao),n=this._instance.get_property(ro);if(!n)return e||{};for(var r=Me({},e),i=Object.keys(n),o=0;o<i.length;o++)r[i[o]]=n[i[o]];return this.ii||(nn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:r}),this.ii=!0),r}getFlagPayloads(){var e=this._instance.get_property(Ov),n=this._instance.get_property(ws);if(!n)return e||{};for(var r=Me({},e||{}),i=Object.keys(n),o=0;o<i.length;o++)r[i[o]]=n[i[o]];return this.ii||(nn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,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 n;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:F({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(Cs)||{}),group_properties:this._instance.get_property(fi)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.ui()&&(r.evaluation_environments=this.li());var i=this._instance.config.__preview_remote_config,o=i?"/flags/?v=2":"/flags/?v=2&config=true",s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("flags",o+s);i&&(r.timezone=By()),this.ri=!0,this._instance.ci({method:"POST",url:a,data:r,compression:this._instance.config.disable_compression?void 0:Wn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,f=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),f=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((u=l.json)!==null&&u!==void 0?u:{})),!r.disable_flags||this.ni)if(this.ai=!f,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(fE.FeatureFlags))nn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var h;r.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},f),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],i=""+r,o=this._instance.get_property(Nv)||void 0,s=this._instance.get_property(Lv)||void 0,a=this._instance.get_property(pl)||{};if((n.send_event||!("send_event"in n))&&(!(e in a)||!a[e].includes(i))){var l,c,u,f,h,g,v,_,x;fe(a[e])?a[e].push(i):a[e]=[i],(l=this._instance.persistence)==null||l.register({[pl]:a});var d=this.getFeatureFlagDetails(e),p={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:s,$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};O(d==null||(f=d.metadata)==null?void 0:f.version)||(p.$feature_flag_version=d.metadata.version);var m,y=(h=d==null||(g=d.reason)==null?void 0:g.description)!==null&&h!==void 0?h:d==null||(v=d.reason)==null?void 0:v.code;y&&(p.$feature_flag_reason=y),d!=null&&(_=d.metadata)!=null&&_.id&&(p.$feature_flag_id=d.metadata.id),O(d?.original_variant)&&O(d?.original_enabled)||(p.$feature_flag_original_response=O(d.original_variant)?d.original_enabled:d.original_variant),d!=null&&(x=d.metadata)!=null&&x.original_payload&&(p.$feature_flag_original_payload=d==null||(m=d.metadata)==null?void 0:m.original_payload),this._instance.capture("$feature_flag_called",p)}return r}nn.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,n){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.ui()&&(i.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:Wn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var s,a=(s=o.json)==null?void 0:s.featureFlagPayloads;n(a?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,n);return O(r)?void 0:!!r}nn.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==e))}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ei=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(s,a,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var f=dE(s),h=f.flags,g=f.featureFlags,v=f.featureFlagPayloads;if(g){var _=s.requestId,x=s.evaluatedAt;if(fe(g)){nn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(g)for(var p=0;p<g.length;p++)d[g[p]]=!0;a&&a.register({[gd]:g,[ao]:d})}else{var m=g,y=v,w=h;s.errorsWhileComputingFlags&&(m=F({},l,m),y=F({},c,y),w=F({},u,w)),a&&a.register(F({[gd]:Object.keys(Mv(m)),[ao]:m||{},[Ov]:y||{},[Fd]:w||{}},_?{[Nv]:_}:{},x?{[Lv]:x}:{}))}}})(e,this._instance.persistence,r,i,o),this.pi(n)}}override(e,n){n===void 0&&(n=!1),nn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return nn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(ro),this._instance.persistence.unregister(ws),this.pi(),_s.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.ii=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(ro),_s.info("Flag overrides cleared");else if(r.flags){if(fe(r.flags)){for(var i={},o=0;o<r.flags.length;o++)i[r.flags[o]]=!0;this._instance.persistence.register({[ro]:i})}else this._instance.persistence.register({[ro]:r.flags});_s.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(ws),_s.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[ws]:r.payloads}),_s.info("Payload overrides set",{payloads:r.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:n,flagVariants:r}=this.gi();e(n,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,r){var i,o=(this._instance.get_property(Es)||[]).find((c=>c.flagKey===e)),s={["$feature_enrollment/"+e]:n},a={$feature_flag:e,$feature_enrollment:n,$set:s};o&&(a.$early_access_feature_name=o.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,!1);var l=F({},this.getFlagVariants(),{[e]:n});(i=this._instance.persistence)==null||i.register({[gd]:Object.keys(Mv(l)),[ao]:l}),this.pi()}getEarlyAccessFeatures(e,n,r){n===void 0&&(n=!1);var i=this._instance.get_property(Es),o=r?"&"+r.map((s=>"stage="+s)).join("&"):"";if(i&&!n)return e(i);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:s=>{var a,l;if(s.json){var c=s.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.unregister(Es),(l=this._instance.persistence)==null||l.register({[Es]:c}),e(c)}}})}gi(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter((r=>n[r])),flagVariants:Object.keys(n).filter((r=>n[r])).reduce(((r,i)=>(r[i]=n[i],r)),{})}}pi(e){var{flags:n,flagVariants:r}=this.gi();this.featureFlagEventHandlers.forEach((i=>i(n,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(Cs)||{};this._instance.register({[Cs]:F({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Cs)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(fi)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((i=>{r[i]=F({},r[i],e[i]),delete e[i]})),this._instance.register({[fi]:F({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(fi)||{};this._instance.register({[fi]:F({},n,{[e]:{}})})}else this._instance.unregister(fi)}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}},pE=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Is=class{constructor(e,n){this.F=e,this.props={},this.mi=!1,this.yi=(r=>{var i="";return r.token&&(i=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+i+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&L.info("Persistence loaded",e.persistence,F({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.wi}bi(e){pE.indexOf(e.persistence.toLowerCase())===-1&&(L.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&ke.H()?ke:n==="localstorage+cookie"&&nl.H()?nl:n==="sessionstorage"&&Ze.H()?Ze:n==="memory"?M1:n==="cookie"?_n:nl.H()?nl:_n}properties(){var e={};return pe(this.props,(function(n,r){if(r===ao&&We(n))for(var i=Object.keys(n),o=0;o<i.length;o++)e["$feature/"+i[o]]=n[i[o]];else a=r,l=!1,(qn(s=v1)?l:Zm&&s.indexOf===Zm?s.indexOf(a)!=-1:(pe(s,(function(c){if(l||(l=c===a))return dl})),l))||(e[r]=n);var s,a,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Me({},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,r){if(We(e)){O(n)&&(n="None"),this.xi=O(r)?this.$i:r;var i=!1;if(pe(e,((o,s)=>{this.props.hasOwnProperty(s)&&this.props[s]!==n||(this.props[s]=o,i=!0)})),i)return this.save(),!0}return!1}register(e,n){if(We(e)){this.xi=O(n)?this.$i:n;var r=!1;if(pe(e,((i,o)=>{e.hasOwnProperty(o)&&this.props[o]!==i&&(this.props[o]=i,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=Ny(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);so(Tf(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=N?.referrer)?My(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Fy(),$referring_domain:N!=null&&N.referrer&&((e=yl(N.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Vd]||this.props[zd]||this.register_once({[hl]:$y(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};pe([zd,Vd],(s=>{var a=this.props[s];a&&pe(a,(function(l,c){e["$initial_"+wd(c)]=l}))}));var n,r,i=this.props[hl];if(i){var o=(n=Dy(i),r={},pe(n,(function(s,a){r["$initial_"+wd(a)]=s})),r);Me(e,o)}return e}safe_merge(e){return pe(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,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!==n.persistence){var i=this.bi(e),o=this.props;this.clear(),this.Y=i,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 r=this.props[ks]||{};r[e]=n,this.props[ks]=r,this.save()}remove_event_timer(e){var n=(this.props[ks]||{})[e];return O(n)||(delete this.props[ks][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}},xs=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),SO=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),bO=(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})({}),kO=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),md=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),EO=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),CO=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),AO=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),cl=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),Fv=(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})({}),qy=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),Ds=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((r=>r!==n))}}emit(e,n){for(var r of this.ki[e]||[])r(n);for(var i of this.ki["*"]||[])i(e,n)}};function io(t,e,n){if(de(t))return!1;switch(n){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 ff=class{constructor(e){this.Pi=new Ds,this.Ti=(n,r)=>this.Ri(n,r)&&this.Ii(n,r)&&this.Fi(n,r)&&this.Ci(n,r),this.Ri=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!O((e=this._instance)==null?void 0:e.Ai)){var n;(n=this._instance)==null||n.Ai(((r,i)=>{this.on(r,i)}))}}register(e){var n,r;if(!O((n=this._instance)==null?void 0:n.Ai)&&(e.forEach((s=>{var a,l;(a=this.Oi)==null||a.add(s),(l=s.steps)==null||l.forEach((c=>{var u;(u=this.Mi)==null||u.add(c?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var i,o=new Set;e.forEach((s=>{var a;(a=s.steps)==null||a.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(i=this._instance)==null||i.autocapture.setElementSelectors(o)}}on(e,n){var r;n!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(n?.event))&&this.Oi&&((r=this.Oi)==null?void 0:r.size)>0&&this.Oi.forEach((i=>{this.Di(n,i)&&this.Pi.emit("actionCaptured",i.name)}))}ji(e){this.onAction("actionCaptured",(n=>e(n)))}Di(e,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.Ti(e,r))return!0;return!1}onAction(e,n){return this.Pi.on(e,n)}Ii(e,n){if(n!=null&&n.url){var r,i=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!i||typeof i!="string"||!io(i,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 r;if(n==null||!n.href)return!0;var i=this.zi(e);if(i.length>0)return i.some((a=>io(a.href,n.href,n.href_matching||"exact")));var o,s=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!s&&io((o=s.match(/(?::|")href="(.*?)"/))?o[1]:"",n.href,n.href_matching||"exact")}Ni(e,n){var r;if(n==null||!n.text)return!0;var i=this.zi(e);if(i.length>0)return i.some((c=>io(c.text,n.text,n.text_matching||"exact")||io(c.$el_text,n.text,n.text_matching||"exact")));var o,s,a,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(o=(function(c){for(var u,f=[],h=/(?::|")text="(.*?)"/g;!de(u=h.exec(c));)f.includes(u[1])||f.push(u[1]);return f})(l),s=n.text,a=n.text_matching||"exact",o.some((c=>io(c,s,a))))}Ui(e,n){var r,i;if(n==null||!n.selector)return!0;var o=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(o!=null&&o.includes(n.selector))return!0;var s=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";if(n.selector_regex&&s)try{return new RegExp(n.selector_regex).test(s)}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||Wy(n.properties.reduce(((r,i)=>{var o=fe(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return r[i.key]={values:o,operator:i.operator||"exact"},r}),{}),e?.properties)}},ce=He("[Surveys]"),pf="seenSurvey_",hE=(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},$v=t=>{var e=""+pf+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+pf+t.id+"_"+t.current_iteration),e},gE=[md.Popover,md.Widget,md.API],mE={ignoreConditions:!1,ignoreDelay:!1,displayType:qy.Popover},hf=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,n){return!!e&&Wy(e.propertyFilters,n?.properties)}Gi(e,n){var r=new Map;return e.forEach((i=>{var o;(o=i.conditions)==null||(o=o[n])==null||(o=o.values)==null||o.forEach((s=>{if(s!=null&&s.name){var a=r.get(s.name)||[];a.push(i.id),r.set(s.name,a)}}))})),r}Vi(e,n,r){var i,o=(r===xs.Activation?this.Hi:this.Bi).get(e),s=[];return(i=this._instance)==null||i.getSurveys((a=>{s=a.filter((l=>o?.includes(l.id)))})),s.filter((a=>{var l,c=(l=a.conditions)==null||(l=l[r])==null||(l=l.values)==null?void 0:l.find((u=>u.name===e));return this.Wi(c,n)}))}register(e){var n;O((n=this._instance)==null?void 0:n.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var n=e.filter((r=>{var i,o;return((i=r.conditions)==null?void 0:i.actions)&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));n.length!==0&&(this.Yi==null&&(this.Yi=new ff(this._instance),this.Yi.init(),this.Yi.ji((r=>{this.onAction(r)}))),n.forEach((r=>{var i,o,s,a,l;r.conditions&&(i=r.conditions)!=null&&i.actions&&(o=r.conditions)!=null&&(o=o.actions)!=null&&o.values&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0&&((a=this.Yi)==null||a.register(r.conditions.actions.values),(l=r.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(r.id),this.qi.set(c.name,u||[r.id])}})))})))}Ji(e){var n,r=e.filter((o=>{var s,a;return((s=o.conditions)==null?void 0:s.events)&&((a=o.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0})),i=e.filter((o=>{var s,a;return((s=o.conditions)==null?void 0:s.cancelEvents)&&((a=o.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0}));(r.length!==0||i.length!==0)&&((n=this._instance)==null||n.Ai(((o,s)=>{this.onEvent(o,s)})),this.Hi=this.Gi(e,xs.Activation),this.Bi=this.Gi(e,xs.Cancellation))}onEvent(e,n){var r,i=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[tl])||[];if(cl.SHOWN===e&&n&&i.length>0){var o;ce.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:i});var s=n==null||(o=n.properties)==null?void 0:o.$survey_id;if(s){var a=i.indexOf(s);a>=0&&(i.splice(a,1),this.Xi(i))}}else{if(this.Bi.has(e)){var l=this.Vi(e,n,xs.Cancellation);l.length>0&&(ce.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((u=>u.id))}),l.forEach((u=>{var f,h=i.indexOf(u.id);h>=0&&i.splice(h,1),(f=this._instance)==null||f.cancelPendingSurvey(u.id)})),this.Xi(i))}if(this.Hi.has(e)){ce.info("survey event name matched",{event:e,eventPayload:n,surveys:this.Hi.get(e)});var c=this.Vi(e,n,xs.Activation);this.Xi(i.concat(c.map((u=>u.id))||[]))}}}onAction(e){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[tl])||[];this.qi.has(e)&&this.Xi(r.concat(this.qi.get(e)||[]))}Xi(e){var n;ce.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[tl]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[tl];return n||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},gf=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(de(n))return ce.warn("Flags not loaded yet. Not loading surveys.");var r=fe(n);this.Zi=r?n.length>0:n,ce.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(pf)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((i=>localStorage.removeItem(i)))}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=G?.__PosthogExtensions__;if(e){if(!O(this.Zi)||this._instance.config.advanced_enable_surveys){var n=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var r=e.generateSurveys;if(r)return void this.re(r,n);var i=e.loadExternalDependency;if(!i)return void this.se("PostHog loadExternalDependency extension not found.");i(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 ce.error("PostHog Extensions not found.")}}re(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new hf(this._instance),ce.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,n){ce.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 ce.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property($d);if(r&&!n)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:i=>{var o;this.te=!1;var s=i.statusCode;if(s!==200||!i.json){var a="Surveys API could not be loaded, status: "+s;return ce.error(a),e([],{isLoaded:!1,error:a})}var l,c=i.json.surveys||[],u=c.filter((f=>(function(h){return!(!h.start_date||h.end_date)})(f)&&((function(h){var g;return!((g=h.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)})(f)||(function(h){var g;return!((g=h.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)})(f))));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(o=this._instance.persistence)==null||o.register({[$d]:c}),e(c,{isLoaded:!0})}})}catch(i){throw this.te=!1,i}}ne(e){for(var n of this.ee)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){ce.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!de(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);ce.warn("init was not called")}oe(e){var n=null;return this.getSurveys((r=>{var i;n=(i=r.find((o=>o.id===e)))!==null&&i!==void 0?i:null})),n}ae(e){if(de(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(de(this._surveyManager))return ce.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 de(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((i=>{var o,s=(o=i.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(s){var a=this.ae(s);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n){var r;if(de(this._surveyManager))ce.warn("init was not called");else{var i=typeof e=="string"?this.oe(e):e;if(i!=null&&i.id)if(gE.includes(i.type)){var o=N?.querySelector(n);if(o)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(ce.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var s,a;ce.info("Rendering survey "+i.id+" with delay of "+((s=i.appearance)==null?void 0:s.surveyPopupDelaySeconds)+" seconds"),(a=this._surveyManager)==null||a.renderSurvey(i,o),ce.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,o);ce.warn("Survey element not found")}else ce.warn("Surveys of type "+i.type+" cannot be rendered in the app");else ce.warn("Survey not found")}}displaySurvey(e,n){var r;if(de(this._surveyManager))ce.warn("init was not called");else{var i=this.oe(e);if(i){var o=i;if((r=i.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(o=F({},i,{appearance:F({},i.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var s=this.canRenderSurvey(i);if(!s.visible)return void ce.warn("Survey is not eligible to be displayed: ",s.disabledReason)}n.displayType!==qy.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,n.selector)}else ce.warn("Survey not found")}}cancelPendingSurvey(e){de(this._surveyManager)?ce.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},Dv=He("[RateLimiter]"),mf=class{constructor(e){var n,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=i=>{var o=i.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((s=>{Dv.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void Dv.warn('could not rate limit - continuing. Error: "'+s?.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(((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 n,r,i;e===void 0&&(e=!1);var o=new Date().getTime(),s=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Bd))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:o};s.tokens+=(o-s.last)/1e3*this.captureEventsPerSecond,s.last=o,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var a=s.tokens<1;return a||e||(s.tokens=Math.max(0,s.tokens-1)),!a||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=a,(i=this.instance.persistence)==null||i.set_property(Bd,s),{isRateLimited:a,remainingTokens:s.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}},di=He("[RemoteConfig]"),vf=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=G._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(di.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 di.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void di.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return di.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){di.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()):di.info("__preview_remote_config is disabled. Logging config instead",e):di.error("Failed to fetch remote config from PostHog.")}},yf=3e3,_f=class{constructor(e,n){this.he=!0,this.ve=[],this.de=vn(n?.flush_interval_ms||yf,250,5e3,L.createLogger("flush interval"),yf),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((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ce(F({},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 n=this._e(),r=function(){var o=n[i],s=new Date().getTime();o.data&&fe(o.data)&&pe(o.data,(a=>{a.offset=Math.abs(a.timestamp-s),delete a.timestamp})),e.ce(o)};for(var i in n)r()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return pe(this.ve,(n=>{var r,i=n,o=(i?i.batchKey:null)||i.url;O(e[o])&&(e[o]=F({},i,{data:[]})),(r=e[o].data)==null||r.push(i.data)})),this.ve=[],e}},vE=["retriesPerformedSoFar"],wf=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!O(C)&&"onLine"in C.navigator&&(this.be=C.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},De(C,"online",this.we),De(C,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=Uv(e,vE);wn(n)&&n>0&&(r.url=El(r.url,{retry_count:n})),this._instance.ci(F({},r,{callback:i=>{i.statusCode!==200&&(i.statusCode<400||i.statusCode>=500)&&(n??0)<10?this.Se(F({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(i)}}))}Se(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(s){var a=3e3*Math.pow(2,s),l=a/2,c=Math.min(18e5,a),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(n),i=Date.now()+r;this.ve.push({retryAt:i,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),L.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=[],r=this.ve.filter((o=>o.retryAt<e||(n.push(o),!1)));if(this.ve=n,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,O(C)||(this.we&&(C.removeEventListener("online",this.we),this.we=void 0),this.xe&&(C.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(F({},e,{transport:"sendBeacon"}))}catch(n){L.error(n)}this.ve=[]}},xf=class{constructor(e){this.ke=()=>{var n,r,i,o;this.Pe||(this.Pe={});var s=this.scrollElement(),a=this.scrollY(),l=s?Math.max(0,s.scrollHeight-s.clientHeight):0,c=a+(s?.clientHeight||0),u=s?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(a),this.Pe.maxScrollY=Math.max(a,(n=this.Pe.maxScrollY)!==null&&n!==void 0?n:0),this.Pe.maxScrollHeight=Math.max(l,(r=this.Pe.maxScrollHeight)!==null&&r!==void 0?r:0),this.Pe.lastContentY=c,this.Pe.maxContentY=Math.max(c,(i=this.Pe.maxContentY)!==null&&i!==void 0?i: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(){De(C,"scroll",this.ke,{capture:!0}),De(C,"scrollend",this.ke,{capture:!0}),De(C,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return C?.document.documentElement;var e=fe(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var r=C?.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return C&&(C.scrollY||C.pageYOffset||C.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return C&&(C.scrollX||C.pageXOffset||C.document.documentElement.scrollLeft)||0}},yE=t=>$y(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),Al=class{constructor(e,n,r,i){this.Te=o=>{var s=this.Re();if(!s||s.sessionId!==o){var a={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[Dd]:a})}},this._instance=e,this.Ce=n,this.Fe=r,this.Ie=i||yE,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[Dd]}getSetOnceProps(){var e,n=(e=this.Re())==null?void 0:e.props;return n?"r"in n?Dy(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 pe(Tf(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+wd(r)]=n})),e}},vd=He("[SessionId]"),Rl=class{on(e,n){return this.Me.on(e,n)}constructor(e,n,r){var i;if(this.Oe=[],this.Ae=void 0,this.Me=new Ds,this.De=(u,f)=>Math.abs(u-f)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.F=e.config,this.Fe=e.persistence,this.je=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ne=n||br,this.Ue=r||br;var o=this.F.persistence_name||this.F.token,s=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*vn(s,60,36e3,vd.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 a=Ze.W(this.He),l=Ze.W(this.Be);a&&!l?this.je=a:Ze.V(this.He),Ze.G(this.Be,!0)}if((i=this.F.bootstrap)!=null&&i.sessionID)try{var c=(u=>{var f=u.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),c)}catch(u){vd.error("Invalid sessionID in bootstrap",u)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return O(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&&Ze.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Ze.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Ze.W(this.He):null}We(e,n,r){e===this.Le&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Le=e,this.Fe.register({[fl]:[n,e,r]}))}Ke(){var e=this.Fe.props[fl];return fe(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&&C&&(C.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Ze.V(this.Be)},De(C,"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 r=n||new Date().getTime(),[i,o,s]=this.Ke(),a=this.Je(),l=wn(s)&&s>0&&Math.abs(r-s)>864e5,c=!1,u=!o,f=!u&&!e&&this.De(r,i);u||f||l?(o=this.Ne(),a=this.Ue(),vd.info("new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}}),s=r,c=!0):a||(a=this.Ue(),c=!0);var h=i===0||!e||l?r:i,g=s===0?new Date().getTime():s;return this.Ve(a),this.We(o,h,g),e||this.ze(),c&&this.Oe.forEach((v=>v(o,a,c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:a,sessionStartTimestamp:g,changeReason:c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:i}}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)}},_E=["$set_once","$set"],xr=He("[SiteApps]"),Sf=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 r=this.globalsForEvent(n);this.Xe.push(r),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=G._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,r,i,o,s,a,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(var[h,g]of Object.entries(f))c[h]={id:u[h],type:h,properties:g};var{$set_once:v,$set:_}=e;return{event:F({},Uv(e,_E),{properties:F({},e.properties,_?{$set:F({},(n=(r=e.properties)==null?void 0:r.$set)!==null&&n!==void 0?n:{},_)}:{},v?{$set_once:F({},(i=(o=e.properties)==null?void 0:o.$set_once)!==null&&i!==void 0?i:{},v)}:{}),elements_chain:(s=(a=e.properties)==null?void 0:a.$elements_chain)!==null&&s!==void 0?s:"",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],r=()=>{var a;!n.errored&&this.Xe.length&&(xr.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))&&((a=this.Ze)==null||a.call(this))},i=!1,o=a=>{n.errored=!a,n.loaded=!0,xr.info("Site app with id "+e.id+" "+(a?"loaded":"errored")),i&&r()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:a=>{o(a)}});s&&(n.processEvent=s),i=!0}catch(a){xr.error("Error while initializing PostHog app with config id "+e.id,a),o(!1)}if(i&&n.loaded)try{r()}catch(a){xr.error("Error while processing buffered events PostHog app with config id "+e.id,a),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 r of e)this.setupSiteApp(r)}ir(e){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(n)}catch(i){xr.error("Error while processing event "+e.event+" for site app "+r.id,i)}}}onRemoteConfig(e){var n,r,i,o=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(c=>this.ir(c)))):void xr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Ze)==null||r.call(this),(i=e.siteApps)!=null&&i.length)if(this.isEnabled){var s=function(c){var u;G["__$$ph_site_app_"+c]=o._instance,(u=G.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,l,(f=>{if(f)return xr.error("Error while initializing PostHog app with config id "+c,f)}))};for(var{id:a,url:l}of e.siteApps)s(a)}else xr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},Ky=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&Jm(n,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some((i=>Jm(i?.brand,e))))return!0}catch{}return!!t.webdriver},Ts=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),Bv="i.posthog.com",bf=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("."+Bv,".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]=Ts.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Ts.EU:this.er[this.apiHost]=Ts.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===Ts.CUSTOM)return this.apiHost+n;var r=Bv+n;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}},wE={icontains:(t,e)=>!!C&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!C&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!C&&Cl(e.href,t),not_regex:(t,e)=>!!C&&!Cl(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},kf=class t{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((i=>{t.rr("retrieved web experiments from the server"),n.sr=new Map,i.forEach((o=>{if(o.feature_flag_key){var s;n.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(s=n.sr)==null||s.set(o.feature_flag_key,o));var a=n._instance.getFeatureFlag(o.feature_flag_key);ze(a)&&o.variants[a]&&n.nr(o.name,a,o.variants[a].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)}}))}),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(de(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((n=>{var r;if(this.sr&&(r=this.sr)!=null&&r.has(n)){var i,o=this._instance.getFeatureFlag(n),s=(i=this.sr)==null?void 0:i.get(n);o&&s!=null&&s.variants[o]&&this.nr(s.name,o,s.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=_l(e?.search,"__experiment_id"),r=_l(e?.search,"__experiment_variant");n&&r&&(t.rr("previewing web experiments "+n+" && "+r),this.getWebExperiments((i=>{this.lr(parseInt(n),r,i)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!n)return e(i);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 s=o.json.experiments||[];return e(s)}})}lr(e,n,r){var i=r.filter((o=>o.id===e));i&&i.length>0&&(t.rr("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this.nr(i[0].name,n,i[0].variants[n].transforms))}static ar(e){return!de(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var n;if(de(e.conditions)||de((n=e.conditions)==null?void 0:n.url))return!0;var r,i,o,s=t.getWindowLocation();return!!s&&((r=e.conditions)==null||!r.url||wE[(i=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&i!==void 0?i:"icontains"](e.conditions.url,s))}static getWindowLocation(){return C?.location}static hr(e){var n;if(de(e.conditions)||de((n=e.conditions)==null?void 0:n.utm))return!0;var r=Ny();if(r.utm_source){var i,o,s,a,l,c,u,f,h=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==r.utm_campaign,g=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,v=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==r.utm_medium,_=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((f=e.conditions)==null||(f=f.utm)==null?void 0:f.utm_term)==r.utm_term;return h&&v&&_&&g}return!1}static rr(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];L.info("[WebExperiments] "+e,r)}nr(e,n,r){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach((i=>{if(i.selector){var o;t.rr("applying transform of variant "+n+" for experiment "+e+" ",i);var s=(o=document)==null?void 0:o.querySelectorAll(i.selector);s?.forEach((a=>{var l=a;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return It&&this._instance?Ky(It,this._instance.config.custom_blocked_useragents):void 0}},xE=He("[PostHog ExternalIntegrations]"),SE={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Ef=class{constructor(e){this._instance=e}it(e,n){var r;(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(i=>{if(i)return xE.error("failed to load script",i);n()}))}startIfEnabledOrStop(){var e=this,n=function(s){var a,l,c;!i||(a=G.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[s]||e.it(SE[s],(()=>{var u;(u=G.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[s])==null||u.start(e._instance)})),!i&&(l=G.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[s]&&((c=G.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[s])==null||c.stop())};for(var[r,i]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;n(r)}}},Cf="[SessionRecording]",Ss=He(Cf),Tl=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 Ss.error("started without valid sessionManager"),new Error(Cf+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Cf+' cannot be used with cookieless_mode="always"')}get cr(){var e,n=!((e=this._instance.get_property(od))==null||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return C&&n&&r&&!i}startIfEnabledOrStop(e){var n;if(!this.cr||(n=this.vr)==null||!n.isStarted){var r=!O(Object.assign)&&!O(Array.from);this.cr&&r?(this.gr(e),Ss.info("starting")):this.stopRecording()}}gr(e){var n,r,i;this.cr&&(G!=null&&(n=G.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(r=G.__PosthogExtensions__)!=null&&r.initSessionRecording?this._r(e):(i=G.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return Ss.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(ey)}br(e){if(this._instance.persistence){var n,r,i=this._instance.persistence,o=()=>{var s=e.sessionRecording===!1?void 0:e.sessionRecording,a=s?.sampleRate,l=de(a)?null:parseFloat(a);de(l)&&this.yr();var c=s?.minimumDurationMilliseconds;i.register({[od]:F({enabled:!!s},s,{networkPayloadCapture:F({capturePerformance:e.capturePerformance},s?.networkPayloadCapture),canvasRecording:{enabled:s?.recordCanvas,fps:s?.canvasFps,quality:s?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:O(c)?null:c,endpoint:s?.endpoint,triggerMatchType:s?.triggerMatchType,masking:s?.masking,urlTriggers:s?.urlTriggers})})};o(),(n=this.pr)==null||n.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:Ss.info("skipping remote config with no sessionRecording",e)}log(e,n){var r;n===void 0&&(n="log"),(r=this.vr)!=null&&r.log?this.vr.log(e,n):Ss.warn("log called before recorder was ready")}get mr(){var e,n,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(od);return(r==null||(n=r.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}_r(e){var n,r;if((n=G.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(r=G.__PosthogExtensions__)==null?void 0:r.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,r;this.vr||(r=this._instance.persistence)==null||r.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 r;return!((r=this.vr)==null||!r.tryAddCustomEvent(e,n))}},Os={},Af=()=>{},oo="posthog",Gy=!uE&&yt?.indexOf("MSIE")===-1&&yt?.indexOf("Mozilla")===-1,Vv=t=>{var e;return F({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:m1(N?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Af,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:_t&&ze(_t?.search)&&_t.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:(C==null||(e=C.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 r="Bad HTTP status: "+n.statusCode+" "+n.text;L.error(r)},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:yf},error_tracking:{},_onCapture:Af,__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))},zv=t=>{var e={};O(t.process_person)||(e.person_profiles=t.process_person),O(t.xhr_headers)||(e.request_headers=t.xhr_headers),O(t.cookie_name)||(e.persistence_name=t.cookie_name),O(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),O(t.store_google)||(e.save_campaign_params=t.store_google),O(t.verbose)||(e.debug=t.verbose);var n=Me({},e,t);return fe(t.property_blacklist)&&(O(t.property_denylist)?n.property_denylist=t.property_blacklist:fe(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:L.error("Invalid value for property_denylist config: "+t.property_denylist)),n},Rf=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){L.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Pl=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 Rf,this.Sr=!1,this.version=Hn.LIB_VERSION,this.Er=new Ds,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Vv(),this.SentryIntegration=Yd,this.sentryIntegration=e=>(function(n,r){var i=my(n,r);return{name:gy,processEvent:o=>i(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 df(this),this.toolbar=new Xd(this),this.scrollManager=new xf(this),this.pageViewManager=new of(this),this.surveys=new gf(this),this.experiments=new kf(this),this.exceptions=new uf(this),this.rateLimiter=new mf(this),this.requestRouter=new bf(this),this.consent=new Kd(this),this.externalIntegrations=new Ef(this),this.people={set:(e,n,r)=>{var i=ze(e)?{[e]:n}:e;this.setPersonProperties(i),r?.({})},set_once:(e,n,r)=>{var i=ze(e)?{[e]:n}:e;this.setPersonProperties(void 0,i),r?.({})}},this.on("eventCaptured",(e=>L.info('send "'+e?.event+'"',e)))}init(e,n,r){if(r&&r!==oo){var i,o=(i=Os[r])!==null&&i!==void 0?i:new t;return o._init(e,n,r),Os[r]=o,Os[oo][r]=o,o}return this._init(e,n,r)}_init(e,n,r){var i;if(n===void 0&&(n={}),O(e)||xd(e))return L.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(Me({},Vv(n.defaults),zv(n),{name:r,token:e})),this.config.on_xhr_error&&L.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Wn.GZipJS;var o=this.Cr();this.persistence=new Is(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Is(F({},this.config,{persistence:"sessionStorage"}),o);var s=F({},this.persistence.props),a=F({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new _f((p=>this.Or(p)),this.config.request_queue_config),this.Ar=new wf(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 Rl(this),this.sessionPropsManager=new Al(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(L.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(L.info("Initializing extensions synchronously"),this.Dr(l)),Hn.DEBUG=Hn.DEBUG||this.config.debug,Hn.DEBUG&&L.info("Starting in debug mode",{this:this,config:n,thisC:F({},this.config),p:s,s:a}),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var c,u,f=this.config.get_device_id(br()),h=(c=n.bootstrap)!=null&&c.isIdentifiedID?f:n.bootstrap.distinctID;this.persistence.set_property(jn,(u=n.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:h})}if(this.jr()){var g,v,_=Object.keys(((g=n.bootstrap)==null?void 0:g.featureFlags)||{}).filter((p=>{var m;return!((m=n.bootstrap)==null||(m=m.featureFlags)==null||!m[p])})).reduce(((p,m)=>{var y;return p[m]=((y=n.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[m])||!1,p}),{}),x=Object.keys(((v=n.bootstrap)==null?void 0:v.featureFlagPayloads)||{}).filter((p=>_[p])).reduce(((p,m)=>{var y,w;return(y=n.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[m]&&(p[m]=(w=n.bootstrap)==null||(w=w.featureFlagPayloads)==null?void 0:w[m]),p}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:x})}if(l)this.register_once({distinct_id:hs,$device_id:null},"");else if(!this.get_distinct_id()){var d=this.config.get_device_id(br());this.register_once({distinct_id:d,$device_id:d},""),this.persistence.set_property(jn,"anonymous")}return De(C,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?D1(this,(()=>this.Lr())):this.Lr(),kr(this.config._onCapture)&&this.config._onCapture!==Af&&(L.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(p=>this.config._onCapture(p.event,p)))),this.config.ip&&L.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 Zd(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new Qd(this).startIfEnabledOrStop()})),r.push((()=>{var i;this.siteApps=new Sf(this),(i=this.siteApps)==null||i.init()})),e||r.push((()=>{this.sessionRecording=new Tl(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new jd(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.heatmaps=new rf(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new nf(this)})),r.push((()=>{this.exceptionObserver=new Gd(this),this.exceptionObserver.startIfEnabled()})),r.push((()=>{this.deadClicksAutocapture=new xl(this,$1),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.Nr){var i=this.Nr;this.Nr=void 0,this.fi(i)}})),this.Ur(r,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 r=e.shift();if(r)try{r()}catch(o){L.error("Error initializing extension:",o)}}var i=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:i}),this.config.__preview_deferred_init_extensions&&L.info("PostHog extensions initialized ("+i+"ms)")}fi(e){var n,r,i,o,s,a,l,c;if(!N||!N.body)return L.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=te(e.supportedCompression,Wn.GZipJS)?Wn.GZipJS:te(e.supportedCompression,Wn.Base64)?Wn.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"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(i=this.sessionRecording)==null||i.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(s=this.heatmaps)==null||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(a=this.webVitalsAutocapture)==null||a.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){L.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new vf(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()&&Cr(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&&(Gy?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=El(e.url,{ip:this.config.ip?1:0}),e.headers=F({},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 r,i,o,s=F({},n);s.timeout=s.timeout||6e4,s.url=El(s.url,{_:new Date().getTime().toString(),ver:Hn.LIB_VERSION,compression:s.compression});var a=(r=s.transport)!==null&&r!==void 0?r:"fetch",l=ll.filter((u=>!s.disableTransport||!u.transport||!s.disableTransport.includes(u.transport))),c=(i=(o=Xv(l,(u=>u.transport===a)))==null?void 0:o.method)!==null&&i!==void 0?i:l[0].method;if(!c)throw new Error("No available transport method");c(s)})(F({},e,{callback:n=>{var r,i;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(i=this.config).on_request_error)==null||r.call(i,n)),e.callback==null||e.callback(n)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var n,r=[],i=[],o=[];Cr(e,(a=>{a&&(n=a[0],fe(n)?o.push(a):kr(a)?a.call(this):fe(a)&&n==="alias"?r.push(a):fe(a)&&n.indexOf("capture")!==-1&&kr(this[n])?o.push(a):i.push(a))}));var s=function(a,l){Cr(a,(function(c){if(fe(c[0])){var u=l;pe(c,(function(f){u=u[f[0]].apply(u,f.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};s(r,this),s(i,this),s(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,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!O(e)&&ze(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var s=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){n!=null&&n.$current_url&&!ze(n?.$current_url)&&(L.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 a=new Date,l=r?.timestamp||a,c=br(),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"),s&&(u.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),r?.$set&&(u.$set=r?.$set);var f,h=this.qr(r?.$set_once);if(h&&(u.$set_once=h),(u=h1(u,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,O(r?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=a),e===cl.DISMISSED||e===cl.SENT){var g=n?.[Fv.SURVEY_ID],v=n?.[Fv.SURVEY_ITERATION];f={id:g,current_iteration:v},localStorage.getItem($v(f))||localStorage.setItem($v(f),"true"),u.$set=F({},u.$set,{[hE({id:g,current_iteration:v},e===cl.SENT?"responded":"dismissed")]:!0})}var _=F({},u.properties.$set,u.$set);if(so(_)||this.setPersonPropertiesForFlags(_),!de(this.config.before_send)){var x=this.Wr(u);if(!x)return;u=x}this.Er.emit("eventCaptured",u);var d={method:"POST",url:(i=r?._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Or(d):this.Mr.enqueue(d),u}L.critical("This capture call is ignored due to client rate limiting.")}}else L.error("No event name provided to posthog.capture")}else L.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,r,i,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var s=o?void 0:this.persistence.remove_event_timer(e),a=F({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),e==="$snapshot"){var l=F({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ze(a.distinct_id)&&!wn(a.distinct_id)||xd(a.distinct_id))&&L.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var c,u=eE(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());a.$session_id=f,a.$window_id=h}this.sessionPropsManager&&Me(a,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Me(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(g=this.Ar)==null?void 0:g.length}catch(d){a.$sdk_debug_error_capturing_properties=String(d)}if(this.requestRouter.region===Ts.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),a=Me(a,c),e==="$pageview"&&N&&(a.title=N.title),!O(s)){var v=r.getTime()-s;a.$duration=parseFloat((v/1e3).toFixed(3))}yt&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Me({},u,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),fe(this.config.property_denylist)?pe(this.config.property_denylist,(function(d){delete a[d]})):L.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(L.error("sanitize_properties is deprecated. Use before_send instead"),a=_(a,e));var x=this.Gr();return a.$process_person_profile=x,x&&!o&&this.Vr("_calculate_event_properties"),a}qr(e){var n;if(!this.persistence||!this.Gr()||this.Sr)return e;var r=this.persistence.get_initial_props(),i=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),o=Me({},r,i||{},e||{}),s=this.config.sanitize_properties;return s&&(L.error("sanitize_properties is deprecated. Use before_send instead"),o=s(o,"$set_once")),this.Sr=!0,so(o)?void 0:o}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var i;(i=this.persistence)==null||i.register_once(e,n,r)}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,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,r)}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,r;return(n=(r=this.sessionManager)==null?void 0:r.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=mE),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,r){if(!this.__loaded||!this.persistence)return L.uninitializedWarning("posthog.identify");if(wn(e)&&(e=e.toString(),L.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()))L.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!==hs){if(this.Vr("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==i&&e!==this.get_property(bs)&&(this.unregister(bs),this.register({distinct_id:e}));var s=(this.persistence.get_property(jn)||"anonymous")==="anonymous";e!==i&&s?(this.persistence.set_property(jn,"identified"),this.setPersonPropertiesForFlags(F({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this.Tr=Iv(e,n,r),this.featureFlags.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(pl))}}else L.critical('The string "'+hs+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else L.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Vr("posthog.setPersonProperties")){var r=Iv(this.get_distinct_id(),e,n);this.Tr!==r?(this.setPersonPropertiesForFlags(F({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Tr=r):L.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,r){if(e&&n){if(this.Vr("posthog.group")){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:F({},i,{[e]:n})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),i[e]===n||r||this.reloadFeatureFlags()}}else L.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,r,i,o;if(L.info("reset"),!this.__loaded)return L.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(i=this.persistence)==null||i.set_property(jn,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:hs,$device_id:null},"");else{var a=this.config.get_device_id(br());this.register_once({distinct_id:a,$device_id:e?a:s},"")}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:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&r){var o,s=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-s,0)}return i}alias(e,n){return e===this.get_property(Qv)?(L.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(O(n)&&(n=this.get_distinct_id()),e!==n?(this.Jr(bs,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(L.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=F({},this.config);if(We(e)){var r,i,o,s,a;Me(this.config,zv(e));var l=this.Cr();(r=this.persistence)==null||r.update_config(this.config,n,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Is(F({},this.config,{persistence:"sessionStorage"}),l);var c=this.Rr(this.config.debug);Er(c)&&(this.config.debug=c),Er(this.config.debug)&&(this.config.debug?(Hn.DEBUG=!0,ke.H()&&ke.G("ph_debug","true"),L.info("set_config",{config:e,oldConfig:n,newConfig:F({},this.config)})):(Hn.DEBUG=!1,ke.H()&&ke.V("ph_debug"))),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(s=this.heatmaps)==null||s.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(a=this.externalIntegrations)==null||a.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,r={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(r).some(Boolean)){var i,o,s,a,l;(i=this.sessionManager)==null||i.checkAndGetSessionAndWindowId(),r.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),r.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),r.url_trigger&&((a=this.sessionRecording)==null||a.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,n){var r=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(F({},i,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:oo;return n!==oo&&(n=oo+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(jn))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(jn))==="identified"}Gr(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&so(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[bs])&&((n=this.persistence)==null||(n=n.props)==null||!n[gl]))}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"?(L.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(gl,!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,r,i,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((r=this.persistence)==null||r.set_disabled(o)),((n=this.sessionPersistence)==null?void 0:n.wi)!==o&&((i=this.sessionPersistence)==null||i.set_disabled(o)),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var r,i;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),this.sessionManager=new Rl(this),this.persistence&&(this.sessionPropsManager=new Al(this,this.sessionManager,this.persistence)),this.sessionRecording=new Tl(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(),(O(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((i=e?.captureEventName)!==null&&i!==void 0?i:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else L.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:hs,$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())):L.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===Un.GRANTED?"granted":e===Un.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 It?Ky(It,this.config.custom_blocked_useragents):void 0}Hr(){N&&(N.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:N.title},{send_instantly:!0}),this.kr&&(N.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),De(N,"visibilitychange",this.kr)))}debug(e){e===!1?(C?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(C?.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,r,i,o,s,a,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?(L.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",i=!1,o=L,s=(n="advanced_disable_flags")in(e=l)&&!O(e[n]),a=r in e&&!O(e[r]),s?e[n]:a?(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[r]):i)}Wr(e){if(de(this.config.before_send))return e;var n=fe(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of n){if(r=i(r),de(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return Xk(e.event)?L.warn(o+". This can cause unexpected behavior."):L.info(o),null}r.properties&&!so(r.properties)||L.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,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Rr(e){var n=Er(e)&&!e,r=ke.H()&&ke.q("ph_debug")==="true";return!n&&(!!r||e)}};(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=p1(t.prototype[e[n]])})(Pl,["identify"]);var Hv,Zy=(Hv=Os[oo]=new Pl,(function(){function t(){t.done||(t.done=!0,Gy=!1,pe(Os,(function(e){e._dom_loaded()})))}N!=null&&N.addEventListener?N.readyState==="complete"?t():De(N,"DOMContentLoaded",t,{capture:!1}):C&&L.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),Hv);var Bf=class{constructor(e={}){this.options=e;j(this,"client");j(this,"featureFlagsCallback");j(this,"captureCallback");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&typeof window<"u"&&e.apiKey){this.client=Zy;let n=e.enableFeatureFlags??!0;this.client.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=>{n&&this.featureFlagsCallback&&r.onFeatureFlags(()=>{let i=this.getAllFeatureFlags();i&&this.featureFlagsCallback&&this.featureFlagsCallback(i)}),this.captureCallback&&r.on("eventCaptured",(i,o)=>{this.captureCallback?.(i,o)})}})}}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let n={};for(let[r,i]of Object.entries(e))r.startsWith("in_segment_")&&(n[r]=i===!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,r){this.track("shadow_canvas_action",{action:e,rectangleId:n,surface:r})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,n,r){let i=`$experiment_${e}`;this.register({[i]:r??`variation_${n}`,[`${i}_id`]:n}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:n,$experiment_variation_name:r??`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 Vf(t={}){return new Bf(t)}var Xy={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function jf(){return Xy}function zf(t){let e=2166136261,n=t.length;for(let r=0;r<n;r++)e^=t.charCodeAt(r),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function Hs(t,e,n){return n===2?zf(zf(t+e)+"")%1e4/1e4:n===1?zf(e+t)%1e3/1e3:null}function bE(t){return t<=0?[]:new Array(t).fill(1/t)}function Ll(t,e){return t>=e[0]&&t<e[1]}function Qy(t,e){let n=Hs("__"+e[0],t,1);return n===null?!1:n>=e[1]&&n<e[2]}function Jy(t,e){for(let n=0;n<e.length;n++)if(Ll(t,e[n]))return n;return-1}function Uf(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function Ml(t,e){if(!e.length)return!1;let n=!1,r=!1;for(let i=0;i<e.length;i++){let o=CE(t,e[i].type,e[i].pattern);if(e[i].include===!1){if(o)return!1}else n=!0,o&&(r=!0)}return r||!n}function kE(t,e,n){try{let r=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return n&&(r="\\/?"+r.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+r+"$","i").test(t)}catch{return!1}}function EE(t,e){try{let n=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),r=[[t.host,n.host,!1],[t.pathname,n.pathname,!0]];return n.hash&&r.push([t.hash,n.hash,!1]),n.searchParams.forEach((i,o)=>{r.push([t.searchParams.get(o)||"",i,!1])}),!r.some(i=>!kE(i[0],i[1],i[2]))}catch{return!1}}function CE(t,e,n){try{let r=new URL(t,"https://_");if(e==="regex"){let i=Uf(n);return i?i.test(r.href)||i.test(r.href.substring(r.origin.length)):!1}else if(e==="simple")return EE(r,n);return!1}catch{return!1}}function e_(t,e,n){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let r=bE(t);n=n||r,n.length!==t&&(n=r);let i=n.reduce((s,a)=>a+s,0);(i<.99||i>1.01)&&(n=r);let o=0;return n.map(s=>{let a=o;return o+=s,[a,a+e*s]})}function t_(t,e,n){if(!e)return null;let r=e.split("?")[1];if(!r)return null;let i=r.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return i.length>0&&i[0]>=0&&i[0]<n?i[0]:null}function n_(t){try{return t()}catch(e){return console.error(e),!1}}var Hf=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function gi(t,e,n){if(e=e||"",n=n||globalThis.crypto&&globalThis.crypto.subtle||Xy.SubtleCrypto,!n)throw new Error("No SubtleCrypto implementation found");try{let r=await n.importKey("raw",Hf(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[i,o]=t.split("."),s=await n.decrypt({name:"AES-CBC",iv:Hf(i)},r,Hf(o));return new TextDecoder().decode(s)}catch{throw new Error("Failed to decrypt")}}function js(t){return typeof t=="string"?t:JSON.stringify(t)}function Ot(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 r_(){let t;try{t="1.6.3"}catch{t=""}return t}function i_(t,e){let n,r;try{n=new URL(t),r=new URL(e)}catch(i){return console.error(`Unable to merge query strings: ${i}`),e}return n.searchParams.forEach((i,o)=>{r.searchParams.has(o)||r.searchParams.set(o,i)}),r.toString()}function Yy(t){return typeof t=="object"&&t!==null}function Fl(t){return t.urlPatterns&&t.variations.some(e=>Yy(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>Yy(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function $l(t,e){return new Promise(n=>{let r=!1,i,o=s=>{r||(r=!0,i&&clearTimeout(i),n(s||null))};e&&(i=setTimeout(()=>o(),e)),t.then(s=>o(s)).catch(()=>o())})}var nt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},xn=jf(),mi={fetchFeaturesCall:({host:t,clientKey:e,headers:n})=>xn.fetch(`${t}/api/features/${e}`,{headers:n}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:n,headers:r})=>{let i={method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(n)};return xn.fetch(`${t}/api/eval/${e}`,i)},eventSourceCall:({host:t,clientKey:e,headers:n})=>n?new xn.EventSource(`${t}/sub/${e}`,{headers:n}):new xn.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let n=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),TE()):document.visibilityState==="hidden"&&(t=window.setTimeout(RE,nt.idleStreamInterval))};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(xn.localStorage=globalThis.localStorage)}catch{}var mo=new Map,o_=!1,Kn=new Map,Dl=new Map,vo=new Map,yo=new Set;function qf(t){Object.assign(nt,t),nt.backgroundSync||Xf()}async function a_({instance:t,timeout:e,skipCache:n,allowStale:r,backgroundSync:i}){return i||(nt.backgroundSync=!1),PE({instance:t,allowStale:r,timeout:e,skipCache:n})}function AE(t){let e=Us(t),n=mo.get(e)||new Set;n.add(t),mo.set(e,n)}function l_(t){mo.forEach(e=>e.delete(t))}function RE(){vo.forEach(t=>{t&&(t.state="idle",Zf(t))})}function TE(){vo.forEach(t=>{t&&t.state==="idle"&&Yf(t)})}async function s_(){try{if(!xn.localStorage)return;await xn.localStorage.setItem(nt.cacheKey,JSON.stringify(Array.from(Kn.entries())))}catch{}}async function PE({instance:t,allowStale:e,timeout:n,skipCache:r}){let i=Us(t),o=Kf(t),s=new Date,a=new Date(s.getTime()-nt.maxAge+nt.staleTTL);await IE();let l=!nt.disableCache&&!r?Kn.get(o):void 0;return l&&(e||l.staleAt>s)&&l.staleAt>a?(l.sse&&yo.add(i),l.staleAt<s?Wf(t):Gf(t),{data:l.data,success:!0,source:"cache"}):await $l(Wf(t),n)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function Us(t){let[e,n]=t.getApiInfo();return`${e}||${n}`}function Kf(t){let e=Us(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let n=t.getAttributes(),r=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),i={};r.forEach(a=>{i[a]=n[a]});let o=t.getForcedVariations(),s=t.getUrl();return`${e}||${JSON.stringify({ca:i,fv:o,url:s})}`}async function IE(){if(!o_){o_=!0;try{if(xn.localStorage){let t=await xn.localStorage.getItem(nt.cacheKey);if(!nt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([n,r])=>{Kn.set(n,{...r,staleAt:new Date(r.staleAt)})}),c_()}}}catch{}if(!nt.disableIdleStreams){let t=mi.startIdleListener();t&&(mi.stopIdleListener=t)}}}function c_(){let t=Array.from(Kn.entries()).map(([n,r])=>({key:n,staleAt:r.staleAt.getTime()})).sort((n,r)=>n.staleAt-r.staleAt),e=Math.min(Math.max(0,Kn.size-nt.maxEntries),Kn.size);for(let n=0;n<e;n++)Kn.delete(t[n].key)}function u_(t,e,n){let r=n.dateUpdated||"",i=new Date(Date.now()+nt.staleTTL),o=nt.disableCache?void 0:Kn.get(e);if(o&&r&&o.version===r){o.staleAt=i,s_();return}nt.disableCache||(Kn.set(e,{data:n,version:r,staleAt:i,sse:yo.has(t)}),c_()),s_();let s=mo.get(t);s&&s.forEach(a=>OE(a,n))}async function OE(t,e){await t.setPayload(e||t.getPayload())}async function Wf(t){let{apiHost:e,apiRequestHeaders:n}=t.getApiHosts(),r=t.getClientKey(),i="isRemoteEval"in t&&t.isRemoteEval(),o=Us(t),s=Kf(t),a=Dl.get(s);return a||(a=(i?mi.fetchRemoteEvalCall({host:e,clientKey:r,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:n}):mi.fetchFeaturesCall({host:e,clientKey:r,headers:n})).then(c=>{if(!c.ok)throw new Error(`HTTP error: ${c.status}`);return c.headers.get("x-sse-support")==="enabled"&&yo.add(o),c.json()}).then(c=>(u_(o,s,c),Gf(t),Dl.delete(s),{data:c,success:!0,source:"network"})).catch(c=>(Dl.delete(s),{data:null,source:"error",success:!1,error:c})),Dl.set(s,a)),a}function Gf(t,e=!1){let n=Us(t),r=Kf(t),{streamingHost:i,streamingHostRequestHeaders:o}=t.getApiHosts(),s=t.getClientKey();if(e&&yo.add(n),nt.backgroundSync&&yo.has(n)&&xn.EventSource){if(vo.has(n))return;let a={src:null,host:i,clientKey:s,headers:o,cb:l=>{try{if(l.type==="features-updated"){let c=mo.get(n);c&&c.forEach(u=>{Wf(u)})}else if(l.type==="features"){let c=JSON.parse(l.data);u_(n,r,c)}a.errors=0}catch{d_(a)}},errors:0,state:"active"};vo.set(n,a),Yf(a)}}function d_(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);Zf(t),setTimeout(()=>{["idle","active"].includes(t.state)||Yf(t)},Math.min(e,3e5))}}function Zf(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function Yf(t){t.src=mi.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=()=>d_(t),t.src.onopen=()=>{t.errors=0}}function NE(t,e){Zf(t),vo.delete(e)}function Xf(){yo.clear(),vo.forEach(NE),mo.clear(),mi.stopIdleListener()}function Bl(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&Gf(t,!0),AE(t)}}var LE=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,ep={revert:function(){}},jl=new Map,tp=new Set;function ME(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function Ul(t){var e=jl.get(t);return e||(e={element:t,attributes:{}},jl.set(t,e)),e}function Wl(t,e,n,r,i){var o=n(t),s={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&s._positionTimeout)){e==="position"&&(s._positionTimeout=setTimeout(function(){s._positionTimeout=null},1e3));var a=n(t);e==="position"&&a.parentNode===s.virtualValue.parentNode&&a.insertBeforeNode===s.virtualValue.insertBeforeNode||a!==s.virtualValue&&(s.originalValue=a,i(s))}}),mutationRunner:i,setValue:r,getCurrentValue:n};return e==="position"&&t.parentNode?s.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):s.observer.observe(t,ME(e)),s}function ql(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,f_()):t!==n&&(e.isDirty=!0,f_())}function FE(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),ql(YE(e),t)}function $E(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(n){return n.mutate(e)}),ql(Array.from(e).filter(Boolean).join(" "),t)}function DE(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),ql(e,t)}function BE(t){var e=t.parentSelector,n=t.insertBeforeSelector,r=document.querySelector(e);if(!r)return null;var i=n?document.querySelector(n):null;return n&&!i?null:{parentNode:r,insertBeforeNode:i}}function VE(t){var e=t.originalValue;t.mutations.forEach(function(n){var r=n.mutate(),i=BE(r);e=i||e}),ql(e,t)}var zE=function(e){return e.innerHTML},HE=function(e,n){return e.innerHTML=n};function h_(t){var e=Ul(t);return e.html||(e.html=Wl(t,"html",zE,HE,FE)),e.html}var jE=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},UE=function(e,n){n.insertBeforeNode&&!n.parentNode.contains(n.insertBeforeNode)||n.parentNode.insertBefore(e,n.insertBeforeNode)};function g_(t){var e=Ul(t);return e.position||(e.position=Wl(t,"position",jE,UE,VE)),e.position}var WE=function(e,n){return n?e.className=n:e.removeAttribute("class")},qE=function(e){return e.className};function m_(t){var e=Ul(t);return e.classes||(e.classes=Wl(t,"class",qE,WE,$E)),e.classes}var KE=function(e){return function(n){var r;return(r=n.getAttribute(e))!=null?r:null}},GE=function(e){return function(n,r){return r!==null?n.setAttribute(e,r):n.removeAttribute(e)}};function v_(t,e){var n=Ul(t);return n.attributes[e]||(n.attributes[e]=Wl(t,e,KE(e),GE(e),DE)),n.attributes[e]}function ZE(t,e){var n=jl.get(t);if(n)if(e==="html"){var r,i;(r=n.html)==null||(i=r.observer)==null||i.disconnect(),delete n.html}else if(e==="class"){var o,s;(o=n.classes)==null||(s=o.observer)==null||s.disconnect(),delete n.classes}else if(e==="position"){var a,l;(a=n.position)==null||(l=a.observer)==null||l.disconnect(),delete n.position}else{var c,u,f;(c=n.attributes)==null||(u=c[e])==null||(f=u.observer)==null||f.disconnect(),delete n.attributes[e]}}var Vl;function YE(t){return Vl||(Vl=document.createElement("div")),Vl.innerHTML=t,Vl.innerHTML}function zl(t,e,n){if(n.isDirty){n.isDirty=!1;var r=n.virtualValue;n.mutations.length||ZE(t,e),n.setValue(t,r)}}function XE(t,e){t.html&&zl(e,"html",t.html),t.classes&&zl(e,"class",t.classes),t.position&&zl(e,"position",t.position),Object.keys(t.attributes).forEach(function(n){zl(e,n,t.attributes[n])})}function f_(){jl.forEach(XE)}function QE(t,e){var n=null;t.kind==="html"?n=h_(e):t.kind==="class"?n=m_(e):t.kind==="attribute"?n=v_(e,t.attribute):t.kind==="position"&&(n=g_(e)),n&&(n.mutations.push(t),n.mutationRunner(n))}function JE(t,e){var n=null;if(t.kind==="html"?n=h_(e):t.kind==="class"?n=m_(e):t.kind==="attribute"?n=v_(e,t.attribute):t.kind==="position"&&(n=g_(e)),!!n){var r=n.mutations.indexOf(t);r!==-1&&n.mutations.splice(r,1),n.mutationRunner(n)}}function y_(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),n=document.querySelectorAll(t.selector);n.forEach(function(r){e.has(r)||(t.elements.add(r),QE(t,r))})}}function eC(t){t.elements.forEach(function(e){return JE(t,e)}),t.elements.clear(),tp.delete(t)}function p_(){tp.forEach(y_)}var Qf;function tC(){typeof document>"u"||(Qf||(Qf=new MutationObserver(function(){p_()})),p_(),Qf.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}tC();function Kl(t){return typeof document>"u"?ep:(tp.add(t),y_(t),{revert:function(){eC(t)}})}function Jf(t,e){return Kl({kind:"html",elements:new Set,mutate:e,selector:t})}function __(t,e){return Kl({kind:"position",elements:new Set,mutate:e,selector:t})}function Ws(t,e){return Kl({kind:"class",elements:new Set,mutate:e,selector:t})}function Hl(t,e,n){return LE.test(e)?e==="class"||e==="className"?Ws(t,function(r){var i=n(Array.from(r).join(" "));r.clear(),i&&i.split(/\s+/g).filter(Boolean).forEach(function(o){return r.add(o)})}):Kl({kind:"attribute",attribute:e,elements:new Set,mutate:n,selector:t}):ep}function nC(t){var e=t.selector,n=t.action,r=t.value,i=t.attribute,o=t.parentSelector,s=t.insertBeforeSelector;if(i==="html"){if(n==="append")return Jf(e,function(a){return a+(r??"")});if(n==="set")return Jf(e,function(){return r??""})}else if(i==="class"){if(n==="append")return Ws(e,function(a){r&&a.add(r)});if(n==="remove")return Ws(e,function(a){r&&a.delete(r)});if(n==="set")return Ws(e,function(a){a.clear(),r&&a.add(r)})}else if(i==="position"){if(n==="set"&&o)return __(e,function(){return{insertBeforeSelector:s,parentSelector:o}})}else{if(n==="append")return Hl(e,i,function(a){return a!==null?a+(r??""):r??""});if(n==="set")return Hl(e,i,function(){return r??""});if(n==="remove")return Hl(e,i,function(){return null})}return ep}var rC={html:Jf,classes:Ws,attribute:Hl,position:__,declarative:nC},w_=rC;var np={};function Rr(t,e,n){n=n||{};for(let[r,i]of Object.entries(e))switch(r){case"$or":if(!S_(t,i,n))return!1;break;case"$nor":if(S_(t,i,n))return!1;break;case"$and":if(!lC(t,i,n))return!1;break;case"$not":if(Rr(t,i,n))return!1;break;default:if(!qs(i,iC(t,r),n))return!1}return!0}function iC(t,e){let n=e.split("."),r=t;for(let i=0;i<n.length;i++)if(r&&typeof r=="object"&&n[i]in r)r=r[n[i]];else return null;return r}function x_(t,e=!1){let n=`${t}${e?"/i":""}`;return np[n]||(np[n]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),np[n]}function qs(t,e,n){if(typeof t=="string")return 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)||!b_(t))return JSON.stringify(e)===JSON.stringify(t);for(let r in t)if(!aC(r,e,t[r],n))return!1;return!0}function b_(t){let e=Object.keys(t);return e.length>0&&e.filter(n=>n[0]==="$").length===e.length}function oC(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 sC(t,e,n){if(!Array.isArray(t))return!1;let r=b_(e)?i=>qs(e,i,n):i=>Rr(i,e,n);for(let i=0;i<t.length;i++)if(t[i]&&r(t[i]))return!0;return!1}function Gl(t,e){return Array.isArray(t)?t.some(n=>e.includes(n)):e.includes(t)}function aC(t,e,n,r){switch(t){case"$veq":return Ot(e)===Ot(n);case"$vne":return Ot(e)!==Ot(n);case"$vgt":return Ot(e)>Ot(n);case"$vgte":return Ot(e)>=Ot(n);case"$vlt":return Ot(e)<Ot(n);case"$vlte":return Ot(e)<=Ot(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)?Gl(e,n):!1;case"$inGroup":return Gl(e,r[n]||[]);case"$notInGroup":return!Gl(e,r[n]||[]);case"$nin":return Array.isArray(n)?!Gl(e,n):!1;case"$not":return!qs(n,e,r);case"$size":return Array.isArray(e)?qs(n,e.length,r):!1;case"$elemMatch":return sC(e,n,r);case"$all":if(!Array.isArray(e))return!1;for(let i=0;i<n.length;i++){let o=!1;for(let s=0;s<e.length;s++)if(qs(n[i],e[s],r)){o=!0;break}if(!o)return!1}return!0;case"$regex":try{return x_(n).test(e)}catch{return!1}case"$regexi":try{return x_(n,!0).test(e)}catch{return!1}case"$type":return oC(e)===n;default:return console.error("Unknown operator: "+t),!1}}function S_(t,e,n){if(!e.length)return!0;for(let r=0;r<e.length;r++)if(Rr(t,e[r],n))return!0;return!1}function lC(t,e,n){for(let r=0;r<e.length;r++)if(!Rr(t,e[r],n))return!1;return!0}var cC="Feature Evaluated",uC="Experiment Viewed";function dC(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((n,r)=>e.set(r,n)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((n,r)=>e.set(r,n)),e}function fC(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 _o(t){try{await t()}catch{}}function k_(t,e,n){if(t.user.trackedExperiments){let i=Xl(e,n);if(t.user.trackedExperiments.has(i))return[];t.user.trackedExperiments.add(i)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:n,timestamp:Date.now().toString(),logType:"experiment"});let r=[];if(t.global.trackingCallback){let i=t.global.trackingCallback;r.push(_o(()=>i(e,n,t.user)))}if(t.user.trackingCallback){let i=t.user.trackingCallback;r.push(_o(()=>i(e,n)))}if(t.global.eventLogger){let i=t.global.eventLogger;r.push(_o(()=>i(uC,{experimentId:e.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},t.user)))}return r}function pC(t,e,n){if(t.user.trackedFeatureUsage){let r=JSON.stringify(n.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:n,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let r=t.global.onFeatureUsage;_o(()=>r(e,n,t.user))}if(t.user.onFeatureUsage){let r=t.user.onFeatureUsage;_o(()=>r(e,n))}if(t.global.eventLogger){let r=t.global.eventLogger;_o(()=>r(cC,{feature:e,source:n.source,value:n.value,ruleId:n.source==="defaultValue"?"$default":n.ruleId||"",variationId:n.experimentResult?n.experimentResult.key:""},t.user))}}function Zl(t,e){if(e.stack.evaluatedFeatures.has(t))return Tr(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let n=dC(e);if(n.has(t))return Tr(e,t,n.get(t),"override");if(!e.global.features||!e.global.features[t])return Tr(e,t,null,"unknownFeature");let r=e.global.features[t];if(r.rules){let i=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(i);let c=Zl(l.id,e);if(c.source==="cyclicPrerequisite")return Tr(e,t,null,"cyclicPrerequisite");let u={value:c.value};if(!Rr(u,l.condition||{})){if(l.gate)return Tr(e,t,null,"prerequisite");continue e}}if(o.filters&&A_(o.filters,e))continue;if("force"in o){if(o.condition&&!C_(o.condition,e)||!hC(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=>{!k_(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),Tr(e,t,o.force,"force",o.id)}if(!o.variations)continue;let s={variations:o.variations,key:o.key||t};"coverage"in o&&(s.coverage=o.coverage),o.weights&&(s.weights=o.weights),o.hashAttribute&&(s.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(s.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(s.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(s.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(s.minBucketVersion=o.minBucketVersion),o.namespace&&(s.namespace=o.namespace),o.meta&&(s.meta=o.meta),o.ranges&&(s.ranges=o.ranges),o.name&&(s.name=o.name),o.phase&&(s.phase=o.phase),o.seed&&(s.seed=o.seed),o.hashVersion&&(s.hashVersion=o.hashVersion),o.filters&&(s.filters=o.filters),o.condition&&(s.condition=o.condition);let{result:a}=Yl(s,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(s,a),a.inExperiment&&!a.passthrough)return Tr(e,t,a.value,"experiment",o.id,s,a)}}return Tr(e,t,r.defaultValue===void 0?null:r.defaultValue,"defaultValue")}function Yl(t,e,n){let r=t.key,i=t.variations.length;if(i<2)return{result:Se(n,t,-1,!1,e)};if(n.global.enabled===!1||n.user.enabled===!1)return{result:Se(n,t,-1,!1,e)};if(t=gC(t,n),t.urlPatterns&&!Ml(n.user.url||"",t.urlPatterns))return{result:Se(n,t,-1,!1,e)};let o=t_(r,n.user.url||"",i);if(o!==null)return{result:Se(n,t,o,!1,e)};let s=fC(n);if(r in s){let x=s[r];return{result:Se(n,t,x,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:Se(n,t,-1,!1,e)};let{hashAttribute:a,hashValue:l}=vi(n,t.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:Se(n,t,-1,!1,e)};let c=-1,u=!1,f=!1;if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:x,versionIsBlocked:d}=yC({ctx:n,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});u=x>=0,c=x,f=!!d}if(!u){if(t.filters){if(A_(t.filters,n))return{result:Se(n,t,-1,!1,e)}}else if(t.namespace&&!Qy(l,t.namespace))return{result:Se(n,t,-1,!1,e)};if(t.include&&!n_(t.include))return{result:Se(n,t,-1,!1,e)};if(t.condition&&!C_(t.condition,n))return{result:Se(n,t,-1,!1,e)};if(t.parentConditions){let x=new Set(n.stack.evaluatedFeatures);for(let d of t.parentConditions){n.stack.evaluatedFeatures=new Set(x);let p=Zl(d.id,n);if(p.source==="cyclicPrerequisite")return{result:Se(n,t,-1,!1,e)};let m={value:p.value};if(!Rr(m,d.condition||{}))return{result:Se(n,t,-1,!1,e)}}}if(t.groups&&!vC(t.groups,n))return{result:Se(n,t,-1,!1,e)}}if(t.url&&!mC(t.url,n))return{result:Se(n,t,-1,!1,e)};let h=Hs(t.seed||r,l,t.hashVersion||1);if(h===null)return{result:Se(n,t,-1,!1,e)};if(!u){let x=t.ranges||e_(i,t.coverage===void 0?1:t.coverage,t.weights);c=Jy(h,x)}if(f)return{result:Se(n,t,-1,!1,e,void 0,!0)};if(c<0)return{result:Se(n,t,-1,!1,e)};if("force"in t)return{result:Se(n,t,t.force===void 0?-1:t.force,!1,e)};if(n.global.qaMode||n.user.qaMode)return{result:Se(n,t,-1,!1,e)};if(t.status==="stopped")return{result:Se(n,t,-1,!1,e)};let g=Se(n,t,c,!0,e,h,u);if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:x,key:d,doc:p}=wC(n,a,js(l),{[rp(t.key,t.bucketVersion)]:g.key});x&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[d]=p,n.user.saveStickyBucketAssignmentDoc(p))}let v=k_(n,t,g);v.length===0&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:t,result:g});let _=v.length?v.length===1?v[0]:Promise.all(v).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&n.global.recordChangeId&&n.global.recordChangeId(t.changeId),{result:g,trackingCall:_}}function Tr(t,e,n,r,i,o,s){let a={value:n,on:!!n,off:!n,source:r,ruleId:i||""};return o&&(a.experiment=o),s&&(a.experimentResult=s),r!=="override"&&pC(t,e,a),a}function E_(t){return{...t.user.attributes,...t.user.attributeOverrides}}function C_(t,e){return Rr(E_(e),t,e.global.savedGroups||{})}function A_(t,e){return t.some(n=>{let{hashValue:r}=vi(e,n.attribute);if(!r)return!0;let i=Hs(n.seed,r,n.hashVersion||2);return i===null?!0:!n.ranges.some(o=>Ll(i,o))})}function hC(t,e,n,r,i,o,s){if(!i&&o===void 0)return!0;if(!i&&o===0)return!1;let{hashValue:a}=vi(t,n,r);if(!a)return!1;let l=Hs(e,a,s||1);return l===null?!1:i?Ll(l,i):o!==void 0?l<=o:!0}function Se(t,e,n,r,i,o,s){let a=!0;(n<0||n>=e.variations.length)&&(n=0,a=!1);let{hashAttribute:l,hashValue:c}=vi(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),u=e.meta?e.meta[n]:{},f={key:u.key||""+n,featureId:i,inExperiment:a,hashUsed:r,variationId:n,value:e.variations[n],hashAttribute:l,hashValue:c,stickyBucketUsed:!!s};return u.name&&(f.name=u.name),o!==void 0&&(f.bucket=o),u.passthrough&&(f.passthrough=u.passthrough),f}function gC(t,e){let n=t.key,r=e.global.overrides;return r&&r[n]&&(t=Object.assign({},t,r[n]),typeof t.url=="string"&&(t.url=Uf(t.url))),t}function vi(t,e,n){let r=e||"id",i="",o=E_(t);return o[r]&&(i=o[r]),!i&&n&&(o[n]&&(i=o[n]),i&&(r=n)),{hashAttribute:r,hashValue:i}}function mC(t,e){let n=e.user.url;if(!n)return!1;let r=n.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(n)||t.test(r))}function vC(t,e){let n=e.global.groups||{};for(let r=0;r<t.length;r++)if(n[t[r]])return!0;return!1}function yC({ctx:t,expKey:e,expBucketVersion:n,expHashAttribute:r,expFallbackAttribute:i,expMinBucketVersion:o,expMeta:s}){n=n||0,o=o||0,r=r||"id",s=s||[];let a=rp(e,n),l=_C(t,r,i);if(o>0)for(let f=0;f<o;f++){let h=rp(e,f);if(l[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let c=l[a];if(c===void 0)return{variation:-1};let u=s.findIndex(f=>f.key===c);return u<0?{variation:-1}:{variation:u}}function rp(t,e){return e=e||0,`${t}__${e}`}function ip(t,e){return`${t}||${e}`}function _C(t,e,n){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:r,hashValue:i}=vi(t,e),o=ip(r,js(i)),{hashAttribute:s,hashValue:a}=vi(t,n),l=a?ip(s,js(a)):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 wC(t,e,n,r){let i=ip(e,n),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[i]?t.user.stickyBucketAssignmentDocs[i].assignments||{}:{},s={...o,...r},a=JSON.stringify(o)!==JSON.stringify(s);return{key:i,doc:{attributeName:e,attributeValue:n,assignments:s},changed:a}}function xC(t,e){let n=new Set,r=e&&e.features?e.features:t.global.features||{},i=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(r).forEach(o=>{let s=r[o];if(s.rules)for(let a of s.rules)a.variations&&(n.add(a.hashAttribute||"id"),a.fallbackAttribute&&n.add(a.fallbackAttribute))}),i.map(o=>{n.add(o.hashAttribute||"id"),o.fallbackAttribute&&n.add(o.fallbackAttribute)}),Array.from(n)}async function R_(t,e,n){let r=op(t,n);return e.getAllAssignments(r)}function op(t,e){let n={};return xC(t,e).forEach(i=>{let{hashValue:o}=vi(t,i);n[i]=js(o)}),n}async function T_(t,e,n){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await gi(t.encryptedFeatures,e,n))}catch(r){console.error(r)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await gi(t.encryptedExperiments,e,n))}catch(r){console.error(r)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await gi(t.encryptedSavedGroups,e,n))}catch(r){console.error(r)}delete t.encryptedSavedGroups}return t}function P_(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 Xl(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var wo=typeof window<"u"&&typeof document<"u",SC=r_(),xo=class{constructor(e){if(e=e||{},this.version=SC,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=r=>n.saveAssignments(r)}if(e.plugins)for(let n of e.plugins)n(this);if(e.features&&(this.ready=!0),wo&&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 r=this._options.stickyBucketAssignmentDocs[n];r&&this._options.stickyBucketService.saveAssignments(r).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let n=await T_(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,Bl(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&qf(e.cacheSettings),e.payload)return await this.setPayload(e.payload),Bl(this,e),{success:!0,source:"init"};{let{data:n,...r}=await this._refresh({...e,allowStale:!0});return Bl(this,e),await this.setPayload(n||{}),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 n=await this._refresh({...e||{},allowStale:!1});n.data&&await this.setPayload(n.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return P_(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:r,streaming:i}){if(!this._options.clientKey)throw new Error("Missing clientKey");return a_({instance:this,timeout:e,skipCache:n||this._options.disableCache,allowStale:r,backgroundSync:i??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,r){let i=await gi(e,n||this._options.decryptionKey,r);this.setFeatures(JSON.parse(i))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,n,r){let i=await gi(e,n||this._options.decryptionKey,r);this.setExperiments(JSON.parse(i))}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(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,l_(this),e.destroyAllStreams&&Xf(),this.logs=[],wo&&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}=Yl(e,null,this._getEvalContext());return this._onExperimentEval(e,n),n}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,n){let r=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!r)return null;let i=this._isAutoExperimentBlockedByContext(e),o,s;i?o=Se(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:s}=Yl(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let a=JSON.stringify(o.value);if(!n&&o.inExperiment&&r&&r.valueHash===a)return o;if(r&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=Fl(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let c=e.persistQueryString?i_(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(Ml(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:f}=this._getNavigateFunction();if(u)if(wo)Promise.all([...s?[$l(s,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??f))]).then(()=>{try{u(c)}catch(h){console.error(h)}});else try{u(c)}catch(h){console.error(h)}}else if(l==="visual"){let c=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);c&&this._activeAutoExperiments.set(e,{undo:c,valueHash:a})}}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||[],r=new Set(n);this._activeAutoExperiments.forEach((i,o)=>{r.has(o)||(i.undo(),this._activeAutoExperiments.delete(o))});for(let i of n){let o=this._runAutoExperiment(i,e);if(o&&o.inExperiment&&Fl(i)==="redirect")break}}_onExperimentEval(e,n){let r=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:n}),this._subscriptions.size>0&&this._fireSubscriptions(e,n,r)}_fireSubscriptions(e,n,r){(!r||r.result.inExperiment!==n.inExperiment||r.result.variationId!==n.variationId)&&this._subscriptions.forEach(i=>{try{i(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 r=this.evalFeature(e).value;return r===null?n:r}feature(e){return this.evalFeature(e)}evalFeature(e){return Zl(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=>[Xl(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(r){console.error(r)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(Xl(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(wo?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let n=Fl(e);if(n==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(r=>r.js))return!0}else if(n==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let r=new URL(this._getContextUrl());for(let i of e.variations){if(!i||!i.urlRedirect)continue;let o=new URL(i.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}:wo?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!wo)return;let n=[];if(e.css){let r=document.createElement("style");r.innerHTML=e.css,document.head.appendChild(r),n.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),n.push(()=>r.remove())}return e.domMutations&&e.domMutations.forEach(r=>{n.push(w_.declarative(r).revert)}),()=>{n.forEach(r=>r())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let n=this._getEvalContext(),r=await R_(n,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=r}}generateStickyBucketAssignmentDocsSync(e,n){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let r=this._getEvalContext(),i=op(r,n);return e.getAllAssignmentsSync(i)}inDevMode(){return!!this._options.enableDevMode}};var Sn=ee(wt());function dp(){return dp=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},dp.apply(null,arguments)}var BC=Sn.createContext({});var VC=t=>n=>Sn.createElement(BC.Consumer,null,({growthbook:r})=>Sn.createElement(t,dp({},n,{runExperiment:i=>r.run(i)})));VC.displayName="WithRunExperiment";var zC="https://experiment.syntrologie.com",fp=class{constructor(e={}){j(this,"gb");if(e.client)this.gb=e.client;else{let n=e.onExperimentViewed?(r,i)=>{e.onExperimentViewed(r.key,i.variationId,typeof i.value=="string"?i.value:`variation_${i.variationId}`)}:void 0;this.gb=new xo({...e,apiHost:e.apiHost??zC,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)}shouldRenderRectangle(e){let n=e.experiment;if(!n||!n.featureKey)return!0;let r=this.gb.getFeatureValue(n.featureKey,null);if(r==null)return!1;if(typeof n.variationId=="number")return Number(r)===n.variationId;if(typeof n.variationValue<"u")return r===n.variationValue;if(n.predicate)try{return n.predicate(r)}catch{return!1}return!!r}};function pp(t={}){return new fp(t)}var Pr=ee(wt(),1),HC=t=>[...t].sort((e,n)=>(e.order??0)-(n.order??0));function U_({fetcher:t,pollIntervalMs:e=3e4,experiments:n,runtime:r}){let[i,o]=(0,Pr.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Pr.useCallback)(async()=>{try{o(c=>({...c,isLoading:!0,error:void 0}));let a=await t(),l=a.tiles||[];r&&a.routes&&r.setRoutes(a.routes),r?(l=await r.filterTiles(l),n&&(l=l.filter(c=>n.shouldRenderRectangle(c)))):n&&(l=l.filter(c=>n.shouldRenderRectangle(c))),o({tiles:HC(l),actions:a.actions||[],isLoading:!1,fetchedAt:a.fetchedAt,canvasTitle:a.canvasTitle,configVersion:a.configVersion,theme:a.theme,launcher:a.launcher,routes:a.routes})}catch(a){o(l=>({...l,isLoading:!1,error:a instanceof Error?a.message:"Unknown error"}))}},[n,t,r]);return(0,Pr.useEffect)(()=>{if(s(),!e)return;let a=setInterval(s,e);return()=>clearInterval(a)},[s,e]),(0,Pr.useMemo)(()=>i,[i])}var Zn=ee(wt(),1);var Gs=ee(wt(),1),ie=ee(ye(),1),ZC={success:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M6 10l2.5 2.5L14 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),warning:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("path",{d:"M10 2L18 17H2L10 2Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,ie.jsx)("path",{d:"M10 8v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ie.jsx)("circle",{cx:"10",cy:"14",r:"0.75",fill:"currentColor"})]}),error:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),info:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M10 9v5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ie.jsx)("circle",{cx:"10",cy:"6",r:"0.75",fill:"currentColor"})]}),alert:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M10 5v6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ie.jsx)("circle",{cx:"10",cy:"14",r:"0.75",fill:"currentColor"})]})};function YC({onClick:t,color:e}){return(0,ie.jsx)("button",{onClick:n=>{n.stopPropagation(),t()},style:{position:"absolute",top:"8px",right:"8px",width:"20px",height:"20px",padding:0,border:"none",background:"rgba(255, 255, 255, 0.1)",borderRadius:"50%",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:e,opacity:.6,transition:"opacity 0.15s ease"},onMouseEnter:n=>{n.currentTarget.style.opacity="1"},onMouseLeave:n=>{n.currentTarget.style.opacity="0.6"},"aria-label":"Dismiss",children:(0,ie.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,ie.jsx)("path",{d:"M1 1l8 8M9 1l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})}function XC(t){let e={success:{bg:"var(--sc-color-success-muted, rgba(52, 199, 89, 0.15))",border:"var(--sc-color-success, #34c759)",icon:"var(--sc-color-success, #34c759)",text:"var(--sc-color-text, #f5f5f7)"},warning:{bg:"var(--sc-color-warning-muted, rgba(255, 159, 10, 0.15))",border:"var(--sc-color-warning, #ff9f0a)",icon:"var(--sc-color-warning, #ff9f0a)",text:"var(--sc-color-text, #f5f5f7)"},error:{bg:"var(--sc-color-error-muted, rgba(255, 69, 58, 0.15))",border:"var(--sc-color-error, #ff453a)",icon:"var(--sc-color-error, #ff453a)",text:"var(--sc-color-text, #f5f5f7)"},info:{bg:"var(--sc-color-info-muted, rgba(10, 132, 255, 0.15))",border:"var(--sc-color-info, #0a84ff)",icon:"var(--sc-color-info, #0a84ff)",text:"var(--sc-color-text, #f5f5f7)"},alert:{bg:"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))",border:"var(--sc-color-primary, #6366f1)",icon:"var(--sc-color-primary, #6366f1)",text:"var(--sc-color-text, #f5f5f7)"}};return e[t]||e.info}function hp({content:t,onDismiss:e,accentColor:n}){let[r,i]=(0,Gs.useState)(!1),[o,s]=(0,Gs.useState)(t.type==="warning"?t.countdown??null:null);(0,Gs.useEffect)(()=>{if(o===null||o<=0)return;let d=setInterval(()=>{s(p=>p!==null&&p>0?p-1:null)},1e3);return()=>clearInterval(d)},[o]);let a=()=>{i(!0),setTimeout(()=>e?.(),200)},l=XC(t.type),c=ZC[t.type],u={position:"relative",padding:"var(--sc-spacing-md, 0.75rem)",borderRadius:"var(--sc-border-radius-md, 10px)",background:l.bg,borderLeft:`3px solid ${l.border}`,opacity:r?0:1,transform:r?"translateX(10px)":"translateX(0)",transition:"opacity 0.2s ease, transform 0.2s ease"},f={display:"flex",alignItems:"flex-start",gap:"var(--sc-spacing-sm, 0.5rem)"},h={color:l.icon,flexShrink:0,marginTop:"1px"},g={flex:1,minWidth:0,paddingRight:t.dismissible?"24px":0},v={fontSize:"var(--sc-font-size-md, 0.9rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:l.text,margin:0,lineHeight:"var(--sc-line-height-tight, 1.25)"},_={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",margin:"var(--sc-spacing-xs, 0.25rem) 0 0",lineHeight:"var(--sc-line-height-normal, 1.5)"},x={fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)",marginTop:"var(--sc-spacing-sm, 0.5rem)"};return(0,ie.jsxs)("div",{style:u,children:[(0,ie.jsxs)("div",{style:f,children:[(0,ie.jsx)("div",{style:h,children:(0,ie.jsx)(c,{})}),(0,ie.jsxs)("div",{style:g,children:[(0,ie.jsx)("h4",{style:v,children:t.title}),t.body&&(0,ie.jsx)("p",{style:_,children:t.body}),t.type==="error"&&t.errorCode&&(0,ie.jsxs)("p",{style:{..._,fontFamily:"var(--sc-font-family-mono, monospace)"},children:["Code: ",t.errorCode]}),t.type==="info"&&t.learnMoreUrl&&(0,ie.jsx)("a",{href:t.learnMoreUrl,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"var(--sc-spacing-sm, 0.5rem)",fontSize:"var(--sc-font-size-sm, 0.8rem)",color:l.icon,textDecoration:"none"},onClick:d=>d.stopPropagation(),children:"Learn more \u2192"}),o!==null&&o>0&&(0,ie.jsxs)("p",{style:{..._,color:l.icon},children:["Action required in ",o,"s"]}),t.timestamp&&(0,ie.jsx)("p",{style:x,children:t.timestamp})]})]}),t.dismissible&&(0,ie.jsx)(YC,{onClick:a,color:l.text})]})}var G_=ee(wt(),1),Ee=ee(ye(),1);function QC({trend:t}){let e=t.direction==="up",n=t.direction==="down";return(0,Ee.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"var(--sc-border-radius-full, 9999px)",background:e?"var(--sc-color-success-muted, rgba(52, 199, 89, 0.15))":n?"var(--sc-color-error-muted, rgba(255, 69, 58, 0.15))":"rgba(142, 142, 147, 0.15)",color:e?"var(--sc-color-success, #34c759)":n?"var(--sc-color-error, #ff453a)":"var(--sc-color-text-muted, #8e8e93)",fontSize:"var(--sc-font-size-xs, 0.7rem)",fontWeight:"var(--sc-font-weight-medium, 500)"},children:[(0,Ee.jsx)(()=>(0,Ee.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",style:{transform:e?"rotate(0deg)":n?"rotate(180deg)":"rotate(90deg)"},children:(0,Ee.jsx)("path",{d:"M5 1v8M5 1L2 4M5 1l3 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),{}),t.value,t.timeframe&&(0,Ee.jsx)("span",{style:{color:"var(--sc-color-text-muted, #8e8e93)"},children:t.timeframe})]})}function JC({data:t,color:e}){let{path:n,width:r,height:i}=(0,G_.useMemo)(()=>{if(t.length<2)return{path:"",width:60,height:24};let l=Math.min(...t),u=Math.max(...t)-l||1;return{path:t.map((g,v)=>{let _=2+v/(t.length-1)*56,x=22-(g-l)/u*20;return{x:_,y:x}}).reduce((g,v,_)=>g+(_===0?`M ${v.x} ${v.y}`:` L ${v.x} ${v.y}`),""),width:60,height:24}},[t]);return n?(0,Ee.jsxs)("svg",{width:r,height:i,viewBox:`0 0 ${r} ${i}`,style:{overflow:"visible"},children:[(0,Ee.jsx)("path",{d:n,stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),(0,Ee.jsx)("defs",{children:(0,Ee.jsxs)("linearGradient",{id:"sparkline-gradient",x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,Ee.jsx)("stop",{offset:"0%",stopColor:e,stopOpacity:"0.3"}),(0,Ee.jsx)("stop",{offset:"100%",stopColor:e,stopOpacity:"0"})]})}),(0,Ee.jsx)("path",{d:`${n} L ${r-2} ${i} L 2 ${i} Z`,fill:"url(#sparkline-gradient)"})]}):null}function gp({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",r={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0"},i={display:"flex",alignItems:"baseline",gap:"var(--sc-spacing-xs, 0.25rem)"},o={fontSize:"var(--sc-font-size-xxl, 1.5rem)",fontWeight:"var(--sc-font-weight-bold, 700)",color:n,letterSpacing:"-0.02em",lineHeight:1},s={fontSize:"var(--sc-font-size-md, 0.9rem)",fontWeight:"var(--sc-font-weight-normal, 400)",color:"var(--sc-color-text-muted, #8e8e93)"},a={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",margin:0},l={display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"var(--sc-spacing-xs, 0.25rem)"};return(0,Ee.jsxs)("div",{style:r,children:[(0,Ee.jsxs)("div",{style:i,children:[t.prefix&&(0,Ee.jsx)("span",{style:s,children:t.prefix}),(0,Ee.jsx)("span",{style:o,children:t.value}),t.suffix&&(0,Ee.jsx)("span",{style:s,children:t.suffix})]}),(0,Ee.jsx)("p",{style:a,children:t.label}),(t.trend||t.sparkline)&&(0,Ee.jsxs)("div",{style:l,children:[t.trend&&(0,Ee.jsx)(QC,{trend:t.trend}),t.sparkline&&t.sparkline.length>1&&(0,Ee.jsx)(JC,{data:t.sparkline,color:n})]})]})}var xt=ee(ye(),1);function eA({item:t,accentColor:e,layout:n}){let r=t.highlight,i={display:"flex",flexDirection:n==="list"?"row":"column",alignItems:n==="list"?"center":"flex-start",gap:n==="list"?"var(--sc-spacing-md, 0.75rem)":"var(--sc-spacing-xs, 0.25rem)",padding:"var(--sc-spacing-md, 0.75rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",background:r?"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))":"var(--sc-color-background-subtle, rgba(0, 0, 0, 0.2))",border:r?`1px solid ${e}`:"1px solid var(--sc-color-border-subtle, rgba(255, 255, 255, 0.06))",transition:"all 0.15s ease"},o={fontSize:"1.25rem",marginBottom:n==="list"?0:"var(--sc-spacing-xs, 0.25rem)"},s={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",flex:n==="list"?1:void 0},a={fontSize:"var(--sc-font-size-lg, 1rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:r?e:"var(--sc-color-text, #f5f5f7)"};return(0,xt.jsxs)("div",{style:i,children:[t.icon&&(0,xt.jsx)("span",{style:o,children:t.icon}),(0,xt.jsx)("span",{style:s,children:t.label}),(0,xt.jsx)("span",{style:a,children:t.value})]})}function mp({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",r=t.layout||"grid",i=t.columns||2,o=t.items;if(t.highlightBest&&!t.items.some(a=>a.highlight)){let a=t.items.map(c=>({...c,numericValue:typeof c.value=="number"?c.value:parseFloat(String(c.value))})),l=Math.max(...a.map(c=>c.numericValue||0));o=a.map(c=>({...c,highlight:c.numericValue===l}))}let s={display:r==="table"?"block":r==="list"?"flex":"grid",flexDirection:r==="list"?"column":void 0,gridTemplateColumns:r==="grid"?`repeat(${i}, 1fr)`:void 0,gap:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0"};return r==="table"?(0,xt.jsx)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--sc-font-size-sm, 0.8rem)"},children:(0,xt.jsx)("tbody",{children:o.map((a,l)=>(0,xt.jsxs)("tr",{style:{borderBottom:l<o.length-1?"1px solid var(--sc-color-border-subtle, rgba(255, 255, 255, 0.06))":void 0},children:[(0,xt.jsxs)("td",{style:{padding:"var(--sc-spacing-sm, 0.5rem) 0",color:"var(--sc-color-text-secondary, #a1a1a6)",display:"flex",alignItems:"center",gap:"var(--sc-spacing-sm, 0.5rem)"},children:[a.icon&&(0,xt.jsx)("span",{children:a.icon}),a.label]}),(0,xt.jsx)("td",{style:{padding:"var(--sc-spacing-sm, 0.5rem) 0",textAlign:"right",fontWeight:"var(--sc-font-weight-semibold, 600)",color:a.highlight?n:"var(--sc-color-text, #f5f5f7)"},children:a.value})]},l))})}):(0,xt.jsx)("div",{style:s,children:o.map((a,l)=>(0,xt.jsx)(eA,{item:a,accentColor:n,layout:r},l))})}var nc=ee(wt(),1),ae=ee(ye(),1);function tA({value:t,maxValue:e,onChange:n,color:r}){let[i,o]=(0,nc.useState)(null);return(0,ae.jsx)("div",{style:{display:"flex",gap:"4px"},children:Array.from({length:e},(s,a)=>{let l=a+1,c=(i??t??0)>=l;return(0,ae.jsx)("button",{onClick:()=>n(l),onMouseEnter:()=>o(l),onMouseLeave:()=>o(null),style:{width:"28px",height:"28px",padding:0,border:"none",background:"none",cursor:"pointer",color:c?r:"var(--sc-color-text-muted, #8e8e93)",transition:"color 0.15s ease, transform 0.1s ease",transform:i===l?"scale(1.15)":"scale(1)"},"aria-label":`Rate ${l} out of ${e}`,children:(0,ae.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:c?"currentColor":"none",children:(0,ae.jsx)("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})},a)})})}function nA({value:t,onChange:e,color:n}){let r=i=>({width:"48px",height:"48px",padding:"8px",border:"none",borderRadius:"var(--sc-border-radius-md, 10px)",background:i?n:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",cursor:"pointer",color:i?"white":"var(--sc-color-text-muted, #8e8e93)",transition:"all 0.15s ease"});return(0,ae.jsxs)("div",{style:{display:"flex",gap:"12px"},children:[(0,ae.jsx)("button",{onClick:()=>e(1),style:r(t===1),"aria-label":"Thumbs up",children:(0,ae.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:(0,ae.jsx)("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3H14zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:t===1?"currentColor":"none"})})}),(0,ae.jsx)("button",{onClick:()=>e(0),style:r(t===0),"aria-label":"Thumbs down",children:(0,ae.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",style:{transform:"rotate(180deg)"},children:(0,ae.jsx)("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3H14zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:t===0?"currentColor":"none"})})})]})}function rA({value:t,maxValue:e,onChange:n,color:r}){return(0,ae.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)"},children:[(0,ae.jsx)("div",{style:{display:"flex",gap:"4px",justifyContent:"center"},children:Array.from({length:e+1},(i,o)=>{let s=t===o;return(0,ae.jsx)("button",{onClick:()=>n(o),style:{width:"28px",height:"32px",padding:0,border:s?`2px solid ${r}`:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.12))",borderRadius:"var(--sc-border-radius-sm, 6px)",background:s?r:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",cursor:"pointer",color:s?"white":"var(--sc-color-text, #f5f5f7)",fontSize:"var(--sc-font-size-sm, 0.8rem)",fontWeight:"var(--sc-font-weight-medium, 500)",transition:"all 0.15s ease"},"aria-label":`Rate ${o}`,children:o},o)})}),(0,ae.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"0 2px"},children:[(0,ae.jsx)("span",{style:{fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)"},children:"Not likely"}),(0,ae.jsx)("span",{style:{fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)"},children:"Very likely"})]})]})}function iA({value:t,onChange:e,color:n}){return(0,ae.jsx)("div",{style:{display:"flex",gap:"8px",justifyContent:"center"},children:["\u{1F622}","\u{1F615}","\u{1F610}","\u{1F642}","\u{1F604}"].map((i,o)=>{let s=t===o;return(0,ae.jsx)("button",{onClick:()=>e(o),style:{width:"44px",height:"44px",padding:0,border:s?`2px solid ${n}`:"1px solid transparent",borderRadius:"var(--sc-border-radius-md, 10px)",background:s?"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))":"transparent",cursor:"pointer",fontSize:"1.75rem",transition:"all 0.15s ease",transform:s?"scale(1.1)":"scale(1)"},"aria-label":`Rate ${o+1} out of 5`,children:i},o)})})}function vp({content:t,onSubmit:e,accentColor:n}){let[r,i]=(0,nc.useState)(null),[o,s]=(0,nc.useState)(!1),a=n||"var(--sc-color-primary, #6366f1)",l=t.maxValue??(t.variant==="nps"?10:5),c=g=>{i(g)},u=()=>{r!==null&&(s(!0),e?.(r))},f={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-md, 0.75rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0",alignItems:"center"},h={fontSize:"var(--sc-font-size-md, 0.9rem)",color:"var(--sc-color-text, #f5f5f7)",textAlign:"center",margin:0};return o?(0,ae.jsxs)("div",{style:{...f,padding:"var(--sc-spacing-lg, 1rem)"},children:[(0,ae.jsx)("span",{style:{fontSize:"2rem"},children:"\u2713"}),(0,ae.jsx)("p",{style:{...h,color:"var(--sc-color-success, #34c759)"},children:"Thanks for your feedback!"})]}):(0,ae.jsxs)("div",{style:f,children:[t.question&&(0,ae.jsx)("p",{style:h,children:t.question}),t.variant==="stars"&&(0,ae.jsx)(tA,{value:r,maxValue:l,onChange:c,color:a}),t.variant==="thumbs"&&(0,ae.jsx)(nA,{value:r,onChange:c,color:a}),t.variant==="nps"&&(0,ae.jsx)(rA,{value:r,maxValue:l,onChange:c,color:a}),t.variant==="emoji"&&(0,ae.jsx)(iA,{value:r,onChange:c,color:a}),r!==null&&t.submitActionId&&(0,ae.jsx)("button",{onClick:u,style:{marginTop:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) var(--sc-spacing-lg, 1rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",border:"none",background:a,color:"white",fontSize:"var(--sc-font-size-sm, 0.8rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",cursor:"pointer",transition:"opacity 0.15s ease"},children:"Submit"})]})}var Xe=ee(ye(),1);function yp({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",r=t.items.filter(x=>x.completed).length,i=t.items.length,o={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)"},s={display:"flex",alignItems:"center",gap:"var(--sc-spacing-sm, 0.5rem)",marginBottom:"var(--sc-spacing-sm, 0.5rem)",fontSize:"var(--sc-font-size-xs, 0.75rem)",color:"var(--sc-color-text-muted, #8e8e93)"},a={flex:1,height:"4px",background:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",borderRadius:"2px",overflow:"hidden"},l={height:"100%",width:`${i>0?r/i*100:0}%`,background:n,borderRadius:"2px",transition:"width 0.3s ease"},c=x=>({display:"flex",alignItems:"flex-start",gap:"var(--sc-spacing-md, 0.75rem)",padding:"var(--sc-spacing-md, 0.75rem)",background:"var(--sc-color-surface, rgba(58, 58, 60, 0.5))",borderRadius:"var(--sc-border-radius-md, 10px)",border:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.08))",opacity:x?.6:1,transition:"all 0.15s ease"}),u=x=>({width:"20px",height:"20px",borderRadius:"50%",border:x?"none":"2px solid var(--sc-color-border, rgba(255, 255, 255, 0.2))",background:x?"#34c759":"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:"2px"}),f={flex:1,minWidth:0},h=x=>({fontSize:"var(--sc-font-size-sm, 0.85rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:"var(--sc-color-text, #f5f5f7)",margin:0,textDecoration:x?"line-through":"none"}),g={fontSize:"var(--sc-font-size-xs, 0.75rem)",color:"var(--sc-color-text-muted, #8e8e93)",margin:"var(--sc-spacing-xs, 0.25rem) 0 0",lineHeight:1.4},v={display:"inline-flex",alignItems:"center",gap:"var(--sc-spacing-xs, 0.25rem)",padding:"var(--sc-spacing-xs, 0.25rem) var(--sc-spacing-sm, 0.5rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",border:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.15))",background:"transparent",color:"var(--sc-color-text, #f5f5f7)",fontSize:"var(--sc-font-size-xs, 0.75rem)",fontWeight:"var(--sc-font-weight-medium, 500)",cursor:"pointer",textDecoration:"none",transition:"all 0.15s ease",flexShrink:0},_=x=>{x&&typeof window<"u"&&(window.location.href=x)};return(0,Xe.jsxs)("div",{style:o,children:[t.showProgress!==!1&&i>0&&(0,Xe.jsxs)("div",{style:s,children:[(0,Xe.jsxs)("span",{children:[r," of ",i]}),(0,Xe.jsx)("div",{style:a,children:(0,Xe.jsx)("div",{style:l})})]}),t.items.map(x=>(0,Xe.jsxs)("div",{style:c(x.completed??!1),children:[(0,Xe.jsx)("div",{style:u(x.completed??!1),children:x.completed&&(0,Xe.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:(0,Xe.jsx)("path",{d:"M20 6L9 17l-5-5",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,Xe.jsxs)("div",{style:f,children:[(0,Xe.jsx)("p",{style:h(x.completed??!1),children:x.title}),x.description&&(0,Xe.jsx)("p",{style:g,children:x.description})]}),x.href&&!x.completed&&(0,Xe.jsxs)("button",{style:v,onClick:d=>{d.stopPropagation(),_(x.href)},onMouseEnter:d=>{d.currentTarget.style.background="var(--sc-color-surface, rgba(58, 58, 60, 0.8))"},onMouseLeave:d=>{d.currentTarget.style.background="transparent"},children:[x.linkLabel||"Go",(0,Xe.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:(0,Xe.jsx)("path",{d:"M5 12h14M12 5l7 7-7 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]},x.id))]})}var bo=ee(ye(),1);function oA(t){return["alert","success","warning","info","error"].includes(t.type)}function sA(t){return t.type==="stats"}function aA(t){return t.type==="comparison"}function lA(t){return t.type==="rating"}function cA(t){return t.type==="checklist"}function Z_(t,e={}){return oA(t)?(0,bo.jsx)(hp,{content:t,accentColor:e.accentColor,onDismiss:e.onDismiss}):sA(t)?(0,bo.jsx)(gp,{content:t,accentColor:e.accentColor}):aA(t)?(0,bo.jsx)(mp,{content:t,accentColor:e.accentColor}):lA(t)?(0,bo.jsx)(vp,{content:t,accentColor:e.accentColor,onSubmit:e.onRatingSubmit}):cA(t)?(0,bo.jsx)(yp,{content:t,accentColor:e.accentColor}):null}function Y_(t){return["alert","success","warning","info","error","stats","comparison","chart","table","form","rating","progress","survey","checklist","video","gallery","code"].includes(t)}var St=ee(wt(),1),X_=ee(ye(),1),_p=(0,St.createContext)({runtime:null,context:null});function wp({runtime:t,children:e}){let[n,r]=(0,St.useState)(t?t.context.get():null);(0,St.useEffect)(()=>t?(r(t.context.get()),t.context.subscribe(s=>{r(s)})):void 0,[t]);let i=(0,St.useMemo)(()=>({runtime:t,context:n}),[t,n]);return(0,X_.jsx)(_p.Provider,{value:i,children:e})}function Gn(){let{runtime:t}=(0,St.useContext)(_p);return t}function rc(){let{context:t}=(0,St.useContext)(_p);return t}function xp(){return rc()?.page??null}function uA(){return rc()?.session??null}function dA(){return rc()?.viewport??null}function fA(t,e,n=[]){let r=Gn();(0,St.useEffect)(()=>r?t?r.events.subscribe(t,e):r.events.subscribe(e):void 0,[r,...n])}function pA(){return Gn()?.state??null}function hA(t,e){let n=Gn(),[r,i]=(0,St.useState)({value:e,isFallback:!0,isLoading:!0});return(0,St.useEffect)(()=>{if(!n||!t){i({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return n.evaluate(t).then(s=>{o||i({value:s.value,isFallback:s.isFallback,isLoading:!1})}),()=>{o=!0}},[n,t,e]),r}var Ce={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",SURFACE_MOUNTED:"surface.mounted",SURFACE_UNMOUNTED:"surface.unmounted"},ko="1.0.0";function rn(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:ko}}function gA(t){return rn(Ce.CANVAS_OPENED,{surface:t})}function mA(t){return rn(Ce.CANVAS_CLOSED,{surface:t})}function vA(t,e){return rn(Ce.TILE_VIEWED,{tileId:t,surface:e})}function yA(t,e){return rn(Ce.TILE_EXPANDED,{tileId:t,surface:e})}function _A(t,e){return rn(Ce.TILE_COLLAPSED,{tileId:t,surface:e})}function wA(t,e,n){return rn(Ce.TILE_ACTION,{tileId:t,actionId:e,surface:n})}function xA(t,e){return rn(Ce.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function SA(t,e){return rn(Ce.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function bA(t,e,n){return rn(Ce.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:n})}function kA(t,e,n){return rn(Ce.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:n})}function EA(t,e){let n=t.startsWith("canvas.")?t:`canvas.${t}`;return rn(n,e)}var bn={canvasOpened:gA,canvasClosed:mA,tileViewed:vA,tileExpanded:yA,tileCollapsed:_A,tileAction:wA,overlayStarted:xA,overlayCompleted:SA,overlayDismissed:bA,overlayStepViewed:kA,custom:EA};var oe=ee(ye(),1);function CA({config:t,telemetry:e,surface:n}){let[r,i]=(0,Zn.useState)([{author:"Lumi",text:"Hi! Need clarity on a deduction?"}]),[o,s]=(0,Zn.useState)(""),a=Gn(),l=c=>{if(c.preventDefault(),!!o.trim()){if(i(u=>[...u,{author:"You",text:o.trim()}]),setTimeout(()=>{i(u=>[...u,{author:"Lumi",text:"I will route that to the experimentation server stub for now."}])},600),e?.trackAction("chatbot_message",t.id,n),a){let u=bn.tileAction(t.id,"chatbot_message",n);a.events.publish(u.name,u.props,u.source)}s("")}};return(0,oe.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",height:"100%"},children:[(0,oe.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"0.75rem",background:"rgba(0, 0, 0, 0.2)",borderRadius:"8px",fontSize:"0.85rem"},children:r.map((c,u)=>(0,oe.jsxs)("p",{style:{margin:"0 0 0.5rem"},children:[(0,oe.jsxs)("span",{style:{fontWeight:600,color:"#94a3b8"},children:[c.author,":"]})," ",(0,oe.jsx)("span",{style:{color:"#e2e8f0"},children:c.text})]},`${c.author}-${u}`))}),(0,oe.jsxs)("form",{onSubmit:l,style:{display:"flex",gap:"0.5rem"},children:[(0,oe.jsx)("input",{style:{flex:1,padding:"0.5rem 0.75rem",borderRadius:"6px",border:"1px solid rgba(255, 255, 255, 0.1)",background:"rgba(0, 0, 0, 0.3)",color:"#f1f5f9",fontSize:"0.85rem",outline:"none"},value:o,onChange:c=>s(c.target.value),placeholder:"Ask anything..."}),(0,oe.jsx)("button",{style:{padding:"0.5rem 0.75rem",borderRadius:"6px",border:"none",background:"#6366f1",color:"white",fontWeight:600,fontSize:"0.8rem",cursor:"pointer"},type:"submit",children:"Send"})]})]})}function AA({renderer:t,config:e,surface:n,telemetry:r,isExpanded:i}){let o=(0,Zn.useRef)(null);return(0,Zn.useEffect)(()=>{if(!o.current)return;let s=t.mount(o.current,{config:e,surface:n,telemetry:r,isExpanded:i});return()=>{s&&s()}},[t,e,n,r,i]),(0,oe.jsx)("div",{ref:o,style:{width:"100%",height:"100%"}})}function Zs({config:t,surface:e,telemetry:n,style:r,customRenderers:i,isExpanded:o=!1,onToggleExpand:s}){let{title:a,subtitle:l,content:c,style:u}=t,f=Gn(),h=(0,Zn.useCallback)(w=>{if(n?.trackAction(w,t.id,e),f){let k=bn.tileAction(t.id,w,e);f.events.publish(k.name,k.props,k.source)}},[n,f,t.id,e]),g=u?.accentColor??"#6366f1",v="72px",_={display:"flex",flexDirection:"column",borderRadius:"14px",background:u?.background??"rgba(28, 28, 30, 0.95)",border:"1px solid rgba(255, 255, 255, 0.08)",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.3)",color:u?.textColor??"#f5f5f7",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif",overflow:"hidden",cursor:s?"pointer":"default",transition:"all 0.25s ease",...r},x={display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.875rem 1rem",minHeight:v},d={width:"40px",height:"40px",borderRadius:"10px",background:`linear-gradient(135deg, ${g} 0%, ${g}cc 100%)`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.25rem",flexShrink:0,boxShadow:`0 2px 8px ${g}40`},p=()=>{switch(c.type){case"chatbot":return"\u{1F4AC}";case"metric":return"\u{1F4CA}";case"embed":return"\u{1F517}";case"custom":return"\u2699\uFE0F";case"checklist":return"\u{1F4CB}";default:return"\u{1F4C4}"}},m=()=>{switch(c.type){case"metric":return`${c.metricValue}${c.metricUnit?` ${c.metricUnit}`:""}`;case"text":return c.headline||c.body?.slice(0,50)||"";case"chatbot":return"Tap to chat";case"embed":return"Tap to view";case"custom":return"Tap to expand";case"checklist":{let w=c.items||[];return`${w.filter(b=>b.completed).length} of ${w.length} complete`}default:return""}},y=()=>{if(Y_(c.type)){let w=Z_(c,{accentColor:g,onDismiss:()=>{h("block_dismissed")},onRatingSubmit:k=>{h("rating_submitted")}});if(w)return w}switch(c.type){case"chatbot":return(0,oe.jsx)("div",{style:{height:"200px"},children:(0,oe.jsx)(CA,{config:t,surface:e,telemetry:n})});case"metric":return(0,oe.jsxs)("div",{style:{textAlign:"center",padding:"0.5rem 0"},children:[(0,oe.jsxs)("p",{style:{fontSize:"3rem",fontWeight:700,color:g,margin:0,letterSpacing:"-0.02em"},children:[c.metricValue,c.metricUnit&&(0,oe.jsx)("span",{style:{fontSize:"1.25rem",fontWeight:400,color:"#8e8e93",marginLeft:"0.5rem"},children:c.metricUnit})]}),c.headline&&(0,oe.jsx)("p",{style:{fontSize:"0.85rem",color:"#8e8e93",margin:"0.5rem 0 0"},children:c.headline})]});case"embed":return c.embedUrl?(0,oe.jsx)("iframe",{src:c.embedUrl,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",style:{width:"100%",height:"200px",borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.1)",background:"rgba(0, 0, 0, 0.2)"},title:c.headline??t.title}):null;case"custom":{let w=c.component||c.customRendererKey;return!w||!i||!i[w]?(0,oe.jsxs)("div",{style:{color:"#ff6b6b",fontSize:"0.85rem",padding:"0.5rem 0"},children:["Unknown component: ",w]}):(0,oe.jsx)(AA,{renderer:i[w],config:t,surface:e,telemetry:n,isExpanded:o})}case"text":default:{let w=c;return(0,oe.jsxs)("div",{style:{padding:"0.25rem 0"},children:[w.headline&&(0,oe.jsx)("p",{style:{fontSize:"1rem",fontWeight:600,color:"#f5f5f7",margin:"0 0 0.5rem"},children:w.headline}),w.body&&(0,oe.jsx)("p",{style:{fontSize:"0.9rem",color:"#8e8e93",margin:0,lineHeight:1.5},children:w.body})]})}}};return(0,oe.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:_,onClick:w=>{o&&w.target.closest("[data-expanded-content]")||s?.()},children:[(0,oe.jsxs)("div",{style:x,children:[(0,oe.jsx)("div",{style:d,children:p()}),(0,oe.jsxs)("div",{style:{flex:1,minWidth:0},children:[l&&(0,oe.jsx)("p",{style:{fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.05em",color:"#8e8e93",margin:0},children:l}),(0,oe.jsx)("h3",{style:{fontSize:"0.95rem",fontWeight:600,color:"#f5f5f7",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a}),!o&&(0,oe.jsx)("p",{style:{fontSize:"0.8rem",color:"#8e8e93",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m()})]}),(0,oe.jsx)("div",{style:{color:"#8e8e93",fontSize:"0.85rem",transform:o?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"},children:"\u25BC"})]}),o&&(0,oe.jsxs)("div",{"data-expanded-content":!0,style:{padding:"0 1rem 1rem",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},onClick:w=>w.stopPropagation(),children:[(0,oe.jsx)("div",{style:{paddingTop:"0.875rem"},children:y()}),"actions"in c&&c.actions&&c.actions.length>0&&(0,oe.jsx)("div",{style:{marginTop:"1rem",paddingTop:"0.75rem",borderTop:"1px solid rgba(255, 255, 255, 0.06)",display:"flex",gap:"0.5rem"},children:c.actions.map((w,k)=>(0,oe.jsx)("button",{onClick:b=>{if(b.stopPropagation(),w.href&&typeof window<"u"&&window.open(w.href,"_blank","noreferrer"),w.onClickId&&(h(w.onClickId),w.onClickId.startsWith("syntro:restart-tour:")||w.onClickId.startsWith("syntro:start-tour:"))){let E=w.onClickId.replace("syntro:restart-tour:","").replace("syntro:start-tour:","");try{localStorage.removeItem("syntro_active_tour"),localStorage.setItem("syntro_active_tour",JSON.stringify({tourId:E,currentStepId:"",startedAt:Date.now()})),console.log(`[SmartCanvas] Starting tour "${E}"...`),window.location.reload()}catch(P){console.warn("[SmartCanvas] Failed to start tour:",P)}}},style:{flex:1,padding:"0.625rem 1rem",borderRadius:"8px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",border:"none",background:k===0?g:"rgba(255, 255, 255, 0.1)",color:"#fff",transition:"opacity 0.15s ease"},onMouseEnter:b=>{b.currentTarget.style.opacity="0.85"},onMouseLeave:b=>{b.currentTarget.style.opacity="1"},children:w.label},w.label))})]})]})}var sr=ee(wt(),1),Mg=ee(bu(),1);var ve=ee(ye(),1),mS="syntro-launcher-styles";function PT(){if(typeof document>"u"||document.getElementById(mS))return;let t=document.createElement("style");t.id=mS,t.textContent=`
13
12
  @keyframes syntro-launcher-pulse {
14
13
  0%, 100% {
15
14
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35), 0 0 0 0 rgba(99, 102, 241, 0.4);
@@ -32,7 +31,7 @@ Error generating stack: `+i.message+`
32
31
  .syntro-launcher-animate:hover {
33
32
  animation: none;
34
33
  }
35
- `,document.head.appendChild(t)}var D2={position:"right",baseWidth:"clamp(320px, 16.666vw, 420px)",expandedWidth:"40vw",zIndex:2147483600,backdropBlur:"18px",mode:"dark",colorPrimary:"#6366f1",colorBackground:"#1c1c1e",colorText:"#f5f5f7",colorTextSecondary:"#a1a1a6",borderRadius:"12px"};function qb({isOpen:t,onToggle:e,telemetry:n,launcherLabel:i="Adaptives",launcherAnimate:r=!1,launcherAnimationStyle:s="pulse",footerSlot:a,tiles:o,isLoading:l,error:c,canvasTitle:u,displayMode:f="standard",theme:h,customRenderers:p}){let[y,_]=(0,hi.useState)(!1),[b,d]=(0,hi.useState)(null),g=fi(),m={...D2,...h},v=(0,hi.useCallback)(U=>{let Q=b===U;if(d(Q?null:U),g){let H=Q?In.tileCollapsed(U,"overlay"):In.tileExpanded(U,"overlay");g.events.publish(H.name,H.props,H.source)}},[b,g]);(0,hi.useEffect)(()=>{t&&o.forEach(U=>{if(n?.trackRectangleViewed(U.id,"overlay"),g){let Q=In.tileViewed(U.id,"overlay");g.events.publish(Q.name,Q.props,Q.source)}})},[n,g,t,o]),(0,hi.useEffect)(()=>{_(!0),N2()},[]);let S=(0,hi.useCallback)(()=>{let U=!t;if(U?n?.trackCanvasOpened("overlay"):n?.trackCanvasClosed("overlay"),g){let Q=U?In.canvasOpened("overlay"):In.canvasClosed("overlay");g.events.publish(Q.name,Q.props,Q.source)}e()},[t,n,g,e]),w=f==="focused",E=m.position==="right",C=m.colorBackground||"#1c1c1e",R=m.mode==="light",T=m.colorPrimary||"#6366f1",I=w?`linear-gradient(to top right, ${T}22 0%, ${C}fa 50%, ${C}fc 100%)`:`linear-gradient(to top right, ${T}33 0%, ${C}f2 45%, ${C}f7 100%)`,G=w?`linear-gradient(to top right, ${T}11 0%, ${C}fa 50%, ${C}fc 100%)`:`linear-gradient(to top right, ${T}15 0%, ${C}f2 45%, ${C}f7 100%)`,K={display:"flex",flexDirection:"column",width:w?m.expandedWidth:m.baseWidth,minWidth:"320px",height:"100%",maxHeight:"100%",background:R?G:I,backdropFilter:`blur(${m.backdropBlur})`,WebkitBackdropFilter:`blur(${m.backdropBlur})`,pointerEvents:"auto",opacity:t?1:.8,transition:"all 340ms cubic-bezier(0.16, 1, 0.3, 1)",color:m.colorText||"#f5f5f7",border:w?E?void 0:`1px solid ${R?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.06)"}`:`1px solid ${T}66`,borderLeft:w&&E?`1px solid ${R?"rgba(0, 0, 0, 0.08)":"rgba(255, 255, 255, 0.08)"}`:void 0,borderRight:w&&!E?`1px solid ${R?"rgba(0, 0, 0, 0.08)":"rgba(255, 255, 255, 0.08)"}`:void 0,borderRadius:w?"0":m.borderRadius||"24px",boxShadow:w?"none":`0 25px 80px rgba(0, 0, 0, ${R?"0.3":"0.7"}), inset 0 0 80px ${T}15`,transform:t?"translateX(0)":E?"translateX(120%)":"translateX(-120%)"},q={position:"absolute",inset:0,display:"flex",flexDirection:E?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:w?"0":"1rem"},he=(0,Ae.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:m.zIndex},children:(0,Ae.jsxs)("div",{style:q,children:[(0,Ae.jsxs)("div",{style:K,children:[!w&&(0,Ae.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,Ae.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"rgba(255, 255, 255, 0.6)"},children:u??"Smart Canvas"})}),(0,Ae.jsx)("div",{style:{flex:1,overflowY:"auto",padding:w?"0":"1.5rem"},children:l?(0,Ae.jsx)("div",{style:{color:"rgba(255, 255, 255, 0.85)",padding:w?"1rem":"0"},children:"Loading..."}):c?(0,Ae.jsxs)("div",{style:{color:"#fecdd3",padding:w?"1rem":"0"},children:["Failed to load: ",c]}):w?o.length>0?(0,Ae.jsx)(Xo,{config:o[0],surface:"overlay",telemetry:n,customRenderers:p,isExpanded:!0,onToggleExpand:()=>{},style:{width:"100%",height:"100%"}}):null:(0,Ae.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:"0.625rem",width:"100%"},children:o.map(U=>{let Q=U.size==="half",H=b===U.id;return(0,Ae.jsx)("div",{style:{gridColumn:Q&&!H?"span 1":"span 2",transition:"all 0.25s ease"},children:(0,Ae.jsx)(Xo,{config:U,surface:"overlay",telemetry:n,customRenderers:p,isExpanded:H,onToggleExpand:()=>v(U.id),style:{width:"100%"}})},U.id)})})}),a]}),(0,Ae.jsx)("div",{onClick:S,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return y?(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ph.createPortal)((0,Ae.jsx)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:m.zIndex+47},children:(0,Ae.jsxs)("button",{onClick:S,"aria-label":"Toggle shadow canvas",className:r&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",bottom:"2.5rem",right:E?"2.5rem":void 0,left:E?void 0:"2.5rem",pointerEvents:"auto",display:"flex",alignItems:"center",gap:"0.75rem",borderRadius:"18px",color:"white",boxShadow:"0 20px 45px rgba(15, 23, 42, 0.35)",transition:"transform 0.2s ease",outline:"none",padding:"0.65rem 1.25rem",border:"2px solid rgba(255, 255, 255, 0.25)",backgroundColor:"rgba(2, 6, 23, 0.8)",backdropFilter:"blur(12px)",cursor:"pointer"},onMouseEnter:U=>U.currentTarget.style.transform="translateY(-2px)",onMouseLeave:U=>U.currentTarget.style.transform="translateY(0)",children:[(0,Ae.jsx)("div",{style:{width:"36px",height:"36px",borderRadius:"12px",background:t?"linear-gradient(135deg, #f472b6, #ec4899)":"linear-gradient(135deg, #94a3b8, #0f172a)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,Ae.jsx)("span",{style:{width:"14px",height:"2px",backgroundColor:"#fff",display:"block",transform:t?"rotate(45deg)":"rotate(0)",position:"relative",transition:"transform 200ms ease"},children:t?null:(0,Ae.jsx)("span",{style:{position:"absolute",top:0,left:0,width:"14px",height:"2px",backgroundColor:"#fff",transform:"rotate(90deg)"}})})}),(0,Ae.jsxs)("div",{style:{display:"flex",flexDirection:"column",textAlign:"left"},children:[(0,Ae.jsx)("span",{style:{fontSize:"0.55rem",letterSpacing:"0.35em",color:"rgba(255,255,255,0.7)"},children:t?"Hide":"Open"}),(0,Ae.jsx)("span",{style:{fontSize:"0.85rem",letterSpacing:"0.25em"},children:i})]})]})}),document.body),t?(0,Ph.createPortal)(he,document.body):null]}):null}var or=J(bt(),1);var ar=J(xe(),1);function j4({tiles:t,intervalMs:e=7e3,telemetry:n}){let[i,r]=(0,or.useState)(0),s=(0,or.useMemo)(()=>[...t].filter(a=>a.size!=="half").sort((a,o)=>(a.order??0)-(o.order??0)),[t]);return(0,or.useEffect)(()=>{n?.trackCanvasOpened("wheel")},[n]),(0,or.useEffect)(()=>{if(s.length<=1)return;let a=setInterval(()=>{r(o=>(o+1)%s.length)},e);return()=>clearInterval(a)},[s,e]),(0,or.useEffect)(()=>{let a=s[i];a&&n?.trackRectangleViewed(a.id,"wheel")},[i,s,n]),s.length?(0,ar.jsxs)("div",{className:"relative overflow-hidden rounded-3xl border border-slate-200 bg-gradient-to-br from-white to-slate-50 p-6 shadow-2xl","data-shadow-canvas-id":"wheel",children:[(0,ar.jsx)("div",{className:"flex transition-transform duration-700 ease-out",style:{transform:`translateX(-${i*100}%)`,width:`${s.length*100}%`},children:s.map(a=>(0,ar.jsx)("div",{className:"w-full shrink-0 px-4",children:(0,ar.jsx)(Xo,{config:{...a,size:"half"},surface:"wheel",telemetry:n})},a.id))}),(0,ar.jsx)("div",{className:"mt-4 flex justify-center gap-2",children:s.map((a,o)=>(0,ar.jsx)("button",{className:`h-2 w-6 rounded-full ${o===i?"bg-slate-800":"bg-slate-300"}`,onClick:()=>r(o)},a.id))})]}):null}var Gh=class{constructor(e){F(this,"state");F(this,"listeners",new Set);this.state={open:e?.open??!1}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOpen(e){this.state.open!==e&&(this.state={...this.state,open:e},this.emit())}toggle(){this.setOpen(!this.state.open)}emit(){for(let e of this.listeners)e(this.state)}},Pb=t=>new Gh(t);var kn=J(bt(),1);var L2=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function z2(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):L2.some(r=>e.hostname===r)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function B2(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var Yh=({configUri:t,experiments:e,featureKey:n="smart-canvas-config-uri"})=>{if(t)return t;let i=e?.getFeatureValue?.(n,null);if(i)return i},da=({configUri:t,experiments:e,featureKey:n,credentials:i,configFeatureKey:r="smart-canvas-config"})=>async()=>{if(e&&r){let l=e.getFeatureValue?.(r,null);if(l&&typeof l=="object")return l}let s=Yh({configUri:t,experiments:e,featureKey:n});if(!s)return{tiles:[],overlays:[]};if(!z2(s))throw new Error(`SmartCanvas: config URI not allowed: ${s}`);let a=i??(B2(s)?"include":"omit"),o=await fetch(s,{credentials:a});if(!o.ok)throw new Error(`SmartCanvas: failed to fetch config (${o.status})`);return await o.json()};var Qo=J(xe(),1);function H2(t,e){return t?t.include?.length?t.include.some(n=>Gb(n,e)):t.exclude?.length?!t.exclude.some(n=>Gb(n,e)):!0:!0}function Gb(t,e){if(t.endsWith("/*")){let n=t.slice(0,-2);return e===n||e.startsWith(n+"/")}return e===t}function Zb({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:s="include",pollIntervalMs:a,experiments:o,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:p="include",footerSlot:y,launcherLabel:_,canvasHost:b,customRenderers:d,theme:g}){return c?(0,Qo.jsx)(jh,{runtime:c,children:(0,Qo.jsx)(Yb,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:s,pollIntervalMs:a,experiments:o,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h,overlayFetchCredentials:p,footerSlot:y,launcherLabel:_,canvasHost:b,customRenderers:d,theme:g})}):(0,Qo.jsx)(Yb,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:s,pollIntervalMs:a,experiments:o,telemetry:l,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h,overlayFetchCredentials:p,footerSlot:y,launcherLabel:_,canvasHost:b,customRenderers:d,theme:g})}function Yb({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:s="include",pollIntervalMs:a,experiments:o,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:p="include",footerSlot:y,launcherLabel:_,canvasHost:b,customRenderers:d,theme:g}){let[m,v]=(0,kn.useState)(t.getState().open),S=qh(),[w,E]=(0,kn.useState)(()=>typeof window<"u"?window.location.pathname:"/"),C=S?.url?new URL(S.url).pathname:w;(0,kn.useEffect)(()=>{if(c||typeof window>"u")return;let q=()=>E(window.location.pathname);window.addEventListener("popstate",q);let he=history.pushState,U=history.replaceState;return history.pushState=function(...Q){he.apply(this,Q),q()},history.replaceState=function(...Q){U.apply(this,Q),q()},()=>{window.removeEventListener("popstate",q),history.pushState=he,history.replaceState=U}},[c]);let R=(0,kn.useMemo)(()=>e||da({configUri:n,experiments:o,featureKey:i,configFeatureKey:r,credentials:s}),[e,n,o,i,r,s]),T=Mb({fetcher:R,pollIntervalMs:a,experiments:o,runtime:c}),I=T.tiles.length>0&&!T.error;(0,kn.useEffect)(()=>t.subscribe(q=>v(q.open)),[t]),(0,kn.useEffect)(()=>{!I&&t.getState().open&&t.setOpen(!1)},[t,I]),(0,kn.useEffect)(()=>{c?.actions&&T.actions.length>0&&c.actions.applyBatch(T.actions).catch(q=>{console.error("[SmartCanvas] Failed to apply actions:",q)})},[c,T.actions]);let G=(0,kn.useMemo)(()=>{let q=T.theme;return q?{...q,...g}:g},[T.theme,g]),K=H2(T.routes,C);return!T.isLoading&&(!I||!K)?null:(0,Qo.jsx)(qb,{tiles:T.tiles,isLoading:T.isLoading,error:T.error,canvasTitle:T.canvasTitle,telemetry:l,launcherLabel:_??T.launcher?.label,launcherAnimate:T.launcher?.animate,launcherAnimationStyle:T.launcher?.animationStyle,footerSlot:y,isOpen:m,onToggle:()=>t.toggle(),customRenderers:d,displayMode:T.displayMode,theme:G})}var ww=J(Sw(),1);var Aw=J(xe(),1),xw="smart-canvas",Ew=`
34
+ `,document.head.appendChild(t)}var IT={position:"right",baseWidth:"clamp(320px, 16.666vw, 420px)",expandedWidth:"40vw",zIndex:2147483600,backdropBlur:"18px",mode:"dark",colorPrimary:"#6366f1",colorBackground:"#1c1c1e",colorText:"#f5f5f7",colorTextSecondary:"#a1a1a6",borderRadius:"12px"};function vS({isOpen:t,onToggle:e,telemetry:n,launcherLabel:r="Adaptives",launcherAnimate:i=!1,launcherAnimationStyle:o="pulse",footerSlot:s,tiles:a,isLoading:l,error:c,canvasTitle:u,displayMode:f="standard",theme:h,customRenderers:g}){let[v,_]=(0,sr.useState)(!1),[x,d]=(0,sr.useState)(null),p=Gn(),m={...IT,...h},y=(0,sr.useCallback)(B=>{let X=x===B;if(d(X?null:B),p){let D=X?bn.tileCollapsed(B,"overlay"):bn.tileExpanded(B,"overlay");p.events.publish(D.name,D.props,D.source)}},[x,p]);(0,sr.useEffect)(()=>{t&&a.forEach(B=>{if(n?.trackRectangleViewed(B.id,"overlay"),p){let X=bn.tileViewed(B.id,"overlay");p.events.publish(X.name,X.props,X.source)}})},[n,p,t,a]),(0,sr.useEffect)(()=>{_(!0),PT()},[]);let w=(0,sr.useCallback)(()=>{let B=!t;if(B?n?.trackCanvasOpened("overlay"):n?.trackCanvasClosed("overlay"),p){let X=B?bn.canvasOpened("overlay"):bn.canvasClosed("overlay");p.events.publish(X.name,X.props,X.source)}e()},[t,n,p,e]),k=f==="focused",b=m.position==="right",E=m.colorBackground||"#1c1c1e",P=m.mode==="light",A=m.colorPrimary||"#6366f1",H=k?`linear-gradient(to top right, ${A}22 0%, ${E}fa 50%, ${E}fc 100%)`:`linear-gradient(to top right, ${A}33 0%, ${E}f2 45%, ${E}f7 100%)`,K=k?`linear-gradient(to top right, ${A}11 0%, ${E}fa 50%, ${E}fc 100%)`:`linear-gradient(to top right, ${A}15 0%, ${E}f2 45%, ${E}f7 100%)`,Y={display:"flex",flexDirection:"column",width:k?m.expandedWidth:m.baseWidth,minWidth:"320px",height:"100%",maxHeight:"100%",background:P?K:H,backdropFilter:`blur(${m.backdropBlur})`,WebkitBackdropFilter:`blur(${m.backdropBlur})`,pointerEvents:"auto",opacity:t?1:.8,transition:"all 340ms cubic-bezier(0.16, 1, 0.3, 1)",color:m.colorText||"#f5f5f7",border:k?b?void 0:`1px solid ${P?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.06)"}`:`1px solid ${A}66`,borderLeft:k&&b?`1px solid ${P?"rgba(0, 0, 0, 0.08)":"rgba(255, 255, 255, 0.08)"}`:void 0,borderRight:k&&!b?`1px solid ${P?"rgba(0, 0, 0, 0.08)":"rgba(255, 255, 255, 0.08)"}`:void 0,borderRadius:k?"0":m.borderRadius||"24px",boxShadow:k?"none":`0 25px 80px rgba(0, 0, 0, ${P?"0.3":"0.7"}), inset 0 0 80px ${A}15`,transform:t?"translateX(0)":b?"translateX(120%)":"translateX(-120%)"},W={position:"absolute",inset:0,display:"flex",flexDirection:b?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:k?"0":"1rem"},le=(0,ve.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:m.zIndex},children:(0,ve.jsxs)("div",{style:W,children:[(0,ve.jsxs)("div",{style:Y,children:[!k&&(0,ve.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,ve.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"rgba(255, 255, 255, 0.6)"},children:u??"Smart Canvas"})}),(0,ve.jsx)("div",{style:{flex:1,overflowY:"auto",padding:k?"0":"1.5rem"},children:l?(0,ve.jsx)("div",{style:{color:"rgba(255, 255, 255, 0.85)",padding:k?"1rem":"0"},children:"Loading..."}):c?(0,ve.jsxs)("div",{style:{color:"#fecdd3",padding:k?"1rem":"0"},children:["Failed to load: ",c]}):k?a.length>0?(0,ve.jsx)(Zs,{config:a[0],surface:"overlay",telemetry:n,customRenderers:g,isExpanded:!0,onToggleExpand:()=>{},style:{width:"100%",height:"100%"}}):null:(0,ve.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:"0.625rem",width:"100%"},children:a.map(B=>{let X=B.size==="half",D=x===B.id;return(0,ve.jsx)("div",{style:{gridColumn:X&&!D?"span 1":"span 2",transition:"all 0.25s ease"},children:(0,ve.jsx)(Zs,{config:B,surface:"overlay",telemetry:n,customRenderers:g,isExpanded:D,onToggleExpand:()=>y(B.id),style:{width:"100%"}})},B.id)})})}),s]}),(0,ve.jsx)("div",{onClick:w,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return v?(0,ve.jsxs)(ve.Fragment,{children:[(0,Mg.createPortal)((0,ve.jsx)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:m.zIndex+47},children:(0,ve.jsxs)("button",{onClick:w,"aria-label":"Toggle shadow canvas",className:i&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",bottom:"2.5rem",right:b?"2.5rem":void 0,left:b?void 0:"2.5rem",pointerEvents:"auto",display:"flex",alignItems:"center",gap:"0.75rem",borderRadius:"18px",color:"white",boxShadow:"0 20px 45px rgba(15, 23, 42, 0.35)",transition:"transform 0.2s ease",outline:"none",padding:"0.65rem 1.25rem",border:"2px solid rgba(255, 255, 255, 0.25)",backgroundColor:"rgba(2, 6, 23, 0.8)",backdropFilter:"blur(12px)",cursor:"pointer"},onMouseEnter:B=>B.currentTarget.style.transform="translateY(-2px)",onMouseLeave:B=>B.currentTarget.style.transform="translateY(0)",children:[(0,ve.jsx)("div",{style:{width:"36px",height:"36px",borderRadius:"12px",background:t?"linear-gradient(135deg, #f472b6, #ec4899)":"linear-gradient(135deg, #94a3b8, #0f172a)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,ve.jsx)("span",{style:{width:"14px",height:"2px",backgroundColor:"#fff",display:"block",transform:t?"rotate(45deg)":"rotate(0)",position:"relative",transition:"transform 200ms ease"},children:t?null:(0,ve.jsx)("span",{style:{position:"absolute",top:0,left:0,width:"14px",height:"2px",backgroundColor:"#fff",transform:"rotate(90deg)"}})})}),(0,ve.jsxs)("div",{style:{display:"flex",flexDirection:"column",textAlign:"left"},children:[(0,ve.jsx)("span",{style:{fontSize:"0.55rem",letterSpacing:"0.35em",color:"rgba(255,255,255,0.7)"},children:t?"Hide":"Open"}),(0,ve.jsx)("span",{style:{fontSize:"0.85rem",letterSpacing:"0.25em"},children:r})]})]})}),document.body),t?(0,Mg.createPortal)(le,document.body):null]}):null}var Jr=ee(wt(),1);var Qr=ee(ye(),1);function fL({tiles:t,intervalMs:e=7e3,telemetry:n}){let[r,i]=(0,Jr.useState)(0),o=(0,Jr.useMemo)(()=>[...t].filter(s=>s.size!=="half").sort((s,a)=>(s.order??0)-(a.order??0)),[t]);return(0,Jr.useEffect)(()=>{n?.trackCanvasOpened("wheel")},[n]),(0,Jr.useEffect)(()=>{if(o.length<=1)return;let s=setInterval(()=>{i(a=>(a+1)%o.length)},e);return()=>clearInterval(s)},[o,e]),(0,Jr.useEffect)(()=>{let s=o[r];s&&n?.trackRectangleViewed(s.id,"wheel")},[r,o,n]),o.length?(0,Qr.jsxs)("div",{className:"relative overflow-hidden rounded-3xl border border-slate-200 bg-gradient-to-br from-white to-slate-50 p-6 shadow-2xl","data-shadow-canvas-id":"wheel",children:[(0,Qr.jsx)("div",{className:"flex transition-transform duration-700 ease-out",style:{transform:`translateX(-${r*100}%)`,width:`${o.length*100}%`},children:o.map(s=>(0,Qr.jsx)("div",{className:"w-full shrink-0 px-4",children:(0,Qr.jsx)(Zs,{config:{...s,size:"half"},surface:"wheel",telemetry:n})},s.id))}),(0,Qr.jsx)("div",{className:"mt-4 flex justify-center gap-2",children:o.map((s,a)=>(0,Qr.jsx)("button",{className:`h-2 w-6 rounded-full ${a===r?"bg-slate-800":"bg-slate-300"}`,onClick:()=>i(a)},s.id))})]}):null}var Fg=class{constructor(e){j(this,"state");j(this,"listeners",new Set);this.state={open:e?.open??!1}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOpen(e){this.state.open!==e&&(this.state={...this.state,open:e},this.emit())}toggle(){this.setOpen(!this.state.open)}emit(){for(let e of this.listeners)e(this.state)}},yS=t=>new Fg(t);var pn=ee(wt(),1);var OT=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function NT(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):OT.some(i=>e.hostname===i)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function LT(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var $g=({configUri:t,experiments:e,featureKey:n="smart-canvas-config-uri"})=>{if(t)return t;let r=e?.getFeatureValue?.(n,null);if(r)return r},es=({configUri:t,experiments:e,featureKey:n,credentials:r,configFeatureKey:i="smart-canvas-config"})=>async()=>{if(e&&i){let l=e.getFeatureValue?.(i,null);if(l&&typeof l=="object")return l}let o=$g({configUri:t,experiments:e,featureKey:n});if(!o)return{tiles:[],overlays:[]};if(!NT(o))throw new Error(`SmartCanvas: config URI not allowed: ${o}`);let s=r??(LT(o)?"include":"omit"),a=await fetch(o,{credentials:s});if(!a.ok)throw new Error(`SmartCanvas: failed to fetch config (${a.status})`);return await a.json()};var za=ee(ye(),1);function MT(t,e){return t?t.include?.length?t.include.some(n=>_S(n,e)):t.exclude?.length?!t.exclude.some(n=>_S(n,e)):!0:!0}function _S(t,e){if(t.endsWith("/*")){let n=t.slice(0,-2);return e===n||e.startsWith(n+"/")}return e===t}function xS({controller:t,fetcher:e,configUri:n,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:i="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:s,experiments:a,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p}){return c?(0,za.jsx)(wp,{runtime:c,children:(0,za.jsx)(wS,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:r,configFeatureKey:i,fetchCredentials:o,pollIntervalMs:s,experiments:a,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p})}):(0,za.jsx)(wS,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:r,configFeatureKey:i,fetchCredentials:o,pollIntervalMs:s,experiments:a,telemetry:l,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p})}function wS({controller:t,fetcher:e,configUri:n,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:i="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:s,experiments:a,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p}){let[m,y]=(0,pn.useState)(t.getState().open),w=xp(),[k,b]=(0,pn.useState)(()=>typeof window<"u"?window.location.pathname:"/"),E=w?.url?new URL(w.url).pathname:k;(0,pn.useEffect)(()=>{if(c||typeof window>"u")return;let W=()=>b(window.location.pathname);window.addEventListener("popstate",W);let le=history.pushState,B=history.replaceState;return history.pushState=function(...X){le.apply(this,X),W()},history.replaceState=function(...X){B.apply(this,X),W()},()=>{window.removeEventListener("popstate",W),history.pushState=le,history.replaceState=B}},[c]);let P=(0,pn.useMemo)(()=>e||es({configUri:n,experiments:a,featureKey:r,configFeatureKey:i,credentials:o}),[e,n,a,r,i,o]),A=U_({fetcher:P,pollIntervalMs:s,experiments:a,runtime:c}),H=A.tiles.length>0&&!A.error;(0,pn.useEffect)(()=>t.subscribe(W=>y(W.open)),[t]),(0,pn.useEffect)(()=>{!H&&t.getState().open&&t.setOpen(!1)},[t,H]),(0,pn.useEffect)(()=>{c?.actions&&A.actions.length>0&&c.actions.applyBatch(A.actions).catch(W=>{console.error("[SmartCanvas] Failed to apply actions:",W)})},[c,A.actions]);let K=(0,pn.useMemo)(()=>{let W=A.theme;return W?{...W,...p}:p},[A.theme,p]),Y=MT(A.routes,E);return!A.isLoading&&(!H||!Y)?null:(0,za.jsx)(vS,{tiles:A.tiles,isLoading:A.isLoading,error:A.error,canvasTitle:A.canvasTitle,telemetry:l,launcherLabel:_??A.launcher?.label,launcherAnimate:A.launcher?.animate,launcherAnimationStyle:A.launcher?.animationStyle,footerSlot:v,isOpen:m,onToggle:()=>t.toggle(),customRenderers:d,displayMode:A.displayMode,theme:K})}var CS=ee(bS(),1);var RS=ee(ye(),1),kS="smart-canvas",ES=`
36
35
  :host {
37
36
  font: inherit;
38
37
  color: inherit;
@@ -45,25 +44,25 @@ Error generating stack: `+i.message+`
45
44
  *, *::before, *::after {
46
45
  box-sizing: border-box;
47
46
  }
48
- `,uN=()=>{let t="smartcanvas-overlays",e=document.getElementById(t);return e||(e=document.createElement("div"),e.id=t,e.setAttribute("data-smart-canvas-overlay","true"),document.body?document.body.appendChild(e):document.addEventListener("DOMContentLoaded",()=>{e.parentNode||document.body.appendChild(e)},{once:!0})),e},zr,Br,Jl,zi,Hr,Bi,no,Av=class extends HTMLElement{constructor(){super();Gi(this,zr);Gi(this,Br);Gi(this,Jl);Gi(this,zi);Gi(this,Hr,null);Gi(this,Bi,null);Gi(this,no,{});Ln(this,zr,this.attachShadow({mode:"open",delegatesFocus:!0})),Ln(this,Br,document.createElement("div")),Ne(this,Br).setAttribute("part","mount"),Ne(this,zr).appendChild(Ne(this,Br)),Ln(this,Jl,uN()),Ln(this,zi,Pb()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){Ne(this,Hr)?.unmount(),Ln(this,Hr,null)}getMountNode(){return Ne(this,Br)}getController(){return Ne(this,zi)}getOverlayRoot(){return Ne(this,Jl)}open(){Ne(this,zi).setOpen(!0)}close(){Ne(this,zi).setOpen(!1)}toggle(){Ne(this,zi).toggle()}registerComponent(n,i){Ln(this,no,{...Ne(this,no),[n]:i}),this.render()}setOverrideFetcher(n){Ne(this,Bi)&&(Ln(this,Bi,{...Ne(this,Bi),fetcher:n}),this.render())}mountReactApp(n){Ln(this,Bi,n),this.render()}render(){!this.isConnected||!Ne(this,Bi)||(Ne(this,Hr)||Ln(this,Hr,(0,ww.createRoot)(Ne(this,Br))),Ne(this,Hr).render((0,Aw.jsx)(Zb,{...Ne(this,Bi),controller:Ne(this,zi),canvasHost:this,customRenderers:Ne(this,no)})))}applyBaseStyles(){if(Ne(this,zr).adoptedStyleSheets!==void 0){let n=new CSSStyleSheet;n.replaceSync(Ew),Ne(this,zr).adoptedStyleSheets=[n]}else{let n=document.createElement("style");n.textContent=Ew,Ne(this,zr).appendChild(n)}}};zr=new WeakMap,Br=new WeakMap,Jl=new WeakMap,zi=new WeakMap,Hr=new WeakMap,Bi=new WeakMap,no=new WeakMap;var Cw=()=>{typeof window>"u"||customElements.get(xw)||customElements.define(xw,Av)};var Pd=J(bt(),1),kw=J(mu(),1);function dz({element:t,children:e}){let[n,i]=(0,Pd.useState)(null);return(0,Pd.useLayoutEffect)(()=>{if(!t){i(null);return}return i(t.getMountNode()),()=>i(null)},[t]),n?(0,kw.createPortal)(e,n):null}var Tw={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important"};function Rw(t={}){let{timeout:e,className:n,style:i}={...Tw,...t},r=document.createElement("style");r.textContent=`.${n} { ${i} }`,document.head.appendChild(r),document.documentElement.classList.add(n);let s=setTimeout(()=>{document.documentElement.classList.remove(n)},e);return()=>{clearTimeout(s),document.documentElement.classList.remove(n),r.remove()}}function dN(t={}){let{className:e,style:n}={...Tw,...t};return`
47
+ `,FT=()=>{let t="smartcanvas-overlays",e=document.getElementById(t);return e||(e=document.createElement("div"),e.id=t,e.setAttribute("data-smart-canvas-overlay","true"),document.body?document.body.appendChild(e):document.addEventListener("DOMContentLoaded",()=>{e.parentNode||document.body.appendChild(e)},{once:!0})),e},ei,ti,Ha,ar,ni,lr,ts,Bg=class extends HTMLElement{constructor(){super();yr(this,ei);yr(this,ti);yr(this,Ha);yr(this,ar);yr(this,ni,null);yr(this,lr,null);yr(this,ts,{});mn(this,ei,this.attachShadow({mode:"open",delegatesFocus:!0})),mn(this,ti,document.createElement("div")),xe(this,ti).setAttribute("part","mount"),xe(this,ei).appendChild(xe(this,ti)),mn(this,Ha,FT()),mn(this,ar,yS()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){xe(this,ni)?.unmount(),mn(this,ni,null)}getMountNode(){return xe(this,ti)}getController(){return xe(this,ar)}getOverlayRoot(){return xe(this,Ha)}open(){xe(this,ar).setOpen(!0)}close(){xe(this,ar).setOpen(!1)}toggle(){xe(this,ar).toggle()}registerComponent(n,r){mn(this,ts,{...xe(this,ts),[n]:r}),this.render()}setOverrideFetcher(n){xe(this,lr)&&(mn(this,lr,{...xe(this,lr),fetcher:n}),this.render())}mountReactApp(n){mn(this,lr,n),this.render()}render(){!this.isConnected||!xe(this,lr)||(xe(this,ni)||mn(this,ni,(0,CS.createRoot)(xe(this,ti))),xe(this,ni).render((0,RS.jsx)(xS,{...xe(this,lr),controller:xe(this,ar),canvasHost:this,customRenderers:xe(this,ts)})))}applyBaseStyles(){if(xe(this,ei).adoptedStyleSheets!==void 0){let n=new CSSStyleSheet;n.replaceSync(ES),xe(this,ei).adoptedStyleSheets=[n]}else{let n=document.createElement("style");n.textContent=ES,xe(this,ei).appendChild(n)}}};ei=new WeakMap,ti=new WeakMap,Ha=new WeakMap,ar=new WeakMap,ni=new WeakMap,lr=new WeakMap,ts=new WeakMap;var AS=()=>{typeof window>"u"||customElements.get(kS)||customElements.define(kS,Bg)};var ku=ee(wt(),1),TS=ee(bu(),1);function OL({element:t,children:e}){let[n,r]=(0,ku.useState)(null);return(0,ku.useLayoutEffect)(()=>{if(!t){r(null);return}return r(t.getMountNode()),()=>r(null)},[t]),n?(0,TS.createPortal)(e,n):null}var PS={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important"};function IS(t={}){let{timeout:e,className:n,style:r}={...PS,...t},i=document.createElement("style");i.textContent=`.${n} { ${r} }`,document.head.appendChild(i),document.documentElement.classList.add(n);let o=setTimeout(()=>{document.documentElement.classList.remove(n)},e);return()=>{clearTimeout(o),document.documentElement.classList.remove(n),i.remove()}}function $T(t={}){let{className:e,style:n}={...PS,...t};return`
49
48
  (function() {
50
49
  var s = document.createElement('style');
51
50
  s.textContent = '.${e} { ${n} }';
52
51
  document.head.appendChild(s);
53
52
  document.documentElement.className += ' ${e}';
54
- })();`}var kv=!1;function Ow(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function Tv(t){if(Ow()){kv=!0;return}kv=t??!1}function fN(){return Ow()?!0:kv}function V(t,e,n){fN()&&(n!==void 0?console.log(`[${t}]`,e,n):console.log(`[${t}]`,e))}function rn(t,e,n){n!==void 0?console.warn(`[${t}]`,e,n):console.warn(`[${t}]`,e)}function Gd(t,e,n){n!==void 0?console.error(`[${t}]`,e,n):console.error(`[${t}]`,e)}var Mw="https://cdn.syntrologie.com/editor-sdk/latest/editor-sdk.js",Nw=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function pN(t){V("Syntro Runtime","Validating editor URL:",t);try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);if(V("Syntro Runtime","Parsed URL:",{hostname:e.hostname,protocol:e.protocol,isLocalhost:n}),e.protocol!=="https:"&&!n)return rn("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1;let i=Nw.some(r=>r.startsWith(".")?e.hostname.endsWith(r)||e.hostname===r.slice(1):e.hostname===r);return V("Syntro Runtime","Host allowlist check:",{hostname:e.hostname,allowedHosts:Nw,isAllowed:i}),i?(V("Syntro Runtime","\u2713 Editor URL validated"),!0):(rn("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return rn("Syntro Runtime","\u274C Invalid editor URL: "+t,e),!1}}var hN=()=>{if(V("Syntro Runtime","====== EDITOR LOAD CHECK ======"),typeof window>"u")return V("Syntro Runtime","Not in browser - skipping editor"),!1;let t=new URLSearchParams(window.location.search);V("Syntro Runtime","URL:",window.location.href),V("Syntro Runtime","Search params:",window.location.search);let e=t.has("syntro_editor")||t.has("syntro-editor"),n=t.has("editor_token");if(V("Syntro Runtime","Editor flags:",{hasEditorFlag:e,hasEditorToken:n,syntro_editor:t.get("syntro_editor"),"syntro-editor":t.get("syntro-editor"),editor_token:n?`${t.get("editor_token")?.slice(0,10)}...`:"none"}),e&&!n)return rn("Syntro Runtime","\u274C Editor activation requires editor_token parameter"),V("Syntro Runtime","================================"),!1;let i=e&&n;return V("Syntro Runtime","Should load editor:",i),V("Syntro Runtime","================================"),i},gN=()=>{if(V("Syntro Runtime","====== AUDIT MODE CHECK ======"),typeof window>"u")return V("Syntro Runtime","Not in browser - skipping audit"),!1;let t=new URLSearchParams(window.location.search),e=t.has("syntro_audit"),n=t.has("audit_token"),i=t.get("audit_session_id");return V("Syntro Runtime","Audit flags:",{hasAuditFlag:e,hasAuditToken:n,auditSessionId:i?`${i.slice(0,8)}...`:"none",audit_token:n?`${t.get("audit_token")?.slice(0,10)}...`:"none"}),e?n?(V("Syntro Runtime","\u2713 Audit mode active"),V("Syntro Runtime","================================"),!0):(rn("Syntro Runtime","\u274C Audit activation requires audit_token parameter"),V("Syntro Runtime","================================"),!1):(V("Syntro Runtime","No syntro_audit param - not in audit mode"),V("Syntro Runtime","================================"),!1)},Dw=()=>hN()?"editor":gN()?"audit":null;function mN(){if(typeof window>"u")return null;let t=new URLSearchParams(window.location.search);return t.get("editor_token")||t.get("audit_token")}var Lw=async t=>{if(V("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){V("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){V("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}let e=typeof t=="string"?{editorUrl:t}:t??{},n=new URLSearchParams(window.location.search),i=n.get("syntro_editor_sdk_url"),r=n.get("api_base"),s=r?`${r}/api/editor/sdk/editor-sdk.js`:null,a=i||s||e.editorUrl||Mw,o=mN();if(!o){rn("Syntro Runtime","\u274C No token found in URL params. SDK requires editor_token or audit_token."),V("Syntro Runtime","================================");return}let l=`${a}?token=${encodeURIComponent(o)}`;if(V("Syntro Runtime","Editor URL:",l),V("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,isDefault:a===Mw,hasApiBase:!!r,tokenPrefix:o.slice(0,10)+"..."}),!pN(a)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",a),V("Syntro Runtime","================================");return}return V("Syntro Runtime","\u2713 URL validated, injecting script tag..."),new Promise((c,u)=>{let f=document.createElement("script");f.src=l,f.async=!0,e.integrity&&(f.integrity=e.integrity,f.crossOrigin="anonymous",V("Syntro Runtime","SRI integrity check enabled")),f.onload=()=>{V("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),V("Syntro Runtime","window.SyntroEditor:",!!window.SyntroEditor),V("Syntro Runtime","================================"),c()},f.onerror=h=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",h),console.error("[Syntro Runtime] URL attempted:",l),console.error("[Syntro Runtime] Check: Is the URL accessible? CORS? Network? Token valid?"),V("Syntro Runtime","================================"),u(h)},document.head.appendChild(f),V("Syntro Runtime","Script tag appended to <head>")})};var Rv=async(t={})=>{if(typeof window>"u"||typeof document>"u")throw new Error("SmartCanvas can only be created in a browser-like environment");let e=null;if(t.antiFlicker){let d=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=Rw(d)}let n=null,i=null,r=null,s=!0,a=t.runtime;async function o(d){!a?.actions||d.length===0||(r?.isApplied()&&await r.revertAll(),r=await a.actions.applyBatch(d))}async function l(){r?.isApplied()&&(await r.revertAll(),r=null)}if(t.fetcher)try{i=t.fetcher;let d=await t.fetcher();n=d,d.actions.length>0&&a?.actions&&await o(d.actions)}catch(d){console.error("[SmartCanvas] Error fetching/applying initial config:",d)}e&&e();let c=Dw();c&&(console.log(`[SmartCanvas] Loading editor SDK for ${c} mode`),Lw(t.editorUrl).catch(console.error)),Cw();let u=document.createElement("smart-canvas");if(t.tokens)for(let[d,g]of Object.entries(t.tokens))u.style.setProperty(d,g);let f=()=>{let d=t.target??document.body;d&&d.appendChild(u)};document.body?f():document.addEventListener("DOMContentLoaded",f,{once:!0});let h=t.integrations?.experiments,p=t.integrations?.telemetry,y=t.fetcher??da({configUri:t.configUri,experiments:h,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});i||(i=y);let _={fetcher:y,pollIntervalMs:t.pollIntervalMs,experiments:h,telemetry:p,runtime:a,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,theme:t.theme};u.mountReactApp(_),t.defaultOpen&&u.open();let b={el:u,open:()=>u.open(),close:()=>u.close(),destroy:()=>{l(),u.remove()},setTokens:d=>{for(let[g,m]of Object.entries(d))u.style.setProperty(g,m)},getConfig:async()=>{if(i)try{let d=await i();return n=d,d}catch(d){console.error("[SmartCanvas] Error fetching config:",d)}return n},updateConfig:async d=>{n=d,s&&await o(d.actions)},setEnabled:async d=>{s=d,d?n&&await o(n.actions):await l()},registerComponent:(d,g)=>u.registerComponent(d,g),setOverrideFetcher:d=>{i=d,u.setOverrideFetcher(d)},registerTelemetryProperties:d=>{p?.register?.(d)},getSessionId:()=>p?.getSessionId?.(),startSessionRecording:()=>{p?.startSessionRecording?.()},runtime:a};return typeof window<"u"&&c&&(window.__smartCanvasHandle=b),b};typeof window<"u"&&(window.SmartCanvas={async create(t){return Rv(t)}});var x={};WA(x,{BRAND:()=>FN,DIRTY:()=>_s,EMPTY_PATH:()=>bN,INVALID:()=>j,NEVER:()=>A5,OK:()=>xt,ParseStatus:()=>yt,Schema:()=>ne,ZodAny:()=>Vr,ZodArray:()=>Vi,ZodBigInt:()=>Ss,ZodBoolean:()=>xs,ZodBranded:()=>tc,ZodCatch:()=>Ds,ZodDate:()=>Es,ZodDefault:()=>Ns,ZodDiscriminatedUnion:()=>Wd,ZodEffects:()=>xn,ZodEnum:()=>Os,ZodError:()=>Ft,ZodFirstPartyTypeKind:()=>P,ZodFunction:()=>Kd,ZodIntersection:()=>ks,ZodIssueCode:()=>O,ZodLazy:()=>Ts,ZodLiteral:()=>Rs,ZodMap:()=>lo,ZodNaN:()=>uo,ZodNativeEnum:()=>Ms,ZodNever:()=>Mn,ZodNull:()=>Cs,ZodNullable:()=>Kn,ZodNumber:()=>bs,ZodObject:()=>jt,ZodOptional:()=>bn,ZodParsedType:()=>z,ZodPipeline:()=>nc,ZodPromise:()=>Ir,ZodReadonly:()=>Ls,ZodRecord:()=>Xd,ZodSchema:()=>ne,ZodSet:()=>co,ZodString:()=>$r,ZodSymbol:()=>ao,ZodTransformer:()=>xn,ZodTuple:()=>Xn,ZodType:()=>ne,ZodUndefined:()=>ws,ZodUnion:()=>As,ZodUnknown:()=>$i,ZodVoid:()=>oo,addIssueToContext:()=>M,any:()=>KN,array:()=>t5,bigint:()=>GN,boolean:()=>Pw,coerce:()=>C5,custom:()=>Fw,date:()=>YN,datetimeRegex:()=>Vw,defaultErrorMap:()=>Hi,discriminatedUnion:()=>s5,effect:()=>v5,enum:()=>h5,function:()=>d5,getErrorMap:()=>io,getParsedType:()=>Wn,instanceof:()=>qN,intersection:()=>a5,isAborted:()=>Yd,isAsync:()=>ro,isDirty:()=>Zd,isValid:()=>Ur,late:()=>jN,lazy:()=>f5,literal:()=>p5,makeIssue:()=>ec,map:()=>c5,nan:()=>PN,nativeEnum:()=>g5,never:()=>JN,null:()=>XN,nullable:()=>_5,number:()=>qw,object:()=>n5,objectUtil:()=>Ov,oboolean:()=>w5,onumber:()=>E5,optional:()=>y5,ostring:()=>x5,pipeline:()=>S5,preprocess:()=>b5,promise:()=>m5,quotelessJson:()=>vN,record:()=>l5,set:()=>u5,setErrorMap:()=>_N,strictObject:()=>i5,string:()=>jw,symbol:()=>ZN,transformer:()=>v5,tuple:()=>o5,undefined:()=>WN,union:()=>r5,unknown:()=>QN,util:()=>ae,void:()=>e5});var ae;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{let s={};for(let a of r)s[a]=a;return s},t.getValidEnumValues=r=>{let s=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),a={};for(let o of s)a[o]=r[o];return t.objectValues(a)},t.objectValues=r=>t.objectKeys(r).map(function(s){return r[s]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let s=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&s.push(a);return s},t.find=(r,s)=>{for(let a of r)if(s(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,s=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=i,t.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(ae||(ae={}));var Ov;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ov||(Ov={}));var z=ae.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Wn=t=>{switch(typeof t){case"undefined":return z.undefined;case"string":return z.string;case"number":return Number.isNaN(t)?z.nan:z.number;case"boolean":return z.boolean;case"function":return z.function;case"bigint":return z.bigint;case"symbol":return z.symbol;case"object":return Array.isArray(t)?z.array:t===null?z.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?z.promise:typeof Map<"u"&&t instanceof Map?z.map:typeof Set<"u"&&t instanceof Set?z.set:typeof Date<"u"&&t instanceof Date?z.date:z.object;default:return z.unknown}};var O=ae.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"]),vN=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Ft=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(s){return s.message},i={_errors:[]},r=s=>{for(let a of s.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 o=i,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(a))):o[c]=o[c]||{_errors:[]},o=o[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,ae.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 s=r.path[0];n[s]=n[s]||[],n[s].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Ft.create=t=>new Ft(t);var yN=(t,e)=>{let n;switch(t.code){case O.invalid_type:t.received===z.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case O.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ae.jsonStringifyReplacer)}`;break;case O.unrecognized_keys:n=`Unrecognized key(s) in object: ${ae.joinValues(t.keys,", ")}`;break;case O.invalid_union:n="Invalid input";break;case O.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ae.joinValues(t.options)}`;break;case O.invalid_enum_value:n=`Invalid enum value. Expected ${ae.joinValues(t.options)}, received '${t.received}'`;break;case O.invalid_arguments:n="Invalid function arguments";break;case O.invalid_return_type:n="Invalid function return type";break;case O.invalid_date:n="Invalid date";break;case O.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}"`:ae.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case O.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 O.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 O.custom:n="Invalid input";break;case O.invalid_intersection_types:n="Intersection results could not be merged";break;case O.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case O.not_finite:n="Number must be finite";break;default:n=e.defaultError,ae.assertNever(t)}return{message:n}},Hi=yN;var zw=Hi;function _N(t){zw=t}function io(){return zw}var ec=t=>{let{data:e,path:n,errorMaps:i,issueData:r}=t,s=[...n,...r.path||[]],a={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let o="",l=i.filter(c=>!!c).slice().reverse();for(let c of l)o=c(a,{data:e,defaultError:o}).message;return{...r,path:s,message:o}},bN=[];function M(t,e){let n=io(),i=ec({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Hi?void 0:Hi].filter(r=>!!r)});t.common.issues.push(i)}var yt=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 j;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 s=await r.key,a=await r.value;i.push({key:s,value:a})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,n){let i={};for(let r of n){let{key:s,value:a}=r;if(s.status==="aborted"||a.status==="aborted")return j;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[s.value]=a.value)}return{status:e.value,value:i}}},j=Object.freeze({status:"aborted"}),_s=t=>({status:"dirty",value:t}),xt=t=>({status:"valid",value:t}),Yd=t=>t.status==="aborted",Zd=t=>t.status==="dirty",Ur=t=>t.status==="valid",ro=t=>typeof Promise<"u"&&t instanceof Promise;var $;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})($||($={}));var Sn=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}},Bw=(t,e)=>{if(Ur(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 Ft(t.common.issues);return this._error=n,this._error}}};function te(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,o)=>{let{message:l}=t;return a.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??i??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:r}}var ne=class{get description(){return this._def.description}_getType(e){return Wn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Wn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new yt,ctx:{common:e.parent.common,data:e.data,parsedType:Wn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(ro(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:Wn(e)},r=this._parseSync({data:e,path:i.path,parent:i});return Bw(i,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wn(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:n});return Ur(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=>Ur(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:Wn(e)},r=this._parse({data:e,path:i.path,parent:i}),s=await(ro(r)?r:Promise.resolve(r));return Bw(i,s)}refine(e,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,s)=>{let a=e(r),o=()=>s.addIssue({code:O.custom,...i(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!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 xn({schema:this,typeName:P.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 bn.create(this,this._def)}nullable(){return Kn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vi.create(this)}promise(){return Ir.create(this,this._def)}or(e){return As.create([this,e],this._def)}and(e){return ks.create(this,e,this._def)}transform(e){return new xn({...te(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Ns({...te(this._def),innerType:this,defaultValue:n,typeName:P.ZodDefault})}brand(){return new tc({typeName:P.ZodBranded,type:this,...te(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Ds({...te(this._def),innerType:this,catchValue:n,typeName:P.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return nc.create(this,e)}readonly(){return Ls.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},SN=/^c[^\s-]{8,}$/i,xN=/^[0-9a-z]+$/,EN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,wN=/^[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,CN=/^[a-z0-9_-]{21}$/i,AN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,kN=/^[-+]?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)?)??$/,TN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,RN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Mv,ON=/^(?:(?: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])$/,MN=/^(?:(?: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])$/,NN=/^(([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]))$/,DN=/^(([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])$/,LN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,zN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Uw="((\\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])))",BN=new RegExp(`^${Uw}$`);function $w(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 HN(t){return new RegExp(`^${$w(t)}$`)}function Vw(t){let e=`${Uw}T${$w(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 UN(t,e){return!!((e==="v4"||!e)&&ON.test(t)||(e==="v6"||!e)&&NN.test(t))}function $N(t,e){if(!AN.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 VN(t,e){return!!((e==="v4"||!e)&&MN.test(t)||(e==="v6"||!e)&&DN.test(t))}var $r=class t extends ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==z.string){let s=this._getOrReturnCtx(e);return M(s,{code:O.invalid_type,expected:z.string,received:s.parsedType}),j}let i=new yt,r;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),M(r,{code:O.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),M(r,{code:O.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(r=this._getOrReturnCtx(e,r),a?M(r,{code:O.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&M(r,{code:O.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")TN.test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"email",code:O.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")Mv||(Mv=new RegExp(RN,"u")),Mv.test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"emoji",code:O.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")wN.test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"uuid",code:O.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")CN.test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"nanoid",code:O.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")SN.test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"cuid",code:O.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")xN.test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"cuid2",code:O.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")EN.test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"ulid",code:O.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),M(r,{validation:"url",code:O.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"regex",code:O.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),M(r,{code:O.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),M(r,{code:O.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),M(r,{code:O.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?Vw(s).test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{code:O.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?BN.test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{code:O.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?HN(s).test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{code:O.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?kN.test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"duration",code:O.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?UN(e.data,s.version)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"ip",code:O.invalid_string,message:s.message}),i.dirty()):s.kind==="jwt"?$N(e.data,s.alg)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"jwt",code:O.invalid_string,message:s.message}),i.dirty()):s.kind==="cidr"?VN(e.data,s.version)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"cidr",code:O.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?LN.test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"base64",code:O.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?zN.test(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{validation:"base64url",code:O.invalid_string,message:s.message}),i.dirty()):ae.assertNever(s);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:O.invalid_string,...$.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...$.errToObj(e)})}url(e){return this._addCheck({kind:"url",...$.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...$.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...$.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...$.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...$.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...$.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...$.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...$.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...$.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...$.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...$.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...$.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,...$.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,...$.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...$.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...$.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...$.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...$.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...$.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...$.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...$.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...$.errToObj(n)})}nonempty(e){return this.min(1,$.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}};$r.create=t=>new $r({checks:[],typeName:P.ZodString,coerce:t?.coerce??!1,...te(t)});function IN(t,e){let n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,s=Number.parseInt(t.toFixed(r).replace(".","")),a=Number.parseInt(e.toFixed(r).replace(".",""));return s%a/10**r}var bs=class t extends ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==z.number){let s=this._getOrReturnCtx(e);return M(s,{code:O.invalid_type,expected:z.number,received:s.parsedType}),j}let i,r=new yt;for(let s of this._def.checks)s.kind==="int"?ae.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{code:O.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),M(i,{code:O.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),M(i,{code:O.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?IN(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),M(i,{code:O.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{code:O.not_finite,message:s.message}),r.dirty()):ae.assertNever(s);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,$.toString(n))}gt(e,n){return this.setLimit("min",e,!1,$.toString(n))}lte(e,n){return this.setLimit("max",e,!0,$.toString(n))}lt(e,n){return this.setLimit("max",e,!1,$.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:$.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:$.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:$.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:$.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.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"&&ae.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)}};bs.create=t=>new bs({checks:[],typeName:P.ZodNumber,coerce:t?.coerce||!1,...te(t)});var Ss=class t extends ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==z.bigint)return this._getInvalidInput(e);let i,r=new yt;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),M(i,{code:O.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),M(i,{code:O.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),M(i,{code:O.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):ae.assertNever(s);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return M(n,{code:O.invalid_type,expected:z.bigint,received:n.parsedType}),j}gte(e,n){return this.setLimit("min",e,!0,$.toString(n))}gt(e,n){return this.setLimit("min",e,!1,$.toString(n))}lte(e,n){return this.setLimit("max",e,!0,$.toString(n))}lt(e,n){return this.setLimit("max",e,!1,$.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:$.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:$.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:$.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}};Ss.create=t=>new Ss({checks:[],typeName:P.ZodBigInt,coerce:t?.coerce??!1,...te(t)});var xs=class extends ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==z.boolean){let i=this._getOrReturnCtx(e);return M(i,{code:O.invalid_type,expected:z.boolean,received:i.parsedType}),j}return xt(e.data)}};xs.create=t=>new xs({typeName:P.ZodBoolean,coerce:t?.coerce||!1,...te(t)});var Es=class t extends ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==z.date){let s=this._getOrReturnCtx(e);return M(s,{code:O.invalid_type,expected:z.date,received:s.parsedType}),j}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return M(s,{code:O.invalid_date}),j}let i=new yt,r;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),M(r,{code:O.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),M(r,{code:O.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):ae.assertNever(s);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:$.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:$.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}};Es.create=t=>new Es({checks:[],coerce:t?.coerce||!1,typeName:P.ZodDate,...te(t)});var ao=class extends ne{_parse(e){if(this._getType(e)!==z.symbol){let i=this._getOrReturnCtx(e);return M(i,{code:O.invalid_type,expected:z.symbol,received:i.parsedType}),j}return xt(e.data)}};ao.create=t=>new ao({typeName:P.ZodSymbol,...te(t)});var ws=class extends ne{_parse(e){if(this._getType(e)!==z.undefined){let i=this._getOrReturnCtx(e);return M(i,{code:O.invalid_type,expected:z.undefined,received:i.parsedType}),j}return xt(e.data)}};ws.create=t=>new ws({typeName:P.ZodUndefined,...te(t)});var Cs=class extends ne{_parse(e){if(this._getType(e)!==z.null){let i=this._getOrReturnCtx(e);return M(i,{code:O.invalid_type,expected:z.null,received:i.parsedType}),j}return xt(e.data)}};Cs.create=t=>new Cs({typeName:P.ZodNull,...te(t)});var Vr=class extends ne{constructor(){super(...arguments),this._any=!0}_parse(e){return xt(e.data)}};Vr.create=t=>new Vr({typeName:P.ZodAny,...te(t)});var $i=class extends ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xt(e.data)}};$i.create=t=>new $i({typeName:P.ZodUnknown,...te(t)});var Mn=class extends ne{_parse(e){let n=this._getOrReturnCtx(e);return M(n,{code:O.invalid_type,expected:z.never,received:n.parsedType}),j}};Mn.create=t=>new Mn({typeName:P.ZodNever,...te(t)});var oo=class extends ne{_parse(e){if(this._getType(e)!==z.undefined){let i=this._getOrReturnCtx(e);return M(i,{code:O.invalid_type,expected:z.void,received:i.parsedType}),j}return xt(e.data)}};oo.create=t=>new oo({typeName:P.ZodVoid,...te(t)});var Vi=class t extends ne{_parse(e){let{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==z.array)return M(n,{code:O.invalid_type,expected:z.array,received:n.parsedType}),j;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,o=n.data.length<r.exactLength.value;(a||o)&&(M(n,{code:a?O.too_big:O.too_small,minimum:o?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&&(M(n,{code:O.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&&(M(n,{code:O.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,o)=>r.type._parseAsync(new Sn(n,a,n.path,o)))).then(a=>yt.mergeArray(i,a));let s=[...n.data].map((a,o)=>r.type._parseSync(new Sn(n,a,n.path,o)));return yt.mergeArray(i,s)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:$.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:$.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:$.toString(n)}})}nonempty(e){return this.min(1,e)}};Vi.create=(t,e)=>new Vi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...te(e)});function so(t){if(t instanceof jt){let e={};for(let n in t.shape){let i=t.shape[n];e[n]=bn.create(so(i))}return new jt({...t._def,shape:()=>e})}else return t instanceof Vi?new Vi({...t._def,type:so(t.element)}):t instanceof bn?bn.create(so(t.unwrap())):t instanceof Kn?Kn.create(so(t.unwrap())):t instanceof Xn?Xn.create(t.items.map(e=>so(e))):t}var jt=class t extends ne{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=ae.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==z.object){let c=this._getOrReturnCtx(e);return M(c,{code:O.invalid_type,expected:z.object,received:c.parsedType}),j}let{status:i,ctx:r}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Mn&&this._def.unknownKeys==="strip"))for(let c in r.data)a.includes(c)||o.push(c);let l=[];for(let c of a){let u=s[c],f=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Sn(r,f,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Mn){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")o.length>0&&(M(r,{code:O.unrecognized_keys,keys:o}),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 o){let f=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Sn(r,f,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let f=await u.key,h=await u.value;c.push({key:f,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>yt.mergeObjectSync(i,c)):yt.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return $.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:$.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:P.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 ae.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 ae.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}deepPartial(){return so(this)}partial(e){let n={};for(let i of ae.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 ae.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof bn;)s=s._def.innerType;n[i]=s}return new t({...this._def,shape:()=>n})}keyof(){return Iw(ae.objectKeys(this.shape))}};jt.create=(t,e)=>new jt({shape:()=>t,unknownKeys:"strip",catchall:Mn.create(),typeName:P.ZodObject,...te(e)});jt.strictCreate=(t,e)=>new jt({shape:()=>t,unknownKeys:"strict",catchall:Mn.create(),typeName:P.ZodObject,...te(e)});jt.lazycreate=(t,e)=>new jt({shape:t,unknownKeys:"strip",catchall:Mn.create(),typeName:P.ZodObject,...te(e)});var As=class extends ne{_parse(e){let{ctx:n}=this._processInputParams(e),i=this._def.options;function r(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(o=>new Ft(o.ctx.common.issues));return M(n,{code:O.invalid_union,unionErrors:a}),j}if(n.common.async)return Promise.all(i.map(async s=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let s,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"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let o=a.map(l=>new Ft(l));return M(n,{code:O.invalid_union,unionErrors:o}),j}}get options(){return this._def.options}};As.create=(t,e)=>new As({options:t,typeName:P.ZodUnion,...te(e)});var Ui=t=>t instanceof Ts?Ui(t.schema):t instanceof xn?Ui(t.innerType()):t instanceof Rs?[t.value]:t instanceof Os?t.options:t instanceof Ms?ae.objectValues(t.enum):t instanceof Ns?Ui(t._def.innerType):t instanceof ws?[void 0]:t instanceof Cs?[null]:t instanceof bn?[void 0,...Ui(t.unwrap())]:t instanceof Kn?[null,...Ui(t.unwrap())]:t instanceof tc||t instanceof Ls?Ui(t.unwrap()):t instanceof Ds?Ui(t._def.innerType):[],Wd=class t extends ne{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==z.object)return M(n,{code:O.invalid_type,expected:z.object,received:n.parsedType}),j;let i=this.discriminator,r=n.data[i],s=this.optionsMap.get(r);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(M(n,{code:O.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),j)}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 s of n){let a=Ui(s.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of a){if(r.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);r.set(o,s)}}return new t({typeName:P.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...te(i)})}};function Nv(t,e){let n=Wn(t),i=Wn(e);if(t===e)return{valid:!0,data:t};if(n===z.object&&i===z.object){let r=ae.objectKeys(e),s=ae.objectKeys(t).filter(o=>r.indexOf(o)!==-1),a={...t,...e};for(let o of s){let l=Nv(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(n===z.array&&i===z.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let s=0;s<t.length;s++){let a=t[s],o=e[s],l=Nv(a,o);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return n===z.date&&i===z.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ks=class extends ne{_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=(s,a)=>{if(Yd(s)||Yd(a))return j;let o=Nv(s.value,a.value);return o.valid?((Zd(s)||Zd(a))&&n.dirty(),{status:n.value,value:o.data}):(M(i,{code:O.invalid_intersection_types}),j)};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(([s,a])=>r(s,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}))}};ks.create=(t,e,n)=>new ks({left:t,right:e,typeName:P.ZodIntersection,...te(n)});var Xn=class t extends ne{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==z.array)return M(i,{code:O.invalid_type,expected:z.array,received:i.parsedType}),j;if(i.data.length<this._def.items.length)return M(i,{code:O.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&i.data.length>this._def.items.length&&(M(i,{code:O.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...i.data].map((a,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new Sn(i,a,i.path,o)):null}).filter(a=>!!a);return i.common.async?Promise.all(s).then(a=>yt.mergeArray(n,a)):yt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Xn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xn({items:t,typeName:P.ZodTuple,rest:null,...te(e)})};var Xd=class t extends ne{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!==z.object)return M(i,{code:O.invalid_type,expected:z.object,received:i.parsedType}),j;let r=[],s=this._def.keyType,a=this._def.valueType;for(let o in i.data)r.push({key:s._parse(new Sn(i,o,i.path,o)),value:a._parse(new Sn(i,i.data[o],i.path,o)),alwaysSet:o in i.data});return i.common.async?yt.mergeObjectAsync(n,r):yt.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof ne?new t({keyType:e,valueType:n,typeName:P.ZodRecord,...te(i)}):new t({keyType:$r.create(),valueType:e,typeName:P.ZodRecord,...te(n)})}},lo=class extends ne{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!==z.map)return M(i,{code:O.invalid_type,expected:z.map,received:i.parsedType}),j;let r=this._def.keyType,s=this._def.valueType,a=[...i.data.entries()].map(([o,l],c)=>({key:r._parse(new Sn(i,o,i.path,[c,"key"])),value:s._parse(new Sn(i,l,i.path,[c,"value"]))}));if(i.common.async){let o=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 j;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}})}else{let o=new Map;for(let l of a){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return j;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}}}};lo.create=(t,e,n)=>new lo({valueType:e,keyType:t,typeName:P.ZodMap,...te(n)});var co=class t extends ne{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==z.set)return M(i,{code:O.invalid_type,expected:z.set,received:i.parsedType}),j;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(M(i,{code:O.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&&(M(i,{code:O.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let s=this._def.valueType;function a(l){let c=new Set;for(let u of l){if(u.status==="aborted")return j;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}let o=[...i.data.values()].map((l,c)=>s._parse(new Sn(i,l,i.path,c)));return i.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,n){return new t({...this._def,minSize:{value:e,message:$.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:$.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};co.create=(t,e)=>new co({valueType:t,minSize:null,maxSize:null,typeName:P.ZodSet,...te(e)});var Kd=class t extends ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==z.function)return M(n,{code:O.invalid_type,expected:z.function,received:n.parsedType}),j;function i(o,l){return ec({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,io(),Hi].filter(c=>!!c),issueData:{code:O.invalid_arguments,argumentsError:l}})}function r(o,l){return ec({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,io(),Hi].filter(c=>!!c),issueData:{code:O.invalid_return_type,returnTypeError:l}})}let s={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Ir){let o=this;return xt(async function(...l){let c=new Ft([]),u=await o._def.args.parseAsync(l,s).catch(p=>{throw c.addIssue(i(l,p)),c}),f=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(f,s).catch(p=>{throw c.addIssue(r(f,p)),c})})}else{let o=this;return xt(function(...l){let c=o._def.args.safeParse(l,s);if(!c.success)throw new Ft([i(l,c.error)]);let u=Reflect.apply(a,this,c.data),f=o._def.returns.safeParse(u,s);if(!f.success)throw new Ft([r(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Xn.create(e).rest($i.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||Xn.create([]).rest($i.create()),returns:n||$i.create(),typeName:P.ZodFunction,...te(i)})}},Ts=class extends ne{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})}};Ts.create=(t,e)=>new Ts({getter:t,typeName:P.ZodLazy,...te(e)});var Rs=class extends ne{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return M(n,{received:n.data,code:O.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:e.data}}get value(){return this._def.value}};Rs.create=(t,e)=>new Rs({value:t,typeName:P.ZodLiteral,...te(e)});function Iw(t,e){return new Os({values:t,typeName:P.ZodEnum,...te(e)})}var Os=class t extends ne{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),i=this._def.values;return M(n,{expected:ae.joinValues(i),received:n.parsedType,code:O.invalid_type}),j}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 M(n,{received:n.data,code:O.invalid_enum_value,options:i}),j}return xt(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})}};Os.create=Iw;var Ms=class extends ne{_parse(e){let n=ae.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==z.string&&i.parsedType!==z.number){let r=ae.objectValues(n);return M(i,{expected:ae.joinValues(r),received:i.parsedType,code:O.invalid_type}),j}if(this._cache||(this._cache=new Set(ae.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=ae.objectValues(n);return M(i,{received:i.data,code:O.invalid_enum_value,options:r}),j}return xt(e.data)}get enum(){return this._def.values}};Ms.create=(t,e)=>new Ms({values:t,typeName:P.ZodNativeEnum,...te(e)});var Ir=class extends ne{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==z.promise&&n.common.async===!1)return M(n,{code:O.invalid_type,expected:z.promise,received:n.parsedType}),j;let i=n.parsedType===z.promise?n.data:Promise.resolve(n.data);return xt(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Ir.create=(t,e)=>new Ir({type:t,typeName:P.ZodPromise,...te(e)});var xn=class extends ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:a=>{M(i,a),a.fatal?n.abort():n.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){let a=r.transform(i.data,s);if(i.common.async)return Promise.resolve(a).then(async o=>{if(n.value==="aborted")return j;let l=await this._def.schema._parseAsync({data:o,path:i.path,parent:i});return l.status==="aborted"?j:l.status==="dirty"?_s(l.value):n.value==="dirty"?_s(l.value):l});{if(n.value==="aborted")return j;let o=this._def.schema._parseSync({data:a,path:i.path,parent:i});return o.status==="aborted"?j:o.status==="dirty"?_s(o.value):n.value==="dirty"?_s(o.value):o}}if(r.type==="refinement"){let a=o=>{let l=r.refinement(o,s);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 o};if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?j:(o.status==="dirty"&&n.dirty(),a(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>o.status==="aborted"?j:(o.status==="dirty"&&n.dirty(),a(o.value).then(()=>({status:n.value,value:o.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(!Ur(a))return j;let o=r.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Ur(a)?Promise.resolve(r.transform(a.value,s)).then(o=>({status:n.value,value:o})):j);ae.assertNever(r)}};xn.create=(t,e,n)=>new xn({schema:t,typeName:P.ZodEffects,effect:e,...te(n)});xn.createWithPreprocess=(t,e,n)=>new xn({schema:e,effect:{type:"preprocess",transform:t},typeName:P.ZodEffects,...te(n)});var bn=class extends ne{_parse(e){return this._getType(e)===z.undefined?xt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};bn.create=(t,e)=>new bn({innerType:t,typeName:P.ZodOptional,...te(e)});var Kn=class extends ne{_parse(e){return this._getType(e)===z.null?xt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Kn.create=(t,e)=>new Kn({innerType:t,typeName:P.ZodNullable,...te(e)});var Ns=class extends ne{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return n.parsedType===z.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ns.create=(t,e)=>new Ns({innerType:t,typeName:P.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...te(e)});var Ds=class extends ne{_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 ro(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ft(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Ft(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Ds.create=(t,e)=>new Ds({innerType:t,typeName:P.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...te(e)});var uo=class extends ne{_parse(e){if(this._getType(e)!==z.nan){let i=this._getOrReturnCtx(e);return M(i,{code:O.invalid_type,expected:z.nan,received:i.parsedType}),j}return{status:"valid",value:e.data}}};uo.create=t=>new uo({typeName:P.ZodNaN,...te(t)});var FN=Symbol("zod_brand"),tc=class extends ne{_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}},nc=class t extends ne{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?j:s.status==="dirty"?(n.dirty(),_s(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?j: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:P.ZodPipeline})}},Ls=class extends ne{_parse(e){let n=this._def.innerType._parse(e),i=r=>(Ur(r)&&(r.value=Object.freeze(r.value)),r);return ro(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Ls.create=(t,e)=>new Ls({innerType:t,typeName:P.ZodReadonly,...te(e)});function Hw(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function Fw(t,e={},n){return t?Vr.create().superRefine((i,r)=>{let s=t(i);if(s instanceof Promise)return s.then(a=>{if(!a){let o=Hw(e,i),l=o.fatal??n??!0;r.addIssue({code:"custom",...o,fatal:l})}});if(!s){let a=Hw(e,i),o=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:o})}}):Vr.create()}var jN={object:jt.lazycreate},P;(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"})(P||(P={}));var qN=(t,e={message:`Input not instance of ${t.name}`})=>Fw(n=>n instanceof t,e),jw=$r.create,qw=bs.create,PN=uo.create,GN=Ss.create,Pw=xs.create,YN=Es.create,ZN=ao.create,WN=ws.create,XN=Cs.create,KN=Vr.create,QN=$i.create,JN=Mn.create,e5=oo.create,t5=Vi.create,n5=jt.create,i5=jt.strictCreate,r5=As.create,s5=Wd.create,a5=ks.create,o5=Xn.create,l5=Xd.create,c5=lo.create,u5=co.create,d5=Kd.create,f5=Ts.create,p5=Rs.create,h5=Os.create,g5=Ms.create,m5=Ir.create,v5=xn.create,y5=bn.create,_5=Kn.create,b5=xn.createWithPreprocess,S5=nc.create,x5=()=>jw().optional(),E5=()=>qw().optional(),w5=()=>Pw().optional(),C5={string:(t=>$r.create({...t,coerce:!0})),number:(t=>bs.create({...t,coerce:!0})),boolean:(t=>xs.create({...t,coerce:!0})),bigint:(t=>Ss.create({...t,coerce:!0})),date:(t=>Es.create({...t,coerce:!0}))};var A5=j;var Gw=x.union([x.object({type:x.literal("data"),key:x.string(),value:x.string().optional()}),x.object({type:x.literal("css"),value:x.string()}),x.object({type:x.literal("aria"),role:x.string().optional(),label:x.string().optional()}),x.object({type:x.literal("shadow-css"),value:x.string()}),x.object({type:x.literal("ref"),el:x.any()})]),k5=x.object({kind:x.literal("tooltip"),id:x.string(),anchor:Gw,content:x.object({title:x.string().optional(),body:x.string()}),placement:x.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:x.number().optional(),blocking:x.boolean().optional(),trigger:x.enum(["immediate","hover","click"]).optional(),dismiss:x.object({onEsc:x.boolean().optional(),closeButton:x.boolean().optional(),timeoutMs:x.number().optional()}).optional()}),T5=x.object({kind:x.literal("highlight"),id:x.string(),anchor:Gw,copy:x.string().optional(),ring:x.object({paddingPx:x.number().optional(),radiusPx:x.number().optional()}).optional(),scrim:x.object({opacity:x.number().optional()}).optional(),ringColor:x.string().optional(),blocking:x.boolean().optional(),dismiss:x.object({onClickOutside:x.boolean().optional(),onEsc:x.boolean().optional(),timeoutMs:x.number().optional()}).optional()}),Dv=x.object({id:x.string(),version:x.number(),routes:x.array(x.string()).optional(),steps:x.array(x.union([k5,T5]))});function Kz(t){return Dv.parse(t)}var t6=({configUri:t,experiments:e,featureKey:n="smart-canvas-overlay-uri",credentials:i="include"}={})=>async()=>{let r=Yh({configUri:t,experiments:e,featureKey:n});if(!r)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let s=await fetch(r,{credentials:i});if(!s.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${s.status})`);let a=await s.json();return Dv.parse(a)};var Yw="syntro_session_metrics",Qd=class{constructor(e={}){F(this,"metrics",new Map);F(this,"experiments");F(this,"attributePrefix");F(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(Yw);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(Yw,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function Lv(t={}){return new Qd(t)}var R5=x.object({url:x.string(),routeId:x.string().optional(),title:x.string().optional(),locale:x.string().optional()}),O5=x.object({url:x.string(),ts:x.number()}),M5=x.object({sessionId:x.string(),startTs:x.number(),pageHistory:x.array(O5).optional()}),N5=x.object({width:x.number(),height:x.number()}),D5=x.object({x:x.number(),y:x.number(),w:x.number(),h:x.number()}),L5=x.object({anchorId:x.string(),present:x.boolean(),visible:x.boolean().optional(),boundingBox:D5.optional()}),z5=x.record(x.union([x.number(),x.string(),x.boolean(),x.undefined()])),B5=x.object({page:R5,session:M5,viewport:N5,anchors:x.array(L5).optional(),augmented:z5.optional()});function l6(t){return B5.safeParse(t)}function H5(){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 zv(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(Zw(n,i))return}if(e.include){for(let i of e.include)if(Zw(n,i))return i;return}return n}function Zw(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 Jd=class{constructor(e={}){F(this,"context");F(this,"previousContext");F(this,"listeners",new Set);F(this,"telemetry");F(this,"routes");F(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.context=H5(),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=zv(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=zv(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)};window.addEventListener("resize",n),this.cleanupFns.push(()=>window.removeEventListener("resize",n));let i=()=>{this.updatePage()};window.addEventListener("popstate",i),this.cleanupFns.push(()=>window.removeEventListener("popstate",i));let r=history.pushState.bind(history),s=history.replaceState.bind(history);history.pushState=(...a)=>{r(...a),this.updatePage()},history.replaceState=(...a)=>{s(...a),this.updatePage()},this.cleanupFns.push(()=>{history.pushState=r,history.replaceState=s})}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,n=document.title,i=zv(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 Bv(t={}){return new Jd(t)}var Ww=x.enum(["posthog","canvas","derived"]),U5=x.object({ts:x.number(),name:x.string(),source:Ww,props:x.record(x.unknown()).optional(),schemaVersion:x.string()}),$5=x.object({names:x.array(x.string()).optional(),patterns:x.array(x.string()).optional(),sources:x.array(Ww).optional()});function v6(t){return U5.safeParse(t)}function y6(t){return $5.safeParse(t)}function Hv(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 ef=class{constructor(e={}){F(this,"subscriptions",new Set);F(this,"history",[]);F(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 s={filter:i,callback:r};return this.subscriptions.add(s),()=>{this.subscriptions.delete(s)}}publish(e,n,i="canvas"){let r={ts:Date.now(),name:e,source:i,props:n,schemaVersion:ua};this.publishEvent(r)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let n of this.subscriptions)if(Hv(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=>Hv(r,e))),n&&n>0&&(i=i.slice(-n)),i}hasRecentEvent(e,n,i){let r=Date.now()-n;return this.history.some(s=>s.name===e&&s.ts>=r&&(i===void 0||s.source===i))}countRecentEvents(e,n){let i=this.history.filter(r=>Hv(r,e));if(n!==void 0){let r=Date.now()-n;i=i.filter(s=>s.ts>=r)}return i.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function ic(t={}){return new ef(t)}var Xw={$autocapture:"ui.click",$click:Ue.UI_CLICK,$scroll:Ue.UI_SCROLL,$input:Ue.UI_INPUT,$change:Ue.UI_CHANGE,$submit:Ue.UI_SUBMIT,$pageview:Ue.NAV_PAGE_VIEW,$pageleave:Ue.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function V5(t){let e=t.event;if(Xw[e])return Xw[e];if(e==="$autocapture"){let n=t.properties?.$tag_name,i=t.properties?.$event_type;return i==="submit"?Ue.UI_SUBMIT:i==="change"?Ue.UI_CHANGE:n==="input"||n==="textarea"?Ue.UI_INPUT:Ue.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function I5(t){let e={},n=t.properties||{};return n.$tag_name&&(e.tagName=n.$tag_name),n.$el_text&&(e.elementText=n.$el_text),n.$elements&&(e.elements=n.$elements),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 Kw(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:V5(t),source:"posthog",props:I5(t),schemaVersion:ua}}function Qw(t){let e=t.event;return!["$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 Uv(t){return(e,n)=>{let i={event:e,properties:n,timestamp:Date.now()};if(Qw(i)){let r=Kw(i);t(r)}}}var F5=x.object({value:x.unknown(),expiresAt:x.number().optional()}),j5=x.object({count:x.number(),resetAt:x.number().optional()});function N6(t){return F5.safeParse(t)}function D6(t){return j5.safeParse(t)}var rc="dismissed:";function Jw(t,e){return{mark(n,i=!1){let r=rc+n;(i?e:t).set(r,!0)},isDismissed(n){let i=rc+n;return t.has(i)||e.has(i)},clear(n){let i=rc+n;t.remove(i),e.remove(i)},clearAll(){for(let n of t.keys())n.startsWith(rc)&&t.remove(n);for(let n of e.keys())n.startsWith(rc)&&e.remove(n)}}}var $v="cooldown:";function eC(t){return{set(e,n){let i=$v+e,r=Date.now()+n;t.set(i,r)},isActive(e){return this.remaining(e)>0},remaining(e){let n=$v+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=$v+e;t.remove(n)}}}var Vv="freq:";function tC(t){function e(n){let i=Vv+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=Vv+n,s=e(n),a=(s?.count??0)+1,o={count:a,resetAt:s?.resetAt??(i?Date.now()+i:void 0)};return t.set(r,o),a},count(n){return e(n)?.count??0},reset(n){let i=Vv+n;t.remove(i)},hasReachedLimit(n,i){return this.count(n)>=i}}}var q5="syntro";function Iv(t,e){let n=`${e}:`;return{get(i){if(t)try{let r=t.getItem(n+i);if(!r)return;let s=JSON.parse(r);if(s.expiresAt&&Date.now()>=s.expiresAt){t.removeItem(n+i);return}return s.value}catch{return}},set(i,r,s){if(t)try{let a={value:r,expiresAt:s?Date.now()+s: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 s=t.key(r);s?.startsWith(n)&&i.push(s.slice(n.length))}return i},clear(){if(!t)return;let i=this.keys();for(let r of i)t.removeItem(n+r)}}}function Fv(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,s){e.set(n+i,{value:r,expiresAt:s?Date.now()+s: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 tf=class{constructor(e={}){F(this,"session");F(this,"user");F(this,"dismissals");F(this,"cooldowns");F(this,"frequency");F(this,"namespace");F(this,"namespacedStorages",new Map);this.namespace=e.namespace??q5,typeof window<"u"?(this.session=Iv(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=Iv(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=Fv(this.namespace),this.user=Fv(this.namespace)),this.dismissals=Jw(this.session,this.user),this.cooldowns=eC(this.user),this.frequency=tC(this.session)}ns(e){let n=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(n)){let i=typeof window<"u"&&typeof sessionStorage<"u"?Iv(sessionStorage,n):Fv(n);this.namespacedStorages.set(n,i)}return this.namespacedStorages.get(n)}};function jv(t={}){return new tf(t)}var P5=x.object({type:x.literal("page_url"),url:x.string()}),G5=x.object({type:x.literal("route"),routeId:x.string()}),Y5=x.object({type:x.literal("anchor_visible"),anchorId:x.string(),state:x.enum(["visible","present","absent"])}),Z5=x.object({type:x.literal("event_occurred"),eventName:x.string(),withinMs:x.number().optional()}),W5=x.object({type:x.literal("state_equals"),key:x.string(),value:x.unknown()}),X5=x.object({type:x.literal("viewport"),minWidth:x.number().optional(),maxWidth:x.number().optional(),minHeight:x.number().optional(),maxHeight:x.number().optional()}),K5=x.object({type:x.literal("session_metric"),key:x.string(),operator:x.enum(["gte","lte","eq","gt","lt"]),threshold:x.number()}),Q5=x.object({type:x.literal("dismissed"),key:x.string(),inverted:x.boolean().optional()}),J5=x.object({type:x.literal("cooldown_active"),key:x.string(),inverted:x.boolean().optional()}),eD=x.object({type:x.literal("frequency_limit"),key:x.string(),limit:x.number(),inverted:x.boolean().optional()}),nC=x.discriminatedUnion("type",[P5,G5,Y5,Z5,W5,X5,K5,Q5,J5,eD]),tD=x.object({conditions:x.array(nC),value:x.unknown()}),nD=x.object({type:x.literal("rules"),rules:x.array(tD),default:x.unknown()}),iD=x.object({type:x.literal("score"),field:x.string(),threshold:x.number(),above:x.unknown(),below:x.unknown()}),rD=x.object({type:x.literal("model"),modelId:x.string(),inputs:x.array(x.string()),outputMapping:x.record(x.unknown()),default:x.unknown()}),sD=x.object({type:x.literal("external"),endpoint:x.string(),method:x.enum(["GET","POST"]).optional(),default:x.unknown(),timeoutMs:x.number().optional()}),iC=x.discriminatedUnion("type",[nD,iD,rD,sD]),aD=x.object({include:x.array(x.string()).optional(),exclude:x.array(x.string()).optional()}),oD=x.object({routes:aD.optional(),strategy:iC.optional()});function Z6(t){return nC.safeParse(t)}function W6(t){return iC.safeParse(t)}function X6(t){return oD.safeParse(t)}function rC(t,e){let{context:n,state:i,events:r}=e;switch(t.type){case"page_url":{let{url:s}=t,a=n.page.url,o=s.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(`^${o}$`).test(a)}case"route":return n.page.routeId===t.routeId;case"anchor_visible":{let s=n.anchors?.find(a=>a.anchorId===t.anchorId);switch(t.state){case"visible":return s?.visible===!0;case"present":return s?.present===!0;case"absent":return!s?.present;default:return!1}}case"event_occurred":{if(!r)return!1;let s=t.withinMs??6e4;return r.hasRecentEvent(t.eventName,s)}case"state_equals":return!1;case"viewport":{let{width:s,height:a}=n.viewport;return!(t.minWidth!==void 0&&s<t.minWidth||t.maxWidth!==void 0&&s>t.maxWidth||t.minHeight!==void 0&&a<t.minHeight||t.maxHeight!==void 0&&a>t.maxHeight)}case"session_metric":{if(!i)return!1;let s=i.getSessionMetric(t.key),{operator:a,threshold:o}=t;switch(a){case"gte":return s>=o;case"lte":return s<=o;case"eq":return s===o;case"gt":return s>o;case"lt":return s<o;default:return!1}}case"dismissed":{if(!i)return t.inverted??!1;let s=i.isDismissed(t.key);return t.inverted?!s:s}case"cooldown_active":{if(!i)return t.inverted??!1;let s=i.isCooldownActive(t.key);return t.inverted?!s:s}case"frequency_limit":{if(!i)return t.inverted??!1;let a=i.getFrequencyCount(t.key)>=t.limit;return t.inverted?!a:a}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function sC(t,e){let n=[];for(let i of t.conditions){let r=rC(i,e);if(n.push({condition:i,result:r}),!r)return{matched:!1,conditionResults:n}}return{matched:!0,conditionResults:n}}function nf(t,e){for(let n=0;n<t.rules.length;n++){let i=t.rules[n],{matched:r,conditionResults:s}=sC(i,e);if(r)return{value:i.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:n,evaluatedConditions:s}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function rf(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 aC(t,e){let{state:n,events:i,sessionMetrics:r}=e;return{context:t,state:n?{isDismissed:s=>n.dismissals.isDismissed(s),isCooldownActive:s=>n.cooldowns.isActive(s),getFrequencyCount:s=>n.frequency.count(s),getSessionMetric:s=>r?.get(s)??0}:void 0,events:i?{hasRecentEvent:(s,a)=>i.hasRecentEvent(s,a)}:void 0}}async function oC(t,e,n={}){let i=aC(e,n);switch(t.type){case"rules":return nf(t,i);case"score":return rf(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 lC(t,e,n={}){let i=aC(e,n);switch(t.type){case"rules":return nf(t,i);case"score":return rf(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 qv(t){return{evaluate:(e,n)=>oC(e,n,t),evaluateSync:(e,n)=>lC(e,n,t)}}var lD=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function Pv(t){if(typeof window.Sanitizer=="function")try{let o=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(o),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),s=[];for(;r.nextNode();){let a=r.currentNode,o=a.tagName.toLowerCase();if(!lD.has(o)){s.push(a);continue}for(let l of Array.from(a.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),f=c.startsWith("on"),h=(c==="href"||c==="src")&&u.startsWith("javascript:");(f||h)&&a.removeAttribute(l.name)}}for(let a of s){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML}var cC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=Pv(t.html),r=document.createElement("div");r.setAttribute("data-syntro-action-id",e.generateId()),r.innerHTML=i;let s=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":s=n.innerHTML,n.replaceWith(r);break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position}),{cleanup:()=>{if(t.position==="replace"&&s!==null){let a=document.createElement(n.tagName);a.innerHTML=s,Array.from(n.attributes).forEach(o=>{a.setAttribute(o.name,o.value)}),r.replaceWith(a)}else r.remove()},updateFn:a=>{"html"in a&&typeof a.html=="string"&&(r.innerHTML=Pv(a.html))}}},uC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=n.textContent??"";return n.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{n.textContent=i},updateFn:r=>{"text"in r&&typeof r.text=="string"&&(n.textContent=r.text)}}},dC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);if(["onclick","onerror","onload","onmouseover","onfocus","onblur"].includes(t.attr.toLowerCase())||t.attr.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);let r=n.getAttribute(t.attr),s=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:()=>{s&&r!==null?n.setAttribute(t.attr,r):n.removeAttribute(t.attr)},updateFn:a=>{"value"in a&&typeof a.value=="string"&&n.setAttribute(t.attr,a.value)}}},fC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=n.classList.contains(t.className);return n.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i||n.classList.remove(t.className)}}},pC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=n.classList.contains(t.className);return n.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i&&n.classList.add(t.className)}}},hC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=new Map;for(let r of Object.keys(t.styles)){let s=n.style.getPropertyValue(r);i.set(r,s)}for(let[r,s]of Object.entries(t.styles))n.style.setProperty(r,s);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[r,s]of i)s?n.style.setProperty(r,s):n.style.removeProperty(r)},updateFn:r=>{if("styles"in r&&typeof r.styles=="object"&&r.styles)for(let[s,a]of Object.entries(r.styles))n.style.setProperty(s,a)}}},Gv=[{kind:"content:insertHtml",executor:cC},{kind:"content:setText",executor:uC},{kind:"content:setAttr",executor:dC},{kind:"content:addClass",executor:fC},{kind:"content:removeClass",executor:pC},{kind:"content:setStyle",executor:hC}],cD={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:Gv};var gC=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function mC(t,e,n){let i=n?.paddingPx??12,r=n?.radiusPx??12,s=Math.min(Math.max(n?.scrimOpacity??.55,0),1),a=n?.ringColor??"var(--syntro-ring, #5b8cff)",o=n?.blocking??!1,l=n?.onClickOutside??!0,c=n?.onEsc??!0,u=getComputedStyle(document.documentElement),f=u.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=u.getPropertyValue("--syntro-ring").trim(),p=document.createElement("div");p.className="syntro-spotlight-scrim";let y=o||l;Object.assign(p.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:y?"auto":"none",background:f||`rgba(2, 6, 23, ${s})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(p),requestAnimationFrame(()=>p.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||"#5b8cff"}`,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(!gC)for(let R=0;R<4;R++){let T=document.createElement("div");T.style.position="fixed",T.style.background="inherit",b.push(T),p.appendChild(T)}let d=R=>{p.style.clipPath=R,p.style.webkitClipPath=R},g=()=>{let R=t.getBoundingClientRect(),T=Math.max(0,R.left-i),I=Math.max(0,R.top-i),G=Math.min(window.innerWidth,R.width+i*2),K=Math.min(window.innerHeight,R.height+i*2);if(Object.assign(_.style,{left:`${T}px`,top:`${I}px`,width:`${G}px`,height:`${K}px`}),gC){let q=window.innerWidth,he=window.innerHeight,U=Math.min(r,G/2,K/2),Q=`M 0 0 L ${q} 0 L ${q} ${he} L 0 ${he} Z`,H=`M ${T+U} ${I} A ${U} ${U} 0 0 0 ${T} ${I+U} L ${T} ${I+K-U} A ${U} ${U} 0 0 0 ${T+U} ${I+K} L ${T+G-U} ${I+K} A ${U} ${U} 0 0 0 ${T+G} ${I+K-U} L ${T+G} ${I+U} A ${U} ${U} 0 0 0 ${T+G-U} ${I} L ${T+U} ${I} Z`;d(`path('${Q} ${H}')`)}else{let[q,he,U,Q]=b;Object.assign(q.style,{left:"0px",top:"0px",width:"100vw",height:`${I}px`}),Object.assign(U.style,{left:"0px",top:`${I+K}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(I+K))}px`}),Object.assign(Q.style,{left:"0px",top:`${I}px`,width:`${T}px`,height:`${K}px`}),Object.assign(he.style,{left:`${T+G}px`,top:`${I}px`,width:`${Math.max(0,window.innerWidth-(T+G))}px`,height:`${K}px`})}},m=new ResizeObserver(()=>requestAnimationFrame(g));m.observe(t);let v=()=>requestAnimationFrame(g),S=()=>requestAnimationFrame(g);window.addEventListener("scroll",v,!0),window.addEventListener("resize",S);let w=R=>{R.key==="Escape"&&c&&C.destroy()};c&&window.addEventListener("keydown",w);let E=R=>{o?(R.preventDefault(),R.stopPropagation()):l&&C.destroy()};p.addEventListener("click",E);let C={destroy(){m.disconnect(),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",S),c&&window.removeEventListener("keydown",w),p.removeEventListener("click",E),p.style.opacity="0",setTimeout(()=>{p.remove(),_.remove()},220)}};return g(),C}var _C=["top","right","bottom","left"];var En=Math.min,Et=Math.max,Qn=Math.round,Jn=Math.floor,Ie=t=>({x:t,y:t}),uD={left:"right",right:"left",bottom:"top",top:"bottom"},dD={start:"end",end:"start"};function af(t,e,n){return Et(t,En(e,n))}function zs(t,e){return typeof t=="function"?t(e):t}function Fr(t){return t.split("-")[0]}function fo(t){return t.split("-")[1]}function Yv(t){return t==="x"?"y":"x"}function of(t){return t==="y"?"height":"width"}var fD=new Set(["top","bottom"]);function Ii(t){return fD.has(Fr(t))?"y":"x"}function lf(t){return Yv(Ii(t))}function bC(t,e,n){n===void 0&&(n=!1);let i=fo(t),r=lf(t),s=of(r),a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=sc(a)),[a,sc(a)]}function SC(t){let e=sc(t);return[sf(t),e,sf(e)]}function sf(t){return t.replace(/start|end/g,e=>dD[e])}var vC=["left","right"],yC=["right","left"],pD=["top","bottom"],hD=["bottom","top"];function gD(t,e,n){switch(t){case"top":case"bottom":return n?e?yC:vC:e?vC:yC;case"left":case"right":return e?pD:hD;default:return[]}}function xC(t,e,n,i){let r=fo(t),s=gD(Fr(t),n==="start",i);return r&&(s=s.map(a=>a+"-"+r),e&&(s=s.concat(s.map(sf)))),s}function sc(t){return t.replace(/left|right|bottom|top/g,e=>uD[e])}function mD(t){return{top:0,right:0,bottom:0,left:0,...t}}function Zv(t){return typeof t!="number"?mD(t):{top:t,right:t,bottom:t,left:t}}function ei(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 EC(t,e,n){let{reference:i,floating:r}=t,s=Ii(e),a=lf(e),o=of(a),l=Fr(e),c=s==="y",u=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[o]/2-r[o]/2,p;switch(l){case"top":p={x:u,y:i.y-r.height};break;case"bottom":p={x:u,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:f};break;case"left":p={x:i.x-r.width,y:f};break;default:p={x:i.x,y:i.y}}switch(fo(e)){case"start":p[a]-=h*(n&&c?-1:1);break;case"end":p[a]+=h*(n&&c?-1:1);break}return p}var cf=async(t,e,n)=>{let{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,o=s.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:f}=EC(c,i,l),h=i,p={},y=0;for(let _=0;_<o.length;_++){let{name:b,fn:d}=o[_],{x:g,y:m,data:v,reset:S}=await d({x:u,y:f,initialPlacement:i,placement:h,strategy:r,middlewareData:p,rects:c,platform:a,elements:{reference:t,floating:e}});u=g??u,f=m??f,p={...p,[b]:{...p[b],...v}},S&&y<=50&&(y++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(c=S.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:r}):S.rects),{x:u,y:f}=EC(c,h,l)),_=-1)}return{x:u,y:f,placement:h,strategy:r,middlewareData:p}};async function po(t,e){var n;e===void 0&&(e={});let{x:i,y:r,platform:s,rects:a,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=zs(e,t),y=Zv(p),b=o[h?f==="floating"?"reference":"floating":f],d=ei(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:c,rootBoundary:u,strategy:l})),g=f==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,m=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),v=await(s.isElement==null?void 0:s.isElement(m))?await(s.getScale==null?void 0:s.getScale(m))||{x:1,y:1}:{x:1,y:1},S=ei(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:m,strategy:l}):g);return{top:(d.top-S.top+y.top)/v.y,bottom:(S.bottom-d.bottom+y.bottom)/v.y,left:(d.left-S.left+y.left)/v.x,right:(S.right-d.right+y.right)/v.x}}var Wv=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:r,rects:s,platform:a,elements:o,middlewareData:l}=e,{element:c,padding:u=0}=zs(t,e)||{};if(c==null)return{};let f=Zv(u),h={x:n,y:i},p=lf(r),y=of(p),_=await a.getDimensions(c),b=p==="y",d=b?"top":"left",g=b?"bottom":"right",m=b?"clientHeight":"clientWidth",v=s.reference[y]+s.reference[p]-h[p]-s.floating[y],S=h[p]-s.reference[p],w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c)),E=w?w[m]:0;(!E||!await(a.isElement==null?void 0:a.isElement(w)))&&(E=o.floating[m]||s.floating[y]);let C=v/2-S/2,R=E/2-_[y]/2-1,T=En(f[d],R),I=En(f[g],R),G=T,K=E-_[y]-I,q=E/2-_[y]/2+C,he=af(G,q,K),U=!l.arrow&&fo(r)!=null&&q!==he&&s.reference[y]/2-(q<G?T:I)-_[y]/2<0,Q=U?q<G?q-G:q-K:0;return{[p]:h[p]+Q,data:{[p]:he,centerOffset:q-he-Q,...U&&{alignmentOffset:Q}},reset:U}}});var uf=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:r,middlewareData:s,rects:a,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:_=!0,...b}=zs(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let d=Fr(r),g=Ii(o),m=Fr(o)===o,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=h||(m||!_?[sc(o)]:SC(o)),w=y!=="none";!h&&w&&S.push(...xC(o,_,y,v));let E=[o,...S],C=await po(e,b),R=[],T=((i=s.flip)==null?void 0:i.overflows)||[];if(u&&R.push(C[d]),f){let q=bC(r,a,v);R.push(C[q[0]],C[q[1]])}if(T=[...T,{placement:r,overflows:R}],!R.every(q=>q<=0)){var I,G;let q=(((I=s.flip)==null?void 0:I.index)||0)+1,he=E[q];if(he&&(!(f==="alignment"?g!==Ii(he):!1)||T.every(H=>Ii(H.placement)===g?H.overflows[0]>0:!0)))return{data:{index:q,overflows:T},reset:{placement:he}};let U=(G=T.filter(Q=>Q.overflows[0]<=0).sort((Q,H)=>Q.overflows[1]-H.overflows[1])[0])==null?void 0:G.placement;if(!U)switch(p){case"bestFit":{var K;let Q=(K=T.filter(H=>{if(w){let W=Ii(H.placement);return W===g||W==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(W=>W>0).reduce((W,Ot)=>W+Ot,0)]).sort((H,W)=>H[1]-W[1])[0])==null?void 0:K[0];Q&&(U=Q);break}case"initialPlacement":U=o;break}if(r!==U)return{reset:{placement:U}}}return{}}}};function wC(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function CC(t){return _C.some(e=>t[e]>=0)}var Xv=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n}=e,{strategy:i="referenceHidden",...r}=zs(t,e);switch(i){case"referenceHidden":{let s=await po(e,{...r,elementContext:"reference"}),a=wC(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:CC(a)}}}case"escaped":{let s=await po(e,{...r,altBoundary:!0}),a=wC(s,n.floating);return{data:{escapedOffsets:a,escaped:CC(a)}}}default:return{}}}}};var vD=new Set(["left","top"]);async function yD(t,e){let{placement:n,platform:i,elements:r}=t,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=Fr(n),o=fo(n),l=Ii(n)==="y",c=vD.has(a)?-1:1,u=s&&l?-1:1,f=zs(e,t),{mainAxis:h,crossAxis:p,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return o&&typeof y=="number"&&(p=o==="end"?y*-1:y),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}var df=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:r,y:s,placement:a,middlewareData:o}=e,l=await yD(e,t);return a===((n=o.offset)==null?void 0:n.placement)&&(i=o.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:a}}}}},ff=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:r}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:b=>{let{x:d,y:g}=b;return{x:d,y:g}}},...l}=zs(t,e),c={x:n,y:i},u=await po(e,l),f=Ii(Fr(r)),h=Yv(f),p=c[h],y=c[f];if(s){let b=h==="y"?"top":"left",d=h==="y"?"bottom":"right",g=p+u[b],m=p-u[d];p=af(g,p,m)}if(a){let b=f==="y"?"top":"left",d=f==="y"?"bottom":"right",g=y+u[b],m=y-u[d];y=af(g,y,m)}let _=o.fn({...e,[h]:p,[f]:y});return{..._,data:{x:_.x-n,y:_.y-i,enabled:{[h]:s,[f]:a}}}}}};function pf(){return typeof window<"u"}function Nn(t){return kC(t)?(t.nodeName||"").toLowerCase():"#document"}function Fe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ze(t){var e;return(e=(kC(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function kC(t){return pf()?t instanceof Node||t instanceof Fe(t).Node:!1}function je(t){return pf()?t instanceof Element||t instanceof Fe(t).Element:!1}function et(t){return pf()?t instanceof HTMLElement||t instanceof Fe(t).HTMLElement:!1}function AC(t){return!pf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Fe(t).ShadowRoot}var _D=new Set(["inline","contents"]);function ni(t){let{overflow:e,overflowX:n,overflowY:i,display:r}=qe(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!_D.has(r)}var bD=new Set(["table","td","th"]);function hf(t){return bD.has(Nn(t))}var SD=[":popover-open",":modal"];function Fi(t){return SD.some(e=>{try{return t.matches(e)}catch{return!1}})}var xD=["transform","translate","scale","rotate","perspective"],ED=["transform","translate","scale","rotate","perspective","filter"],wD=["paint","layout","strict","content"];function Bs(t){let e=Hs(),n=je(t)?qe(t):t;return xD.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)||ED.some(i=>(n.willChange||"").includes(i))||wD.some(i=>(n.contain||"").includes(i))}function gf(t){let e=Rt(t);for(;et(e)&&!wn(e);){if(Bs(e))return e;if(Fi(e))return null;e=Rt(e)}return null}function Hs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var CD=new Set(["html","body","#document"]);function wn(t){return CD.has(Nn(t))}function qe(t){return Fe(t).getComputedStyle(t)}function ii(t){return je(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Rt(t){if(Nn(t)==="html")return t;let e=t.assignedSlot||t.parentNode||AC(t)&&t.host||Ze(t);return AC(e)?e.host:e}function TC(t){let e=Rt(t);return wn(e)?t.ownerDocument?t.ownerDocument.body:t.body:et(e)&&ni(e)?e:TC(e)}function ti(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let r=TC(t),s=r===((i=t.ownerDocument)==null?void 0:i.body),a=Fe(r);if(s){let o=Us(a);return e.concat(a,a.visualViewport||[],ni(r)?r:[],o&&n?ti(o):[])}return e.concat(r,ti(r,[],n))}function Us(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function NC(t){let e=qe(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,r=et(t),s=r?t.offsetWidth:n,a=r?t.offsetHeight:i,o=Qn(n)!==s||Qn(i)!==a;return o&&(n=s,i=a),{width:n,height:i,$:o}}function Qv(t){return je(t)?t:t.contextElement}function ho(t){let e=Qv(t);if(!et(e))return Ie(1);let n=e.getBoundingClientRect(),{width:i,height:r,$:s}=NC(e),a=(s?Qn(n.width):n.width)/i,o=(s?Qn(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}var OD=Ie(0);function DC(t){let e=Fe(t);return!Hs()||!e.visualViewport?OD:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function MD(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Fe(t)?!1:e}function $s(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let r=t.getBoundingClientRect(),s=Qv(t),a=Ie(1);e&&(i?je(i)&&(a=ho(i)):a=ho(t));let o=MD(s,n,i)?DC(s):Ie(0),l=(r.left+o.x)/a.x,c=(r.top+o.y)/a.y,u=r.width/a.x,f=r.height/a.y;if(s){let h=Fe(s),p=i&&je(i)?Fe(i):i,y=h,_=Us(y);for(;_&&i&&p!==y;){let b=ho(_),d=_.getBoundingClientRect(),g=qe(_),m=d.left+(_.clientLeft+parseFloat(g.paddingLeft))*b.x,v=d.top+(_.clientTop+parseFloat(g.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,f*=b.y,l+=m,c+=v,y=Fe(_),_=Us(y)}}return ei({width:u,height:f,x:l,y:c})}function mf(t,e){let n=ii(t).scrollLeft;return e?e.left+n:$s(Ze(t)).left+n}function LC(t,e){let n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-mf(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function ND(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t,s=r==="fixed",a=Ze(i),o=e?Fi(e.floating):!1;if(i===a||o&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Ie(1),u=Ie(0),f=et(i);if((f||!f&&!s)&&((Nn(i)!=="body"||ni(a))&&(l=ii(i)),et(i))){let p=$s(i);c=ho(i),u.x=p.x+i.clientLeft,u.y=p.y+i.clientTop}let h=a&&!f&&!s?LC(a,l):Ie(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 DD(t){return Array.from(t.getClientRects())}function LD(t){let e=Ze(t),n=ii(t),i=t.ownerDocument.body,r=Et(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=Et(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),a=-n.scrollLeft+mf(t),o=-n.scrollTop;return qe(i).direction==="rtl"&&(a+=Et(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:a,y:o}}var RC=25;function zD(t,e){let n=Fe(t),i=Ze(t),r=n.visualViewport,s=i.clientWidth,a=i.clientHeight,o=0,l=0;if(r){s=r.width,a=r.height;let u=Hs();(!u||u&&e==="fixed")&&(o=r.offsetLeft,l=r.offsetTop)}let c=mf(i);if(c<=0){let u=i.ownerDocument,f=u.body,h=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,y=Math.abs(i.clientWidth-f.clientWidth-p);y<=RC&&(s-=y)}else c<=RC&&(s+=c);return{width:s,height:a,x:o,y:l}}var BD=new Set(["absolute","fixed"]);function HD(t,e){let n=$s(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,s=et(t)?ho(t):Ie(1),a=t.clientWidth*s.x,o=t.clientHeight*s.y,l=r*s.x,c=i*s.y;return{width:a,height:o,x:l,y:c}}function OC(t,e,n){let i;if(e==="viewport")i=zD(t,n);else if(e==="document")i=LD(Ze(t));else if(je(e))i=HD(e,n);else{let r=DC(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return ei(i)}function zC(t,e){let n=Rt(t);return n===e||!je(n)||wn(n)?!1:qe(n).position==="fixed"||zC(n,e)}function UD(t,e){let n=e.get(t);if(n)return n;let i=ti(t,[],!1).filter(o=>je(o)&&Nn(o)!=="body"),r=null,s=qe(t).position==="fixed",a=s?Rt(t):t;for(;je(a)&&!wn(a);){let o=qe(a),l=Bs(a);!l&&o.position==="fixed"&&(r=null),(s?!l&&!r:!l&&o.position==="static"&&!!r&&BD.has(r.position)||ni(a)&&!l&&zC(t,a))?i=i.filter(u=>u!==a):r=o,a=Rt(a)}return e.set(t,i),i}function $D(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t,a=[...n==="clippingAncestors"?Fi(e)?[]:UD(e,this._c):[].concat(n),i],o=a[0],l=a.reduce((c,u)=>{let f=OC(e,u,r);return c.top=Et(f.top,c.top),c.right=En(f.right,c.right),c.bottom=En(f.bottom,c.bottom),c.left=Et(f.left,c.left),c},OC(e,o,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function VD(t){let{width:e,height:n}=NC(t);return{width:e,height:n}}function ID(t,e,n){let i=et(e),r=Ze(e),s=n==="fixed",a=$s(t,!0,s,e),o={scrollLeft:0,scrollTop:0},l=Ie(0);function c(){l.x=mf(r)}if(i||!i&&!s)if((Nn(e)!=="body"||ni(r))&&(o=ii(e)),i){let p=$s(e,!0,s,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else r&&c();s&&!i&&r&&c();let u=r&&!i&&!s?LC(r,o):Ie(0),f=a.left+o.scrollLeft-l.x-u.x,h=a.top+o.scrollTop-l.y-u.y;return{x:f,y:h,width:a.width,height:a.height}}function Kv(t){return qe(t).position==="static"}function MC(t,e){if(!et(t)||qe(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ze(t)===n&&(n=n.ownerDocument.body),n}function BC(t,e){let n=Fe(t);if(Fi(t))return n;if(!et(t)){let r=Rt(t);for(;r&&!wn(r);){if(je(r)&&!Kv(r))return r;r=Rt(r)}return n}let i=MC(t,e);for(;i&&hf(i)&&Kv(i);)i=MC(i,e);return i&&wn(i)&&Kv(i)&&!Bs(i)?n:i||gf(t)||n}var FD=async function(t){let e=this.getOffsetParent||BC,n=this.getDimensions,i=await n(t.floating);return{reference:ID(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function jD(t){return qe(t).direction==="rtl"}var qD={convertOffsetParentRelativeRectToViewportRelativeRect:ND,getDocumentElement:Ze,getClippingRect:$D,getOffsetParent:BC,getElementRects:FD,getClientRects:DD,getDimensions:VD,getScale:ho,isElement:je,isRTL:jD};function HC(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function PD(t,e){let n=null,i,r=Ze(t);function s(){var o;clearTimeout(i),(o=n)==null||o.disconnect(),n=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();let c=t.getBoundingClientRect(),{left:u,top:f,width:h,height:p}=c;if(o||e(),!h||!p)return;let y=Jn(f),_=Jn(r.clientWidth-(u+h)),b=Jn(r.clientHeight-(f+p)),d=Jn(u),m={rootMargin:-y+"px "+-_+"px "+-b+"px "+-d+"px",threshold:Et(0,En(1,l))||1},v=!0;function S(w){let E=w[0].intersectionRatio;if(E!==l){if(!v)return a();E?a(!1,E):i=setTimeout(()=>{a(!1,1e-7)},1e3)}E===1&&!HC(c,t.getBoundingClientRect())&&a(),v=!1}try{n=new IntersectionObserver(S,{...m,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,m)}n.observe(t)}return a(!0),s}function UC(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=Qv(t),u=r||s?[...c?ti(c):[],...ti(e)]:[];u.forEach(d=>{r&&d.addEventListener("scroll",n,{passive:!0}),s&&d.addEventListener("resize",n)});let f=c&&o?PD(c,n):null,h=-1,p=null;a&&(p=new ResizeObserver(d=>{let[g]=d;g&&g.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var m;(m=p)==null||m.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let y,_=l?$s(t):null;l&&b();function b(){let d=$s(t);_&&!HC(_,d)&&n(),_=d,y=requestAnimationFrame(b)}return n(),()=>{var d;u.forEach(g=>{r&&g.removeEventListener("scroll",n),s&&g.removeEventListener("resize",n)}),f?.(),(d=p)==null||d.disconnect(),p=null,l&&cancelAnimationFrame(y)}}var $C=df;var VC=ff,IC=uf;var FC=Xv,jC=Wv;var qC=(t,e,n)=>{let i=new Map,r={platform:qD,...n},s={...r.platform,_c:i};return cf(t,e,{...r,platform:s})};var GD=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function sn(t){if(typeof window.Sanitizer=="function")try{let o=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(o),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),s=[];for(;r.nextNode();){let a=r.currentNode,o=a.tagName.toLowerCase();if(!GD.has(o)){s.push(a);continue}for(let l of Array.from(a.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),f=c.startsWith("on"),h=(c==="href"||c==="src")&&u.startsWith("javascript:");(f||h)&&a.removeAttribute(l.name)}}for(let a of s){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML}function YD(t){let e=t.getBoundingClientRect(),n=window.innerWidth,i=window.innerHeight;if(!(e.width>n*.8||e.height>i*.8))return t;let s=Math.max(e.left,0),a=Math.max(e.top,0),o=Math.min(e.right,n),l=Math.min(e.bottom,i),c=(s+o)/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 PC(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 s=document.createElement("div");s.className="syntro-tooltip",s.setAttribute("role","tooltip"),s.innerHTML=sn(n.html);let a=s.querySelectorAll("[data-syntro-action]"),o=d=>{let m=d.currentTarget.getAttribute("data-syntro-action");m&&n.onAction&&n.onAction(m)};a.forEach(d=>d.addEventListener("click",o));let l=document.createElement("div");l.className="syntro-tooltip-arrow",s.appendChild(l),e.appendChild(s);let c=[$C(n.offsetPx??8),IC(),VC({padding:8}),FC(),jC({element:l})],u=n.placement&&n.placement!=="auto"?n.placement:"top",f=UC(t,s,async()=>{let d=YD(t),g=await qC(d,s,{placement:u,middleware:c}),{x:m,y:v,strategy:S,middlewareData:w,placement:E}=g;if(Object.assign(s.style,{left:`${m}px`,top:`${v}px`,position:S}),w.arrow){let{x:C,y:R}=w.arrow,T=E.split("-")[0],I={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:C!=null?`${C}px`:"",top:R!=null?`${R}px`:"",right:"",bottom:"",[I[T]]:"-4px"});let G={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${G[T]||"0deg"})`}}),h=d=>{d.key==="Escape"&&b.destroy()};window.addEventListener("keydown",h);let p=[];if(n.blocking){Array.from(document.body.children).forEach(g=>{g!==e&&g.getAttribute("inert")===null&&(g.setAttribute("inert",""),p.push(g.id||g.tagName))});let d=Array.from(s.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(d.length>0){let g=d[0],m=d[d.length-1],v=S=>{S.key==="Tab"&&(S.shiftKey?document.activeElement===g&&(m.focus(),S.preventDefault()):document.activeElement===m&&(g.focus(),S.preventDefault()))};s.addEventListener("keydown",v),requestAnimationFrame(()=>g.focus())}}let _=(()=>{if(n.trigger==="hover"){let d=()=>{s.style.visibility="visible",s.style.opacity="1"},g=()=>{s.style.visibility="hidden",s.style.opacity="0"};return s.style.visibility="hidden",s.style.opacity="0",s.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",d),t.addEventListener("mouseleave",g),t.addEventListener("focus",d),t.addEventListener("blur",g),()=>{t.removeEventListener("mouseenter",d),t.removeEventListener("mouseleave",g),t.removeEventListener("focus",d),t.removeEventListener("blur",g)}}if(n.trigger==="click"){let d=()=>{s.style.visibility==="visible"?b.destroy():(s.style.visibility="visible",s.style.opacity="1")};return s.style.visibility="hidden",s.style.opacity="0",s.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",d),()=>t.removeEventListener("click",d)}return s.style.opacity="0",s.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{s.style.opacity="1"}),()=>{}})(),b={el:s,destroy(){f(),_(),window.removeEventListener("keydown",h),a.forEach(d=>d.removeEventListener("click",o)),n.blocking&&Array.from(document.body.children).forEach(d=>{d!==e&&d.removeAttribute("inert")}),s.style.opacity="0",setTimeout(()=>s.remove(),200)}};return b}var Jv=async(t,e)=>{let{content:n,size:i="md",blocking:r=!1,scrim:s,dismiss:a,ctaButtons:o}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
53
+ })();`}var Vg=!1;function OS(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function zg(t){if(OS()){Vg=!0;return}Vg=t??!1}function DT(){return OS()?!0:Vg}function V(t,e,n){DT()&&(n!==void 0?console.log(`[${t}]`,e,n):console.log(`[${t}]`,e))}function Bt(t,e,n){n!==void 0?console.warn(`[${t}]`,e,n):console.warn(`[${t}]`,e)}function Eu(t,e,n){n!==void 0?console.error(`[${t}]`,e,n):console.error(`[${t}]`,e)}var NS="https://cdn.syntrologie.com/editor-sdk/latest/editor-sdk.js",LS=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function BT(t){V("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return V("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);if(V("Syntro Runtime","Parsed URL:",{hostname:e.hostname,protocol:e.protocol,isLocalhost:n}),e.protocol!=="https:"&&!n)return Bt("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1;let r=LS.some(i=>i.startsWith(".")?e.hostname.endsWith(i)||e.hostname===i.slice(1):e.hostname===i);return V("Syntro Runtime","Host allowlist check:",{hostname:e.hostname,allowedHosts:LS,isAllowed:r}),r?(V("Syntro Runtime","\u2713 Editor URL validated"),!0):(Bt("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return Bt("Syntro Runtime","\u274C Invalid editor URL: "+t,e),!1}}var VT=()=>{if(V("Syntro Runtime","====== EDITOR LOAD CHECK ======"),typeof window>"u")return V("Syntro Runtime","Not in browser - skipping editor"),!1;let t=new URLSearchParams(window.location.search);V("Syntro Runtime","URL:",window.location.href),V("Syntro Runtime","Search params:",window.location.search);let e=t.has("syntro_editor")||t.has("syntro-editor"),n=t.has("editor_token");if(V("Syntro Runtime","Editor flags:",{hasEditorFlag:e,hasEditorToken:n,syntro_editor:t.get("syntro_editor"),"syntro-editor":t.get("syntro-editor"),editor_token:n?`${t.get("editor_token")?.slice(0,10)}...`:"none"}),e&&!n)return Bt("Syntro Runtime","\u274C Editor activation requires editor_token parameter"),V("Syntro Runtime","================================"),!1;let r=e&&n;return V("Syntro Runtime","Should load editor:",r),V("Syntro Runtime","================================"),r},zT=()=>{if(V("Syntro Runtime","====== AUDIT MODE CHECK ======"),typeof window>"u")return V("Syntro Runtime","Not in browser - skipping audit"),!1;let t=new URLSearchParams(window.location.search),e=t.has("syntro_audit"),n=t.has("audit_token"),r=t.get("audit_session_id");return V("Syntro Runtime","Audit flags:",{hasAuditFlag:e,hasAuditToken:n,auditSessionId:r?`${r.slice(0,8)}...`:"none",audit_token:n?`${t.get("audit_token")?.slice(0,10)}...`:"none"}),e?n?(V("Syntro Runtime","\u2713 Audit mode active"),V("Syntro Runtime","================================"),!0):(Bt("Syntro Runtime","\u274C Audit activation requires audit_token parameter"),V("Syntro Runtime","================================"),!1):(V("Syntro Runtime","No syntro_audit param - not in audit mode"),V("Syntro Runtime","================================"),!1)},MS=()=>VT()?"editor":zT()?"audit":null;function HT(){if(typeof window>"u")return null;let t=new URLSearchParams(window.location.search);return t.get("editor_token")||t.get("audit_token")}var FS=async t=>{if(V("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){V("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){V("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}let e=typeof t=="string"?{editorUrl:t}:t??{},n=new URLSearchParams(window.location.search),r=n.get("syntro_editor_sdk_url"),i=n.get("api_base"),o=i?`${i}/api/editor/sdk/editor-sdk.js`:null,s=r||o||e.editorUrl||NS,a=HT();if(!a){Bt("Syntro Runtime","\u274C No token found in URL params. SDK requires editor_token or audit_token."),V("Syntro Runtime","================================");return}let l=`${s}?token=${encodeURIComponent(a)}`;if(V("Syntro Runtime","Editor URL:",l),V("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,isDefault:s===NS,hasApiBase:!!i,tokenPrefix:a.slice(0,10)+"..."}),!BT(s)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",s),V("Syntro Runtime","================================");return}return V("Syntro Runtime","\u2713 URL validated, injecting script tag..."),new Promise((c,u)=>{let f=document.createElement("script");f.src=l,f.async=!0,e.integrity&&(f.integrity=e.integrity,f.crossOrigin="anonymous",V("Syntro Runtime","SRI integrity check enabled")),f.onload=()=>{V("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),V("Syntro Runtime","window.SyntroEditor:",!!window.SyntroEditor),V("Syntro Runtime","================================"),c()},f.onerror=h=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",h),console.error("[Syntro Runtime] URL attempted:",l),console.error("[Syntro Runtime] Check: Is the URL accessible? CORS? Network? Token valid?"),V("Syntro Runtime","================================"),u(h)},document.head.appendChild(f),V("Syntro Runtime","Script tag appended to <head>")})};var Hg=async(t={})=>{if(typeof window>"u"||typeof document>"u")throw new Error("SmartCanvas can only be created in a browser-like environment");let e=null;if(t.antiFlicker){let d=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=IS(d)}let n=null,r=null,i=null,o=!0,s=t.runtime;async function a(d){!s?.actions||d.length===0||(i?.isApplied()&&await i.revertAll(),i=await s.actions.applyBatch(d))}async function l(){i?.isApplied()&&(await i.revertAll(),i=null)}if(t.fetcher)try{r=t.fetcher;let d=await t.fetcher();n=d,d.actions&&d.actions.length>0&&s?.actions&&await a(d.actions)}catch(d){console.error("[SmartCanvas] Error fetching/applying initial config:",d)}e&&e();let c=MS();c&&(console.log(`[SmartCanvas] Loading editor SDK for ${c} mode`),FS(t.editorUrl).catch(console.error)),AS();let u=document.createElement("smart-canvas");if(t.tokens)for(let[d,p]of Object.entries(t.tokens))u.style.setProperty(d,p);let f=()=>{let d=t.target??document.body;d&&d.appendChild(u)};document.body?f():document.addEventListener("DOMContentLoaded",f,{once:!0});let h=t.integrations?.experiments,g=t.integrations?.telemetry,v=t.fetcher??es({configUri:t.configUri,experiments:h,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});r||(r=v);let _={fetcher:v,pollIntervalMs:t.pollIntervalMs,experiments:h,telemetry:g,runtime:s,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,theme:t.theme};u.mountReactApp(_),t.defaultOpen&&u.open();let x={el:u,open:()=>u.open(),close:()=>u.close(),destroy:()=>{l(),u.remove()},setTokens:d=>{for(let[p,m]of Object.entries(d))u.style.setProperty(p,m)},getConfig:async()=>{if(r)try{let d=await r();return n=d,d}catch(d){console.error("[SmartCanvas] Error fetching config:",d)}return n},updateConfig:async d=>{n=d,o&&await a(d.actions)},setEnabled:async d=>{o=d,d?n&&await a(n.actions):await l()},registerComponent:(d,p)=>u.registerComponent(d,p),setOverrideFetcher:d=>{r=d,u.setOverrideFetcher(d)},registerTelemetryProperties:d=>{g?.register?.(d)},getSessionId:()=>g?.getSessionId?.(),startSessionRecording:()=>{g?.startSessionRecording?.()},runtime:s};return typeof window<"u"&&c&&(window.__smartCanvasHandle=x),x};typeof window<"u"&&(window.SmartCanvas={async create(t){return Hg(t)}});var S={};Wk(S,{BRAND:()=>hP,DIRTY:()=>Ni,EMPTY_PATH:()=>qT,INVALID:()=>U,NEVER:()=>QP,OK:()=>lt,ParseStatus:()=>tt,Schema:()=>J,ZodAny:()=>oi,ZodArray:()=>fr,ZodBigInt:()=>Mi,ZodBoolean:()=>Fi,ZodBranded:()=>Ua,ZodCatch:()=>Ki,ZodDate:()=>$i,ZodDefault:()=>qi,ZodDiscriminatedUnion:()=>Ru,ZodEffects:()=>Jt,ZodEnum:()=>Ui,ZodError:()=>Rt,ZodFirstPartyTypeKind:()=>q,ZodFunction:()=>Pu,ZodIntersection:()=>zi,ZodIssueCode:()=>R,ZodLazy:()=>Hi,ZodLiteral:()=>ji,ZodMap:()=>as,ZodNaN:()=>cs,ZodNativeEnum:()=>Wi,ZodNever:()=>hn,ZodNull:()=>Bi,ZodNullable:()=>On,ZodNumber:()=>Li,ZodObject:()=>Tt,ZodOptional:()=>Xt,ZodParsedType:()=>M,ZodPipeline:()=>Wa,ZodPromise:()=>si,ZodReadonly:()=>Gi,ZodRecord:()=>Tu,ZodSchema:()=>J,ZodSet:()=>ls,ZodString:()=>ii,ZodSymbol:()=>os,ZodTransformer:()=>Jt,ZodTuple:()=>In,ZodType:()=>J,ZodUndefined:()=>Di,ZodUnion:()=>Vi,ZodUnknown:()=>dr,ZodVoid:()=>ss,addIssueToContext:()=>I,any:()=>bP,array:()=>AP,bigint:()=>yP,boolean:()=>KS,coerce:()=>XP,custom:()=>US,date:()=>_P,datetimeRegex:()=>HS,defaultErrorMap:()=>cr,discriminatedUnion:()=>IP,effect:()=>jP,enum:()=>VP,function:()=>$P,getErrorMap:()=>ns,getParsedType:()=>Pn,instanceof:()=>mP,intersection:()=>OP,isAborted:()=>Cu,isAsync:()=>rs,isDirty:()=>Au,isValid:()=>ri,late:()=>gP,lazy:()=>DP,literal:()=>BP,makeIssue:()=>ja,map:()=>MP,nan:()=>vP,nativeEnum:()=>zP,never:()=>EP,null:()=>SP,nullable:()=>WP,number:()=>qS,object:()=>RP,objectUtil:()=>jg,oboolean:()=>YP,onumber:()=>ZP,optional:()=>UP,ostring:()=>GP,pipeline:()=>KP,preprocess:()=>qP,promise:()=>HP,quotelessJson:()=>jT,record:()=>LP,set:()=>FP,setErrorMap:()=>WT,strictObject:()=>TP,string:()=>WS,symbol:()=>wP,transformer:()=>jP,tuple:()=>NP,undefined:()=>xP,union:()=>PP,unknown:()=>kP,util:()=>re,void:()=>CP});var re;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var jg;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(jg||(jg={}));var M=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pn=t=>{switch(typeof t){case"undefined":return M.undefined;case"string":return M.string;case"number":return Number.isNaN(t)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":return Array.isArray(t)?M.array:t===null?M.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?M.promise:typeof Map<"u"&&t instanceof Map?M.map:typeof Set<"u"&&t instanceof Set?M.set:typeof Date<"u"&&t instanceof Date?M.date:M.object;default:return M.unknown}};var R=re.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"]),jT=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Rt=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 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},r={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){let c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(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,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];n[o]=n[o]||[],n[o].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Rt.create=t=>new Rt(t);var UT=(t,e)=>{let n;switch(t.code){case R.invalid_type:t.received===M.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case R.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,re.jsonStringifyReplacer)}`;break;case R.unrecognized_keys:n=`Unrecognized key(s) in object: ${re.joinValues(t.keys,", ")}`;break;case R.invalid_union:n="Invalid input";break;case R.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${re.joinValues(t.options)}`;break;case R.invalid_enum_value:n=`Invalid enum value. Expected ${re.joinValues(t.options)}, received '${t.received}'`;break;case R.invalid_arguments:n="Invalid function arguments";break;case R.invalid_return_type:n="Invalid function return type";break;case R.invalid_date:n="Invalid date";break;case R.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}"`:re.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case R.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 R.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 R.custom:n="Invalid input";break;case R.invalid_intersection_types:n="Intersection results could not be merged";break;case R.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case R.not_finite:n="Number must be finite";break;default:n=e.defaultError,re.assertNever(t)}return{message:n}},cr=UT;var $S=cr;function WT(t){$S=t}function ns(){return $S}var ja=t=>{let{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",l=r.filter(c=>!!c).slice().reverse();for(let c of l)a=c(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},qT=[];function I(t,e){let n=ns(),r=ja({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===cr?void 0:cr].filter(i=>!!i)});t.common.issues.push(r)}var tt=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 r=[];for(let i of n){if(i.status==="aborted")return U;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let i of n){let o=await i.key,s=await i.value;r.push({key:o,value:s})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let i of n){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return U;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:e.value,value:r}}},U=Object.freeze({status:"aborted"}),Ni=t=>({status:"dirty",value:t}),lt=t=>({status:"valid",value:t}),Cu=t=>t.status==="aborted",Au=t=>t.status==="dirty",ri=t=>t.status==="valid",rs=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 Qt=class{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}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}},DS=(t,e)=>{if(ri(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 Rt(t.common.issues);return this._error=n,this._error}}};function Q(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:i}}var J=class{get description(){return this._def.description}_getType(e){return Pn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Pn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new tt,ctx:{common:e.parent.common,data:e.data,parsedType:Pn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(rs(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 r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return DS(r,i)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pn(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return ri(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>ri(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pn(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(rs(i)?i:Promise.resolve(i));return DS(r,o)}refine(e,n){let r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:R.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Jt({schema:this,typeName:q.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 Xt.create(this,this._def)}nullable(){return On.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fr.create(this)}promise(){return si.create(this,this._def)}or(e){return Vi.create([this,e],this._def)}and(e){return zi.create(this,e,this._def)}transform(e){return new Jt({...Q(this._def),schema:this,typeName:q.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new qi({...Q(this._def),innerType:this,defaultValue:n,typeName:q.ZodDefault})}brand(){return new Ua({typeName:q.ZodBranded,type:this,...Q(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Ki({...Q(this._def),innerType:this,catchValue:n,typeName:q.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Wa.create(this,e)}readonly(){return Gi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},KT=/^c[^\s-]{8,}$/i,GT=/^[0-9a-z]+$/,ZT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,YT=/^[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,XT=/^[a-z0-9_-]{21}$/i,QT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,JT=/^[-+]?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)?)??$/,eP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ug,nP=/^(?:(?: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])$/,rP=/^(?:(?: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])$/,iP=/^(([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]))$/,oP=/^(([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])$/,sP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aP=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,VS="((\\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])))",lP=new RegExp(`^${VS}$`);function zS(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 cP(t){return new RegExp(`^${zS(t)}$`)}function HS(t){let e=`${VS}T${zS(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 uP(t,e){return!!((e==="v4"||!e)&&nP.test(t)||(e==="v6"||!e)&&iP.test(t))}function dP(t,e){if(!QT.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function fP(t,e){return!!((e==="v4"||!e)&&rP.test(t)||(e==="v6"||!e)&&oP.test(t))}var ii=class t extends J{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==M.string){let o=this._getOrReturnCtx(e);return I(o,{code:R.invalid_type,expected:M.string,received:o.parsedType}),U}let r=new tt,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),I(i,{code:R.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&&(i=this._getOrReturnCtx(e,i),I(i,{code:R.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?I(i,{code:R.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&I(i,{code:R.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")eP.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"email",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Ug||(Ug=new RegExp(tP,"u")),Ug.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"emoji",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")YT.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"uuid",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")XT.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"nanoid",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")KT.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"cuid",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")GT.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"cuid2",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")ZT.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"ulid",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),I(i,{validation:"url",code:R.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"regex",code:R.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)||(i=this._getOrReturnCtx(e,i),I(i,{code:R.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)||(i=this._getOrReturnCtx(e,i),I(i,{code:R.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),I(i,{code:R.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?HS(o).test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{code:R.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?lP.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{code:R.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?cP(o).test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{code:R.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?JT.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"duration",code:R.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?uP(e.data,o.version)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"ip",code:R.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?dP(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"jwt",code:R.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?fP(e.data,o.version)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"cidr",code:R.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?sP.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"base64",code:R.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?aP.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"base64url",code:R.invalid_string,message:o.message}),r.dirty()):re.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:R.invalid_string,...z.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...z.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...z.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...z.errToObj(e)})}regex(e,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}};ii.create=t=>new ii({checks:[],typeName:q.ZodString,coerce:t?.coerce??!1,...Q(t)});function pP(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}var Li=class t extends J{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)!==M.number){let o=this._getOrReturnCtx(e);return I(o,{code:R.invalid_type,expected:M.number,received:o.parsedType}),U}let r,i=new tt;for(let o of this._def.checks)o.kind==="int"?re.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{code:R.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),I(r,{code:R.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),I(r,{code:R.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?pP(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),I(r,{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{code:R.not_finite,message:o.message}),i.dirty()):re.assertNever(o);return{status:i.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,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:z.toString(i)}]})}_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"&&re.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Li.create=t=>new Li({checks:[],typeName:q.ZodNumber,coerce:t?.coerce||!1,...Q(t)});var Mi=class t extends J{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)!==M.bigint)return this._getInvalidInput(e);let r,i=new tt;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),I(r,{code:R.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),I(r,{code:R.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),I(r,{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):re.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return I(n,{code:R.invalid_type,expected:M.bigint,received:n.parsedType}),U}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,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:z.toString(i)}]})}_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}};Mi.create=t=>new Mi({checks:[],typeName:q.ZodBigInt,coerce:t?.coerce??!1,...Q(t)});var Fi=class extends J{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==M.boolean){let r=this._getOrReturnCtx(e);return I(r,{code:R.invalid_type,expected:M.boolean,received:r.parsedType}),U}return lt(e.data)}};Fi.create=t=>new Fi({typeName:q.ZodBoolean,coerce:t?.coerce||!1,...Q(t)});var $i=class t extends J{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==M.date){let o=this._getOrReturnCtx(e);return I(o,{code:R.invalid_type,expected:M.date,received:o.parsedType}),U}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return I(o,{code:R.invalid_date}),U}let r=new tt,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),I(i,{code:R.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),I(i,{code:R.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):re.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,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}};$i.create=t=>new $i({checks:[],coerce:t?.coerce||!1,typeName:q.ZodDate,...Q(t)});var os=class extends J{_parse(e){if(this._getType(e)!==M.symbol){let r=this._getOrReturnCtx(e);return I(r,{code:R.invalid_type,expected:M.symbol,received:r.parsedType}),U}return lt(e.data)}};os.create=t=>new os({typeName:q.ZodSymbol,...Q(t)});var Di=class extends J{_parse(e){if(this._getType(e)!==M.undefined){let r=this._getOrReturnCtx(e);return I(r,{code:R.invalid_type,expected:M.undefined,received:r.parsedType}),U}return lt(e.data)}};Di.create=t=>new Di({typeName:q.ZodUndefined,...Q(t)});var Bi=class extends J{_parse(e){if(this._getType(e)!==M.null){let r=this._getOrReturnCtx(e);return I(r,{code:R.invalid_type,expected:M.null,received:r.parsedType}),U}return lt(e.data)}};Bi.create=t=>new Bi({typeName:q.ZodNull,...Q(t)});var oi=class extends J{constructor(){super(...arguments),this._any=!0}_parse(e){return lt(e.data)}};oi.create=t=>new oi({typeName:q.ZodAny,...Q(t)});var dr=class extends J{constructor(){super(...arguments),this._unknown=!0}_parse(e){return lt(e.data)}};dr.create=t=>new dr({typeName:q.ZodUnknown,...Q(t)});var hn=class extends J{_parse(e){let n=this._getOrReturnCtx(e);return I(n,{code:R.invalid_type,expected:M.never,received:n.parsedType}),U}};hn.create=t=>new hn({typeName:q.ZodNever,...Q(t)});var ss=class extends J{_parse(e){if(this._getType(e)!==M.undefined){let r=this._getOrReturnCtx(e);return I(r,{code:R.invalid_type,expected:M.void,received:r.parsedType}),U}return lt(e.data)}};ss.create=t=>new ss({typeName:q.ZodVoid,...Q(t)});var fr=class t extends J{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==M.array)return I(n,{code:R.invalid_type,expected:M.array,received:n.parsedType}),U;if(i.exactLength!==null){let s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(I(n,{code:s?R.too_big:R.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(I(n,{code:R.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(I(n,{code:R.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new Qt(n,s,n.path,a)))).then(s=>tt.mergeArray(r,s));let o=[...n.data].map((s,a)=>i.type._parseSync(new Qt(n,s,n.path,a)));return tt.mergeArray(r,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)}};fr.create=(t,e)=>new fr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:q.ZodArray,...Q(e)});function is(t){if(t instanceof Tt){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Xt.create(is(r))}return new Tt({...t._def,shape:()=>e})}else return t instanceof fr?new fr({...t._def,type:is(t.element)}):t instanceof Xt?Xt.create(is(t.unwrap())):t instanceof On?On.create(is(t.unwrap())):t instanceof In?In.create(t.items.map(e=>is(e))):t}var Tt=class t extends J{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=re.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==M.object){let c=this._getOrReturnCtx(e);return I(c,{code:R.invalid_type,expected:M.object,received:c.parsedType}),U}let{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof hn&&this._def.unknownKeys==="strip"))for(let c in i.data)s.includes(c)||a.push(c);let l=[];for(let c of s){let u=o[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Qt(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof hn){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(I(i,{code:R.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of a){let f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Qt(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let f=await u.key,h=await u.value;c.push({key:f,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>tt.mergeObjectSync(r,c)):tt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return z.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:z.errToObj(e).message??i}:{message:i}}}:{}})}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:q.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of re.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of re.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return is(this)}partial(e){let n={};for(let r of re.objectKeys(this.shape)){let i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of re.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Xt;)o=o._def.innerType;n[r]=o}return new t({...this._def,shape:()=>n})}keyof(){return jS(re.objectKeys(this.shape))}};Tt.create=(t,e)=>new Tt({shape:()=>t,unknownKeys:"strip",catchall:hn.create(),typeName:q.ZodObject,...Q(e)});Tt.strictCreate=(t,e)=>new Tt({shape:()=>t,unknownKeys:"strict",catchall:hn.create(),typeName:q.ZodObject,...Q(e)});Tt.lazycreate=(t,e)=>new Tt({shape:t,unknownKeys:"strip",catchall:hn.create(),typeName:q.ZodObject,...Q(e)});var Vi=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new Rt(a.ctx.common.issues));return I(n,{code:R.invalid_union,unionErrors:s}),U}if(n.common.async)return Promise.all(r.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let l of r){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&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(l=>new Rt(l));return I(n,{code:R.invalid_union,unionErrors:a}),U}}get options(){return this._def.options}};Vi.create=(t,e)=>new Vi({options:t,typeName:q.ZodUnion,...Q(e)});var ur=t=>t instanceof Hi?ur(t.schema):t instanceof Jt?ur(t.innerType()):t instanceof ji?[t.value]:t instanceof Ui?t.options:t instanceof Wi?re.objectValues(t.enum):t instanceof qi?ur(t._def.innerType):t instanceof Di?[void 0]:t instanceof Bi?[null]:t instanceof Xt?[void 0,...ur(t.unwrap())]:t instanceof On?[null,...ur(t.unwrap())]:t instanceof Ua||t instanceof Gi?ur(t.unwrap()):t instanceof Ki?ur(t._def.innerType):[],Ru=class t extends J{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.object)return I(n,{code:R.invalid_type,expected:M.object,received:n.parsedType}),U;let r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);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}):(I(n,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),U)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let i=new Map;for(let o of n){let s=ur(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:q.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Q(r)})}};function Wg(t,e){let n=Pn(t),r=Pn(e);if(t===e)return{valid:!0,data:t};if(n===M.object&&r===M.object){let i=re.objectKeys(e),o=re.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let l=Wg(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===M.array&&r===M.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],l=Wg(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===M.date&&r===M.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var zi=class extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=(o,s)=>{if(Cu(o)||Cu(s))return U;let a=Wg(o.value,s.value);return a.valid?((Au(o)||Au(s))&&n.dirty(),{status:n.value,value:a.data}):(I(r,{code:R.invalid_intersection_types}),U)};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,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};zi.create=(t,e,n)=>new zi({left:t,right:e,typeName:q.ZodIntersection,...Q(n)});var In=class t extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.array)return I(r,{code:R.invalid_type,expected:M.array,received:r.parsedType}),U;if(r.data.length<this._def.items.length)return I(r,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),U;!this._def.rest&&r.data.length>this._def.items.length&&(I(r,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...r.data].map((s,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new Qt(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>tt.mergeArray(n,s)):tt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};In.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new In({items:t,typeName:q.ZodTuple,rest:null,...Q(e)})};var Tu=class t extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.object)return I(r,{code:R.invalid_type,expected:M.object,received:r.parsedType}),U;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in r.data)i.push({key:o._parse(new Qt(r,a,r.path,a)),value:s._parse(new Qt(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?tt.mergeObjectAsync(n,i):tt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof J?new t({keyType:e,valueType:n,typeName:q.ZodRecord,...Q(r)}):new t({keyType:ii.create(),valueType:e,typeName:q.ZodRecord,...Q(n)})}},as=class extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.map)return I(r,{code:R.invalid_type,expected:M.map,received:r.parsedType}),U;let i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new Qt(r,a,r.path,[c,"key"])),value:o._parse(new Qt(r,l,r.path,[c,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of s){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return U;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let l of s){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return U;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}};as.create=(t,e,n)=>new as({valueType:e,keyType:t,typeName:q.ZodMap,...Q(n)});var ls=class t extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.set)return I(r,{code:R.invalid_type,expected:M.set,received:r.parsedType}),U;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(I(r,{code:R.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(I(r,{code:R.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function s(l){let c=new Set;for(let u of l){if(u.status==="aborted")return U;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}let a=[...r.data.values()].map((l,c)=>o._parse(new Qt(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}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)}};ls.create=(t,e)=>new ls({valueType:t,minSize:null,maxSize:null,typeName:q.ZodSet,...Q(e)});var Pu=class t extends J{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.function)return I(n,{code:R.invalid_type,expected:M.function,received:n.parsedType}),U;function r(a,l){return ja({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ns(),cr].filter(c=>!!c),issueData:{code:R.invalid_arguments,argumentsError:l}})}function i(a,l){return ja({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ns(),cr].filter(c=>!!c),issueData:{code:R.invalid_return_type,returnTypeError:l}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof si){let a=this;return lt(async function(...l){let c=new Rt([]),u=await a._def.args.parseAsync(l,o).catch(g=>{throw c.addIssue(r(l,g)),c}),f=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(f,o).catch(g=>{throw c.addIssue(i(f,g)),c})})}else{let a=this;return lt(function(...l){let c=a._def.args.safeParse(l,o);if(!c.success)throw new Rt([r(l,c.error)]);let u=Reflect.apply(s,this,c.data),f=a._def.returns.safeParse(u,o);if(!f.success)throw new Rt([i(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:In.create(e).rest(dr.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,r){return new t({args:e||In.create([]).rest(dr.create()),returns:n||dr.create(),typeName:q.ZodFunction,...Q(r)})}},Hi=class extends J{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})}};Hi.create=(t,e)=>new Hi({getter:t,typeName:q.ZodLazy,...Q(e)});var ji=class extends J{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return I(n,{received:n.data,code:R.invalid_literal,expected:this._def.value}),U}return{status:"valid",value:e.data}}get value(){return this._def.value}};ji.create=(t,e)=>new ji({value:t,typeName:q.ZodLiteral,...Q(e)});function jS(t,e){return new Ui({values:t,typeName:q.ZodEnum,...Q(e)})}var Ui=class t extends J{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return I(n,{expected:re.joinValues(r),received:n.parsedType,code:R.invalid_type}),U}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return I(n,{received:n.data,code:R.invalid_enum_value,options:r}),U}return lt(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(r=>!e.includes(r)),{...this._def,...n})}};Ui.create=jS;var Wi=class extends J{_parse(e){let n=re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==M.string&&r.parsedType!==M.number){let i=re.objectValues(n);return I(r,{expected:re.joinValues(i),received:r.parsedType,code:R.invalid_type}),U}if(this._cache||(this._cache=new Set(re.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=re.objectValues(n);return I(r,{received:r.data,code:R.invalid_enum_value,options:i}),U}return lt(e.data)}get enum(){return this._def.values}};Wi.create=(t,e)=>new Wi({values:t,typeName:q.ZodNativeEnum,...Q(e)});var si=class extends J{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.promise&&n.common.async===!1)return I(n,{code:R.invalid_type,expected:M.promise,received:n.parsedType}),U;let r=n.parsedType===M.promise?n.data:Promise.resolve(n.data);return lt(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};si.create=(t,e)=>new si({type:t,typeName:q.ZodPromise,...Q(e)});var Jt=class extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{I(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return U;let l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?U:l.status==="dirty"?Ni(l.value):n.value==="dirty"?Ni(l.value):l});{if(n.value==="aborted")return U;let a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?U:a.status==="dirty"?Ni(a.value):n.value==="dirty"?Ni(a.value):a}}if(i.type==="refinement"){let s=a=>{let l=i.refinement(a,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 a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?U:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?U:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ri(s))return U;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>ri(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):U);re.assertNever(i)}};Jt.create=(t,e,n)=>new Jt({schema:t,typeName:q.ZodEffects,effect:e,...Q(n)});Jt.createWithPreprocess=(t,e,n)=>new Jt({schema:e,effect:{type:"preprocess",transform:t},typeName:q.ZodEffects,...Q(n)});var Xt=class extends J{_parse(e){return this._getType(e)===M.undefined?lt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Xt.create=(t,e)=>new Xt({innerType:t,typeName:q.ZodOptional,...Q(e)});var On=class extends J{_parse(e){return this._getType(e)===M.null?lt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};On.create=(t,e)=>new On({innerType:t,typeName:q.ZodNullable,...Q(e)});var qi=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===M.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};qi.create=(t,e)=>new qi({innerType:t,typeName:q.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Q(e)});var Ki=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return rs(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Rt(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Rt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Ki.create=(t,e)=>new Ki({innerType:t,typeName:q.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Q(e)});var cs=class extends J{_parse(e){if(this._getType(e)!==M.nan){let r=this._getOrReturnCtx(e);return I(r,{code:R.invalid_type,expected:M.nan,received:r.parsedType}),U}return{status:"valid",value:e.data}}};cs.create=t=>new cs({typeName:q.ZodNaN,...Q(t)});var hP=Symbol("zod_brand"),Ua=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Wa=class t extends J{_parse(e){let{status:n,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"?U:o.status==="dirty"?(n.dirty(),Ni(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?U:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:q.ZodPipeline})}},Gi=class extends J{_parse(e){let n=this._def.innerType._parse(e),r=i=>(ri(i)&&(i.value=Object.freeze(i.value)),i);return rs(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};Gi.create=(t,e)=>new Gi({innerType:t,typeName:q.ZodReadonly,...Q(e)});function BS(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function US(t,e={},n){return t?oi.create().superRefine((r,i)=>{let o=t(r);if(o instanceof Promise)return o.then(s=>{if(!s){let a=BS(e,r),l=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:l})}});if(!o){let s=BS(e,r),a=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:a})}}):oi.create()}var gP={object:Tt.lazycreate},q;(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"})(q||(q={}));var mP=(t,e={message:`Input not instance of ${t.name}`})=>US(n=>n instanceof t,e),WS=ii.create,qS=Li.create,vP=cs.create,yP=Mi.create,KS=Fi.create,_P=$i.create,wP=os.create,xP=Di.create,SP=Bi.create,bP=oi.create,kP=dr.create,EP=hn.create,CP=ss.create,AP=fr.create,RP=Tt.create,TP=Tt.strictCreate,PP=Vi.create,IP=Ru.create,OP=zi.create,NP=In.create,LP=Tu.create,MP=as.create,FP=ls.create,$P=Pu.create,DP=Hi.create,BP=ji.create,VP=Ui.create,zP=Wi.create,HP=si.create,jP=Jt.create,UP=Xt.create,WP=On.create,qP=Jt.createWithPreprocess,KP=Wa.create,GP=()=>WS().optional(),ZP=()=>qS().optional(),YP=()=>KS().optional(),XP={string:(t=>ii.create({...t,coerce:!0})),number:(t=>Li.create({...t,coerce:!0})),boolean:(t=>Fi.create({...t,coerce:!0})),bigint:(t=>Mi.create({...t,coerce:!0})),date:(t=>$i.create({...t,coerce:!0}))};var QP=U;var GS=S.union([S.object({type:S.literal("data"),key:S.string(),value:S.string().optional()}),S.object({type:S.literal("css"),value:S.string()}),S.object({type:S.literal("aria"),role:S.string().optional(),label:S.string().optional()}),S.object({type:S.literal("shadow-css"),value:S.string()}),S.object({type:S.literal("ref"),el:S.any()})]),JP=S.object({kind:S.literal("tooltip"),id:S.string(),anchor:GS,content:S.object({title:S.string().optional(),body:S.string()}),placement:S.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:S.number().optional(),blocking:S.boolean().optional(),trigger:S.enum(["immediate","hover","click"]).optional(),dismiss:S.object({onEsc:S.boolean().optional(),closeButton:S.boolean().optional(),timeoutMs:S.number().optional()}).optional()}),eI=S.object({kind:S.literal("highlight"),id:S.string(),anchor:GS,copy:S.string().optional(),ring:S.object({paddingPx:S.number().optional(),radiusPx:S.number().optional()}).optional(),scrim:S.object({opacity:S.number().optional()}).optional(),ringColor:S.string().optional(),blocking:S.boolean().optional(),dismiss:S.object({onClickOutside:S.boolean().optional(),onEsc:S.boolean().optional(),timeoutMs:S.number().optional()}).optional()}),qg=S.object({id:S.string(),version:S.number(),routes:S.array(S.string()).optional(),steps:S.array(S.union([JP,eI]))});function yM(t){return qg.parse(t)}var SM=({configUri:t,experiments:e,featureKey:n="smart-canvas-overlay-uri",credentials:r="include"}={})=>async()=>{let i=$g({configUri:t,experiments:e,featureKey:n});if(!i)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(i,{credentials:r});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let s=await o.json();return qg.parse(s)};var ZS="syntro_session_metrics",Iu=class{constructor(e={}){j(this,"metrics",new Map);j(this,"experiments");j(this,"attributePrefix");j(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,n=1){let i=(this.metrics.get(e)??0)+n;return this.metrics.set(e,i),this.saveToStorage(),this.updateExperimentAttributes(e,i),this.onMetricChange?.(e,i),i}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 r of e)n[`${this.attributePrefix}${r}`]=0,this.onMetricChange?.(r,0);this.experiments?.setAttributes?.(n)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,n){if(!this.experiments?.setAttributes)return;let r=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[r]:n})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[n,r]of this.metrics)e[`${this.attributePrefix}${n}`]=r;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(ZS);if(e){let n=JSON.parse(e);for(let[r,i]of Object.entries(n))this.metrics.set(r,i.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,r]of this.metrics)e[n]={count:r,lastUpdated:Date.now()};sessionStorage.setItem(ZS,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function Kg(t={}){return new Iu(t)}var tI=S.object({url:S.string(),routeId:S.string().optional(),title:S.string().optional(),locale:S.string().optional()}),nI=S.object({url:S.string(),ts:S.number()}),rI=S.object({sessionId:S.string(),startTs:S.number(),pageHistory:S.array(nI).optional()}),iI=S.object({width:S.number(),height:S.number()}),oI=S.object({x:S.number(),y:S.number(),w:S.number(),h:S.number()}),sI=S.object({anchorId:S.string(),present:S.boolean(),visible:S.boolean().optional(),boundingBox:oI.optional()}),aI=S.record(S.union([S.number(),S.string(),S.boolean(),S.undefined()])),lI=S.object({page:tI,session:rI,viewport:iI,anchors:S.array(sI).optional(),augmented:aI.optional()});function TM(t){return lI.safeParse(t)}function cI(){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 Gg(t,e){if(!e)return;let n;try{n=new URL(t).pathname}catch{n=t}if(e.exclude){for(let r of e.exclude)if(YS(n,r))return}if(e.include){for(let r of e.include)if(YS(n,r))return r;return}return n}function YS(t,e){let n=t.replace(/\/$/,"")||"/",r=e.replace(/\/$/,"")||"/";if(n===r)return!0;let i=r.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${i}$`).test(n)}var Ou=class{constructor(e={}){j(this,"context");j(this,"previousContext");j(this,"listeners",new Set);j(this,"telemetry");j(this,"routes");j(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.context=cI(),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=Gg(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=Gg(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)};window.addEventListener("resize",n),this.cleanupFns.push(()=>window.removeEventListener("resize",n));let r=()=>{this.updatePage()};window.addEventListener("popstate",r),this.cleanupFns.push(()=>window.removeEventListener("popstate",r));let i=history.pushState.bind(history),o=history.replaceState.bind(history);history.pushState=(...s)=>{i(...s),this.updatePage()},history.replaceState=(...s)=>{o(...s),this.updatePage()},this.cleanupFns.push(()=>{history.pushState=i,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,n=document.title,r=Gg(e,this.routes),i={url:e,title:n,routeId:r};(i.url!==this.context.page.url||i.title!==this.context.page.title||i.routeId!==this.context.page.routeId)&&(i.url!==this.context.page.url&&this.addPageToHistory(i.url),this.updateContext({page:i}))}addPageToHistory(e){let n={url:e,ts:Date.now()},r=[...this.context.session.pageHistory||[],n];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(n){console.error("[ContextManager] Listener error:",n)}}};function Zg(t={}){return new Ou(t)}var XS=S.enum(["posthog","canvas","derived"]),uI=S.object({ts:S.number(),name:S.string(),source:XS,props:S.record(S.unknown()).optional(),schemaVersion:S.string()}),dI=S.object({names:S.array(S.string()).optional(),patterns:S.array(S.string()).optional(),sources:S.array(XS).optional()});function DM(t){return uI.safeParse(t)}function BM(t){return dI.safeParse(t)}function Yg(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 Nu=class{constructor(e={}){j(this,"subscriptions",new Set);j(this,"history",[]);j(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,n){let r,i;typeof e=="function"?(r=void 0,i=e):(r=e,i=n);let o={filter:r,callback:i};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,n,r="canvas"){let i={ts:Date.now(),name:e,source:r,props:n,schemaVersion:ko};this.publishEvent(i)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let n of this.subscriptions)if(Yg(e,n.filter))try{n.callback(e)}catch(r){console.error("[EventBus] Subscriber error:",r)}}getRecent(e,n){let r=this.history;return e&&(r=r.filter(i=>Yg(i,e))),n&&n>0&&(r=r.slice(-n)),r}hasRecentEvent(e,n,r){let i=Date.now()-n;return this.history.some(o=>o.name===e&&o.ts>=i&&(r===void 0||o.source===r))}countRecentEvents(e,n){let r=this.history.filter(i=>Yg(i,e));if(n!==void 0){let i=Date.now()-n;r=r.filter(o=>o.ts>=i)}return r.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function qa(t={}){return new Nu(t)}var QS={$autocapture:"ui.click",$click:Ce.UI_CLICK,$scroll:Ce.UI_SCROLL,$input:Ce.UI_INPUT,$change:Ce.UI_CHANGE,$submit:Ce.UI_SUBMIT,$pageview:Ce.NAV_PAGE_VIEW,$pageleave:Ce.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function fI(t){let e=t.event;if(QS[e])return QS[e];if(e==="$autocapture"){let n=t.properties?.$tag_name,r=t.properties?.$event_type;return r==="submit"?Ce.UI_SUBMIT:r==="change"?Ce.UI_CHANGE:n==="input"||n==="textarea"?Ce.UI_INPUT:Ce.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function pI(t){let e={},n=t.properties||{};return n.$tag_name&&(e.tagName=n.$tag_name),n.$el_text&&(e.elementText=n.$el_text),n.$elements&&(e.elements=n.$elements),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 JS(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:fI(t),source:"posthog",props:pI(t),schemaVersion:ko}}function eb(t){let e=t.event;return!["$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 Xg(t){return(e,n)=>{let r={event:e,properties:n,timestamp:Date.now()};if(eb(r)){let i=JS(r);t(i)}}}var hI=S.object({value:S.unknown(),expiresAt:S.number().optional()}),gI=S.object({count:S.number(),resetAt:S.number().optional()});function JM(t){return hI.safeParse(t)}function eF(t){return gI.safeParse(t)}var Ka="dismissed:";function tb(t,e){return{mark(n,r=!1){let i=Ka+n;(r?e:t).set(i,!0)},isDismissed(n){let r=Ka+n;return t.has(r)||e.has(r)},clear(n){let r=Ka+n;t.remove(r),e.remove(r)},clearAll(){for(let n of t.keys())n.startsWith(Ka)&&t.remove(n);for(let n of e.keys())n.startsWith(Ka)&&e.remove(n)}}}var Qg="cooldown:";function nb(t){return{set(e,n){let r=Qg+e,i=Date.now()+n;t.set(r,i)},isActive(e){return this.remaining(e)>0},remaining(e){let n=Qg+e,r=t.get(n);if(r===void 0)return 0;let i=r-Date.now();return i<=0?(t.remove(n),0):i},clear(e){let n=Qg+e;t.remove(n)}}}var Jg="freq:";function rb(t){function e(n){let r=Jg+n,i=t.get(r);if(i){if(i.resetAt&&Date.now()>=i.resetAt){t.remove(r);return}return i}}return{increment(n,r){let i=Jg+n,o=e(n),s=(o?.count??0)+1,a={count:s,resetAt:o?.resetAt??(r?Date.now()+r:void 0)};return t.set(i,a),s},count(n){return e(n)?.count??0},reset(n){let r=Jg+n;t.remove(r)},hasReachedLimit(n,r){return this.count(n)>=r}}}var mI="syntro";function em(t,e){let n=`${e}:`;return{get(r){if(t)try{let i=t.getItem(n+r);if(!i)return;let o=JSON.parse(i);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(n+r);return}return o.value}catch{return}},set(r,i,o){if(t)try{let s={value:i,expiresAt:o?Date.now()+o:void 0};t.setItem(n+r,JSON.stringify(s))}catch(s){console.warn("[StateStore] Failed to save:",s)}},remove(r){t&&t.removeItem(n+r)},has(r){return t?this.get(r)!==void 0:!1},keys(){if(!t)return[];let r=[];for(let i=0;i<t.length;i++){let o=t.key(i);o?.startsWith(n)&&r.push(o.slice(n.length))}return r},clear(){if(!t)return;let r=this.keys();for(let i of r)t.removeItem(n+i)}}}function tm(t){let e=new Map,n=`${t}:`;return{get(r){let i=e.get(n+r);if(i){if(i.expiresAt&&Date.now()>=i.expiresAt){e.delete(n+r);return}return i.value}},set(r,i,o){e.set(n+r,{value:i,expiresAt:o?Date.now()+o:void 0})},remove(r){e.delete(n+r)},has(r){return this.get(r)!==void 0},keys(){let r=[];for(let i of e.keys())i.startsWith(n)&&r.push(i.slice(n.length));return r},clear(){for(let r of e.keys())r.startsWith(n)&&e.delete(r)}}}var Lu=class{constructor(e={}){j(this,"session");j(this,"user");j(this,"dismissals");j(this,"cooldowns");j(this,"frequency");j(this,"namespace");j(this,"namespacedStorages",new Map);this.namespace=e.namespace??mI,typeof window<"u"?(this.session=em(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=em(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=tm(this.namespace),this.user=tm(this.namespace)),this.dismissals=tb(this.session,this.user),this.cooldowns=nb(this.user),this.frequency=rb(this.session)}ns(e){let n=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(n)){let r=typeof window<"u"&&typeof sessionStorage<"u"?em(sessionStorage,n):tm(n);this.namespacedStorages.set(n,r)}return this.namespacedStorages.get(n)}};function nm(t={}){return new Lu(t)}var vI=S.object({type:S.literal("page_url"),url:S.string()}),yI=S.object({type:S.literal("route"),routeId:S.string()}),_I=S.object({type:S.literal("anchor_visible"),anchorId:S.string(),state:S.enum(["visible","present","absent"])}),wI=S.object({type:S.literal("event_occurred"),eventName:S.string(),withinMs:S.number().optional()}),xI=S.object({type:S.literal("state_equals"),key:S.string(),value:S.unknown()}),SI=S.object({type:S.literal("viewport"),minWidth:S.number().optional(),maxWidth:S.number().optional(),minHeight:S.number().optional(),maxHeight:S.number().optional()}),bI=S.object({type:S.literal("session_metric"),key:S.string(),operator:S.enum(["gte","lte","eq","gt","lt"]),threshold:S.number()}),kI=S.object({type:S.literal("dismissed"),key:S.string(),inverted:S.boolean().optional()}),EI=S.object({type:S.literal("cooldown_active"),key:S.string(),inverted:S.boolean().optional()}),CI=S.object({type:S.literal("frequency_limit"),key:S.string(),limit:S.number(),inverted:S.boolean().optional()}),ib=S.discriminatedUnion("type",[vI,yI,_I,wI,xI,SI,bI,kI,EI,CI]),AI=S.object({conditions:S.array(ib),value:S.unknown()}),RI=S.object({type:S.literal("rules"),rules:S.array(AI),default:S.unknown()}),TI=S.object({type:S.literal("score"),field:S.string(),threshold:S.number(),above:S.unknown(),below:S.unknown()}),PI=S.object({type:S.literal("model"),modelId:S.string(),inputs:S.array(S.string()),outputMapping:S.record(S.unknown()),default:S.unknown()}),II=S.object({type:S.literal("external"),endpoint:S.string(),method:S.enum(["GET","POST"]).optional(),default:S.unknown(),timeoutMs:S.number().optional()}),ob=S.discriminatedUnion("type",[RI,TI,PI,II]),OI=S.object({include:S.array(S.string()).optional(),exclude:S.array(S.string()).optional()}),NI=S.object({routes:OI.optional(),strategy:ob.optional()});function gF(t){return ib.safeParse(t)}function mF(t){return ob.safeParse(t)}function vF(t){return NI.safeParse(t)}function sb(t,e){let{context:n,state:r,events:i}=e;switch(t.type){case"page_url":{let{url:o}=t,s=n.page.url,a=o.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(`^${a}$`).test(s)}case"route":return n.page.routeId===t.routeId;case"anchor_visible":{let o=n.anchors?.find(s=>s.anchorId===t.anchorId);switch(t.state){case"visible":return o?.visible===!0;case"present":return o?.present===!0;case"absent":return!o?.present;default:return!1}}case"event_occurred":{if(!i)return!1;let o=t.withinMs??6e4;return i.hasRecentEvent(t.eventName,o)}case"state_equals":return!1;case"viewport":{let{width:o,height:s}=n.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&s<t.minHeight||t.maxHeight!==void 0&&s>t.maxHeight)}case"session_metric":{if(!r)return!1;let o=r.getSessionMetric(t.key),{operator:s,threshold:a}=t;switch(s){case"gte":return o>=a;case"lte":return o<=a;case"eq":return o===a;case"gt":return o>a;case"lt":return o<a;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 s=r.getFrequencyCount(t.key)>=t.limit;return t.inverted?!s:s}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function ab(t,e){let n=[];for(let r of t.conditions){let i=sb(r,e);if(n.push({condition:r,result:i}),!i)return{matched:!1,conditionResults:n}}return{matched:!0,conditionResults:n}}function Mu(t,e){for(let n=0;n<t.rules.length;n++){let r=t.rules[n],{matched:i,conditionResults:o}=ab(r,e);if(i)return{value:r.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:n,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function Fu(t,e){let{context:n}=e,r=n.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 lb(t,e){let{state:n,events:r,sessionMetrics:i}=e;return{context:t,state:n?{isDismissed:o=>n.dismissals.isDismissed(o),isCooldownActive:o=>n.cooldowns.isActive(o),getFrequencyCount:o=>n.frequency.count(o),getSessionMetric:o=>i?.get(o)??0}:void 0,events:r?{hasRecentEvent:(o,s)=>r.hasRecentEvent(o,s)}:void 0}}async function cb(t,e,n={}){let r=lb(e,n);switch(t.type){case"rules":return Mu(t,r);case"score":return Fu(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 ub(t,e,n={}){let r=lb(e,n);switch(t.type){case"rules":return Mu(t,r);case"score":return Fu(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 rm(t){return{evaluate:(e,n)=>cb(e,n,t),evaluateSync:(e,n)=>ub(e,n,t)}}var LI=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 a=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(a),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let r=n.content,i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;i.nextNode();){let s=i.currentNode,a=s.tagName.toLowerCase();if(!LI.has(a)){o.push(s);continue}for(let l of Array.from(s.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),f=c.startsWith("on"),h=(c==="href"||c==="src")&&u.startsWith("javascript:");(f||h)&&s.removeAttribute(l.name)}}for(let s of o){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML}var db=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=im(t.html),i=document.createElement("div");i.setAttribute("data-syntro-action-id",e.generateId()),i.innerHTML=r;let o=null;switch(t.position){case"before":n.insertAdjacentElement("beforebegin",i);break;case"after":n.insertAdjacentElement("afterend",i);break;case"prepend":n.insertBefore(i,n.firstChild);break;case"append":n.appendChild(i);break;case"replace":o=n.innerHTML,n.replaceWith(i);break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position}),{cleanup:()=>{if(t.position==="replace"&&o!==null){let s=document.createElement(n.tagName);s.innerHTML=o,Array.from(n.attributes).forEach(a=>{s.setAttribute(a.name,a.value)}),i.replaceWith(s)}else i.remove()},updateFn:s=>{"html"in s&&typeof s.html=="string"&&(i.innerHTML=im(s.html))}}},fb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=n.textContent??"";return n.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{n.textContent=r},updateFn:i=>{"text"in i&&typeof i.text=="string"&&(n.textContent=i.text)}}},pb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);if(["onclick","onerror","onload","onmouseover","onfocus","onblur"].includes(t.attr.toLowerCase())||t.attr.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);let i=n.getAttribute(t.attr),o=n.hasAttribute(t.attr);return n.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{o&&i!==null?n.setAttribute(t.attr,i):n.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&n.setAttribute(t.attr,s.value)}}},hb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=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:()=>{r||n.classList.remove(t.className)}}},gb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=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:()=>{r&&n.classList.add(t.className)}}},mb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=new Map;for(let i of Object.keys(t.styles)){let o=n.style.getPropertyValue(i);r.set(i,o)}for(let[i,o]of Object.entries(t.styles))n.style.setProperty(i,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[i,o]of r)o?n.style.setProperty(i,o):n.style.removeProperty(i)},updateFn:i=>{if("styles"in i&&typeof i.styles=="object"&&i.styles)for(let[o,s]of Object.entries(i.styles))n.style.setProperty(o,s)}}},om=[{kind:"content:insertHtml",executor:db},{kind:"content:setText",executor:fb},{kind:"content:setAttr",executor:pb},{kind:"content:addClass",executor:hb},{kind:"content:removeClass",executor:gb},{kind:"content:setStyle",executor:mb}],MI={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:om};var vb=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function yb(t,e,n){let r=n?.paddingPx??12,i=n?.radiusPx??12,o=Math.min(Math.max(n?.scrimOpacity??.55,0),1),s=n?.ringColor??"var(--syntro-ring, #5b8cff)",a=n?.blocking??!1,l=n?.onClickOutside??!0,c=n?.onEsc??!0,u=getComputedStyle(document.documentElement),f=u.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=u.getPropertyValue("--syntro-ring").trim(),g=document.createElement("div");g.className="syntro-spotlight-scrim";let v=a||l;Object.assign(g.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:v?"auto":"none",background:f||`rgba(2, 6, 23, ${o})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(g),requestAnimationFrame(()=>g.style.opacity="1");let _=document.createElement("div");_.className="syntro-spotlight-ring",Object.assign(_.style,{position:"fixed",pointerEvents:"none",borderRadius:`${i}px`,border:`2px solid ${s||h||"#5b8cff"}`,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 x=[];if(!vb)for(let P=0;P<4;P++){let A=document.createElement("div");A.style.position="fixed",A.style.background="inherit",x.push(A),g.appendChild(A)}let d=P=>{g.style.clipPath=P,g.style.webkitClipPath=P},p=()=>{let P=t.getBoundingClientRect(),A=Math.max(0,P.left-r),H=Math.max(0,P.top-r),K=Math.min(window.innerWidth,P.width+r*2),Y=Math.min(window.innerHeight,P.height+r*2);if(Object.assign(_.style,{left:`${A}px`,top:`${H}px`,width:`${K}px`,height:`${Y}px`}),vb){let W=window.innerWidth,le=window.innerHeight,B=Math.min(i,K/2,Y/2),X=`M 0 0 L ${W} 0 L ${W} ${le} L 0 ${le} Z`,D=`M ${A+B} ${H} A ${B} ${B} 0 0 0 ${A} ${H+B} L ${A} ${H+Y-B} A ${B} ${B} 0 0 0 ${A+B} ${H+Y} L ${A+K-B} ${H+Y} A ${B} ${B} 0 0 0 ${A+K} ${H+Y-B} L ${A+K} ${H+B} A ${B} ${B} 0 0 0 ${A+K-B} ${H} L ${A+B} ${H} Z`;d(`path('${X} ${D}')`)}else{let[W,le,B,X]=x;Object.assign(W.style,{left:"0px",top:"0px",width:"100vw",height:`${H}px`}),Object.assign(B.style,{left:"0px",top:`${H+Y}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(H+Y))}px`}),Object.assign(X.style,{left:"0px",top:`${H}px`,width:`${A}px`,height:`${Y}px`}),Object.assign(le.style,{left:`${A+K}px`,top:`${H}px`,width:`${Math.max(0,window.innerWidth-(A+K))}px`,height:`${Y}px`})}},m=new ResizeObserver(()=>requestAnimationFrame(p));m.observe(t);let y=()=>requestAnimationFrame(p),w=()=>requestAnimationFrame(p);window.addEventListener("scroll",y,!0),window.addEventListener("resize",w);let k=P=>{P.key==="Escape"&&c&&E.destroy()};c&&window.addEventListener("keydown",k);let b=P=>{a?(P.preventDefault(),P.stopPropagation()):l&&E.destroy()};g.addEventListener("click",b);let E={destroy(){m.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",w),c&&window.removeEventListener("keydown",k),g.removeEventListener("click",b),g.style.opacity="0",setTimeout(()=>{g.remove(),_.remove()},220)}};return p(),E}var xb=["top","right","bottom","left"];var en=Math.min,ct=Math.max,Nn=Math.round,Ln=Math.floor,Ie=t=>({x:t,y:t}),FI={left:"right",right:"left",bottom:"top",top:"bottom"},$I={start:"end",end:"start"};function Du(t,e,n){return ct(t,en(e,n))}function Zi(t,e){return typeof t=="function"?t(e):t}function ai(t){return t.split("-")[0]}function us(t){return t.split("-")[1]}function sm(t){return t==="x"?"y":"x"}function Bu(t){return t==="y"?"height":"width"}var DI=new Set(["top","bottom"]);function pr(t){return DI.has(ai(t))?"y":"x"}function Vu(t){return sm(pr(t))}function Sb(t,e,n){n===void 0&&(n=!1);let r=us(t),i=Vu(t),o=Bu(i),s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Ga(s)),[s,Ga(s)]}function bb(t){let e=Ga(t);return[$u(t),e,$u(e)]}function $u(t){return t.replace(/start|end/g,e=>$I[e])}var _b=["left","right"],wb=["right","left"],BI=["top","bottom"],VI=["bottom","top"];function zI(t,e,n){switch(t){case"top":case"bottom":return n?e?wb:_b:e?_b:wb;case"left":case"right":return e?BI:VI;default:return[]}}function kb(t,e,n,r){let i=us(t),o=zI(ai(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map($u)))),o}function Ga(t){return t.replace(/left|right|bottom|top/g,e=>FI[e])}function HI(t){return{top:0,right:0,bottom:0,left:0,...t}}function am(t){return typeof t!="number"?HI(t):{top:t,right:t,bottom:t,left:t}}function Mn(t){let{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Eb(t,e,n){let{reference:r,floating:i}=t,o=pr(e),s=Vu(e),a=Bu(s),l=ai(e),c=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2,g;switch(l){case"top":g={x:u,y:r.y-i.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-i.width,y:f};break;default:g={x:r.x,y:r.y}}switch(us(e)){case"start":g[s]-=h*(n&&c?-1:1);break;case"end":g[s]+=h*(n&&c?-1:1);break}return g}var zu=async(t,e,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e)),c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=Eb(c,r,l),h=r,g={},v=0;for(let _=0;_<a.length;_++){let{name:x,fn:d}=a[_],{x:p,y:m,data:y,reset:w}=await d({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:g,rects:c,platform:s,elements:{reference:t,floating:e}});u=p??u,f=m??f,g={...g,[x]:{...g[x],...y}},w&&v<=50&&(v++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):w.rects),{x:u,y:f}=Eb(c,h,l)),_=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:g}};async function ds(t,e){var n;e===void 0&&(e={});let{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:g=0}=Zi(e,t),v=am(g),x=a[h?f==="floating"?"reference":"floating":f],d=Mn(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),p=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),y=await(o.isElement==null?void 0:o.isElement(m))?await(o.getScale==null?void 0:o.getScale(m))||{x:1,y:1}:{x:1,y:1},w=Mn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:m,strategy:l}):p);return{top:(d.top-w.top+v.top)/y.y,bottom:(w.bottom-d.bottom+v.bottom)/y.y,left:(d.left-w.left+v.left)/y.x,right:(w.right-d.right+v.right)/y.x}}var lm=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=Zi(t,e)||{};if(c==null)return{};let f=am(u),h={x:n,y:r},g=Vu(i),v=Bu(g),_=await s.getDimensions(c),x=g==="y",d=x?"top":"left",p=x?"bottom":"right",m=x?"clientHeight":"clientWidth",y=o.reference[v]+o.reference[g]-h[g]-o.floating[v],w=h[g]-o.reference[g],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c)),b=k?k[m]:0;(!b||!await(s.isElement==null?void 0:s.isElement(k)))&&(b=a.floating[m]||o.floating[v]);let E=y/2-w/2,P=b/2-_[v]/2-1,A=en(f[d],P),H=en(f[p],P),K=A,Y=b-_[v]-H,W=b/2-_[v]/2+E,le=Du(K,W,Y),B=!l.arrow&&us(i)!=null&&W!==le&&o.reference[v]/2-(W<K?A:H)-_[v]/2<0,X=B?W<K?W-K:W-Y:0;return{[g]:h[g]+X,data:{[g]:le,centerOffset:W-le-X,...B&&{alignmentOffset:X}},reset:B}}});var Hu=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;let{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:_=!0,...x}=Zi(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};let d=ai(i),p=pr(a),m=ai(a)===a,y=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=h||(m||!_?[Ga(a)]:bb(a)),k=v!=="none";!h&&k&&w.push(...kb(a,_,v,y));let b=[a,...w],E=await ds(e,x),P=[],A=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&P.push(E[d]),f){let W=Sb(i,s,y);P.push(E[W[0]],E[W[1]])}if(A=[...A,{placement:i,overflows:P}],!P.every(W=>W<=0)){var H,K;let W=(((H=o.flip)==null?void 0:H.index)||0)+1,le=b[W];if(le&&(!(f==="alignment"?p!==pr(le):!1)||A.every(D=>pr(D.placement)===p?D.overflows[0]>0:!0)))return{data:{index:W,overflows:A},reset:{placement:le}};let B=(K=A.filter(X=>X.overflows[0]<=0).sort((X,D)=>X.overflows[1]-D.overflows[1])[0])==null?void 0:K.placement;if(!B)switch(g){case"bestFit":{var Y;let X=(Y=A.filter(D=>{if(k){let Z=pr(D.placement);return Z===p||Z==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(Z=>Z>0).reduce((Z,vt)=>Z+vt,0)]).sort((D,Z)=>D[1]-Z[1])[0])==null?void 0:Y[0];X&&(B=X);break}case"initialPlacement":B=a;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function Cb(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ab(t){return xb.some(e=>t[e]>=0)}var cm=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n}=e,{strategy:r="referenceHidden",...i}=Zi(t,e);switch(r){case"referenceHidden":{let o=await ds(e,{...i,elementContext:"reference"}),s=Cb(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Ab(s)}}}case"escaped":{let o=await ds(e,{...i,altBoundary:!0}),s=Cb(o,n.floating);return{data:{escapedOffsets:s,escaped:Ab(s)}}}default:return{}}}}};var jI=new Set(["left","top"]);async function UI(t,e){let{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=ai(n),a=us(n),l=pr(n)==="y",c=jI.has(s)?-1:1,u=o&&l?-1:1,f=Zi(e,t),{mainAxis:h,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*u,y:h*c}:{x:h*c,y:g*u}}var ju=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;let{x:i,y:o,placement:s,middlewareData:a}=e,l=await UI(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},Uu=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:d,y:p}=x;return{x:d,y:p}}},...l}=Zi(t,e),c={x:n,y:r},u=await ds(e,l),f=pr(ai(i)),h=sm(f),g=c[h],v=c[f];if(o){let x=h==="y"?"top":"left",d=h==="y"?"bottom":"right",p=g+u[x],m=g-u[d];g=Du(p,g,m)}if(s){let x=f==="y"?"top":"left",d=f==="y"?"bottom":"right",p=v+u[x],m=v-u[d];v=Du(p,v,m)}let _=a.fn({...e,[h]:g,[f]:v});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[h]:o,[f]:s}}}}}};function Wu(){return typeof window<"u"}function gn(t){return Tb(t)?(t.nodeName||"").toLowerCase():"#document"}function Oe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $e(t){var e;return(e=(Tb(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Tb(t){return Wu()?t instanceof Node||t instanceof Oe(t).Node:!1}function Ne(t){return Wu()?t instanceof Element||t instanceof Oe(t).Element:!1}function Ve(t){return Wu()?t instanceof HTMLElement||t instanceof Oe(t).HTMLElement:!1}function Rb(t){return!Wu()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Oe(t).ShadowRoot}var WI=new Set(["inline","contents"]);function $n(t){let{overflow:e,overflowX:n,overflowY:r,display:i}=Le(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!WI.has(i)}var qI=new Set(["table","td","th"]);function qu(t){return qI.has(gn(t))}var KI=[":popover-open",":modal"];function hr(t){return KI.some(e=>{try{return t.matches(e)}catch{return!1}})}var GI=["transform","translate","scale","rotate","perspective"],ZI=["transform","translate","scale","rotate","perspective","filter"],YI=["paint","layout","strict","content"];function Yi(t){let e=Xi(),n=Ne(t)?Le(t):t;return GI.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||ZI.some(r=>(n.willChange||"").includes(r))||YI.some(r=>(n.contain||"").includes(r))}function Ku(t){let e=mt(t);for(;Ve(e)&&!tn(e);){if(Yi(e))return e;if(hr(e))return null;e=mt(e)}return null}function Xi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var XI=new Set(["html","body","#document"]);function tn(t){return XI.has(gn(t))}function Le(t){return Oe(t).getComputedStyle(t)}function Dn(t){return Ne(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function mt(t){if(gn(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Rb(t)&&t.host||$e(t);return Rb(e)?e.host:e}function Pb(t){let e=mt(t);return tn(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ve(e)&&$n(e)?e:Pb(e)}function Fn(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Pb(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Oe(i);if(o){let a=Qi(s);return e.concat(s,s.visualViewport||[],$n(i)?i:[],a&&n?Fn(a):[])}return e.concat(i,Fn(i,[],n))}function Qi(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Lb(t){let e=Le(t),n=parseFloat(e.width)||0,r=parseFloat(e.height)||0,i=Ve(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Nn(n)!==o||Nn(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function dm(t){return Ne(t)?t:t.contextElement}function fs(t){let e=dm(t);if(!Ve(e))return Ie(1);let n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Lb(e),s=(o?Nn(n.width):n.width)/r,a=(o?Nn(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var n2=Ie(0);function Mb(t){let e=Oe(t);return!Xi()||!e.visualViewport?n2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function r2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Oe(t)?!1:e}function Ji(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),o=dm(t),s=Ie(1);e&&(r?Ne(r)&&(s=fs(r)):s=fs(t));let a=r2(o,n,r)?Mb(o):Ie(0),l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){let h=Oe(o),g=r&&Ne(r)?Oe(r):r,v=h,_=Qi(v);for(;_&&r&&g!==v;){let x=fs(_),d=_.getBoundingClientRect(),p=Le(_),m=d.left+(_.clientLeft+parseFloat(p.paddingLeft))*x.x,y=d.top+(_.clientTop+parseFloat(p.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,f*=x.y,l+=m,c+=y,v=Oe(_),_=Qi(v)}}return Mn({width:u,height:f,x:l,y:c})}function Gu(t,e){let n=Dn(t).scrollLeft;return e?e.left+n:Ji($e(t)).left+n}function Fb(t,e){let n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Gu(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function i2(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t,o=i==="fixed",s=$e(r),a=e?hr(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Ie(1),u=Ie(0),f=Ve(r);if((f||!f&&!o)&&((gn(r)!=="body"||$n(s))&&(l=Dn(r)),Ve(r))){let g=Ji(r);c=fs(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}let h=s&&!f&&!o?Fb(s,l):Ie(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 o2(t){return Array.from(t.getClientRects())}function s2(t){let e=$e(t),n=Dn(t),r=t.ownerDocument.body,i=ct(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=ct(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),s=-n.scrollLeft+Gu(t),a=-n.scrollTop;return Le(r).direction==="rtl"&&(s+=ct(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}var Ib=25;function a2(t,e){let n=Oe(t),r=$e(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;let u=Xi();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}let c=Gu(r);if(c<=0){let u=r.ownerDocument,f=u.body,h=getComputedStyle(f),g=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-g);v<=Ib&&(o-=v)}else c<=Ib&&(o+=c);return{width:o,height:s,x:a,y:l}}var l2=new Set(["absolute","fixed"]);function c2(t,e){let n=Ji(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Ve(t)?fs(t):Ie(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function Ob(t,e,n){let r;if(e==="viewport")r=a2(t,n);else if(e==="document")r=s2($e(t));else if(Ne(e))r=c2(e,n);else{let i=Mb(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Mn(r)}function $b(t,e){let n=mt(t);return n===e||!Ne(n)||tn(n)?!1:Le(n).position==="fixed"||$b(n,e)}function u2(t,e){let n=e.get(t);if(n)return n;let r=Fn(t,[],!1).filter(a=>Ne(a)&&gn(a)!=="body"),i=null,o=Le(t).position==="fixed",s=o?mt(t):t;for(;Ne(s)&&!tn(s);){let a=Le(s),l=Yi(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&l2.has(i.position)||$n(s)&&!l&&$b(t,s))?r=r.filter(u=>u!==s):i=a,s=mt(s)}return e.set(t,r),r}function d2(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t,s=[...n==="clippingAncestors"?hr(e)?[]:u2(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{let f=Ob(e,u,i);return c.top=ct(f.top,c.top),c.right=en(f.right,c.right),c.bottom=en(f.bottom,c.bottom),c.left=ct(f.left,c.left),c},Ob(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function f2(t){let{width:e,height:n}=Lb(t);return{width:e,height:n}}function p2(t,e,n){let r=Ve(e),i=$e(e),o=n==="fixed",s=Ji(t,!0,o,e),a={scrollLeft:0,scrollTop:0},l=Ie(0);function c(){l.x=Gu(i)}if(r||!r&&!o)if((gn(e)!=="body"||$n(i))&&(a=Dn(e)),r){let g=Ji(e,!0,o,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else i&&c();o&&!r&&i&&c();let u=i&&!r&&!o?Fb(i,a):Ie(0),f=s.left+a.scrollLeft-l.x-u.x,h=s.top+a.scrollTop-l.y-u.y;return{x:f,y:h,width:s.width,height:s.height}}function um(t){return Le(t).position==="static"}function Nb(t,e){if(!Ve(t)||Le(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $e(t)===n&&(n=n.ownerDocument.body),n}function Db(t,e){let n=Oe(t);if(hr(t))return n;if(!Ve(t)){let i=mt(t);for(;i&&!tn(i);){if(Ne(i)&&!um(i))return i;i=mt(i)}return n}let r=Nb(t,e);for(;r&&qu(r)&&um(r);)r=Nb(r,e);return r&&tn(r)&&um(r)&&!Yi(r)?n:r||Ku(t)||n}var h2=async function(t){let e=this.getOffsetParent||Db,n=this.getDimensions,r=await n(t.floating);return{reference:p2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function g2(t){return Le(t).direction==="rtl"}var m2={convertOffsetParentRelativeRectToViewportRelativeRect:i2,getDocumentElement:$e,getClippingRect:d2,getOffsetParent:Db,getElementRects:h2,getClientRects:o2,getDimensions:f2,getScale:fs,isElement:Ne,isRTL:g2};function Bb(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function v2(t,e){let n=null,r,i=$e(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();let c=t.getBoundingClientRect(),{left:u,top:f,width:h,height:g}=c;if(a||e(),!h||!g)return;let v=Ln(f),_=Ln(i.clientWidth-(u+h)),x=Ln(i.clientHeight-(f+g)),d=Ln(u),m={rootMargin:-v+"px "+-_+"px "+-x+"px "+-d+"px",threshold:ct(0,en(1,l))||1},y=!0;function w(k){let b=k[0].intersectionRatio;if(b!==l){if(!y)return s();b?s(!1,b):r=setTimeout(()=>{s(!1,1e-7)},1e3)}b===1&&!Bb(c,t.getBoundingClientRect())&&s(),y=!1}try{n=new IntersectionObserver(w,{...m,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,m)}n.observe(t)}return s(!0),o}function Vb(t,e,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=dm(t),u=i||o?[...c?Fn(c):[],...Fn(e)]:[];u.forEach(d=>{i&&d.addEventListener("scroll",n,{passive:!0}),o&&d.addEventListener("resize",n)});let f=c&&a?v2(c,n):null,h=-1,g=null;s&&(g=new ResizeObserver(d=>{let[p]=d;p&&p.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var m;(m=g)==null||m.observe(e)})),n()}),c&&!l&&g.observe(c),g.observe(e));let v,_=l?Ji(t):null;l&&x();function x(){let d=Ji(t);_&&!Bb(_,d)&&n(),_=d,v=requestAnimationFrame(x)}return n(),()=>{var d;u.forEach(p=>{i&&p.removeEventListener("scroll",n),o&&p.removeEventListener("resize",n)}),f?.(),(d=g)==null||d.disconnect(),g=null,l&&cancelAnimationFrame(v)}}var zb=ju;var Hb=Uu,jb=Hu;var Ub=cm,Wb=lm;var qb=(t,e,n)=>{let r=new Map,i={platform:m2,...n},o={...i.platform,_c:r};return zu(t,e,{...i,platform:o})};var y2=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function Vt(t){if(typeof window.Sanitizer=="function")try{let a=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(a),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let r=n.content,i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;i.nextNode();){let s=i.currentNode,a=s.tagName.toLowerCase();if(!y2.has(a)){o.push(s);continue}for(let l of Array.from(s.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),f=c.startsWith("on"),h=(c==="href"||c==="src")&&u.startsWith("javascript:");(f||h)&&s.removeAttribute(l.name)}}for(let s of o){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML}function _2(t){let e=t.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight;if(!(e.width>n*.8||e.height>r*.8))return t;let o=Math.max(e.left,0),s=Math.max(e.top,0),a=Math.min(e.right,n),l=Math.min(e.bottom,r),c=(o+a)/2,u=(s+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:c,y:u,top:u,left:c,right:c,bottom:u}}}}function Kb(t,e,n){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");o.className="syntro-tooltip",o.setAttribute("role","tooltip"),o.innerHTML=Vt(n.html);let s=o.querySelectorAll("[data-syntro-action]"),a=d=>{let m=d.currentTarget.getAttribute("data-syntro-action");m&&n.onAction&&n.onAction(m)};s.forEach(d=>d.addEventListener("click",a));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let c=[zb(n.offsetPx??8),jb(),Hb({padding:8}),Ub(),Wb({element:l})],u=n.placement&&n.placement!=="auto"?n.placement:"top",f=Vb(t,o,async()=>{let d=_2(t),p=await qb(d,o,{placement:u,middleware:c}),{x:m,y,strategy:w,middlewareData:k,placement:b}=p;if(Object.assign(o.style,{left:`${m}px`,top:`${y}px`,position:w}),k.arrow){let{x:E,y:P}=k.arrow,A=b.split("-")[0],H={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:E!=null?`${E}px`:"",top:P!=null?`${P}px`:"",right:"",bottom:"",[H[A]]:"-4px"});let K={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${K[A]||"0deg"})`}}),h=d=>{d.key==="Escape"&&x.destroy()};window.addEventListener("keydown",h);let g=[];if(n.blocking){Array.from(document.body.children).forEach(p=>{p!==e&&p.getAttribute("inert")===null&&(p.setAttribute("inert",""),g.push(p.id||p.tagName))});let d=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(d.length>0){let p=d[0],m=d[d.length-1],y=w=>{w.key==="Tab"&&(w.shiftKey?document.activeElement===p&&(m.focus(),w.preventDefault()):document.activeElement===m&&(p.focus(),w.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>p.focus())}}let _=(()=>{if(n.trigger==="hover"){let d=()=>{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",d),t.addEventListener("mouseleave",p),t.addEventListener("focus",d),t.addEventListener("blur",p),()=>{t.removeEventListener("mouseenter",d),t.removeEventListener("mouseleave",p),t.removeEventListener("focus",d),t.removeEventListener("blur",p)}}if(n.trigger==="click"){let d=()=>{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",d),()=>t.removeEventListener("click",d)}return o.style.opacity="0",o.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{o.style.opacity="1"}),()=>{}})(),x={el:o,destroy(){f(),_(),window.removeEventListener("keydown",h),s.forEach(d=>d.removeEventListener("click",a)),n.blocking&&Array.from(document.body.children).forEach(d=>{d!==e&&d.removeAttribute("inert")}),o.style.opacity="0",setTimeout(()=>o.remove(),200)}};return x}var fm=async(t,e)=>{let{content:n,size:r="md",blocking:i=!1,scrim:o,dismiss:s,ctaButtons:a}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
55
54
  position: fixed;
56
55
  inset: 0;
57
- background: rgba(0, 0, 0, ${s?.opacity??.6});
56
+ background: rgba(0, 0, 0, ${o?.opacity??.6});
58
57
  z-index: 2147483645;
59
58
  opacity: 0;
60
59
  transition: opacity 200ms ease-out;
61
- `,e.overlayRoot.appendChild(l);let c=document.createElement("div");c.className=`syntro-modal syntro-modal-${i}`,c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true");let u={sm:"360px",md:"480px",lg:"640px"};c.style.cssText=`
60
+ `,e.overlayRoot.appendChild(l);let c=document.createElement("div");c.className=`syntro-modal syntro-modal-${r}`,c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true");let u={sm:"360px",md:"480px",lg:"640px"};c.style.cssText=`
62
61
  position: fixed;
63
62
  top: 50%;
64
63
  left: 50%;
65
64
  transform: translate(-50%, -50%) scale(0.95);
66
- max-width: ${u[i]};
65
+ max-width: ${u[r]};
67
66
  width: 90%;
68
67
  background: white;
69
68
  border-radius: 12px;
@@ -72,7 +71,7 @@ Error generating stack: `+i.message+`
72
71
  opacity: 0;
73
72
  transition: opacity 200ms ease-out, transform 200ms ease-out;
74
73
  padding: 24px;
75
- `;let f="";if(n.title&&(f+=`<h2 class="syntro-modal-title" style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: #111827;">${sn(n.title)}</h2>`),f+=`<div class="syntro-modal-body" style="color: #4b5563; line-height: 1.5;">${sn(n.body)}</div>`,a?.closeButton!==!1&&(f+=`
74
+ `;let f="";if(n.title&&(f+=`<h2 class="syntro-modal-title" style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: #111827;">${Vt(n.title)}</h2>`),f+=`<div class="syntro-modal-body" style="color: #4b5563; line-height: 1.5;">${Vt(n.body)}</div>`,s?.closeButton!==!1&&(f+=`
76
75
  <button class="syntro-modal-close" data-syntro-action="dismiss" style="
77
76
  position: absolute;
78
77
  top: 16px;
@@ -87,10 +86,10 @@ Error generating stack: `+i.message+`
87
86
  <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"/>
88
87
  </svg>
89
88
  </button>
90
- `),o&&o.length>0){f+='<div class="syntro-modal-actions" style="display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end;">';for(let S of o){let w=S.primary??!1;f+=`
89
+ `),a&&a.length>0){f+='<div class="syntro-modal-actions" style="display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end;">';for(let w of a){let k=w.primary??!1;f+=`
91
90
  <button
92
- class="syntro-modal-btn ${w?"syntro-modal-btn-primary":""}"
93
- data-syntro-action="${sn(S.actionId)}"
91
+ class="syntro-modal-btn ${k?"syntro-modal-btn-primary":""}"
92
+ data-syntro-action="${Vt(w.actionId)}"
94
93
  style="
95
94
  padding: 10px 20px;
96
95
  border-radius: 8px;
@@ -98,12 +97,12 @@ Error generating stack: `+i.message+`
98
97
  font-weight: 500;
99
98
  cursor: pointer;
100
99
  transition: background 150ms ease;
101
- ${w?"background: #4f46e5; color: white; border: none;":"background: white; color: #374151; border: 1px solid #d1d5db;"}
100
+ ${k?"background: #4f46e5; color: white; border: none;":"background: white; color: #374151; border: 1px solid #d1d5db;"}
102
101
  "
103
102
  >
104
- ${sn(S.label)}
103
+ ${Vt(w.label)}
105
104
  </button>
106
- `}f+="</div>"}c.innerHTML=f,e.overlayRoot.appendChild(c);let h=null,p=c.querySelectorAll("[data-syntro-action]"),y=S=>{let E=S.currentTarget.getAttribute("data-syntro-action");E&&(h=E,e.publishEvent("action.modal_cta_clicked",{actionId:E}),E==="dismiss"&&v.destroy())};p.forEach(S=>S.addEventListener("click",y));let _=S=>{S.key==="Escape"&&a?.onEsc!==!1&&v.destroy()};window.addEventListener("keydown",_);let b=()=>{r||v.destroy()};l.addEventListener("click",b);let d=[];r&&Array.from(document.body.children).forEach(S=>{S!==e.overlayRoot&&S.getAttribute("inert")===null&&(S.setAttribute("inert",""),d.push(S))});let g;a?.timeoutMs&&(g=setTimeout(()=>{v.destroy()},a.timeoutMs));let m=c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m.length>0&&requestAnimationFrame(()=>m[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",c.style.opacity="1",c.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:i,blocking:r});let v={destroy(){g&&clearTimeout(g),window.removeEventListener("keydown",_),l.removeEventListener("click",b),p.forEach(S=>S.removeEventListener("click",y)),d.forEach(S=>S.removeAttribute("inert")),c.style.opacity="0",c.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{c.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:h})}};return{cleanup:()=>{v.destroy()}}};var GC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=mC(n,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:t.style?.color,blocking:!1,onClickOutside:!1,onEsc:!1});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{i.destroy()}}},YC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=t.duration??2e3,r="syntro-pulse-effect";if(!document.querySelector("[data-syntro-pulse-styles]")){let a=document.createElement("style");a.setAttribute("data-syntro-pulse-styles",""),a.textContent=`
105
+ `}f+="</div>"}c.innerHTML=f,e.overlayRoot.appendChild(c);let h=null,g=c.querySelectorAll("[data-syntro-action]"),v=w=>{let b=w.currentTarget.getAttribute("data-syntro-action");b&&(h=b,e.publishEvent("action.modal_cta_clicked",{actionId:b}),b==="dismiss"&&y.destroy())};g.forEach(w=>w.addEventListener("click",v));let _=w=>{w.key==="Escape"&&s?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",_);let x=()=>{i||y.destroy()};l.addEventListener("click",x);let d=[];i&&Array.from(document.body.children).forEach(w=>{w!==e.overlayRoot&&w.getAttribute("inert")===null&&(w.setAttribute("inert",""),d.push(w))});let p;s?.timeoutMs&&(p=setTimeout(()=>{y.destroy()},s.timeoutMs));let m=c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m.length>0&&requestAnimationFrame(()=>m[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",c.style.opacity="1",c.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:r,blocking:i});let y={destroy(){p&&clearTimeout(p),window.removeEventListener("keydown",_),l.removeEventListener("click",x),g.forEach(w=>w.removeEventListener("click",v)),d.forEach(w=>w.removeAttribute("inert")),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 Gb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=yb(n,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:t.style?.color,blocking:!1,onClickOutside:!1,onEsc:!1});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{r.destroy()}}},Zb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=t.duration??2e3,i="syntro-pulse-effect";if(!document.querySelector("[data-syntro-pulse-styles]")){let s=document.createElement("style");s.setAttribute("data-syntro-pulse-styles",""),s.textContent=`
107
106
  @keyframes syntro-pulse {
108
107
  0%, 100% {
109
108
  box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
@@ -112,10 +111,10 @@ Error generating stack: `+i.message+`
112
111
  box-shadow: 0 0 0 8px rgba(79, 70, 229, 0);
113
112
  }
114
113
  }
115
- .${r} {
114
+ .${i} {
116
115
  animation: syntro-pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
117
116
  }
118
- `,document.head.appendChild(a)}n.classList.add(r);let s=setTimeout(()=>{n.classList.remove(r)},i);return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:pulse",anchorId:t.anchorId,duration:i}),{cleanup:()=>{clearTimeout(s),n.classList.remove(r)}}},ZC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=document.createElement("div");if(i.className="syntro-badge",i.textContent=t.content,i.setAttribute("data-syntro-badge",t.anchorId),!document.querySelector("[data-syntro-badge-styles]")){let a=document.createElement("style");a.setAttribute("data-syntro-badge-styles",""),a.textContent=`
117
+ `,document.head.appendChild(s)}n.classList.add(i);let o=setTimeout(()=>{n.classList.remove(i)},r);return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:pulse",anchorId:t.anchorId,duration:r}),{cleanup:()=>{clearTimeout(o),n.classList.remove(i)}}},Yb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=document.createElement("div");if(r.className="syntro-badge",r.textContent=t.content,r.setAttribute("data-syntro-badge",t.anchorId),!document.querySelector("[data-syntro-badge-styles]")){let s=document.createElement("style");s.setAttribute("data-syntro-badge-styles",""),s.textContent=`
119
118
  .syntro-badge {
120
119
  position: absolute;
121
120
  padding: 2px 6px;
@@ -129,36 +128,18 @@ Error generating stack: `+i.message+`
129
128
  z-index: 2147483646;
130
129
  white-space: nowrap;
131
130
  }
132
- `,document.head.appendChild(a)}let r=t.position??"top-right",s=n.style.position;switch(getComputedStyle(n).position==="static"&&(n.style.position="relative"),n.appendChild(i),r){case"top-left":Object.assign(i.style,{top:"-8px",left:"-8px"});break;case"top-right":Object.assign(i.style,{top:"-8px",right:"-8px"});break;case"bottom-left":Object.assign(i.style,{bottom:"-8px",left:"-8px"});break;case"bottom-right":Object.assign(i.style,{bottom:"-8px",right:"-8px"});break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:badge",anchorId:t.anchorId,content:t.content,position:r}),{cleanup:()=>{i.remove(),s!==void 0&&(n.style.position=s)},updateFn:a=>{"content"in a&&typeof a.content=="string"&&(i.textContent=a.content)}}},WC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=t.content,r="";if(i.title&&(r+=`<div class="syntro-tt-title">${sn(i.title)}</div>`),r+=`<div class="syntro-tt-body">${sn(i.body)}</div>`,i.ctaButtons&&i.ctaButtons.length>0){r+='<div class="syntro-tt-actions">';for(let a of i.ctaButtons){let o=a.primary??!1;r+=`
131
+ `,document.head.appendChild(s)}let i=t.position??"top-right",o=n.style.position;switch(getComputedStyle(n).position==="static"&&(n.style.position="relative"),n.appendChild(r),i){case"top-left":Object.assign(r.style,{top:"-8px",left:"-8px"});break;case"top-right":Object.assign(r.style,{top:"-8px",right:"-8px"});break;case"bottom-left":Object.assign(r.style,{bottom:"-8px",left:"-8px"});break;case"bottom-right":Object.assign(r.style,{bottom:"-8px",right:"-8px"});break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:badge",anchorId:t.anchorId,content:t.content,position:i}),{cleanup:()=>{r.remove(),o!==void 0&&(n.style.position=o)},updateFn:s=>{"content"in s&&typeof s.content=="string"&&(r.textContent=s.content)}}},Xb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=t.content,i="";if(r.title&&(i+=`<div class="syntro-tt-title">${Vt(r.title)}</div>`),i+=`<div class="syntro-tt-body">${Vt(r.body)}</div>`,r.ctaButtons&&r.ctaButtons.length>0){i+='<div class="syntro-tt-actions">';for(let s of r.ctaButtons){let a=s.primary??!1;i+=`
133
132
  <button
134
- class="syntro-tt-btn ${o?"syntro-tt-btn-primary":""}"
135
- data-syntro-action="${sn(a.actionId)}"
133
+ class="syntro-tt-btn ${a?"syntro-tt-btn-primary":""}"
134
+ data-syntro-action="${Vt(s.actionId)}"
136
135
  >
137
- ${sn(a.label)}
136
+ ${Vt(s.label)}
138
137
  </button>
139
- `}r+="</div>"}else i.cta&&(r+=`<div class="syntro-tt-actions">
138
+ `}i+="</div>"}else r.cta&&(i+=`<div class="syntro-tt-actions">
140
139
  <button class="syntro-tt-btn syntro-tt-btn-primary" data-syntro-action="cta">
141
- ${sn(i.cta.label)}
140
+ ${Vt(r.cta.label)}
142
141
  </button>
143
- </div>`);let s=PC(n,e.overlayRoot,{html:r,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:a=>{if(a==="cta"&&i.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:i.cta.label});else if(i.ctaButtons){let o=i.ctaButtons.find(l=>l.actionId===a);o&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:a,label:o.label})}}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:tooltip",anchorId:t.anchorId,trigger:t.trigger??"immediate"}),{cleanup:()=>{s.destroy()}}},ey=[{kind:"overlays:highlight",executor:GC},{kind:"overlays:pulse",executor:YC},{kind:"overlays:badge",executor:ZC},{kind:"overlays:tooltip",executor:WC},{kind:"overlays:modal",executor:Jv}],ZD={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, and visual overlays",executors:ey};var XC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=window.scrollX,r=window.scrollY;return n.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:()=>{}}},KC=async(t,e)=>{let n=t.url.trim();if(n.toLowerCase().startsWith("javascript:"))throw new Error("javascript: URLs are not allowed");let i=t.target??"_self";return e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:navigate",url:t.url,target:i}),i==="_blank"?window.open(n,"_blank","noopener,noreferrer"):window.location.href=n,{cleanup:()=>{}}},ty=[{kind:"navigation:scrollTo",executor:XC},{kind:"navigation:navigate",executor:KC}],WD={id:"adaptive-navigation",version:"1.0.0",name:"Navigation",description:"Scroll and page navigation actions",executors:ty};var QC=async(t,e)=>{let{badgeId:n}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:n,awardedAt:Date.now()}),{cleanup:()=>{}}},JC=async(t,e)=>{let{points:n,reason:i}=t;return e.publishEvent("gamification.points_added",{points:n,reason:i,timestamp:Date.now()}),{cleanup:()=>{}}},XD={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},ny=[{kind:"gamification:awardBadge",executor:QC},{kind:"gamification:addPoints",executor:JC}],KD=[XD],QD={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:ny,eventHandlers:KD};var ry="syntro_active_tour",vf=new Map;function JD(t){try{let e=localStorage.getItem(ry);if(!e)return null;let n=JSON.parse(e);return n.tourId!==t?null:n}catch{return null}}function iy(t){try{localStorage.setItem(ry,JSON.stringify(t))}catch{}}function e3(){try{localStorage.removeItem(ry)}catch{}}function ac(){return window.location.pathname}function t3(t){if(!t.route)return!0;let e=ac();return t.route.includes("*")?new RegExp("^"+t.route.replace(/\*/g,".*")+"$").test(e):e===t.route}var sy=async(t,e)=>{let{tourId:n,steps:i,startStep:r,autoStart:s=!0}=t;if(i.length===0)throw new Error(`Tour "${n}" has no steps`);if(vf.has(n))return{cleanup:async()=>{let m=vf.get(n);m&&await m.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let a=JD(n),o=!!a;if(!o&&!s)return{cleanup:()=>{}};a||(a={tourId:n,currentStepId:r||i[0].id,startedAt:Date.now()},iy(a));let l=i.findIndex(m=>m.id===a.currentStepId);if(l===-1){let m=r||i[0].id;l=i.findIndex(v=>v.id===m),l===-1&&(l=0),a.currentStepId=i[l].id,iy(a)}let c=i[l];if(!t3(c))return e.publishEvent("tour.waiting_for_route",{tourId:n,stepId:c.id,expectedRoute:c.route,currentRoute:ac()}),{cleanup:()=>{}};let u=!1,f=null,h=null,p=null,y=async()=>{h&&(h(),h=null),f&&f.isApplied()&&(await f.revert(),f=null)},_=async m=>{if(u)return;if(await y(),m==="end"){e3(),e.publishEvent("tour.completed",{tourId:n,totalSteps:i.length}),u=!0;return}let v=i.find(S=>S.id===m);if(!v){console.error(`[Tour] Step "${m}" not found`);return}if(a.currentStepId=m,iy(a),e.publishEvent("tour.step_changed",{tourId:n,previousStepId:c.id,nextStepId:m}),v.route&&v.route!==ac()){e.publishEvent("tour.awaiting_navigation",{tourId:n,stepId:m,targetRoute:v.route});return}await b(v)},b=async m=>{if(!u){e.publishEvent("tour.step_started",{tourId:n,stepId:m.id,stepIndex:i.findIndex(v=>v.id===m.id),totalSteps:i.length});try{f=await e.applyAction(m.action)}catch(v){console.error(`[Tour] Failed to execute step "${m.id}":`,v),e.publishEvent("tour.step_failed",{tourId:n,stepId:m.id,error:String(v)});return}if(m.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",w=>{let E=w?.actionId;if(E&&m.onAction){let C=m.onAction[E];C&&_(C)}});let v=e.subscribeEvent("action.tooltip_cta_clicked",w=>{let E=w?.actionId;if(E&&m.onAction){let C=m.onAction[E];C&&_(C)}}),S=h;h=()=>{S(),v()}}}};p=(()=>{let m=ac(),v=()=>{let E=ac();E!==m&&(m=E,e.publishEvent("tour.route_changed",{tourId:n,newRoute:E}))};window.addEventListener("popstate",v);let S=history.pushState.bind(history),w=history.replaceState.bind(history);return history.pushState=(...E)=>{S(...E),v()},history.replaceState=(...E)=>{w(...E),v()},()=>{window.removeEventListener("popstate",v),history.pushState=S,history.replaceState=w}})(),o?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 g=async()=>{u=!0,vf.delete(n),await y(),p&&p(),e.publishEvent("tour.paused",{tourId:n,stepId:a.currentStepId})};return vf.set(n,{cleanup:g}),{cleanup:g}};var yf=class{constructor(){F(this,"executors",new Map);for(let{kind:e,executor:n}of Gv)this.registerCore(e,n);for(let{kind:e,executor:n}of ey)this.registerCore(e,n);for(let{kind:e,executor:n}of ty)this.registerCore(e,n);for(let{kind:e,executor:n}of ny)this.registerCore(e,n);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:tour",sy)}registerCore(e,n,i){this.executors.set(e,{kind:e,executor:n,schema:i,source:"core",isBuiltIn:!0})}register(e,n,i,r="custom",s=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)throw new Error(`Cannot override built-in executor: ${e}`);console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e}`)}this.executors.set(e,{kind:e,executor:n,schema:i,source:r,isBuiltIn:s})}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 i=e.kind;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 s=r.schema.safeParse(e);if(!s.success){for(let a of s.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)}},Vs=new yf;function n3(t){return Vs.get(t)}function ay(t){return Vs.has(t)}var i3=["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","navigation:scrollTo","navigation:navigate"],r3=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),eA=5e4,tA=50;function qr(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 i=t.kind;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(!i3.includes(i))return e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:e,warnings:n};switch(!ay(i)&&i!=="core:mountWidget"&&e.push({code:"NO_EXECUTOR",message:`No executor registered for action kind: ${i}`,field:"kind"}),i){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":jr(t,e,n);break;case"overlays:badge":jr(t,e,n),s3(t,e,n);break;case"overlays:tooltip":jr(t,e,n),a3(t,e,n);break;case"overlays:modal":v3(t,e,n);break;case"content:insertHtml":jr(t,e,n),o3(t,e,n);break;case"content:setText":jr(t,e,n),l3(t,e,n);break;case"content:setAttr":jr(t,e,n),c3(t,e,n);break;case"content:addClass":case"content:removeClass":jr(t,e,n),u3(t,e,n);break;case"content:setStyle":jr(t,e,n),d3(t,e,n);break;case"core:mountWidget":f3(t,e,n);break;case"core:wait":p3(t,e,n);break;case"core:sequence":h3(t,e,n);break;case"core:parallel":g3(t,e,n);break;case"core:tour":y3(t,e,n);break;case"navigation:navigate":m3(t,e,n);break}return{valid:e.length===0,errors:e,warnings:n}}function jr(t,e,n){!t.anchorId||typeof t.anchorId!="string"?e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' property",field:"anchorId"}):t.anchorId.length>200&&n.push({code:"LONG_ANCHOR_ID",message:"Anchor ID is unusually long",suggestion:"Consider using a shorter, more descriptive ID"})}function s3(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 a3(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 o3(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>eA&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${eA}`,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 l3(t,e,n){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function c3(t,e,n){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(r3.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 u3(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 d3(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>tA&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${i}). Maximum is ${tA}`,field:"styles"});for(let[r,s]of Object.entries(t.styles))typeof s=="string"&&s.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${r}`,field:`styles.${r}`})}}function f3(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 p3(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 h3(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=qr(t.actions[i]);for(let s of r.errors)e.push({...s,field:`actions[${i}]${s.field?`.${s.field}`:""}`});for(let s of r.warnings)n.push(s)}}function g3(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=qr(t.actions[i]);for(let s of r.errors)e.push({...s,field:`actions[${i}]${s.field?`.${s.field}`:""}`});for(let s of r.warnings)n.push(s)}}function m3(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 v3(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 y3(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 s=t.steps[r];if(!s.id||typeof s.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${r} requires 'id' property`,field:`steps[${r}].id`}):(i.has(s.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${s.id}`,field:`steps[${r}].id`}),i.add(s.id)),!s.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${r} requires 'action' property`,field:`steps[${r}].action`});else{let a=qr(s.action);for(let o of a.errors)e.push({...o,field:`steps[${r}].action${o.field?`.${o.field}`:""}`});for(let o of a.warnings)n.push(o)}if(s.onAction)for(let[a,o]of Object.entries(s.onAction))o!=="end"&&!t.steps.some(l=>l.id===o)&&n.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${s.id}" references unknown target step: ${o}`,suggestion:`Make sure step "${o}" exists in the tour`})}}function oy(t){let e=[],n=[];if(!Array.isArray(t))return 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=qr(t[i]);for(let s of r.errors)e.push({...s,field:s.field?`[${i}].${s.field}`:`[${i}]`});for(let s of r.warnings)n.push({...s,suggestion:s.suggestion?`Action ${i}: ${s.suggestion}`:void 0})}return{valid:e.length===0,errors:e,warnings:n}}var _3=0;function ly(t){let{overlayRoot:e,eventBus:n,surfaces:i,anchorResolver:r,adaptiveId:s,executorRegistry:a=Vs}=t,o=new Map;function l(){return`action-${++_3}`}function c(d,g){n&&n.publish(d,g)}function u(){return{overlayRoot:e,resolveAnchor:r,generateId:l,publishEvent:c,adaptiveId:s,applyAction:h,subscribeEvent:n?(d,g)=>n.subscribe({names:[d]},m=>g(m.props)):void 0}}async function f(d,g){if(!i)throw new Error("Surfaces provider required for core:mountWidget actions");let m=i.mount(d.slot,{type:"widget",widgetId:d.widget.widgetId,config:d.widget.props},{priority:d.widget.priority});return g.publishEvent("action.applied",{id:g.generateId(),kind:"core:mountWidget",slot:d.slot,widgetId:d.widget.widgetId}),{cleanup:()=>{m.unmount()},updateFn:v=>{if("widget"in v&&v.widget){let S=v.widget;S.props&&m.update({type:"widget",widgetId:d.widget.widgetId,config:S.props})}}}}async function h(d){let g=qr(d);if(!g.valid){let C=g.errors.map(R=>R.message).join("; ");throw new Error(`Action validation failed: ${C}`)}let m=l(),v=u(),S;if(d.kind==="core:mountWidget")S=await f(d,v);else{let C=a.get(d.kind);if(!C)throw new Error(`No executor for action kind: ${d.kind}`);S=await C(d,v)}let w={id:m,action:d,adaptiveId:s,appliedTs:Date.now(),state:"applied",cleanup:S.cleanup,updateFn:S.updateFn};return o.set(m,w),c("action.applied",{id:m,kind:d.kind,anchorId:"anchorId"in d?d.anchorId:void 0}),{id:m,action:d,async revert(){let C=o.get(m);if(!(!C||C.state!=="applied"))try{await C.cleanup(),C.state="reverted",c("action.reverted",{id:m,kind:d.kind})}catch(R){throw C.state="failed",c("action.failed",{id:m,kind:d.kind,error:String(R)}),R}finally{o.delete(m)}},isApplied(){return o.get(m)?.state==="applied"},async update(C){let R=o.get(m);if(!R||R.state!=="applied")throw new Error("Cannot update action that is not applied");if(R.updateFn)await R.updateFn(C);else throw new Error(`Action kind ${d.kind} does not support updates`)},getState(){return o.get(m)?.state??"reverted"}}}async function p(d){let g=oy(d);if(!g.valid){let E=g.errors.map(C=>C.message).join("; ");throw new Error(`Batch validation failed: ${E}`)}let m=l(),v=[],S=[];try{for(let E of d){let C=await h(E);v.push(C),S.push(C)}}catch(E){for(let C of S)try{await C.revert()}catch{}throw E}return{id:m,handles:v,async revertAll(){for(let E=v.length-1;E>=0;E--)try{await v[E].revert()}catch(C){console.error(`[ActionEngine] Error reverting action ${v[E].id}:`,C)}},isApplied(){return v.every(E=>E.isApplied())}}}function y(d){return qr(d)}function _(){return Array.from(o.values()).map(d=>({id:d.id,action:d.action,adaptiveId:d.adaptiveId,appliedTs:d.appliedTs,state:d.state}))}function b(){for(let d of o.values())if(d.state==="applied")try{d.cleanup()}catch(g){console.error("[ActionEngine] Error during cleanup:",g)}o.clear()}return{apply:h,applyBatch:p,validate:y,getActive:_,destroy:b}}function oc(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function _f(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}function nA(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),s=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 o=r.currentNode,l=o.tagName.toLowerCase();if(!s.has(l)){a.push(o);continue}for(let c of Array.from(o.attributes)){let u=c.name.toLowerCase(),f=c.value.trim().toLowerCase(),h=u.startsWith("on"),p=(u==="href"||u==="src")&&f.startsWith("javascript:");(h||p)&&o.removeAttribute(c.name)}}for(let o of a){for(;o.firstChild;)o.parentNode?.insertBefore(o.firstChild,o);o.remove()}return n.innerHTML=(i.firstChild,n.innerHTML)}function sA(t){let e=qe(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,r=et(t),s=r?t.offsetWidth:n,a=r?t.offsetHeight:i,o=Qn(n)!==s||Qn(i)!==a;return o&&(n=s,i=a),{width:n,height:i,$:o}}function uy(t){return je(t)?t:t.contextElement}function go(t){let e=uy(t);if(!et(e))return Ie(1);let n=e.getBoundingClientRect(),{width:i,height:r,$:s}=sA(e),a=(s?Qn(n.width):n.width)/i,o=(s?Qn(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}var b3=Ie(0);function aA(t){let e=Fe(t);return!Hs()||!e.visualViewport?b3:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function S3(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Fe(t)?!1:e}function Is(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let r=t.getBoundingClientRect(),s=uy(t),a=Ie(1);e&&(i?je(i)&&(a=go(i)):a=go(t));let o=S3(s,n,i)?aA(s):Ie(0),l=(r.left+o.x)/a.x,c=(r.top+o.y)/a.y,u=r.width/a.x,f=r.height/a.y;if(s){let h=Fe(s),p=i&&je(i)?Fe(i):i,y=h,_=Us(y);for(;_&&i&&p!==y;){let b=go(_),d=_.getBoundingClientRect(),g=qe(_),m=d.left+(_.clientLeft+parseFloat(g.paddingLeft))*b.x,v=d.top+(_.clientTop+parseFloat(g.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,f*=b.y,l+=m,c+=v,y=Fe(_),_=Us(y)}}return ei({width:u,height:f,x:l,y:c})}function dy(t,e){let n=ii(t).scrollLeft;return e?e.left+n:Is(Ze(t)).left+n}function oA(t,e,n){n===void 0&&(n=!1);let i=t.getBoundingClientRect(),r=i.left+e.scrollLeft-(n?0:dy(t,i)),s=i.top+e.scrollTop;return{x:r,y:s}}function x3(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t,s=r==="fixed",a=Ze(i),o=e?Fi(e.floating):!1;if(i===a||o&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Ie(1),u=Ie(0),f=et(i);if((f||!f&&!s)&&((Nn(i)!=="body"||ni(a))&&(l=ii(i)),et(i))){let p=Is(i);c=go(i),u.x=p.x+i.clientLeft,u.y=p.y+i.clientTop}let h=a&&!f&&!s?oA(a,l,!0):Ie(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 E3(t){return Array.from(t.getClientRects())}function w3(t){let e=Ze(t),n=ii(t),i=t.ownerDocument.body,r=Et(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=Et(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),a=-n.scrollLeft+dy(t),o=-n.scrollTop;return qe(i).direction==="rtl"&&(a+=Et(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:a,y:o}}function C3(t,e){let n=Fe(t),i=Ze(t),r=n.visualViewport,s=i.clientWidth,a=i.clientHeight,o=0,l=0;if(r){s=r.width,a=r.height;let c=Hs();(!c||c&&e==="fixed")&&(o=r.offsetLeft,l=r.offsetTop)}return{width:s,height:a,x:o,y:l}}function A3(t,e){let n=Is(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,s=et(t)?go(t):Ie(1),a=t.clientWidth*s.x,o=t.clientHeight*s.y,l=r*s.x,c=i*s.y;return{width:a,height:o,x:l,y:c}}function iA(t,e,n){let i;if(e==="viewport")i=C3(t,n);else if(e==="document")i=w3(Ze(t));else if(je(e))i=A3(e,n);else{let r=aA(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return ei(i)}function lA(t,e){let n=Rt(t);return n===e||!je(n)||wn(n)?!1:qe(n).position==="fixed"||lA(n,e)}function k3(t,e){let n=e.get(t);if(n)return n;let i=ti(t,[],!1).filter(o=>je(o)&&Nn(o)!=="body"),r=null,s=qe(t).position==="fixed",a=s?Rt(t):t;for(;je(a)&&!wn(a);){let o=qe(a),l=Bs(a);!l&&o.position==="fixed"&&(r=null),(s?!l&&!r:!l&&o.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||ni(a)&&!l&&lA(t,a))?i=i.filter(u=>u!==a):r=o,a=Rt(a)}return e.set(t,i),i}function T3(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t,a=[...n==="clippingAncestors"?Fi(e)?[]:k3(e,this._c):[].concat(n),i],o=a[0],l=a.reduce((c,u)=>{let f=iA(e,u,r);return c.top=Et(f.top,c.top),c.right=En(f.right,c.right),c.bottom=En(f.bottom,c.bottom),c.left=Et(f.left,c.left),c},iA(e,o,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function R3(t){let{width:e,height:n}=sA(t);return{width:e,height:n}}function O3(t,e,n){let i=et(e),r=Ze(e),s=n==="fixed",a=Is(t,!0,s,e),o={scrollLeft:0,scrollTop:0},l=Ie(0);if(i||!i&&!s)if((Nn(e)!=="body"||ni(r))&&(o=ii(e)),i){let h=Is(e,!0,s,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else r&&(l.x=dy(r));let c=r&&!i&&!s?oA(r,o):Ie(0),u=a.left+o.scrollLeft-l.x-c.x,f=a.top+o.scrollTop-l.y-c.y;return{x:u,y:f,width:a.width,height:a.height}}function cy(t){return qe(t).position==="static"}function rA(t,e){if(!et(t)||qe(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ze(t)===n&&(n=n.ownerDocument.body),n}function cA(t,e){let n=Fe(t);if(Fi(t))return n;if(!et(t)){let r=Rt(t);for(;r&&!wn(r);){if(je(r)&&!cy(r))return r;r=Rt(r)}return n}let i=rA(t,e);for(;i&&hf(i)&&cy(i);)i=rA(i,e);return i&&wn(i)&&cy(i)&&!Bs(i)?n:i||gf(t)||n}var M3=async function(t){let e=this.getOffsetParent||cA,n=this.getDimensions,i=await n(t.floating);return{reference:O3(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function N3(t){return qe(t).direction==="rtl"}var D3={convertOffsetParentRelativeRectToViewportRelativeRect:x3,getDocumentElement:Ze,getClippingRect:T3,getOffsetParent:cA,getElementRects:M3,getClientRects:E3,getDimensions:R3,getScale:go,isElement:je,isRTL:N3};function uA(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function L3(t,e){let n=null,i,r=Ze(t);function s(){var o;clearTimeout(i),(o=n)==null||o.disconnect(),n=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();let c=t.getBoundingClientRect(),{left:u,top:f,width:h,height:p}=c;if(o||e(),!h||!p)return;let y=Jn(f),_=Jn(r.clientWidth-(u+h)),b=Jn(r.clientHeight-(f+p)),d=Jn(u),m={rootMargin:-y+"px "+-_+"px "+-b+"px "+-d+"px",threshold:Et(0,En(1,l))||1},v=!0;function S(w){let E=w[0].intersectionRatio;if(E!==l){if(!v)return a();E?a(!1,E):i=setTimeout(()=>{a(!1,1e-7)},1e3)}E===1&&!uA(c,t.getBoundingClientRect())&&a(),v=!1}try{n=new IntersectionObserver(S,{...m,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,m)}n.observe(t)}return a(!0),s}function dA(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=uy(t),u=r||s?[...c?ti(c):[],...ti(e)]:[];u.forEach(d=>{r&&d.addEventListener("scroll",n,{passive:!0}),s&&d.addEventListener("resize",n)});let f=c&&o?L3(c,n):null,h=-1,p=null;a&&(p=new ResizeObserver(d=>{let[g]=d;g&&g.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var m;(m=p)==null||m.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let y,_=l?Is(t):null;l&&b();function b(){let d=Is(t);_&&!uA(_,d)&&n(),_=d,y=requestAnimationFrame(b)}return n(),()=>{var d;u.forEach(g=>{r&&g.removeEventListener("scroll",n),s&&g.removeEventListener("resize",n)}),f?.(),(d=p)==null||d.disconnect(),p=null,l&&cancelAnimationFrame(y)}}var fA=df;var pA=ff,hA=uf;var gA=(t,e,n)=>{let i=new Map,r={platform:D3,...n},s={...r.platform,_c:i};return cf(t,e,{...r,platform:s})};var mA={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"}},lc={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:[]},vA={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function fy(t,e,n){let i=mA[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 py(t,e,n){let i=n.placement==="auto"?"bottom":n.placement,r=[fA(n.offset?{mainAxis:n.offset.y,crossAxis:n.offset.x}:8)];return n.flip!==!1&&r.push(hA()),n.shift!==!1&&r.push(pA({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",dA(e,t,async()=>{let{x:a,y:o,strategy:l}=await gA(e,t,{placement:i,middleware:r});Object.assign(t.style,{position:l,left:`${a}px`,top:`${o}px`})})}function hy(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 gy(t,e){return e==="none"||lc[e].length===0?null:t.animate(lc[e],vA)}function my(t,e){if(e==="none"||lc[e].length===0)return Promise.resolve();let n=[...lc[e]].reverse(),i=t.animate(n,vA);return new Promise(r=>{i.onfinish=()=>r(),i.oncancel=()=>r()})}function vy(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 yy(t){switch(oc(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}}var z3=0;function _y(t){let{overlayRoot:e,eventBus:n,anchorResolver:i,defaultAnimation:r="fade",widgetRegistry:s}=t,a=new Map,o=new Map,l=new Map;function c(){return`mount-${++z3}`}function u(v,S){n&&n.publish(v,S)}function f(v){let S=l.get(v);if(S){let w=b(v);for(let E of S)try{E(w)}catch(C){console.error("[Surfaces] State callback error:",C)}}}let h=new Map;function p(v,S,w){switch(S.type){case"html":v.innerHTML=nA(S.content);return;case"widget":{if(s&&s.has(S.widgetId)){let E=s.mount(S.widgetId,v,S.config);return w&&h.set(w,E),()=>{E.unmount(),w&&h.delete(w)}}console.warn(`[Surfaces] Widget not found: ${S.widgetId}`),v.innerHTML=`<div data-widget-id="${S.widgetId}" data-widget-missing="true">Widget: ${S.widgetId}</div>`;return}case"custom":return S.mount(v);case"react":v.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function y(v,S,w){let E=c(),C=oc(v),R=w?.priority??0,T=w?.animation??r,I=w?.exclusive??!0,G=a.get(v);if(G&&I){if(G.options.priority>R)throw new Error(`Slot ${v} is occupied by higher priority content (${G.options.priority} > ${R})`);_(G)}let K=vy(v,E);K.style.zIndex=String(yy(v));let q;if(C==="static")fy(K,v,w?.constraints),e.appendChild(K);else if(C==="inline"){let H=_f(v);if(!H)throw new Error(`Invalid inline slot: ${v}`);if(!i)throw new Error("Anchor resolver required for inline slots");let W=i(H);if(!W)throw new Error(`Anchor not found for inline slot: ${H}`);q=hy(K,W)}else if(C==="adjacent"){let H=_f(v);if(!H)throw new Error(`Invalid adjacent slot: ${v}`);if(!i)throw new Error("Anchor resolver required for adjacent slots");let W=i(H);if(!W)throw new Error(`Anchor not found for adjacent slot: ${H}`);e.appendChild(K),q=py(K,W,w?.position??{placement:"bottom"})}let he=p(K,S,E);gy(K,T);let U={id:E,slot:v,content:S,options:{priority:R,exclusive:I,animation:T,position:w?.position??{placement:"auto"},constraints:w?.constraints??{},adaptiveId:w?.adaptiveId,autoUnmountOnRouteChange:w?.autoUnmountOnRouteChange??!0},container:K,cleanup:()=>{q?.(),he?.()},mountedAt:Date.now()};return a.set(v,U),o.set(v,(o.get(v)??0)+1),u("surface.mounted",{slot:v,id:E,adaptiveId:w?.adaptiveId}),f(v),{id:E,update(H){let W=a.get(v);if(!W||W.id!==E)throw new Error("Mount no longer active");let Ot=h.get(E);if(Ot){if(H.type==="widget"){Ot.update(H.config),W.content=H;return}Ot.unmount(),h.delete(E)}W.container.innerHTML="";let ri=p(W.container,H,E);if(W.content=H,ri){let ct=W.cleanup;W.cleanup=()=>{ct?.(),ri()}}},setOptions(H){let W=a.get(v);if(!W||W.id!==E)throw new Error("Mount no longer active");H.priority!==void 0&&(W.options.priority=H.priority),H.animation!==void 0&&(W.options.animation=H.animation),H.constraints&&C==="static"&&(H.constraints.maxWidth&&(W.container.style.maxWidth=H.constraints.maxWidth),H.constraints.maxHeight&&(W.container.style.maxHeight=H.constraints.maxHeight),H.constraints.minWidth&&(W.container.style.minWidth=H.constraints.minWidth),H.constraints.minHeight&&(W.container.style.minHeight=H.constraints.minHeight)),f(v)},async unmount(){let H=a.get(v);!H||H.id!==E||await _(H)},isMounted(){return a.get(v)?.id===E},getContainer(){let H=a.get(v);return H?.id===E?H.container:null}}}async function _(v){await my(v.container,v.options.animation),v.cleanup?.(),v.container.remove(),a.delete(v.slot),u("surface.unmounted",{slot:v.slot,id:v.id}),f(v.slot)}function b(v){let S=a.get(v);return{slot:v,occupied:!!S,currentPriority:S?.options.priority,currentAdaptiveId:S?.options.adaptiveId,mountCount:o.get(v)??0,currentMountId:S?.id}}function d(v,S){let w=l.get(v);return w||(w=new Set,l.set(v,w)),w.add(S),()=>{w?.delete(S),w?.size===0&&l.delete(v)}}function g(v,S){let w=a.get(v);return w?S!==void 0?S>=w.options.priority:!1:!0}function m(){for(let v of a.values())try{v.cleanup?.(),v.container.remove()}catch(S){console.error("[Surfaces] Error during cleanup:",S)}a.clear(),l.clear()}return{mount:y,getState:b,onStateChange:d,canMount:g,destroy:m}}var bf=class{constructor(){F(this,"widgets",new Map);F(this,"mountedWidgets",new Map);F(this,"mountIdCounter",0)}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})}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),!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 s=`widget-mount-${++this.mountIdCounter}`;n.setAttribute("data-widget-mount-id",s),n.setAttribute("data-widget-id",e);let a=r.widget.mount(n,i);return this.mountedWidgets.set(s,{cleanup:a??void 0,container:n}),{widgetId:e,container:n,unmount:()=>{let l=this.mountedWidgets.get(s);l&&(l.cleanup?.(),this.mountedWidgets.delete(s),n.removeAttribute("data-widget-mount-id"),n.removeAttribute("data-widget-id"),n.innerHTML="")},update:l=>{if(r.widget.update)r.widget.update(n,l);else{let c=this.mountedWidgets.get(s);if(c){c.cleanup?.(),n.innerHTML="";let u=r.widget.mount(n,l);c.cleanup=u??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)}destroy(){for(let[e,n]of this.mountedWidgets.entries())n.cleanup?.(),n.container.innerHTML="";this.mountedWidgets.clear()}},by=new bf;function Sy(t){let{appId:e,runtime:n,isBuiltIn:i=!1}=t,r=`app:${e}:`,s=[],a=[],o=n.state.ns(`app:${e}`);return{appId:e,state:{get:c=>o.get(c),set:(c,u)=>o.set(c,u),remove:c=>o.remove(c)},telemetry:n.telemetry?{emit:(c,u)=>{n.events.publish(c,{...u,_appId:e})},getSessionId:()=>n.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(c,u,f)=>{let h=n.surfaces.mount(c,u,{...f,adaptiveId:e});return{unmount:()=>h.unmount(),update:p=>h.update(p)}},canMount:(c,u)=>n.surfaces.canMount(c,u)},events:{subscribe:c=>n.events.subscribe(u=>{c(u)}),publish:(c,u)=>{n.events.publish(c,{...u,_appId:e})}},registerAction:c=>{n.executors.register(c.kind,c.executor,c.schema,e,i),s.push(c.kind)},registerWidget:c=>{n.widgets.register(c.id,c.component,e,c.metadata),a.push(c.id)}}}function xy(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var Sf=class{constructor(){F(this,"apps",new Map);F(this,"eventListeners",new Set);F(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,n]of this.apps)n.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 n={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,n),this.emit({type:"app:registered",appId:e.id,manifest:e}),n}async activate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state==="active"){console.warn(`[AppRegistry] App already active: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(n.manifest.dependencies)for(let i of n.manifest.dependencies){let r=this.apps.get(i);if(!r||r.state!=="active")throw new Error(`App ${e} depends on ${i}, which is not active`)}n.state="activating";try{let i=n.manifest.metadata?.isBuiltIn===!0,r=Sy({appId:e,runtime:this.runtime,isBuiltIn:i}),{runtime:s}=n.manifest,a=[];if(s){if(s.actions)for(let o of s.actions)r.registerAction(o);if(s.widgets)for(let o of s.widgets)r.registerWidget(o);if(s.events)for(let o of s.events){let l=this.runtime.events.subscribe(c=>{if(o.names.includes(c.name)){let u={appId:e,state:r.state,telemetry:r.telemetry,surfaces:r.surfaces};try{o.handler(c,u)}catch(f){console.error(`[AppRegistry] Event handler error in ${e}:`,f)}}});a.push(l)}}n.cleanup=async()=>{for(let o of a)try{await o()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}xy(e,this.runtime)},n.state="active",n.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(i){throw n.state="error",n.error=String(i),this.emit({type:"app:error",appId:e,error:String(i)}),i}}async deactivate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[i,r]of this.apps)if(r.state==="active"&&r.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${i} depends on it`);n.state="deactivating";try{n.cleanup&&(await n.cleanup(),n.cleanup=void 0),n.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(i){throw n.state="error",n.error=String(i),this.emit({type:"app:error",appId:e,error:String(i)}),i}}async unregister(e){let n=this.apps.get(e);n&&(n.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 n of this.eventListeners)try{n(e)}catch(i){console.error("[AppRegistry] Event listener error:",i)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},Ey=new Sf;var B3=new Set(["overlays:highlight","overlays:pulse","overlays:badge","overlays:tooltip","content:insertHtml","content:setText","content:setAttr","content:addClass","content:removeClass","content:setStyle","core:mountWidget","core:wait","core:sequence","core:parallel","navigation:scrollTo","navigation:navigate"]);function yA(t){return B3.has(t)}function _A(t){if(yA(t))return null;let e=t.indexOf(":");return e===-1?null:t.slice(0,e)}function bA(t){let e=t.indexOf(":");return e===-1?null:t.slice(0,e)}function wy(t){let{cdnBase:e,registry:n,timeout:i=1e4,onLoadStart:r,onLoadEnd:s}=t,a=new Map,o=new Set;function l(y){return`${e}/apps/${y}/index.js`}async function c(y){if(n.has(y))return{appId:y,success:!0,manifest:n.get(y)?.manifest};if(a.has(y))return a.get(y);let _=(async()=>{r?.(y);try{let b=l(y);if(o.has(b)){let v=n.get(y);if(v)return s?.(y,!0),{appId:y,success:!0,manifest:v.manifest}}let d=new Promise((v,S)=>{setTimeout(()=>S(new Error(`Timeout loading app: ${y}`)),i)}),g=u(b,y);await Promise.race([g,d]),o.add(b);let m=n.get(y);if(!m)throw new Error(`App ${y} did not register after loading`);return s?.(y,!0),{appId:y,success:!0,manifest:m.manifest}}catch(b){let d=b instanceof Error?b.message:String(b);return s?.(y,!1,d),{appId:y,success:!1,error:d}}finally{a.delete(y)}})();return a.set(y,_),_}async function u(y,_){if(typeof window<"u"){try{let b=await import(y);b.manifest?n.register(b.manifest):b.default?.manifest?n.register(b.default.manifest):b.default&&n.register(b.default);return}catch{}return new Promise((b,d)=>{let g=document.createElement("script");g.src=y,g.async=!0,g.onload=()=>{n.get(_)?b():d(new Error(`App ${_} did not self-register`))},g.onerror=()=>{d(new Error(`Failed to load app script: ${y}`))},document.head.appendChild(g)})}throw new Error("Dynamic app loading not supported in SSR")}function f(y){let _=new Set;if(y.apps)for(let b of y.apps)_.add(b);if(y.actions)for(let b of y.actions){let d=_A(b.kind);if(d&&_.add(d),b.kind==="core:mountWidget"){let g=b.widget?.widgetId;if(g){let m=bA(g);m&&_.add(m)}}}return Array.from(_)}async function h(y){let _=f(y);return _.length===0?[]:await Promise.all(_.map(d=>c(d)))}async function p(y){return Promise.all(y.map(_=>c(_)))}return{loadApp:c,loadAppsForConfig:h,preloadApps:p,getRequiredApps:f,getAppUrl:l}}var SA=J(xe(),1),cc=J(bt(),1);var xA={mount(t,e){let{runtime:n,instanceId:i="nav-widget",...r}=e||{layout:"horizontal",theme:"auto",actions:[]};if(!n){let s=r.actions||[];t.innerHTML=`
144
- <nav style="display: flex; gap: 8px; padding: 8px; font-family: system-ui;">
145
- ${s.map(a=>`
146
- <a href="${a.config.href}" style="padding: 8px 12px; text-decoration: none; color: #374151;">
147
- ${a.config.icon?`<span>${a.config.icon}</span>`:""}
148
- ${a.config.label}
149
- </a>
150
- `).join("")}
151
- </nav>
152
- `}return()=>{t.innerHTML=""}}};var H3={id:"adaptive-nav",version:"1.0.0",name:"Navigation Links",description:"Widget-based navigation link list with per-item conditional visibility",executors:[],widgets:[{id:"adaptive-nav:links",component:xA,metadata:{name:"Navigation Links",description:"Horizontal or vertical navigation link list",icon:"\u{1F517}"}}]};var EA=J(xe(),1),uc=J(bt(),1);var wA={mount(t,e){let{runtime:n,instanceId:i="faq-widget",...r}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(!n){let s=r.actions||[];t.innerHTML=`
153
- <div style="font-family: system-ui; max-width: 800px;">
154
- ${s.map(a=>`
155
- <div style="margin-bottom: 8px; padding: 16px; background: #f9fafb; border-radius: 8px;">
156
- <strong>${a.config.question}</strong>
157
- <p style="margin-top: 8px; color: #4b5563;">${a.config.answer}</p>
158
- </div>
159
- `).join("")}
160
- </div>
161
- `}return()=>{t.innerHTML=""}}};var U3={id:"adaptive-faq",version:"1.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with per-item conditional visibility",executors:[],widgets:[{id:"adaptive-faq:accordion",component:wA,metadata:{name:"FAQ Accordion",description:"Collapsible Q&A accordion with search",icon:"\u2753"}}]};var dc=null;function AA(){if(dc&&document.body.contains(dc))return dc;let t=document.getElementById("syntro-overlays");return t||(t=document.createElement("div"),t.id="syntro-overlays",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none"}),document.body.appendChild(t)),dc=t,$3(),dc}var CA=!1;function $3(){if(CA)return;let t=`
142
+ </div>`);let o=Kb(n,e.overlayRoot,{html:i,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:s=>{if(s==="cta"&&r.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:r.cta.label});else if(r.ctaButtons){let a=r.ctaButtons.find(l=>l.actionId===s);a&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:s,label:a.label})}}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:tooltip",anchorId:t.anchorId,trigger:t.trigger??"immediate"}),{cleanup:()=>{o.destroy()}}},pm=[{kind:"overlays:highlight",executor:Gb},{kind:"overlays:pulse",executor:Zb},{kind:"overlays:badge",executor:Yb},{kind:"overlays:tooltip",executor:Xb},{kind:"overlays:modal",executor:fm}],w2={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, and visual overlays",executors:pm};var Qb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=window.scrollX,i=window.scrollY;return n.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:()=>{}}},Jb=async(t,e)=>{let n=t.url.trim();if(n.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(n,"_blank","noopener,noreferrer"):window.location.href=n,{cleanup:()=>{}}},hm=[{kind:"navigation:scrollTo",executor:Qb},{kind:"navigation:navigate",executor:Jb}],x2={id:"adaptive-navigation",version:"1.0.0",name:"Navigation",description:"Scroll and page navigation actions",executors:hm};var mm="syntro_active_tour",Zu=new Map;function S2(t){try{let e=localStorage.getItem(mm);if(!e)return null;let n=JSON.parse(e);return n.tourId!==t?null:n}catch{return null}}function gm(t){try{localStorage.setItem(mm,JSON.stringify(t))}catch{}}function b2(){try{localStorage.removeItem(mm)}catch{}}function Za(){return window.location.pathname}function k2(t){if(!t.route)return!0;let e=Za();return t.route.includes("*")?new RegExp("^"+t.route.replace(/\*/g,".*")+"$").test(e):e===t.route}var vm=async(t,e)=>{let{tourId:n,steps:r,startStep:i,autoStart:o=!0}=t;if(r.length===0)throw new Error(`Tour "${n}" has no steps`);if(Zu.has(n))return{cleanup:async()=>{let m=Zu.get(n);m&&await m.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let s=S2(n),a=!!s;if(!a&&!o)return{cleanup:()=>{}};s||(s={tourId:n,currentStepId:i||r[0].id,startedAt:Date.now()},gm(s));let l=r.findIndex(m=>m.id===s.currentStepId);if(l===-1){let m=i||r[0].id;l=r.findIndex(y=>y.id===m),l===-1&&(l=0),s.currentStepId=r[l].id,gm(s)}let c=r[l];if(!k2(c))return e.publishEvent("tour.waiting_for_route",{tourId:n,stepId:c.id,expectedRoute:c.route,currentRoute:Za()}),{cleanup:()=>{}};let u=!1,f=null,h=null,g=null,v=async()=>{h&&(h(),h=null),f&&f.isApplied()&&(await f.revert(),f=null)},_=async m=>{if(u)return;if(await v(),m==="end"){b2(),e.publishEvent("tour.completed",{tourId:n,totalSteps:r.length}),u=!0;return}let y=r.find(w=>w.id===m);if(!y){console.error(`[Tour] Step "${m}" not found`);return}if(s.currentStepId=m,gm(s),e.publishEvent("tour.step_changed",{tourId:n,previousStepId:c.id,nextStepId:m}),y.route&&y.route!==Za()){e.publishEvent("tour.awaiting_navigation",{tourId:n,stepId:m,targetRoute:y.route});return}await x(y)},x=async m=>{if(!u){e.publishEvent("tour.step_started",{tourId:n,stepId:m.id,stepIndex:r.findIndex(y=>y.id===m.id),totalSteps:r.length});try{f=await e.applyAction(m.action)}catch(y){console.error(`[Tour] Failed to execute step "${m.id}":`,y),e.publishEvent("tour.step_failed",{tourId:n,stepId:m.id,error:String(y)});return}if(m.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",k=>{let b=k?.actionId;if(b&&m.onAction){let E=m.onAction[b];E&&_(E)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",k=>{let b=k?.actionId;if(b&&m.onAction){let E=m.onAction[b];E&&_(E)}}),w=h;h=()=>{w(),y()}}}};g=(()=>{let m=Za(),y=()=>{let b=Za();b!==m&&(m=b,e.publishEvent("tour.route_changed",{tourId:n,newRoute:b}))};window.addEventListener("popstate",y);let w=history.pushState.bind(history),k=history.replaceState.bind(history);return history.pushState=(...b)=>{w(...b),y()},history.replaceState=(...b)=>{k(...b),y()},()=>{window.removeEventListener("popstate",y),history.pushState=w,history.replaceState=k}})(),a?e.publishEvent("tour.resumed",{tourId:n,stepId:s.currentStepId}):e.publishEvent("tour.started",{tourId:n,totalSteps:r.length,startStepId:s.currentStepId}),await x(c);let p=async()=>{u=!0,Zu.delete(n),await v(),g&&g(),e.publishEvent("tour.paused",{tourId:n,stepId:s.currentStepId})};return Zu.set(n,{cleanup:p}),{cleanup:p}};var Yu=class{constructor(){j(this,"executors",new Map);for(let{kind:e,executor:n}of om)this.registerCore(e,n);for(let{kind:e,executor:n}of pm)this.registerCore(e,n);for(let{kind:e,executor:n}of hm)this.registerCore(e,n);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:tour",vm)}registerCore(e,n,r){this.executors.set(e,{kind:e,executor:n,schema:r,source:"core",isBuiltIn:!0})}register(e,n,r,i="custom",o=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)throw new Error(`Cannot override built-in executor: ${e}`);console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e}`)}this.executors.set(e,{kind:e,executor:n,schema:r,source:i,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,r]of this.executors.entries())r.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 r=e.kind;if(!r||typeof r!="string")return n.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:n,warnings:[]};let i=this.executors.get(r);if(!i)return n.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:n,warnings:[]};if(i.schema){let o=i.schema.safeParse(e);if(!o.success){for(let s of o.error.issues)n.push({code:"SCHEMA_VALIDATION_ERROR",message:s.message,field:s.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)}},eo=new Yu;function E2(t){return eo.get(t)}function ym(t){return eo.has(t)}var C2=["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","navigation:scrollTo","navigation:navigate"],A2=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),ek=5e4,tk=50;function ci(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 r=t.kind;if(!r||typeof r!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:n};if(!C2.includes(r))return e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:e,warnings:n};switch(!ym(r)&&r!=="core:mountWidget"&&e.push({code:"NO_EXECUTOR",message:`No executor registered for action kind: ${r}`,field:"kind"}),r){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":li(t,e,n);break;case"overlays:badge":li(t,e,n),R2(t,e,n);break;case"overlays:tooltip":li(t,e,n),T2(t,e,n);break;case"overlays:modal":V2(t,e,n);break;case"content:insertHtml":li(t,e,n),P2(t,e,n);break;case"content:setText":li(t,e,n),I2(t,e,n);break;case"content:setAttr":li(t,e,n),O2(t,e,n);break;case"content:addClass":case"content:removeClass":li(t,e,n),N2(t,e,n);break;case"content:setStyle":li(t,e,n),L2(t,e,n);break;case"core:mountWidget":M2(t,e,n);break;case"core:wait":F2(t,e,n);break;case"core:sequence":$2(t,e,n);break;case"core:parallel":D2(t,e,n);break;case"core:tour":z2(t,e,n);break;case"navigation:navigate":B2(t,e,n);break}return{valid:e.length===0,errors:e,warnings:n}}function li(t,e,n){!t.anchorId||typeof t.anchorId!="string"?e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' property",field:"anchorId"}):t.anchorId.length>200&&n.push({code:"LONG_ANCHOR_ID",message:"Anchor ID is unusually long",suggestion:"Consider using a shorter, more descriptive ID"})}function R2(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 T2(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 P2(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>ek&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${ek}`,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 I2(t,e,n){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function O2(t,e,n){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(A2.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 N2(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 L2(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 r=Object.keys(t.styles).length;r>tk&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${r}). Maximum is ${tk}`,field:"styles"});for(let[i,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${i}`,field:`styles.${i}`})}}function M2(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 F2(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 $2(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 r=0;r<t.actions.length;r++){let i=ci(t.actions[r]);for(let o of i.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of i.warnings)n.push(o)}}function D2(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 r=0;r<t.actions.length;r++){let i=ci(t.actions[r]);for(let o of i.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of i.warnings)n.push(o)}}function B2(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 r=t.url.trim().toLowerCase();r.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),r.startsWith("data:")&&n.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function V2(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 r=0;r<t.ctaButtons.length;r++){let i=t.ctaButtons[r];(!i.label||typeof i.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${r} requires 'label' property`,field:`ctaButtons[${r}].label`}),(!i.actionId||typeof i.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${r} requires 'actionId' property`,field:`ctaButtons[${r}].actionId`})}}function z2(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 r=new Set;for(let i=0;i<t.steps.length;i++){let o=t.steps[i];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${i} requires 'id' property`,field:`steps[${i}].id`}):(r.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${i}].id`}),r.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${i} requires 'action' property`,field:`steps[${i}].action`});else{let s=ci(o.action);for(let a of s.errors)e.push({...a,field:`steps[${i}].action${a.field?`.${a.field}`:""}`});for(let a of s.warnings)n.push(a)}if(o.onAction)for(let[s,a]of Object.entries(o.onAction))a!=="end"&&!t.steps.some(l=>l.id===a)&&n.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${a}`,suggestion:`Make sure step "${a}" exists in the tour`})}}function _m(t){let e=[],n=[];if(!Array.isArray(t))return e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:n};for(let r=0;r<t.length;r++){let i=ci(t[r]);for(let o of i.errors)e.push({...o,field:o.field?`[${r}].${o.field}`:`[${r}]`});for(let o of i.warnings)n.push({...o,suggestion:o.suggestion?`Action ${r}: ${o.suggestion}`:void 0})}return{valid:e.length===0,errors:e,warnings:n}}var H2=0;function wm(t){let{overlayRoot:e,eventBus:n,surfaces:r,anchorResolver:i,adaptiveId:o,executorRegistry:s=eo}=t,a=new Map;function l(){return`action-${++H2}`}function c(d,p){n&&n.publish(d,p)}function u(){return{overlayRoot:e,resolveAnchor:i,generateId:l,publishEvent:c,adaptiveId:o,applyAction:h,subscribeEvent:n?(d,p)=>n.subscribe({names:[d]},m=>p(m.props)):void 0}}async function f(d,p){if(!r)throw new Error("Surfaces provider required for core:mountWidget actions");let m=r.mount(d.slot,{type:"widget",widgetId:d.widget.widgetId,config:d.widget.props},{priority:d.widget.priority});return p.publishEvent("action.applied",{id:p.generateId(),kind:"core:mountWidget",slot:d.slot,widgetId:d.widget.widgetId}),{cleanup:()=>{m.unmount()},updateFn:y=>{if("widget"in y&&y.widget){let w=y.widget;w.props&&m.update({type:"widget",widgetId:d.widget.widgetId,config:w.props})}}}}async function h(d){let p=ci(d);if(!p.valid){let E=p.errors.map(P=>P.message).join("; ");throw new Error(`Action validation failed: ${E}`)}let m=l(),y=u(),w;if(d.kind==="core:mountWidget")w=await f(d,y);else{let E=s.get(d.kind);if(!E)throw new Error(`No executor for action kind: ${d.kind}`);w=await E(d,y)}let k={id:m,action:d,adaptiveId:o,appliedTs:Date.now(),state:"applied",cleanup:w.cleanup,updateFn:w.updateFn};return a.set(m,k),c("action.applied",{id:m,kind:d.kind,anchorId:"anchorId"in d?d.anchorId:void 0}),{id:m,action:d,async revert(){let E=a.get(m);if(!(!E||E.state!=="applied"))try{await E.cleanup(),E.state="reverted",c("action.reverted",{id:m,kind:d.kind})}catch(P){throw E.state="failed",c("action.failed",{id:m,kind:d.kind,error:String(P)}),P}finally{a.delete(m)}},isApplied(){return a.get(m)?.state==="applied"},async update(E){let P=a.get(m);if(!P||P.state!=="applied")throw new Error("Cannot update action that is not applied");if(P.updateFn)await P.updateFn(E);else throw new Error(`Action kind ${d.kind} does not support updates`)},getState(){return a.get(m)?.state??"reverted"}}}async function g(d){let p=_m(d);if(!p.valid){let b=p.errors.map(E=>E.message).join("; ");throw new Error(`Batch validation failed: ${b}`)}let m=l(),y=[],w=[];try{for(let b of d){let E=await h(b);y.push(E),w.push(E)}}catch(b){for(let E of w)try{await E.revert()}catch{}throw b}return{id:m,handles:y,async revertAll(){for(let b=y.length-1;b>=0;b--)try{await y[b].revert()}catch(E){console.error(`[ActionEngine] Error reverting action ${y[b].id}:`,E)}},isApplied(){return y.every(b=>b.isApplied())}}}function v(d){return ci(d)}function _(){return Array.from(a.values()).map(d=>({id:d.id,action:d.action,adaptiveId:d.adaptiveId,appliedTs:d.appliedTs,state:d.state}))}function x(){for(let d of a.values())if(d.state==="applied")try{d.cleanup()}catch(p){console.error("[ActionEngine] Error during cleanup:",p)}a.clear()}return{apply:h,applyBatch:g,validate:v,getActive:_,destroy:x}}function Ya(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function Xu(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}function nk(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 r=n.content,i=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"]),s=[];for(;i.nextNode();){let a=i.currentNode,l=a.tagName.toLowerCase();if(!o.has(l)){s.push(a);continue}for(let c of Array.from(a.attributes)){let u=c.name.toLowerCase(),f=c.value.trim().toLowerCase(),h=u.startsWith("on"),g=(u==="href"||u==="src")&&f.startsWith("javascript:");(h||g)&&a.removeAttribute(c.name)}}for(let a of s){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML=(r.firstChild,n.innerHTML)}function ok(t){let e=Le(t),n=parseFloat(e.width)||0,r=parseFloat(e.height)||0,i=Ve(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Nn(n)!==o||Nn(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Sm(t){return Ne(t)?t:t.contextElement}function ps(t){let e=Sm(t);if(!Ve(e))return Ie(1);let n=e.getBoundingClientRect(),{width:r,height:i,$:o}=ok(e),s=(o?Nn(n.width):n.width)/r,a=(o?Nn(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var j2=Ie(0);function sk(t){let e=Oe(t);return!Xi()||!e.visualViewport?j2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function U2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Oe(t)?!1:e}function to(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),o=Sm(t),s=Ie(1);e&&(r?Ne(r)&&(s=ps(r)):s=ps(t));let a=U2(o,n,r)?sk(o):Ie(0),l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){let h=Oe(o),g=r&&Ne(r)?Oe(r):r,v=h,_=Qi(v);for(;_&&r&&g!==v;){let x=ps(_),d=_.getBoundingClientRect(),p=Le(_),m=d.left+(_.clientLeft+parseFloat(p.paddingLeft))*x.x,y=d.top+(_.clientTop+parseFloat(p.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,f*=x.y,l+=m,c+=y,v=Oe(_),_=Qi(v)}}return Mn({width:u,height:f,x:l,y:c})}function bm(t,e){let n=Dn(t).scrollLeft;return e?e.left+n:to($e(t)).left+n}function ak(t,e,n){n===void 0&&(n=!1);let r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:bm(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function W2(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t,o=i==="fixed",s=$e(r),a=e?hr(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Ie(1),u=Ie(0),f=Ve(r);if((f||!f&&!o)&&((gn(r)!=="body"||$n(s))&&(l=Dn(r)),Ve(r))){let g=to(r);c=ps(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}let h=s&&!f&&!o?ak(s,l,!0):Ie(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 q2(t){return Array.from(t.getClientRects())}function K2(t){let e=$e(t),n=Dn(t),r=t.ownerDocument.body,i=ct(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=ct(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),s=-n.scrollLeft+bm(t),a=-n.scrollTop;return Le(r).direction==="rtl"&&(s+=ct(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function G2(t,e){let n=Oe(t),r=$e(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;let c=Xi();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function Z2(t,e){let n=to(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Ve(t)?ps(t):Ie(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function rk(t,e,n){let r;if(e==="viewport")r=G2(t,n);else if(e==="document")r=K2($e(t));else if(Ne(e))r=Z2(e,n);else{let i=sk(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Mn(r)}function lk(t,e){let n=mt(t);return n===e||!Ne(n)||tn(n)?!1:Le(n).position==="fixed"||lk(n,e)}function Y2(t,e){let n=e.get(t);if(n)return n;let r=Fn(t,[],!1).filter(a=>Ne(a)&&gn(a)!=="body"),i=null,o=Le(t).position==="fixed",s=o?mt(t):t;for(;Ne(s)&&!tn(s);){let a=Le(s),l=Yi(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||$n(s)&&!l&&lk(t,s))?r=r.filter(u=>u!==s):i=a,s=mt(s)}return e.set(t,r),r}function X2(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t,s=[...n==="clippingAncestors"?hr(e)?[]:Y2(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{let f=rk(e,u,i);return c.top=ct(f.top,c.top),c.right=en(f.right,c.right),c.bottom=en(f.bottom,c.bottom),c.left=ct(f.left,c.left),c},rk(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Q2(t){let{width:e,height:n}=ok(t);return{width:e,height:n}}function J2(t,e,n){let r=Ve(e),i=$e(e),o=n==="fixed",s=to(t,!0,o,e),a={scrollLeft:0,scrollTop:0},l=Ie(0);if(r||!r&&!o)if((gn(e)!=="body"||$n(i))&&(a=Dn(e)),r){let h=to(e,!0,o,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&(l.x=bm(i));let c=i&&!r&&!o?ak(i,a):Ie(0),u=s.left+a.scrollLeft-l.x-c.x,f=s.top+a.scrollTop-l.y-c.y;return{x:u,y:f,width:s.width,height:s.height}}function xm(t){return Le(t).position==="static"}function ik(t,e){if(!Ve(t)||Le(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $e(t)===n&&(n=n.ownerDocument.body),n}function ck(t,e){let n=Oe(t);if(hr(t))return n;if(!Ve(t)){let i=mt(t);for(;i&&!tn(i);){if(Ne(i)&&!xm(i))return i;i=mt(i)}return n}let r=ik(t,e);for(;r&&qu(r)&&xm(r);)r=ik(r,e);return r&&tn(r)&&xm(r)&&!Yi(r)?n:r||Ku(t)||n}var eO=async function(t){let e=this.getOffsetParent||ck,n=this.getDimensions,r=await n(t.floating);return{reference:J2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tO(t){return Le(t).direction==="rtl"}var nO={convertOffsetParentRelativeRectToViewportRelativeRect:W2,getDocumentElement:$e,getClippingRect:X2,getOffsetParent:ck,getElementRects:eO,getClientRects:q2,getDimensions:Q2,getScale:ps,isElement:Ne,isRTL:tO};function uk(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function rO(t,e){let n=null,r,i=$e(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();let c=t.getBoundingClientRect(),{left:u,top:f,width:h,height:g}=c;if(a||e(),!h||!g)return;let v=Ln(f),_=Ln(i.clientWidth-(u+h)),x=Ln(i.clientHeight-(f+g)),d=Ln(u),m={rootMargin:-v+"px "+-_+"px "+-x+"px "+-d+"px",threshold:ct(0,en(1,l))||1},y=!0;function w(k){let b=k[0].intersectionRatio;if(b!==l){if(!y)return s();b?s(!1,b):r=setTimeout(()=>{s(!1,1e-7)},1e3)}b===1&&!uk(c,t.getBoundingClientRect())&&s(),y=!1}try{n=new IntersectionObserver(w,{...m,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,m)}n.observe(t)}return s(!0),o}function dk(t,e,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Sm(t),u=i||o?[...c?Fn(c):[],...Fn(e)]:[];u.forEach(d=>{i&&d.addEventListener("scroll",n,{passive:!0}),o&&d.addEventListener("resize",n)});let f=c&&a?rO(c,n):null,h=-1,g=null;s&&(g=new ResizeObserver(d=>{let[p]=d;p&&p.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var m;(m=g)==null||m.observe(e)})),n()}),c&&!l&&g.observe(c),g.observe(e));let v,_=l?to(t):null;l&&x();function x(){let d=to(t);_&&!uk(_,d)&&n(),_=d,v=requestAnimationFrame(x)}return n(),()=>{var d;u.forEach(p=>{i&&p.removeEventListener("scroll",n),o&&p.removeEventListener("resize",n)}),f?.(),(d=g)==null||d.disconnect(),g=null,l&&cancelAnimationFrame(v)}}var fk=ju;var pk=Uu,hk=Hu;var gk=(t,e,n)=>{let r=new Map,i={platform:nO,...n},o={...i.platform,_c:r};return zu(t,e,{...i,platform:o})};var mk={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"}},Xa={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:[]},vk={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function km(t,e,n){let r=mk[e];Object.assign(t.style,r),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 Em(t,e,n){let r=n.placement==="auto"?"bottom":n.placement,i=[fk(n.offset?{mainAxis:n.offset.y,crossAxis:n.offset.x}:8)];return n.flip!==!1&&i.push(hk()),n.shift!==!1&&i.push(pk({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",dk(e,t,async()=>{let{x:s,y:a,strategy:l}=await gk(e,t,{placement:r,middleware:i});Object.assign(t.style,{position:l,left:`${s}px`,top:`${a}px`})})}function Cm(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 Am(t,e){return e==="none"||Xa[e].length===0?null:t.animate(Xa[e],vk)}function Rm(t,e){if(e==="none"||Xa[e].length===0)return Promise.resolve();let n=[...Xa[e]].reverse(),r=t.animate(n,vk);return new Promise(i=>{r.onfinish=()=>i(),r.oncancel=()=>i()})}function Tm(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 Pm(t){switch(Ya(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}}var iO=0;function Im(t){let{overlayRoot:e,eventBus:n,anchorResolver:r,defaultAnimation:i="fade",widgetRegistry:o}=t,s=new Map,a=new Map,l=new Map;function c(){return`mount-${++iO}`}function u(y,w){n&&n.publish(y,w)}function f(y){let w=l.get(y);if(w){let k=x(y);for(let b of w)try{b(k)}catch(E){console.error("[Surfaces] State callback error:",E)}}}let h=new Map;function g(y,w,k){switch(w.type){case"html":y.innerHTML=nk(w.content);return;case"widget":{if(o&&o.has(w.widgetId)){let b=o.mount(w.widgetId,y,w.config);return k&&h.set(k,b),()=>{b.unmount(),k&&h.delete(k)}}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 v(y,w,k){let b=c(),E=Ya(y),P=k?.priority??0,A=k?.animation??i,H=k?.exclusive??!0,K=s.get(y);if(K&&H){if(K.options.priority>P)throw new Error(`Slot ${y} is occupied by higher priority content (${K.options.priority} > ${P})`);_(K)}let Y=Tm(y,b);Y.style.zIndex=String(Pm(y));let W;if(E==="static")km(Y,y,k?.constraints),e.appendChild(Y);else if(E==="inline"){let D=Xu(y);if(!D)throw new Error(`Invalid inline slot: ${y}`);if(!r)throw new Error("Anchor resolver required for inline slots");let Z=r(D);if(!Z)throw new Error(`Anchor not found for inline slot: ${D}`);W=Cm(Y,Z)}else if(E==="adjacent"){let D=Xu(y);if(!D)throw new Error(`Invalid adjacent slot: ${y}`);if(!r)throw new Error("Anchor resolver required for adjacent slots");let Z=r(D);if(!Z)throw new Error(`Anchor not found for adjacent slot: ${D}`);e.appendChild(Y),W=Em(Y,Z,k?.position??{placement:"bottom"})}let le=g(Y,w,b);Am(Y,A);let B={id:b,slot:y,content:w,options:{priority:P,exclusive:H,animation:A,position:k?.position??{placement:"auto"},constraints:k?.constraints??{},adaptiveId:k?.adaptiveId,autoUnmountOnRouteChange:k?.autoUnmountOnRouteChange??!0},container:Y,cleanup:()=>{W?.(),le?.()},mountedAt:Date.now()};return s.set(y,B),a.set(y,(a.get(y)??0)+1),u("surface.mounted",{slot:y,id:b,adaptiveId:k?.adaptiveId}),f(y),{id:b,update(D){let Z=s.get(y);if(!Z||Z.id!==b)throw new Error("Mount no longer active");let vt=h.get(b);if(vt){if(D.type==="widget"){vt.update(D.config),Z.content=D;return}vt.unmount(),h.delete(b)}Z.container.innerHTML="";let Bn=g(Z.container,D,b);if(Z.content=D,Bn){let Ge=Z.cleanup;Z.cleanup=()=>{Ge?.(),Bn()}}},setOptions(D){let Z=s.get(y);if(!Z||Z.id!==b)throw new Error("Mount no longer active");D.priority!==void 0&&(Z.options.priority=D.priority),D.animation!==void 0&&(Z.options.animation=D.animation),D.constraints&&E==="static"&&(D.constraints.maxWidth&&(Z.container.style.maxWidth=D.constraints.maxWidth),D.constraints.maxHeight&&(Z.container.style.maxHeight=D.constraints.maxHeight),D.constraints.minWidth&&(Z.container.style.minWidth=D.constraints.minWidth),D.constraints.minHeight&&(Z.container.style.minHeight=D.constraints.minHeight)),f(y)},async unmount(){let D=s.get(y);!D||D.id!==b||await _(D)},isMounted(){return s.get(y)?.id===b},getContainer(){let D=s.get(y);return D?.id===b?D.container:null}}}async function _(y){await Rm(y.container,y.options.animation),y.cleanup?.(),y.container.remove(),s.delete(y.slot),u("surface.unmounted",{slot:y.slot,id:y.id}),f(y.slot)}function x(y){let w=s.get(y);return{slot:y,occupied:!!w,currentPriority:w?.options.priority,currentAdaptiveId:w?.options.adaptiveId,mountCount:a.get(y)??0,currentMountId:w?.id}}function d(y,w){let k=l.get(y);return k||(k=new Set,l.set(y,k)),k.add(w),()=>{k?.delete(w),k?.size===0&&l.delete(y)}}function p(y,w){let k=s.get(y);return k?w!==void 0?w>=k.options.priority:!1:!0}function m(){for(let y of s.values())try{y.cleanup?.(),y.container.remove()}catch(w){console.error("[Surfaces] Error during cleanup:",w)}s.clear(),l.clear()}return{mount:v,getState:x,onStateChange:d,canMount:p,destroy:m}}var Qu=class{constructor(){j(this,"widgets",new Map);j(this,"mountedWidgets",new Map);j(this,"mountIdCounter",0)}register(e,n,r="custom",i){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:r,metadata:i})}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),!0):!1}unregisterBySource(e){for(let[n,r]of this.widgets.entries())r.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,r){let i=this.widgets.get(e);if(!i)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 s=i.widget.mount(n,r);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:n}),{widgetId:e,container:n,unmount:()=>{let l=this.mountedWidgets.get(o);l&&(l.cleanup?.(),this.mountedWidgets.delete(o),n.removeAttribute("data-widget-mount-id"),n.removeAttribute("data-widget-id"),n.innerHTML="")},update:l=>{if(i.widget.update)i.widget.update(n,l);else{let c=this.mountedWidgets.get(o);if(c){c.cleanup?.(),n.innerHTML="";let u=i.widget.mount(n,l);c.cleanup=u??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)}destroy(){for(let[e,n]of this.mountedWidgets.entries())n.cleanup?.(),n.container.innerHTML="";this.mountedWidgets.clear()}},Om=new Qu;function Nm(t){let{appId:e,runtime:n,isBuiltIn:r=!1}=t,i=`app:${e}:`,o=[],s=[],a=n.state.ns(`app:${e}`);return{appId:e,state:{get:c=>a.get(c),set:(c,u)=>a.set(c,u),remove:c=>a.remove(c)},telemetry:n.telemetry?{emit:(c,u)=>{n.events.publish(c,{...u,_appId:e})},getSessionId:()=>n.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(c,u,f)=>{let h=n.surfaces.mount(c,u,{...f,adaptiveId:e});return{unmount:()=>h.unmount(),update:g=>h.update(g)}},canMount:(c,u)=>n.surfaces.canMount(c,u)},events:{subscribe:c=>n.events.subscribe(u=>{c(u)}),publish:(c,u)=>{n.events.publish(c,{...u,_appId:e})}},registerAction:c=>{n.executors.register(c.kind,c.executor,c.schema,e,r),o.push(c.kind)},registerWidget:c=>{n.widgets.register(c.id,c.component,e,c.metadata),s.push(c.id)}}}function Lm(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var Ju=class{constructor(){j(this,"apps",new Map);j(this,"eventListeners",new Set);j(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,n]of this.apps)n.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 n={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,n),this.emit({type:"app:registered",appId:e.id,manifest:e}),n}async activate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state==="active"){console.warn(`[AppRegistry] App already active: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(n.manifest.dependencies)for(let r of n.manifest.dependencies){let i=this.apps.get(r);if(!i||i.state!=="active")throw new Error(`App ${e} depends on ${r}, which is not active`)}n.state="activating";try{let r=n.manifest.metadata?.isBuiltIn===!0,i=Nm({appId:e,runtime:this.runtime,isBuiltIn:r}),{runtime:o}=n.manifest,s=[];if(o){if(o.actions)for(let a of o.actions)i.registerAction(a);if(o.widgets)for(let a of o.widgets)i.registerWidget(a);if(o.events)for(let a of o.events){let l=this.runtime.events.subscribe(c=>{if(a.names.includes(c.name)){let u={appId:e,state:i.state,telemetry:i.telemetry,surfaces:i.surfaces};try{a.handler(c,u)}catch(f){console.error(`[AppRegistry] Event handler error in ${e}:`,f)}}});s.push(l)}}n.cleanup=async()=>{for(let a of s)try{await a()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}Lm(e,this.runtime)},n.state="active",n.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(r){throw n.state="error",n.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async deactivate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[r,i]of this.apps)if(i.state==="active"&&i.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${r} depends on it`);n.state="deactivating";try{n.cleanup&&(await n.cleanup(),n.cleanup=void 0),n.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(r){throw n.state="error",n.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async unregister(e){let n=this.apps.get(e);n&&(n.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 n of this.eventListeners)try{n(e)}catch(r){console.error("[AppRegistry] Event listener error:",r)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},Mm=new Ju;var oO=new Set(["overlays:highlight","overlays:pulse","overlays:badge","overlays:tooltip","overlays:modal","content:insertHtml","content:setText","content:setAttr","content:addClass","content:removeClass","content:setStyle","navigation:scrollTo","navigation:navigate","core:mountWidget","core:wait","core:sequence","core:parallel","core:tour"]);function yk(t){return oO.has(t)}function _k(t){if(yk(t))return null;let e=t.indexOf(":");return e===-1?null:t.slice(0,e)}function wk(t){let e=t.indexOf(":");return e===-1?null:t.slice(0,e)}function Fm(t){let{cdnBase:e,registry:n,timeout:r=1e4,onLoadStart:i,onLoadEnd:o}=t,s=new Map,a=new Set;function l(v){return`${e}/apps/${v}/index.js`}async function c(v){if(n.has(v))return{appId:v,success:!0,manifest:n.get(v)?.manifest};if(s.has(v))return s.get(v);let _=(async()=>{i?.(v);try{let x=l(v);if(a.has(x)){let y=n.get(v);if(y)return o?.(v,!0),{appId:v,success:!0,manifest:y.manifest}}let d=new Promise((y,w)=>{setTimeout(()=>w(new Error(`Timeout loading app: ${v}`)),r)}),p=u(x,v);await Promise.race([p,d]),a.add(x);let m=n.get(v);if(!m)throw new Error(`App ${v} did not register after loading`);return o?.(v,!0),{appId:v,success:!0,manifest:m.manifest}}catch(x){let d=x instanceof Error?x.message:String(x);return o?.(v,!1,d),{appId:v,success:!1,error:d}}finally{s.delete(v)}})();return s.set(v,_),_}async function u(v,_){if(typeof window<"u"){try{let x=await import(v);x.manifest?n.register(x.manifest):x.default?.manifest?n.register(x.default.manifest):x.default&&n.register(x.default);return}catch{}return new Promise((x,d)=>{let p=document.createElement("script");p.src=v,p.async=!0,p.onload=()=>{n.get(_)?x():d(new Error(`App ${_} did not self-register`))},p.onerror=()=>{d(new Error(`Failed to load app script: ${v}`))},document.head.appendChild(p)})}throw new Error("Dynamic app loading not supported in SSR")}function f(v){let _=new Set;if(v.apps)for(let x of v.apps)_.add(x);if(v.actions)for(let x of v.actions){let d=_k(x.kind);if(d&&_.add(d),x.kind==="core:mountWidget"){let p=x.widget?.widgetId;if(p){let m=wk(p);m&&_.add(m)}}}return Array.from(_)}async function h(v){let _=f(v);return _.length===0?[]:await Promise.all(_.map(d=>c(d)))}async function g(v){return Promise.all(v.map(_=>c(_)))}return{loadApp:c,loadAppsForConfig:h,preloadApps:g,getRequiredApps:f,getAppUrl:l}}var Qa=null;function Sk(){if(Qa&&document.body.contains(Qa))return Qa;let t=document.getElementById("syntro-overlays");return t||(t=document.createElement("div"),t.id="syntro-overlays",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none"}),document.body.appendChild(t)),Qa=t,sO(),Qa}var xk=!1;function sO(){if(xk)return;let t=`
162
143
  :root {
163
144
  --syntro-surface: #111;
164
145
  --syntro-fg: #fff;
@@ -415,59 +396,48 @@ Error generating stack: `+i.message+`
415
396
  background: var(--syntro-accent, #4338ca);
416
397
  filter: brightness(1.1);
417
398
  }
418
- `,e=document.createElement("style");e.setAttribute("data-syntro","base-overlay"),e.textContent=t,document.head.appendChild(e),CA=!0}var TA="2.0.0";function V3(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(kA(i,r))return!1}if(e.include&&e.include.length>0){for(let r of e.include)if(kA(i,r))return!0;return!1}return!0}function kA(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 I3(t,e){if(t.startsWith("[data-"))return document.querySelector(t);let n=e.get();if(n.anchors&&n.anchors.find(s=>s.anchorId===t)?.present){let s=document.querySelector(`[data-syntro-anchor="${t}"]`);if(s)return s}if(t.startsWith(".")||t.startsWith("#")||t.startsWith("["))return document.querySelector(t);let i=document.getElementById(t);return i||document.querySelector(`[data-syntro-anchor="${t}"]`)}function Cy(t={}){let{telemetry:e,sessionMetrics:n,routes:i,mode:r="production",namespace:s}=t,a=t.widgets??by,o=t.executors??Vs,l=t.apps??Ey,c=Bv({telemetry:e,routes:i}),u=t.events??ic(),f=jv({namespace:s}),h=qv({state:f,events:u,sessionMetrics:n}),p=AA(),y=g=>I3(g,c),_=_y({overlayRoot:p,eventBus:u,anchorResolver:y,widgetRegistry:a}),b=ly({overlayRoot:p,eventBus:u,surfaces:_,anchorResolver:y,executorRegistry:o}),d={telemetry:e,context:c,events:u,state:f,sessionMetrics:n,actions:b,surfaces:_,widgets:a,executors:o,apps:l,version:TA,mode:r,async evaluate(g){return h.evaluate(g,c.get())},evaluateSync(g){return h.evaluateSync(g,c.get())},async filterTiles(g){let m=c.get().page.url,v=[];for(let S of g){let w=S.activation;if(!w){v.push(S);continue}if(!V3(m,w.routes))continue;if(!w.strategy){v.push(S);continue}(await this.evaluate(w.strategy)).value&&v.push(S)}return v},setRoutes(g){c.setRoutes(g)},destroy(){l.unbind().catch(g=>{console.error("[Runtime] Error unbinding apps registry:",g)}),c.destroy(),b.destroy(),_.destroy()}};return l.bind(d),d}var Ay="syn_";function xf(t){if(!t.startsWith(Ay))throw new Error("Invalid Syntro token: must start with 'syn_'");let n=t.slice(Ay.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 ky(t){let e=JSON.stringify(t),n=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return Ay+n}var RA={growthbook:t=>Bh({...t,autoInit:!0})};function OA(t,e){let n=RA[t];if(!n)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(RA).join(", ")}`);return n(e)}var MA={posthog:t=>oh(t)};function NA(t,e){let n=MA[t];if(!n)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(MA).join(", ")}`);return n(e)}var F3=["cdn.syntrologie.com","localhost","127.0.0.1"];function j3(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):F3.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 Ty=class{constructor(e){F(this,"name","cdn");F(this,"url");F(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!j3(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 q3(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),s=performance.now()-e,a=n.headers.get("cache-control"),o=n.headers.get("age");return{config:r,meta:{source:"cdn",fetchTimeMs:s,cached:a?.includes("public")??!1,cacheAge:o?parseInt(o,10):void 0}}}};async function q3(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 DA(t){return new Ty(t)}var P3="syntro_exp",G3="syntro_var",Ry=class{constructor(e){F(this,"name","experiments");F(this,"client");F(this,"featureKey");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config"}async fetch(){let e=performance.now();if(typeof window<"u"){let r=new URLSearchParams(window.location.search),s=r.get(P3),a=r.get(G3);if(s&&a!==null&&this.client.setForcedVariations){let o=parseInt(a,10);isNaN(o)||(console.log(`[SmartCanvas] Preview mode: forcing "${s}" to variation ${o}`),this.client.setForcedVariations({[s]:o}))}}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}}}};function LA(t){return new Ry(t)}var Y3="https://cdn.syntrologie.com/configs",zA={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return DA({baseUrl:t.baseUrl??Y3,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return LA({featureKey:t.featureKey})}};function BA(t,e={}){let n=zA[t];if(!n)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(zA).join(", ")}`);return n(e)}function ji(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 Z3(){if(typeof window>"u")return V("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=new URLSearchParams(window.location.search),e=t.has("editor_token");return V("Syntro Bootstrap","isEditorMode check:",{url:window.location.href,search:window.location.search,hasEditorToken:e,allParams:Object.fromEntries(t.entries())}),e}function W3(){if(typeof window>"u")return V("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=new URLSearchParams(window.location.search),e=t.has("syntro_audit");return V("Syntro Bootstrap","isAuditMode check:",{url:window.location.href,hasAuditFlag:e,auditSessionId:t.get("audit_session_id")??"none"}),e}var HA="syntro_segment_attributes";function X3(){if(typeof window>"u")return{};try{let t=localStorage.getItem(HA);if(t){let e=JSON.parse(t);return V("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){rn("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function K3(t){if(!(typeof window>"u"))try{localStorage.setItem(HA,JSON.stringify(t)),V("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){rn("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function Q3(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 J3(t){Tv(),V("Syntro Bootstrap","====== INIT ======"),V("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:t.token?.slice(0,15)+"...",hasCanvasOptions:!!t.canvas});let e=Z3(),n=W3(),i=e?"editor":n?"audit":null;V("Syntro Bootstrap","SDK mode:",i??"normal");let r;if(t.token)if(t.token.startsWith("syn_"))V("Syntro Bootstrap","Token starts with syn_, decoding..."),r=xf(t.token),Tv(r.d);else if(i)V("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${i} mode)`);else throw Gd("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit mode!"),Gd("Syntro Bootstrap","Token received:",t.token),new Error("Invalid Syntro token: must start with 'syn_'");else if(i)V("Syntro Bootstrap",`\u2713 No token, but ${i} mode - proceeding`);else throw Gd("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit mode!"),new Error("Syntro token is required (unless in editor or audit mode)");let s=ji("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||ji("VITE_SYNTRO_EXPERIMENT_HOST")||r?.eh,a=ji("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||ji("VITE_SYNTRO_TELEMETRY_HOST")||r?.th,o=ji("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||ji("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,l=X3();V("Syntro Bootstrap","Phase 1: Using cached segment attributes:",l);let c,u=ic();console.log("[Syntro Bootstrap] EventBus created");let f=Uv(w=>{u.publishEvent(w)}),h=w=>{V("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let E=Q3(w);if(V("Syntro Bootstrap","Segment flags from PostHog:",E),K3(E),c){let R={...y?.getAll?.()??{},...E};V("Syntro Bootstrap","Updating GrowthBook with attributes:",R),c.setAttributes?.(R)}},p;r?.t&&(p=NA("posthog",{apiKey:r.t,apiHost:a,enableFeatureFlags:!0,onFeatureFlagsLoaded:h,onCapture:f}),console.log("[Syntro Bootstrap] Telemetry client created with EventBus wiring"));let y;r?.e&&(c=OA("growthbook",{clientKey:r.e,apiHost:s,attributes:l,onExperimentViewed:p?.trackExperiment?(w,E,C)=>{p.trackExperiment(w,E,C)}:void 0})),t.enableSessionMetrics&&(y=Lv({experiments:c,onMetricChange:(w,E)=>{V("Syntro Bootstrap",`Session metric changed: ${w} = ${E}`)}}),V("Syntro Bootstrap","SessionMetricTracker created"));let _="production";e?_="editor":n?_="audit":ji("NODE_ENV")==="development"&&(_="development");let b=Cy({telemetry:p,sessionMetrics:y,mode:_,events:u});V("Syntro Bootstrap","Runtime created:",{version:b.version,mode:b.mode,hasContext:!!b.context,hasEvents:!!b.events,hasState:!!b.state}),V("Syntro Bootstrap","Core app executors already registered");let d=t.cdnBase||ji("NEXT_PUBLIC_SYNTRO_CDN_BASE")||ji("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntro.io",g=wy({cdnBase:d,registry:b.apps,onLoadStart:w=>{V("Syntro Bootstrap",`Loading app from CDN: ${w}`)},onLoadEnd:(w,E,C)=>{E?V("Syntro Bootstrap",`App loaded successfully: ${w}`):rn("Syntro Bootstrap",`Failed to load app: ${w}`,C)}});typeof window<"u"&&(window.SynOS={appRegistry:b.apps,runtime:b,version:b.version},V("Syntro Bootstrap","Global SynOS object exposed"));let m;if(t.fetcher)m=t.fetcher;else if(r?.f){let w=BA(r.f,r.o??{});m=async()=>{let E=await w.fetch();return{...E.config,tiles:E.config.tiles??[]}}}else c&&(m=da({experiments:c}));let v=m?async()=>{let w=await m(),E=w,C=g.getRequiredApps(E);return V("Syntro Bootstrap","Config fetched, required apps:",C),C.length>0&&await g.loadAppsForConfig(E).then(async T=>{let I=T.filter(G=>!G.success);I.length>0&&rn("Syntro Bootstrap","Some apps failed to load:",I);for(let G of C)if(b.apps.has(G))try{await b.apps.activate(G)}catch(K){rn("Syntro Bootstrap",`Failed to activate app: ${G}`,K)}}),w}:void 0;return{canvas:await Rv({...t.canvas,fetcher:v,integrations:{experiments:c,telemetry:p},editorUrl:o,runtime:b}),runtime:b,experiments:c,telemetry:p,sessionMetrics:y,appLoader:g}}var UA={init:J3,encodeToken:ky,decodeToken:xf};typeof window<"u"&&(window.Syntro=UA);export{lc as ANIMATION_KEYFRAMES,oD as ActivationConfigZ,L5 as AnchorStateZ,Y5 as AnchorVisibleConditionZ,Sf as AppRegistry,z5 as AugmentationZ,D5 as BoundingBoxZ,In as CanvasEvents,Dv as CanvasRecipeZ,nC as ConditionZ,Jd as ContextManager,J5 as CooldownActiveConditionZ,iC as DecisionStrategyZ,Q5 as DismissedConditionZ,ua as EVENT_SCHEMA_VERSION,ef as EventBus,$5 as EventFilterZ,Z5 as EventOccurredConditionZ,Ww as EventSourceZ,yf as ExecutorRegistry,sD as ExternalStrategyZ,j5 as FrequencyEntryZ,eD as FrequencyLimitConditionZ,T5 as HighlightStepZ,rD as ModelStrategyZ,U5 as NormalizedEventZ,R5 as PageContextZ,O5 as PageHistoryEntryZ,P5 as PageUrlConditionZ,TA as RUNTIME_VERSION,G5 as RouteConditionZ,aD as RouteFilterZ,nD as RuleStrategyZ,tD as RuleZ,B5 as RuntimeContextZ,jh as RuntimeProvider,mA as STATIC_SLOT_STYLES,iD as ScoreStrategyZ,Gw as SelectorZ,M5 as SessionContextZ,K5 as SessionMetricConditionZ,Qd as SessionMetricTracker,qb as ShadowCanvasOverlay,Zb as SmartCanvasApp,Gh as SmartCanvasController,Av as SmartCanvasElement,dz as SmartCanvasPortal,Ue as StandardEvents,W5 as StateEqualsConditionZ,tf as StateStore,F5 as StoredValueZ,UA as Syntro,Xo as TileCard,j4 as TileWheel,k5 as TooltipStepZ,X5 as ViewportConditionZ,N5 as ViewportContextZ,bf as WidgetRegistry,Ey as appRegistry,fy as applyStaticSlotStyles,xy as cleanupAppContext,cD as contentRuntime,ly as createActionEngine,Sy as createAppContext,wy as createAppLoader,da as createCanvasConfigFetcher,Bv as createContextManager,qv as createDecisionEngine,ic as createEventBus,Bh as createGrowthBookClient,t6 as createOverlayRecipeFetcher,oh as createPostHogClient,Uv as createPostHogNormalizer,Lv as createSessionMetricTracker,Rv as createSmartCanvas,Pb as createSmartCanvasController,Cy as createSmartCanvasRuntime,jv as createStateStore,vy as createSurfaceContainer,_y as createSurfaces,xf as decodeToken,ky as encodeToken,oC as evaluate,rC as evaluateCondition,sC as evaluateRule,nf as evaluateRuleStrategy,rf as evaluateScoreStrategy,lC as evaluateSync,Vs as executorRegistry,U3 as faqRuntime,QD as gamificationRuntime,dN as getAntiFlickerSnippet,_A as getAppIdFromActionKind,bA as getAppIdFromWidgetId,n3 as getExecutor,_f as getSlotAnchorId,oc as getSlotType,yy as getSlotZIndex,ay as hasExecutor,yA as isCoreActionKind,H3 as navRuntime,WD as navigationRuntime,Kw as normalizePostHogEvent,ZD as overlaysRuntime,gy as playEnterAnimation,my as playExitAnimation,Cw as registerSmartCanvasElement,Yh as resolveConfigUri,py as setupAdjacentPositioning,hy as setupInlinePositioning,Qw as shouldNormalizeEvent,g2 as useDecision,qh as usePageContext,fi as useRuntime,hu as useRuntimeContext,p2 as useRuntimeEvents,h2 as useRuntimeState,d2 as useSessionContext,Mb as useShadowCanvasConfig,f2 as useViewportContext,qr as validateAction,oy as validateActions,X6 as validateActivationConfig,Z6 as validateCondition,y6 as validateEventFilter,D6 as validateFrequencyEntry,v6 as validateNormalizedEvent,Kz as validateRecipe,l6 as validateRuntimeContext,N6 as validateStoredValue,W6 as validateStrategy,by as widgetRegistry};
399
+ `,e=document.createElement("style");e.setAttribute("data-syntro","base-overlay"),e.textContent=t,document.head.appendChild(e),xk=!0}var kk="2.0.0";function aO(t,e){if(!e)return!0;let n;try{n=new URL(t).pathname}catch{n=t}let r=n.replace(/\/$/,"")||"/";if(e.exclude){for(let i of e.exclude)if(bk(r,i))return!1}if(e.include&&e.include.length>0){for(let i of e.include)if(bk(r,i))return!0;return!1}return!0}function bk(t,e){let n=e.replace(/\/$/,"")||"/";if(t===n)return!0;let r=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${r}$`).test(t)}function lO(t,e){if(t.startsWith("[data-"))return document.querySelector(t);let n=e.get();if(n.anchors&&n.anchors.find(o=>o.anchorId===t)?.present){let o=document.querySelector(`[data-syntro-anchor="${t}"]`);if(o)return o}if(t.startsWith(".")||t.startsWith("#")||t.startsWith("["))return document.querySelector(t);let r=document.getElementById(t);return r||document.querySelector(`[data-syntro-anchor="${t}"]`)}function $m(t={}){let{telemetry:e,sessionMetrics:n,routes:r,mode:i="production",namespace:o}=t,s=t.widgets??Om,a=t.executors??eo,l=t.apps??Mm,c=Zg({telemetry:e,routes:r}),u=t.events??qa(),f=nm({namespace:o}),h=rm({state:f,events:u,sessionMetrics:n}),g=Sk(),v=p=>lO(p,c),_=Im({overlayRoot:g,eventBus:u,anchorResolver:v,widgetRegistry:s}),x=wm({overlayRoot:g,eventBus:u,surfaces:_,anchorResolver:v,executorRegistry:a}),d={telemetry:e,context:c,events:u,state:f,sessionMetrics:n,actions:x,surfaces:_,widgets:s,executors:a,apps:l,version:kk,mode:i,async evaluate(p){return h.evaluate(p,c.get())},evaluateSync(p){return h.evaluateSync(p,c.get())},async filterTiles(p){let m=c.get().page.url,y=[];for(let w of p){let k=w.activation;if(!k){y.push(w);continue}if(!aO(m,k.routes))continue;if(!k.strategy){y.push(w);continue}(await this.evaluate(k.strategy)).value&&y.push(w)}return y},setRoutes(p){c.setRoutes(p)},destroy(){l.unbind().catch(p=>{console.error("[Runtime] Error unbinding apps registry:",p)}),c.destroy(),x.destroy(),_.destroy()}};return l.bind(d),d}var Dm="syn_";function ed(t){if(!t.startsWith(Dm))throw new Error("Invalid Syntro token: must start with 'syn_'");let n=t.slice(Dm.length).replace(/-/g,"+").replace(/_/g,"/"),r=atob(n),i=JSON.parse(r);if(i.v!==1)throw new Error(`Unsupported token version: ${i.v}`);return i}function Bm(t){let e=JSON.stringify(t),n=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return Dm+n}var Ek={growthbook:t=>pp({...t,autoInit:!0})};function Ck(t,e){let n=Ek[t];if(!n)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(Ek).join(", ")}`);return n(e)}var Ak={posthog:t=>Vf(t)};function Rk(t,e){let n=Ak[t];if(!n)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(Ak).join(", ")}`);return n(e)}var cO=["cdn.syntrologie.com","localhost","127.0.0.1"];function uO(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):cO.some(i=>e.hostname===i)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var Vm=class{constructor(e){j(this,"name","cdn");j(this,"url");j(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!uO(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 r=await n.text();if(this.integrity){let l=await dO(r),c=this.integrity.replace("sha384-","");if(l!==c)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${c}, got ${l}`)}let i=JSON.parse(r),o=performance.now()-e,s=n.headers.get("cache-control"),a=n.headers.get("age");return{config:i,meta:{source:"cdn",fetchTimeMs:o,cached:s?.includes("public")??!1,cacheAge:a?parseInt(a,10):void 0}}}};async function dO(t){let n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-384",n),i=new Uint8Array(r);return btoa(String.fromCharCode(...i))}function Tk(t){return new Vm(t)}var fO="syntro_exp",pO="syntro_var",zm=class{constructor(e){j(this,"name","experiments");j(this,"client");j(this,"featureKey");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config"}async fetch(){let e=performance.now();if(typeof window<"u"){let i=new URLSearchParams(window.location.search),o=i.get(fO),s=i.get(pO);if(o&&s!==null&&this.client.setForcedVariations){let a=parseInt(s,10);isNaN(a)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${a}`),this.client.setForcedVariations({[o]:a}))}}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 r=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:r,cached:!0}}}};function Pk(t){return new zm(t)}var hO="https://cdn.syntrologie.com/configs",Ik={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return Tk({baseUrl:t.baseUrl??hO,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return Pk({featureKey:t.featureKey})}};function Ok(t,e={}){let n=Ik[t];if(!n)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(Ik).join(", ")}`);return n(e)}function gr(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 gO(){if(typeof window>"u")return V("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=new URLSearchParams(window.location.search),e=t.has("editor_token");return V("Syntro Bootstrap","isEditorMode check:",{url:window.location.href,search:window.location.search,hasEditorToken:e,allParams:Object.fromEntries(t.entries())}),e}function mO(){if(typeof window>"u")return V("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=new URLSearchParams(window.location.search),e=t.has("syntro_audit");return V("Syntro Bootstrap","isAuditMode check:",{url:window.location.href,hasAuditFlag:e,auditSessionId:t.get("audit_session_id")??"none"}),e}var Nk="syntro_segment_attributes";function vO(){if(typeof window>"u")return{};try{let t=localStorage.getItem(Nk);if(t){let e=JSON.parse(t);return V("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){Bt("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function yO(t){if(!(typeof window>"u"))try{localStorage.setItem(Nk,JSON.stringify(t)),V("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){Bt("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function _O(t){if(!t)return{};let e={};for(let[n,r]of Object.entries(t))n.startsWith("in_segment_")&&(e[n]=r===!0);return e}async function wO(t){zg(),V("Syntro Bootstrap","====== INIT ======"),V("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:t.token?.slice(0,15)+"...",hasCanvasOptions:!!t.canvas});let e=gO(),n=mO(),r=e?"editor":n?"audit":null;V("Syntro Bootstrap","SDK mode:",r??"normal");let i;if(t.token)if(t.token.startsWith("syn_"))V("Syntro Bootstrap","Token starts with syn_, decoding..."),i=ed(t.token),zg(i.d);else if(r)V("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${r} mode)`);else throw Eu("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit mode!"),Eu("Syntro Bootstrap","Token received:",t.token),new Error("Invalid Syntro token: must start with 'syn_'");else if(r)V("Syntro Bootstrap",`\u2713 No token, but ${r} mode - proceeding`);else throw Eu("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit mode!"),new Error("Syntro token is required (unless in editor or audit mode)");let o=gr("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||gr("VITE_SYNTRO_EXPERIMENT_HOST")||i?.eh,s=gr("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||gr("VITE_SYNTRO_TELEMETRY_HOST")||i?.th,a=gr("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||gr("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,l=vO();V("Syntro Bootstrap","Phase 1: Using cached segment attributes:",l);let c,u=qa();console.log("[Syntro Bootstrap] EventBus created");let f=Xg(k=>{u.publishEvent(k)}),h=k=>{V("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let b=_O(k);if(V("Syntro Bootstrap","Segment flags from PostHog:",b),yO(b),c){let P={...v?.getAll?.()??{},...b};V("Syntro Bootstrap","Updating GrowthBook with attributes:",P),c.setAttributes?.(P)}},g;i?.t&&(g=Rk("posthog",{apiKey:i.t,apiHost:s,enableFeatureFlags:!0,onFeatureFlagsLoaded:h,onCapture:f}),console.log("[Syntro Bootstrap] Telemetry client created with EventBus wiring"));let v;i?.e&&(c=Ck("growthbook",{clientKey:i.e,apiHost:o,attributes:l,onExperimentViewed:g?.trackExperiment?(k,b,E)=>{g.trackExperiment(k,b,E)}:void 0})),t.enableSessionMetrics&&(v=Kg({experiments:c,onMetricChange:(k,b)=>{V("Syntro Bootstrap",`Session metric changed: ${k} = ${b}`)}}),V("Syntro Bootstrap","SessionMetricTracker created"));let _="production";e?_="editor":n?_="audit":gr("NODE_ENV")==="development"&&(_="development");let x=$m({telemetry:g,sessionMetrics:v,mode:_,events:u});V("Syntro Bootstrap","Runtime created:",{version:x.version,mode:x.mode,hasContext:!!x.context,hasEvents:!!x.events,hasState:!!x.state}),V("Syntro Bootstrap","Core app executors already registered");let d=t.cdnBase||gr("NEXT_PUBLIC_SYNTRO_CDN_BASE")||gr("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntro.io",p=Fm({cdnBase:d,registry:x.apps,onLoadStart:k=>{V("Syntro Bootstrap",`Loading app from CDN: ${k}`)},onLoadEnd:(k,b,E)=>{b?V("Syntro Bootstrap",`App loaded successfully: ${k}`):Bt("Syntro Bootstrap",`Failed to load app: ${k}`,E)}});typeof window<"u"&&(window.SynOS={appRegistry:x.apps,runtime:x,version:x.version},V("Syntro Bootstrap","Global SynOS object exposed"));let m;if(t.fetcher)m=t.fetcher;else if(i?.f){let k=Ok(i.f,i.o??{});m=async()=>{let b=await k.fetch();return{...b.config,tiles:b.config.tiles??[]}}}else c&&(m=es({experiments:c}));let y=m?async()=>{let k=await m(),b=k,E=p.getRequiredApps(b);return V("Syntro Bootstrap","Config fetched, required apps:",E),E.length>0&&await p.loadAppsForConfig(b).then(async A=>{let H=A.filter(K=>!K.success);H.length>0&&Bt("Syntro Bootstrap","Some apps failed to load:",H);for(let K of E)if(x.apps.has(K))try{await x.apps.activate(K)}catch(Y){Bt("Syntro Bootstrap",`Failed to activate app: ${K}`,Y)}}),k}:void 0;return{canvas:await Hg({...t.canvas,fetcher:y,integrations:{experiments:c,telemetry:g},editorUrl:a,runtime:x}),runtime:x,experiments:c,telemetry:g,sessionMetrics:v,appLoader:p}}var Lk={init:wO,encodeToken:Bm,decodeToken:ed};typeof window<"u"&&(window.Syntro=Lk);export{Xa as ANIMATION_KEYFRAMES,NI as ActivationConfigZ,sI as AnchorStateZ,_I as AnchorVisibleConditionZ,Ju as AppRegistry,aI as AugmentationZ,oI as BoundingBoxZ,bn as CanvasEvents,qg as CanvasRecipeZ,ib as ConditionZ,Ou as ContextManager,EI as CooldownActiveConditionZ,ob as DecisionStrategyZ,kI as DismissedConditionZ,ko as EVENT_SCHEMA_VERSION,Nu as EventBus,dI as EventFilterZ,wI as EventOccurredConditionZ,XS as EventSourceZ,Yu as ExecutorRegistry,II as ExternalStrategyZ,gI as FrequencyEntryZ,CI as FrequencyLimitConditionZ,eI as HighlightStepZ,PI as ModelStrategyZ,uI as NormalizedEventZ,tI as PageContextZ,nI as PageHistoryEntryZ,vI as PageUrlConditionZ,kk as RUNTIME_VERSION,yI as RouteConditionZ,OI as RouteFilterZ,RI as RuleStrategyZ,AI as RuleZ,lI as RuntimeContextZ,wp as RuntimeProvider,mk as STATIC_SLOT_STYLES,TI as ScoreStrategyZ,GS as SelectorZ,rI as SessionContextZ,bI as SessionMetricConditionZ,Iu as SessionMetricTracker,vS as ShadowCanvasOverlay,xS as SmartCanvasApp,Fg as SmartCanvasController,Bg as SmartCanvasElement,OL as SmartCanvasPortal,Ce as StandardEvents,xI as StateEqualsConditionZ,Lu as StateStore,hI as StoredValueZ,Lk as Syntro,Zs as TileCard,fL as TileWheel,JP as TooltipStepZ,SI as ViewportConditionZ,iI as ViewportContextZ,Qu as WidgetRegistry,Mm as appRegistry,km as applyStaticSlotStyles,Lm as cleanupAppContext,MI as contentRuntime,wm as createActionEngine,Nm as createAppContext,Fm as createAppLoader,es as createCanvasConfigFetcher,Zg as createContextManager,rm as createDecisionEngine,qa as createEventBus,pp as createGrowthBookClient,SM as createOverlayRecipeFetcher,Vf as createPostHogClient,Xg as createPostHogNormalizer,Kg as createSessionMetricTracker,Hg as createSmartCanvas,yS as createSmartCanvasController,$m as createSmartCanvasRuntime,nm as createStateStore,Tm as createSurfaceContainer,Im as createSurfaces,ed as decodeToken,Bm as encodeToken,cb as evaluate,sb as evaluateCondition,ab as evaluateRule,Mu as evaluateRuleStrategy,Fu as evaluateScoreStrategy,ub as evaluateSync,eo as executorRegistry,$T as getAntiFlickerSnippet,_k as getAppIdFromActionKind,wk as getAppIdFromWidgetId,E2 as getExecutor,Xu as getSlotAnchorId,Ya as getSlotType,Pm as getSlotZIndex,ym as hasExecutor,yk as isCoreActionKind,x2 as navigationRuntime,JS as normalizePostHogEvent,w2 as overlaysRuntime,Am as playEnterAnimation,Rm as playExitAnimation,AS as registerSmartCanvasElement,$g as resolveConfigUri,Em as setupAdjacentPositioning,Cm as setupInlinePositioning,eb as shouldNormalizeEvent,hA as useDecision,xp as usePageContext,Gn as useRuntime,rc as useRuntimeContext,fA as useRuntimeEvents,pA as useRuntimeState,uA as useSessionContext,U_ as useShadowCanvasConfig,dA as useViewportContext,ci as validateAction,_m as validateActions,vF as validateActivationConfig,gF as validateCondition,BM as validateEventFilter,eF as validateFrequencyEntry,DM as validateNormalizedEvent,yM as validateRecipe,TM as validateRuntimeContext,JM as validateStoredValue,mF as validateStrategy,Om as widgetRegistry};
419
400
  /*! Bundled license information:
420
401
 
421
- react/cjs/react.production.js:
402
+ react/cjs/react.production.min.js:
422
403
  (**
423
404
  * @license React
424
- * react.production.js
405
+ * react.production.min.js
425
406
  *
426
- * Copyright (c) Meta Platforms, Inc. and affiliates.
407
+ * Copyright (c) Facebook, Inc. and its affiliates.
427
408
  *
428
409
  * This source code is licensed under the MIT license found in the
429
410
  * LICENSE file in the root directory of this source tree.
430
411
  *)
431
412
 
432
- react/cjs/react-jsx-runtime.production.js:
413
+ react/cjs/react-jsx-runtime.production.min.js:
433
414
  (**
434
415
  * @license React
435
- * react-jsx-runtime.production.js
416
+ * react-jsx-runtime.production.min.js
436
417
  *
437
- * Copyright (c) Meta Platforms, Inc. and affiliates.
418
+ * Copyright (c) Facebook, Inc. and its affiliates.
438
419
  *
439
420
  * This source code is licensed under the MIT license found in the
440
421
  * LICENSE file in the root directory of this source tree.
441
422
  *)
442
423
 
443
- react-dom/cjs/react-dom.production.js:
424
+ scheduler/cjs/scheduler.production.min.js:
444
425
  (**
445
426
  * @license React
446
- * react-dom.production.js
427
+ * scheduler.production.min.js
447
428
  *
448
- * Copyright (c) Meta Platforms, Inc. and affiliates.
429
+ * Copyright (c) Facebook, Inc. and its affiliates.
449
430
  *
450
431
  * This source code is licensed under the MIT license found in the
451
432
  * LICENSE file in the root directory of this source tree.
452
433
  *)
453
434
 
454
- scheduler/cjs/scheduler.production.js:
435
+ react-dom/cjs/react-dom.production.min.js:
455
436
  (**
456
437
  * @license React
457
- * scheduler.production.js
438
+ * react-dom.production.min.js
458
439
  *
459
- * Copyright (c) Meta Platforms, Inc. and affiliates.
460
- *
461
- * This source code is licensed under the MIT license found in the
462
- * LICENSE file in the root directory of this source tree.
463
- *)
464
-
465
- react-dom/cjs/react-dom-client.production.js:
466
- (**
467
- * @license React
468
- * react-dom-client.production.js
469
- *
470
- * Copyright (c) Meta Platforms, Inc. and affiliates.
440
+ * Copyright (c) Facebook, Inc. and its affiliates.
471
441
  *
472
442
  * This source code is licensed under the MIT license found in the
473
443
  * LICENSE file in the root directory of this source tree.