rivet-design 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/services/LocalGitService.d.ts.map +1 -1
- package/dist/services/LocalGitService.js +4 -26
- package/dist/services/LocalGitService.js.map +1 -1
- package/dist/services/__tests__/LocalGitService.test.js +3 -13
- package/dist/services/__tests__/LocalGitService.test.js.map +1 -1
- package/package.json +1 -1
- package/src/ui/dist/assets/main-Cj-e8nRg.js +145 -0
- package/src/ui/dist/index.html +1 -1
- package/src/ui/dist/assets/main-CdGS8Nf3.js +0 -145
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
function uS(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var cS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Jv={exports:{}},dl={},ey={exports:{}},Y={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var oo=Symbol.for("react.element"),dS=Symbol.for("react.portal"),fS=Symbol.for("react.fragment"),hS=Symbol.for("react.strict_mode"),pS=Symbol.for("react.profiler"),gS=Symbol.for("react.provider"),mS=Symbol.for("react.context"),vS=Symbol.for("react.forward_ref"),yS=Symbol.for("react.suspense"),_S=Symbol.for("react.memo"),wS=Symbol.for("react.lazy"),dp=Symbol.iterator;function xS(t){return t===null||typeof t!="object"?null:(t=dp&&t[dp]||t["@@iterator"],typeof t=="function"?t:null)}var ty={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ny=Object.assign,ry={};function Ii(t,e,n){this.props=t,this.context=e,this.refs=ry,this.updater=n||ty}Ii.prototype.isReactComponent={};Ii.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")};Ii.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function iy(){}iy.prototype=Ii.prototype;function of(t,e,n){this.props=t,this.context=e,this.refs=ry,this.updater=n||ty}var af=of.prototype=new iy;af.constructor=of;ny(af,Ii.prototype);af.isPureReactComponent=!0;var fp=Array.isArray,sy=Object.prototype.hasOwnProperty,lf={current:null},oy={key:!0,ref:!0,__self:!0,__source:!0};function ay(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)sy.call(e,r)&&!oy.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),u=0;u<a;u++)l[u]=arguments[u+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:oo,type:t,key:s,ref:o,props:i,_owner:lf.current}}function SS(t,e){return{$$typeof:oo,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function uf(t){return typeof t=="object"&&t!==null&&t.$$typeof===oo}function ES(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var hp=/\/+/g;function ql(t,e){return typeof t=="object"&&t!==null&&t.key!=null?ES(""+t.key):e.toString(36)}function Xo(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case oo:case dS:o=!0}}if(o)return o=t,i=i(o),t=r===""?"."+ql(o,0):r,fp(i)?(n="",t!=null&&(n=t.replace(hp,"$&/")+"/"),Xo(i,e,n,"",function(u){return u})):i!=null&&(uf(i)&&(i=SS(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(hp,"$&/")+"/")+t)),e.push(i)),1;if(o=0,r=r===""?".":r+":",fp(t))for(var a=0;a<t.length;a++){s=t[a];var l=r+ql(s,a);o+=Xo(s,e,n,l,i)}else if(l=xS(t),typeof l=="function")for(t=l.call(t),a=0;!(s=t.next()).done;)s=s.value,l=r+ql(s,a++),o+=Xo(s,e,n,l,i);else if(s==="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 o}function vo(t,e,n){if(t==null)return t;var r=[],i=0;return Xo(t,r,"","",function(s){return e.call(n,s,i++)}),r}function kS(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 et={current:null},Qo={transition:null},CS={ReactCurrentDispatcher:et,ReactCurrentBatchConfig:Qo,ReactCurrentOwner:lf};function ly(){throw Error("act(...) is not supported in production builds of React.")}Y.Children={map:vo,forEach:function(t,e,n){vo(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return vo(t,function(){e++}),e},toArray:function(t){return vo(t,function(e){return e})||[]},only:function(t){if(!uf(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Y.Component=Ii;Y.Fragment=fS;Y.Profiler=pS;Y.PureComponent=of;Y.StrictMode=hS;Y.Suspense=yS;Y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=CS;Y.act=ly;Y.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=ny({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=lf.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)sy.call(e,l)&&!oy.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 u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:oo,type:t.type,key:i,ref:s,props:r,_owner:o}};Y.createContext=function(t){return t={$$typeof:mS,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:gS,_context:t},t.Consumer=t};Y.createElement=ay;Y.createFactory=function(t){var e=ay.bind(null,t);return e.type=t,e};Y.createRef=function(){return{current:null}};Y.forwardRef=function(t){return{$$typeof:vS,render:t}};Y.isValidElement=uf;Y.lazy=function(t){return{$$typeof:wS,_payload:{_status:-1,_result:t},_init:kS}};Y.memo=function(t,e){return{$$typeof:_S,type:t,compare:e===void 0?null:e}};Y.startTransition=function(t){var e=Qo.transition;Qo.transition={};try{t()}finally{Qo.transition=e}};Y.unstable_act=ly;Y.useCallback=function(t,e){return et.current.useCallback(t,e)};Y.useContext=function(t){return et.current.useContext(t)};Y.useDebugValue=function(){};Y.useDeferredValue=function(t){return et.current.useDeferredValue(t)};Y.useEffect=function(t,e){return et.current.useEffect(t,e)};Y.useId=function(){return et.current.useId()};Y.useImperativeHandle=function(t,e,n){return et.current.useImperativeHandle(t,e,n)};Y.useInsertionEffect=function(t,e){return et.current.useInsertionEffect(t,e)};Y.useLayoutEffect=function(t,e){return et.current.useLayoutEffect(t,e)};Y.useMemo=function(t,e){return et.current.useMemo(t,e)};Y.useReducer=function(t,e,n){return et.current.useReducer(t,e,n)};Y.useRef=function(t){return et.current.useRef(t)};Y.useState=function(t){return et.current.useState(t)};Y.useSyncExternalStore=function(t,e,n){return et.current.useSyncExternalStore(t,e,n)};Y.useTransition=function(){return et.current.useTransition()};Y.version="18.3.1";ey.exports=Y;var x=ey.exports;const ee=sf(x),uy=uS({__proto__:null,default:ee},[x]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var PS=x,TS=Symbol.for("react.element"),bS=Symbol.for("react.fragment"),AS=Object.prototype.hasOwnProperty,RS=PS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,MS={key:!0,ref:!0,__self:!0,__source:!0};function cy(t,e,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)AS.call(e,r)&&!MS.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:TS,type:t,key:s,ref:o,props:i,_owner:RS.current}}dl.Fragment=bS;dl.jsx=cy;dl.jsxs=cy;Jv.exports=dl;var C=Jv.exports,tc={},dy={exports:{}},_t={},fy={exports:{}},hy={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(t){function e(M,L){var z=M.length;M.push(L);e:for(;0<z;){var J=z-1>>>1,G=M[J];if(0<i(G,L))M[J]=L,M[z]=G,z=J;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var L=M[0],z=M.pop();if(z!==L){M[0]=z;e:for(var J=0,G=M.length,ve=G>>>1;J<ve;){var ue=2*(J+1)-1,Gt=M[ue],je=ue+1,Or=M[je];if(0>i(Gt,z))je<G&&0>i(Or,Gt)?(M[J]=Or,M[je]=z,J=je):(M[J]=Gt,M[ue]=z,J=ue);else if(je<G&&0>i(Or,z))M[J]=Or,M[je]=z,J=je;else break e}}return L}function i(M,L){var z=M.sortIndex-L.sortIndex;return z!==0?z:M.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,d=null,f=3,h=!1,y=!1,m=!1,_=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(M){for(var L=n(u);L!==null;){if(L.callback===null)r(u);else if(L.startTime<=M)r(u),L.sortIndex=L.expirationTime,e(l,L);else break;L=n(u)}}function w(M){if(m=!1,v(M),!y)if(n(l)!==null)y=!0,Q(E);else{var L=n(u);L!==null&&U(w,L.startTime-M)}}function E(M,L){y=!1,m&&(m=!1,p(S),S=-1),h=!0;var z=f;try{for(v(L),d=n(l);d!==null&&(!(d.expirationTime>L)||M&&!R());){var J=d.callback;if(typeof J=="function"){d.callback=null,f=d.priorityLevel;var G=J(d.expirationTime<=L);L=t.unstable_now(),typeof G=="function"?d.callback=G:d===n(l)&&r(l),v(L)}else r(l);d=n(l)}if(d!==null)var ve=!0;else{var ue=n(u);ue!==null&&U(w,ue.startTime-L),ve=!1}return ve}finally{d=null,f=z,h=!1}}var A=!1,b=null,S=-1,k=5,P=-1;function R(){return!(t.unstable_now()-P<k)}function N(){if(b!==null){var M=t.unstable_now();P=M;var L=!0;try{L=b(!0,M)}finally{L?V():(A=!1,b=null)}}else A=!1}var V;if(typeof g=="function")V=function(){g(N)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,K=$.port2;$.port1.onmessage=N,V=function(){K.postMessage(null)}}else V=function(){_(N,0)};function Q(M){b=M,A||(A=!0,V())}function U(M,L){S=_(function(){M(t.unstable_now())},L)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(M){M.callback=null},t.unstable_continueExecution=function(){y||h||(y=!0,Q(E))},t.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<M?Math.floor(1e3/M):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(M){switch(f){case 1:case 2:case 3:var L=3;break;default:L=f}var z=f;f=L;try{return M()}finally{f=z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(M,L){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var z=f;f=M;try{return L()}finally{f=z}},t.unstable_scheduleCallback=function(M,L,z){var J=t.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?J+z:J):z=J,M){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=z+G,M={id:c++,callback:L,priorityLevel:M,startTime:z,expirationTime:G,sortIndex:-1},z>J?(M.sortIndex=z,e(u,M),n(l)===null&&M===n(u)&&(m?(p(S),S=-1):m=!0,U(w,z-J))):(M.sortIndex=G,e(l,M),y||h||(y=!0,Q(E))),M},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(M){var L=f;return function(){var z=f;f=L;try{return M.apply(this,arguments)}finally{f=z}}}})(hy);fy.exports=hy;var IS=fy.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var NS=x,yt=IS;function I(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 py=new Set,Ns={};function Dr(t,e){mi(t,e),mi(t+"Capture",e)}function mi(t,e){for(Ns[t]=e,t=0;t<e.length;t++)py.add(e[t])}var yn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nc=Object.prototype.hasOwnProperty,DS=/^[: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]*$/,pp={},gp={};function LS(t){return nc.call(gp,t)?!0:nc.call(pp,t)?!1:DS.test(t)?gp[t]=!0:(pp[t]=!0,!1)}function OS(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 $S(t,e,n,r){if(e===null||typeof e>"u"||OS(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 tt(t,e,n,r,i,s,o){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=s,this.removeEmptyString=o}var Fe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Fe[t]=new tt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Fe[e]=new tt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Fe[t]=new tt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Fe[t]=new tt(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){Fe[t]=new tt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Fe[t]=new tt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Fe[t]=new tt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Fe[t]=new tt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Fe[t]=new tt(t,5,!1,t.toLowerCase(),null,!1,!1)});var cf=/[\-:]([a-z])/g;function df(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(cf,df);Fe[e]=new tt(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(cf,df);Fe[e]=new tt(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(cf,df);Fe[e]=new tt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Fe[t]=new tt(t,1,!1,t.toLowerCase(),null,!1,!1)});Fe.xlinkHref=new tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Fe[t]=new tt(t,1,!1,t.toLowerCase(),null,!0,!0)});function ff(t,e,n,r){var i=Fe.hasOwnProperty(e)?Fe[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&($S(e,n,i,r)&&(n=null),r||i===null?LS(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 Cn=NS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,yo=Symbol.for("react.element"),Br=Symbol.for("react.portal"),zr=Symbol.for("react.fragment"),hf=Symbol.for("react.strict_mode"),rc=Symbol.for("react.profiler"),gy=Symbol.for("react.provider"),my=Symbol.for("react.context"),pf=Symbol.for("react.forward_ref"),ic=Symbol.for("react.suspense"),sc=Symbol.for("react.suspense_list"),gf=Symbol.for("react.memo"),Nn=Symbol.for("react.lazy"),vy=Symbol.for("react.offscreen"),mp=Symbol.iterator;function Fi(t){return t===null||typeof t!="object"?null:(t=mp&&t[mp]||t["@@iterator"],typeof t=="function"?t:null)}var me=Object.assign,Yl;function ns(t){if(Yl===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Yl=e&&e[1]||""}return`
|
|
34
|
+
`+Yl+t}var Xl=!1;function Ql(t,e){if(!t||Xl)return"";Xl=!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(u){var r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
|
35
|
+
`),s=r.stack.split(`
|
|
36
|
+
`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
|
|
37
|
+
`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{Xl=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?ns(t):""}function FS(t){switch(t.tag){case 5:return ns(t.type);case 16:return ns("Lazy");case 13:return ns("Suspense");case 19:return ns("SuspenseList");case 0:case 2:case 15:return t=Ql(t.type,!1),t;case 11:return t=Ql(t.type.render,!1),t;case 1:return t=Ql(t.type,!0),t;default:return""}}function oc(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 zr:return"Fragment";case Br:return"Portal";case rc:return"Profiler";case hf:return"StrictMode";case ic:return"Suspense";case sc:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case my:return(t.displayName||"Context")+".Consumer";case gy:return(t._context.displayName||"Context")+".Provider";case pf:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case gf:return e=t.displayName||null,e!==null?e:oc(t.type)||"Memo";case Nn:e=t._payload,t=t._init;try{return oc(t(e))}catch{}}return null}function jS(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 oc(e);case 8:return e===hf?"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 Xn(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function yy(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function VS(t){var e=yy(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,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function _o(t){t._valueTracker||(t._valueTracker=VS(t))}function _y(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=yy(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function ga(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 ac(t,e){var n=e.checked;return me({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function vp(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Xn(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 wy(t,e){e=e.checked,e!=null&&ff(t,"checked",e,!1)}function lc(t,e){wy(t,e);var n=Xn(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")?uc(t,e.type,n):e.hasOwnProperty("defaultValue")&&uc(t,e.type,Xn(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function yp(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 uc(t,e,n){(e!=="number"||ga(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var rs=Array.isArray;function ai(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=""+Xn(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 cc(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(I(91));return me({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function _p(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(I(92));if(rs(n)){if(1<n.length)throw Error(I(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Xn(n)}}function xy(t,e){var n=Xn(e.value),r=Xn(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 wp(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function Sy(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 dc(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?Sy(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var wo,Ey=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(wo=wo||document.createElement("div"),wo.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=wo.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ds(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ms={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},BS=["Webkit","ms","Moz","O"];Object.keys(ms).forEach(function(t){BS.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ms[e]=ms[t]})});function ky(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ms.hasOwnProperty(t)&&ms[t]?(""+e).trim():e+"px"}function Cy(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=ky(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var zS=me({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 fc(t,e){if(e){if(zS[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(I(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(I(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(I(61))}if(e.style!=null&&typeof e.style!="object")throw Error(I(62))}}function hc(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 pc=null;function mf(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var gc=null,li=null,ui=null;function xp(t){if(t=uo(t)){if(typeof gc!="function")throw Error(I(280));var e=t.stateNode;e&&(e=ml(e),gc(t.stateNode,t.type,e))}}function Py(t){li?ui?ui.push(t):ui=[t]:li=t}function Ty(){if(li){var t=li,e=ui;if(ui=li=null,xp(t),e)for(t=0;t<e.length;t++)xp(e[t])}}function by(t,e){return t(e)}function Ay(){}var Zl=!1;function Ry(t,e,n){if(Zl)return t(e,n);Zl=!0;try{return by(t,e,n)}finally{Zl=!1,(li!==null||ui!==null)&&(Ay(),Ty())}}function Ls(t,e){var n=t.stateNode;if(n===null)return null;var r=ml(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(I(231,e,typeof n));return n}var mc=!1;if(yn)try{var ji={};Object.defineProperty(ji,"passive",{get:function(){mc=!0}}),window.addEventListener("test",ji,ji),window.removeEventListener("test",ji,ji)}catch{mc=!1}function US(t,e,n,r,i,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(c){this.onError(c)}}var vs=!1,ma=null,va=!1,vc=null,HS={onError:function(t){vs=!0,ma=t}};function WS(t,e,n,r,i,s,o,a,l){vs=!1,ma=null,US.apply(HS,arguments)}function KS(t,e,n,r,i,s,o,a,l){if(WS.apply(this,arguments),vs){if(vs){var u=ma;vs=!1,ma=null}else throw Error(I(198));va||(va=!0,vc=u)}}function Lr(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function My(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 Sp(t){if(Lr(t)!==t)throw Error(I(188))}function GS(t){var e=t.alternate;if(!e){if(e=Lr(t),e===null)throw Error(I(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Sp(i),t;if(s===r)return Sp(i),e;s=s.sibling}throw Error(I(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(I(189))}}if(n.alternate!==r)throw Error(I(190))}if(n.tag!==3)throw Error(I(188));return n.stateNode.current===n?t:e}function Iy(t){return t=GS(t),t!==null?Ny(t):null}function Ny(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Ny(t);if(e!==null)return e;t=t.sibling}return null}var Dy=yt.unstable_scheduleCallback,Ep=yt.unstable_cancelCallback,qS=yt.unstable_shouldYield,YS=yt.unstable_requestPaint,ke=yt.unstable_now,XS=yt.unstable_getCurrentPriorityLevel,vf=yt.unstable_ImmediatePriority,Ly=yt.unstable_UserBlockingPriority,ya=yt.unstable_NormalPriority,QS=yt.unstable_LowPriority,Oy=yt.unstable_IdlePriority,fl=null,en=null;function ZS(t){if(en&&typeof en.onCommitFiberRoot=="function")try{en.onCommitFiberRoot(fl,t,void 0,(t.current.flags&128)===128)}catch{}}var zt=Math.clz32?Math.clz32:tE,JS=Math.log,eE=Math.LN2;function tE(t){return t>>>=0,t===0?32:31-(JS(t)/eE|0)|0}var xo=64,So=4194304;function is(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 _a(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=is(a):(s&=o,s!==0&&(r=is(s)))}else o=n&~i,o!==0?r=is(o):s!==0&&(r=is(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-zt(e),i=1<<n,r|=t[n],e&=~i;return r}function nE(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 rE(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-zt(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=nE(a,e)):l<=e&&(t.expiredLanes|=a),s&=~a}}function yc(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function $y(){var t=xo;return xo<<=1,!(xo&4194240)&&(xo=64),t}function Jl(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function ao(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-zt(e),t[e]=n}function iE(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-zt(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function yf(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-zt(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var te=0;function Fy(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var jy,_f,Vy,By,zy,_c=!1,Eo=[],Vn=null,Bn=null,zn=null,Os=new Map,$s=new Map,Ln=[],sE="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 kp(t,e){switch(t){case"focusin":case"focusout":Vn=null;break;case"dragenter":case"dragleave":Bn=null;break;case"mouseover":case"mouseout":zn=null;break;case"pointerover":case"pointerout":Os.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":$s.delete(e.pointerId)}}function Vi(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=uo(e),e!==null&&_f(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function oE(t,e,n,r,i){switch(e){case"focusin":return Vn=Vi(Vn,t,e,n,r,i),!0;case"dragenter":return Bn=Vi(Bn,t,e,n,r,i),!0;case"mouseover":return zn=Vi(zn,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return Os.set(s,Vi(Os.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,$s.set(s,Vi($s.get(s)||null,t,e,n,r,i)),!0}return!1}function Uy(t){var e=gr(t.target);if(e!==null){var n=Lr(e);if(n!==null){if(e=n.tag,e===13){if(e=My(n),e!==null){t.blockedOn=e,zy(t.priority,function(){Vy(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 Zo(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=wc(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);pc=r,n.target.dispatchEvent(r),pc=null}else return e=uo(n),e!==null&&_f(e),t.blockedOn=n,!1;e.shift()}return!0}function Cp(t,e,n){Zo(t)&&n.delete(e)}function aE(){_c=!1,Vn!==null&&Zo(Vn)&&(Vn=null),Bn!==null&&Zo(Bn)&&(Bn=null),zn!==null&&Zo(zn)&&(zn=null),Os.forEach(Cp),$s.forEach(Cp)}function Bi(t,e){t.blockedOn===e&&(t.blockedOn=null,_c||(_c=!0,yt.unstable_scheduleCallback(yt.unstable_NormalPriority,aE)))}function Fs(t){function e(i){return Bi(i,t)}if(0<Eo.length){Bi(Eo[0],t);for(var n=1;n<Eo.length;n++){var r=Eo[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Vn!==null&&Bi(Vn,t),Bn!==null&&Bi(Bn,t),zn!==null&&Bi(zn,t),Os.forEach(e),$s.forEach(e),n=0;n<Ln.length;n++)r=Ln[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Ln.length&&(n=Ln[0],n.blockedOn===null);)Uy(n),n.blockedOn===null&&Ln.shift()}var ci=Cn.ReactCurrentBatchConfig,wa=!0;function lE(t,e,n,r){var i=te,s=ci.transition;ci.transition=null;try{te=1,wf(t,e,n,r)}finally{te=i,ci.transition=s}}function uE(t,e,n,r){var i=te,s=ci.transition;ci.transition=null;try{te=4,wf(t,e,n,r)}finally{te=i,ci.transition=s}}function wf(t,e,n,r){if(wa){var i=wc(t,e,n,r);if(i===null)uu(t,e,r,xa,n),kp(t,r);else if(oE(i,t,e,n,r))r.stopPropagation();else if(kp(t,r),e&4&&-1<sE.indexOf(t)){for(;i!==null;){var s=uo(i);if(s!==null&&jy(s),s=wc(t,e,n,r),s===null&&uu(t,e,r,xa,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else uu(t,e,r,null,n)}}var xa=null;function wc(t,e,n,r){if(xa=null,t=mf(r),t=gr(t),t!==null)if(e=Lr(t),e===null)t=null;else if(n=e.tag,n===13){if(t=My(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 xa=t,null}function Hy(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(XS()){case vf:return 1;case Ly:return 4;case ya:case QS:return 16;case Oy:return 536870912;default:return 16}default:return 16}}var $n=null,xf=null,Jo=null;function Wy(){if(Jo)return Jo;var t,e=xf,n=e.length,r,i="value"in $n?$n.value:$n.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===i[s-r];r++);return Jo=i.slice(t,1<r?1-r:void 0)}function ea(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 ko(){return!0}function Pp(){return!1}function wt(t){function e(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?ko:Pp,this.isPropagationStopped=Pp,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=ko)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ko)},persist:function(){},isPersistent:ko}),e}var Ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sf=wt(Ni),lo=me({},Ni,{view:0,detail:0}),cE=wt(lo),eu,tu,zi,hl=me({},lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ef,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!==zi&&(zi&&t.type==="mousemove"?(eu=t.screenX-zi.screenX,tu=t.screenY-zi.screenY):tu=eu=0,zi=t),eu)},movementY:function(t){return"movementY"in t?t.movementY:tu}}),Tp=wt(hl),dE=me({},hl,{dataTransfer:0}),fE=wt(dE),hE=me({},lo,{relatedTarget:0}),nu=wt(hE),pE=me({},Ni,{animationName:0,elapsedTime:0,pseudoElement:0}),gE=wt(pE),mE=me({},Ni,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),vE=wt(mE),yE=me({},Ni,{data:0}),bp=wt(yE),_E={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wE={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"},xE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SE(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=xE[t])?!!e[t]:!1}function Ef(){return SE}var EE=me({},lo,{key:function(t){if(t.key){var e=_E[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=ea(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?wE[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ef,charCode:function(t){return t.type==="keypress"?ea(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ea(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),kE=wt(EE),CE=me({},hl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ap=wt(CE),PE=me({},lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ef}),TE=wt(PE),bE=me({},Ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),AE=wt(bE),RE=me({},hl,{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}),ME=wt(RE),IE=[9,13,27,32],kf=yn&&"CompositionEvent"in window,ys=null;yn&&"documentMode"in document&&(ys=document.documentMode);var NE=yn&&"TextEvent"in window&&!ys,Ky=yn&&(!kf||ys&&8<ys&&11>=ys),Rp=" ",Mp=!1;function Gy(t,e){switch(t){case"keyup":return IE.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qy(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ur=!1;function DE(t,e){switch(t){case"compositionend":return qy(e);case"keypress":return e.which!==32?null:(Mp=!0,Rp);case"textInput":return t=e.data,t===Rp&&Mp?null:t;default:return null}}function LE(t,e){if(Ur)return t==="compositionend"||!kf&&Gy(t,e)?(t=Wy(),Jo=xf=$n=null,Ur=!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 Ky&&e.locale!=="ko"?null:e.data;default:return null}}var OE={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 Ip(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!OE[t.type]:e==="textarea"}function Yy(t,e,n,r){Py(r),e=Sa(e,"onChange"),0<e.length&&(n=new Sf("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var _s=null,js=null;function $E(t){o0(t,0)}function pl(t){var e=Kr(t);if(_y(e))return t}function FE(t,e){if(t==="change")return e}var Xy=!1;if(yn){var ru;if(yn){var iu="oninput"in document;if(!iu){var Np=document.createElement("div");Np.setAttribute("oninput","return;"),iu=typeof Np.oninput=="function"}ru=iu}else ru=!1;Xy=ru&&(!document.documentMode||9<document.documentMode)}function Dp(){_s&&(_s.detachEvent("onpropertychange",Qy),js=_s=null)}function Qy(t){if(t.propertyName==="value"&&pl(js)){var e=[];Yy(e,js,t,mf(t)),Ry($E,e)}}function jE(t,e,n){t==="focusin"?(Dp(),_s=e,js=n,_s.attachEvent("onpropertychange",Qy)):t==="focusout"&&Dp()}function VE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return pl(js)}function BE(t,e){if(t==="click")return pl(e)}function zE(t,e){if(t==="input"||t==="change")return pl(e)}function UE(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ht=typeof Object.is=="function"?Object.is:UE;function Vs(t,e){if(Ht(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(!nc.call(e,i)||!Ht(t[i],e[i]))return!1}return!0}function Lp(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Op(t,e){var n=Lp(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=Lp(n)}}function Zy(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Zy(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Jy(){for(var t=window,e=ga();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=ga(t.document)}return e}function Cf(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 HE(t){var e=Jy(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Zy(n.ownerDocument.documentElement,n)){if(r!==null&&Cf(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,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=Op(n,s);var o=Op(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.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 WE=yn&&"documentMode"in document&&11>=document.documentMode,Hr=null,xc=null,ws=null,Sc=!1;function $p(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Sc||Hr==null||Hr!==ga(r)||(r=Hr,"selectionStart"in r&&Cf(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}),ws&&Vs(ws,r)||(ws=r,r=Sa(xc,"onSelect"),0<r.length&&(e=new Sf("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Hr)))}function Co(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Wr={animationend:Co("Animation","AnimationEnd"),animationiteration:Co("Animation","AnimationIteration"),animationstart:Co("Animation","AnimationStart"),transitionend:Co("Transition","TransitionEnd")},su={},e0={};yn&&(e0=document.createElement("div").style,"AnimationEvent"in window||(delete Wr.animationend.animation,delete Wr.animationiteration.animation,delete Wr.animationstart.animation),"TransitionEvent"in window||delete Wr.transitionend.transition);function gl(t){if(su[t])return su[t];if(!Wr[t])return t;var e=Wr[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in e0)return su[t]=e[n];return t}var t0=gl("animationend"),n0=gl("animationiteration"),r0=gl("animationstart"),i0=gl("transitionend"),s0=new Map,Fp="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 tr(t,e){s0.set(t,e),Dr(e,[t])}for(var ou=0;ou<Fp.length;ou++){var au=Fp[ou],KE=au.toLowerCase(),GE=au[0].toUpperCase()+au.slice(1);tr(KE,"on"+GE)}tr(t0,"onAnimationEnd");tr(n0,"onAnimationIteration");tr(r0,"onAnimationStart");tr("dblclick","onDoubleClick");tr("focusin","onFocus");tr("focusout","onBlur");tr(i0,"onTransitionEnd");mi("onMouseEnter",["mouseout","mouseover"]);mi("onMouseLeave",["mouseout","mouseover"]);mi("onPointerEnter",["pointerout","pointerover"]);mi("onPointerLeave",["pointerout","pointerover"]);Dr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Dr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Dr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Dr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Dr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Dr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ss="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(" "),qE=new Set("cancel close invalid load scroll toggle".split(" ").concat(ss));function jp(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,KS(r,e,void 0,t),t.currentTarget=null}function o0(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 s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;jp(i,a,u),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;jp(i,a,u),s=l}}}if(va)throw t=vc,va=!1,vc=null,t}function oe(t,e){var n=e[Tc];n===void 0&&(n=e[Tc]=new Set);var r=t+"__bubble";n.has(r)||(a0(e,t,2,!1),n.add(r))}function lu(t,e,n){var r=0;e&&(r|=4),a0(n,t,r,e)}var Po="_reactListening"+Math.random().toString(36).slice(2);function Bs(t){if(!t[Po]){t[Po]=!0,py.forEach(function(n){n!=="selectionchange"&&(qE.has(n)||lu(n,!1,t),lu(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Po]||(e[Po]=!0,lu("selectionchange",!1,e))}}function a0(t,e,n,r){switch(Hy(e)){case 1:var i=lE;break;case 4:i=uE;break;default:i=wf}n=i.bind(null,e,n,t),i=void 0,!mc||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 uu(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=gr(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}Ry(function(){var u=s,c=mf(n),d=[];e:{var f=s0.get(t);if(f!==void 0){var h=Sf,y=t;switch(t){case"keypress":if(ea(n)===0)break e;case"keydown":case"keyup":h=kE;break;case"focusin":y="focus",h=nu;break;case"focusout":y="blur",h=nu;break;case"beforeblur":case"afterblur":h=nu;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":h=Tp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=fE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=TE;break;case t0:case n0:case r0:h=gE;break;case i0:h=AE;break;case"scroll":h=cE;break;case"wheel":h=ME;break;case"copy":case"cut":case"paste":h=vE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Ap}var m=(e&4)!==0,_=!m&&t==="scroll",p=m?f!==null?f+"Capture":null:f;m=[];for(var g=u,v;g!==null;){v=g;var w=v.stateNode;if(v.tag===5&&w!==null&&(v=w,p!==null&&(w=Ls(g,p),w!=null&&m.push(zs(g,w,v)))),_)break;g=g.return}0<m.length&&(f=new h(f,y,null,n,c),d.push({event:f,listeners:m}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",f&&n!==pc&&(y=n.relatedTarget||n.fromElement)&&(gr(y)||y[_n]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=u,y=y?gr(y):null,y!==null&&(_=Lr(y),y!==_||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=u),h!==y)){if(m=Tp,w="onMouseLeave",p="onMouseEnter",g="mouse",(t==="pointerout"||t==="pointerover")&&(m=Ap,w="onPointerLeave",p="onPointerEnter",g="pointer"),_=h==null?f:Kr(h),v=y==null?f:Kr(y),f=new m(w,g+"leave",h,n,c),f.target=_,f.relatedTarget=v,w=null,gr(c)===u&&(m=new m(p,g+"enter",y,n,c),m.target=v,m.relatedTarget=_,w=m),_=w,h&&y)t:{for(m=h,p=y,g=0,v=m;v;v=$r(v))g++;for(v=0,w=p;w;w=$r(w))v++;for(;0<g-v;)m=$r(m),g--;for(;0<v-g;)p=$r(p),v--;for(;g--;){if(m===p||p!==null&&m===p.alternate)break t;m=$r(m),p=$r(p)}m=null}else m=null;h!==null&&Vp(d,f,h,m,!1),y!==null&&_!==null&&Vp(d,_,y,m,!0)}}e:{if(f=u?Kr(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var E=FE;else if(Ip(f))if(Xy)E=zE;else{E=VE;var A=jE}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=BE);if(E&&(E=E(t,u))){Yy(d,E,n,c);break e}A&&A(t,f,u),t==="focusout"&&(A=f._wrapperState)&&A.controlled&&f.type==="number"&&uc(f,"number",f.value)}switch(A=u?Kr(u):window,t){case"focusin":(Ip(A)||A.contentEditable==="true")&&(Hr=A,xc=u,ws=null);break;case"focusout":ws=xc=Hr=null;break;case"mousedown":Sc=!0;break;case"contextmenu":case"mouseup":case"dragend":Sc=!1,$p(d,n,c);break;case"selectionchange":if(WE)break;case"keydown":case"keyup":$p(d,n,c)}var b;if(kf)e:{switch(t){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Ur?Gy(t,n)&&(S="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&(Ky&&n.locale!=="ko"&&(Ur||S!=="onCompositionStart"?S==="onCompositionEnd"&&Ur&&(b=Wy()):($n=c,xf="value"in $n?$n.value:$n.textContent,Ur=!0)),A=Sa(u,S),0<A.length&&(S=new bp(S,t,null,n,c),d.push({event:S,listeners:A}),b?S.data=b:(b=qy(n),b!==null&&(S.data=b)))),(b=NE?DE(t,n):LE(t,n))&&(u=Sa(u,"onBeforeInput"),0<u.length&&(c=new bp("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=b))}o0(d,e)})}function zs(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Sa(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Ls(t,n),s!=null&&r.unshift(zs(t,s,i)),s=Ls(t,e),s!=null&&r.push(zs(t,s,i))),t=t.return}return r}function $r(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Vp(t,e,n,r,i){for(var s=e._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=Ls(n,s),l!=null&&o.unshift(zs(n,l,a))):i||(l=Ls(n,s),l!=null&&o.push(zs(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var YE=/\r\n?/g,XE=/\u0000|\uFFFD/g;function Bp(t){return(typeof t=="string"?t:""+t).replace(YE,`
|
|
38
|
+
`).replace(XE,"")}function To(t,e,n){if(e=Bp(e),Bp(t)!==e&&n)throw Error(I(425))}function Ea(){}var Ec=null,kc=null;function Cc(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 Pc=typeof setTimeout=="function"?setTimeout:void 0,QE=typeof clearTimeout=="function"?clearTimeout:void 0,zp=typeof Promise=="function"?Promise:void 0,ZE=typeof queueMicrotask=="function"?queueMicrotask:typeof zp<"u"?function(t){return zp.resolve(null).then(t).catch(JE)}:Pc;function JE(t){setTimeout(function(){throw t})}function cu(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),Fs(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Fs(e)}function Un(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 Up(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 Di=Math.random().toString(36).slice(2),Zt="__reactFiber$"+Di,Us="__reactProps$"+Di,_n="__reactContainer$"+Di,Tc="__reactEvents$"+Di,ek="__reactListeners$"+Di,tk="__reactHandles$"+Di;function gr(t){var e=t[Zt];if(e)return e;for(var n=t.parentNode;n;){if(e=n[_n]||n[Zt]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Up(t);t!==null;){if(n=t[Zt])return n;t=Up(t)}return e}t=n,n=t.parentNode}return null}function uo(t){return t=t[Zt]||t[_n],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Kr(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(I(33))}function ml(t){return t[Us]||null}var bc=[],Gr=-1;function nr(t){return{current:t}}function le(t){0>Gr||(t.current=bc[Gr],bc[Gr]=null,Gr--)}function se(t,e){Gr++,bc[Gr]=t.current,t.current=e}var Qn={},qe=nr(Qn),ct=nr(!1),kr=Qn;function vi(t,e){var n=t.type.contextTypes;if(!n)return Qn;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function dt(t){return t=t.childContextTypes,t!=null}function ka(){le(ct),le(qe)}function Hp(t,e,n){if(qe.current!==Qn)throw Error(I(168));se(qe,e),se(ct,n)}function l0(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(I(108,jS(t)||"Unknown",i));return me({},n,r)}function Ca(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Qn,kr=qe.current,se(qe,t),se(ct,ct.current),!0}function Wp(t,e,n){var r=t.stateNode;if(!r)throw Error(I(169));n?(t=l0(t,e,kr),r.__reactInternalMemoizedMergedChildContext=t,le(ct),le(qe),se(qe,t)):le(ct),se(ct,n)}var fn=null,vl=!1,du=!1;function u0(t){fn===null?fn=[t]:fn.push(t)}function nk(t){vl=!0,u0(t)}function rr(){if(!du&&fn!==null){du=!0;var t=0,e=te;try{var n=fn;for(te=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}fn=null,vl=!1}catch(i){throw fn!==null&&(fn=fn.slice(t+1)),Dy(vf,rr),i}finally{te=e,du=!1}}return null}var qr=[],Yr=0,Pa=null,Ta=0,Et=[],kt=0,Cr=null,gn=1,mn="";function cr(t,e){qr[Yr++]=Ta,qr[Yr++]=Pa,Pa=t,Ta=e}function c0(t,e,n){Et[kt++]=gn,Et[kt++]=mn,Et[kt++]=Cr,Cr=t;var r=gn;t=mn;var i=32-zt(r)-1;r&=~(1<<i),n+=1;var s=32-zt(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,gn=1<<32-zt(e)+i|n<<i|r,mn=s+t}else gn=1<<s|n<<i|r,mn=t}function Pf(t){t.return!==null&&(cr(t,1),c0(t,1,0))}function Tf(t){for(;t===Pa;)Pa=qr[--Yr],qr[Yr]=null,Ta=qr[--Yr],qr[Yr]=null;for(;t===Cr;)Cr=Et[--kt],Et[kt]=null,mn=Et[--kt],Et[kt]=null,gn=Et[--kt],Et[kt]=null}var vt=null,pt=null,ce=!1,Vt=null;function d0(t,e){var n=Ct(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 Kp(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,vt=t,pt=Un(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,vt=t,pt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Cr!==null?{id:gn,overflow:mn}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Ct(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,vt=t,pt=null,!0):!1;default:return!1}}function Ac(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Rc(t){if(ce){var e=pt;if(e){var n=e;if(!Kp(t,e)){if(Ac(t))throw Error(I(418));e=Un(n.nextSibling);var r=vt;e&&Kp(t,e)?d0(r,n):(t.flags=t.flags&-4097|2,ce=!1,vt=t)}}else{if(Ac(t))throw Error(I(418));t.flags=t.flags&-4097|2,ce=!1,vt=t}}}function Gp(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;vt=t}function bo(t){if(t!==vt)return!1;if(!ce)return Gp(t),ce=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Cc(t.type,t.memoizedProps)),e&&(e=pt)){if(Ac(t))throw f0(),Error(I(418));for(;e;)d0(t,e),e=Un(e.nextSibling)}if(Gp(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(I(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){pt=Un(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}pt=null}}else pt=vt?Un(t.stateNode.nextSibling):null;return!0}function f0(){for(var t=pt;t;)t=Un(t.nextSibling)}function yi(){pt=vt=null,ce=!1}function bf(t){Vt===null?Vt=[t]:Vt.push(t)}var rk=Cn.ReactCurrentBatchConfig;function Ui(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(I(309));var r=n.stateNode}if(!r)throw Error(I(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(I(284));if(!n._owner)throw Error(I(290,t))}return t}function Ao(t,e){throw t=Object.prototype.toString.call(e),Error(I(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function qp(t){var e=t._init;return e(t._payload)}function h0(t){function e(p,g){if(t){var v=p.deletions;v===null?(p.deletions=[g],p.flags|=16):v.push(g)}}function n(p,g){if(!t)return null;for(;g!==null;)e(p,g),g=g.sibling;return null}function r(p,g){for(p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function i(p,g){return p=Gn(p,g),p.index=0,p.sibling=null,p}function s(p,g,v){return p.index=v,t?(v=p.alternate,v!==null?(v=v.index,v<g?(p.flags|=2,g):v):(p.flags|=2,g)):(p.flags|=1048576,g)}function o(p){return t&&p.alternate===null&&(p.flags|=2),p}function a(p,g,v,w){return g===null||g.tag!==6?(g=yu(v,p.mode,w),g.return=p,g):(g=i(g,v),g.return=p,g)}function l(p,g,v,w){var E=v.type;return E===zr?c(p,g,v.props.children,w,v.key):g!==null&&(g.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Nn&&qp(E)===g.type)?(w=i(g,v.props),w.ref=Ui(p,g,v),w.return=p,w):(w=aa(v.type,v.key,v.props,null,p.mode,w),w.ref=Ui(p,g,v),w.return=p,w)}function u(p,g,v,w){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=_u(v,p.mode,w),g.return=p,g):(g=i(g,v.children||[]),g.return=p,g)}function c(p,g,v,w,E){return g===null||g.tag!==7?(g=xr(v,p.mode,w,E),g.return=p,g):(g=i(g,v),g.return=p,g)}function d(p,g,v){if(typeof g=="string"&&g!==""||typeof g=="number")return g=yu(""+g,p.mode,v),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case yo:return v=aa(g.type,g.key,g.props,null,p.mode,v),v.ref=Ui(p,null,g),v.return=p,v;case Br:return g=_u(g,p.mode,v),g.return=p,g;case Nn:var w=g._init;return d(p,w(g._payload),v)}if(rs(g)||Fi(g))return g=xr(g,p.mode,v,null),g.return=p,g;Ao(p,g)}return null}function f(p,g,v,w){var E=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return E!==null?null:a(p,g,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case yo:return v.key===E?l(p,g,v,w):null;case Br:return v.key===E?u(p,g,v,w):null;case Nn:return E=v._init,f(p,g,E(v._payload),w)}if(rs(v)||Fi(v))return E!==null?null:c(p,g,v,w,null);Ao(p,v)}return null}function h(p,g,v,w,E){if(typeof w=="string"&&w!==""||typeof w=="number")return p=p.get(v)||null,a(g,p,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case yo:return p=p.get(w.key===null?v:w.key)||null,l(g,p,w,E);case Br:return p=p.get(w.key===null?v:w.key)||null,u(g,p,w,E);case Nn:var A=w._init;return h(p,g,v,A(w._payload),E)}if(rs(w)||Fi(w))return p=p.get(v)||null,c(g,p,w,E,null);Ao(g,w)}return null}function y(p,g,v,w){for(var E=null,A=null,b=g,S=g=0,k=null;b!==null&&S<v.length;S++){b.index>S?(k=b,b=null):k=b.sibling;var P=f(p,b,v[S],w);if(P===null){b===null&&(b=k);break}t&&b&&P.alternate===null&&e(p,b),g=s(P,g,S),A===null?E=P:A.sibling=P,A=P,b=k}if(S===v.length)return n(p,b),ce&&cr(p,S),E;if(b===null){for(;S<v.length;S++)b=d(p,v[S],w),b!==null&&(g=s(b,g,S),A===null?E=b:A.sibling=b,A=b);return ce&&cr(p,S),E}for(b=r(p,b);S<v.length;S++)k=h(b,p,S,v[S],w),k!==null&&(t&&k.alternate!==null&&b.delete(k.key===null?S:k.key),g=s(k,g,S),A===null?E=k:A.sibling=k,A=k);return t&&b.forEach(function(R){return e(p,R)}),ce&&cr(p,S),E}function m(p,g,v,w){var E=Fi(v);if(typeof E!="function")throw Error(I(150));if(v=E.call(v),v==null)throw Error(I(151));for(var A=E=null,b=g,S=g=0,k=null,P=v.next();b!==null&&!P.done;S++,P=v.next()){b.index>S?(k=b,b=null):k=b.sibling;var R=f(p,b,P.value,w);if(R===null){b===null&&(b=k);break}t&&b&&R.alternate===null&&e(p,b),g=s(R,g,S),A===null?E=R:A.sibling=R,A=R,b=k}if(P.done)return n(p,b),ce&&cr(p,S),E;if(b===null){for(;!P.done;S++,P=v.next())P=d(p,P.value,w),P!==null&&(g=s(P,g,S),A===null?E=P:A.sibling=P,A=P);return ce&&cr(p,S),E}for(b=r(p,b);!P.done;S++,P=v.next())P=h(b,p,S,P.value,w),P!==null&&(t&&P.alternate!==null&&b.delete(P.key===null?S:P.key),g=s(P,g,S),A===null?E=P:A.sibling=P,A=P);return t&&b.forEach(function(N){return e(p,N)}),ce&&cr(p,S),E}function _(p,g,v,w){if(typeof v=="object"&&v!==null&&v.type===zr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case yo:e:{for(var E=v.key,A=g;A!==null;){if(A.key===E){if(E=v.type,E===zr){if(A.tag===7){n(p,A.sibling),g=i(A,v.props.children),g.return=p,p=g;break e}}else if(A.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Nn&&qp(E)===A.type){n(p,A.sibling),g=i(A,v.props),g.ref=Ui(p,A,v),g.return=p,p=g;break e}n(p,A);break}else e(p,A);A=A.sibling}v.type===zr?(g=xr(v.props.children,p.mode,w,v.key),g.return=p,p=g):(w=aa(v.type,v.key,v.props,null,p.mode,w),w.ref=Ui(p,g,v),w.return=p,p=w)}return o(p);case Br:e:{for(A=v.key;g!==null;){if(g.key===A)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){n(p,g.sibling),g=i(g,v.children||[]),g.return=p,p=g;break e}else{n(p,g);break}else e(p,g);g=g.sibling}g=_u(v,p.mode,w),g.return=p,p=g}return o(p);case Nn:return A=v._init,_(p,g,A(v._payload),w)}if(rs(v))return y(p,g,v,w);if(Fi(v))return m(p,g,v,w);Ao(p,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,g!==null&&g.tag===6?(n(p,g.sibling),g=i(g,v),g.return=p,p=g):(n(p,g),g=yu(v,p.mode,w),g.return=p,p=g),o(p)):n(p,g)}return _}var _i=h0(!0),p0=h0(!1),ba=nr(null),Aa=null,Xr=null,Af=null;function Rf(){Af=Xr=Aa=null}function Mf(t){var e=ba.current;le(ba),t._currentValue=e}function Mc(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 di(t,e){Aa=t,Af=Xr=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ot=!0),t.firstContext=null)}function It(t){var e=t._currentValue;if(Af!==t)if(t={context:t,memoizedValue:e,next:null},Xr===null){if(Aa===null)throw Error(I(308));Xr=t,Aa.dependencies={lanes:0,firstContext:t}}else Xr=Xr.next=t;return e}var mr=null;function If(t){mr===null?mr=[t]:mr.push(t)}function g0(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,If(e)):(n.next=i.next,i.next=n),e.interleaved=n,wn(t,r)}function wn(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 Dn=!1;function Nf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function m0(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 vn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Hn(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Z&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,wn(t,n)}return i=r.interleaved,i===null?(e.next=e,If(r)):(e.next=i.next,i.next=e),r.interleaved=e,wn(t,n)}function ta(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,yf(t,n)}}function Yp(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 Ra(t,e,n,r){var i=t.updateQueue;Dn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var c=t.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;o=0,c=u=l=null,a=s;do{var f=a.lane,h=a.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=t,m=a;switch(f=e,h=n,m.tag){case 1:if(y=m.payload,typeof y=="function"){d=y.call(h,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=m.payload,f=typeof y=="function"?y.call(h,d,f):y,f==null)break e;d=me({},d,f);break e;case 2:Dn=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Tr|=o,t.lanes=o,t.memoizedState=d}}function Xp(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(I(191,i));i.call(r)}}}var co={},tn=nr(co),Hs=nr(co),Ws=nr(co);function vr(t){if(t===co)throw Error(I(174));return t}function Df(t,e){switch(se(Ws,e),se(Hs,t),se(tn,co),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:dc(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=dc(e,t)}le(tn),se(tn,e)}function wi(){le(tn),le(Hs),le(Ws)}function v0(t){vr(Ws.current);var e=vr(tn.current),n=dc(e,t.type);e!==n&&(se(Hs,t),se(tn,n))}function Lf(t){Hs.current===t&&(le(tn),le(Hs))}var fe=nr(0);function Ma(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)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 fu=[];function Of(){for(var t=0;t<fu.length;t++)fu[t]._workInProgressVersionPrimary=null;fu.length=0}var na=Cn.ReactCurrentDispatcher,hu=Cn.ReactCurrentBatchConfig,Pr=0,ge=null,Te=null,Ie=null,Ia=!1,xs=!1,Ks=0,ik=0;function Ve(){throw Error(I(321))}function $f(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Ht(t[n],e[n]))return!1;return!0}function Ff(t,e,n,r,i,s){if(Pr=s,ge=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,na.current=t===null||t.memoizedState===null?lk:uk,t=n(r,i),xs){s=0;do{if(xs=!1,Ks=0,25<=s)throw Error(I(301));s+=1,Ie=Te=null,e.updateQueue=null,na.current=ck,t=n(r,i)}while(xs)}if(na.current=Na,e=Te!==null&&Te.next!==null,Pr=0,Ie=Te=ge=null,Ia=!1,e)throw Error(I(300));return t}function jf(){var t=Ks!==0;return Ks=0,t}function Xt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?ge.memoizedState=Ie=t:Ie=Ie.next=t,Ie}function Nt(){if(Te===null){var t=ge.alternate;t=t!==null?t.memoizedState:null}else t=Te.next;var e=Ie===null?ge.memoizedState:Ie.next;if(e!==null)Ie=e,Te=t;else{if(t===null)throw Error(I(310));Te=t,t={memoizedState:Te.memoizedState,baseState:Te.baseState,baseQueue:Te.baseQueue,queue:Te.queue,next:null},Ie===null?ge.memoizedState=Ie=t:Ie=Ie.next=t}return Ie}function Gs(t,e){return typeof e=="function"?e(t):e}function pu(t){var e=Nt(),n=e.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=t;var r=Te,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,u=s;do{var c=u.lane;if((Pr&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=d,o=r):l=l.next=d,ge.lanes|=c,Tr|=c}u=u.next}while(u!==null&&u!==s);l===null?o=r:l.next=a,Ht(r,e.memoizedState)||(ot=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,ge.lanes|=s,Tr|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function gu(t){var e=Nt(),n=e.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);Ht(s,e.memoizedState)||(ot=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function y0(){}function _0(t,e){var n=ge,r=Nt(),i=e(),s=!Ht(r.memoizedState,i);if(s&&(r.memoizedState=i,ot=!0),r=r.queue,Vf(S0.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||Ie!==null&&Ie.memoizedState.tag&1){if(n.flags|=2048,qs(9,x0.bind(null,n,r,i,e),void 0,null),Ne===null)throw Error(I(349));Pr&30||w0(n,e,i)}return i}function w0(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=ge.updateQueue,e===null?(e={lastEffect:null,stores:null},ge.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function x0(t,e,n,r){e.value=n,e.getSnapshot=r,E0(e)&&k0(t)}function S0(t,e,n){return n(function(){E0(e)&&k0(t)})}function E0(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Ht(t,n)}catch{return!0}}function k0(t){var e=wn(t,1);e!==null&&Ut(e,t,1,-1)}function Qp(t){var e=Xt();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Gs,lastRenderedState:t},e.queue=t,t=t.dispatch=ak.bind(null,ge,t),[e.memoizedState,t]}function qs(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=ge.updateQueue,e===null?(e={lastEffect:null,stores:null},ge.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 C0(){return Nt().memoizedState}function ra(t,e,n,r){var i=Xt();ge.flags|=t,i.memoizedState=qs(1|e,n,void 0,r===void 0?null:r)}function yl(t,e,n,r){var i=Nt();r=r===void 0?null:r;var s=void 0;if(Te!==null){var o=Te.memoizedState;if(s=o.destroy,r!==null&&$f(r,o.deps)){i.memoizedState=qs(e,n,s,r);return}}ge.flags|=t,i.memoizedState=qs(1|e,n,s,r)}function Zp(t,e){return ra(8390656,8,t,e)}function Vf(t,e){return yl(2048,8,t,e)}function P0(t,e){return yl(4,2,t,e)}function T0(t,e){return yl(4,4,t,e)}function b0(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 A0(t,e,n){return n=n!=null?n.concat([t]):null,yl(4,4,b0.bind(null,e,t),n)}function Bf(){}function R0(t,e){var n=Nt();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&$f(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function M0(t,e){var n=Nt();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&$f(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function I0(t,e,n){return Pr&21?(Ht(n,e)||(n=$y(),ge.lanes|=n,Tr|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,ot=!0),t.memoizedState=n)}function sk(t,e){var n=te;te=n!==0&&4>n?n:4,t(!0);var r=hu.transition;hu.transition={};try{t(!1),e()}finally{te=n,hu.transition=r}}function N0(){return Nt().memoizedState}function ok(t,e,n){var r=Kn(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},D0(t))L0(e,n);else if(n=g0(t,e,n,r),n!==null){var i=Je();Ut(n,t,r,i),O0(n,e,r)}}function ak(t,e,n){var r=Kn(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(D0(t))L0(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Ht(a,o)){var l=e.interleaved;l===null?(i.next=i,If(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=g0(t,e,i,r),n!==null&&(i=Je(),Ut(n,t,r,i),O0(n,e,r))}}function D0(t){var e=t.alternate;return t===ge||e!==null&&e===ge}function L0(t,e){xs=Ia=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function O0(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,yf(t,n)}}var Na={readContext:It,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useInsertionEffect:Ve,useLayoutEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useMutableSource:Ve,useSyncExternalStore:Ve,useId:Ve,unstable_isNewReconciler:!1},lk={readContext:It,useCallback:function(t,e){return Xt().memoizedState=[t,e===void 0?null:e],t},useContext:It,useEffect:Zp,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,ra(4194308,4,b0.bind(null,e,t),n)},useLayoutEffect:function(t,e){return ra(4194308,4,t,e)},useInsertionEffect:function(t,e){return ra(4,2,t,e)},useMemo:function(t,e){var n=Xt();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Xt();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=ok.bind(null,ge,t),[r.memoizedState,t]},useRef:function(t){var e=Xt();return t={current:t},e.memoizedState=t},useState:Qp,useDebugValue:Bf,useDeferredValue:function(t){return Xt().memoizedState=t},useTransition:function(){var t=Qp(!1),e=t[0];return t=sk.bind(null,t[1]),Xt().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=ge,i=Xt();if(ce){if(n===void 0)throw Error(I(407));n=n()}else{if(n=e(),Ne===null)throw Error(I(349));Pr&30||w0(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,Zp(S0.bind(null,r,s,t),[t]),r.flags|=2048,qs(9,x0.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=Xt(),e=Ne.identifierPrefix;if(ce){var n=mn,r=gn;n=(r&~(1<<32-zt(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Ks++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=ik++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},uk={readContext:It,useCallback:R0,useContext:It,useEffect:Vf,useImperativeHandle:A0,useInsertionEffect:P0,useLayoutEffect:T0,useMemo:M0,useReducer:pu,useRef:C0,useState:function(){return pu(Gs)},useDebugValue:Bf,useDeferredValue:function(t){var e=Nt();return I0(e,Te.memoizedState,t)},useTransition:function(){var t=pu(Gs)[0],e=Nt().memoizedState;return[t,e]},useMutableSource:y0,useSyncExternalStore:_0,useId:N0,unstable_isNewReconciler:!1},ck={readContext:It,useCallback:R0,useContext:It,useEffect:Vf,useImperativeHandle:A0,useInsertionEffect:P0,useLayoutEffect:T0,useMemo:M0,useReducer:gu,useRef:C0,useState:function(){return gu(Gs)},useDebugValue:Bf,useDeferredValue:function(t){var e=Nt();return Te===null?e.memoizedState=t:I0(e,Te.memoizedState,t)},useTransition:function(){var t=gu(Gs)[0],e=Nt().memoizedState;return[t,e]},useMutableSource:y0,useSyncExternalStore:_0,useId:N0,unstable_isNewReconciler:!1};function Ot(t,e){if(t&&t.defaultProps){e=me({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Ic(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:me({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var _l={isMounted:function(t){return(t=t._reactInternals)?Lr(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Je(),i=Kn(t),s=vn(r,i);s.payload=e,n!=null&&(s.callback=n),e=Hn(t,s,i),e!==null&&(Ut(e,t,i,r),ta(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Je(),i=Kn(t),s=vn(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=Hn(t,s,i),e!==null&&(Ut(e,t,i,r),ta(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Je(),r=Kn(t),i=vn(n,r);i.tag=2,e!=null&&(i.callback=e),e=Hn(t,i,r),e!==null&&(Ut(e,t,r,n),ta(e,t,r))}};function Jp(t,e,n,r,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!Vs(n,r)||!Vs(i,s):!0}function $0(t,e,n){var r=!1,i=Qn,s=e.contextType;return typeof s=="object"&&s!==null?s=It(s):(i=dt(e)?kr:qe.current,r=e.contextTypes,s=(r=r!=null)?vi(t,i):Qn),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=_l,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function eg(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&&_l.enqueueReplaceState(e,e.state,null)}function Nc(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},Nf(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=It(s):(s=dt(e)?kr:qe.current,i.context=vi(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(Ic(t,e,s,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&&_l.enqueueReplaceState(i,i.state,null),Ra(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function xi(t,e){try{var n="",r=e;do n+=FS(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
39
|
+
Error generating stack: `+s.message+`
|
|
40
|
+
`+s.stack}return{value:t,source:e,stack:i,digest:null}}function mu(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Dc(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var dk=typeof WeakMap=="function"?WeakMap:Map;function F0(t,e,n){n=vn(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){La||(La=!0,Hc=r),Dc(t,e)},n}function j0(t,e,n){n=vn(-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(){Dc(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Dc(t,e),typeof r!="function"&&(Wn===null?Wn=new Set([this]):Wn.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function tg(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new dk;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=Ck.bind(null,t,e,n),e.then(t,t))}function ng(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 rg(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=vn(-1,1),e.tag=2,Hn(n,e,1))),n.lanes|=1),t)}var fk=Cn.ReactCurrentOwner,ot=!1;function Xe(t,e,n,r){e.child=t===null?p0(e,null,n,r):_i(e,t.child,n,r)}function ig(t,e,n,r,i){n=n.render;var s=e.ref;return di(e,i),r=Ff(t,e,n,r,s,i),n=jf(),t!==null&&!ot?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,xn(t,e,i)):(ce&&n&&Pf(e),e.flags|=1,Xe(t,e,r,i),e.child)}function sg(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!Yf(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,V0(t,e,s,r,i)):(t=aa(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Vs,n(o,r)&&t.ref===e.ref)return xn(t,e,i)}return e.flags|=1,t=Gn(s,r),t.ref=e.ref,t.return=e,e.child=t}function V0(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(Vs(s,r)&&t.ref===e.ref)if(ot=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(ot=!0);else return e.lanes=t.lanes,xn(t,e,i)}return Lc(t,e,n,r,i)}function B0(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},se(Zr,ht),ht|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,se(Zr,ht),ht|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,se(Zr,ht),ht|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,se(Zr,ht),ht|=r;return Xe(t,e,i,n),e.child}function z0(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Lc(t,e,n,r,i){var s=dt(n)?kr:qe.current;return s=vi(e,s),di(e,i),n=Ff(t,e,n,r,s,i),r=jf(),t!==null&&!ot?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,xn(t,e,i)):(ce&&r&&Pf(e),e.flags|=1,Xe(t,e,n,i),e.child)}function og(t,e,n,r,i){if(dt(n)){var s=!0;Ca(e)}else s=!1;if(di(e,i),e.stateNode===null)ia(t,e),$0(e,n,r),Nc(e,n,r,i),r=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=It(u):(u=dt(n)?kr:qe.current,u=vi(e,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&eg(e,o,r,u),Dn=!1;var f=e.memoizedState;o.state=f,Ra(e,r,o,i),l=e.memoizedState,a!==r||f!==l||ct.current||Dn?(typeof c=="function"&&(Ic(e,n,c,r),l=e.memoizedState),(a=Dn||Jp(e,n,a,r,f,l,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,m0(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:Ot(e.type,a),o.props=u,d=e.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=It(l):(l=dt(n)?kr:qe.current,l=vi(e,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||f!==l)&&eg(e,o,r,l),Dn=!1,f=e.memoizedState,o.state=f,Ra(e,r,o,i);var y=e.memoizedState;a!==d||f!==y||ct.current||Dn?(typeof h=="function"&&(Ic(e,n,h,r),y=e.memoizedState),(u=Dn||Jp(e,n,u,r,f,y,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,y,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,y,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=y),o.props=r,o.state=y,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return Oc(t,e,n,r,s,i)}function Oc(t,e,n,r,i,s){z0(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&Wp(e,n,!1),xn(t,e,s);r=e.stateNode,fk.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=_i(e,t.child,null,s),e.child=_i(e,null,a,s)):Xe(t,e,a,s),e.memoizedState=r.state,i&&Wp(e,n,!0),e.child}function U0(t){var e=t.stateNode;e.pendingContext?Hp(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Hp(t,e.context,!1),Df(t,e.containerInfo)}function ag(t,e,n,r,i){return yi(),bf(i),e.flags|=256,Xe(t,e,n,r),e.child}var $c={dehydrated:null,treeContext:null,retryLane:0};function Fc(t){return{baseLanes:t,cachePool:null,transitions:null}}function H0(t,e,n){var r=e.pendingProps,i=fe.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),se(fe,i&1),t===null)return Rc(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Sl(o,r,0,null),t=xr(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=Fc(n),e.memoizedState=$c,t):zf(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return hk(t,e,o,r,a,i,n);if(s){s=r.fallback,o=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=Gn(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Gn(a,s):(s=xr(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=t.child.memoizedState,o=o===null?Fc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~n,e.memoizedState=$c,r}return s=t.child,t=s.sibling,r=Gn(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(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 zf(t,e){return e=Sl({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Ro(t,e,n,r){return r!==null&&bf(r),_i(e,t.child,null,n),t=zf(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function hk(t,e,n,r,i,s,o){if(n)return e.flags&256?(e.flags&=-257,r=mu(Error(I(422))),Ro(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=Sl({mode:"visible",children:r.children},i,0,null),s=xr(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&_i(e,t.child,null,o),e.child.memoizedState=Fc(o),e.memoizedState=$c,s);if(!(e.mode&1))return Ro(t,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(I(419)),r=mu(s,r,void 0),Ro(t,e,o,r)}if(a=(o&t.childLanes)!==0,ot||a){if(r=Ne,r!==null){switch(o&-o){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|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,wn(t,i),Ut(r,t,i,-1))}return qf(),r=mu(Error(I(421))),Ro(t,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=Pk.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,pt=Un(i.nextSibling),vt=e,ce=!0,Vt=null,t!==null&&(Et[kt++]=gn,Et[kt++]=mn,Et[kt++]=Cr,gn=t.id,mn=t.overflow,Cr=e),e=zf(e,r.children),e.flags|=4096,e)}function lg(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Mc(t.return,e,n)}function vu(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function W0(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Xe(t,e,r.children,n),r=fe.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&lg(t,n,e);else if(t.tag===19)lg(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(se(fe,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Ma(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),vu(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Ma(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}vu(e,!0,n,null,s);break;case"together":vu(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ia(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function xn(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Tr|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(I(153));if(e.child!==null){for(t=e.child,n=Gn(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Gn(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function pk(t,e,n){switch(e.tag){case 3:U0(e),yi();break;case 5:v0(e);break;case 1:dt(e.type)&&Ca(e);break;case 4:Df(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;se(ba,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(se(fe,fe.current&1),e.flags|=128,null):n&e.child.childLanes?H0(t,e,n):(se(fe,fe.current&1),t=xn(t,e,n),t!==null?t.sibling:null);se(fe,fe.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return W0(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),se(fe,fe.current),r)break;return null;case 22:case 23:return e.lanes=0,B0(t,e,n)}return xn(t,e,n)}var K0,jc,G0,q0;K0=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}};jc=function(){};G0=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,vr(tn.current);var s=null;switch(n){case"input":i=ac(t,i),r=ac(t,r),s=[];break;case"select":i=me({},i,{value:void 0}),r=me({},r,{value:void 0}),s=[];break;case"textarea":i=cc(t,i),r=cc(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Ea)}fc(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ns.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ns.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&oe("scroll",t),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};q0=function(t,e,n,r){n!==r&&(e.flags|=4)};function Hi(t,e){if(!ce)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 Be(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 gk(t,e,n){var r=e.pendingProps;switch(Tf(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(e),null;case 1:return dt(e.type)&&ka(),Be(e),null;case 3:return r=e.stateNode,wi(),le(ct),le(qe),Of(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(bo(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Vt!==null&&(Gc(Vt),Vt=null))),jc(t,e),Be(e),null;case 5:Lf(e);var i=vr(Ws.current);if(n=e.type,t!==null&&e.stateNode!=null)G0(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(I(166));return Be(e),null}if(t=vr(tn.current),bo(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[Zt]=e,r[Us]=s,t=(e.mode&1)!==0,n){case"dialog":oe("cancel",r),oe("close",r);break;case"iframe":case"object":case"embed":oe("load",r);break;case"video":case"audio":for(i=0;i<ss.length;i++)oe(ss[i],r);break;case"source":oe("error",r);break;case"img":case"image":case"link":oe("error",r),oe("load",r);break;case"details":oe("toggle",r);break;case"input":vp(r,s),oe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},oe("invalid",r);break;case"textarea":_p(r,s),oe("invalid",r)}fc(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&To(r.textContent,a,t),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&To(r.textContent,a,t),i=["children",""+a]):Ns.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&oe("scroll",r)}switch(n){case"input":_o(r),yp(r,s,!0);break;case"textarea":_o(r),wp(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Ea)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Sy(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[Zt]=e,t[Us]=r,K0(t,e,!1,!1),e.stateNode=t;e:{switch(o=hc(n,r),n){case"dialog":oe("cancel",t),oe("close",t),i=r;break;case"iframe":case"object":case"embed":oe("load",t),i=r;break;case"video":case"audio":for(i=0;i<ss.length;i++)oe(ss[i],t);i=r;break;case"source":oe("error",t),i=r;break;case"img":case"image":case"link":oe("error",t),oe("load",t),i=r;break;case"details":oe("toggle",t),i=r;break;case"input":vp(t,r),i=ac(t,r),oe("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=me({},r,{value:void 0}),oe("invalid",t);break;case"textarea":_p(t,r),i=cc(t,r),oe("invalid",t);break;default:i=r}fc(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?Cy(t,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Ey(t,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Ds(t,l):typeof l=="number"&&Ds(t,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ns.hasOwnProperty(s)?l!=null&&s==="onScroll"&&oe("scroll",t):l!=null&&ff(t,s,l,o))}switch(n){case"input":_o(t),yp(t,r,!1);break;case"textarea":_o(t),wp(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Xn(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?ai(t,!!r.multiple,s,!1):r.defaultValue!=null&&ai(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Ea)}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 Be(e),null;case 6:if(t&&e.stateNode!=null)q0(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(I(166));if(n=vr(Ws.current),vr(tn.current),bo(e)){if(r=e.stateNode,n=e.memoizedProps,r[Zt]=e,(s=r.nodeValue!==n)&&(t=vt,t!==null))switch(t.tag){case 3:To(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&To(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Zt]=e,e.stateNode=r}return Be(e),null;case 13:if(le(fe),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ce&&pt!==null&&e.mode&1&&!(e.flags&128))f0(),yi(),e.flags|=98560,s=!1;else if(s=bo(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(I(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(I(317));s[Zt]=e}else yi(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Be(e),s=!1}else Vt!==null&&(Gc(Vt),Vt=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||fe.current&1?Ae===0&&(Ae=3):qf())),e.updateQueue!==null&&(e.flags|=4),Be(e),null);case 4:return wi(),jc(t,e),t===null&&Bs(e.stateNode.containerInfo),Be(e),null;case 10:return Mf(e.type._context),Be(e),null;case 17:return dt(e.type)&&ka(),Be(e),null;case 19:if(le(fe),s=e.memoizedState,s===null)return Be(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)Hi(s,!1);else{if(Ae!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Ma(t),o!==null){for(e.flags|=128,Hi(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return se(fe,fe.current&1|2),e.child}t=t.sibling}s.tail!==null&&ke()>Si&&(e.flags|=128,r=!0,Hi(s,!1),e.lanes=4194304)}else{if(!r)if(t=Ma(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Hi(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ce)return Be(e),null}else 2*ke()-s.renderingStartTime>Si&&n!==1073741824&&(e.flags|=128,r=!0,Hi(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ke(),e.sibling=null,n=fe.current,se(fe,r?n&1|2:n&1),e):(Be(e),null);case 22:case 23:return Gf(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ht&1073741824&&(Be(e),e.subtreeFlags&6&&(e.flags|=8192)):Be(e),null;case 24:return null;case 25:return null}throw Error(I(156,e.tag))}function mk(t,e){switch(Tf(e),e.tag){case 1:return dt(e.type)&&ka(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return wi(),le(ct),le(qe),Of(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Lf(e),null;case 13:if(le(fe),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(I(340));yi()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return le(fe),null;case 4:return wi(),null;case 10:return Mf(e.type._context),null;case 22:case 23:return Gf(),null;case 24:return null;default:return null}}var Mo=!1,Ue=!1,vk=typeof WeakSet=="function"?WeakSet:Set,B=null;function Qr(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){_e(t,e,r)}else n.current=null}function Vc(t,e,n){try{n()}catch(r){_e(t,e,r)}}var ug=!1;function yk(t,e){if(Ec=wa,t=Jy(),Cf(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,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(a=o+i),d!==s||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===n&&++u===i&&(a=o),f===s&&++c===r&&(l=o),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(kc={focusedElem:t,selectionRange:n},wa=!1,B=e;B!==null;)if(e=B,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,B=t;else for(;B!==null;){e=B;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var m=y.memoizedProps,_=y.memoizedState,p=e.stateNode,g=p.getSnapshotBeforeUpdate(e.elementType===e.type?m:Ot(e.type,m),_);p.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var v=e.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(w){_e(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,B=t;break}B=e.return}return y=ug,ug=!1,y}function Ss(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 s=i.destroy;i.destroy=void 0,s!==void 0&&Vc(e,n,s)}i=i.next}while(i!==r)}}function wl(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 Bc(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 Y0(t){var e=t.alternate;e!==null&&(t.alternate=null,Y0(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Zt],delete e[Us],delete e[Tc],delete e[ek],delete e[tk])),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 X0(t){return t.tag===5||t.tag===3||t.tag===4}function cg(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||X0(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 zc(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=Ea));else if(r!==4&&(t=t.child,t!==null))for(zc(t,e,n),t=t.sibling;t!==null;)zc(t,e,n),t=t.sibling}function Uc(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(Uc(t,e,n),t=t.sibling;t!==null;)Uc(t,e,n),t=t.sibling}var De=null,jt=!1;function bn(t,e,n){for(n=n.child;n!==null;)Q0(t,e,n),n=n.sibling}function Q0(t,e,n){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(fl,n)}catch{}switch(n.tag){case 5:Ue||Qr(n,e);case 6:var r=De,i=jt;De=null,bn(t,e,n),De=r,jt=i,De!==null&&(jt?(t=De,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):De.removeChild(n.stateNode));break;case 18:De!==null&&(jt?(t=De,n=n.stateNode,t.nodeType===8?cu(t.parentNode,n):t.nodeType===1&&cu(t,n),Fs(t)):cu(De,n.stateNode));break;case 4:r=De,i=jt,De=n.stateNode.containerInfo,jt=!0,bn(t,e,n),De=r,jt=i;break;case 0:case 11:case 14:case 15:if(!Ue&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Vc(n,e,o),i=i.next}while(i!==r)}bn(t,e,n);break;case 1:if(!Ue&&(Qr(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){_e(n,e,a)}bn(t,e,n);break;case 21:bn(t,e,n);break;case 22:n.mode&1?(Ue=(r=Ue)||n.memoizedState!==null,bn(t,e,n),Ue=r):bn(t,e,n);break;default:bn(t,e,n)}}function dg(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new vk),e.forEach(function(r){var i=Tk.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Dt(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:De=a.stateNode,jt=!1;break e;case 3:De=a.stateNode.containerInfo,jt=!0;break e;case 4:De=a.stateNode.containerInfo,jt=!0;break e}a=a.return}if(De===null)throw Error(I(160));Q0(s,o,i),De=null,jt=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){_e(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Z0(e,t),e=e.sibling}function Z0(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Dt(e,t),qt(t),r&4){try{Ss(3,t,t.return),wl(3,t)}catch(m){_e(t,t.return,m)}try{Ss(5,t,t.return)}catch(m){_e(t,t.return,m)}}break;case 1:Dt(e,t),qt(t),r&512&&n!==null&&Qr(n,n.return);break;case 5:if(Dt(e,t),qt(t),r&512&&n!==null&&Qr(n,n.return),t.flags&32){var i=t.stateNode;try{Ds(i,"")}catch(m){_e(t,t.return,m)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=n!==null?n.memoizedProps:s,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&wy(i,s),hc(a,o);var u=hc(a,s);for(o=0;o<l.length;o+=2){var c=l[o],d=l[o+1];c==="style"?Cy(i,d):c==="dangerouslySetInnerHTML"?Ey(i,d):c==="children"?Ds(i,d):ff(i,c,d,u)}switch(a){case"input":lc(i,s);break;case"textarea":xy(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?ai(i,!!s.multiple,h,!1):f!==!!s.multiple&&(s.defaultValue!=null?ai(i,!!s.multiple,s.defaultValue,!0):ai(i,!!s.multiple,s.multiple?[]:"",!1))}i[Us]=s}catch(m){_e(t,t.return,m)}}break;case 6:if(Dt(e,t),qt(t),r&4){if(t.stateNode===null)throw Error(I(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(m){_e(t,t.return,m)}}break;case 3:if(Dt(e,t),qt(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fs(e.containerInfo)}catch(m){_e(t,t.return,m)}break;case 4:Dt(e,t),qt(t);break;case 13:Dt(e,t),qt(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Wf=ke())),r&4&&dg(t);break;case 22:if(c=n!==null&&n.memoizedState!==null,t.mode&1?(Ue=(u=Ue)||c,Dt(e,t),Ue=u):Dt(e,t),qt(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(B=t,c=t.child;c!==null;){for(d=B=c;B!==null;){switch(f=B,h=f.child,f.tag){case 0:case 11:case 14:case 15:Ss(4,f,f.return);break;case 1:Qr(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){r=f,n=f.return;try{e=r,y.props=e.memoizedProps,y.state=e.memoizedState,y.componentWillUnmount()}catch(m){_e(r,n,m)}}break;case 5:Qr(f,f.return);break;case 22:if(f.memoizedState!==null){hg(d);continue}}h!==null?(h.return=f,B=h):hg(d)}c=c.sibling}e:for(c=null,d=t;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=ky("display",o))}catch(m){_e(t,t.return,m)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(m){_e(t,t.return,m)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Dt(e,t),qt(t),r&4&&dg(t);break;case 21:break;default:Dt(e,t),qt(t)}}function qt(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(X0(n)){var r=n;break e}n=n.return}throw Error(I(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ds(i,""),r.flags&=-33);var s=cg(t);Uc(t,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=cg(t);zc(t,a,o);break;default:throw Error(I(161))}}catch(l){_e(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function _k(t,e,n){B=t,J0(t)}function J0(t,e,n){for(var r=(t.mode&1)!==0;B!==null;){var i=B,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Mo;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Ue;a=Mo;var u=Ue;if(Mo=o,(Ue=l)&&!u)for(B=i;B!==null;)o=B,l=o.child,o.tag===22&&o.memoizedState!==null?pg(i):l!==null?(l.return=o,B=l):pg(i);for(;s!==null;)B=s,J0(s),s=s.sibling;B=i,Mo=a,Ue=u}fg(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,B=s):fg(t)}}function fg(t){for(;B!==null;){var e=B;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Ue||wl(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Ue)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:Ot(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&Xp(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}Xp(e,o,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 u=e.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Fs(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(I(163))}Ue||e.flags&512&&Bc(e)}catch(f){_e(e,e.return,f)}}if(e===t){B=null;break}if(n=e.sibling,n!==null){n.return=e.return,B=n;break}B=e.return}}function hg(t){for(;B!==null;){var e=B;if(e===t){B=null;break}var n=e.sibling;if(n!==null){n.return=e.return,B=n;break}B=e.return}}function pg(t){for(;B!==null;){var e=B;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{wl(4,e)}catch(l){_e(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){_e(e,i,l)}}var s=e.return;try{Bc(e)}catch(l){_e(e,s,l)}break;case 5:var o=e.return;try{Bc(e)}catch(l){_e(e,o,l)}}}catch(l){_e(e,e.return,l)}if(e===t){B=null;break}var a=e.sibling;if(a!==null){a.return=e.return,B=a;break}B=e.return}}var wk=Math.ceil,Da=Cn.ReactCurrentDispatcher,Uf=Cn.ReactCurrentOwner,Tt=Cn.ReactCurrentBatchConfig,Z=0,Ne=null,Pe=null,$e=0,ht=0,Zr=nr(0),Ae=0,Ys=null,Tr=0,xl=0,Hf=0,Es=null,it=null,Wf=0,Si=1/0,un=null,La=!1,Hc=null,Wn=null,Io=!1,Fn=null,Oa=0,ks=0,Wc=null,sa=-1,oa=0;function Je(){return Z&6?ke():sa!==-1?sa:sa=ke()}function Kn(t){return t.mode&1?Z&2&&$e!==0?$e&-$e:rk.transition!==null?(oa===0&&(oa=$y()),oa):(t=te,t!==0||(t=window.event,t=t===void 0?16:Hy(t.type)),t):1}function Ut(t,e,n,r){if(50<ks)throw ks=0,Wc=null,Error(I(185));ao(t,n,r),(!(Z&2)||t!==Ne)&&(t===Ne&&(!(Z&2)&&(xl|=n),Ae===4&&On(t,$e)),ft(t,r),n===1&&Z===0&&!(e.mode&1)&&(Si=ke()+500,vl&&rr()))}function ft(t,e){var n=t.callbackNode;rE(t,e);var r=_a(t,t===Ne?$e:0);if(r===0)n!==null&&Ep(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&Ep(n),e===1)t.tag===0?nk(gg.bind(null,t)):u0(gg.bind(null,t)),ZE(function(){!(Z&6)&&rr()}),n=null;else{switch(Fy(r)){case 1:n=vf;break;case 4:n=Ly;break;case 16:n=ya;break;case 536870912:n=Oy;break;default:n=ya}n=a_(n,e_.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function e_(t,e){if(sa=-1,oa=0,Z&6)throw Error(I(327));var n=t.callbackNode;if(fi()&&t.callbackNode!==n)return null;var r=_a(t,t===Ne?$e:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=$a(t,r);else{e=r;var i=Z;Z|=2;var s=n_();(Ne!==t||$e!==e)&&(un=null,Si=ke()+500,wr(t,e));do try{Ek();break}catch(a){t_(t,a)}while(!0);Rf(),Da.current=s,Z=i,Pe!==null?e=0:(Ne=null,$e=0,e=Ae)}if(e!==0){if(e===2&&(i=yc(t),i!==0&&(r=i,e=Kc(t,i))),e===1)throw n=Ys,wr(t,0),On(t,r),ft(t,ke()),n;if(e===6)On(t,r);else{if(i=t.current.alternate,!(r&30)&&!xk(i)&&(e=$a(t,r),e===2&&(s=yc(t),s!==0&&(r=s,e=Kc(t,s))),e===1))throw n=Ys,wr(t,0),On(t,r),ft(t,ke()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(I(345));case 2:dr(t,it,un);break;case 3:if(On(t,r),(r&130023424)===r&&(e=Wf+500-ke(),10<e)){if(_a(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){Je(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Pc(dr.bind(null,t,it,un),e);break}dr(t,it,un);break;case 4:if(On(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var o=31-zt(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=ke()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*wk(r/1960))-r,10<r){t.timeoutHandle=Pc(dr.bind(null,t,it,un),r);break}dr(t,it,un);break;case 5:dr(t,it,un);break;default:throw Error(I(329))}}}return ft(t,ke()),t.callbackNode===n?e_.bind(null,t):null}function Kc(t,e){var n=Es;return t.current.memoizedState.isDehydrated&&(wr(t,e).flags|=256),t=$a(t,e),t!==2&&(e=it,it=n,e!==null&&Gc(e)),t}function Gc(t){it===null?it=t:it.push.apply(it,t)}function xk(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],s=i.getSnapshot;i=i.value;try{if(!Ht(s(),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 On(t,e){for(e&=~Hf,e&=~xl,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-zt(e),r=1<<n;t[n]=-1,e&=~r}}function gg(t){if(Z&6)throw Error(I(327));fi();var e=_a(t,0);if(!(e&1))return ft(t,ke()),null;var n=$a(t,e);if(t.tag!==0&&n===2){var r=yc(t);r!==0&&(e=r,n=Kc(t,r))}if(n===1)throw n=Ys,wr(t,0),On(t,e),ft(t,ke()),n;if(n===6)throw Error(I(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,dr(t,it,un),ft(t,ke()),null}function Kf(t,e){var n=Z;Z|=1;try{return t(e)}finally{Z=n,Z===0&&(Si=ke()+500,vl&&rr())}}function br(t){Fn!==null&&Fn.tag===0&&!(Z&6)&&fi();var e=Z;Z|=1;var n=Tt.transition,r=te;try{if(Tt.transition=null,te=1,t)return t()}finally{te=r,Tt.transition=n,Z=e,!(Z&6)&&rr()}}function Gf(){ht=Zr.current,le(Zr)}function wr(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,QE(n)),Pe!==null)for(n=Pe.return;n!==null;){var r=n;switch(Tf(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ka();break;case 3:wi(),le(ct),le(qe),Of();break;case 5:Lf(r);break;case 4:wi();break;case 13:le(fe);break;case 19:le(fe);break;case 10:Mf(r.type._context);break;case 22:case 23:Gf()}n=n.return}if(Ne=t,Pe=t=Gn(t.current,null),$e=ht=e,Ae=0,Ys=null,Hf=xl=Tr=0,it=Es=null,mr!==null){for(e=0;e<mr.length;e++)if(n=mr[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}mr=null}return t}function t_(t,e){do{var n=Pe;try{if(Rf(),na.current=Na,Ia){for(var r=ge.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ia=!1}if(Pr=0,Ie=Te=ge=null,xs=!1,Ks=0,Uf.current=null,n===null||n.return===null){Ae=1,Ys=e,Pe=null;break}e:{var s=t,o=n.return,a=n,l=e;if(e=$e,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=ng(o);if(h!==null){h.flags&=-257,rg(h,o,a,s,e),h.mode&1&&tg(s,u,e),e=h,l=u;var y=e.updateQueue;if(y===null){var m=new Set;m.add(l),e.updateQueue=m}else y.add(l);break e}else{if(!(e&1)){tg(s,u,e),qf();break e}l=Error(I(426))}}else if(ce&&a.mode&1){var _=ng(o);if(_!==null){!(_.flags&65536)&&(_.flags|=256),rg(_,o,a,s,e),bf(xi(l,a));break e}}s=l=xi(l,a),Ae!==4&&(Ae=2),Es===null?Es=[s]:Es.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var p=F0(s,l,e);Yp(s,p);break e;case 1:a=l;var g=s.type,v=s.stateNode;if(!(s.flags&128)&&(typeof g.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Wn===null||!Wn.has(v)))){s.flags|=65536,e&=-e,s.lanes|=e;var w=j0(s,a,e);Yp(s,w);break e}}s=s.return}while(s!==null)}i_(n)}catch(E){e=E,Pe===n&&n!==null&&(Pe=n=n.return);continue}break}while(!0)}function n_(){var t=Da.current;return Da.current=Na,t===null?Na:t}function qf(){(Ae===0||Ae===3||Ae===2)&&(Ae=4),Ne===null||!(Tr&268435455)&&!(xl&268435455)||On(Ne,$e)}function $a(t,e){var n=Z;Z|=2;var r=n_();(Ne!==t||$e!==e)&&(un=null,wr(t,e));do try{Sk();break}catch(i){t_(t,i)}while(!0);if(Rf(),Z=n,Da.current=r,Pe!==null)throw Error(I(261));return Ne=null,$e=0,Ae}function Sk(){for(;Pe!==null;)r_(Pe)}function Ek(){for(;Pe!==null&&!qS();)r_(Pe)}function r_(t){var e=o_(t.alternate,t,ht);t.memoizedProps=t.pendingProps,e===null?i_(t):Pe=e,Uf.current=null}function i_(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=mk(n,e),n!==null){n.flags&=32767,Pe=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ae=6,Pe=null;return}}else if(n=gk(n,e,ht),n!==null){Pe=n;return}if(e=e.sibling,e!==null){Pe=e;return}Pe=e=t}while(e!==null);Ae===0&&(Ae=5)}function dr(t,e,n){var r=te,i=Tt.transition;try{Tt.transition=null,te=1,kk(t,e,n,r)}finally{Tt.transition=i,te=r}return null}function kk(t,e,n,r){do fi();while(Fn!==null);if(Z&6)throw Error(I(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(I(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(iE(t,s),t===Ne&&(Pe=Ne=null,$e=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Io||(Io=!0,a_(ya,function(){return fi(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Tt.transition,Tt.transition=null;var o=te;te=1;var a=Z;Z|=4,Uf.current=null,yk(t,n),Z0(n,t),HE(kc),wa=!!Ec,kc=Ec=null,t.current=n,_k(n),YS(),Z=a,te=o,Tt.transition=s}else t.current=n;if(Io&&(Io=!1,Fn=t,Oa=i),s=t.pendingLanes,s===0&&(Wn=null),ZS(n.stateNode),ft(t,ke()),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(La)throw La=!1,t=Hc,Hc=null,t;return Oa&1&&t.tag!==0&&fi(),s=t.pendingLanes,s&1?t===Wc?ks++:(ks=0,Wc=t):ks=0,rr(),null}function fi(){if(Fn!==null){var t=Fy(Oa),e=Tt.transition,n=te;try{if(Tt.transition=null,te=16>t?16:t,Fn===null)var r=!1;else{if(t=Fn,Fn=null,Oa=0,Z&6)throw Error(I(331));var i=Z;for(Z|=4,B=t.current;B!==null;){var s=B,o=s.child;if(B.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(B=u;B!==null;){var c=B;switch(c.tag){case 0:case 11:case 15:Ss(8,c,s)}var d=c.child;if(d!==null)d.return=c,B=d;else for(;B!==null;){c=B;var f=c.sibling,h=c.return;if(Y0(c),c===u){B=null;break}if(f!==null){f.return=h,B=f;break}B=h}}}var y=s.alternate;if(y!==null){var m=y.child;if(m!==null){y.child=null;do{var _=m.sibling;m.sibling=null,m=_}while(m!==null)}}B=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,B=o;else e:for(;B!==null;){if(s=B,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Ss(9,s,s.return)}var p=s.sibling;if(p!==null){p.return=s.return,B=p;break e}B=s.return}}var g=t.current;for(B=g;B!==null;){o=B;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,B=v;else e:for(o=g;B!==null;){if(a=B,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:wl(9,a)}}catch(E){_e(a,a.return,E)}if(a===o){B=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,B=w;break e}B=a.return}}if(Z=i,rr(),en&&typeof en.onPostCommitFiberRoot=="function")try{en.onPostCommitFiberRoot(fl,t)}catch{}r=!0}return r}finally{te=n,Tt.transition=e}}return!1}function mg(t,e,n){e=xi(n,e),e=F0(t,e,1),t=Hn(t,e,1),e=Je(),t!==null&&(ao(t,1,e),ft(t,e))}function _e(t,e,n){if(t.tag===3)mg(t,t,n);else for(;e!==null;){if(e.tag===3){mg(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Wn===null||!Wn.has(r))){t=xi(n,t),t=j0(e,t,1),e=Hn(e,t,1),t=Je(),e!==null&&(ao(e,1,t),ft(e,t));break}}e=e.return}}function Ck(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Je(),t.pingedLanes|=t.suspendedLanes&n,Ne===t&&($e&n)===n&&(Ae===4||Ae===3&&($e&130023424)===$e&&500>ke()-Wf?wr(t,0):Hf|=n),ft(t,e)}function s_(t,e){e===0&&(t.mode&1?(e=So,So<<=1,!(So&130023424)&&(So=4194304)):e=1);var n=Je();t=wn(t,e),t!==null&&(ao(t,e,n),ft(t,n))}function Pk(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),s_(t,n)}function Tk(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(I(314))}r!==null&&r.delete(e),s_(t,n)}var o_;o_=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||ct.current)ot=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return ot=!1,pk(t,e,n);ot=!!(t.flags&131072)}else ot=!1,ce&&e.flags&1048576&&c0(e,Ta,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;ia(t,e),t=e.pendingProps;var i=vi(e,qe.current);di(e,n),i=Ff(null,e,r,t,i,n);var s=jf();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,dt(r)?(s=!0,Ca(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Nf(e),i.updater=_l,e.stateNode=i,i._reactInternals=e,Nc(e,r,t,n),e=Oc(null,e,r,!0,s,n)):(e.tag=0,ce&&s&&Pf(e),Xe(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(ia(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=Ak(r),t=Ot(r,t),i){case 0:e=Lc(null,e,r,t,n);break e;case 1:e=og(null,e,r,t,n);break e;case 11:e=ig(null,e,r,t,n);break e;case 14:e=sg(null,e,r,Ot(r.type,t),n);break e}throw Error(I(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ot(r,i),Lc(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ot(r,i),og(t,e,r,i,n);case 3:e:{if(U0(e),t===null)throw Error(I(387));r=e.pendingProps,s=e.memoizedState,i=s.element,m0(t,e),Ra(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=xi(Error(I(423)),e),e=ag(t,e,r,n,i);break e}else if(r!==i){i=xi(Error(I(424)),e),e=ag(t,e,r,n,i);break e}else for(pt=Un(e.stateNode.containerInfo.firstChild),vt=e,ce=!0,Vt=null,n=p0(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yi(),r===i){e=xn(t,e,n);break e}Xe(t,e,r,n)}e=e.child}return e;case 5:return v0(e),t===null&&Rc(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,Cc(r,i)?o=null:s!==null&&Cc(r,s)&&(e.flags|=32),z0(t,e),Xe(t,e,o,n),e.child;case 6:return t===null&&Rc(e),null;case 13:return H0(t,e,n);case 4:return Df(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=_i(e,null,r,n):Xe(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ot(r,i),ig(t,e,r,i,n);case 7:return Xe(t,e,e.pendingProps,n),e.child;case 8:return Xe(t,e,e.pendingProps.children,n),e.child;case 12:return Xe(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,se(ba,r._currentValue),r._currentValue=o,s!==null)if(Ht(s.value,o)){if(s.children===i.children&&!ct.current){e=xn(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=vn(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Mc(s.return,n,e),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(I(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Mc(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Xe(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,di(e,n),i=It(i),r=r(i),e.flags|=1,Xe(t,e,r,n),e.child;case 14:return r=e.type,i=Ot(r,e.pendingProps),i=Ot(r.type,i),sg(t,e,r,i,n);case 15:return V0(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ot(r,i),ia(t,e),e.tag=1,dt(r)?(t=!0,Ca(e)):t=!1,di(e,n),$0(e,r,i),Nc(e,r,i,n),Oc(null,e,r,!0,t,n);case 19:return W0(t,e,n);case 22:return B0(t,e,n)}throw Error(I(156,e.tag))};function a_(t,e){return Dy(t,e)}function bk(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 Ct(t,e,n,r){return new bk(t,e,n,r)}function Yf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ak(t){if(typeof t=="function")return Yf(t)?1:0;if(t!=null){if(t=t.$$typeof,t===pf)return 11;if(t===gf)return 14}return 2}function Gn(t,e){var n=t.alternate;return n===null?(n=Ct(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 aa(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")Yf(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case zr:return xr(n.children,i,s,e);case hf:o=8,i|=8;break;case rc:return t=Ct(12,n,e,i|2),t.elementType=rc,t.lanes=s,t;case ic:return t=Ct(13,n,e,i),t.elementType=ic,t.lanes=s,t;case sc:return t=Ct(19,n,e,i),t.elementType=sc,t.lanes=s,t;case vy:return Sl(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case gy:o=10;break e;case my:o=9;break e;case pf:o=11;break e;case gf:o=14;break e;case Nn:o=16,r=null;break e}throw Error(I(130,t==null?t:typeof t,""))}return e=Ct(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function xr(t,e,n,r){return t=Ct(7,t,r,e),t.lanes=n,t}function Sl(t,e,n,r){return t=Ct(22,t,r,e),t.elementType=vy,t.lanes=n,t.stateNode={isHidden:!1},t}function yu(t,e,n){return t=Ct(6,t,null,e),t.lanes=n,t}function _u(t,e,n){return e=Ct(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Rk(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=Jl(0),this.expirationTimes=Jl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jl(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Xf(t,e,n,r,i,s,o,a,l){return t=new Rk(t,e,n,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ct(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Nf(s),t}function Mk(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Br,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function l_(t){if(!t)return Qn;t=t._reactInternals;e:{if(Lr(t)!==t||t.tag!==1)throw Error(I(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(dt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(I(171))}if(t.tag===1){var n=t.type;if(dt(n))return l0(t,n,e)}return e}function u_(t,e,n,r,i,s,o,a,l){return t=Xf(n,r,!0,t,i,s,o,a,l),t.context=l_(null),n=t.current,r=Je(),i=Kn(n),s=vn(r,i),s.callback=e??null,Hn(n,s,i),t.current.lanes=i,ao(t,i,r),ft(t,r),t}function El(t,e,n,r){var i=e.current,s=Je(),o=Kn(i);return n=l_(n),e.context===null?e.context=n:e.pendingContext=n,e=vn(s,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Hn(i,e,o),t!==null&&(Ut(t,i,o,s),ta(t,i,o)),o}function Fa(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 vg(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Qf(t,e){vg(t,e),(t=t.alternate)&&vg(t,e)}function Ik(){return null}var c_=typeof reportError=="function"?reportError:function(t){console.error(t)};function Zf(t){this._internalRoot=t}kl.prototype.render=Zf.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(I(409));El(t,e,null,null)};kl.prototype.unmount=Zf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;br(function(){El(null,t,null,null)}),e[_n]=null}};function kl(t){this._internalRoot=t}kl.prototype.unstable_scheduleHydration=function(t){if(t){var e=By();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Ln.length&&e!==0&&e<Ln[n].priority;n++);Ln.splice(n,0,t),n===0&&Uy(t)}};function Jf(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Cl(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function yg(){}function Nk(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=Fa(o);s.call(u)}}var o=u_(e,r,t,0,null,!1,!1,"",yg);return t._reactRootContainer=o,t[_n]=o.current,Bs(t.nodeType===8?t.parentNode:t),br(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=Fa(l);a.call(u)}}var l=Xf(t,0,!1,null,null,!1,!1,"",yg);return t._reactRootContainer=l,t[_n]=l.current,Bs(t.nodeType===8?t.parentNode:t),br(function(){El(e,l,n,r)}),l}function Pl(t,e,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Fa(o);a.call(l)}}El(e,o,t,i)}else o=Nk(n,e,t,i,r);return Fa(o)}jy=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=is(e.pendingLanes);n!==0&&(yf(e,n|1),ft(e,ke()),!(Z&6)&&(Si=ke()+500,rr()))}break;case 13:br(function(){var r=wn(t,1);if(r!==null){var i=Je();Ut(r,t,1,i)}}),Qf(t,1)}};_f=function(t){if(t.tag===13){var e=wn(t,134217728);if(e!==null){var n=Je();Ut(e,t,134217728,n)}Qf(t,134217728)}};Vy=function(t){if(t.tag===13){var e=Kn(t),n=wn(t,e);if(n!==null){var r=Je();Ut(n,t,e,r)}Qf(t,e)}};By=function(){return te};zy=function(t,e){var n=te;try{return te=t,e()}finally{te=n}};gc=function(t,e,n){switch(e){case"input":if(lc(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=ml(r);if(!i)throw Error(I(90));_y(r),lc(r,i)}}}break;case"textarea":xy(t,n);break;case"select":e=n.value,e!=null&&ai(t,!!n.multiple,e,!1)}};by=Kf;Ay=br;var Dk={usingClientEntryPoint:!1,Events:[uo,Kr,ml,Py,Ty,Kf]},Wi={findFiberByHostInstance:gr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Lk={bundleType:Wi.bundleType,version:Wi.version,rendererPackageName:Wi.rendererPackageName,rendererConfig:Wi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Cn.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Iy(t),t===null?null:t.stateNode},findFiberByHostInstance:Wi.findFiberByHostInstance||Ik,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var No=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!No.isDisabled&&No.supportsFiber)try{fl=No.inject(Lk),en=No}catch{}}_t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Dk;_t.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jf(e))throw Error(I(200));return Mk(t,e,null,n)};_t.createRoot=function(t,e){if(!Jf(t))throw Error(I(299));var n=!1,r="",i=c_;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Xf(t,1,!1,null,null,n,!1,r,i),t[_n]=e.current,Bs(t.nodeType===8?t.parentNode:t),new Zf(e)};_t.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(I(188)):(t=Object.keys(t).join(","),Error(I(268,t)));return t=Iy(e),t=t===null?null:t.stateNode,t};_t.flushSync=function(t){return br(t)};_t.hydrate=function(t,e,n){if(!Cl(e))throw Error(I(200));return Pl(null,t,e,!0,n)};_t.hydrateRoot=function(t,e,n){if(!Jf(t))throw Error(I(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=c_;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=u_(e,null,t,1,n??null,i,!1,s,o),t[_n]=e.current,Bs(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 kl(e)};_t.render=function(t,e,n){if(!Cl(e))throw Error(I(200));return Pl(null,t,e,!1,n)};_t.unmountComponentAtNode=function(t){if(!Cl(t))throw Error(I(40));return t._reactRootContainer?(br(function(){Pl(null,null,t,!1,function(){t._reactRootContainer=null,t[_n]=null})}),!0):!1};_t.unstable_batchedUpdates=Kf;_t.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Cl(n))throw Error(I(200));if(t==null||t._reactInternals===void 0)throw Error(I(38));return Pl(t,e,n,!1,r)};_t.version="18.3.1-next-f1338f8080-20240426";function d_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(d_)}catch(t){console.error(t)}}d_(),dy.exports=_t;var Tl=dy.exports;const Ok=sf(Tl);var _g=Tl;tc.createRoot=_g.createRoot,tc.hydrateRoot=_g.hydrateRoot;const f_=x.createContext({});function $k(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const eh=typeof window<"u",Fk=eh?x.useLayoutEffect:x.useEffect,th=x.createContext(null);function nh(t,e){t.indexOf(e)===-1&&t.push(e)}function rh(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Sn=(t,e,n)=>n>e?e:n<t?t:n;let ih=()=>{};const En={},h_=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function p_(t){return typeof t=="object"&&t!==null}const g_=t=>/^0[^.\s]+$/u.test(t);function sh(t){let e;return()=>(e===void 0&&(e=t()),e)}const bt=t=>t,jk=(t,e)=>n=>e(t(n)),fo=(...t)=>t.reduce(jk),Xs=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class oh{constructor(){this.subscriptions=[]}add(e){return nh(this.subscriptions,e),()=>rh(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const nn=t=>t*1e3,Pt=t=>t/1e3;function m_(t,e){return e?t*(1e3/e):0}const v_=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Vk=1e-7,Bk=12;function zk(t,e,n,r,i){let s,o,a=0;do o=e+(n-e)/2,s=v_(o,r,i)-t,s>0?n=o:e=o;while(Math.abs(s)>Vk&&++a<Bk);return o}function ho(t,e,n,r){if(t===e&&n===r)return bt;const i=s=>zk(s,0,1,t,n);return s=>s===0||s===1?s:v_(i(s),e,r)}const y_=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,__=t=>e=>1-t(1-e),w_=ho(.33,1.53,.69,.99),ah=__(w_),x_=y_(ah),S_=t=>(t*=2)<1?.5*ah(t):.5*(2-Math.pow(2,-10*(t-1))),lh=t=>1-Math.sin(Math.acos(t)),E_=__(lh),k_=y_(lh),Uk=ho(.42,0,1,1),Hk=ho(0,0,.58,1),C_=ho(.42,0,.58,1),Wk=t=>Array.isArray(t)&&typeof t[0]!="number",P_=t=>Array.isArray(t)&&typeof t[0]=="number",Kk={linear:bt,easeIn:Uk,easeInOut:C_,easeOut:Hk,circIn:lh,circInOut:k_,circOut:E_,backIn:ah,backInOut:x_,backOut:w_,anticipate:S_},Gk=t=>typeof t=="string",wg=t=>{if(P_(t)){ih(t.length===4);const[e,n,r,i]=t;return ho(e,n,r,i)}else if(Gk(t))return Kk[t];return t},Do=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function qk(t,e){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){o.has(c)&&(u.schedule(c),t()),c(a)}const u={schedule:(c,d=!1,f=!1)=>{const y=f&&i?n:r;return d&&o.add(c),y.has(c)||y.add(c),c},cancel:c=>{r.delete(c),o.delete(c)},process:c=>{if(a=c,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),n.clear(),i=!1,s&&(s=!1,u.process(c))}};return u}const Yk=40;function T_(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Do.reduce((v,w)=>(v[w]=qk(s),v),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:f,render:h,postRender:y}=o,m=()=>{const v=En.useManualTiming?i.timestamp:performance.now();n=!1,En.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(v-i.timestamp,Yk),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),h.process(i),y.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(m))},_=()=>{n=!0,r=!0,i.isProcessing||t(m)};return{schedule:Do.reduce((v,w)=>{const E=o[w];return v[w]=(A,b=!1,S=!1)=>(n||_(),E.schedule(A,b,S)),v},{}),cancel:v=>{for(let w=0;w<Do.length;w++)o[Do[w]].cancel(v)},state:i,steps:o}}const{schedule:de,cancel:Zn,state:Le,steps:wu}=T_(typeof requestAnimationFrame<"u"?requestAnimationFrame:bt,!0);let la;function Xk(){la=void 0}const at={now:()=>(la===void 0&&at.set(Le.isProcessing||En.useManualTiming?Le.timestamp:performance.now()),la),set:t=>{la=t,queueMicrotask(Xk)}},b_=t=>e=>typeof e=="string"&&e.startsWith(t),uh=b_("--"),Qk=b_("var(--"),ch=t=>Qk(t)?Zk.test(t.split("/*")[0].trim()):!1,Zk=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Li={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Qs={...Li,transform:t=>Sn(0,1,t)},Lo={...Li,default:1},Cs=t=>Math.round(t*1e5)/1e5,dh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Jk(t){return t==null}const eC=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,fh=(t,e)=>n=>!!(typeof n=="string"&&eC.test(n)&&n.startsWith(t)||e&&!Jk(n)&&Object.prototype.hasOwnProperty.call(n,e)),A_=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(dh);return{[t]:parseFloat(i),[e]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},tC=t=>Sn(0,255,t),xu={...Li,transform:t=>Math.round(tC(t))},yr={test:fh("rgb","red"),parse:A_("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+xu.transform(t)+", "+xu.transform(e)+", "+xu.transform(n)+", "+Cs(Qs.transform(r))+")"};function nC(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const qc={test:fh("#"),parse:nC,transform:yr.transform},po=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Mn=po("deg"),rn=po("%"),W=po("px"),rC=po("vh"),iC=po("vw"),xg={...rn,parse:t=>rn.parse(t)/100,transform:t=>rn.transform(t*100)},Jr={test:fh("hsl","hue"),parse:A_("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+rn.transform(Cs(e))+", "+rn.transform(Cs(n))+", "+Cs(Qs.transform(r))+")"},Ce={test:t=>yr.test(t)||qc.test(t)||Jr.test(t),parse:t=>yr.test(t)?yr.parse(t):Jr.test(t)?Jr.parse(t):qc.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?yr.transform(t):Jr.transform(t),getAnimatableNone:t=>{const e=Ce.parse(t);return e.alpha=0,Ce.transform(e)}},sC=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function oC(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(dh))==null?void 0:e.length)||0)+(((n=t.match(sC))==null?void 0:n.length)||0)>0}const R_="number",M_="color",aC="var",lC="var(",Sg="${}",uC=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Zs(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace(uC,l=>(Ce.test(l)?(r.color.push(s),i.push(M_),n.push(Ce.parse(l))):l.startsWith(lC)?(r.var.push(s),i.push(aC),n.push(l)):(r.number.push(s),i.push(R_),n.push(parseFloat(l))),++s,Sg)).split(Sg);return{values:n,split:a,indexes:r,types:i}}function I_(t){return Zs(t).values}function N_(t){const{split:e,types:n}=Zs(t),r=e.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=e[o],i[o]!==void 0){const a=n[o];a===R_?s+=Cs(i[o]):a===M_?s+=Ce.transform(i[o]):s+=i[o]}return s}}const cC=t=>typeof t=="number"?0:Ce.test(t)?Ce.getAnimatableNone(t):t;function dC(t){const e=I_(t);return N_(t)(e.map(cC))}const Jn={test:oC,parse:I_,createTransformer:N_,getAnimatableNone:dC};function Su(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function fC({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,s=0,o=0;if(!e)i=s=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=Su(l,a,t+1/3),s=Su(l,a,t),o=Su(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function ja(t,e){return n=>n>0?e:t}const he=(t,e,n)=>t+(e-t)*n,Eu=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},hC=[qc,yr,Jr],pC=t=>hC.find(e=>e.test(t));function Eg(t){const e=pC(t);if(!e)return!1;let n=e.parse(t);return e===Jr&&(n=fC(n)),n}const kg=(t,e)=>{const n=Eg(t),r=Eg(e);if(!n||!r)return ja(t,e);const i={...n};return s=>(i.red=Eu(n.red,r.red,s),i.green=Eu(n.green,r.green,s),i.blue=Eu(n.blue,r.blue,s),i.alpha=he(n.alpha,r.alpha,s),yr.transform(i))},Yc=new Set(["none","hidden"]);function gC(t,e){return Yc.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function mC(t,e){return n=>he(t,e,n)}function hh(t){return typeof t=="number"?mC:typeof t=="string"?ch(t)?ja:Ce.test(t)?kg:_C:Array.isArray(t)?D_:typeof t=="object"?Ce.test(t)?kg:vC:ja}function D_(t,e){const n=[...t],r=n.length,i=t.map((s,o)=>hh(s)(s,e[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function vC(t,e){const n={...t,...e},r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=hh(t[i])(t[i],e[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function yC(t,e){const n=[],r={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const s=e.types[i],o=t.indexes[s][r[s]],a=t.values[o]??0;n[i]=a,r[s]++}return n}const _C=(t,e)=>{const n=Jn.createTransformer(e),r=Zs(t),i=Zs(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Yc.has(t)&&!i.values.length||Yc.has(e)&&!r.values.length?gC(t,e):fo(D_(yC(r,i),i.values),n):ja(t,e)};function L_(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?he(t,e,n):hh(t)(t,e)}const wC=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>de.update(e,n),stop:()=>Zn(e),now:()=>Le.isProcessing?Le.timestamp:at.now()}},O_=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=Math.round(t(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Va=2e4;function ph(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Va;)e+=n,r=t.next(e);return e>=Va?1/0:e}function xC(t,e=100,n){const r=n({...t,keyframes:[0,e]}),i=Math.min(ph(r),Va);return{type:"keyframes",ease:s=>r.next(i*s).value/e,duration:Pt(i)}}const SC=5;function $_(t,e,n){const r=Math.max(e-SC,0);return m_(n-t(r),e-r)}const ye={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},ku=.001;function EC({duration:t=ye.duration,bounce:e=ye.bounce,velocity:n=ye.velocity,mass:r=ye.mass}){let i,s,o=1-e;o=Sn(ye.minDamping,ye.maxDamping,o),t=Sn(ye.minDuration,ye.maxDuration,Pt(t)),o<1?(i=u=>{const c=u*o,d=c*t,f=c-n,h=Xc(u,o),y=Math.exp(-d);return ku-f/h*y},s=u=>{const d=u*o*t,f=d*n+n,h=Math.pow(o,2)*Math.pow(u,2)*t,y=Math.exp(-d),m=Xc(Math.pow(u,2),o);return(-i(u)+ku>0?-1:1)*((f-h)*y)/m}):(i=u=>{const c=Math.exp(-u*t),d=(u-n)*t+1;return-ku+c*d},s=u=>{const c=Math.exp(-u*t),d=(n-u)*(t*t);return c*d});const a=5/t,l=CC(i,s,a);if(t=nn(t),isNaN(l))return{stiffness:ye.stiffness,damping:ye.damping,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:t}}}const kC=12;function CC(t,e,n){let r=n;for(let i=1;i<kC;i++)r=r-t(r)/e(r);return r}function Xc(t,e){return t*Math.sqrt(1-e*e)}const PC=["duration","bounce"],TC=["stiffness","damping","mass"];function Cg(t,e){return e.some(n=>t[n]!==void 0)}function bC(t){let e={velocity:ye.velocity,stiffness:ye.stiffness,damping:ye.damping,mass:ye.mass,isResolvedFromDuration:!1,...t};if(!Cg(t,TC)&&Cg(t,PC))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Sn(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:ye.mass,stiffness:i,damping:s}}else{const n=EC(t);e={...e,...n,mass:ye.mass},e.isResolvedFromDuration=!0}return e}function Ba(t=ye.visualDuration,e=ye.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:h}=bC({...n,velocity:-Pt(n.velocity||0)}),y=f||0,m=u/(2*Math.sqrt(l*c)),_=o-s,p=Pt(Math.sqrt(l/c)),g=Math.abs(_)<5;r||(r=g?ye.restSpeed.granular:ye.restSpeed.default),i||(i=g?ye.restDelta.granular:ye.restDelta.default);let v;if(m<1){const E=Xc(p,m);v=A=>{const b=Math.exp(-m*p*A);return o-b*((y+m*p*_)/E*Math.sin(E*A)+_*Math.cos(E*A))}}else if(m===1)v=E=>o-Math.exp(-p*E)*(_+(y+p*_)*E);else{const E=p*Math.sqrt(m*m-1);v=A=>{const b=Math.exp(-m*p*A),S=Math.min(E*A,300);return o-b*((y+m*p*_)*Math.sinh(S)+E*_*Math.cosh(S))/E}}const w={calculatedDuration:h&&d||null,next:E=>{const A=v(E);if(h)a.done=E>=d;else{let b=E===0?y:0;m<1&&(b=E===0?nn(y):$_(v,E,A));const S=Math.abs(b)<=r,k=Math.abs(o-A)<=i;a.done=S&&k}return a.value=a.done?o:A,a},toString:()=>{const E=Math.min(ph(w),Va),A=O_(b=>w.next(E*b).value,E,30);return E+"ms "+A},toTransition:()=>{}};return w}Ba.applyToOptions=t=>{const e=xC(t,100,Ba);return t.ease=e.ease,t.duration=nn(e.duration),t.type="keyframes",t};function Qc({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=t[0],f={done:!1,value:d},h=S=>a!==void 0&&S<a||l!==void 0&&S>l,y=S=>a===void 0?l:l===void 0||Math.abs(a-S)<Math.abs(l-S)?a:l;let m=n*e;const _=d+m,p=o===void 0?_:o(_);p!==_&&(m=p-d);const g=S=>-m*Math.exp(-S/r),v=S=>p+g(S),w=S=>{const k=g(S),P=v(S);f.done=Math.abs(k)<=u,f.value=f.done?p:P};let E,A;const b=S=>{h(f.value)&&(E=S,A=Ba({keyframes:[f.value,y(f.value)],velocity:$_(v,S,f.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return b(0),{calculatedDuration:null,next:S=>{let k=!1;return!A&&E===void 0&&(k=!0,w(S),b(S)),E!==void 0&&S>=E?A.next(S-E):(!k&&w(S),f)}}}function AC(t,e,n){const r=[],i=n||En.mix||L_,s=t.length-1;for(let o=0;o<s;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||bt:e;a=fo(l,a)}r.push(a)}return r}function RC(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const s=t.length;if(ih(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=AC(e,r,i),l=a.length,u=c=>{if(o&&c<t[0])return e[0];let d=0;if(l>1)for(;d<t.length-2&&!(c<t[d+1]);d++);const f=Xs(t[d],t[d+1],c);return a[d](f)};return n?c=>u(Sn(t[0],t[s-1],c)):u}function MC(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Xs(0,e,r);t.push(he(n,1,i))}}function IC(t){const e=[0];return MC(e,t.length-1),e}function NC(t,e){return t.map(n=>n*e)}function DC(t,e){return t.map(()=>e||C_).splice(0,t.length-1)}function Ps({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=Wk(r)?r.map(wg):wg(r),s={done:!1,value:e[0]},o=NC(n&&n.length===e.length?n:IC(e),t),a=RC(o,e,{ease:Array.isArray(i)?i:DC(e,i)});return{calculatedDuration:t,next:l=>(s.value=a(l),s.done=l>=t,s)}}const LC=t=>t!==null;function gh(t,{repeat:e,repeatType:n="loop"},r,i=1){const s=t.filter(LC),a=i<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const OC={decay:Qc,inertia:Qc,tween:Ps,keyframes:Ps,spring:Ba};function F_(t){typeof t.type=="string"&&(t.type=OC[t.type])}class mh{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const $C=t=>t/100;class vh extends mh{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==at.now()&&this.tick(at.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;F_(e);const{type:n=Ps,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=e;let{keyframes:a}=e;const l=n||Ps;l!==Ps&&typeof a[0]!="number"&&(this.mixKeyframes=fo($C,L_(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ph(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:c,repeat:d,repeatType:f,repeatDelay:h,type:y,onUpdate:m,finalKeyframe:_}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const p=this.currentTime-u*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?p<0:p>i;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,w=r;if(d){const S=Math.min(this.currentTime,i)/a;let k=Math.floor(S),P=S%1;!P&&S>=1&&(P=1),P===1&&k--,k=Math.min(k,d+1),!!(k%2)&&(f==="reverse"?(P=1-P,h&&(P-=h/a)):f==="mirror"&&(w=o)),v=Sn(0,1,P)*a}const E=g?{done:!1,value:c[0]}:w.next(v);s&&(E.value=s(E.value));let{done:A}=E;!g&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const b=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return b&&y!==Qc&&(E.value=gh(c,this.options,_,this.speed)),m&&m(E.value),b&&this.finish(),E}then(e,n){return this.finished.then(e,n)}get duration(){return Pt(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Pt(e)}get time(){return Pt(this.currentTime)}set time(e){var n;e=nn(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(at.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=Pt(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:e=wC,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(at.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function FC(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const _r=t=>t*180/Math.PI,Zc=t=>{const e=_r(Math.atan2(t[1],t[0]));return Jc(e)},jC={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Zc,rotateZ:Zc,skewX:t=>_r(Math.atan(t[1])),skewY:t=>_r(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Jc=t=>(t=t%360,t<0&&(t+=360),t),Pg=Zc,Tg=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),bg=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),VC={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Tg,scaleY:bg,scale:t=>(Tg(t)+bg(t))/2,rotateX:t=>Jc(_r(Math.atan2(t[6],t[5]))),rotateY:t=>Jc(_r(Math.atan2(-t[2],t[0]))),rotateZ:Pg,rotate:Pg,skewX:t=>_r(Math.atan(t[4])),skewY:t=>_r(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ed(t){return t.includes("scale")?1:0}function td(t,e){if(!t||t==="none")return ed(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=VC,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=jC,i=a}if(!i)return ed(e);const s=r[e],o=i[1].split(",").map(zC);return typeof s=="function"?s(o):o[s]}const BC=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return td(n,e)};function zC(t){return parseFloat(t.trim())}const Oi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],$i=new Set(Oi),Ag=t=>t===Li||t===W,UC=new Set(["x","y","z"]),HC=Oi.filter(t=>!UC.has(t));function WC(t){const e=[];return HC.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Sr={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>td(e,"x"),y:(t,{transform:e})=>td(e,"y")};Sr.translateX=Sr.x;Sr.translateY=Sr.y;const Er=new Set;let nd=!1,rd=!1,id=!1;function j_(){if(rd){const t=Array.from(Er).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=WC(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}rd=!1,nd=!1,Er.forEach(t=>t.complete(id)),Er.clear()}function V_(){Er.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(rd=!0)})}function KC(){id=!0,V_(),j_(),id=!1}class yh{constructor(e,n,r,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Er.add(this),nd||(nd=!0,de.read(V_),de.resolveKeyframes(j_))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;if(e[0]===null){const s=i==null?void 0:i.get(),o=e[e.length-1];if(s!==void 0)e[0]=s;else if(r&&n){const a=r.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&s===void 0&&i.set(e[0])}FC(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Er.delete(this)}cancel(){this.state==="scheduled"&&(Er.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const GC=t=>t.startsWith("--");function qC(t,e,n){GC(e)?t.style.setProperty(e,n):t.style[e]=n}const YC=sh(()=>window.ScrollTimeline!==void 0),XC={};function QC(t,e){const n=sh(t);return()=>XC[e]??n()}const B_=QC(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),os=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Rg={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:os([0,.65,.55,1]),circOut:os([.55,0,1,.45]),backIn:os([.31,.01,.66,-.59]),backOut:os([.33,1.53,.69,.99])};function z_(t,e){if(t)return typeof t=="function"?B_()?O_(t,e):"ease-out":P_(t)?os(t):Array.isArray(t)?t.map(n=>z_(n,e)||Rg.easeOut):Rg[t]}function ZC(t,e,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const d=z_(a,i);Array.isArray(d)&&(c.easing=d);const f={delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(c,f)}function U_(t){return typeof t=="function"&&"applyToOptions"in t}function JC({type:t,...e}){return U_(t)&&B_()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class eP extends mh{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=e,ih(typeof e.type!="string");const u=JC(e);this.animation=ZC(n,r,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const c=gh(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):qC(n,r,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,n;this.isPseudoElement||(n=(e=this.animation).commitStyles)==null||n.call(e)}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Pt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Pt(e)}get time(){return Pt(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=nn(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&YC()?(this.animation.timeline=e,bt):n(this)}}const H_={anticipate:S_,backInOut:x_,circInOut:k_};function tP(t){return t in H_}function nP(t){typeof t.ease=="string"&&tP(t.ease)&&(t.ease=H_[t.ease])}const Mg=10;class rP extends eP{constructor(e){nP(e),F_(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new vh({...o,autoplay:!1}),l=nn(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-Mg).value,a.sample(l).value,Mg),a.stop()}}const Ig=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Jn.test(t)||t==="0")&&!t.startsWith("url("));function iP(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function sP(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],o=Ig(i,e),a=Ig(s,e);return!o||!a?!1:iP(t)||(n==="spring"||U_(n))&&r}function sd(t){t.duration=0,t.type="keyframes"}const oP=new Set(["opacity","clipPath","filter","transform"]),aP=sh(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function lP(t){var c;const{motionValue:e,name:n,repeatDelay:r,repeatType:i,damping:s,type:o}=t;if(!(((c=e==null?void 0:e.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return aP()&&n&&oP.has(n)&&(n!=="transform"||!u)&&!l&&!r&&i!=="mirror"&&s!==0&&o!=="inertia"}const uP=40;class cP extends mh{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:l,motionValue:u,element:c,...d}){var y;super(),this.stop=()=>{var m,_;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(_=this.keyframeResolver)==null||_.cancel()},this.createdAt=at.now();const f={autoplay:e,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,name:l,motionValue:u,element:c,...d},h=(c==null?void 0:c.KeyframeResolver)||yh;this.keyframeResolver=new h(a,(m,_,p)=>this.onKeyframesResolved(m,_,f,!p),l,u,c),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(e,n,r,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:c}=r;this.resolvedAt=at.now(),sP(e,s,o,a)||((En.instantAnimations||!l)&&(c==null||c(gh(e,r,n))),e[0]=e[e.length-1],sd(r),r.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>uP?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},h=!u&&lP(f)?new rP({...f,element:f.motionValue.owner.current}):new vh(f);h.finished.then(()=>this.notifyFinished()).catch(bt),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),KC()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const dP=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fP(t){const e=dP.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}function W_(t,e,n=1){const[r,i]=fP(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const o=s.trim();return h_(o)?parseFloat(o):o}return ch(i)?W_(i,e,n+1):i}function _h(t,e){return(t==null?void 0:t[e])??(t==null?void 0:t.default)??t}const K_=new Set(["width","height","top","left","right","bottom",...Oi]),hP={test:t=>t==="auto",parse:t=>t},G_=t=>e=>e.test(t),q_=[Li,W,rn,Mn,iC,rC,hP],Ng=t=>q_.find(G_(t));function pP(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||g_(t):!0}const gP=new Set(["brightness","contrast","saturate","opacity"]);function mP(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(dh)||[];if(!r)return t;const i=n.replace(r,"");let s=gP.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+i+")"}const vP=/\b([a-z-]*)\(.*?\)/gu,od={...Jn,getAnimatableNone:t=>{const e=t.match(vP);return e?e.map(mP).join(" "):t}},Dg={...Li,transform:Math.round},yP={rotate:Mn,rotateX:Mn,rotateY:Mn,rotateZ:Mn,scale:Lo,scaleX:Lo,scaleY:Lo,scaleZ:Lo,skew:Mn,skewX:Mn,skewY:Mn,distance:W,translateX:W,translateY:W,translateZ:W,x:W,y:W,z:W,perspective:W,transformPerspective:W,opacity:Qs,originX:xg,originY:xg,originZ:W},wh={borderWidth:W,borderTopWidth:W,borderRightWidth:W,borderBottomWidth:W,borderLeftWidth:W,borderRadius:W,radius:W,borderTopLeftRadius:W,borderTopRightRadius:W,borderBottomRightRadius:W,borderBottomLeftRadius:W,width:W,maxWidth:W,height:W,maxHeight:W,top:W,right:W,bottom:W,left:W,padding:W,paddingTop:W,paddingRight:W,paddingBottom:W,paddingLeft:W,margin:W,marginTop:W,marginRight:W,marginBottom:W,marginLeft:W,backgroundPositionX:W,backgroundPositionY:W,...yP,zIndex:Dg,fillOpacity:Qs,strokeOpacity:Qs,numOctaves:Dg},_P={...wh,color:Ce,backgroundColor:Ce,outlineColor:Ce,fill:Ce,stroke:Ce,borderColor:Ce,borderTopColor:Ce,borderRightColor:Ce,borderBottomColor:Ce,borderLeftColor:Ce,filter:od,WebkitFilter:od},Y_=t=>_P[t];function X_(t,e){let n=Y_(t);return n!==od&&(n=Jn),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const wP=new Set(["auto","none","0"]);function xP(t,e,n){let r=0,i;for(;r<t.length&&!i;){const s=t[r];typeof s=="string"&&!wP.has(s)&&Zs(s).values.length&&(i=t[r]),r++}if(i&&n)for(const s of e)t[s]=X_(n,i)}class SP extends yh{constructor(e,n,r,i,s){super(e,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),ch(u))){const c=W_(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!K_.has(r)||e.length!==2)return;const[i,s]=e,o=Ng(i),a=Ng(s);if(o!==a)if(Ag(o)&&Ag(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else Sr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)(e[i]===null||pP(e[i]))&&r.push(i);r.length&&xP(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Sr[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=Sr[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function EP(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const i=(n==null?void 0:n[t])??r.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}const Q_=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function kP(t){return p_(t)&&"offsetHeight"in t}const Lg=30,CP=t=>!isNaN(parseFloat(t));class PP{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=at.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=at.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=CP(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new oh);const r=this.events[e].add(n);return e==="change"?()=>{r(),de.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=at.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Lg)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Lg);return m_(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ei(t,e){return new PP(t,e)}const{schedule:xh}=T_(queueMicrotask,!1),Lt={x:!1,y:!1};function Z_(){return Lt.x||Lt.y}function TP(t){return t==="x"||t==="y"?Lt[t]?null:(Lt[t]=!0,()=>{Lt[t]=!1}):Lt.x||Lt.y?null:(Lt.x=Lt.y=!0,()=>{Lt.x=Lt.y=!1})}function J_(t,e){const n=EP(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function Og(t){return!(t.pointerType==="touch"||Z_())}function bP(t,e,n={}){const[r,i,s]=J_(t,n),o=a=>{if(!Og(a))return;const{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;const c=d=>{Og(d)&&(u(d),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const ew=(t,e)=>e?t===e?!0:ew(t,e.parentElement):!1,Sh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,AP=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function RP(t){return AP.has(t.tagName)||t.tabIndex!==-1}const ua=new WeakSet;function $g(t){return e=>{e.key==="Enter"&&t(e)}}function Cu(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const MP=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=$g(()=>{if(ua.has(n))return;Cu(n,"down");const i=$g(()=>{Cu(n,"up")}),s=()=>Cu(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function Fg(t){return Sh(t)&&!Z_()}function IP(t,e,n={}){const[r,i,s]=J_(t,n),o=a=>{const l=a.currentTarget;if(!Fg(a))return;ua.add(l);const u=e(l,a),c=(h,y)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),ua.has(l)&&ua.delete(l),Fg(h)&&typeof u=="function"&&u(h,{success:y})},d=h=>{c(h,l===window||l===document||n.useGlobalTarget||ew(l,h.target))},f=h=>{c(h,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),kP(a)&&(a.addEventListener("focus",u=>MP(u,i)),!RP(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function tw(t){return p_(t)&&"ownerSVGElement"in t}function NP(t){return tw(t)&&t.tagName==="svg"}const We=t=>!!(t&&t.getVelocity),DP=[...q_,Ce,Jn],LP=t=>DP.find(G_(t)),nw=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function OP(t=!0){const e=x.useContext(th);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=e,s=x.useId();x.useEffect(()=>{if(t)return i(s)},[t]);const o=x.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,o]:[!0]}const rw=x.createContext({strict:!1}),jg={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ki={};for(const t in jg)ki[t]={isEnabled:e=>jg[t].some(n=>!!e[n])};function $P(t){for(const e in t)ki[e]={...ki[e],...t[e]}}const FP=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function za(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||FP.has(t)}let iw=t=>!za(t);function jP(t){typeof t=="function"&&(iw=e=>e.startsWith("on")?!za(e):t(e))}try{jP(require("@emotion/is-prop-valid").default)}catch{}function VP(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||(iw(i)||n===!0&&za(i)||!e&&!za(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}const bl=x.createContext({});function Al(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Js(t){return typeof t=="string"||Array.isArray(t)}const Eh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],kh=["initial",...Eh];function Rl(t){return Al(t.animate)||kh.some(e=>Js(t[e]))}function sw(t){return!!(Rl(t)||t.variants)}function BP(t,e){if(Rl(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Js(n)?n:void 0,animate:Js(r)?r:void 0}}return t.inherit!==!1?e:{}}function zP(t){const{initial:e,animate:n}=BP(t,x.useContext(bl));return x.useMemo(()=>({initial:e,animate:n}),[Vg(e),Vg(n)])}function Vg(t){return Array.isArray(t)?t.join(" "):t}const eo={};function UP(t){for(const e in t)eo[e]=t[e],uh(e)&&(eo[e].isCSSVariable=!0)}function ow(t,{layout:e,layoutId:n}){return $i.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!eo[t]||t==="opacity")}const HP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},WP=Oi.length;function KP(t,e,n){let r="",i=!0;for(let s=0;s<WP;s++){const o=Oi[s],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Q_(a,wh[o]);if(!l){i=!1;const c=HP[o]||o;r+=`${c}(${u}) `}n&&(e[o]=u)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function Ch(t,e,n){const{style:r,vars:i,transformOrigin:s}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if($i.has(l)){o=!0;continue}else if(uh(l)){i[l]=u;continue}else{const c=Q_(u,wh[l]);l.startsWith("origin")?(a=!0,s[l]=c):r[l]=c}}if(e.transform||(o||n?r.transform=KP(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=s;r.transformOrigin=`${l} ${u} ${c}`}}const Ph=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function aw(t,e,n){for(const r in e)!We(e[r])&&!ow(r,n)&&(t[r]=e[r])}function GP({transformTemplate:t},e){return x.useMemo(()=>{const n=Ph();return Ch(n,e,t),Object.assign({},n.vars,n.style)},[e])}function qP(t,e){const n=t.style||{},r={};return aw(r,n,t),Object.assign(r,GP(t,e)),r}function YP(t,e){const n={},r=qP(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const XP={offset:"stroke-dashoffset",array:"stroke-dasharray"},QP={offset:"strokeDashoffset",array:"strokeDasharray"};function ZP(t,e,n=1,r=0,i=!0){t.pathLength=1;const s=i?XP:QP;t[s.offset]=W.transform(-r);const o=W.transform(e),a=W.transform(n);t[s.array]=`${o} ${a}`}function lw(t,{attrX:e,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},l,u,c){if(Ch(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:f}=t;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete d.transformBox),e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&ZP(d,i,s,o,!1)}const uw=()=>({...Ph(),attrs:{}}),cw=t=>typeof t=="string"&&t.toLowerCase()==="svg";function JP(t,e,n,r){const i=x.useMemo(()=>{const s=uw();return lw(s,e,cw(r),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};aw(s,t.style,t),i.style={...s,...i.style}}return i}const eT=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Th(t){return typeof t!="string"||t.includes("-")?!1:!!(eT.indexOf(t)>-1||/[A-Z]/u.test(t))}function tT(t,e,n,{latestValues:r},i,s=!1){const a=(Th(t)?JP:YP)(e,r,i,t),l=VP(e,typeof t=="string",s),u=t!==x.Fragment?{...l,...a,ref:n}:{},{children:c}=e,d=x.useMemo(()=>We(c)?c.get():c,[c]);return x.createElement(t,{...u,children:d})}function Bg(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function bh(t,e,n,r){if(typeof e=="function"){const[i,s]=Bg(r);e=e(n!==void 0?n:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=Bg(r);e=e(n!==void 0?n:t.custom,i,s)}return e}function ca(t){return We(t)?t.get():t}function nT({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,i){return{latestValues:rT(n,r,i,t),renderState:e()}}function rT(t,e,n,r){const i={},s=r(t,{});for(const f in s)i[f]=ca(s[f]);let{initial:o,animate:a}=t;const l=Rl(t),u=sw(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const d=c?a:o;if(d&&typeof d!="boolean"&&!Al(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const y=bh(t,f[h]);if(y){const{transitionEnd:m,transition:_,...p}=y;for(const g in p){let v=p[g];if(Array.isArray(v)){const w=c?v.length-1:0;v=v[w]}v!==null&&(i[g]=v)}for(const g in m)i[g]=m[g]}}}return i}const dw=t=>(e,n)=>{const r=x.useContext(bl),i=x.useContext(th),s=()=>nT(t,e,r,i);return n?s():$k(s)};function Ah(t,e,n){var s;const{style:r}=t,i={};for(const o in r)(We(r[o])||e.style&&We(e.style[o])||ow(o,t)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const iT=dw({scrapeMotionValuesFromProps:Ah,createRenderState:Ph});function fw(t,e,n){const r=Ah(t,e,n);for(const i in t)if(We(t[i])||We(e[i])){const s=Oi.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i]}return r}const sT=dw({scrapeMotionValuesFromProps:fw,createRenderState:uw}),oT=Symbol.for("motionComponentSymbol");function ei(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function aT(t,e,n){return x.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):ei(n)&&(n.current=r))},[e])}const Rh=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),lT="framerAppearId",hw="data-"+Rh(lT),pw=x.createContext({});function uT(t,e,n,r,i){var m,_;const{visualElement:s}=x.useContext(bl),o=x.useContext(rw),a=x.useContext(th),l=x.useContext(nw).reducedMotion,u=x.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(t,{visualState:e,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const c=u.current,d=x.useContext(pw);c&&!c.projection&&i&&(c.type==="html"||c.type==="svg")&&cT(u.current,n,i,d);const f=x.useRef(!1);x.useInsertionEffect(()=>{c&&f.current&&c.update(n,a)});const h=n[hw],y=x.useRef(!!h&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,h))&&((_=window.MotionHasOptimisedAnimation)==null?void 0:_.call(window,h)));return Fk(()=>{c&&(f.current=!0,window.MotionIsMounted=!0,c.updateFeatures(),c.scheduleRenderMicrotask(),y.current&&c.animationState&&c.animationState.animateChanges())}),x.useEffect(()=>{c&&(!y.current&&c.animationState&&c.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var p;(p=window.MotionHandoffMarkAsComplete)==null||p.call(window,h)}),y.current=!1),c.enteringChildren=void 0)}),c}function cT(t,e,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:gw(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&ei(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:c,layoutScroll:l,layoutRoot:u})}function gw(t){if(t)return t.options.allowProjection!==!1?t.projection:gw(t.parent)}function Pu(t,{forwardMotionProps:e=!1}={},n,r){n&&$P(n);const i=Th(t)?sT:iT;function s(a,l){let u;const c={...x.useContext(nw),...a,layoutId:dT(a)},{isStatic:d}=c,f=zP(a),h=i(a,d);if(!d&&eh){fT();const y=hT(c);u=y.MeasureLayout,f.visualElement=uT(t,h,c,r,y.ProjectionNode)}return C.jsxs(bl.Provider,{value:f,children:[u&&f.visualElement?C.jsx(u,{visualElement:f.visualElement,...c}):null,tT(t,a,aT(h,f.visualElement,l),h,d,e)]})}s.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const o=x.forwardRef(s);return o[oT]=t,o}function dT({layoutId:t}){const e=x.useContext(f_).id;return e&&t!==void 0?e+"-"+t:t}function fT(t,e){x.useContext(rw).strict}function hT(t){const{drag:e,layout:n}=ki;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function pT(t,e){if(typeof Proxy>"u")return Pu;const n=new Map,r=(s,o)=>Pu(s,o,t,e),i=(s,o)=>r(s,o);return new Proxy(i,{get:(s,o)=>o==="create"?r:(n.has(o)||n.set(o,Pu(o,void 0,t,e)),n.get(o))})}function mw({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function gT({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function mT(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Tu(t){return t===void 0||t===1}function ad({scale:t,scaleX:e,scaleY:n}){return!Tu(t)||!Tu(e)||!Tu(n)}function fr(t){return ad(t)||vw(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function vw(t){return zg(t.x)||zg(t.y)}function zg(t){return t&&t!=="0%"}function Ua(t,e,n){const r=t-n,i=e*r;return n+i}function Ug(t,e,n,r,i){return i!==void 0&&(t=Ua(t,i,r)),Ua(t,n,r)+e}function ld(t,e=0,n=1,r,i){t.min=Ug(t.min,e,n,r,i),t.max=Ug(t.max,e,n,r,i)}function yw(t,{x:e,y:n}){ld(t.x,e.translate,e.scale,e.originPoint),ld(t.y,n.translate,n.scale,n.originPoint)}const Hg=.999999999999,Wg=1.0000000000001;function vT(t,e,n,r=!1){const i=n.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&ni(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,yw(t,o)),r&&fr(s.latestValues)&&ni(t,s.latestValues))}e.x<Wg&&e.x>Hg&&(e.x=1),e.y<Wg&&e.y>Hg&&(e.y=1)}function ti(t,e){t.min=t.min+e,t.max=t.max+e}function Kg(t,e,n,r,i=.5){const s=he(t.min,t.max,i);ld(t,e,n,s,r)}function ni(t,e){Kg(t.x,e.x,e.scaleX,e.scale,e.originX),Kg(t.y,e.y,e.scaleY,e.scale,e.originY)}function _w(t,e){return mw(mT(t.getBoundingClientRect(),e))}function yT(t,e,n){const r=_w(t,n),{scroll:i}=e;return i&&(ti(r.x,i.offset.x),ti(r.y,i.offset.y)),r}const Gg=()=>({translate:0,scale:1,origin:0,originPoint:0}),ri=()=>({x:Gg(),y:Gg()}),qg=()=>({min:0,max:0}),Se=()=>({x:qg(),y:qg()}),ud={current:null},ww={current:!1};function _T(){if(ww.current=!0,!!eh)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ud.current=t.matches;t.addEventListener("change",e),e()}else ud.current=!1}const wT=new WeakMap;function xT(t,e,n){for(const r in e){const i=e[r],s=n[r];if(We(i))t.addValue(r,i);else if(We(s))t.addValue(r,Ei(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(r);t.addValue(r,Ei(o!==void 0?o:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Yg=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ST{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=yh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=at.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,de.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Rl(n),this.isVariantNode=sw(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const h=d[f];l[f]!==void 0&&We(h)&&h.set(l[f])}}mount(e){var n;this.current=e,wT.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),ww.current||_T(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ud.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var e;this.projection&&this.projection.unmount(),Zn(this.notifyUpdate),Zn(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=$i.has(e);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&de.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ki){const n=ki[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Se()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Yg.length;r++){const i=Yg[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=e[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=xT(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Ei(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(h_(r)||g_(r))?r=parseFloat(r):!LP(r)&&Jn.test(n)&&(r=X_(e,n)),this.setBaseTarget(e,We(r)?r.get():r)),We(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=bh(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!We(i)?i:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new oh),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){xh.render(this.render)}}class xw extends ST{constructor(){super(...arguments),this.KeyframeResolver=SP}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;We(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Sw(t,{style:e,vars:n},r,i){const s=t.style;let o;for(o in e)s[o]=e[o];i==null||i.applyProjectionStyles(s,r);for(o in n)s.setProperty(o,n[o])}function ET(t){return window.getComputedStyle(t)}class kT extends xw{constructor(){super(...arguments),this.type="html",this.renderInstance=Sw}readValueFromInstance(e,n){var r;if($i.has(n))return(r=this.projection)!=null&&r.isProjecting?ed(n):BC(e,n);{const i=ET(e),s=(uh(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return _w(e,n)}build(e,n,r){Ch(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Ah(e,n,r)}}const Ew=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function CT(t,e,n,r){Sw(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(Ew.has(i)?i:Rh(i),e.attrs[i])}class PT extends xw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Se}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if($i.has(n)){const r=Y_(n);return r&&r.default||0}return n=Ew.has(n)?n:Rh(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return fw(e,n,r)}build(e,n,r){lw(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,i){CT(e,n,r,i)}mount(e){this.isSVGTag=cw(e.tagName),super.mount(e)}}const TT=(t,e)=>Th(t)?new PT(e):new kT(e,{allowProjection:t!==x.Fragment});function hi(t,e,n){const r=t.getProps();return bh(r,e,n!==void 0?n:r.custom,t)}const cd=t=>Array.isArray(t);function bT(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ei(n))}function AT(t){return cd(t)?t[t.length-1]||0:t}function RT(t,e){const n=hi(t,e);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=AT(s[o]);bT(t,o,a)}}function MT(t){return!!(We(t)&&t.add)}function dd(t,e){const n=t.getValue("willChange");if(MT(n))return n.add(e);if(!n&&En.WillChange){const r=new En.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function kw(t){return t.props[hw]}const IT=t=>t!==null;function NT(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(IT),s=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[s]}const DT={type:"spring",stiffness:500,damping:25,restSpeed:10},LT=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),OT={type:"keyframes",duration:.8},$T={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},FT=(t,{keyframes:e})=>e.length>2?OT:$i.has(t)?t.startsWith("scale")?LT(e[1]):DT:$T;function jT({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const Mh=(t,e,n,r={},i,s)=>o=>{const a=_h(r,t)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-nn(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:i};jT(a)||Object.assign(c,FT(t,c)),c.duration&&(c.duration=nn(c.duration)),c.repeatDelay&&(c.repeatDelay=nn(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(sd(c),c.delay===0&&(d=!0)),(En.instantAnimations||En.skipAnimations)&&(d=!0,sd(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,d&&!s&&e.get()!==void 0){const f=NT(c.keyframes,a);if(f!==void 0){de.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new vh(c):new cP(c)};function VT({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function Cw(t,e,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=t.getDefaultTransition(),transitionEnd:o,...a}=e;r&&(s=r);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const c in a){const d=t.getValue(c,t.latestValues[c]??null),f=a[c];if(f===void 0||u&&VT(u,c))continue;const h={delay:n,..._h(s||{},c)},y=d.get();if(y!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===y&&!h.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const p=kw(t);if(p){const g=window.MotionHandoffAnimation(p,c,de);g!==null&&(h.startTime=g,m=!0)}}dd(t,c),d.start(Mh(c,d,f,t.shouldReduceMotion&&K_.has(c)?{type:!1}:h,t,m));const _=d.animation;_&&l.push(_)}return o&&Promise.all(l).then(()=>{de.update(()=>{o&&RT(t,o)})}),l}function Pw(t,e,n,r=0,i=1){const s=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),o=t.size,a=(o-1)*r;return typeof n=="function"?n(s,o):i===1?s*r:a-s*r}function fd(t,e,n={}){var l;const r=hi(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(Cw(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=i;return BT(t,e,u,c,d,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,c]=a==="beforeChildren"?[s,o]:[o,s];return u().then(()=>c())}else return Promise.all([s(),o(n.delay)])}function BT(t,e,n=0,r=0,i=0,s=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(fd(l,e,{...o,delay:n+(typeof r=="function"?0:r)+Pw(t.variantChildren,l,r,i,s)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function zT(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(s=>fd(t,s,n));r=Promise.all(i)}else if(typeof e=="string")r=fd(t,e,n);else{const i=typeof e=="function"?hi(t,e,n.custom):e;r=Promise.all(Cw(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}function Tw(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const UT=kh.length;function bw(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?bw(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<UT;n++){const r=kh[n],i=t.props[r];(Js(i)||i===!1)&&(e[r]=i)}return e}const HT=[...Eh].reverse(),WT=Eh.length;function KT(t){return e=>Promise.all(e.map(({animation:n,options:r})=>zT(t,n,r)))}function GT(t){let e=KT(t),n=Xg(),r=!0;const i=l=>(u,c)=>{var f;const d=hi(t,c,l==="exit"?(f=t.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:y,...m}=d;u={...u,...m,...y}}return u};function s(l){e=l(t)}function o(l){const{props:u}=t,c=bw(t.parent)||{},d=[],f=new Set;let h={},y=1/0;for(let _=0;_<WT;_++){const p=HT[_],g=n[p],v=u[p]!==void 0?u[p]:c[p],w=Js(v),E=p===l?g.isActive:null;E===!1&&(y=_);let A=v===c[p]&&v!==u[p]&&w;if(A&&r&&t.manuallyAnimateOnMount&&(A=!1),g.protectedKeys={...h},!g.isActive&&E===null||!v&&!g.prevProp||Al(v)||typeof v=="boolean")continue;const b=qT(g.prevProp,v);let S=b||p===l&&g.isActive&&!A&&w||_>y&&w,k=!1;const P=Array.isArray(v)?v:[v];let R=P.reduce(i(p),{});E===!1&&(R={});const{prevResolvedValues:N={}}=g,V={...N,...R},$=U=>{S=!0,f.has(U)&&(k=!0,f.delete(U)),g.needsAnimating[U]=!0;const M=t.getValue(U);M&&(M.liveStyle=!1)};for(const U in V){const M=R[U],L=N[U];if(h.hasOwnProperty(U))continue;let z=!1;cd(M)&&cd(L)?z=!Tw(M,L):z=M!==L,z?M!=null?$(U):f.add(U):M!==void 0&&f.has(U)?$(U):g.protectedKeys[U]=!0}g.prevProp=v,g.prevResolvedValues=R,g.isActive&&(h={...h,...R}),r&&t.blockInitialAnimation&&(S=!1);const K=A&&b;S&&(!K||k)&&d.push(...P.map(U=>{const M={type:p};if(typeof U=="string"&&r&&!K&&t.manuallyAnimateOnMount&&t.parent){const{parent:L}=t,z=hi(L,U);if(L.enteringChildren&&z){const{delayChildren:J}=z.transition||{};M.delay=Pw(L.enteringChildren,t,J)}}return{animation:U,options:M}}))}if(f.size){const _={};if(typeof u.initial!="boolean"){const p=hi(t,Array.isArray(u.initial)?u.initial[0]:u.initial);p&&p.transition&&(_.transition=p.transition)}f.forEach(p=>{const g=t.getBaseTarget(p),v=t.getValue(p);v&&(v.liveStyle=!0),_[p]=g??null}),d.push({animation:_})}let m=!!d.length;return r&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),r=!1,m?e(d):Promise.resolve()}function a(l,u){var d;if(n[l].isActive===u)return Promise.resolve();(d=t.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(l,u)}),n[l].isActive=u;const c=o(l);for(const f in n)n[f].protectedKeys={};return c}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Xg(),r=!0}}}function qT(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Tw(e,t):!1}function sr(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Xg(){return{animate:sr(!0),whileInView:sr(),whileHover:sr(),whileTap:sr(),whileDrag:sr(),whileFocus:sr(),exit:sr()}}class ir{constructor(e){this.isMounted=!1,this.node=e}update(){}}class YT extends ir{constructor(e){super(e),e.animationState||(e.animationState=GT(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Al(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let XT=0;class QT extends ir{constructor(){super(...arguments),this.id=XT++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const ZT={animation:{Feature:YT},exit:{Feature:QT}};function to(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function go(t){return{point:{x:t.pageX,y:t.pageY}}}const JT=t=>e=>Sh(e)&&t(e,go(e));function Ts(t,e,n,r){return to(t,e,JT(n),r)}const Aw=1e-4,eb=1-Aw,tb=1+Aw,Rw=.01,nb=0-Rw,rb=0+Rw;function Ze(t){return t.max-t.min}function ib(t,e,n){return Math.abs(t-e)<=n}function Qg(t,e,n,r=.5){t.origin=r,t.originPoint=he(e.min,e.max,t.origin),t.scale=Ze(n)/Ze(e),t.translate=he(n.min,n.max,t.origin)-t.originPoint,(t.scale>=eb&&t.scale<=tb||isNaN(t.scale))&&(t.scale=1),(t.translate>=nb&&t.translate<=rb||isNaN(t.translate))&&(t.translate=0)}function bs(t,e,n,r){Qg(t.x,e.x,n.x,r?r.originX:void 0),Qg(t.y,e.y,n.y,r?r.originY:void 0)}function Zg(t,e,n){t.min=n.min+e.min,t.max=t.min+Ze(e)}function sb(t,e,n){Zg(t.x,e.x,n.x),Zg(t.y,e.y,n.y)}function Jg(t,e,n){t.min=e.min-n.min,t.max=t.min+Ze(e)}function As(t,e,n){Jg(t.x,e.x,n.x),Jg(t.y,e.y,n.y)}function St(t){return[t("x"),t("y")]}const Mw=({current:t})=>t?t.ownerDocument.defaultView:null,em=(t,e)=>Math.abs(t-e);function ob(t,e){const n=em(t.x,e.x),r=em(t.y,e.y);return Math.sqrt(n**2+r**2)}class Iw{constructor(e,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Au(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,y=ob(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!y)return;const{point:m}=f,{timestamp:_}=Le;this.history.push({...m,timestamp:_});const{onStart:p,onMove:g}=this.handlers;h||(p&&p(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=bu(h,this.transformPagePoint),de.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:y,onSessionEnd:m,resumeAnimation:_}=this.handlers;if(this.dragSnapToOrigin&&_&&_(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=Au(f.type==="pointercancel"?this.lastMoveEventInfo:bu(h,this.transformPagePoint),this.history);this.startEvent&&y&&y(f,p),m&&m(f,p)},!Sh(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=i||window;const a=go(e),l=bu(a,this.transformPagePoint),{point:u}=l,{timestamp:c}=Le;this.history=[{...u,timestamp:c}];const{onSessionStart:d}=n;d&&d(e,Au(l,this.history)),this.removeListeners=fo(Ts(this.contextWindow,"pointermove",this.handlePointerMove),Ts(this.contextWindow,"pointerup",this.handlePointerUp),Ts(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Zn(this.updatePoint)}}function bu(t,e){return e?{point:e(t.point)}:t}function tm(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Au({point:t},e){return{point:t,delta:tm(t,Nw(e)),offset:tm(t,ab(e)),velocity:lb(e,.1)}}function ab(t){return t[0]}function Nw(t){return t[t.length-1]}function lb(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=Nw(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>nn(e)));)n--;if(!r)return{x:0,y:0};const s=Pt(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ub(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?he(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?he(n,t,r.max):Math.min(t,n)),t}function nm(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function cb(t,{top:e,left:n,bottom:r,right:i}){return{x:nm(t.x,n,i),y:nm(t.y,e,r)}}function rm(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function db(t,e){return{x:rm(t.x,e.x),y:rm(t.y,e.y)}}function fb(t,e){let n=.5;const r=Ze(t),i=Ze(e);return i>r?n=Xs(e.min,e.max-r,t.min):r>i&&(n=Xs(t.min,t.max-i,e.min)),Sn(0,1,n)}function hb(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const hd=.35;function pb(t=hd){return t===!1?t=0:t===!0&&(t=hd),{x:im(t,"left","right"),y:im(t,"top","bottom")}}function im(t,e,n){return{min:sm(t,e),max:sm(t,n)}}function sm(t,e){return typeof t=="number"?t:t[e]||0}const gb=new WeakMap;class mb{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Se(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(go(d).point)},o=(d,f)=>{const{drag:h,dragPropagation:y,onDragStart:m}=this.getProps();if(h&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=TP(h),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),St(p=>{let g=this.getAxisMotionValue(p).get()||0;if(rn.test(g)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[p];w&&(g=Ze(w)*(parseFloat(g)/100))}}this.originPoint[p]=g}),m&&de.postRender(()=>m(d,f)),dd(this.visualElement,"transform");const{animationState:_}=this.visualElement;_&&_.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:h,dragDirectionLock:y,onDirectionLock:m,onDrag:_}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:p}=f;if(y&&this.currentDirection===null){this.currentDirection=vb(p),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,p),this.updateAxis("y",f.point,p),this.visualElement.render(),_&&_(d,f)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>St(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)==null?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Iw(e,{onSessionStart:s,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:r,contextWindow:Mw(this.visualElement)})}stop(e,n){const r=e||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&de.postRender(()=>a(r,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!Oo(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=ub(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;e&&ei(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=cb(r.layoutBox,e):this.constraints=!1,this.elastic=pb(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&St(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=hb(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ei(e))return!1;const r=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=yT(r,i.root,this.visualElement.getTransformPagePoint());let o=db(i.layout.layoutBox,s);if(n){const a=n(gT(o));this.hasMutatedConstraints=!!a,a&&(o=mw(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=St(c=>{if(!Oo(c,n,this.currentDirection))return;let d=l&&l[c]||{};o&&(d={min:0,max:0});const f=i?200:1e6,h=i?40:1e7,y={type:"inertia",velocity:r?e[c]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(c,y)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return dd(this.visualElement,e),r.start(Mh(e,r,0,n,this.visualElement,!1))}stopAnimation(){St(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){St(e=>{var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){St(n=>{const{drag:r}=this.getProps();if(!Oo(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(e[n]-he(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ei(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};St(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=fb({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),St(o=>{if(!Oo(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(he(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;gb.set(this.visualElement,this);const e=this.visualElement.current,n=Ts(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();ei(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),de.read(r);const o=to(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(St(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=hd,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Oo(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function vb(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class yb extends ir{constructor(e){super(e),this.removeGroupControls=bt,this.removeListeners=bt,this.controls=new mb(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||bt}unmount(){this.removeGroupControls(),this.removeListeners()}}const om=t=>(e,n)=>{t&&de.postRender(()=>t(e,n))};class _b extends ir{constructor(){super(...arguments),this.removePointerDownListener=bt}onPointerDown(e){this.session=new Iw(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Mw(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:om(e),onStart:om(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&de.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Ts(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const da={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function am(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ki={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(W.test(t))t=parseFloat(t);else return t;const n=am(t,e.target.x),r=am(t,e.target.y);return`${n}% ${r}%`}},wb={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=Jn.parse(t);if(i.length>5)return r;const s=Jn.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const u=he(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};let Ru=!1;class xb extends x.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;UP(Sb),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),Ru&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),da.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:o}=r;return o&&(o.isPresent=s,Ru=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==s?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||de.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),xh.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;Ru=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Dw(t){const[e,n]=OP(),r=x.useContext(f_);return C.jsx(xb,{...t,layoutGroup:r,switchLayoutGroup:x.useContext(pw),isPresent:e,safeToRemove:n})}const Sb={borderRadius:{...Ki,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ki,borderTopRightRadius:Ki,borderBottomLeftRadius:Ki,borderBottomRightRadius:Ki,boxShadow:wb};function Eb(t,e,n){const r=We(t)?t:Ei(t);return r.start(Mh("",r,e,n)),r.animation}const kb=(t,e)=>t.depth-e.depth;class Cb{constructor(){this.children=[],this.isDirty=!1}add(e){nh(this.children,e),this.isDirty=!0}remove(e){rh(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(kb),this.isDirty=!1,this.children.forEach(e)}}function Pb(t,e){const n=at.now(),r=({timestamp:i})=>{const s=i-n;s>=e&&(Zn(r),t(s-e))};return de.setup(r,!0),()=>Zn(r)}const Lw=["TopLeft","TopRight","BottomLeft","BottomRight"],Tb=Lw.length,lm=t=>typeof t=="string"?parseFloat(t):t,um=t=>typeof t=="number"||W.test(t);function bb(t,e,n,r,i,s){i?(t.opacity=he(0,n.opacity??1,Ab(r)),t.opacityExit=he(e.opacity??1,0,Rb(r))):s&&(t.opacity=he(e.opacity??1,n.opacity??1,r));for(let o=0;o<Tb;o++){const a=`border${Lw[o]}Radius`;let l=cm(e,a),u=cm(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||um(l)===um(u)?(t[a]=Math.max(he(lm(l),lm(u),r),0),(rn.test(u)||rn.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=he(e.rotate||0,n.rotate||0,r))}function cm(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Ab=Ow(0,.5,E_),Rb=Ow(.5,.95,bt);function Ow(t,e,n){return r=>r<t?0:r>e?1:n(Xs(t,e,r))}function dm(t,e){t.min=e.min,t.max=e.max}function xt(t,e){dm(t.x,e.x),dm(t.y,e.y)}function fm(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function hm(t,e,n,r,i){return t-=e,t=Ua(t,1/n,r),i!==void 0&&(t=Ua(t,1/i,r)),t}function Mb(t,e=0,n=1,r=.5,i,s=t,o=t){if(rn.test(e)&&(e=parseFloat(e),e=he(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=he(s.min,s.max,r);t===s&&(a-=e),t.min=hm(t.min,e,n,a,i),t.max=hm(t.max,e,n,a,i)}function pm(t,e,[n,r,i],s,o){Mb(t,e[n],e[r],e[i],e.scale,s,o)}const Ib=["x","scaleX","originX"],Nb=["y","scaleY","originY"];function gm(t,e,n,r){pm(t.x,e,Ib,n?n.x:void 0,r?r.x:void 0),pm(t.y,e,Nb,n?n.y:void 0,r?r.y:void 0)}function mm(t){return t.translate===0&&t.scale===1}function $w(t){return mm(t.x)&&mm(t.y)}function vm(t,e){return t.min===e.min&&t.max===e.max}function Db(t,e){return vm(t.x,e.x)&&vm(t.y,e.y)}function ym(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Fw(t,e){return ym(t.x,e.x)&&ym(t.y,e.y)}function _m(t){return Ze(t.x)/Ze(t.y)}function wm(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Lb{constructor(){this.members=[]}add(e){nh(this.members,e),e.scheduleRender()}remove(e){if(rh(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Ob(t,e,n){let r="";const i=t.x.translate/e.x,s=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:h,skewY:y}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),h&&(r+=`skewX(${h}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Mu=["","X","Y","Z"],$b=1e3;let Fb=0;function Iu(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function jw(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=kw(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",de,!(i||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&jw(r)}function Vw({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=Fb++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Bb),this.nodes.forEach(Wb),this.nodes.forEach(Kb),this.nodes.forEach(zb)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Cb)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new oh),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=tw(o)&&!NP(o),this.instance=o;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let c,d=0;const f=()=>this.root.updateBlockedByResize=!1;de.read(()=>{d=window.innerWidth}),t(o,()=>{const h=window.innerWidth;h!==d&&(d=h,this.root.updateBlockedByResize=!0,c&&c(),c=Pb(f,250),da.hasAnimatedSinceResize&&(da.hasAnimatedSinceResize=!1,this.nodes.forEach(Em)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||Qb,{onLayoutAnimationStart:m,onLayoutAnimationComplete:_}=u.getProps(),p=!this.targetLayout||!Fw(this.targetLayout,h),g=!d&&f;if(this.options.layoutRoot||this.resumeFrom||g||d&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={..._h(y,"layout"),onPlay:m,onComplete:_};(u.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(c,g)}else d||Em(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Zn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Gb),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&jw(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xm);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Sm);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Hb),this.nodes.forEach(jb),this.nodes.forEach(Vb)):this.nodes.forEach(Sm),this.clearAllSnapshots();const a=at.now();Le.delta=Sn(0,1e3/60,a-Le.timestamp),Le.timestamp=a,Le.isProcessing=!0,wu.update.process(Le),wu.preRender.process(Le),wu.render.process(Le),Le.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,xh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ub),this.sharedNodes.forEach(qb)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,de.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){de.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ze(this.snapshot.measuredBox.x)&&!Ze(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Se(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!$w(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||fr(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Zb(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return Se();const a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Jb))){const{scroll:c}=this.root;c&&(ti(a.x,c.offset.x),ti(a.y,c.offset.y))}return a}removeElementScroll(o){var l;const a=Se();if(xt(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:d,options:f}=c;c!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&xt(a,o),ti(a.x,d.offset.x),ti(a.y,d.offset.y))}return a}applyTransform(o,a=!1){const l=Se();xt(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&ni(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),fr(c.latestValues)&&ni(l,c.latestValues)}return fr(this.latestValues)&&ni(l,this.latestValues),l}removeTransform(o){const a=Se();xt(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!fr(u.latestValues))continue;ad(u.latestValues)&&u.updateSnapshot();const c=Se(),d=u.measurePageBox();xt(c,d),gm(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return fr(this.latestValues)&&gm(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Le.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var f;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:d}=this.options;if(!(!this.layout||!(c||d))){if(this.resolvedRelativeTargetAt=Le.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),As(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),xt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Se(),this.targetWithTransforms=Se()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),sb(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):xt(this.target,this.layout.layoutBox),yw(this.target,this.targetDelta)):xt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),As(this.relativeTargetOrigin,this.target,h.target),xt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ad(this.parent.latestValues)||vw(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var y;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Le.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;xt(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;vT(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Se());const{target:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fm(this.prevProjectionDelta.x,this.projectionDelta.x),fm(this.prevProjectionDelta.y,this.projectionDelta.y)),bs(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!wm(this.projectionDelta.x,this.prevProjectionDelta.x)||!wm(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ri(),this.projectionDelta=ri(),this.projectionDeltaWithTransform=ri()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=ri();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Se(),h=l?l.source:void 0,y=this.layout?this.layout.source:void 0,m=h!==y,_=this.getStack(),p=!_||_.members.length<=1,g=!!(m&&!p&&this.options.crossfade===!0&&!this.path.some(Xb));this.animationProgress=0;let v;this.mixTargetDelta=w=>{const E=w/1e3;km(d.x,o.x,E),km(d.y,o.y,E),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(As(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Yb(this.relativeTarget,this.relativeTargetOrigin,f,E),v&&Db(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=Se()),xt(v,this.relativeTarget)),m&&(this.animationValues=c,bb(c,u,this.latestValues,E,g,p)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Zn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=de.update(()=>{da.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ei(0)),this.currentAnimation=Eb(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),o.onUpdate&&o.onUpdate(c)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta($b),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Bw(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Se();const d=Ze(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const f=Ze(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}xt(a,l),ni(a,c),bs(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Lb),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Iu("z",o,u,this.animationValues);for(let c=0;c<Mu.length;c++)Iu(`rotate${Mu[c]}`,o,u,this.animationValues),Iu(`skew${Mu[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=ca(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=ca(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!fr(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let d=Ob(this.projectionDeltaWithTransform,this.treeScale,c);l&&(d=l(c,d)),o.transform=d;const{x:f,y:h}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${h.origin*100}% 0`,u.animationValues?o.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const y in eo){if(c[y]===void 0)continue;const{correct:m,applyTo:_,isCSSVariable:p}=eo[y],g=d==="none"?c[y]:m(c[y],u);if(_){const v=_.length;for(let w=0;w<v;w++)o[_[w]]=g}else p?this.options.visualElement.renderState.vars[y]=g:o[y]=g}this.options.layoutId&&(o.pointerEvents=u===this?ca(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(xm),this.root.sharedNodes.clear()}}}function jb(t){t.updateLayout()}function Vb(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;s==="size"?St(d=>{const f=o?e.measuredBox[d]:e.layoutBox[d],h=Ze(f);f.min=r[d].min,f.max=f.min+h}):Bw(s,e.layoutBox,r)&&St(d=>{const f=o?e.measuredBox[d]:e.layoutBox[d],h=Ze(r[d]);f.max=f.min+h,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+h)});const a=ri();bs(a,r,e.layoutBox);const l=ri();o?bs(l,t.applyTransform(i,!0),e.measuredBox):bs(l,r,e.layoutBox);const u=!$w(a);let c=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const y=Se();As(y,e.layoutBox,f.layoutBox);const m=Se();As(m,r,h.layoutBox),Fw(y,m)||(c=!0),d.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=y,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Bb(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function zb(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Ub(t){t.clearSnapshot()}function xm(t){t.clearMeasurements()}function Sm(t){t.isLayoutDirty=!1}function Hb(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Em(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Wb(t){t.resolveTargetDelta()}function Kb(t){t.calcProjection()}function Gb(t){t.resetSkewAndRotation()}function qb(t){t.removeLeadSnapshot()}function km(t,e,n){t.translate=he(e.translate,0,n),t.scale=he(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Cm(t,e,n,r){t.min=he(e.min,n.min,r),t.max=he(e.max,n.max,r)}function Yb(t,e,n,r){Cm(t.x,e.x,n.x,r),Cm(t.y,e.y,n.y,r)}function Xb(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Qb={duration:.45,ease:[.4,0,.1,1]},Pm=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Tm=Pm("applewebkit/")&&!Pm("chrome/")?Math.round:bt;function bm(t){t.min=Tm(t.min),t.max=Tm(t.max)}function Zb(t){bm(t.x),bm(t.y)}function Bw(t,e,n){return t==="position"||t==="preserve-aspect"&&!ib(_m(e),_m(n),.2)}function Jb(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const eA=Vw({attachResizeListener:(t,e)=>to(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Nu={current:void 0},zw=Vw({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Nu.current){const t=new eA({});t.mount(window),t.setOptions({layoutScroll:!0}),Nu.current=t}return Nu.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),tA={pan:{Feature:_b},drag:{Feature:yb,ProjectionNode:zw,MeasureLayout:Dw}};function Am(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&de.postRender(()=>s(e,go(e)))}class nA extends ir{mount(){const{current:e}=this.node;e&&(this.unmount=bP(e,(n,r)=>(Am(this.node,r,"Start"),i=>Am(this.node,i,"End"))))}unmount(){}}class rA extends ir{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=fo(to(this.node.current,"focus",()=>this.onFocus()),to(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Rm(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&de.postRender(()=>s(e,go(e)))}class iA extends ir{mount(){const{current:e}=this.node;e&&(this.unmount=IP(e,(n,r)=>(Rm(this.node,r,"Start"),(i,{success:s})=>Rm(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const pd=new WeakMap,Du=new WeakMap,sA=t=>{const e=pd.get(t.target);e&&e(t)},oA=t=>{t.forEach(sA)};function aA({root:t,...e}){const n=t||document;Du.has(n)||Du.set(n,{});const r=Du.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(oA,{root:t,...e})),r[i]}function lA(t,e,n){const r=aA(e);return pd.set(t,n),r.observe(t),()=>{pd.delete(t),r.unobserve(t)}}const uA={some:0,all:1};class cA extends ir{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:uA[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return lA(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(dA(e,n))&&this.startObserver()}unmount(){}}function dA({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const fA={inView:{Feature:cA},tap:{Feature:iA},focus:{Feature:rA},hover:{Feature:nA}},hA={layout:{ProjectionNode:zw,MeasureLayout:Dw}},pA={...ZT,...fA,...tA,...hA},Uw=pT(pA,TT),Ci={};function Hw(t){return"init"in t}function gd(t){return!!t.write}function Mm(t){return"v"in t||"e"in t}function Ha(t){if("e"in t)throw t.e;if((Ci?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}const Wa=new WeakMap;function Ww(t){var e;return Ka(t)&&!!((e=Wa.get(t))!=null&&e[0])}function gA(t){const e=Wa.get(t);e!=null&&e[0]&&(e[0]=!1,e[1].forEach(n=>n()))}function md(t,e){let n=Wa.get(t);if(!n){n=[!0,new Set],Wa.set(t,n);const r=()=>{n[0]=!1};t.then(r,r)}n[1].add(e)}function Ka(t){return typeof(t==null?void 0:t.then)=="function"}function Kw(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function Gw(t,e,n){var r;const i=new Set;for(const s of((r=n.get(t))==null?void 0:r.t)||[])n.has(s)&&i.add(s);for(const s of e.p)i.add(s);return i}const mA=(t,e,...n)=>e.read(...n),vA=(t,e,...n)=>e.write(...n),yA=(t,e)=>{var n;return(n=e.unstable_onInit)==null?void 0:n.call(e,t)},_A=(t,e,n)=>{var r;return(r=e.onMount)==null?void 0:r.call(e,n)},wA=(t,e)=>{const n=Ke(t),r=n[0],i=n[9];if((Ci?"production":void 0)!=="production"&&!e)throw new Error("Atom is undefined or null");let s=r.get(e);return s||(s={d:new Map,p:new Set,n:0},r.set(e,s),i==null||i(t,e)),s},xA=t=>{const e=Ke(t),n=e[1],r=e[3],i=e[4],s=e[5],o=e[6],a=e[13],l=[],u=c=>{try{c()}catch(d){l.push(d)}};do{o.f&&u(o.f);const c=new Set,d=c.add.bind(c);r.forEach(f=>{var h;return(h=n.get(f))==null?void 0:h.l.forEach(d)}),r.clear(),s.forEach(d),s.clear(),i.forEach(d),i.clear(),c.forEach(u),r.size&&a(t)}while(r.size||s.size||i.size);if(l.length)throw new AggregateError(l)},SA=t=>{const e=Ke(t),n=e[1],r=e[2],i=e[3],s=e[11],o=e[14],a=e[17],l=[],u=new WeakSet,c=new WeakSet,d=Array.from(i);for(;d.length;){const f=d[d.length-1],h=s(t,f);if(c.has(f)){d.pop();continue}if(u.has(f)){if(r.get(f)===h.n)l.push([f,h]);else if((Ci?"production":void 0)!=="production"&&r.has(f))throw new Error("[Bug] invalidated atom exists");c.add(f),d.pop();continue}u.add(f);for(const y of Gw(f,h,n))u.has(y)||d.push(y)}for(let f=l.length-1;f>=0;--f){const[h,y]=l[f];let m=!1;for(const _ of y.d.keys())if(_!==h&&i.has(_)){m=!0;break}m&&(o(t,h),a(t,h)),r.delete(h)}},EA=(t,e)=>{var n,r;const i=Ke(t),s=i[1],o=i[2],a=i[3],l=i[6],u=i[7],c=i[11],d=i[12],f=i[13],h=i[14],y=i[16],m=i[17],_=c(t,e);if(Mm(_)&&(s.has(e)&&o.get(e)!==_.n||Array.from(_.d).every(([S,k])=>h(t,S).n===k)))return _;_.d.clear();let p=!0;function g(){s.has(e)&&(m(t,e),f(t),d(t))}function v(S){var k;if(S===e){const R=c(t,S);if(!Mm(R))if(Hw(S))Ga(t,S,S.init);else throw new Error("no atom init");return Ha(R)}const P=h(t,S);try{return Ha(P)}finally{_.d.set(S,P.n),Ww(_.v)&&Kw(e,_.v,P),(k=s.get(S))==null||k.t.add(e),p||g()}}let w,E;const A={get signal(){return w||(w=new AbortController),w.signal},get setSelf(){return(Ci?"production":void 0)!=="production"&&!gd(e)&&console.warn("setSelf function cannot be used with read-only atom"),!E&&gd(e)&&(E=(...S)=>{if((Ci?"production":void 0)!=="production"&&p&&console.warn("setSelf function cannot be called in sync"),!p)try{return y(t,e,...S)}finally{f(t),d(t)}}),E}},b=_.n;try{const S=u(t,e,v,A);return Ga(t,e,S),Ka(S)&&(md(S,()=>w==null?void 0:w.abort()),S.then(g,g)),(n=l.r)==null||n.call(l,e),_}catch(S){return delete _.v,_.e=S,++_.n,_}finally{p=!1,b!==_.n&&o.get(e)===b&&(o.set(e,_.n),a.add(e),(r=l.c)==null||r.call(l,e))}},kA=(t,e)=>{const n=Ke(t),r=n[1],i=n[2],s=n[11],o=[e];for(;o.length;){const a=o.pop(),l=s(t,a);for(const u of Gw(a,l,r)){const c=s(t,u);i.set(u,c.n),o.push(u)}}},qw=(t,e,...n)=>{const r=Ke(t),i=r[3],s=r[6],o=r[8],a=r[11],l=r[12],u=r[13],c=r[14],d=r[15],f=r[17];let h=!0;const y=_=>Ha(c(t,_)),m=(_,...p)=>{var g;const v=a(t,_);try{if(_===e){if(!Hw(_))throw new Error("atom not writable");const w=v.n,E=p[0];Ga(t,_,E),f(t,_),w!==v.n&&(i.add(_),(g=s.c)==null||g.call(s,_),d(t,_));return}else return qw(t,_,...p)}finally{h||(u(t),l(t))}};try{return o(t,e,y,m,...n)}finally{h=!1}},CA=(t,e)=>{var n;const r=Ke(t),i=r[1],s=r[3],o=r[6],a=r[11],l=r[15],u=r[18],c=r[19],d=a(t,e),f=i.get(e);if(f&&!Ww(d.v)){for(const[h,y]of d.d)if(!f.d.has(h)){const m=a(t,h);u(t,h).t.add(e),f.d.add(h),y!==m.n&&(s.add(h),(n=o.c)==null||n.call(o,h),l(t,h))}for(const h of f.d||[])if(!d.d.has(h)){f.d.delete(h);const y=c(t,h);y==null||y.t.delete(e)}}},Yw=(t,e)=>{var n;const r=Ke(t),i=r[1],s=r[4],o=r[6],a=r[10],l=r[11],u=r[12],c=r[13],d=r[14],f=r[16],h=l(t,e);let y=i.get(e);if(!y){d(t,e);for(const m of h.d.keys())Yw(t,m).t.add(e);if(y={l:new Set,d:new Set(h.d.keys()),t:new Set},i.set(e,y),(n=o.m)==null||n.call(o,e),gd(e)){const m=()=>{let _=!0;const p=(...g)=>{try{return f(t,e,...g)}finally{_||(c(t),u(t))}};try{const g=a(t,e,p);g&&(y.u=()=>{_=!0;try{g()}finally{_=!1}})}finally{_=!1}};s.add(m)}}return y},PA=(t,e)=>{var n;const r=Ke(t),i=r[1],s=r[5],o=r[6],a=r[11],l=r[19],u=a(t,e);let c=i.get(e);if(c&&!c.l.size&&!Array.from(c.t).some(d=>{var f;return(f=i.get(d))==null?void 0:f.d.has(e)})){c.u&&s.add(c.u),c=void 0,i.delete(e),(n=o.u)==null||n.call(o,e);for(const d of u.d.keys()){const f=l(t,d);f==null||f.t.delete(e)}return}return c},Ga=(t,e,n)=>{const r=Ke(t)[11],i=r(t,e),s="v"in i,o=i.v;if(Ka(n))for(const a of i.d.keys())Kw(e,n,r(t,a));i.v=n,delete i.e,(!s||!Object.is(o,i.v))&&(++i.n,Ka(o)&&gA(o))},TA=(t,e)=>{const n=Ke(t)[14];return Ha(n(t,e))},bA=(t,e,...n)=>{const r=Ke(t),i=r[12],s=r[13],o=r[16];try{return o(t,e,...n)}finally{s(t),i(t)}},AA=(t,e,n)=>{const r=Ke(t),i=r[12],s=r[18],o=r[19],l=s(t,e).l;return l.add(n),i(t),()=>{l.delete(n),o(t,e),i(t)}},Xw=new WeakMap,Ke=t=>{const e=Xw.get(t);if((Ci?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");return e};function RA(...t){const e={get(r){const i=Ke(e)[21];return i(e,r)},set(r,...i){const s=Ke(e)[22];return s(e,r,...i)},sub(r,i){const s=Ke(e)[23];return s(e,r,i)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},mA,vA,yA,_A,wA,xA,SA,EA,kA,qw,CA,Yw,PA,Ga,TA,bA,AA,void 0].map((r,i)=>t[i]||r);return Xw.set(e,Object.freeze(n)),e}const Qw={};let MA=0;function IA(t,e){const n=`atom${++MA}`,r={toString(){return(Qw?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=NA,r.write=DA),r}function NA(t){return t(this)}function DA(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function LA(){return RA()}let Gi;function OA(){return Gi||(Gi=LA(),(Qw?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Gi),globalThis.__JOTAI_DEFAULT_STORE__!==Gi&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Gi}const $A={},FA=x.createContext(void 0);function Zw(t){return x.useContext(FA)||OA()}const vd=t=>typeof(t==null?void 0:t.then)=="function",yd=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},jA=ee.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(yd(t),t)}),Lu=new WeakMap,Im=(t,e)=>{let n=Lu.get(t);return n||(n=new Promise((r,i)=>{let s=t;const o=u=>c=>{s===u&&r(c)},a=u=>c=>{s===u&&i(c)},l=()=>{try{const u=e();vd(u)?(Lu.set(u,n),s=u,u.then(o(u),a(u)),md(u,l)):r(u)}catch(u){i(u)}};t.then(o(t),a(t)),md(t,l)}),Lu.set(t,n)),n};function VA(t,e){const{delay:n,unstable_promiseStatus:r=!ee.use}={},i=Zw(),[[s,o,a],l]=x.useReducer(c=>{const d=i.get(t);return Object.is(c[0],d)&&c[1]===i&&c[2]===t?c:[d,i,t]},void 0,()=>[i.get(t),i,t]);let u=s;if((o!==i||a!==t)&&(l(),u=i.get(t)),x.useEffect(()=>{const c=i.sub(t,()=>{if(r)try{const d=i.get(t);vd(d)&&yd(Im(d,()=>i.get(t)))}catch{}if(typeof n=="number"){setTimeout(l,n);return}l()});return l(),c},[i,t,n,r]),x.useDebugValue(u),vd(u)){const c=Im(u,()=>i.get(t));return r&&yd(c),jA(c)}return u}function Ih(t,e){const n=Zw();return x.useCallback((...i)=>{if(($A?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...i)},[n,t])}function Jw(t,e){return[VA(t),Ih(t)]}/**
|
|
41
|
+
* @license lucide-react v0.539.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const BA=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zA=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),Nm=t=>{const e=zA(t);return e.charAt(0).toUpperCase()+e.slice(1)},e1=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),UA=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
|
|
46
|
+
* @license lucide-react v0.539.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/var HA={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
51
|
+
* @license lucide-react v0.539.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const WA=x.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>x.createElement("svg",{ref:l,...HA,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:e1("lucide",i),...!s&&!UA(a)&&{"aria-hidden":"true"},...a},[...o.map(([u,c])=>x.createElement(u,c)),...Array.isArray(s)?s:[s]]));/**
|
|
56
|
+
* @license lucide-react v0.539.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const Wt=(t,e)=>{const n=x.forwardRef(({className:r,...i},s)=>x.createElement(WA,{ref:s,iconNode:e,className:e1(`lucide-${BA(Nm(t))}`,`lucide-${t}`,r),...i}));return n.displayName=Nm(t),n};/**
|
|
61
|
+
* @license lucide-react v0.539.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const KA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],GA=Wt("chevron-down",KA);/**
|
|
66
|
+
* @license lucide-react v0.539.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const qA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Dm=Wt("circle-alert",qA);/**
|
|
71
|
+
* @license lucide-react v0.539.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const YA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],XA=Wt("circle-check-big",YA);/**
|
|
76
|
+
* @license lucide-react v0.539.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const QA=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ZA=Wt("eye",QA);/**
|
|
81
|
+
* @license lucide-react v0.539.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const JA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],t1=Wt("loader-circle",JA);/**
|
|
86
|
+
* @license lucide-react v0.539.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const eR=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],tR=Wt("palette",eR);/**
|
|
91
|
+
* @license lucide-react v0.539.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const nR=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],rR=Wt("pencil",nR);/**
|
|
96
|
+
* @license lucide-react v0.539.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const iR=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],sR=Wt("send",iR);/**
|
|
101
|
+
* @license lucide-react v0.539.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const oR=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aR=Wt("sparkles",oR);/**
|
|
106
|
+
* @license lucide-react v0.539.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const lR=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],uR=Wt("upload",lR);/**
|
|
111
|
+
* @license lucide-react v0.539.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const cR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],dR=Wt("x",cR);var n1={exports:{}};(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(cS,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],s={},o=null;function a(m,_){var p=m[_];if(typeof p.bind=="function")return p.bind(m);try{return Function.prototype.bind.call(p,m)}catch{return function(){return Function.prototype.apply.apply(p,[m,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(m){return m==="debug"&&(m="log"),typeof console===n?!1:m==="trace"&&r?l:console[m]!==void 0?a(console,m):console.log!==void 0?a(console,"log"):e}function c(){for(var m=this.getLevel(),_=0;_<i.length;_++){var p=i[_];this[p]=_<m?e:this.methodFactory(p,m,this.name)}if(this.log=this.debug,typeof console===n&&m<this.levels.SILENT)return"No console available for logging"}function d(m){return function(){typeof console!==n&&(c.call(this),this[m].apply(this,arguments))}}function f(m,_,p){return u(m)||d.apply(this,arguments)}function h(m,_){var p=this,g,v,w,E="loglevel";typeof m=="string"?E+=":"+m:typeof m=="symbol"&&(E=void 0);function A(R){var N=(i[R]||"silent").toUpperCase();if(!(typeof window===n||!E)){try{window.localStorage[E]=N;return}catch{}try{window.document.cookie=encodeURIComponent(E)+"="+N+";"}catch{}}}function b(){var R;if(!(typeof window===n||!E)){try{R=window.localStorage[E]}catch{}if(typeof R===n)try{var N=window.document.cookie,V=encodeURIComponent(E),$=N.indexOf(V+"=");$!==-1&&(R=/^([^;]+)/.exec(N.slice($+V.length+1))[1])}catch{}return p.levels[R]===void 0&&(R=void 0),R}}function S(){if(!(typeof window===n||!E)){try{window.localStorage.removeItem(E)}catch{}try{window.document.cookie=encodeURIComponent(E)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function k(R){var N=R;if(typeof N=="string"&&p.levels[N.toUpperCase()]!==void 0&&(N=p.levels[N.toUpperCase()]),typeof N=="number"&&N>=0&&N<=p.levels.SILENT)return N;throw new TypeError("log.setLevel() called with invalid level: "+R)}p.name=m,p.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},p.methodFactory=_||f,p.getLevel=function(){return w??v??g},p.setLevel=function(R,N){return w=k(R),N!==!1&&A(w),c.call(p)},p.setDefaultLevel=function(R){v=k(R),b()||p.setLevel(R,!1)},p.resetLevel=function(){w=null,S(),c.call(p)},p.enableAll=function(R){p.setLevel(p.levels.TRACE,R)},p.disableAll=function(R){p.setLevel(p.levels.SILENT,R)},p.rebuild=function(){if(o!==p&&(g=k(o.getLevel())),c.call(p),o===p)for(var R in s)s[R].rebuild()},g=k(o?o.getLevel():"WARN");var P=b();P!=null&&(w=k(P)),c.call(p)}o=new h,o.getLogger=function(_){if(typeof _!="symbol"&&typeof _!="string"||_==="")throw new TypeError("You must supply a name when creating a logger.");var p=s[_];return p||(p=s[_]=new h(_,o.methodFactory)),p};var y=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=y),o},o.getLoggers=function(){return s},o.default=o,o})})(n1);var fR=n1.exports;const $t=sf(fR),hR="INFO",pR=hR.toUpperCase();$t.setLevel($t.levels[pR]||$t.levels.INFO);const Ml=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>$t.trace(`${e}${n}`,...r),debug:(n,...r)=>$t.debug(`${e}${n}`,...r),info:(n,...r)=>$t.info(`${e}${n}`,...r),warn:(n,...r)=>$t.warn(`${e}${n}`,...r),error:(n,...r)=>$t.error(`${e}${n}`,...r),api:(n,...r)=>$t.info(`${e}API: ${n}`,...r),hook:(n,...r)=>$t.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>$t.debug(`${e}Mount: ${n}`,...r)}},qi=Ml("useGitPublish"),gR=()=>{const[t,e]=x.useState(!1),[n,r]=x.useState(null),i=x.useCallback(async()=>{qi.debug("publishChanges called"),e(!0),r(null);try{qi.debug("Making fetch request to /api/git/publish");const o=await fetch("/api/git/publish",{method:"POST",headers:{"Content-Type":"application/json"}});if(qi.debug("Response received",{status:o.status,ok:o.ok}),!o.ok){const l=await o.json();throw new Error(l.details||l.error||`HTTP ${o.status}`)}const a=await o.json();return qi.info("Git publish completed successfully:",a.prUrl),a}catch(o){const a=o instanceof Error?o.message:"Failed to publish changes";return r(a),qi.error("Git publish error:",o),null}finally{e(!1)}},[]);return{publishChanges:x.useCallback(async o=>{const a=await i();return a?o("success","🎉 Changes published successfully!","Your branch has been pushed and is ready for a pull request.",{label:"View PR",onClick:()=>window.open(a.prUrl,"_blank")}):n&&o("error","Failed to publish changes",n),a},[i,n]),isPublishing:t,error:n,clearError:()=>r(null)}};function Qe(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Lm(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function r1(...t){return e=>{let n=!1;const r=t.map(i=>{const s=Lm(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():Lm(t[i],null)}}}}function kn(...t){return x.useCallback(r1(...t),t)}function Il(t,e=[]){let n=[];function r(s,o){const a=x.createContext(o),l=n.length;n=[...n,o];const u=d=>{var p;const{scope:f,children:h,...y}=d,m=((p=f==null?void 0:f[t])==null?void 0:p[l])||a,_=x.useMemo(()=>y,Object.values(y));return C.jsx(m.Provider,{value:_,children:h})};u.displayName=s+"Provider";function c(d,f){var m;const h=((m=f==null?void 0:f[t])==null?void 0:m[l])||a,y=x.useContext(h);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,c]}const i=()=>{const s=n.map(o=>x.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return x.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,mR(i,...e)]}function mR(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...a,...d}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function _d(t){const e=vR(t),n=x.forwardRef((r,i)=>{const{children:s,...o}=r,a=x.Children.toArray(s),l=a.find(_R);if(l){const u=l.props.children,c=a.map(d=>d===l?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:d);return C.jsx(e,{...o,ref:i,children:x.isValidElement(u)?x.cloneElement(u,void 0,c):null})}return C.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function vR(t){const e=x.forwardRef((n,r)=>{const{children:i,...s}=n;if(x.isValidElement(i)){const o=xR(i),a=wR(s,i.props);return i.type!==x.Fragment&&(a.ref=r?r1(r,o):o),x.cloneElement(i,a)}return x.Children.count(i)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var yR=Symbol("radix.slottable");function _R(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===yR}function wR(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function xR(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function i1(t){const e=t+"CollectionProvider",[n,r]=Il(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:_,children:p}=m,g=ee.useRef(null),v=ee.useRef(new Map).current;return C.jsx(i,{scope:_,itemMap:v,collectionRef:g,children:p})};o.displayName=e;const a=t+"CollectionSlot",l=_d(a),u=ee.forwardRef((m,_)=>{const{scope:p,children:g}=m,v=s(a,p),w=kn(_,v.collectionRef);return C.jsx(l,{ref:w,children:g})});u.displayName=a;const c=t+"CollectionItemSlot",d="data-radix-collection-item",f=_d(c),h=ee.forwardRef((m,_)=>{const{scope:p,children:g,...v}=m,w=ee.useRef(null),E=kn(_,w),A=s(c,p);return ee.useEffect(()=>(A.itemMap.set(w,{ref:w,...v}),()=>void A.itemMap.delete(w))),C.jsx(f,{[d]:"",ref:E,children:g})});h.displayName=c;function y(m){const _=s(t+"CollectionConsumer",m);return ee.useCallback(()=>{const g=_.collectionRef.current;if(!g)return[];const v=Array.from(g.querySelectorAll(`[${d}]`));return Array.from(_.itemMap.values()).sort((A,b)=>v.indexOf(A.ref.current)-v.indexOf(b.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:o,Slot:u,ItemSlot:h},y,r]}var SR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nt=SR.reduce((t,e)=>{const n=_d(`Primitive.${e}`),r=x.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function s1(t,e){t&&Tl.flushSync(()=>t.dispatchEvent(e))}function Ar(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function ER(t,e=globalThis==null?void 0:globalThis.document){const n=Ar(t);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var kR="DismissableLayer",wd="dismissableLayer.update",CR="dismissableLayer.pointerDownOutside",PR="dismissableLayer.focusOutside",Om,o1=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),a1=x.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=t,u=x.useContext(o1),[c,d]=x.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=x.useState({}),y=kn(e,b=>d(b)),m=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),p=m.indexOf(_),g=c?m.indexOf(c):-1,v=u.layersWithOutsidePointerEventsDisabled.size>0,w=g>=p,E=bR(b=>{const S=b.target,k=[...u.branches].some(P=>P.contains(S));!w||k||(i==null||i(b),o==null||o(b),b.defaultPrevented||a==null||a())},f),A=AR(b=>{const S=b.target;[...u.branches].some(P=>P.contains(S))||(s==null||s(b),o==null||o(b),b.defaultPrevented||a==null||a())},f);return ER(b=>{g===u.layers.size-1&&(r==null||r(b),!b.defaultPrevented&&a&&(b.preventDefault(),a()))},f),x.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Om=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),$m(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Om)}},[c,f,n,u]),x.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),$m())},[c,u]),x.useEffect(()=>{const b=()=>h({});return document.addEventListener(wd,b),()=>document.removeEventListener(wd,b)},[]),C.jsx(nt.div,{...l,ref:y,style:{pointerEvents:v?w?"auto":"none":void 0,...t.style},onFocusCapture:Qe(t.onFocusCapture,A.onFocusCapture),onBlurCapture:Qe(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Qe(t.onPointerDownCapture,E.onPointerDownCapture)})});a1.displayName=kR;var TR="DismissableLayerBranch",l1=x.forwardRef((t,e)=>{const n=x.useContext(o1),r=x.useRef(null),i=kn(e,r);return x.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),C.jsx(nt.div,{...t,ref:i})});l1.displayName=TR;function bR(t,e=globalThis==null?void 0:globalThis.document){const n=Ar(t),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){u1(CR,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function AR(t,e=globalThis==null?void 0:globalThis.document){const n=Ar(t),r=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!r.current&&u1(PR,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $m(){const t=new CustomEvent(wd);document.dispatchEvent(t)}function u1(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?s1(i,s):i.dispatchEvent(s)}var RR=a1,MR=l1,Rr=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},IR="Portal",c1=x.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[i,s]=x.useState(!1);Rr(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?Ok.createPortal(C.jsx(nt.div,{...r,ref:e}),o):null});c1.displayName=IR;function NR(t,e){return x.useReducer((n,r)=>e[n][r]??n,t)}var Nh=t=>{const{present:e,children:n}=t,r=DR(e),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),s=kn(r.ref,LR(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:s}):null};Nh.displayName="Presence";function DR(t){const[e,n]=x.useState(),r=x.useRef(null),i=x.useRef(t),s=x.useRef("none"),o=t?"mounted":"unmounted",[a,l]=NR(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=$o(r.current);s.current=a==="mounted"?u:"none"},[a]),Rr(()=>{const u=r.current,c=i.current;if(c!==t){const f=s.current,h=$o(u);t?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Rr(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,d=h=>{const m=$o(r.current).includes(CSS.escape(h.animationName));if(h.target===e&&m&&(l("ANIMATION_END"),!i.current)){const _=e.style.animationFillMode;e.style.animationFillMode="forwards",u=c.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=_)})}},f=h=>{h.target===e&&(s.current=$o(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{c.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:x.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function $o(t){return(t==null?void 0:t.animationName)||"none"}function LR(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var OR=uy[" useInsertionEffect ".trim().toString()]||Rr;function Nl({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,s,o]=$R({defaultProp:e,onChange:n}),a=t!==void 0,l=a?t:i;{const c=x.useRef(t!==void 0);x.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,r])}const u=x.useCallback(c=>{var d;if(a){const f=FR(c)?c(t):c;f!==t&&((d=o.current)==null||d.call(o,f))}else s(c)},[a,t,s,o]);return[l,u]}function $R({defaultProp:t,onChange:e}){const[n,r]=x.useState(t),i=x.useRef(n),s=x.useRef(e);return OR(()=>{s.current=e},[e]),x.useEffect(()=>{var o;i.current!==n&&((o=s.current)==null||o.call(s,n),i.current=n)},[n,i]),[n,r,s]}function FR(t){return typeof t=="function"}var jR=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),VR="VisuallyHidden",Dh=x.forwardRef((t,e)=>C.jsx(nt.span,{...t,ref:e,style:{...jR,...t.style}}));Dh.displayName=VR;var Lh="ToastProvider",[Oh,BR,zR]=i1("Toast"),[d1]=Il("Toast",[zR]),[UR,Dl]=d1(Lh),f1=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=t,[a,l]=x.useState(null),[u,c]=x.useState(0),d=x.useRef(!1),f=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Lh}\`. Expected non-empty \`string\`.`),C.jsx(Oh.Provider,{scope:e,children:C.jsx(UR,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:x.useCallback(()=>c(h=>h+1),[]),onToastRemove:x.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};f1.displayName=Lh;var h1="ToastViewport",HR=["F8"],xd="toast.viewportPause",Sd="toast.viewportResume",p1=x.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=HR,label:i="Notifications ({hotkey})",...s}=t,o=Dl(h1,n),a=BR(n),l=x.useRef(null),u=x.useRef(null),c=x.useRef(null),d=x.useRef(null),f=kn(e,d,o.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=o.toastCount>0;x.useEffect(()=>{const _=p=>{var v;r.length!==0&&r.every(w=>p[w]||p.code===w)&&((v=d.current)==null||v.focus())};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[r]),x.useEffect(()=>{const _=l.current,p=d.current;if(y&&_&&p){const g=()=>{if(!o.isClosePausedRef.current){const A=new CustomEvent(xd);p.dispatchEvent(A),o.isClosePausedRef.current=!0}},v=()=>{if(o.isClosePausedRef.current){const A=new CustomEvent(Sd);p.dispatchEvent(A),o.isClosePausedRef.current=!1}},w=A=>{!_.contains(A.relatedTarget)&&v()},E=()=>{_.contains(document.activeElement)||v()};return _.addEventListener("focusin",g),_.addEventListener("focusout",w),_.addEventListener("pointermove",g),_.addEventListener("pointerleave",E),window.addEventListener("blur",g),window.addEventListener("focus",v),()=>{_.removeEventListener("focusin",g),_.removeEventListener("focusout",w),_.removeEventListener("pointermove",g),_.removeEventListener("pointerleave",E),window.removeEventListener("blur",g),window.removeEventListener("focus",v)}}},[y,o.isClosePausedRef]);const m=x.useCallback(({tabbingDirection:_})=>{const g=a().map(v=>{const w=v.ref.current,E=[w,...rM(w)];return _==="forwards"?E:E.reverse()});return(_==="forwards"?g.reverse():g).flat()},[a]);return x.useEffect(()=>{const _=d.current;if(_){const p=g=>{var E,A,b;const v=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!v){const S=document.activeElement,k=g.shiftKey;if(g.target===_&&k){(E=u.current)==null||E.focus();return}const N=m({tabbingDirection:k?"backwards":"forwards"}),V=N.findIndex($=>$===S);Ou(N.slice(V+1))?g.preventDefault():k?(A=u.current)==null||A.focus():(b=c.current)==null||b.focus()}};return _.addEventListener("keydown",p),()=>_.removeEventListener("keydown",p)}},[a,m]),C.jsxs(MR,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&C.jsx(Ed,{ref:u,onFocusFromOutsideViewport:()=>{const _=m({tabbingDirection:"forwards"});Ou(_)}}),C.jsx(Oh.Slot,{scope:n,children:C.jsx(nt.ol,{tabIndex:-1,...s,ref:f})}),y&&C.jsx(Ed,{ref:c,onFocusFromOutsideViewport:()=>{const _=m({tabbingDirection:"backwards"});Ou(_)}})]})});p1.displayName=h1;var g1="ToastFocusProxy",Ed=x.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,s=Dl(g1,n);return C.jsx(Dh,{tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=s.viewport)!=null&&u.contains(a))&&r()}})});Ed.displayName=g1;var mo="Toast",WR="toast.swipeStart",KR="toast.swipeMove",GR="toast.swipeCancel",qR="toast.swipeEnd",m1=x.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...o}=t,[a,l]=Nl({prop:r,defaultProp:i??!0,onChange:s,caller:mo});return C.jsx(Nh,{present:n||a,children:C.jsx(QR,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Ar(t.onPause),onResume:Ar(t.onResume),onSwipeStart:Qe(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Qe(t.onSwipeMove,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Qe(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Qe(t.onSwipeEnd,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});m1.displayName=mo;var[YR,XR]=d1(mo,{onClose(){}}),QR=x.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,...y}=t,m=Dl(mo,n),[_,p]=x.useState(null),g=kn(e,$=>p($)),v=x.useRef(null),w=x.useRef(null),E=i||m.duration,A=x.useRef(0),b=x.useRef(E),S=x.useRef(0),{onToastAdd:k,onToastRemove:P}=m,R=Ar(()=>{var K;(_==null?void 0:_.contains(document.activeElement))&&((K=m.viewport)==null||K.focus()),o()}),N=x.useCallback($=>{!$||$===1/0||(window.clearTimeout(S.current),A.current=new Date().getTime(),S.current=window.setTimeout(R,$))},[R]);x.useEffect(()=>{const $=m.viewport;if($){const K=()=>{N(b.current),u==null||u()},Q=()=>{const U=new Date().getTime()-A.current;b.current=b.current-U,window.clearTimeout(S.current),l==null||l()};return $.addEventListener(xd,Q),$.addEventListener(Sd,K),()=>{$.removeEventListener(xd,Q),$.removeEventListener(Sd,K)}}},[m.viewport,E,l,u,N]),x.useEffect(()=>{s&&!m.isClosePausedRef.current&&N(E)},[s,E,m.isClosePausedRef,N]),x.useEffect(()=>(k(),()=>P()),[k,P]);const V=x.useMemo(()=>_?E1(_):null,[_]);return m.viewport?C.jsxs(C.Fragment,{children:[V&&C.jsx(ZR,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:V}),C.jsx(YR,{scope:n,onClose:R,children:Tl.createPortal(C.jsx(Oh.ItemSlot,{scope:n,children:C.jsx(RR,{asChild:!0,onEscapeKeyDown:Qe(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||R(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:C.jsx(nt.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection,...y,ref:g,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Qe(t.onKeyDown,$=>{$.key==="Escape"&&(a==null||a($.nativeEvent),$.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,R()))}),onPointerDown:Qe(t.onPointerDown,$=>{$.button===0&&(v.current={x:$.clientX,y:$.clientY})}),onPointerMove:Qe(t.onPointerMove,$=>{if(!v.current)return;const K=$.clientX-v.current.x,Q=$.clientY-v.current.y,U=!!w.current,M=["left","right"].includes(m.swipeDirection),L=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,z=M?L(0,K):0,J=M?0:L(0,Q),G=$.pointerType==="touch"?10:2,ve={x:z,y:J},ue={originalEvent:$,delta:ve};U?(w.current=ve,Fo(KR,d,ue,{discrete:!1})):Fm(ve,m.swipeDirection,G)?(w.current=ve,Fo(WR,c,ue,{discrete:!1}),$.target.setPointerCapture($.pointerId)):(Math.abs(K)>G||Math.abs(Q)>G)&&(v.current=null)}),onPointerUp:Qe(t.onPointerUp,$=>{const K=w.current,Q=$.target;if(Q.hasPointerCapture($.pointerId)&&Q.releasePointerCapture($.pointerId),w.current=null,v.current=null,K){const U=$.currentTarget,M={originalEvent:$,delta:K};Fm(K,m.swipeDirection,m.swipeThreshold)?Fo(qR,h,M,{discrete:!0}):Fo(GR,f,M,{discrete:!0}),U.addEventListener("click",L=>L.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),ZR=t=>{const{__scopeToast:e,children:n,...r}=t,i=Dl(mo,e),[s,o]=x.useState(!1),[a,l]=x.useState(!1);return tM(()=>o(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:C.jsx(c1,{asChild:!0,children:C.jsx(Dh,{...r,children:s&&C.jsxs(C.Fragment,{children:[i.label," ",n]})})})},JR="ToastTitle",v1=x.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return C.jsx(nt.div,{...r,ref:e})});v1.displayName=JR;var eM="ToastDescription",y1=x.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return C.jsx(nt.div,{...r,ref:e})});y1.displayName=eM;var _1="ToastAction",w1=x.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?C.jsx(S1,{altText:n,asChild:!0,children:C.jsx($h,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${_1}\`. Expected non-empty \`string\`.`),null)});w1.displayName=_1;var x1="ToastClose",$h=x.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=XR(x1,n);return C.jsx(S1,{asChild:!0,children:C.jsx(nt.button,{type:"button",...r,ref:e,onClick:Qe(t.onClick,i.onClose)})})});$h.displayName=x1;var S1=x.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return C.jsx(nt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function E1(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),nM(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...E1(r))}}),e}function Fo(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?s1(i,s):i.dispatchEvent(s)}var Fm=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),s=r>i;return e==="left"||e==="right"?s&&r>n:!s&&i>n};function tM(t=()=>{}){const e=Ar(t);Rr(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function nM(t){return t.nodeType===t.ELEMENT_NODE}function rM(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Ou(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var iM=f1,sM=p1,oM=m1,aM=v1,lM=y1,uM=w1,cM=$h;const k1=({isOpen:t,onOpenChange:e,type:n,title:r,description:i,action:s})=>{const o=()=>{switch(n){case"success":return{Icon:XA,bgColor:"bg-accent-success/90",borderColor:"border-accent-success",textColor:"text-content",iconColor:"text-content",actionStyles:"border-white hover:bg-white/10 hover:border-white text-content"};case"error":return{Icon:Dm,bgColor:"bg-accent-error/90",borderColor:"border-accent-error",textColor:"text-content",iconColor:"text-content",actionStyles:"border-white hover:bg-white/10 hover:border-white text-content"};default:return{Icon:Dm,bgColor:"bg-content-muted/90",borderColor:"border-divider",textColor:"text-content",iconColor:"text-content-subtle",actionStyles:"border-divider hover:bg-content-muted/10 hover:border-divider"}}},{Icon:a,bgColor:l,borderColor:u,textColor:c,iconColor:d,actionStyles:f}=o();return C.jsxs(oM,{className:`${l} ${u} ${c} data-[state=open]:animate-slideIn data-[state=closed]:animate-hide data-[swipe=end]:animate-swipeOut grid grid-cols-[auto_1fr_auto] items-start gap-3 rounded-lg border p-4 shadow-lg data-[swipe=cancel]:translate-x-0 data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)]`,open:t,onOpenChange:e,duration:9e3,children:[C.jsx(a,{className:`${d} mt-0.5 h-5 w-5`}),C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsxs("div",{className:"flex flex-col gap-1",children:[C.jsx(aM,{className:"text-sm font-semibold",children:r}),i&&C.jsx(lM,{className:"text-sm",children:i})]}),s&&C.jsx(uM,{className:`rounded border px-3 py-1.5 text-xs font-medium transition-colors ${f} self-start`,altText:s.label,onClick:s.onClick,children:s.label})]}),C.jsx(cM,{className:"rounded p-1 transition-colors hover:bg-black/10",children:C.jsx(dR,{className:"h-4 w-4"})})]})},C1=({children:t})=>C.jsxs(iM,{swipeDirection:"right",children:[t,C.jsx(sM,{className:"z-ui-primary fixed bottom-0 right-0 m-0 flex w-96 max-w-[100vw] list-none flex-col gap-3 p-6 outline-none"})]}),$u=({onClick:t,isActive:e=!1,isDisabled:n=!1,title:r,children:i,className:s=""})=>{const o="p-2 rounded-md transition-colors",a=e?"bg-primary/20 text-primary":"text-content hover:bg-main-input",l=n?"opacity-50 cursor-not-allowed":"";return C.jsx("button",{onClick:t,disabled:n,className:`${o} ${a} ${l} ${s}`,title:r,children:i})},dM=({mode:t,onModeChange:e,isLoading:n=!1})=>{const{publishChanges:r,isPublishing:i}=gR(),[s,o]=x.useState({isOpen:!1,type:"success",title:"",onOpenChange:()=>{},description:void 0,action:void 0}),a=(l,u,c,d)=>{o({isOpen:!0,type:l,title:u,description:c,action:d,onOpenChange:f=>o(h=>({...h,isOpen:f}))})};return C.jsxs(C1,{children:[C.jsx(Uw.div,{className:"z-ui-primary absolute bottom-6 left-1/2 -translate-x-1/2 transform",initial:{y:100,opacity:0},animate:{y:n?100:0,opacity:n?0:1},transition:{duration:.6,ease:"easeOut",delay:n?0:.3},children:C.jsxs("div",{className:"bg-main border-primary/30 flex items-center space-x-1 rounded-lg border p-2 shadow-lg",children:[C.jsx($u,{onClick:()=>e(!1),isActive:t==="view",title:"View Mode",children:C.jsx(ZA,{className:"h-5 w-5"})}),C.jsx($u,{onClick:()=>e(!0),isActive:t==="edit",title:"Edit Mode - Drag to select elements",children:C.jsx(rR,{className:"h-5 w-5"})}),C.jsx($u,{onClick:()=>r(a),isDisabled:i,title:i?"Publishing changes...":"Publish changes & create PR",children:i?C.jsx("div",{className:"h-5 w-5 animate-spin",children:C.jsxs("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[C.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),C.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):C.jsx(uR,{className:"h-5 w-5"})})]})}),C.jsx(k1,{isOpen:s.isOpen,onOpenChange:s.onOpenChange,type:s.type,title:s.title,description:s.description,action:s.action})]})},P1=t=>{var e;try{return t.contentDocument||((e=t.contentWindow)==null?void 0:e.document)}catch(n){return console.error("[IframeDom] Cannot access iframe document:",n),null}},jm=(t,e,n)=>{const r=P1(t);if(!r)return null;const i=t.getBoundingClientRect(),s=e-i.left,o=n-i.top;return r.elementFromPoint(s,o)},fM=t=>Object.fromEntries(Array.from(t).map(e=>[e,t.getPropertyValue(e)])),T1=t=>{var r,i;if(t.id)return`//*[@id="${t.id}"]`;if(t===((r=t.ownerDocument)==null?void 0:r.body))return"/html/body";let e=0;const n=((i=t.parentNode)==null?void 0:i.childNodes)||[];for(let s=0;s<n.length;s++){const o=n[s];if(o===t){const a=t.parentNode;if(a)return T1(a)+"/"+t.tagName.toLowerCase()+"["+(e+1)+"]"}o.nodeType===1&&o.tagName===t.tagName&&e++}return""},Fu=t=>{var o,a,l;const e=t.getBoundingClientRect(),n=(o=t.ownerDocument)==null?void 0:o.defaultView,r=n==null?void 0:n.getComputedStyle(t);let i="";try{const u=t;"className"in u&&(typeof u.className=="string"?i=u.className:u.className&&typeof u.className=="object"&&"baseVal"in u.className&&(i=u.className.baseVal||""))}catch(u){i="",console.warn("[IframeDom] Error getting className:",u)}let s="";try{s=t.id||""}catch(u){s="",console.warn("[IframeDom] Error getting id:",u)}return{tagName:t.tagName.toLowerCase(),className:i,id:s,textContent:((a=t.textContent)==null?void 0:a.trim().substring(0,100))||"",innerHTML:((l=t.innerHTML)==null?void 0:l.substring(0,200))||"",attributes:Array.from(t.attributes).reduce((u,c)=>(u[c.name]=c.value,u),{}),computedStyles:r?fM(r):{},boundingRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,left:e.left,right:e.right,bottom:e.bottom},xpath:T1(t),filePath:null}},Ll=IA([]),b1={theme:{extend:{zIndex:{"capture-overlay":"35","selection-overlay":"30"},colors:{primary:{DEFAULT:"#f97316",hover:"#ea580c",border:"#ff6b35"}}}}},Fh=b1.theme.extend.zIndex,qa=b1.theme.extend.colors,hM=t=>{const e=t.tagName.toLowerCase();return!!(["path","g","circle","rect","line","polygon"].includes(e)||e==="i"&&t.className&&/\b(fa|icon|material)\b/.test(t.className))},pM=(t,e)=>{const r=t.map(s=>{const o=s.getBoundingClientRect(),l=o.width*o.height/e,u=s.tagName.toLowerCase();let c=l>=.2&&l<=3?100:20;return["button","a","input","select","textarea"].includes(u)&&(c+=50),(l<.05||l>10)&&(c-=50),{element:s,score:c,ratio:l}}).filter(s=>s.score>30).filter(s=>!hM(s.element)).sort((s,o)=>o.score-s.score),i=[];for(const s of r)i.some(a=>a.element.contains(s.element))||i.push(s);return console.log(`[IframeSelection] Multi-selection: ${i.length} elements selected`),i.slice(0,6).map(s=>s.element)},gM=()=>{let t=document.getElementById("rivet-hover-overlay");return t||(t=document.createElement("div"),t.id="rivet-hover-overlay",t.style.cssText=`
|
|
116
|
+
position: fixed;
|
|
117
|
+
pointer-events: none;
|
|
118
|
+
z-index: ${Fh["selection-overlay"]};
|
|
119
|
+
border: 3px solid ${qa.primary.border};
|
|
120
|
+
border-radius: 2px;
|
|
121
|
+
background-color: rgb(from ${qa.primary.hover} r g b / 0.2);
|
|
122
|
+
display: none;
|
|
123
|
+
`,document.body.appendChild(t)),t},mM=t=>{const e=`rivet-selection-${Math.random().toString(36).substr(2,9)}`,n=document.createElement("div");return n.id=e,n.style.cssText=`
|
|
124
|
+
position: fixed;
|
|
125
|
+
pointer-events: none;
|
|
126
|
+
z-index: ${Fh["selection-overlay"]};
|
|
127
|
+
border: 3px solid ${qa.primary.border};
|
|
128
|
+
border-radius: 2px;
|
|
129
|
+
background-color: rgb(from ${qa.primary.DEFAULT} r g b / 0.2);
|
|
130
|
+
box-shadow: box-shadow: 0 0 10px rgba(255, 107, 53, 0.7);
|
|
131
|
+
`,n.__element=t,document.body.appendChild(n),n},ju=(t,e,n,r)=>{const i=document.querySelector('[data-cy="element-inspector"]');if(!i)return!1;const s=i.getBoundingClientRect(),o=t+n,a=e+r;return!(o<=s.left||t>=s.right||a<=s.top||e>=s.bottom)},vM=t=>{let e=t.querySelector("#rivet-mouse-capture");return e||(e=document.createElement("div"),e.id="rivet-mouse-capture",e.style.cssText=`
|
|
132
|
+
position: absolute;
|
|
133
|
+
top: 0;
|
|
134
|
+
left: 0;
|
|
135
|
+
right: 0;
|
|
136
|
+
bottom: 0;
|
|
137
|
+
z-index: ${Fh["capture-overlay"]};
|
|
138
|
+
background: transparent;
|
|
139
|
+
pointer-events: none;
|
|
140
|
+
display: none;
|
|
141
|
+
`,t.appendChild(e)),e},yM=({mode:t})=>{const e=x.useRef(null),n=Ih(Ll),[r,i]=x.useState(null),[s,o]=x.useState(new Set),[a,l]=x.useState(null),u=x.useCallback(async k=>{if(console.log(`[IframeSelection] searchComponents called for ${k.length} element(s)!`,k.map(P=>P==null?void 0:P.tagName)),!k||k.length===0)return[];try{const P=await fetch("/api/search-components",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)});return P.ok?(await P.json()).elements||[]:(console.error(`Component search failed: HTTP ${P.status}`),[])}catch(P){return console.error("Component search error:",P),[]}},[]),c=x.useCallback(async k=>{const P=await u(k);n(R=>[...R,...P])},[u,n]),d=x.useCallback(k=>{n(P=>P.filter(R=>!k.some(N=>R.xpath===N.xpath)))},[n]),f=a!==null,h=t==="edit",y=x.useCallback(k=>{const P=e.current,R=gM();if(!k||!P){R.style.display="none";return}const N=P.getBoundingClientRect(),V=k.getBoundingClientRect(),$=N.left+V.left,K=N.top+V.top,Q=V.width,U=V.height;if(ju($,K,Q,U)){R.style.display="none";return}R.style.display="block",R.style.left=`${$}px`,R.style.top=`${K}px`,R.style.width=`${Q}px`,R.style.height=`${U}px`},[]),m=x.useCallback(k=>{const P=e.current;if(P)if(s.has(k))o(N=>{const V=new Set(N);return V.delete(k),V}),document.querySelectorAll('[id^="rivet-selection-"]').forEach(N=>{N.__element===k&&N.remove()});else{o(U=>new Set(U).add(k));const R=P.getBoundingClientRect(),N=k.getBoundingClientRect(),V=R.left+N.left,$=R.top+N.top,K=N.width,Q=N.height;if(!ju(V,$,K,Q)){const U=mM(k);U.style.left=`${V}px`,U.style.top=`${$}px`,U.style.width=`${K}px`,U.style.height=`${Q}px`}}},[s]),_=x.useCallback(()=>{const k=document.getElementById("rivet-hover-overlay");k&&(k.style.display="none"),i(null)},[]),p=x.useCallback(()=>{document.querySelectorAll('[id^="rivet-selection-"]').forEach(P=>P.remove()),o(new Set)},[]),g=x.useCallback(k=>{if(console.log("[IframeSelection] Mouse move detected, editMode:",h,"boxSelection:",f),!h||!e.current||f)return;console.log("[IframeSelection] Mouse move in edit mode:",{x:k.clientX,y:k.clientY});const P=jm(e.current,k.clientX,k.clientY);if(!P){console.log("[IframeSelection] No element found at point");return}console.log("[IframeSelection] Element found:",P.tagName),P&&P!==r&&(i(P),y(P))},[h,r,y,f]),v=x.useCallback(k=>{if(!h||!e.current||f)return;k.preventDefault(),k.stopPropagation();const P=jm(e.current,k.clientX,k.clientY);if(P){console.log("[IframeSelection] Element clicked for selection toggle:",P.tagName);const R=Fu(P);s.has(P)?(console.log("[IframeSelection] Removing element from selection"),d([R])):(console.log("[IframeSelection] Adding element to selection"),c([R])),m(P)}},[h,f,s,m,c,d]),w=x.useCallback(k=>{!h||!e.current||(k.preventDefault(),k.stopPropagation(),l({x:k.clientX,y:k.clientY}),_())},[h,_]),E=x.useCallback(k=>{if(!f||!a||!e.current)return;k.preventDefault(),k.stopPropagation();const P=e.current,R=P.getBoundingClientRect(),N={left:Math.min(a.x,k.clientX)-R.left,top:Math.min(a.y,k.clientY)-R.top,right:Math.max(a.x,k.clientX)-R.left,bottom:Math.max(a.y,k.clientY)-R.top},V=P1(P);if(V){const K=Array.from(V.querySelectorAll("*")).filter(M=>{const L=M.getBoundingClientRect();return L.left<N.right&&L.right>N.left&&L.top<N.bottom&&L.bottom>N.top&&L.width>0&&L.height>0}),Q=(N.right-N.left)*(N.bottom-N.top),U=pM(K,Q);if(console.log("[IframeSelection] Using multi-element selection logic"),U.length===1){const M=Fu(U[0]);console.log("[IframeSelection] Single element via box selection:",U[0].tagName),c([M])}else if(U.length>1){const M=U.map(Fu);console.log("[IframeSelection] Multiple elements selected:",M.length),c(M)}else console.log("[IframeSelection] No meaningful elements found in selection")}l(null)},[f,a,c]),A=x.useCallback(k=>{if(e.current=k,!k)return;const P=()=>{console.log("[IframeSelection] Iframe loaded")};return k.addEventListener("load",P),()=>{k.removeEventListener("load",P)}},[]);x.useEffect(()=>{var k,P;if(!h){if(_(),p(),l(null),(k=e.current)!=null&&k.parentElement){const R=e.current.parentElement.querySelector("#rivet-mouse-capture");R&&(R.style.display="none",R.style.pointerEvents="none")}document.body.style.cursor="auto";return}if((P=e.current)!=null&&P.parentElement){const R=e.current,N=vM(R.parentElement);N.style.display="block",N.style.pointerEvents="auto",N.style.cursor="crosshair",document.body.style.cursor="crosshair"}},[h,_,p]);const b=x.useCallback(()=>{const k=e.current;if(!k)return;const P=k.getBoundingClientRect();document.querySelectorAll('[id^="rivet-selection-"]').forEach(N=>{const V=N,$=V.__element;if($){const K=$.getBoundingClientRect(),Q=P.left+K.left,U=P.top+K.top,M=K.width,L=K.height;ju(Q,U,M,L)?V.style.display="none":(V.style.display="block",V.style.left=`${Q}px`,V.style.top=`${U}px`,V.style.width=`${M}px`,V.style.height=`${L}px`)}})},[]);x.useEffect(()=>{if(!h)return;const k=new ResizeObserver(()=>{b()}),P=new MutationObserver(()=>{b()});if(e.current){k.observe(e.current);const R=e.current.contentDocument;R&&P.observe(R.body,{childList:!0,subtree:!0,attributes:!0})}return window.addEventListener("resize",b),()=>{k.disconnect(),P.disconnect(),window.removeEventListener("resize",b)}},[h,b]),x.useEffect(()=>{var P;if(!h||!((P=e.current)!=null&&P.parentElement))return;const k=e.current.parentElement.querySelector("#rivet-mouse-capture");if(k)return console.log("[IframeSelection] Setting up mouse listeners on overlay"),k.addEventListener("mousemove",g),k.addEventListener("mouseleave",_),k.addEventListener("click",v),k.addEventListener("mousedown",w),k.addEventListener("mouseup",E),()=>{console.log("[IframeSelection] Cleaning up mouse listeners"),k.removeEventListener("mousemove",g),k.removeEventListener("mouseleave",_),k.removeEventListener("click",v),k.removeEventListener("mousedown",w),k.removeEventListener("mouseup",E)}},[h,g,v,w,E,_]),x.useEffect(()=>()=>{const k=document.getElementById("rivet-hover-overlay");k&&k.remove(),document.querySelectorAll('[id^="rivet-selection-"]').forEach(N=>N.remove()),document.querySelectorAll("#rivet-mouse-capture").forEach(N=>N.remove())},[]);const S=x.useCallback(()=>{i(null),o(new Set),l(null),_(),p()},[_,p]);return{setupIframe:A,clearSelectionState:S}},_M=({isLoading:t=!1})=>{const e=Ih(Ll),[n,r]=x.useState("view"),{setupIframe:i}=yM({mode:n});x.useEffect(()=>{n==="view"&&e([])},[n,e]);const s=o=>{r(o?"edit":"view")};return C.jsxs("div",{className:"relative h-full w-full",children:[C.jsx(dM,{mode:n,onModeChange:s,isLoading:t}),C.jsx("iframe",{ref:i,src:"/",className:"h-full w-full border-none",title:"Project Preview",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-modals"})]})},wM=({type:t,value:e,onChange:n,disabled:r=!1})=>{const i=s=>{n(s.target.value)};switch(t){case"color":return C.jsxs("div",{className:"border-divider bg-main-input focus-within:ring-primary focus-within:border-primary flex w-28 items-center space-x-1 rounded border px-2 py-1 focus-within:ring-1",children:[C.jsx("input",{type:"color",value:e,onChange:i,disabled:r,className:"flex-shrink-0 cursor-pointer rounded border-0 outline-none",style:{width:"16px",height:"16px",padding:"0",margin:"0",border:"none",borderRadius:"2px",WebkitAppearance:"none",MozAppearance:"none",appearance:"none",aspectRatio:"1/1"},title:e}),C.jsx("span",{className:"text-content min-w-0 flex-1 text-center font-mono text-xs",children:e})]});case"range":return C.jsx("input",{type:"text",value:`${e}%`,onChange:s=>{const o=s.target.value.replace("%","");n(o)},disabled:r,className:"border-divider bg-main-input focus:ring-primary focus:border-primary text-content placeholder-content-subtle w-28 rounded border px-4 py-1 text-right text-xs focus:ring-1",placeholder:"100%"});case"text":case"spacing":default:return C.jsx("input",{type:"text",value:e,onChange:i,disabled:r,className:"border-divider bg-main-input focus:ring-primary focus:border-primary text-content placeholder-content-subtle w-28 rounded border px-4 py-1 text-right text-xs focus:ring-1"})}},Vm=Ml("StreamingUtils"),xM=async(t,e)=>{var c;const{url:n,method:r="POST",headers:i={},body:s}=t,{onChunk:o,onProgress:a,onComplete:l,onError:u}=e;try{const d=await fetch(n,{method:r,headers:{"Content-Type":"application/json",...i},body:JSON.stringify(s)});if(!d.ok)throw new Error(`HTTP error! status: ${d.status}`);const f=(c=d.body)==null?void 0:c.getReader(),h=new TextDecoder;if(!f)throw new Error("No response body reader available");let y="",m="";for(;;){const{done:_,value:p}=await f.read();if(_)break;y+=h.decode(p,{stream:!0});const g=y.split(`
|
|
142
|
+
`);y=g.pop()||"";for(const v of g)if(v.trim()!==""){if(v.startsWith("event: ")){m=v.slice(7).trim();continue}if(v.startsWith("data: "))try{const w=JSON.parse(v.slice(6));if(m==="progress")a("current",w.content||"");else if(w.content&&!w.done)o("current",w.content);else if(w.done){l("current",w.usage,w);break}else if(w.error){u("current",w.error);break}}catch(w){Vm.error("Failed to parse SSE data:",w)}}}}catch(d){Vm.error("Streaming request failed:",d);const f=d instanceof Error?d.message:"An unexpected error occurred.";u("unknown",f)}},SM=t=>{const e=(l,u)=>{t(c=>c.map(d=>d.id===l?{...d,message:d.message+u}:d))},n=l=>{t(u=>u.map(c=>c.id===l?{...c,isLoading:!1}:c))},r=(l,u)=>{t(c=>c.map(d=>d.id===l?{...d,message:`Error: ${u}`,isLoading:!1}:d))},i=(l,u,c="",d=!1)=>{const f={id:l,message:c,isUser:u,isLoading:!u,isProgress:d};t(h=>[...h,f])};return{updateStreamingMessage:e,finalizeStreamingMessage:n,setErrorMessage:r,addStreamingMessage:i,addProgressMessage:(l,u="")=>{i(l,!1,u,!0)},updateOrAddProgressMessage:(l,u)=>{t(c=>{const d=c.filter(h=>!h.isProgress),f={id:l,message:u,isUser:!1,isLoading:!0,isProgress:!0};return[...d,f]})},removeProgressMessages:()=>{t(l=>l.filter(u=>!u.isProgress))}}},Bm=Ml("useGenerateCode"),EM=()=>{const[t,e]=x.useState(!1),[n,r]=x.useState(null),[i,s]=x.useState(""),o=x.useCallback(async c=>{e(!0),r(null),s("");try{const{instruction:d,elements:f,temperature:h=.7,shouldStream:y=!1,messages:m,onChunk:_,onProgress:p,onComplete:g,onError:v}=c;return f&&f.length>0?await a({instruction:d,elements:f,temperature:h},{onChunk:_,onProgress:p,onComplete:g,onError:v}):(y&&m&&Bm.warn("Streaming LLM requests are not supported yet"),await l({instruction:d,messages:m,temperature:h}))}catch(d){const f=d instanceof Error?d.message:"Code generation failed";return r(f),Bm.error("Code generation error:",f),null}finally{e(!1)}},[]),a=async(c,d)=>{var m;const f={url:"/api/code/modify",body:{instruction:c.instruction,elements:c.elements,temperature:c.temperature}};let h=null,y=null;try{if(await xM(f,{onChunk:(_,p)=>{var g;s(v=>v+p),(g=d.onChunk)==null||g.call(d,p)},onProgress:(_,p)=>{var g;(g=d.onProgress)==null||g.call(d,p)},onComplete:(_,p,g)=>{var w;h=g||{changes:"Code modification completed",filesModified:[],totalElements:c.elements.length},(w=d.onComplete)==null||w.call(d,p)},onError:(_,p)=>{var g;y=p,(g=d.onError)==null||g.call(d,p)}}),y)throw new Error(y);return h}catch(_){const p=_ instanceof Error?_.message:"Streaming failed";throw y||(m=d.onError)==null||m.call(d,p),_}},l=async c=>{var h;const d=await fetch("/api/code/modify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:c.messages||[{role:"user",content:c.instruction}],temperature:c.temperature,stream:!1})});if(!d.ok){const y=await d.json();throw new Error(y.error||`HTTP ${d.status}`)}const f=await d.json();return{content:((h=f.data)==null?void 0:h.text)||f.text}},u=x.useCallback(async(c,d,f)=>{const y=`Apply these CSS styles: ${Object.entries(d).map(([m,_])=>`${m}: ${_}`).join(", ")}`;return o({instruction:y,elements:[c],temperature:.3,...f})},[o]);return{generateCode:o,generateCodeWithCSS:u,isGenerating:t,error:n,streamingContent:i,clearError:()=>r(null),clearStreamingContent:()=>s("")}};var kM=uy[" useId ".trim().toString()]||(()=>{}),CM=0;function A1(t){const[e,n]=x.useState(kM());return Rr(()=>{n(r=>r??String(CM++))},[t]),t||(e?`radix-${e}`:"")}var Ol="Collapsible",[PM,R1]=Il(Ol),[TM,jh]=PM(Ol),M1=x.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:o,...a}=t,[l,u]=Nl({prop:r,defaultProp:i??!1,onChange:o,caller:Ol});return C.jsx(TM,{scope:n,disabled:s,contentId:A1(),open:l,onOpenToggle:x.useCallback(()=>u(c=>!c),[u]),children:C.jsx(nt.div,{"data-state":Bh(l),"data-disabled":s?"":void 0,...a,ref:e})})});M1.displayName=Ol;var I1="CollapsibleTrigger",N1=x.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=jh(I1,n);return C.jsx(nt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Bh(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:Qe(t.onClick,i.onOpenToggle)})});N1.displayName=I1;var Vh="CollapsibleContent",D1=x.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=jh(Vh,t.__scopeCollapsible);return C.jsx(Nh,{present:n||i.open,children:({present:s})=>C.jsx(bM,{...r,ref:e,present:s})})});D1.displayName=Vh;var bM=x.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=t,o=jh(Vh,n),[a,l]=x.useState(r),u=x.useRef(null),c=kn(e,u),d=x.useRef(0),f=d.current,h=x.useRef(0),y=h.current,m=o.open||a,_=x.useRef(m),p=x.useRef(void 0);return x.useEffect(()=>{const g=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(g)},[]),Rr(()=>{const g=u.current;if(g){p.current=p.current||{transitionDuration:g.style.transitionDuration,animationName:g.style.animationName},g.style.transitionDuration="0s",g.style.animationName="none";const v=g.getBoundingClientRect();d.current=v.height,h.current=v.width,_.current||(g.style.transitionDuration=p.current.transitionDuration,g.style.animationName=p.current.animationName),l(r)}},[o.open,r]),C.jsx(nt.div,{"data-state":Bh(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m,...s,ref:c,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:m&&i})});function Bh(t){return t?"open":"closed"}var AM=M1,RM=N1,MM=D1,IM=x.createContext(void 0);function NM(t){const e=x.useContext(IM);return t||e||"ltr"}var Kt="Accordion",DM=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[zh,LM,OM]=i1(Kt),[$l]=Il(Kt,[OM,R1]),Uh=R1(),L1=ee.forwardRef((t,e)=>{const{type:n,...r}=t,i=r,s=r;return C.jsx(zh.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?C.jsx(VM,{...s,ref:e}):C.jsx(jM,{...i,ref:e})})});L1.displayName=Kt;var[O1,$M]=$l(Kt),[$1,FM]=$l(Kt,{collapsible:!1}),jM=ee.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:s=!1,...o}=t,[a,l]=Nl({prop:n,defaultProp:r??"",onChange:i,caller:Kt});return C.jsx(O1,{scope:t.__scopeAccordion,value:ee.useMemo(()=>a?[a]:[],[a]),onItemOpen:l,onItemClose:ee.useCallback(()=>s&&l(""),[s,l]),children:C.jsx($1,{scope:t.__scopeAccordion,collapsible:s,children:C.jsx(F1,{...o,ref:e})})})}),VM=ee.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=t,[o,a]=Nl({prop:n,defaultProp:r??[],onChange:i,caller:Kt}),l=ee.useCallback(c=>a((d=[])=>[...d,c]),[a]),u=ee.useCallback(c=>a((d=[])=>d.filter(f=>f!==c)),[a]);return C.jsx(O1,{scope:t.__scopeAccordion,value:o,onItemOpen:l,onItemClose:u,children:C.jsx($1,{scope:t.__scopeAccordion,collapsible:!0,children:C.jsx(F1,{...s,ref:e})})})}),[BM,Fl]=$l(Kt),F1=ee.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:s="vertical",...o}=t,a=ee.useRef(null),l=kn(a,e),u=LM(n),d=NM(i)==="ltr",f=Qe(t.onKeyDown,h=>{var S;if(!DM.includes(h.key))return;const y=h.target,m=u().filter(k=>{var P;return!((P=k.ref.current)!=null&&P.disabled)}),_=m.findIndex(k=>k.ref.current===y),p=m.length;if(_===-1)return;h.preventDefault();let g=_;const v=0,w=p-1,E=()=>{g=_+1,g>w&&(g=v)},A=()=>{g=_-1,g<v&&(g=w)};switch(h.key){case"Home":g=v;break;case"End":g=w;break;case"ArrowRight":s==="horizontal"&&(d?E():A());break;case"ArrowDown":s==="vertical"&&E();break;case"ArrowLeft":s==="horizontal"&&(d?A():E());break;case"ArrowUp":s==="vertical"&&A();break}const b=g%p;(S=m[b].ref.current)==null||S.focus()});return C.jsx(BM,{scope:n,disabled:r,direction:i,orientation:s,children:C.jsx(zh.Slot,{scope:n,children:C.jsx(nt.div,{...o,"data-orientation":s,ref:l,onKeyDown:r?void 0:f})})})}),Ya="AccordionItem",[zM,Hh]=$l(Ya),j1=ee.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...i}=t,s=Fl(Ya,n),o=$M(Ya,n),a=Uh(n),l=A1(),u=r&&o.value.includes(r)||!1,c=s.disabled||t.disabled;return C.jsx(zM,{scope:n,open:u,disabled:c,triggerId:l,children:C.jsx(AM,{"data-orientation":s.orientation,"data-state":W1(u),...a,...i,ref:e,disabled:c,open:u,onOpenChange:d=>{d?o.onItemOpen(r):o.onItemClose(r)}})})});j1.displayName=Ya;var V1="AccordionHeader",B1=ee.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Fl(Kt,n),s=Hh(V1,n);return C.jsx(nt.h3,{"data-orientation":i.orientation,"data-state":W1(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:e})});B1.displayName=V1;var kd="AccordionTrigger",z1=ee.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Fl(Kt,n),s=Hh(kd,n),o=FM(kd,n),a=Uh(n);return C.jsx(zh.ItemSlot,{scope:n,children:C.jsx(RM,{"aria-disabled":s.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:s.triggerId,...a,...r,ref:e})})});z1.displayName=kd;var U1="AccordionContent",H1=ee.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Fl(Kt,n),s=Hh(U1,n),o=Uh(n);return C.jsx(MM,{role:"region","aria-labelledby":s.triggerId,"data-orientation":i.orientation,...o,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});H1.displayName=U1;function W1(t){return t?"open":"closed"}var UM=L1,HM=j1,WM=B1,KM=z1,GM=H1;const as=({children:t,defaultValue:e=[],className:n=""})=>C.jsx(UM,{type:"multiple",defaultValue:e,className:`space-y-4 ${n}`,children:t}),qM=({value:t,title:e,icon:n,children:r,className:i=""})=>C.jsxs(HM,{value:t,className:`flex h-full flex-col overflow-hidden rounded-none ${i}`,children:[C.jsx(WM,{children:C.jsxs(KM,{className:"hover:bg-divider-muted focus:bg-divider-muted group flex w-full items-center justify-between px-2 text-left focus:outline-none",children:[C.jsxs("div",{className:"flex items-center space-x-2 py-3",children:[n,C.jsx("h5",{className:"text-content text-sm font-medium",children:e})]}),C.jsx(GA,{className:"text-content-subtle h-4 w-4 transition-transform group-data-[state=open]:rotate-180"})]})}),C.jsx(GM,{className:"data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up min-h-0 flex-1",children:C.jsx("div",{className:"h-full",children:r})})]});as.Item=qM;const YM=({message:t,isUser:e})=>C.jsx("div",{className:`flex ${e?"justify-end":"justify-start"} mb-4`,children:C.jsx("div",{className:`max-w-[80%] ${e?"order-2":"order-1"}`,children:C.jsx("div",{className:`rounded-lg px-3 py-2 text-sm ${e?"bg-divider-muted border-divider text-content border":"text-content-muted bg-transparent"}`,children:C.jsx("div",{className:"whitespace-pre-wrap",children:t})})})}),XM=({message:t,isLoading:e=!0})=>C.jsxs("div",{className:"text-content-muted flex items-center gap-2 text-sm",children:[e?C.jsx(t1,{className:"text-content-subtle h-4 w-4 animate-spin"}):null,C.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),QM=({message:t})=>C.jsx("pre",{className:"text-content-muted overflow-x-auto whitespace-pre-wrap font-sans text-sm",children:t}),ZM=({messages:t})=>{const e=x.useRef(null);x.useEffect(()=>{e.current&&(e.current.scrollTop=e.current.scrollHeight)},[t]);const n=r=>r.isUser?C.jsx(YM,{message:r.message,isUser:r.isUser},r.id):r.isProgress?C.jsx(XM,{message:r.message,isLoading:r.isLoading},r.id):C.jsx(QM,{message:r.message},r.id);return t.length===0?C.jsx("div",{className:"text-content-subtle flex flex-1 items-center justify-center text-sm"}):C.jsx("div",{ref:e,className:"scrollbar-hide h-full space-y-3 overflow-y-auto p-2",children:t.map(n)})},JM=({onSend:t,disabled:e=!1,placeholder:n="Type your message..."})=>{const[r,i]=x.useState(""),s=x.useRef(null),o=()=>{r.trim()&&!e&&(t(r.trim()),i(""))};x.useEffect(()=>{s.current&&(s.current.style.height="auto",s.current.style.height=`${s.current.scrollHeight}px`)},[r]);const a=l=>{l.key==="Enter"&&!l.shiftKey&&(l.preventDefault(),o())};return C.jsxs("div",{className:"relative px-2",children:[C.jsx("textarea",{ref:s,value:r,onChange:l=>i(l.target.value),onKeyDown:a,placeholder:n,disabled:e,className:"border-divider bg-main-input focus:ring-primary focus:border-primary text-content placeholder-content-subtle max-h-32 min-h-[2.5rem] w-full resize-none overflow-hidden rounded-lg border py-2 pl-3 pr-10 text-sm focus:ring-1 disabled:opacity-50",rows:3}),C.jsx("button",{onClick:o,disabled:!r.trim()||e,className:"bg-primary text-content hover:bg-primary-hover absolute bottom-4 right-4 flex items-center justify-center rounded p-1 transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:C.jsx(sR,{className:"h-5 w-5"})})]})},jo=Ml("ElementInspector"),e2=[{key:"backgroundColor",label:"Background Color",type:"color"},{key:"color",label:"Text Color",type:"color"},{key:"fontSize",label:"Text Size",type:"text"},{key:"opacity",label:"Opacity",type:"range"},{key:"borderColor",label:"Border Color",type:"color"},{key:"borderWidth",label:"Border Width",type:"text"},{key:"borderRadius",label:"Border Radius",type:"text"},{key:"paddingVertical",label:"Padding Vertical",type:"spacing"},{key:"paddingHorizontal",label:"Padding Horizontal",type:"spacing"},{key:"marginVertical",label:"Margin Vertical",type:"spacing",isHidden:!0},{key:"marginHorizontal",label:"Margin Horizontal",type:"spacing",isHidden:!0}],t2={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",silver:"#c0c0c0",gray:"#808080",grey:"#808080"},n2={paddingVertical:["paddingTop","paddingBottom"],paddingHorizontal:["paddingLeft","paddingRight"],marginVertical:["marginTop","marginBottom"],marginHorizontal:["marginLeft","marginRight"]},Vo=(t,e,n)=>{const r=t[e],i=t[n];return r&&i&&r===i?r:r&&i&&r!==i?`${r}/${i}`:r||i||""},r2=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),zm=(t,e)=>t[e]||t[r2(e)]||"",i2=t=>{if(!t||t==="transparent"||t==="inherit"||t==="initial")return"#000000";if(t.startsWith("#"))return t;const e=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(e){const n=parseInt(e[1]),r=parseInt(e[2]),i=parseInt(e[3]),s=o=>{const a=o.toString(16);return a.length===1?"0"+a:a};return`#${s(n)}${s(r)}${s(i)}`}return t2[t.toLowerCase()]||"#000000"},s2=({onClick:t,disabled:e=!1,isLoading:n=!1,children:r})=>C.jsxs("button",{onClick:t,disabled:e,className:"bg-primary text-content hover:bg-primary-hover flex w-full cursor-pointer items-center justify-center gap-2 rounded px-3 py-2 text-sm transition-all duration-200 disabled:cursor-not-allowed disabled:opacity-50",children:[n?C.jsx(t1,{className:"h-4 w-4 animate-spin"}):null,r]}),o2=({onClose:t,chatMessages:e,setChatMessages:n})=>{const[r,i]=Jw(Ll);if(r.length===0)return null;const s=r.length===1,o=r[0];return C.jsxs("div",{className:"bg-main border-divider scrollbar-hide w-96 cursor-auto overflow-y-auto border-l","data-cy":"element-inspector",children:[C.jsxs("div",{className:"border-divider border-b p-4",children:[C.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[C.jsx("h3",{className:"text-content text-lg font-semibold",children:"Element"}),C.jsx("button",{onClick:t,className:"text-content-subtle hover:text-content-muted",children:"✕"})]}),C.jsx("div",{className:"text-content-muted text-sm",children:s?C.jsxs(C.Fragment,{children:["Selected:"," ",C.jsxs("span",{className:"text-primary font-mono",children:[o.tagName,o.className&&`.${o.className.split(" ")[0]}`,o.id&&`#${o.id}`]})]}):C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"mb-2 font-medium",children:["Selected ",r.length," elements:"]}),C.jsx("div",{className:"max-h-32 space-y-1 overflow-y-auto",children:r.map((a,l)=>C.jsxs("div",{className:"text-xs",children:[C.jsxs("span",{className:"text-primary font-mono",children:[a.tagName,a.className&&`.${a.className.split(" ")[0]}`,a.id&&`#${a.id}`]}),a.filePath&&C.jsxs("span",{className:"text-content-subtle ml-1",children:["in ",a.filePath.split("/").pop()]})]},`${a.xpath}-${l}`))})]})})]}),C.jsx("div",{children:C.jsx(a2,{selectedElements:r,chatMessages:e,setChatMessages:n,onElementsChange:i})})]})},a2=({selectedElements:t,chatMessages:e,setChatMessages:n,onElementsChange:r})=>{const i=t[0],s=t.length>1,[o,a]=x.useState({}),[l,u]=x.useState({isOpen:!1,type:"success",title:"",description:"",onOpenChange:()=>{}}),c=SM(n),{generateCode:d,generateCodeWithCSS:f,isGenerating:h}=EM(),y=t.every(S=>!!S.filePath),m=()=>{document.querySelectorAll('[id^="rivet-selection-"]').forEach(P=>P.remove());const k=document.getElementById("rivet-hover-overlay");k&&(k.style.display="none"),r([])},_=S=>{const{computedStyles:k}=i,P=["color","backgroundColor","borderColor"];switch(S){case"paddingVertical":return Vo(k,"padding-top","padding-bottom");case"paddingHorizontal":return Vo(k,"padding-left","padding-right");case"marginVertical":return Vo(k,"margin-top","margin-bottom");case"marginHorizontal":return Vo(k,"margin-left","margin-right");case"opacity":return zm(k,"opacity")||"1";case"borderColor":return k["border-color"]||k["border-top-color"]||k["border-right-color"]||k["border-bottom-color"]||k["border-left-color"]||"";case"borderWidth":return k["border-width"]||k["border-top-width"]||k["border-right-width"]||k["border-bottom-width"]||k["border-left-width"]||"";case"borderRadius":return k["border-radius"]||k["border-top-left-radius"]||"";default:const R=zm(k,S);return P.includes(S)&&R?i2(R):R}},p=S=>o[S]??_(S),g=(S,k)=>{a(P=>({...P,[S]:k}))},v=(S,k)=>{const P=n2[S];P&&a(R=>{const N={...R};return P.forEach(V=>{N[V]=k}),N})},w=S=>{const k=p(S),P=parseFloat(k??"");return isNaN(P)?100:Math.round(P*100)},E=(S,k)=>{const P=k.replace("%","").trim(),R=parseFloat(P);if(!isNaN(R)){const V=(Math.max(0,Math.min(100,R))/100).toString();g(S,V)}},A=async()=>{if(Object.keys(o).length!==0){if(!i.filePath){jo.error("Please find the component file first using the search functionality.");return}try{const S=await f(i,o);S?(jo.info("CSS changes applied successfully:",S.changes),a({}),m()):u({isOpen:!0,type:"error",title:"Failed to apply CSS changes",description:"An error occurred while applying the style changes.",onOpenChange:k=>u(P=>({...P,isOpen:k}))})}catch(S){jo.error("Error applying CSS changes:",S),u({isOpen:!0,type:"error",title:"Failed to apply CSS changes",description:S instanceof Error?S.message:"An unexpected error occurred.",onOpenChange:k=>u(P=>({...P,isOpen:k}))})}}},b=async S=>{const k=Date.now().toString(),P=(Date.now()+1).toString();if(c.addStreamingMessage(k,!0,S),c.addStreamingMessage(P,!1,""),t.filter(V=>!V.filePath).length>0){c.setErrorMessage(P,"Cannot modify - component files not found for some elements.");return}const N="progress-"+Date.now();try{await d({instruction:S,elements:t,shouldStream:!0,onProgress:V=>{c.updateOrAddProgressMessage(N,V)},onChunk:V=>{c.removeProgressMessages(),c.updateStreamingMessage(P,V)},onComplete:()=>{c.removeProgressMessages(),c.finalizeStreamingMessage(P),m(),u({isOpen:!0,type:"success",title:"Code modification completed!",description:"Changes applied successfully.",onOpenChange:V=>u($=>({...$,isOpen:V}))})},onError:V=>{c.removeProgressMessages(),c.setErrorMessage(P,V),u({isOpen:!0,type:"error",title:"Code Modification Error",description:V,onOpenChange:$=>u(K=>({...K,isOpen:$}))})}})}catch(V){jo.error("Error with streaming request:",V);const $=V instanceof Error?V.message:"An unexpected error occurred.";c.removeProgressMessages(),c.setErrorMessage(P,$),u({isOpen:!0,type:"error",title:"Failed to generate AI response",description:$,onOpenChange:K=>u(Q=>({...Q,isOpen:K}))})}};return C.jsxs("div",{className:"bg-main scrollbar-hide flex h-screen flex-col overflow-hidden",children:[C.jsx("div",{className:"flex-shrink-0",children:C.jsx(as,{defaultValue:["ai-input"],children:C.jsx(as.Item,{value:"ai-input",title:s?"Change multiple elements":"Change an element",icon:C.jsx(aR,{className:"text-content h-4 w-4"}),children:C.jsxs("div",{className:"flex h-96 flex-col",children:[C.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:C.jsx(ZM,{messages:e})}),C.jsx("div",{className:"border-divider bg-main flex-shrink-0 border-t py-4",children:C.jsx(JM,{onSend:b,disabled:h})})]})})})}),C.jsx("div",{className:"border-divider flex-shrink-0 border-t pt-4",children:C.jsx(as,{defaultValue:["style-properties"],className:"overflow-visible",children:C.jsx(as.Item,{value:"style-properties",title:"Style properties",icon:C.jsx(tR,{className:"text-content h-4 w-4"}),children:C.jsxs("div",{className:"flex flex-col",children:[C.jsx("div",{className:"space-y-3 p-2",children:e2.filter(({isHidden:S})=>!S).map(({key:S,label:k,type:P})=>C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("label",{className:"text-content flex-1 text-xs",children:k}),C.jsx(wM,{type:P,value:P==="range"?w(S):p(S),onChange:R=>{P==="spacing"?v(S,R):P==="range"?E(S,R+"%"):g(S,R)}})]},S))}),C.jsx("div",{className:"border-divider border-t px-2 pt-3",children:C.jsx(s2,{onClick:A,disabled:Object.keys(o).length===0||h||!y,isLoading:h,children:h?"Applying Style Changes...":"Apply Style Changes"})})]})})})}),y?null:C.jsx("div",{className:"border-accent-warning bg-accent-warning/20 text-accent-warning rounded border p-3 text-xs",children:s?"Cannot modify - component files not found for some elements.":"Cannot modify - no component file found."}),C.jsx(C1,{children:C.jsx(k1,{isOpen:l.isOpen,onOpenChange:l.onOpenChange,type:l.type,title:l.title,description:l.description})})]})},l2=()=>{const[t,e]=Jw(Ll),[n,r]=x.useState([]);x.useEffect(()=>{r([])},[t]);const i=()=>{e([])};return C.jsxs(Uw.div,{className:"flex h-screen",initial:{opacity:0},animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},children:[C.jsx("div",{className:"relative flex flex-1 flex-col",children:C.jsx(_M,{})}),C.jsx(o2,{onClose:i,chatMessages:n,setChatMessages:r})]})};var T=typeof window<"u"?window:void 0,lt=typeof globalThis<"u"?globalThis:T,K1=Array.prototype,Um=K1.forEach,Hm=K1.indexOf,gt=lt==null?void 0:lt.navigator,j=lt==null?void 0:lt.document,st=lt==null?void 0:lt.location,Cd=lt==null?void 0:lt.fetch,Pd=lt!=null&<.XMLHttpRequest&&"withCredentials"in new lt.XMLHttpRequest?lt.XMLHttpRequest:void 0,Wm=lt==null?void 0:lt.AbortController,rt=gt==null?void 0:gt.userAgent,H=T??{},hn={DEBUG:!1,LIB_VERSION:"1.268.9"};function Km(t,e,n,r,i,s,o){try{var a=t[s](o),l=a.value}catch(u){return void n(u)}a.done?e(l):Promise.resolve(l).then(r,i)}function Gm(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function o(l){Km(s,r,i,o,a,"next",l)}function a(l){Km(s,r,i,o,a,"throw",l)}o(void 0)})}}function O(){return O=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},O.apply(null,arguments)}function G1(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 u2=["$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 q(t,e){return t.indexOf(e)!==-1}var jl=function(t){return t.trim()},Td=function(t){return t.replace(/^\$/,"")},c2=Array.isArray,q1=Object.prototype,Y1=q1.hasOwnProperty,Vl=q1.toString,ie=c2||function(t){return Vl.call(t)==="[object Array]"},At=t=>typeof t=="function",we=t=>t===Object(t)&&!ie(t),ii=t=>{if(we(t)){for(var e in t)if(Y1.call(t,e))return!1;return!0}return!1},D=t=>t===void 0,xe=t=>Vl.call(t)=="[object String]",bd=t=>xe(t)&&t.trim().length===0,Pn=t=>t===null,X=t=>D(t)||Pn(t),He=t=>Vl.call(t)=="[object Number]",Bt=t=>Vl.call(t)==="[object Boolean]",d2=t=>t instanceof FormData,f2=t=>q(u2,t);function Ad(t){return t===null||typeof t!="object"}function Xa(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function X1(t){return!D(Event)&&function(e,n){try{return e instanceof n}catch{return!1}}(t,Event)}var h2=[!0,"true",1,"1","yes"],Vu=t=>q(h2,t),p2=[!1,"false",0,"0","no"];function mt(t,e,n,r,i){return e>n&&(r.warn("min cannot be greater than max."),e=n),He(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),mt(i||n,e,n,r))}class Q1{constructor(e){this.t=e,this.i={},this.o=()=>{Object.keys(this.i).forEach(n=>{var r=this.h(n)+this.m;r>=this.S?delete this.i[n]:this.k(n,r)})},this.h=n=>this.i[String(n)],this.k=(n,r)=>{this.i[String(n)]=r},this.consumeRateLimit=n=>{var r,i,s=(r=this.h(n))!==null&&r!==void 0?r:this.S;if((s=Math.max(s-1,0))===0)return!0;this.k(n,s);var o=s===0;return o&&((i=this.$)==null||i.call(this,n)),o},this.$=this.t.$,this.S=mt(this.t.bucketSize,0,100,this.t.R),this.m=mt(this.t.refillRate,0,this.S,this.t.R),this.P=mt(this.t.refillInterval,0,864e5,this.t.R),this.I=setInterval(()=>{this.o()},this.P)}stop(){this.I&&(clearInterval(this.I),this.I=void 0)}}var Bo,qm,Bu,g2=t=>t instanceof Error;function m2(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return Bu&&n.length===qm||(qm=n.length,Bu=n.reduce((r,i)=>{Bo||(Bo={});var s=Bo[i];if(s)r[s[0]]=s[1];else for(var o=t(i),a=o.length-1;a>=0;a--){var l=o[a],u=l==null?void 0:l.filename,c=e[i];if(u&&c){r[u]=c,Bo[i]=[u,c];break}}return r},{})),Bu}}var Pi="?";function Rd(t,e,n,r){var i={platform:"web:javascript",filename:t,function:e==="<anonymous>"?Pi:e,in_app:!0};return D(n)||(i.lineno=n),D(r)||(i.colno=r),i}var Z1=(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]:Pi,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},v2=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,y2=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,_2=/\((\S*)(?::(\d+))(?::(\d+))\)/,w2=t=>{var e=v2.exec(t);if(e){var[,n,r,i]=e;return Rd(n,Pi,+r,+i)}var s=y2.exec(t);if(s){if(s[2]&&s[2].indexOf("eval")===0){var o=_2.exec(s[2]);o&&(s[2]=o[1],s[3]=o[2],s[4]=o[3])}var[a,l]=Z1(s[1]||Pi,s[2]);return Rd(l,a,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},x2=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,S2=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,E2=t=>{var e=x2.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){var n=S2.exec(e[3]);n&&(e[1]=e[1]||"eval",e[3]=n[1],e[4]=n[2],e[5]="")}var r=e[3],i=e[1]||Pi;return[i,r]=Z1(i,r),Rd(r,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},Ym=/\(error: (.*)\)/,Xm=50;function k2(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r,i){i===void 0&&(i=0);for(var s=[],o=r.split(`
|
|
143
|
+
`),a=i;a<o.length;a++){var l=o[a];if(!(l.length>1024)){var u=Ym.test(l)?l.replace(Ym,"$1"):l;if(!u.match(/\S*Error: /)){for(var c of e){var d=c(u);if(d){s.push(d);break}}if(s.length>=Xm)break}}}return function(f){if(!f.length)return[];var h=Array.from(f);return h.reverse(),h.slice(0,Xm).map(y=>{return O({},y,{filename:y.filename||(m=h,m[m.length-1]||{}).filename,function:y.function||Pi});var m})}(s)}}class C2{constructor(e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r=[]),this.coercers=e,this.modifiers=r,this.stackParser=k2(...n)}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,n,0).apply(e),s=this.buildParsingContext(),o=this.parseStacktrace(i,s);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(e){var n=this;return Gm(function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&ie(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)),O({},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 Gm(function*(){var r=e;for(var i of n.modifiers)r=yield i(r);return r})()}convertToExceptionList(e,n){var r,i,s,o={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:(s=e.synthetic)!==null&&s!==void 0&&s}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,O({},n,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:m2(this.stackParser)}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var i=(s,o)=>{if(o<=4){var a=this.buildCoercingContext(e,n,o);return this.applyCoercers(s,a)}};return O({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:s=>i(s,r),next:s=>i(s,r+1)})}}class P2{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=xe(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 Xa(e,"DOMException")}isDOMError(e){return Xa(e,"DOMError")}}class T2{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}}class b2{constructor(){}match(e){return Xa(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}}}var A2=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class R2{match(e){return typeof e=="string"}coerce(e,n){var r,[i,s]=this.getInfos(e);return{type:i??"Error",value:s??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,i=e.match(A2);return i&&(n=i[1],r=i[2]),[n,r]}}var M2=["fatal","error","warning","log","info","debug"];function J1(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""}class I2{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 X1(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: "+J1(e)}isSeverityLevel(e){return xe(e)&&!bd(e)&&M2.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(g2(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class N2{match(e){return X1(e)}coerce(e,n){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+J1(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class D2{match(e){return Ad(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}}}class L2{match(e){return Xa(e,"PromiseRejectionEvent")}coerce(e,n){var r,i=this.getUnhandledRejectionReason(e);return Ad(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(Ad(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}}var ex=t=>{var e={T:function(n){if(T&&(hn.DEBUG||H.POSTHOG_DEBUG)&&!D(T.console)&&T.console){for(var r=("__rrweb_original__"in T.console[n])?T.console[n].__rrweb_original__:T.console[n],i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];r(t,...s)}},info:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.T("log",...r)},warn:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.T("warn",...r)},error:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.T("error",...r)},critical:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning:n=>{e.error("You must initialize PostHog before calling "+n)},createLogger:n=>ex(t+" "+n)};return e},F=ex("[PostHog.js]"),Re=F.createLogger,O2=Re("[ExternalScriptsLoader]"),Qm=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return O2.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=j==null?void 0:j.querySelectorAll("script");if(r){for(var i,s=function(){if(r[o].src===e){var l=r[o];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",u=>{l.__posthog_loading_callback_fired=!0,n(void 0,u)}),l.onerror=u=>n(u),{v:void 0})}},o=0;o<r.length;o++)if(i=s())return i.v}var a=()=>{if(!j)return n("document not found");var l=j.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,n(void 0,d)},l.onerror=d=>n(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");var u,c=j.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):j.body.appendChild(l)};j!=null&&j.body?a():j==null||j.addEventListener("DOMContentLoaded",a)};H.__PosthogExtensions__=H.__PosthogExtensions__||{},H.__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 s=t.requestRouter.endpointFor("assets",r);Qm(t,s,n)},H.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);Qm(t,r,n)};var Qa={};function qn(t,e,n){if(ie(t)){if(Um&&t.forEach===Um)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)===Qa)return}}}function re(t,e,n){if(!X(t)){if(ie(t))return qn(t,e,n);if(d2(t)){for(var r of t.entries())if(e.call(n,r[1],r[0])===Qa)return}else for(var i in t)if(Y1.call(t,i)&&e.call(n,t[i],i)===Qa)return}}var Ee=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 qn(n,function(i){for(var s in i)i[s]!==void 0&&(t[s]=i[s])}),t},Bl=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 qn(n,function(i){qn(i,function(s){t.push(s)})}),t};function fa(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 Zm=function(t){try{return t()}catch{return}},$2=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){F.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),F.critical(i)}}},Wh=function(t){var e={};return re(t,function(n,r){(xe(n)&&n.length>0||He(n))&&(e[r]=n)}),e};function F2(t,e){return n=t,r=s=>xe(s)&&!Pn(e)?s.slice(0,e):s,i=new Set,function s(o,a){return o!==Object(o)?r?r(o,a):o:i.has(o)?void 0:(i.add(o),ie(o)?(l=[],qn(o,u=>{l.push(s(u))})):(l={},re(o,(u,c)=>{i.has(u)||(l[c]=s(u,c))})),l);var l}(n);var n,r,i}var j2=["herokuapp.com","vercel.app","netlify.app"];function V2(t){var e=t==null?void 0:t.hostname;if(!xe(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of j2)if(n===r)return!1;return!0}function tx(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function pe(t,e,n,r){var{capture:i=!1,passive:s=!0}=r??{};t==null||t.addEventListener(e,n,{capture:i,passive:s})}var nx="$people_distinct_id",ls="__alias",us="__timers",Jm="$autocapture_disabled_server_side",Md="$heatmaps_enabled_server_side",ev="$exception_capture_enabled_server_side",Id="$error_tracking_suppression_rules",tv="$error_tracking_capture_extension_exceptions",nv="$web_vitals_enabled_server_side",rx="$dead_clicks_enabled_server_side",rv="$web_vitals_allowed_metrics",zu="$session_recording_remote_config",Nd="$session_recording_enabled_server_side",iv="$console_log_recording_enabled_server_side",sv="$session_recording_network_payload_capture",ov="$session_recording_masking",av="$session_recording_canvas_recording",lv="$replay_sample_rate",uv="$replay_minimum_duration",cv="$replay_script_config",Za="$sesid",si="$session_is_sampled",Dd="$session_recording_url_trigger_activated_session",Ld="$session_recording_event_trigger_activated_session",oi="$enabled_feature_flags",cs="$early_access_features",Od="$feature_flag_details",ds="$stored_person_properties",hr="$stored_group_properties",$d="$surveys",zo="$surveys_activated",Ja="$flag_call_reported",cn="$user_state",Fd="$client_session_props",jd="$capture_rate_limit",Vd="$initial_campaign_params",Bd="$initial_referrer_info",el="$initial_person_info",tl="$epp",ix="__POSTHOG_TOOLBAR__",Yi="$posthog_cookieless",B2=[nx,ls,"__cmpns",us,Nd,Md,Za,oi,Id,cn,cs,Od,hr,ds,$d,Ja,Fd,jd,Vd,Bd,tl,el];function dv(t){return t instanceof Element&&(t.id===ix||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function zl(t){return!!t&&t.nodeType===1}function Yn(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function sx(t){return!!t&&t.nodeType===3}function ox(t){return!!t&&t.nodeType===11}function Kh(t){return t?jl(t).split(/\s+/):[]}function fv(t){var e=T==null?void 0:T.location.href;return!!(e&&t&&t.some(n=>e.match(n)))}function nl(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 Kh(e)}function ax(t){return X(t)?null:jl(t).split(/(\s+)/).filter(e=>Ti(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ul(t){var e="";return zd(t)&&!fx(t)&&t.childNodes&&t.childNodes.length&&re(t.childNodes,function(n){var r;sx(n)&&n.textContent&&(e+=(r=ax(n.textContent))!==null&&r!==void 0?r:"")}),jl(e)}function lx(t){return D(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Gh=["a","button","form","input","select","textarea","label"];function ux(t,e){if(D(e))return!0;var n,r=function(s){if(e.some(o=>s.matches(o)))return{v:!0}};for(var i of t)if(n=r(i))return n.v;return!1}function cx(t){var e=t.parentNode;return!(!e||!zl(e))&&e}var hv=[".ph-no-rageclick",".ph-no-capture"],qh=t=>!t||Yn(t,"html")||!zl(t),dx=(t,e)=>{if(!T||qh(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],i=t;i.parentNode&&!Yn(i,"body");)if(ox(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var s=cx(i);if(!s)break;if(e||Gh.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var o=T.getComputedStyle(s);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(s),i=s}return{parentIsUsefulElement:n,targetElementList:r}};function z2(t,e,n,r,i){var s,o,a,l;if(n===void 0&&(n=void 0),!T||qh(t)||(s=n)!=null&&s.url_allowlist&&!fv(n.url_allowlist)||(o=n)!=null&&o.url_ignorelist&&fv(n.url_ignorelist))return!1;if((a=n)!=null&&a.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some(y=>e.type===y))return!1}var{parentIsUsefulElement:c,targetElementList:d}=dx(t,r);if(!function(y,m){var _=m==null?void 0:m.element_allowlist;if(D(_))return!0;var p,g=function(w){if(_.some(E=>w.tagName.toLowerCase()===E))return{v:!0}};for(var v of y)if(p=g(v))return p.v;return!1}(d,n)||!ux(d,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var f=T.getComputedStyle(t);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var h=t.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(i||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(e.type)>=0;default:return c?(i||["click"]).indexOf(e.type)>=0:(i||["click"]).indexOf(e.type)>=0&&(Gh.indexOf(h)>-1||t.getAttribute("contenteditable")==="true")}}function zd(t){for(var e=t;e.parentNode&&!Yn(e,"body");e=e.parentNode){var n=nl(e);if(q(n,"ph-sensitive")||q(n,"ph-no-capture"))return!1}if(q(nl(t),"ph-include"))return!0;var r=t.type||"";if(xe(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.id||"";return!(xe(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 fx(t){return!!(Yn(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Yn(t,"select")||Yn(t,"textarea")||t.getAttribute("contenteditable")==="true")}var hx="(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})",U2=new RegExp("^(?:"+hx+")$"),H2=new RegExp(hx),px="\\d{3}-?\\d{2}-?\\d{4}",W2=new RegExp("^("+px+")$"),K2=new RegExp("("+px+")");function Ti(t,e){return e===void 0&&(e=!0),!(X(t)||xe(t)&&(t=jl(t),(e?U2:H2).test((t||"").replace(/[- ]/g,""))||(e?W2:K2).test(t)))}function gx(t){var e=Ul(t);return Ti(e=(e+" "+mx(t)).trim())?e:""}function mx(t){var e="";return t&&t.childNodes&&t.childNodes.length&&re(t.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var i=Ul(n);e=(e+" "+i).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+mx(n)).trim())}catch(s){F.error("[AutoCapture]",s)}}),e}function G2(t){return function(e){var n=e.map(r=>{var i,s,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))o+="."+a.replace(/"/g,"");var l=O({},r.text?{text:r.text}:{},{"nth-child":(i=r.nth_child)!==null&&i!==void 0?i:0,"nth-of-type":(s=r.nth_of_type)!==null&&s!==void 0?s:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),u={};return fa(l).sort((c,d)=>{var[f]=c,[h]=d;return f.localeCompare(h)}).forEach(c=>{var[d,f]=c;return u[pv(d.toString())]=pv(f.toString())}),o+=":",o+=fa(u).map(c=>{var[d,f]=c;return d+'="'+f+'"'}).join("")});return n.join(";")}(function(e){return e.map(n=>{var r,i,s={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:q2(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return fa(n).filter(o=>{var[a]=o;return a.indexOf("attr__")===0}).forEach(o=>{var[a,l]=o;return s.attributes[a]=l}),s})}(t))}function pv(t){return t.replace(/"|\\"/g,'\\"')}function q2(t){var e=t.attr__class;return e?ie(e)?e:Kh(e):void 0}class vx{constructor(){this.clicks=[]}isRageClick(e,n,r){var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(n-i.y)<30&&r-i.timestamp<1e3){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var Uu="$copy_autocapture",pn=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Y2=["localhost","127.0.0.1"],bi=t=>{var e=j==null?void 0:j.createElement("a");return D(e)?null:(e.href=t,e)},X2=function(t,e){var n,r;e===void 0&&(e="&");var i=[];return re(t,function(s,o){D(s)||D(o)||o==="undefined"||(n=encodeURIComponent((a=>a instanceof File)(s)?s.name:s.toString()),r=encodeURIComponent(o),i[i.length]=r+"="+n)}),i.join(e)},rl=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<r.length;i++){var s=r[i].split("=");if(s[0]===e){n=s;break}}if(!ie(n)||n.length<2)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{F.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Yh=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),i=r[0]||"",s=r[1],o=i.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),c=[],d=0;d<u.length;d++){var f=u[d].split("=");ie(f)&&(e.includes(f[0])?c.push(f[0]+"="+n):c.push(u[d]))}var h=l;return a!=null&&(h+="?"+c.join("&")),s!=null&&(h+="#"+s),h},il=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},gv=Re("[AutoCapture]");function Hu(t,e){return e.length>t?e.slice(0,t)+"...":e}function Q2(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!zl(e));return e}function Z2(t,e,n,r){var i=t.tagName.toLowerCase(),s={tag_name:i};Gh.indexOf(i)>-1&&!n&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?s.$el_text=Hu(1024,gx(t)):s.$el_text=Hu(1024,Ul(t)));var o=nl(t);o.length>0&&(s.classes=o.filter(function(c){return c!==""})),re(t.attributes,function(c){var d;if((!fx(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!e&&Ti(c.value)&&(d=c.name,!xe(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var f=c.value;c.name==="class"&&(f=Kh(f).join(" ")),s["attr__"+c.name]=Hu(1024,f)}});for(var a=1,l=1,u=t;u=Q2(u);)a++,u.tagName===t.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}function J2(t,e){for(var n,r,{e:i,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!Yn(c,"body");)ox(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,f=[],h={},y=!1,m=!1;if(re(u,w=>{var E=zd(w);w.tagName.toLowerCase()==="a"&&(y=w.getAttribute("href"),y=E&&y&&Ti(y)&&y),q(nl(w),"ph-no-capture")&&(m=!0),f.push(Z2(w,s,o,a));var A=function(b){if(!zd(b))return{};var S={};return re(b.attributes,function(k){if(k.name&&k.name.indexOf("data-ph-capture-attribute")===0){var P=k.name.replace("data-ph-capture-attribute-",""),R=k.value;P&&R&&Ti(R)&&(S[P]=R)}}),S}(w);Ee(h,A)}),m)return{props:{},explicitNoCapture:m};if(o||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?f[0].$el_text=gx(t):f[0].$el_text=Ul(t)),y){var _,p;f[0].attr__href=y;var g=(_=bi(y))==null?void 0:_.host,v=T==null||(p=T.location)==null?void 0:p.host;g&&v&&g!==v&&(d=y)}return{props:Ee({$event_type:i.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:G2(f)},(n=f[0])!=null&&n.$el_text?{$el_text:(r=f[0])==null?void 0:r.$el_text}:{},d&&i.type==="click"?{$external_click_url:d}:{},h)}}class eI{constructor(e){this.C=!1,this.M=null,this.rageclicks=new vx,this.O=!1,this.instance=e,this.F=null}get A(){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}D(){if(this.isBrowserSupported()){if(T&&j){var e=r=>{r=r||(T==null?void 0:T.event);try{this.j(r)}catch(i){gv.error("Failed to capture event",i)}};if(pe(j,"submit",e,{capture:!0}),pe(j,"change",e,{capture:!0}),pe(j,"click",e,{capture:!0}),this.A.capture_copied_text){var n=r=>{r=r||(T==null?void 0:T.event),this.j(r,Uu)};pe(j,"copy",n,{capture:!0}),pe(j,"cut",n,{capture:!0})}}}else gv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.C&&(this.D(),this.C=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.O=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Jm]:!!e.autocapture_opt_out}),this.M=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.F=e}getElementSelectors(e){var n,r=[];return(n=this.F)==null||n.forEach(i=>{var s=j==null?void 0:j.querySelectorAll(i);s==null||s.forEach(o=>{e===o&&r.push(i)})}),r}get isEnabled(){var e,n,r=(e=this.instance.persistence)==null?void 0:e.props[Jm],i=this.M;if(Pn(i)&&!Bt(r)&&!this.instance.L())return!1;var s=(n=this.M)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!s}j(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r,i=lx(e);sx(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,new Date().getTime())&&function(f,h){if(!T||qh(f))return!1;var y,m;if((y=Bt(h)?!!h&&hv:(m=h==null?void 0:h.css_selector_ignorelist)!==null&&m!==void 0?m:hv)===!1)return!1;var{targetElementList:_}=dx(f,!1);return!ux(_,y)}(i,this.instance.config.rageclick)&&this.j(e,"$rageclick");var s=n===Uu;if(i&&z2(i,e,this.A,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=J2(i,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.A.element_attribute_ignorelist,elementsChainAsString:this.O});if(a)return!1;var l=this.getElementSelectors(i);if(l&&l.length>0&&(o.$element_selectors=l),n===Uu){var u,c=ax(T==null||(u=T.getSelection())==null?void 0:u.toString()),d=e.type||"clipboard";if(!c)return!1;o.$selected_content=c,o.$copy_type=d}return this.instance.capture(n,o),!0}}}isBrowserSupported(){return At(j==null?void 0:j.querySelectorAll)}}Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return He(t)&&isFinite(t)&&Math.floor(t)===t});var mv="0123456789abcdef";class sl{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 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|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new sl(s)}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 sl(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}}class tI{constructor(){this.N=0,this.U=0,this.B=new nI}generate(){var e=this.generateOrAbort();if(D(e)){this.N=0;var n=this.generateOrAbort();if(D(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.N)this.N=e,this.q();else{if(!(e+1e4>this.N))return;this.U++,this.U>4398046511103&&(this.N++,this.q())}return sl.fromFieldsV7(this.N,Math.trunc(this.U/Math.pow(2,30)),this.U&Math.pow(2,30)-1,this.B.nextUint32())}q(){this.U=1024*this.B.nextUint32()+(1023&this.B.nextUint32())}}var vv,yx=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};T&&!D(T.crypto)&&crypto.getRandomValues&&(yx=t=>crypto.getRandomValues(t));class nI{constructor(){this.H=new Uint32Array(8),this.W=1/0}nextUint32(){return this.W>=this.H.length&&(yx(this.H),this.W=0),this.H[this.W++]}}var jn=()=>rI().toString(),rI=()=>(vv||(vv=new tI)).generate(),Xi="",iI=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function sI(t,e){if(e){var n=function(i,s){if(s===void 0&&(s=j),Xi)return Xi;if(!s||["localhost","127.0.0.1"].includes(i))return"";for(var o=i.split("."),a=Math.min(o.length,8),l="dmn_chk_"+jn();!Xi&&a--;){var u=o.slice(a).join("."),c=l+"=1;domain=."+u+";path=/";s.cookie=c+";max-age=3",s.cookie.includes(l)&&(s.cookie=c+";max-age=0",Xi=u)}return Xi}(t);if(!n){var r=(i=>{var s=i.match(iI);return s?s[0]:""})(t);r!==n&&F.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var sn={G:()=>!!j,V:function(t){F.error("cookieStore error: "+t)},J:function(t){if(j){try{for(var e=t+"=",n=j.cookie.split(";").filter(s=>s.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}},K:function(t){var e;try{e=JSON.parse(sn.J(t))||{}}catch{}return e},Y:function(t,e,n,r,i){if(j)try{var s="",o="",a=sI(j.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),s="; expires="+l.toUTCString()}i&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&F.warn("cookieStore warning: large cookie, len="+u.length),j.cookie=u,u}catch{return}},X:function(t,e){if(j!=null&&j.cookie)try{sn.Y(t,"",-1,e)}catch{return}}},Wu=null,be={G:function(){if(!Pn(Wu))return Wu;var t=!0;if(D(T))t=!1;else try{var e="__mplssupport__";be.Y(e,"xyz"),be.J(e)!=='"xyz"'&&(t=!1),be.X(e)}catch{t=!1}return t||F.error("localStorage unsupported; falling back to cookie store"),Wu=t,t},V:function(t){F.error("localStorage error: "+t)},J:function(t){try{return T==null?void 0:T.localStorage.getItem(t)}catch(e){be.V(e)}return null},K:function(t){try{return JSON.parse(be.J(t))||{}}catch{}return null},Y:function(t,e){try{T==null||T.localStorage.setItem(t,JSON.stringify(e))}catch(n){be.V(n)}},X:function(t){try{T==null||T.localStorage.removeItem(t)}catch(e){be.V(e)}}},oI=["distinct_id",Za,si,tl,el],Uo=O({},be,{K:function(t){try{var e={};try{e=sn.K(t)||{}}catch{}var n=Ee(e,JSON.parse(be.J(t)||"{}"));return be.Y(t,n),n}catch{}return null},Y:function(t,e,n,r,i,s){try{be.Y(t,e,void 0,void 0,s);var o={};oI.forEach(a=>{e[a]&&(o[a]=e[a])}),Object.keys(o).length&&sn.Y(t,o,n,r,i,s)}catch(a){be.V(a)}},X:function(t,e){try{T==null||T.localStorage.removeItem(t),sn.X(t,e)}catch(n){be.V(n)}}}),Ho={},aI={G:function(){return!0},V:function(t){F.error("memoryStorage error: "+t)},J:function(t){return Ho[t]||null},K:function(t){return Ho[t]||null},Y:function(t,e){Ho[t]=e},X:function(t){delete Ho[t]}},or=null,Oe={G:function(){if(!Pn(or))return or;if(or=!0,D(T))or=!1;else try{var t="__support__";Oe.Y(t,"xyz"),Oe.J(t)!=='"xyz"'&&(or=!1),Oe.X(t)}catch{or=!1}return or},V:function(t){F.error("sessionStorage error: ",t)},J:function(t){try{return T==null?void 0:T.sessionStorage.getItem(t)}catch(e){Oe.V(e)}return null},K:function(t){try{return JSON.parse(Oe.J(t))||null}catch{}return null},Y:function(t,e){try{T==null||T.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Oe.V(n)}},X:function(t){try{T==null||T.sessionStorage.removeItem(t)}catch(e){Oe.V(e)}}},dn=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class lI{constructor(e){this._instance=e}get A(){return this._instance.config}get consent(){return this.Z()?dn.DENIED:this.tt}isOptedOut(){return this.A.cookieless_mode==="always"||this.consent===dn.DENIED||this.consent===dn.PENDING&&(this.A.opt_out_capturing_by_default||this.A.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===dn.DENIED}optInOut(e){this.it.Y(this.et,e?1:0,this.A.cookie_expiration,this.A.cross_subdomain_cookie,this.A.secure_cookie)}reset(){this.it.X(this.et,this.A.cross_subdomain_cookie)}get et(){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 tt(){var e=this.it.J(this.et);return Vu(e)?dn.GRANTED:q(p2,e)?dn.DENIED:dn.PENDING}get it(){if(!this.rt){var e=this.A.opt_out_capturing_persistence_type;this.rt=e==="localStorage"?be:sn;var n=e==="localStorage"?sn:be;n.J(this.et)&&(this.rt.J(this.et)||this.optInOut(Vu(n.J(this.et))),n.X(this.et,this.A.cross_subdomain_cookie))}return this.rt}Z(){return!!this.A.respect_dnt&&!!tx([gt==null?void 0:gt.doNotTrack,gt==null?void 0:gt.msDoNotTrack,H.doNotTrack],e=>Vu(e))}}var Wo=Re("[Dead Clicks]"),uI=()=>!0,cI=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(rx)),r=t.instance.config.capture_dead_clicks;return Bt(r)?r:n};class _x{get lazyLoadedDeadClicksAutocapture(){return this.st}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[rx]:e==null?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.nt(()=>{this.ot()})}nt(e){var n,r;(n=H.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(r=H.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",i=>{i?Wo.error("failed to load script",i):e()})}ot(){var e;if(j){if(!this.st&&(e=H.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=we(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.st=H.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.st.start(j),Wo.info("starting...")}}else Wo.error("`document` not found. Cannot start.")}stop(){this.st&&(this.st.stop(),this.st=void 0,Wo.info("stopping..."))}}var Qi=Re("[ExceptionAutocapture]");class dI{constructor(e){var n,r,i;this.lt=()=>{var s;if(T&&this.isEnabled&&(s=H.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var o=H.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=H.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=H.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ut&&this.A.capture_unhandled_errors&&(this.ut=o(this.captureException.bind(this))),!this.ht&&this.A.capture_unhandled_rejections&&(this.ht=a(this.captureException.bind(this))),!this.dt&&this.A.capture_console_errors&&(this.dt=l(this.captureException.bind(this)))}catch(u){Qi.error("failed to start",u),this.vt()}}},this._instance=e,this.ct=!((n=this._instance.persistence)==null||!n.props[ev]),this.A=this.ft(),this.gt=new Q1({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,R:Qi}),this.startIfEnabled()}ft(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return we(e)?n=O({},n,e):(D(e)?this.ct:e)&&(n=O({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.A.capture_console_errors||this.A.capture_unhandled_errors||this.A.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Qi.info("enabled"),this.nt(this.lt))}nt(e){var n,r;(n=H.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(r=H.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",i=>{if(i)return Qi.error("failed to load script",i);e()})}vt(){var e,n,r;(e=this.ut)==null||e.call(this),this.ut=void 0,(n=this.ht)==null||n.call(this),this.ht=void 0,(r=this.dt)==null||r.call(this),this.dt=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ct=!!n||!1,this.A=this.ft(),this._instance.persistence&&this._instance.persistence.register({[ev]:this.ct}),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.gt.consumeRateLimit(i)?Qi.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 At(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}class fI{constructor(e){var n;this._instance=e,this._t=(T==null||(n=T.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(F.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.yt&&this.yt(),this.yt=void 0,F.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(T&&T.history){var r=this;(e=T.history.pushState)!=null&&e.__posthog_wrapped__||yv(T.history,"pushState",i=>function(s,o,a){i.call(this,s,o,a),r.bt("pushState")}),(n=T.history.replaceState)!=null&&n.__posthog_wrapped__||yv(T.history,"replaceState",i=>function(s,o,a){i.call(this,s,o,a),r.bt("replaceState")}),this.wt()}}bt(e){try{var n,r=T==null||(n=T.location)==null?void 0:n.pathname;if(!r)return;r!==this._t&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this._t=r}catch(i){F.error("Error capturing "+e+" pageview",i)}}wt(){if(!this.yt){var e=()=>{this.bt("popstate")};pe(T,"popstate",e),this.yt=()=>{T&&T.removeEventListener("popstate",e)}}}}function Rs(t){var e,n;return((e=JSON.stringify(t,(n=[],function(r,i){if(we(i)){for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(i)?"[Circular]":(n.push(i),i)}return i})))==null?void 0:e.length)||0}function Ud(t,e){if(e===void 0&&(e=66060288e-1),t.size>=e&&t.data.length>1){var n=Math.floor(t.data.length/2),r=t.data.slice(0,n),i=t.data.slice(n);return[Ud({size:Rs(r),data:r,sessionId:t.sessionId,windowId:t.windowId}),Ud({size:Rs(i),data:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap(s=>s)}return[t]}var Qt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Qt||{}),Ft=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Ft||{}),Hd="[SessionRecording]",Wd="redacted",Ko={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},hI=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],pI=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],gI=["/s/","/e/","/i/"];function _v(t,e,n,r){if(X(t))return t;var i=(e==null?void 0:e["content-length"])||function(s){return new Blob([s]).size}(t);return xe(i)&&(i=parseInt(i)),i>n?Hd+" "+r+" body too large to record ("+i+" bytes)":t}function wv(t,e){if(X(t))return t;var n=t;return Ti(n,!1)||(n=Hd+" "+e+" body "+Wd),re(pI,r=>{var i,s;(i=n)!=null&&i.length&&((s=n)==null?void 0:s.indexOf(r))!==-1&&(n=Hd+" "+e+" body "+Wd+" as might contain: "+r)}),n}var mI=(t,e)=>{var n,r,i,s={payloadSizeLimitBytes:Ko.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ko.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ko.payloadHostDenyList]},o=t.session_recording.recordHeaders!==!1&&e.recordHeaders,a=t.session_recording.recordBody!==!1&&e.recordBody,l=t.capture_performance!==!1&&e.recordPerformance,u=(n=s,i=Math.min(1e6,(r=n.payloadSizeLimitBytes)!==null&&r!==void 0?r:1e6),f=>(f!=null&&f.requestBody&&(f.requestBody=_v(f.requestBody,f.requestHeaders,i,"Request")),f!=null&&f.responseBody&&(f.responseBody=_v(f.responseBody,f.responseHeaders,i,"Response")),f)),c=f=>{return u(((m,_)=>{var p,g=bi(m.name),v=_.indexOf("http")===0?(p=bi(_))==null?void 0:p.pathname:_;v==="/"&&(v="");var w=g==null?void 0:g.pathname.replace(v||"","");if(!(g&&w&&gI.some(E=>w.indexOf(E)===0)))return m})((y=(h=f).requestHeaders,X(y)||re(Object.keys(y??{}),m=>{hI.includes(m.toLowerCase())&&(y[m]=Wd)}),h),t.api_host));var h,y},d=At(t.session_recording.maskNetworkRequestFn);return d&&At(t.session_recording.maskCapturedNetworkRequestFn)&&F.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=f=>{var h=t.session_recording.maskNetworkRequestFn({url:f.name});return O({},f,{name:h==null?void 0:h.url})}),s.maskRequestFn=At(t.session_recording.maskCapturedNetworkRequestFn)?f=>{var h,y=c(f);return y&&(h=t.session_recording.maskCapturedNetworkRequestFn==null?void 0:t.session_recording.maskCapturedNetworkRequestFn(y))!==null&&h!==void 0?h:void 0}:f=>function(h){if(!D(h))return h.requestBody=wv(h.requestBody,"Request"),h.responseBody=wv(h.responseBody,"Response"),h}(c(f)),O({},Ko,s,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})};class vI{constructor(e,n){var r,i;n===void 0&&(n={}),this.St={},this.kt=s=>{if(!this.St[s]){var o,a;this.St[s]=!0;var l=this.$t(s);(o=(a=this.t).onBlockedNode)==null||o.call(a,s,l)}},this.xt=s=>{var o=this.$t(s);if((o==null?void 0:o.nodeName)!=="svg"&&o instanceof Element){var a=o.closest("svg");if(a)return[this._rrweb.mirror.getId(a),a]}return[s,o]},this.$t=s=>this._rrweb.mirror.getNode(s),this.Et=s=>{var o,a,l,u,c,d,f,h;return((o=(a=s.removes)==null?void 0:a.length)!==null&&o!==void 0?o:0)+((l=(u=s.attributes)==null?void 0:u.length)!==null&&l!==void 0?l:0)+((c=(d=s.texts)==null?void 0:d.length)!==null&&c!==void 0?c:0)+((f=(h=s.adds)==null?void 0:h.length)!==null&&f!==void 0?f:0)},this.throttleMutations=s=>{if(s.type!==3||s.data.source!==0)return s;var o=s.data,a=this.Et(o);o.attributes&&(o.attributes=o.attributes.filter(u=>{var[c]=this.xt(u.id);return!this.gt.consumeRateLimit(c)&&u}));var l=this.Et(o);return l!==0||a===l?s:void 0},this._rrweb=e,this.t=n,this.gt=new Q1({bucketSize:(r=this.t.bucketSize)!==null&&r!==void 0?r:100,refillRate:(i=this.t.refillRate)!==null&&i!==void 0?i:10,refillInterval:1e3,$:this.kt,R:F})}}var Rt=Uint8Array,ut=Uint16Array,Ai=Uint32Array,Xh=new Rt([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]),Qh=new Rt([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]),xv=new Rt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wx=function(t,e){for(var n=new ut(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new Ai(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},xx=wx(Xh,2),yI=xx[0],Kd=xx[1];yI[28]=258,Kd[258]=28;for(var Sv=wx(Qh,0)[1],Sx=new ut(32768),ae=0;ae<32768;++ae){var ar=(43690&ae)>>>1|(21845&ae)<<1;ar=(61680&(ar=(52428&ar)>>>2|(13107&ar)<<2))>>>4|(3855&ar)<<4,Sx[ae]=((65280&ar)>>>8|(255&ar)<<8)>>>1}var Ms=function(t,e,n){for(var r=t.length,i=0,s=new ut(e);i<r;++i)++s[t[i]-1];var o,a=new ut(e);for(i=0;i<e;++i)a[i]=a[i-1]+s[i-1]<<1;for(o=new ut(r),i=0;i<r;++i)o[i]=Sx[a[t[i]-1]++]>>>15-t[i];return o},Mr=new Rt(288);for(ae=0;ae<144;++ae)Mr[ae]=8;for(ae=144;ae<256;++ae)Mr[ae]=9;for(ae=256;ae<280;++ae)Mr[ae]=7;for(ae=280;ae<288;++ae)Mr[ae]=8;var ol=new Rt(32);for(ae=0;ae<32;++ae)ol[ae]=5;var _I=Ms(Mr,9),wI=Ms(ol,5),Ex=function(t){return(t/8>>0)+(7&t&&1)},kx=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof ut?ut:t instanceof Ai?Ai:Rt)(n-e);return r.set(t.subarray(e,n)),r},ln=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8},Zi=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},Ku=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,s=n.slice();if(!i)return[new Rt(0),0];if(i==1){var o=new Rt(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(E,A){return E.f-A.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[u].f<n[d].f?u++:d++],l=n[u!=c&&n[u].f<n[d].f?u++:d++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var f=s[0].s;for(r=1;r<i;++r)s[r].s>f&&(f=s[r].s);var h=new ut(f+1),y=Gd(n[c-1],h,0);if(y>e){r=0;var m=0,_=y-e,p=1<<_;for(s.sort(function(E,A){return h[A.s]-h[E.s]||E.f-A.f});r<i;++r){var g=s[r].s;if(!(h[g]>e))break;m+=p-(1<<y-h[g]),h[g]=e}for(m>>>=_;m>0;){var v=s[r].s;h[v]<e?m-=1<<e-h[v]++-1:++r}for(;r>=0&&m;--r){var w=s[r].s;h[w]==e&&(--h[w],++m)}y=e}return[new Rt(h),y]},Gd=function(t,e,n){return t.s==-1?Math.max(Gd(t.l,e,n+1),Gd(t.r,e,n+1)):e[t.s]=n},Ev=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ut(++e),r=0,i=t[0],s=1,o=function(l){n[r++]=l},a=1;a<=e;++a)if(t[a]==i&&a!=e)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=t[a]}return[n.subarray(0,r),e]},Ji=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},qd=function(t,e,n){var r=n.length,i=Ex(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 s=0;s<r;++s)t[i+s+4]=n[s];return 8*(i+4+r)},kv=function(t,e,n,r,i,s,o,a,l,u,c){ln(e,c++,n),++i[256];for(var d=Ku(i,15),f=d[0],h=d[1],y=Ku(s,15),m=y[0],_=y[1],p=Ev(f),g=p[0],v=p[1],w=Ev(m),E=w[0],A=w[1],b=new ut(19),S=0;S<g.length;++S)b[31&g[S]]++;for(S=0;S<E.length;++S)b[31&E[S]]++;for(var k=Ku(b,7),P=k[0],R=k[1],N=19;N>4&&!P[xv[N-1]];--N);var V,$,K,Q,U=u+5<<3,M=Ji(i,Mr)+Ji(s,ol)+o,L=Ji(i,f)+Ji(s,m)+o+14+3*N+Ji(b,P)+(2*b[16]+3*b[17]+7*b[18]);if(U<=M&&U<=L)return qd(e,c,t.subarray(l,l+u));if(ln(e,c,1+(L<M)),c+=2,L<M){V=Ms(f,h),$=f,K=Ms(m,_),Q=m;var z=Ms(P,R);for(ln(e,c,v-257),ln(e,c+5,A-1),ln(e,c+10,N-4),c+=14,S=0;S<N;++S)ln(e,c+3*S,P[xv[S]]);c+=3*N;for(var J=[g,E],G=0;G<2;++G){var ve=J[G];for(S=0;S<ve.length;++S){var ue=31&ve[S];ln(e,c,z[ue]),c+=P[ue],ue>15&&(ln(e,c,ve[S]>>>5&127),c+=ve[S]>>>12)}}}else V=_I,$=Mr,K=wI,Q=ol;for(S=0;S<a;++S)if(r[S]>255){ue=r[S]>>>18&31,Zi(e,c,V[ue+257]),c+=$[ue+257],ue>7&&(ln(e,c,r[S]>>>23&31),c+=Xh[ue]);var Gt=31&r[S];Zi(e,c,K[Gt]),c+=Q[Gt],Gt>3&&(Zi(e,c,r[S]>>>5&8191),c+=Qh[Gt])}else Zi(e,c,V[r[S]]),c+=$[r[S]];return Zi(e,c,V[256]),c+$[256]},xI=new Ai([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),SI=function(){for(var t=new Ai(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),EI=function(){var t=4294967295;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=SI[255&n^e[r]]^n>>>8;t=n},d:function(){return 4294967295^t}}},kI=function(t,e,n,r,i){return function(s,o,a,l,u,c){var d=s.length,f=new Rt(l+d+5*(1+Math.floor(d/7e3))+u),h=f.subarray(l,f.length-u),y=0;if(!o||d<8)for(var m=0;m<=d;m+=65535){var _=m+65535;_<d?y=qd(h,y,s.subarray(m,_)):(h[m]=c,y=qd(h,y,s.subarray(m,d)))}else{for(var p=xI[o-1],g=p>>>13,v=8191&p,w=(1<<a)-1,E=new ut(32768),A=new ut(w+1),b=Math.ceil(a/3),S=2*b,k=function(Gl){return(s[Gl]^s[Gl+1]<<b^s[Gl+2]<<S)&w},P=new Ai(25e3),R=new ut(288),N=new ut(32),V=0,$=0,K=(m=0,0),Q=0,U=0;m<d;++m){var M=k(m),L=32767&m,z=A[M];if(E[L]=z,A[M]=L,Q<=m){var J=d-m;if((V>7e3||K>24576)&&J>423){y=kv(s,h,0,P,R,N,$,K,U,m-U,y),K=V=$=0,U=m;for(var G=0;G<286;++G)R[G]=0;for(G=0;G<30;++G)N[G]=0}var ve=2,ue=0,Gt=v,je=L-z&32767;if(J>2&&M==k(m-je))for(var Or=Math.min(g,J)-1,oS=Math.min(32767,m),aS=Math.min(258,J);je<=oS&&--Gt&&L!=z;){if(s[m+ve]==s[m+ve-je]){for(var Tn=0;Tn<aS&&s[m+Tn]==s[m+Tn-je];++Tn);if(Tn>ve){if(ve=Tn,ue=je,Tn>Or)break;var lS=Math.min(je,Tn-2),ap=0;for(G=0;G<lS;++G){var Kl=m-je+G+32768&32767,lp=Kl-E[Kl]+32768&32767;lp>ap&&(ap=lp,z=Kl)}}}je+=(L=z)-(z=E[L])+32768&32767}if(ue){P[K++]=268435456|Kd[ve]<<18|Sv[ue];var up=31&Kd[ve],cp=31&Sv[ue];$+=Xh[up]+Qh[cp],++R[257+up],++N[cp],Q=m+ve,++V}else P[K++]=s[m],++R[s[m]]}}y=kv(s,h,c,P,R,N,$,K,U,m-U,y)}return kx(f,0,l+Ex(y)+u)}(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!0)},Yd=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},CI=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&Yd(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},PI=function(t){return 10+(t.filename&&t.filename.length+1||0)};function Cx(t,e){e===void 0&&(e={});var n=EI(),r=t.length;n.p(t);var i=kI(t,e,PI(e),8),s=i.length;return CI(i,e),Yd(i,s-8,n.d()),Yd(i,s-4,r),i}function Px(t,e){var n=t.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(t);for(var r=new Rt(t.length+(t.length>>>1)),i=0,s=function(u){r[i++]=u},o=0;o<n;++o){if(i+5>r.length){var a=new Rt(i+8+(n-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);l<128||e?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return kx(r,0,i)}function TI(t,e){return function(n){for(var r=0,i=0;i<n.length;i++)r=(r<<5)-r+n.charCodeAt(i),r|=0;return Math.abs(r)}(t)%100<mt(100*e,0,100,F)}var er="disabled",Zh="sampled",al="active",Ir="buffering",Jh="paused",ep="trigger",on=ep+"_activated",Ge=ep+"_pending",an=ep+"_"+er;function Cv(t,e){return e.some(n=>n.matching==="regex"&&new RegExp(n.url).test(t))}class Tx{constructor(e){this.Rt=e}triggerStatus(e){var n=this.Rt.map(r=>r.triggerStatus(e));return n.includes(on)?on:n.includes(Ge)?Ge:an}stop(){this.Rt.forEach(e=>e.stop())}}class bx{constructor(e){this.Rt=e}triggerStatus(e){var n=new Set;for(var r of this.Rt)n.add(r.triggerStatus(e));switch(n.delete(an),n.size){case 0:return an;case 1:return Array.from(n)[0];default:return Ge}}stop(){this.Rt.forEach(e=>e.stop())}}class bI{triggerStatus(){return Ge}stop(){}}var ll=t=>"sessionRecording"in t;class AI{constructor(e){this.Pt=[],this.It=[],this.urlBlocked=!1,this._instance=e}onConfig(e){var n,r;this.Pt=(ll(e)?(n=e.sessionRecording)==null?void 0:n.urlTriggers:e==null?void 0:e.urlTriggers)||[],this.It=(ll(e)?(r=e.sessionRecording)==null?void 0:r.urlBlocklist:e==null?void 0:e.urlBlocklist)||[]}onRemoteConfig(e){this.onConfig(e)}Tt(e){var n;return this.Pt.length===0?an:((n=this._instance)==null?void 0:n.get_property(Dd))===e?on:Ge}triggerStatus(e){var n=this.Tt(e),r=n===on?on:n===Ge?Ge:an;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlTriggerConditions(e,n,r){if(T!==void 0&&T.location.href){var i=T.location.href,s=this.urlBlocked,o=Cv(i,this.It);s&&o||(o&&!s?e():!o&&s&&n(),Cv(i,this.Pt)&&r("url"))}}stop(){}}class RI{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Ct=()=>{},this._instance=e}triggerStatus(){var e=Ge;return X(this.linkedFlag)&&(e=an),this.linkedFlagSeen&&(e=on),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}onConfig(e,n){var r;if(this.linkedFlag=(ll(e)?(r=e.sessionRecording)==null?void 0:r.linkedFlag:e==null?void 0:e.linkedFlag)||null,!X(this.linkedFlag)&&!this.linkedFlagSeen){var i=xe(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,s=xe(this.linkedFlag)?null:this.linkedFlag.variant;this.Ct=this._instance.onFeatureFlags((o,a)=>{var l=!1;if(we(a)&&i in a){var u=a[i];l=Bt(u)?u===!0:s?u===s:!!u}this.linkedFlagSeen=l,l&&n(i,s)})}}onRemoteConfig(e,n){this.onConfig(e,n)}stop(){this.Ct()}}class MI{constructor(e){this.Mt=[],this._instance=e}onConfig(e){var n;this.Mt=(ll(e)?(n=e.sessionRecording)==null?void 0:n.eventTriggers:e==null?void 0:e.eventTriggers)||[]}onRemoteConfig(e){this.onConfig(e)}Ot(e){var n;return this.Mt.length===0?an:((n=this._instance)==null?void 0:n.get_property(Ld))===e?on:Ge}triggerStatus(e){var n=this.Ot(e),r=n===on?on:n===Ge?Ge:an;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}stop(){}}function II(t){return t.isRecordingEnabled?Ir:er}function NI(t){if(!t.receivedFlags)return Ir;if(!t.isRecordingEnabled)return er;if(t.urlTriggerMatching.urlBlocked)return Jh;var e=t.isSampled===!0,n=new Tx([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Zh:n===on?al:n===Ge?Ir:t.isSampled===!1?er:al}function DI(t){if(!t.receivedFlags)return Ir;if(!t.isRecordingEnabled)return er;if(t.urlTriggerMatching.urlBlocked)return Jh;var e=new bx([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),n=e!==an,r=Bt(t.isSampled);return n&&e===Ge?Ir:n&&e===an||r&&!t.isSampled?er:t.isSampled===!0?Zh:al}var fs="[SessionRecording]",Me=Re(fs);function Go(){var t;return H==null||(t=H.__PosthogExtensions__)==null||(t=t.rrweb)==null?void 0:t.record}var LI=3e5,OI=[Ft.MouseMove,Ft.MouseInteraction,Ft.Scroll,Ft.ViewportResize,Ft.Input,Ft.TouchMove,Ft.MediaInteraction,Ft.Drag],Pv=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function lr(t){return function(e,n){for(var r="",i=0;i<e.length;){var s=e[i++];r+=String.fromCharCode(s)}return r}(Cx(Px(JSON.stringify(t))))}function Tv(t){return t.type===Qt.Custom&&t.data.tag==="sessionIdle"}class bv{get sessionId(){return this.Ft}get At(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.Dt}get jt(){if(!this._instance.sessionManager)throw new Error(fs+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Lt(){var e,n;return this.Nt.triggerStatus(this.sessionId)===Ge?6e4:(e=(n=this._instance.config.session_recording)==null?void 0:n.full_snapshot_interval_millis)!==null&&e!==void 0?e:LI}get Ut(){var e=this._instance.get_property(si);return Bt(e)?e:null}get zt(){var e,n,r=(e=this.H)==null?void 0:e.data[((n=this.H)==null?void 0:n.data.length)-1],{sessionStartTimestamp:i}=this.jt.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i:null}get Bt(){var e=!!this._instance.get_property(Nd),n=!this._instance.config.disable_session_recording;return T&&e&&n}get qt(){var e=!!this._instance.get_property(iv),n=this._instance.config.enable_recording_console_log;return n??e}get Ht(){var e,n,r,i,s,o,a=this._instance.config.session_recording.captureCanvas,l=this._instance.get_property(av),u=(e=(n=a==null?void 0:a.recordCanvas)!==null&&n!==void 0?n:l==null?void 0:l.enabled)!==null&&e!==void 0&&e,c=(r=(i=a==null?void 0:a.canvasFps)!==null&&i!==void 0?i:l==null?void 0:l.fps)!==null&&r!==void 0?r:4,d=(s=(o=a==null?void 0:a.canvasQuality)!==null&&o!==void 0?o:l==null?void 0:l.quality)!==null&&s!==void 0?s:.4;if(typeof d=="string"){var f=parseFloat(d);d=isNaN(f)?.4:f}return{enabled:u,fps:mt(c,0,12,Me.createLogger("canvas recording fps"),4),quality:mt(d,0,1,Me.createLogger("canvas recording quality"),.4)}}get Wt(){var e,n,r=this._instance.get_property(sv),i={recordHeaders:(e=this._instance.config.session_recording)==null?void 0:e.recordHeaders,recordBody:(n=this._instance.config.session_recording)==null?void 0:n.recordBody},s=(i==null?void 0:i.recordHeaders)||(r==null?void 0:r.recordHeaders),o=(i==null?void 0:i.recordBody)||(r==null?void 0:r.recordBody),a=we(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,l=!!(Bt(a)?a:r!=null&&r.capturePerformance);return s||o||l?{recordHeaders:s,recordBody:o,recordPerformance:l}:void 0}get Gt(){var e,n,r,i,s,o,a=this._instance.get_property(ov),l={maskAllInputs:(e=this._instance.config.session_recording)==null?void 0:e.maskAllInputs,maskTextSelector:(n=this._instance.config.session_recording)==null?void 0:n.maskTextSelector,blockSelector:(r=this._instance.config.session_recording)==null?void 0:r.blockSelector},u=(i=l==null?void 0:l.maskAllInputs)!==null&&i!==void 0?i:a==null?void 0:a.maskAllInputs,c=(s=l==null?void 0:l.maskTextSelector)!==null&&s!==void 0?s:a==null?void 0:a.maskTextSelector,d=(o=l==null?void 0:l.blockSelector)!==null&&o!==void 0?o:a==null?void 0:a.blockSelector;return D(u)&&D(c)&&D(d)?void 0:{maskAllInputs:u==null||u,maskTextSelector:c,blockSelector:d}}get Vt(){var e=this._instance.get_property(lv);return He(e)?e:null}get Jt(){var e=this._instance.get_property(uv);return He(e)?e:null}get status(){return this.Kt?this.Yt({receivedFlags:this.Kt,isRecordingEnabled:this.Bt,isSampled:this.Ut,urlTriggerMatching:this.Xt,eventTriggerMatching:this.Qt,linkedFlagMatching:this.Zt,sessionId:this.sessionId}):Ir}constructor(e){if(this.Yt=II,this.Kt=!1,this.ti=[],this.ii="unknown",this.ei=Date.now(),this.Nt=new bI,this.ri=void 0,this.si=void 0,this.ni=void 0,this.oi=void 0,this.ai=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.li=()=>{this.ui()},this.hi=()=>{this.tryAddCustomEvent("browser offline",{})},this.di=()=>{this.tryAddCustomEvent("browser online",{})},this.vi=()=>{if(j!=null&&j.visibilityState){var i="window "+j.visibilityState;this.tryAddCustomEvent(i,{})}},this._instance=e,this.Dt=!1,this.ci="/s/",this.fi=void 0,this.Kt=!1,!this._instance.sessionManager)throw Me.error("started without valid sessionManager"),new Error(fs+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(fs+' cannot be used with cookieless_mode="always"');this.Zt=new RI(this._instance),this.Xt=new AI(this._instance),this.Qt=new MI(this._instance);var{sessionId:n,windowId:r}=this.jt.checkAndGetSessionAndWindowId();this.Ft=n,this.pi=r,this.H=this.gi(),this.At>=this.jt.sessionTimeoutMs&&Me.warn("session_idle_threshold_ms ("+this.At+") is greater than the session timeout ("+this.jt.sessionTimeoutMs+"). Session will never be detected as idle")}startIfEnabledOrStop(e){this.Bt?(this.mi(e),pe(T,"beforeunload",this.li),pe(T,"offline",this.hi),pe(T,"online",this.di),pe(T,"visibilitychange",this.vi),this.yi(),this.bi(),X(this.ri)&&(this.ri=this._instance.on("eventCaptured",n=>{try{if(n.event==="$pageview"){var r=n!=null&&n.properties.$current_url?this.wi(n==null?void 0:n.properties.$current_url):"";if(!r)return;this.tryAddCustomEvent("$pageview",{href:r})}}catch(i){Me.error("Could not add $pageview to rrweb session",i)}})),this.si||(this.si=this.jt.onSessionId((n,r,i)=>{var s,o;i&&(this.tryAddCustomEvent("$session_id_change",{sessionId:n,windowId:r,changeReason:i}),(s=this._instance)==null||(s=s.persistence)==null||s.unregister(Ld),(o=this._instance)==null||(o=o.persistence)==null||o.unregister(Dd))}))):this.stopRecording()}stopRecording(){var e,n,r,i;this.Dt&&this.fi&&(this.fi(),this.fi=void 0,this.Dt=!1,T==null||T.removeEventListener("beforeunload",this.li),T==null||T.removeEventListener("offline",this.hi),T==null||T.removeEventListener("online",this.di),T==null||T.removeEventListener("visibilitychange",this.vi),this.gi(),clearInterval(this.Si),(e=this.ri)==null||e.call(this),this.ri=void 0,(n=this.ai)==null||n.call(this),this.ai=void 0,(r=this.si)==null||r.call(this),this.si=void 0,(i=this.oi)==null||i.call(this),this.oi=void 0,this.Qt.stop(),this.Xt.stop(),this.Zt.stop(),Me.info("stopped"))}ki(){var e;(e=this._instance.persistence)==null||e.unregister(si)}$i(e){var n,r=this.Ft!==e,i=this.Vt;if(He(i)){var s=this.Ut,o=r||!Bt(s),a=o?TI(e,i):s;o&&(a?this.xi(Zh):Me.warn("Sample rate ("+i+") has determined that this sessionId ("+e+") will not be sent to the server."),this.tryAddCustomEvent("samplingDecisionMade",{sampleRate:i,isSampled:a})),(n=this._instance.persistence)==null||n.register({[si]:a})}else this.ki()}onRemoteConfig(e){var n,r,i,s;this.tryAddCustomEvent("$remote_config_received",e),this.Ei(e),(n=e.sessionRecording)!=null&&n.endpoint&&(this.ci=(s=e.sessionRecording)==null?void 0:s.endpoint),this.yi(),((r=e.sessionRecording)==null?void 0:r.triggerMatchType)==="any"?(this.Yt=NI,this.Nt=new Tx([this.Qt,this.Xt])):(this.Yt=DI,this.Nt=new bx([this.Qt,this.Xt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:(i=e.sessionRecording)==null?void 0:i.triggerMatchType}),this.Xt.onConfig(e),this.Qt.onConfig(e),this.Zt.onConfig(e,(o,a)=>{this.xi("linked_flag_matched",{flag:o,variant:a})}),this.Kt=!0,this.startIfEnabledOrStop()}yi(){He(this.Vt)&&X(this.oi)&&(this.oi=this.jt.onSessionId(e=>{this.$i(e)}))}Ei(e){if(this._instance.persistence){var n,r=this._instance.persistence,i=()=>{var s,o,a,l,u,c,d,f,h,y=(s=e.sessionRecording)==null?void 0:s.sampleRate,m=X(y)?null:parseFloat(y);X(m)&&this.ki();var _=(o=e.sessionRecording)==null?void 0:o.minimumDurationMilliseconds;r.register({[Nd]:!!e.sessionRecording,[iv]:(a=e.sessionRecording)==null?void 0:a.consoleLogRecordingEnabled,[sv]:O({capturePerformance:e.capturePerformance},(l=e.sessionRecording)==null?void 0:l.networkPayloadCapture),[ov]:(u=e.sessionRecording)==null?void 0:u.masking,[av]:{enabled:(c=e.sessionRecording)==null?void 0:c.recordCanvas,fps:(d=e.sessionRecording)==null?void 0:d.canvasFps,quality:(f=e.sessionRecording)==null?void 0:f.canvasQuality},[lv]:m,[uv]:D(_)?null:_,[cv]:(h=e.sessionRecording)==null?void 0:h.scriptConfig})};i(),(n=this.ni)==null||n.call(this),this.ni=this.jt.onSessionId(i)}}log(e,n){var r;n===void 0&&(n="log"),(r=this._instance.sessionRecording)==null||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}mi(e){if(!D(Object.assign)&&!D(Array.from)&&!(this.Dt||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())){var n;this.Dt=!0,this.jt.checkAndGetSessionAndWindowId(),Go()?this.Ri():(n=H.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.Pi,r=>{if(r)return Me.error("could not load recorder",r);this.Ri()}),Me.info("starting"),this.status===al&&this.xi(e||"recording_initialized")}}get Pi(){var e;return((e=this._instance)==null||(e=e.persistence)==null||(e=e.get_property(cv))==null?void 0:e.script)||"recorder"}Ii(e){var n;return e.type===3&&OI.indexOf((n=e.data)==null?void 0:n.source)!==-1}Ti(e){var n=this.Ii(e);n||this.ii||e.timestamp-this.ei>this.At&&(this.ii=!0,clearInterval(this.Si),this.tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.ei,threshold:this.At,bufferLength:this.H.data.length,bufferSize:this.H.size}),this.ui());var r=!1;if(n&&(this.ei=e.timestamp,this.ii)){var i=this.ii==="unknown";this.ii=!1,i||(this.tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)}if(!this.ii){var{windowId:s,sessionId:o}=this.jt.checkAndGetSessionAndWindowId(!n,e.timestamp),a=this.Ft!==o,l=this.pi!==s;this.pi=s,this.Ft=o,a||l?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):r&&this.Ci()}}Mi(e){try{return e.rrwebMethod(),!0}catch(n){return this.ti.length<10?this.ti.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Me.warn("could not emit queued rrweb event.",n,e),!1}}tryAddCustomEvent(e,n){return this.Mi(Pv(()=>Go().addCustomEvent(e,n)))}Oi(){return this.Mi(Pv(()=>Go().takeFullSnapshot()))}Ri(){var e,n,r,i,s={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},o=this._instance.config.session_recording;for(var[a,l]of Object.entries(o||{}))a in s&&(a==="maskInputOptions"?s.maskInputOptions=O({password:!0},l):s[a]=l);this.Ht&&this.Ht.enabled&&(s.recordCanvas=!0,s.sampling={canvas:this.Ht.fps},s.dataURLOptions={type:"image/webp",quality:this.Ht.quality}),this.Gt&&(s.maskAllInputs=(n=this.Gt.maskAllInputs)===null||n===void 0||n,s.maskTextSelector=(r=this.Gt.maskTextSelector)!==null&&r!==void 0?r:void 0,s.blockSelector=(i=this.Gt.blockSelector)!==null&&i!==void 0?i:void 0);var u=Go();if(u){this.Fi=(e=this.Fi)!==null&&e!==void 0?e:new vI(u,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(d,f)=>{var h="Too many mutations on node '"+d+"'. Rate limiting. This could be due to SVG animations or something similar";Me.info(h,{node:f}),this.log(fs+" "+h,"warn")}});var c=this.Ai();this.fi=u(O({emit:d=>{this.onRRwebEmit(d)},plugins:c},s)),this.ei=Date.now(),this.ii=Bt(this.ii)?this.ii:"unknown",this.tryAddCustomEvent("$session_options",{sessionRecordingOptions:s,activePlugins:c.map(d=>d==null?void 0:d.name)}),this.tryAddCustomEvent("$posthog_config",{config:this._instance.config})}else Me.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}Ci(){if(this.Si&&clearInterval(this.Si),this.ii!==!0){var e=this.Lt;e&&(this.Si=setInterval(()=>{this.Oi()},e))}}Ai(){var e,n,r=[],i=(e=H.__PosthogExtensions__)==null||(e=e.rrwebPlugins)==null?void 0:e.getRecordConsolePlugin;i&&this.qt&&r.push(i());var s=(n=H.__PosthogExtensions__)==null||(n=n.rrwebPlugins)==null?void 0:n.getRecordNetworkPlugin;return this.Wt&&At(s)&&(!Y2.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(s(mI(this._instance.config,this.Wt))):Me.info("NetworkCapture not started because we are on localhost.")),r}onRRwebEmit(e){var n;if(this.Di(),e&&we(e)){if(e.type===Qt.Meta){var r=this.wi(e.data.href);if(this.ji=r,!r)return;e.data.href=r}else this.Li();if(this.Xt.checkUrlTriggerConditions(()=>this.Ni(),()=>this.Ui(),f=>this.zi(f)),!this.Xt.urlBlocked||(i=e).type===Qt.Custom&&i.data.tag==="recording paused"){var i;e.type===Qt.FullSnapshot&&this.Ci(),e.type===Qt.FullSnapshot&&this.Kt&&this.Nt.triggerStatus(this.sessionId)===Ge&&this.Bi();var s=this.Fi?this.Fi.throttleMutations(e):e;if(s){var o=function(f){var h=f;if(h&&we(h)&&h.type===6&&we(h.data)&&h.data.plugin==="rrweb/console@1"){h.data.payload.payload.length>10&&(h.data.payload.payload=h.data.payload.payload.slice(0,10),h.data.payload.payload.push("...[truncated]"));for(var y=[],m=0;m<h.data.payload.payload.length;m++)h.data.payload.payload[m]&&h.data.payload.payload[m].length>2e3?y.push(h.data.payload.payload[m].slice(0,2e3)+"...[truncated]"):y.push(h.data.payload.payload[m]);return h.data.payload.payload=y,f}return f}(s);if(this.Ti(o),this.ii!==!0||Tv(o)){if(Tv(o)){var a=o.data.payload;if(a){var l=a.lastActivityTimestamp,u=a.threshold;o.timestamp=l+u}}var c=(n=this._instance.config.session_recording.compress_events)===null||n===void 0||n?function(f){if(Rs(f)<1024)return f;try{if(f.type===Qt.FullSnapshot)return O({},f,{data:lr(f.data),cv:"2024-10"});if(f.type===Qt.IncrementalSnapshot&&f.data.source===Ft.Mutation)return O({},f,{cv:"2024-10",data:O({},f.data,{texts:lr(f.data.texts),attributes:lr(f.data.attributes),removes:lr(f.data.removes),adds:lr(f.data.adds)})});if(f.type===Qt.IncrementalSnapshot&&f.data.source===Ft.StyleSheetRule)return O({},f,{cv:"2024-10",data:O({},f.data,{adds:f.data.adds?lr(f.data.adds):void 0,removes:f.data.removes?lr(f.data.removes):void 0})})}catch(h){Me.error("could not compress event - will use uncompressed event",h)}return f}(o):o,d={$snapshot_bytes:Rs(c),$snapshot_data:c,$session_id:this.Ft,$window_id:this.pi};this.status!==er?this.qi(d):this.gi()}}}}}Li(){if(!this._instance.config.capture_pageview&&T){var e=this.wi(T.location.href);this.ji!==e&&(this.tryAddCustomEvent("$url_changed",{href:e}),this.ji=e)}}Di(){if(this.ti.length){var e=[...this.ti];this.ti=[],e.forEach(n=>{Date.now()-n.enqueuedAt<=2e3&&this.Mi(n)})}}wi(e){var n=this._instance.config.session_recording;if(n.maskNetworkRequestFn){var r,i={url:e};return(r=i=n.maskNetworkRequestFn(i))==null?void 0:r.url}return e}Bi(){if(!this.H||this.H.data.length===0)return this.gi();for(var e=-1,n=this.H.data.length-1;n>=0;n--)if(this.H.data[n].type===Qt.Meta){e=n;break}return e>=0?(this.H.data=this.H.data.slice(e),this.H.size=this.H.data.reduce((r,i)=>r+Rs(i),0),this.H):this.gi()}gi(){return this.H={size:0,data:[],sessionId:this.Ft,windowId:this.pi},this.H}ui(){this.Hi&&(clearTimeout(this.Hi),this.Hi=void 0);var e=this.Jt,n=this.zt,r=He(n)&&n>=0,i=He(e)&&r&&n<e;return this.status===Ir||this.status===Jh||this.status===er||i?(this.Hi=setTimeout(()=>{this.ui()},2e3),this.H):(this.H.data.length>0&&Ud(this.H).forEach(s=>{this.Wi({$snapshot_bytes:s.size,$snapshot_data:s.data,$session_id:s.sessionId,$window_id:s.windowId,$lib:"web",$lib_version:hn.LIB_VERSION})}),this.gi())}qi(e){var n,r=2+(((n=this.H)==null?void 0:n.data.length)||0);!this.ii&&(this.H.size+e.$snapshot_bytes+r>943718.4||this.H.sessionId!==this.Ft)&&(this.H=this.ui()),this.H.size+=e.$snapshot_bytes,this.H.data.push(e.$snapshot_data),this.Hi||this.ii||(this.Hi=setTimeout(()=>{this.ui()},2e3))}Wi(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.ci),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}zi(e){var n;this.Nt.triggerStatus(this.sessionId)===Ge&&((n=this._instance)==null||(n=n.persistence)==null||n.register({[e==="url"?Dd:Ld]:this.Ft}),this.ui(),this.xi(e+"_trigger_matched"))}Ni(){this.Xt.urlBlocked||(this.Xt.urlBlocked=!0,clearInterval(this.Si),Me.info("recording paused due to URL blocker"),this.tryAddCustomEvent("recording paused",{reason:"url blocker"}))}Ui(){this.Xt.urlBlocked&&(this.Xt.urlBlocked=!1,this.Oi(),this.Ci(),this.tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Me.info("recording resumed"))}bi(){this.Qt.Mt.length!==0&&X(this.ai)&&(this.ai=this._instance.on("eventCaptured",e=>{try{this.Qt.Mt.includes(e.event)&&this.zi("event")}catch(n){Me.error("Could not activate event trigger",n)}}))}overrideLinkedFlag(){this.Zt.linkedFlagSeen=!0,this.Oi(),this.xi("linked_flag_overridden")}overrideSampling(){var e;(e=this._instance.persistence)==null||e.register({[si]:!0}),this.Oi(),this.xi("sampling_overridden")}overrideTrigger(e){this.zi(e)}xi(e,n){this._instance.register_for_session({$session_recording_start_reason:e}),Me.info(e.replace("_"," "),n),q(["recording_initialized","session_id_changed"],e)||this.tryAddCustomEvent(e,n)}get sdkDebugProperties(){var{sessionStartTimestamp:e}=this.jt.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.H.data.length,$sdk_debug_replay_internal_buffer_size:this.H.size,$sdk_debug_current_session_duration:this.zt,$sdk_debug_session_start:e}}}var Gu=Re("[SegmentIntegration]");function $I(t,e){var n=t.config.segment;if(!n)return e();(function(r,i){var s=r.config.segment;if(!s)return i();var o=l=>{var u=()=>l.anonymousId()||jn();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(cn,"identified")),i()},a=s.user();"then"in a&&At(a.then)?a.then(l=>o(l)):o(a)})(t,()=>{n.register((r=>{Promise&&Promise.resolve||Gu.warn("This browser does not have Promise support, and can not use the segment integration");var i=(s,o)=>{if(!o)return s;s.event.userId||s.event.anonymousId===r.get_distinct_id()||(Gu.info("No userId set, resetting PostHog"),r.reset()),s.event.userId&&s.event.userId!==r.get_distinct_id()&&(Gu.info("UserId set, identifying with PostHog"),r.identify(s.event.userId));var a=r.calculateEventProperties(o,s.event.properties);return s.event.properties=Object.assign({},a,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:s=>i(s,s.event.event),page:s=>i(s,"$pageview"),identify:s=>i(s,"$identify"),screen:s=>i(s,"$screen")}})(t)).then(()=>{e()})})}var Ax="posthog-js";function Rx(t,e){var{organization:n,projectId:r,prefix:i,severityAllowList:s=["error"],sendExceptionsToPostHog:o=!0}=e===void 0?{}:e;return a=>{var l,u,c,d,f;if(!(s==="*"||s.includes(a.level))||!t.__loaded)return a;a.tags||(a.tags={});var h=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());a.tags["PostHog Person URL"]=h,t.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var y=((l=a.exception)==null?void 0:l.values)||[],m=y.map(p=>O({},p,{stacktrace:p.stacktrace?O({},p.stacktrace,{type:"raw",frames:(p.stacktrace.frames||[]).map(g=>O({},g,{platform:"web:javascript"}))}):void 0})),_={$exception_message:((u=y[0])==null?void 0:u.value)||a.message,$exception_type:(c=y[0])==null?void 0:c.type,$exception_personURL:h,$exception_level:a.level,$exception_list:m,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((d=y[0])==null?void 0:d.value)||a.message,$sentry_exception_type:(f=y[0])==null?void 0:f.type,$sentry_tags:a.tags};return n&&r&&(_.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+a.event_id),o&&t.exceptions.sendExceptionEvent(_),a}}class FI{constructor(e,n,r,i,s,o){this.name=Ax,this.setupOnce=function(a){a(Rx(e,{organization:n,projectId:r,prefix:i,severityAllowList:s,sendExceptionsToPostHog:o==null||o}))}}}var jI=T!=null&&T.location?il(T.location.hash,"__posthog")||il(location.hash,"state"):null,Av="_postHogToolbarParams",Rv=Re("[Toolbar]"),In=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(In||{});class VI{constructor(e){this.instance=e}Gi(e){H.ph_toolbar_state=e}Vi(){var e;return(e=H.ph_toolbar_state)!==null&&e!==void 0?e:In.UNINITIALIZED}maybeLoadToolbar(e,n,r){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),!T||!j)return!1;e=e??T.location,r=r??T.history;try{if(!n){try{T.localStorage.setItem("test","test"),T.localStorage.removeItem("test")}catch{return!1}n=T==null?void 0:T.localStorage}var i,s=jI||il(e.hash,"__posthog")||il(e.hash,"state"),o=s?Zm(()=>JSON.parse(atob(decodeURIComponent(s))))||Zm(()=>JSON.parse(decodeURIComponent(s))):null;return o&&o.action==="ph_authorize"?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?e.hash=o.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(n.getItem(Av)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}Ji(e){var n=H.ph_load_toolbar||H.ph_load_editor;!X(n)&&At(n)?n(e,this.instance):Rv.warn("No toolbar load function found")}loadToolbar(e){var n=!(j==null||!j.getElementById(ix));if(!T||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=O({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(T.localStorage.setItem(Av,JSON.stringify(O({},i,{source:void 0}))),this.Vi()===In.LOADED)this.Ji(i);else if(this.Vi()===In.UNINITIALIZED){var s;this.Gi(In.LOADING),(s=H.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",o=>{if(o)return Rv.error("[Toolbar] Failed to load",o),void this.Gi(In.UNINITIALIZED);this.Gi(In.LOADED),this.Ji(i)}),pe(T,"turbolinks:load",()=>{this.Gi(In.UNINITIALIZED),this.loadToolbar(i)})}return!0}Ki(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)}}var BI=Re("[TracingHeaders]");class zI{constructor(e){this.Yi=void 0,this.Xi=void 0,this.lt=()=>{var n,r;D(this.Yi)&&((n=H.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),D(this.Xi)&&((r=H.__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}nt(e){var n,r;(n=H.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(r=H.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",i=>{if(i)return BI.error("failed to load script",i);e()})}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.nt(this.lt):((e=this.Yi)==null||e.call(this),(n=this.Xi)==null||n.call(this),this.Yi=void 0,this.Xi=void 0)}}var An=Re("[Web Vitals]"),Mv=9e5;class UI{constructor(e){var n;this.Qi=!1,this.C=!1,this.H={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Zi=()=>{clearTimeout(this.te),this.H.metrics.length!==0&&(this._instance.capture("$web_vitals",this.H.metrics.reduce((r,i)=>O({},r,{["$web_vitals_"+i.name+"_event"]:O({},i),["$web_vitals_"+i.name+"_value"]:i.value}),{})),this.H={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ie=r=>{var i,s=(i=this._instance.sessionManager)==null?void 0:i.checkAndGetSessionAndWindowId(!0);if(D(s))An.error("Could not read session ID. Dropping metrics!");else{this.H=this.H||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=this.ee();D(o)||(X(r==null?void 0:r.name)||X(r==null?void 0:r.value)?An.error("Invalid metric received",r):this.re&&r.value>=this.re?An.error("Ignoring metric with value >= "+this.re,r):(this.H.url!==o&&(this.Zi(),this.te=setTimeout(this.Zi,this.flushToCaptureTimeoutMs)),D(this.H.url)&&(this.H.url=o),this.H.firstMetricTimestamp=D(this.H.firstMetricTimestamp)?Date.now():this.H.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.H.metrics.push(O({},r,{$current_url:o,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.H.metrics.length===this.allowedMetrics.length&&this.Zi()))}},this.lt=()=>{var r,i,s,o,a=H.__PosthogExtensions__;D(a)||D(a.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:i,onFCP:s,onINP:o}=a.postHogWebVitalsCallbacks),r&&i&&s&&o?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.ie.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this.ie.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.ie.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&o(this.ie.bind(this)),this.C=!0):An.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Qi=!((n=this._instance.persistence)==null||!n.props[nv]),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 D(r)?((n=this._instance.persistence)==null?void 0:n.props[rv])||["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 re(){var e=we(this._instance.config.capture_performance)&&He(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Mv;return 0<e&&e<=6e4?Mv:e}get isEnabled(){var e=st==null?void 0:st.protocol;if(e!=="http:"&&e!=="https:")return An.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:Bt(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Bt(n)?n:this.Qi}startIfEnabled(){this.isEnabled&&!this.C&&(An.info("enabled, starting..."),this.nt(this.lt))}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({[nv]:n}),this._instance.persistence.register({[rv]:r})),this.Qi=n,this.startIfEnabled()}nt(e){var n,r;(n=H.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(r=H.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",i=>{i?An.error("failed to load script",i):e()})}ee(){var e=T?T.location.href:void 0;return e||An.error("Could not determine current URL"),e}}var HI=Re("[Heatmaps]");function Iv(t){return we(t)&&"clientX"in t&&"clientY"in t&&He(t.clientX)&&He(t.clientY)}class WI{constructor(e){var n;this.rageclicks=new vx,this.Qi=!1,this.C=!1,this.se=null,this.instance=e,this.Qi=!((n=this.instance.persistence)==null||!n.props[Md])}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 D(this.instance.config.capture_heatmaps)?D(this.instance.config.enable_heatmaps)?this.Qi:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.C)return;HI.info("starting..."),this.ne(),this.se=setInterval(this.oe.bind(this),this.flushIntervalMilliseconds)}else{var e,n;clearInterval((e=this.se)!==null&&e!==void 0?e:void 0),(n=this.ae)==null||n.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Md]:n}),this.Qi=n,this.startIfEnabled()}getAndClearBuffer(){var e=this.H;return this.H=void 0,e}le(e){this.ue(e.originalEvent,"deadclick")}ne(){T&&j&&(pe(T,"beforeunload",this.oe.bind(this)),pe(j,"click",e=>this.ue(e||(T==null?void 0:T.event)),{capture:!0}),pe(j,"mousemove",e=>this.he(e||(T==null?void 0:T.event)),{capture:!0}),this.ae=new _x(this.instance,uI,this.le.bind(this)),this.ae.startIfEnabled(),this.C=!0)}de(e,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(a,l,u){for(var c=a;c&&zl(c)&&!Yn(c,"body");){if(c===u)return!1;if(q(l,T==null?void 0:T.getComputedStyle(c).position))return!0;c=cx(c)}return!1}(lx(e),["fixed","sticky"],s);return{x:e.clientX+(o?0:i),y:e.clientY+(o?0:r),target_fixed:o,type:n}}ue(e,n){var r;if(n===void 0&&(n="click"),!dv(e.target)&&Iv(e)){var i=this.de(e,n);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.ve(O({},i,{type:"rageclick"})),this.ve(i)}}he(e){!dv(e.target)&&Iv(e)&&(clearTimeout(this.ce),this.ce=setTimeout(()=>{this.ve(this.de(e,"mousemove"))},500))}ve(e){if(T){var n=T.location.href;this.H=this.H||{},this.H[n]||(this.H[n]=[]),this.H[n].push(e)}}oe(){this.H&&!ii(this.H)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class KI{constructor(e){this._instance=e}doPageView(e,n){var r,i=this.fe(e,n);return this.pe={pathname:(r=T==null?void 0:T.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var n;return this.fe(e,(n=this.pe)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.pe)==null?void 0:e.pageViewId}}fe(e,n){var r=this.pe;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:a,maxScrollY:l,maxContentHeight:u,lastContentY:c,maxContentY:d}=s;if(!(D(o)||D(a)||D(l)||D(u)||D(c)||D(d))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d);var f=o<=1?1:mt(a/o,0,1,F),h=o<=1?1:mt(l/o,0,1,F),y=u<=1?1:mt(c/u,0,1,F),m=u<=1?1:mt(d/u,0,1,F);i=Ee(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:y,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:m})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var GI=function(t){var e,n,r,i,s="";for(e=n=0,r=(t=(t+"").replace(/\r\n/g,`
|
|
144
|
+
`).replace(/\r/g,`
|
|
145
|
+
`)).length,i=0;i<r;i++){var o=t.charCodeAt(i),a=null;o<128?n++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Pn(a)||(n>e&&(s+=t.substring(e,n)),s+=a,e=n=i+1)}return n>e&&(s+=t.substring(e,t.length)),s},qI=!!Pd||!!Cd,Nv="text/plain",ul=(t,e)=>{var[n,r]=t.split("?"),i=O({},e);r==null||r.split("&").forEach(o=>{var[a]=o.split("=");delete i[a]});var s=X2(i);return n+"?"+(s=s?(r?r+"&":"")+s:r)},hs=(t,e)=>JSON.stringify(t,(n,r)=>typeof r=="bigint"?r.toString():r,e),qu=t=>{var{data:e,compression:n}=t;if(e){if(n===pn.GZipJS){var r=Cx(Px(hs(e)),{mtime:0}),i=new Blob([r],{type:Nv});return{contentType:Nv,body:i,estimatedSize:i.size}}if(n===pn.Base64){var s=function(l){var u,c,d,f,h,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,_=0,p="",g=[];if(!l)return l;l=GI(l);do u=(h=l.charCodeAt(m++)<<16|l.charCodeAt(m++)<<8|l.charCodeAt(m++))>>18&63,c=h>>12&63,d=h>>6&63,f=63&h,g[_++]=y.charAt(u)+y.charAt(c)+y.charAt(d)+y.charAt(f);while(m<l.length);switch(p=g.join(""),l.length%3){case 1:p=p.slice(0,-2)+"==";break;case 2:p=p.slice(0,-1)+"="}return p}(hs(e)),o=(l=>"data="+encodeURIComponent(typeof l=="string"?l:hs(l)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=hs(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},ha=[];Cd&&ha.push({transport:"fetch",method:t=>{var e,n,{contentType:r,body:i,estimatedSize:s}=(e=qu(t))!==null&&e!==void 0?e:{},o=new Headers;re(t.headers,function(c,d){o.append(d,c)}),r&&o.append("Content-Type",r);var a=t.url,l=null;if(Wm){var u=new Wm;l={signal:u.signal,timeout:setTimeout(()=>u.abort(),t.timeout)}}Cd(a,O({method:(t==null?void 0:t.method)||"GET",headers:o,keepalive:t.method==="POST"&&(s||0)<52428.8,body:i,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then(c=>c.text().then(d=>{var f={statusCode:c.status,text:d};if(c.status===200)try{f.json=JSON.parse(d)}catch(h){F.error(h)}t.callback==null||t.callback(f)})).catch(c=>{F.error(c),t.callback==null||t.callback({statusCode:0,text:c})}).finally(()=>l?clearTimeout(l.timeout):null)}}),Pd&&ha.push({transport:"XHR",method:t=>{var e,n=new Pd;n.open(t.method||"GET",t.url,!0);var{contentType:r,body:i}=(e=qu(t))!==null&&e!==void 0?e:{};re(t.headers,function(s,o){n.setRequestHeader(o,s)}),r&&n.setRequestHeader("Content-Type",r),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(i)}}),gt!=null&>.sendBeacon&&ha.push({transport:"sendBeacon",method:t=>{var e=ul(t.url,{beacon:"1"});try{var n,{contentType:r,body:i}=(n=qu(t))!==null&&n!==void 0?n:{},s=typeof i=="string"?new Blob([i],{type:r}):i;gt.sendBeacon(e,s)}catch{}}});var Ri=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 Dv(t,e,n){return hs({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var Mx={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=>Ri(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!Ri(n,r))),icontains:(t,e)=>e.map(qo).some(n=>t.map(qo).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(qo).every(n=>t.map(qo).every(r=>!n.includes(r)))},qo=t=>t.toLowerCase(),Lv=Re("[Error tracking]");class YI{constructor(e){var n,r;this.ge=[],this._e=new C2([new P2,new L2,new b2,new T2,new N2,new I2,new R2,new D2],[w2,E2]),this._instance=e,this.ge=(n=(r=this._instance.persistence)==null?void 0:r.get_property(Id))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,r,i,s=(n=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],o=(i=e.errorTracking)==null?void 0:i.captureExtensionExceptions;this.ge=s,this._instance.persistence&&this._instance.persistence.register({[Id]:this.ge,[tv]:o})}get me(){var e,n=!!this._instance.get_property(tv),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this._e.buildFromUnknown(e,{syntheticException:n==null?void 0:n.syntheticException,mechanism:{handled:n==null?void 0:n.handled}})}sendExceptionEvent(e){if(this.ye(e))Lv.info("Skipping exception capture because a suppression rule matched");else{if(this.me||!this.be(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});Lv.info("Skipping exception capture because it was thrown by an extension")}}ye(e){var n=e.$exception_list;if(!n||!ie(n)||n.length===0)return!1;var r=n.reduce((i,s)=>{var{type:o,value:a}=s;return xe(o)&&o.length>0&&i.$exception_types.push(o),xe(a)&&a.length>0&&i.$exception_values.push(a),i},{$exception_types:[],$exception_values:[]});return this.ge.some(i=>{var s=i.values.map(o=>{var a,l=Mx[o.operator],u=ie(o.value)?o.value:[o.value],c=(a=r[o.key])!==null&&a!==void 0?a:[];return u.length>0&&l(u,c)});return i.type==="OR"?s.some(Boolean):s.every(Boolean)})}be(e){var n=e.$exception_list;return!(!n||!ie(n))&&n.flatMap(r=>{var i,s;return(i=(s=r.stacktrace)==null?void 0:s.frames)!==null&&i!==void 0?i:[]}).some(r=>r.filename&&r.filename.startsWith("chrome-extension://"))}}var Mt="Mobile",cl="iOS",Jt="Android",no="Tablet",Ix=Jt+" "+no,Nx="iPad",Dx="Apple",Lx=Dx+" Watch",ro="Safari",Mi="BlackBerry",Ox="Samsung",$x=Ox+"Browser",Fx=Ox+" Internet",Nr="Chrome",XI=Nr+" OS",jx=Nr+" "+cl,tp="Internet Explorer",Vx=tp+" "+Mt,np="Opera",QI=np+" Mini",rp="Edge",Bx="Microsoft "+rp,pi="Firefox",zx=pi+" "+cl,io="Nintendo",so="PlayStation",gi="Xbox",Ux=Jt+" "+Mt,Hx=Mt+" "+ro,ps="Windows",Xd=ps+" Phone",Ov="Nokia",Qd="Ouya",Wx="Generic",ZI=Wx+" "+Mt.toLowerCase(),Kx=Wx+" "+no.toLowerCase(),Zd="Konqueror",Ye="(\\d+(\\.\\d+)?)",Yu=new RegExp("Version/"+Ye),JI=new RegExp(gi,"i"),eN=new RegExp(so+" \\w+","i"),tN=new RegExp(io+" \\w+","i"),ip=new RegExp(Mi+"|PlayBook|BB10","i"),nN={"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"},rN=(t,e)=>e&&q(e,Dx)||function(n){return q(n,ro)&&!q(n,Nr)&&!q(n,Jt)}(t),Gx=function(t,e){return e=e||"",q(t," OPR/")&&q(t,"Mini")?QI:q(t," OPR/")?np:ip.test(t)?Mi:q(t,"IE"+Mt)||q(t,"WPDesktop")?Vx:q(t,$x)?Fx:q(t,rp)||q(t,"Edg/")?Bx:q(t,"FBIOS")?"Facebook "+Mt:q(t,"UCWEB")||q(t,"UCBrowser")?"UC Browser":q(t,"CriOS")?jx:q(t,"CrMo")||q(t,Nr)?Nr:q(t,Jt)&&q(t,ro)?Ux:q(t,"FxiOS")?zx:q(t.toLowerCase(),Zd.toLowerCase())?Zd:rN(t,e)?q(t,Mt)?Hx:ro:q(t,pi)?pi:q(t,"MSIE")||q(t,"Trident/")?tp:q(t,"Gecko")?pi:""},iN={[Vx]:[new RegExp("rv:"+Ye)],[Bx]:[new RegExp(rp+"?\\/"+Ye)],[Nr]:[new RegExp("("+Nr+"|CrMo)\\/"+Ye)],[jx]:[new RegExp("CriOS\\/"+Ye)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ye)],[ro]:[Yu],[Hx]:[Yu],[np]:[new RegExp("(Opera|OPR)\\/"+Ye)],[pi]:[new RegExp(pi+"\\/"+Ye)],[zx]:[new RegExp("FxiOS\\/"+Ye)],[Zd]:[new RegExp("Konqueror[:/]?"+Ye,"i")],[Mi]:[new RegExp(Mi+" "+Ye),Yu],[Ux]:[new RegExp("android\\s"+Ye,"i")],[Fx]:[new RegExp($x+"\\/"+Ye)],[tp]:[new RegExp("(rv:|MSIE )"+Ye)],Mozilla:[new RegExp("rv:"+Ye)]},sN=function(t,e){var n=Gx(t,e),r=iN[n];if(D(r))return null;for(var i=0;i<r.length;i++){var s=r[i],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},$v=[[new RegExp(gi+"; "+gi+" (.*?)[);]","i"),t=>[gi,t&&t[1]||""]],[new RegExp(io,"i"),[io,""]],[new RegExp(so,"i"),[so,""]],[ip,[Mi,""]],[new RegExp(ps,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Xd,""];if(new RegExp(Mt).test(e)&&!/IEMobile\b/.test(e))return[ps+" "+Mt,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=n[1],i=nN[r]||"";return/arm/i.test(e)&&(i="RT"),[ps,i]}return[ps,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[cl,e.join(".")]}return[cl,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=D(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Jt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Jt+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Jt,e.join(".")]}return[Jt,""]}],[/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/,[XI,""]],[/Linux|debian/i,["Linux",""]]],Fv=function(t){return tN.test(t)?io:eN.test(t)?so:JI.test(t)?gi:new RegExp(Qd,"i").test(t)?Qd:new RegExp("("+Xd+"|WPDesktop)","i").test(t)?Xd:/iPad/.test(t)?Nx:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Lx:ip.test(t)?Mi:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ov,"i").test(t)?Ov:/(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(Mt).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)?Jt:Ix:Jt:new RegExp("(pda|"+Mt+")","i").test(t)?ZI:new RegExp(no,"i").test(t)&&!new RegExp(no+" pc","i").test(t)?Kx:""},Yo="https?://(.*)",Hl=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],oN=Bl(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Hl),sp="<masked>",aN=["li_fat_id"];function qx(t,e,n){if(!j)return{};var r,i=e?Bl([],Hl,n||[]):[],s=Yx(Yh(j.URL,i,sp),t),o=(r={},re(aN,function(a){var l=sn.J(a);r[a]=l||null}),r);return Ee(o,s)}function Yx(t,e){var n=oN.concat(e||[]),r={};return re(n,function(i){var s=rl(t,i);r[i]=s||null}),r}function Xx(t){var e=function(s){return s?s.search(Yo+"google.([^/?]*)")===0?"google":s.search(Yo+"bing.com")===0?"bing":s.search(Yo+"yahoo.com")===0?"yahoo":s.search(Yo+"duckduckgo.com")===0?"duckduckgo":null:null}(t),n=e!="yahoo"?"q":"p",r={};if(!Pn(e)){r.$search_engine=e;var i=j?rl(j.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function jv(){return navigator.language||navigator.userLanguage}function Qx(){return(j==null?void 0:j.referrer)||"$direct"}function Zx(t,e){var n=t?Bl([],Hl,e||[]):[],r=st==null?void 0:st.href.substring(0,1e3);return{r:Qx().substring(0,1e3),u:r?Yh(r,n,sp):void 0}}function Jx(t){var e,{r:n,u:r}=t,i={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=bi(n))==null?void 0:e.host};if(r){i.$current_url=r;var s=bi(r);i.$host=s==null?void 0:s.host,i.$pathname=s==null?void 0:s.pathname;var o=Yx(r);Ee(i,o)}if(n){var a=Xx(n);Ee(i,a)}return i}function eS(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function lN(){try{return new Date().getTimezoneOffset()}catch{return}}function uN(t,e){if(!rt)return{};var n,r,i,s=t?Bl([],Hl,e||[]):[],[o,a]=function(l){for(var u=0;u<$v.length;u++){var[c,d]=$v[u],f=c.exec(l),h=f&&(At(d)?d(f,l):d);if(h)return h}return["",""]}(rt);return Ee(Wh({$os:o,$os_version:a,$browser:Gx(rt,navigator.vendor),$device:Fv(rt),$device_type:(r=rt,i=Fv(r),i===Nx||i===Ix||i==="Kobo"||i==="Kindle Fire"||i===Kx?no:i===io||i===gi||i===so||i===Qd?"Console":i===Lx?"Wearable":i?Mt:"Desktop"),$timezone:eS(),$timezone_offset:lN()}),{$current_url:Yh(st==null?void 0:st.href,s,sp),$host:st==null?void 0:st.host,$pathname:st==null?void 0:st.pathname,$raw_user_agent:rt.length>1e3?rt.substring(0,997)+"...":rt,$browser_version:sN(rt,navigator.vendor),$browser_language:jv(),$browser_language_prefix:(n=jv(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:T==null?void 0:T.screen.height,$screen_width:T==null?void 0:T.screen.width,$viewport_height:T==null?void 0:T.innerHeight,$viewport_width:T==null?void 0:T.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 Yt=Re("[FeatureFlags]"),Xu="$active_feature_flags",Fr="$override_feature_flags",Vv="$feature_flag_payloads",es="$override_feature_flag_payloads",Bv="$feature_flag_request_id",zv=t=>{var e={};for(var[n,r]of fa(t||{}))r&&(e[n]=r);return e},cN=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]}))):Yt.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},dN=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class fN{constructor(e){this.we=!1,this.Se=!1,this.ke=!1,this.$e=!1,this.xe=!1,this.Ee=!1,this.Re=!1,this._instance=e,this.featureFlagEventHandlers=[]}flags(){if(this._instance.config.__preview_remote_config)this.Ee=!0;else{var e=!this.Pe&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.Ie({disableFlags:e})}}get hasLoadedFlags(){return this.Se}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Od),n=this._instance.get_property(Fr),r=this._instance.get_property(es);if(!r&&!n)return e||{};var i=Ee({},e||{}),s=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var o of s){var a,l,u=i[o],c=n==null?void 0:n[o],d=D(c)?(a=u==null?void 0:u.enabled)!==null&&a!==void 0&&a:!!c,f=D(c)?u.variant:typeof c=="string"?c:void 0,h=r==null?void 0:r[o],y=O({},u,{enabled:d,variant:d?f??(u==null?void 0:u.variant):void 0});d!==(u==null?void 0:u.enabled)&&(y.original_enabled=u==null?void 0:u.enabled),f!==(u==null?void 0:u.variant)&&(y.original_variant=u==null?void 0:u.variant),h&&(y.metadata=O({},u==null?void 0:u.metadata,{payload:h,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),i[o]=y}return this.we||(Yt.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:i}),this.we=!0),i}getFlagVariants(){var e=this._instance.get_property(oi),n=this._instance.get_property(Fr);if(!n)return e||{};for(var r=Ee({},e),i=Object.keys(n),s=0;s<i.length;s++)r[i[s]]=n[i[s]];return this.we||(Yt.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:r}),this.we=!0),r}getFlagPayloads(){var e=this._instance.get_property(Vv),n=this._instance.get_property(es);if(!n)return e||{};for(var r=Ee({},e||{}),i=Object.keys(n),s=0;s<i.length;s++)r[i[s]]=n[i[s]];return this.we||(Yt.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:r}),this.we=!0),r}reloadFeatureFlags(){this.$e||this._instance.config.advanced_disable_feature_flags||this.Pe||(this.Pe=setTimeout(()=>{this.Ie()},5))}Te(){clearTimeout(this.Pe),this.Pe=void 0}ensureFlagsLoaded(){this.Se||this.ke||this.Pe||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.$e=e}Ie(e){var n;if(this.Te(),!this._instance.L())if(this.ke)this.xe=!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:O({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(ds)||{}),group_properties:this._instance.get_property(hr)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0);var i=this._instance.config.__preview_remote_config,s=i?"/flags/?v=2":"/flags/?v=2&config=true",o=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("api",s+o);i&&(r.timezone=eS()),this.ke=!0,this._instance.Ce({method:"POST",url:a,data:r,compression:this._instance.config.disable_compression?void 0:pn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,c,d=!0;if(l.statusCode===200&&(this.xe||(this.$anon_distinct_id=void 0),d=!1),this.ke=!1,this.Ee||(this.Ee=!0,this._instance.Me((c=l.json)!==null&&c!==void 0?c:{})),!r.disable_flags||this.xe)if(this.Re=!d,l.json&&(u=l.json.quotaLimited)!=null&&u.includes(dN.FeatureFlags))Yt.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var f;r.disable_flags||this.receivedFeatureFlags((f=l.json)!==null&&f!==void 0?f:{},d),this.xe&&(this.xe=!1,this.Ie())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.Se||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],i=""+r,s=this._instance.get_property(Bv)||void 0,o=this._instance.get_property(Ja)||{};if((n.send_event||!("send_event"in n))&&(!(e in o)||!o[e].includes(i))){var a,l,u,c,d,f,h,y,m;ie(o[e])?o[e].push(i):o[e]=[i],(a=this._instance.persistence)==null||a.register({[Ja]:o});var _=this.getFeatureFlagDetails(e),p={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:s,$feature_flag_bootstrapped_response:((l=this._instance.config.bootstrap)==null||(l=l.featureFlags)==null?void 0:l[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.Re};D(_==null||(c=_.metadata)==null?void 0:c.version)||(p.$feature_flag_version=_.metadata.version);var g,v=(d=_==null||(f=_.reason)==null?void 0:f.description)!==null&&d!==void 0?d:_==null||(h=_.reason)==null?void 0:h.code;v&&(p.$feature_flag_reason=v),_!=null&&(y=_.metadata)!=null&&y.id&&(p.$feature_flag_id=_.metadata.id),D(_==null?void 0:_.original_variant)&&D(_==null?void 0:_.original_enabled)||(p.$feature_flag_original_response=D(_.original_variant)?_.original_enabled:_.original_variant),_!=null&&(m=_.metadata)!=null&&m.original_payload&&(p.$feature_flag_original_payload=_==null||(g=_.metadata)==null?void 0:g.original_payload),this._instance.capture("$feature_flag_called",p)}return r}Yt.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;this._instance.Ce({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:{distinct_id:this._instance.get_distinct_id(),token:r},compression:this._instance.config.disable_compression?void 0:pn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var s,o=(s=i.json)==null?void 0:s.featureFlagPayloads;n((o==null?void 0:o[e])||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.Se||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,n);return D(r)?void 0:!!r}Yt.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.Se=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(o,a,l,u,c){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var d=cN(o),f=d.flags,h=d.featureFlags,y=d.featureFlagPayloads;if(h){var m=o.requestId;if(ie(h)){Yt.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var _={};if(h)for(var p=0;p<h.length;p++)_[h[p]]=!0;a&&a.register({[Xu]:h,[oi]:_})}else{var g=h,v=y,w=f;o.errorsWhileComputingFlags&&(g=O({},l,g),v=O({},u,v),w=O({},c,w)),a&&a.register(O({[Xu]:Object.keys(zv(g)),[oi]:g||{},[Vv]:v||{},[Od]:w||{}},m?{[Bv]:m}:{}))}}})(e,this._instance.persistence,r,i,s),this.Oe(n)}}override(e,n){n===void 0&&(n=!1),Yt.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Yt.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Fr),this._instance.persistence.unregister(es),void this.Oe();if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.we=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(Fr);else if(r.flags)if(ie(r.flags)){for(var i={},s=0;s<r.flags.length;s++)i[r.flags[s]]=!0;this._instance.persistence.register({[Fr]:i})}else this._instance.persistence.register({[Fr]:r.flags})}return"payloads"in r&&(r.payloads===!1?this._instance.persistence.unregister(es):r.payloads&&this._instance.persistence.register({[es]:r.payloads})),void this.Oe()}this.Oe()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Se){var{flags:n,flagVariants:r}=this.Fe();e(n,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,r){var i,s=(this._instance.get_property(cs)||[]).find(u=>u.flagKey===e),o={["$feature_enrollment/"+e]:n},a={$feature_flag:e,$feature_enrollment:n,$set:o};s&&(a.$early_access_feature_name=s.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=O({},this.getFlagVariants(),{[e]:n});(i=this._instance.persistence)==null||i.register({[Xu]:Object.keys(zv(l)),[oi]:l}),this.Oe()}getEarlyAccessFeatures(e,n,r){n===void 0&&(n=!1);var i=this._instance.get_property(cs),s=r?"&"+r.map(o=>"stage="+o).join("&"):"";if(i&&!n)return e(i);this._instance.Ce({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+s),method:"GET",callback:o=>{var a,l;if(o.json){var u=o.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.unregister(cs),(l=this._instance.persistence)==null||l.register({[cs]:u}),e(u)}}})}Fe(){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),{})}}Oe(e){var{flags:n,flagVariants:r}=this.Fe();this.featureFlagEventHandlers.forEach(i=>i(n,r,{errorsLoading:e}))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(ds)||{};this._instance.register({[ds]:O({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ds)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(hr)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(i=>{r[i]=O({},r[i],e[i]),delete e[i]}),this._instance.register({[hr]:O({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(hr)||{};this._instance.register({[hr]:O({},n,{[e]:{}})})}else this._instance.unregister(hr)}reset(){this.Se=!1,this.ke=!1,this.$e=!1,this.xe=!1,this.Ee=!1,this.Re=!1,this.$anon_distinct_id=void 0,this.Te(),this.we=!1}}var hN=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Qu{constructor(e,n){this.A=e,this.props={},this.Ae=!1,this.De=(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.it=this.je(e),this.load(),e.debug&&F.info("Persistence loaded",e.persistence,O({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.Le}je(e){hN.indexOf(e.persistence.toLowerCase())===-1&&(F.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&be.G()?be:n==="localstorage+cookie"&&Uo.G()?Uo:n==="sessionstorage"&&Oe.G()?Oe:n==="memory"?aI:n==="cookie"?sn:Uo.G()?Uo:sn}properties(){var e={};return re(this.props,function(n,r){if(r===oi&&we(n))for(var i=Object.keys(n),s=0;s<i.length;s++)e["$feature/"+i[s]]=n[i[s]];else a=r,l=!1,(Pn(o=B2)?l:Hm&&o.indexOf===Hm?o.indexOf(a)!=-1:(re(o,function(u){if(l||(l=u===a))return Qa}),l))||(e[r]=n);var o,a,l}),e}load(){if(!this.Le){var e=this.it.K(this.De);e&&(this.props=Ee({},e))}}save(){this.Le||this.it.Y(this.De,this.props,this.Ne,this.Ue,this.ze,this.A.debug)}remove(){this.it.X(this.De,!1),this.it.X(this.De,!0)}clear(){this.remove(),this.props={}}register_once(e,n,r){if(we(e)){D(n)&&(n="None"),this.Ne=D(r)?this.Be:r;var i=!1;if(re(e,(s,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=s,i=!0)}),i)return this.save(),!0}return!1}register(e,n){if(we(e)){this.Ne=D(n)?this.Be:n;var r=!1;if(re(e,(i,s)=>{e.hasOwnProperty(s)&&this.props[s]!==i&&(this.props[s]=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.Ae){var e=qx(this.A.custom_campaign_params,this.A.mask_personal_data_properties,this.A.custom_personal_data_properties);ii(Wh(e))||this.register(e),this.Ae=!0}}update_search_keyword(){var e;this.register((e=j==null?void 0:j.referrer)?Xx(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Qx(),$referring_domain:j!=null&&j.referrer&&((e=bi(j.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Vd]||this.props[Bd]||this.register_once({[el]:Zx(this.A.mask_personal_data_properties,this.A.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};re([Bd,Vd],o=>{var a=this.props[o];a&&re(a,function(l,u){e["$initial_"+Td(u)]=l})});var n,r,i=this.props[el];if(i){var s=(n=Jx(i),r={},re(n,function(o,a){r["$initial_"+Td(a)]=o}),r);Ee(e,s)}return e}safe_merge(e){return re(this.props,function(n,r){r in e||(e[r]=n)}),e}update_config(e,n,r){if(this.Be=this.Ne=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.je(e),s=this.props;this.clear(),this.it=i,this.props=s,this.save()}}set_disabled(e){this.Le=e,this.Le?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ue&&(this.Ue=e,this.remove(),this.save())}set_secure(e){e!==this.ze&&(this.ze=e,this.remove(),this.save())}set_event_timer(e,n){var r=this.props[us]||{};r[e]=n,this.props[us]=r,this.save()}remove_event_timer(e){var n=(this.props[us]||{})[e];return D(n)||(delete this.props[us][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}}(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({});(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})({});var Zu=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({});(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({});(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({});(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({});var pa=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t}({}),Uv=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}({}),tS=function(t){return t.Popover="popover",t.Inline="inline",t}({});class op{constructor(){this.qe={},this.qe={}}on(e,n){return this.qe[e]||(this.qe[e]=[]),this.qe[e].push(n),()=>{this.qe[e]=this.qe[e].filter(r=>r!==n)}}emit(e,n){for(var r of this.qe[e]||[])r(n);for(var i of this.qe["*"]||[])i(e,n)}}class pr{constructor(e){this.He=new op,this.We=(n,r)=>this.Ge(n,r)&&this.Ve(n,r)&&this.Je(n,r),this.Ge=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.Ke=new Set,this.Ye=new Set}init(){var e;if(!D((e=this._instance)==null?void 0:e.Xe)){var n;(n=this._instance)==null||n.Xe((r,i)=>{this.on(r,i)})}}register(e){var n,r;if(!D((n=this._instance)==null?void 0:n.Xe)&&(e.forEach(o=>{var a,l;(a=this.Ye)==null||a.add(o),(l=o.steps)==null||l.forEach(u=>{var c;(c=this.Ke)==null||c.add((u==null?void 0:u.event)||"")})}),(r=this._instance)!=null&&r.autocapture)){var i,s=new Set;e.forEach(o=>{var a;(a=o.steps)==null||a.forEach(l=>{l!=null&&l.selector&&s.add(l==null?void 0:l.selector)})}),(i=this._instance)==null||i.autocapture.setElementSelectors(s)}}on(e,n){var r;n!=null&&e.length!=0&&(this.Ke.has(e)||this.Ke.has(n==null?void 0:n.event))&&this.Ye&&((r=this.Ye)==null?void 0:r.size)>0&&this.Ye.forEach(i=>{this.Qe(n,i)&&this.He.emit("actionCaptured",i.name)})}Ze(e){this.onAction("actionCaptured",n=>e(n))}Qe(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.We(e,r))return!0;return!1}onAction(e,n){return this.He.on(e,n)}Ve(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"||!pr.tr(i,n==null?void 0:n.url,(n==null?void 0:n.url_matching)||"contains"))return!1}return!0}static tr(e,n,r){switch(r){case"regex":return!!T&&Ri(e,n);case"exact":return n===e;case"contains":var i=pr.ir(n).replace(/_/g,".").replace(/%/g,".*");return Ri(e,i);default:return!1}}static ir(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Je(e,n){if((n!=null&&n.href||n!=null&&n.tag_name||n!=null&&n.text)&&!this.er(e).some(s=>!(n!=null&&n.href&&!pr.tr(s.href||"",n==null?void 0:n.href,(n==null?void 0:n.href_matching)||"exact"))&&(n==null||!n.tag_name||s.tag_name===(n==null?void 0:n.tag_name))&&!(n!=null&&n.text&&!pr.tr(s.text||"",n==null?void 0:n.text,(n==null?void 0:n.text_matching)||"exact")&&!pr.tr(s.$el_text||"",n==null?void 0:n.text,(n==null?void 0:n.text_matching)||"exact"))))return!1;if(n!=null&&n.selector){var r,i=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(!i||!i.includes(n==null?void 0:n.selector))return!1}return!0}er(e){return(e==null?void 0:e.properties.$elements)==null?[]:e==null?void 0:e.properties.$elements}}var ne=Re("[Surveys]"),Jd="seenSurvey_",pN=(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},Hv=t=>{var e=""+Jd+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Jd+t.id+"_"+t.current_iteration),e},gN=[Zu.Popover,Zu.Widget,Zu.API],mN={ignoreConditions:!1,ignoreDelay:!1,displayType:tS.Popover};class vN{constructor(e){this._instance=e,this.rr=new Map,this.sr=new Map}register(e){var n;D((n=this._instance)==null?void 0:n.Xe)||(this.nr(e),this.ar(e))}ar(e){var n=e.filter(r=>{var i,s;return((i=r.conditions)==null?void 0:i.actions)&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0});n.length!==0&&(this.lr==null&&(this.lr=new pr(this._instance),this.lr.init(),this.lr.Ze(r=>{this.onAction(r)})),n.forEach(r=>{var i,s,o,a,l;r.conditions&&(i=r.conditions)!=null&&i.actions&&(s=r.conditions)!=null&&(s=s.actions)!=null&&s.values&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((a=this.lr)==null||a.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(u=>{if(u&&u.name){var c=this.sr.get(u.name);c&&c.push(r.id),this.sr.set(u.name,c||[r.id])}}))}))}nr(e){var n;e.filter(r=>{var i,s;return((i=r.conditions)==null?void 0:i.events)&&((s=r.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0}).length!==0&&((n=this._instance)==null||n.Xe((r,i)=>{this.onEvent(r,i)}),e.forEach(r=>{var i;(i=r.conditions)==null||(i=i.events)==null||(i=i.values)==null||i.forEach(s=>{if(s&&s.name){var o=this.rr.get(s.name);o&&o.push(r.id),this.rr.set(s.name,o||[r.id])}})}))}onEvent(e,n){var r,i,s=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[zo])||[];if(pa.SHOWN===e&&n&&s.length>0){var o;ne.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:s});var a=n==null||(o=n.properties)==null?void 0:o.$survey_id;if(a){var l=s.indexOf(a);l>=0&&(s.splice(l,1),this.ur(s))}}else if(this.rr.has(e)){ne.info("survey event name matched",{event:e,eventPayload:n,surveys:this.rr.get(e)});var u=[];(i=this._instance)==null||i.getSurveys(d=>{u=d.filter(f=>{var h;return(h=this.rr.get(e))==null?void 0:h.includes(f.id)})});var c=u.filter(d=>{var f,h=(f=d.conditions)==null||(f=f.events)==null||(f=f.values)==null?void 0:f.find(y=>y.name===e);return!!h&&(!h.propertyFilters||Object.entries(h.propertyFilters).every(y=>{var m,[_,p]=y,g=n==null||(m=n.properties)==null?void 0:m[_];if(D(g)||Pn(g))return!1;var v=[String(g)],w=Mx[p.operator];return w?w(p.values,v):(ne.warn("Unknown property comparison operator: "+p.operator),!1)}))});this.ur(s.concat(c.map(d=>d.id)||[]))}}onAction(e){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[zo])||[];this.sr.has(e)&&this.ur(r.concat(this.sr.get(e)||[]))}ur(e){var n;ne.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[zo]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[zo];return n||[]}getEventToSurveys(){return this.rr}hr(){return this.lr}}class yN{constructor(e){this.dr=void 0,this._surveyManager=null,this.vr=!1,this.cr=!1,this.pr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(X(n))return ne.warn("Flags not loaded yet. Not loading surveys.");var r=ie(n);this.dr=r?n.length>0:n,ne.info("flags response received, isSurveysEnabled: "+this.dr),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(Jd)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach(i=>localStorage.removeItem(i))}loadIfEnabled(){if(!this._surveyManager)if(this.cr)ne.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ne.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())ne.info("Not loading surveys in cookieless mode without consent.");else{var e=H==null?void 0:H.__PosthogExtensions__;if(e){if(!D(this.dr)||this._instance.config.advanced_enable_surveys){var n=this.dr||this._instance.config.advanced_enable_surveys;this.cr=!0;try{var r=e.generateSurveys;if(r)return void this.gr(r,n);var i=e.loadExternalDependency;if(!i)return void this._r("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",s=>{s||!e.generateSurveys?this._r("Could not load surveys script",s):this.gr(e.generateSurveys,n)})}catch(s){throw this._r("Error initializing surveys",s),s}finally{this.cr=!1}}}else ne.error("PostHog Extensions not found.")}}gr(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new vN(this._instance),ne.info("Surveys loaded successfully"),this.mr({isLoaded:!0})}_r(e,n){ne.error(e,n),this.mr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.pr.push(e),this._surveyManager&&this.mr({isLoaded:!0}),()=>{this.pr=this.pr.filter(n=>n!==e)}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return ne.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property($d);if(r&&!n)return e(r,{isLoaded:!0});if(this.vr)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.vr=!0,this._instance.Ce({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 s;this.vr=!1;var o=i.statusCode;if(o!==200||!i.json){var a="Surveys API could not be loaded, status: "+o;return ne.error(a),e([],{isLoaded:!1,error:a})}var l,u=i.json.surveys||[],c=u.filter(d=>function(f){return!(!f.start_date||f.end_date)}(d)&&(function(f){var h;return!((h=f.conditions)==null||(h=h.events)==null||(h=h.values)==null||!h.length)}(d)||function(f){var h;return!((h=f.conditions)==null||(h=h.actions)==null||(h=h.values)==null||!h.length)}(d)));return c.length>0&&((l=this._surveyEventReceiver)==null||l.register(c)),(s=this._instance.persistence)==null||s.register({[$d]:u}),e(u,{isLoaded:!0})}})}catch(i){throw this.vr=!1,i}}mr(e){for(var n of this.pr)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){ne.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!X(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);ne.warn("init was not called")}yr(e){var n=null;return this.getSurveys(r=>{var i;n=(i=r.find(s=>s.id===e))!==null&&i!==void 0?i:null}),n}br(e){if(X(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.yr(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(X(this._surveyManager))return ne.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.br(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return X(this._surveyManager)?(ne.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 s,o=(s=i.find(l=>l.id===e))!==null&&s!==void 0?s:null;if(o){var a=this.br(o);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(e,n){var r;if(X(this._surveyManager))ne.warn("init was not called");else{var i=typeof e=="string"?this.yr(e):e;if(i!=null&&i.id)if(gN.includes(i.type)){var s=j==null?void 0:j.querySelector(n);if(s)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(ne.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var o,a;ne.info("Rendering survey "+i.id+" with delay of "+((o=i.appearance)==null?void 0:o.surveyPopupDelaySeconds)+" seconds"),(a=this._surveyManager)==null||a.renderSurvey(i,s),ne.info("Survey "+i.id+" rendered")},1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,s);ne.warn("Survey element not found")}else ne.warn("Surveys of type "+i.type+" cannot be rendered in the app");else ne.warn("Survey not found")}}displaySurvey(e,n){var r;if(X(this._surveyManager))ne.warn("init was not called");else{var i=this.yr(e);if(i){var s=i;if((r=i.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(s=O({},i,{appearance:O({},i.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var o=this.canRenderSurvey(i);if(!o.visible)return void ne.warn("Survey is not eligible to be displayed: ",o.disabledReason)}n.displayType!==tS.Inline?this._surveyManager.handlePopoverSurvey(s):this.renderSurvey(s,n.selector)}else ne.warn("Survey not found")}}}var Wv=Re("[RateLimiter]");class _N{constructor(e){var n,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=i=>{var s=i.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(o=>{Wv.info((o||"events")+" is quota limited."),this.serverLimits[o]=new Date().getTime()+6e4})}catch(o){return void Wv.warn('could not rate limit - continuing. Error: "'+(o==null?void 0:o.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(((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 s=new Date().getTime(),o=(n=(r=this.instance.persistence)==null?void 0:r.get_property(jd))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:s};o.tokens+=(s-o.last)/1e3*this.captureEventsPerSecond,o.last=s,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var a=o.tokens<1;return a||e||(o.tokens=Math.max(0,o.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(jd,o),{isRateLimited:a,remainingTokens:o.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var ur=Re("[RemoteConfig]");class wN{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=H._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}wr(e){var n,r;(n=H.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=H.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(ur.error("PostHog Extensions not found. Cannot load remote config."),e())}Sr(e){this._instance.Ce({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 ur.info("Using preloaded remote config",this.remoteConfig),void this.Me(this.remoteConfig);if(this._instance.L())return void ur.warn("Remote config is disabled. Falling back to local config.");this.wr(e=>{if(!e)return ur.info("No config found after loading remote JS config. Falling back to JSON."),void this.Sr(n=>{this.Me(n)});this.Me(e)})}catch(e){ur.error("Error loading remote config",e)}}Me(e){e?this._instance.config.__preview_remote_config?(this._instance.Me(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):ur.info("__preview_remote_config is disabled. Logging config instead",e):ur.error("Failed to fetch remote config from PostHog.")}}var ef=3e3;class xN{constructor(e,n){this.kr=!0,this.$r=[],this.Er=mt((n==null?void 0:n.flush_interval_ms)||ef,250,5e3,F.createLogger("flush interval"),ef),this.Rr=e}enqueue(e){this.$r.push(e),this.Pr||this.Ir()}unload(){this.Tr();var e=this.$r.length>0?this.Cr():{},n=Object.values(e);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.Rr(O({},r,{transport:"sendBeacon"}))})}enable(){this.kr=!1,this.Ir()}Ir(){var e=this;this.kr||(this.Pr=setTimeout(()=>{if(this.Tr(),this.$r.length>0){var n=this.Cr(),r=function(){var s=n[i],o=new Date().getTime();s.data&&ie(s.data)&&re(s.data,a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp}),e.Rr(s)};for(var i in n)r()}},this.Er))}Tr(){clearTimeout(this.Pr),this.Pr=void 0}Cr(){var e={};return re(this.$r,n=>{var r,i=n,s=(i?i.batchKey:null)||i.url;D(e[s])&&(e[s]=O({},i,{data:[]})),(r=e[s].data)==null||r.push(i.data)}),this.$r=[],e}}var SN=["retriesPerformedSoFar"];class EN{constructor(e){this.Mr=!1,this.Or=3e3,this.$r=[],this._instance=e,this.$r=[],this.Fr=!0,!D(T)&&"onLine"in T.navigator&&(this.Fr=T.navigator.onLine,pe(T,"online",()=>{this.Fr=!0,this.oe()}),pe(T,"offline",()=>{this.Fr=!1}))}get length(){return this.$r.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=G1(e,SN);He(n)&&n>0&&(r.url=ul(r.url,{retry_count:n})),this._instance.Ce(O({},r,{callback:i=>{i.statusCode!==200&&(i.statusCode<400||i.statusCode>=500)&&(n??0)<10?this.Ar(O({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(i)}}))}Ar(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)}(n),i=Date.now()+r;this.$r.push({retryAt:i,requestOptions:e});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),F.warn(s),this.Mr||(this.Mr=!0,this.Dr())}Dr(){this.jr&&clearTimeout(this.jr),this.jr=setTimeout(()=>{this.Fr&&this.$r.length>0&&this.oe(),this.Dr()},this.Or)}oe(){var e=Date.now(),n=[],r=this.$r.filter(s=>s.retryAt<e||(n.push(s),!1));if(this.$r=n,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.jr&&(clearTimeout(this.jr),this.jr=void 0),this.$r))try{this._instance.Ce(O({},e,{transport:"sendBeacon"}))}catch(n){F.error(n)}this.$r=[]}}class kN{constructor(e){this.Lr=()=>{var n,r,i,s;this.Nr||(this.Nr={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((o==null?void 0:o.clientHeight)||0),c=(o==null?void 0:o.scrollHeight)||0;this.Nr.lastScrollY=Math.ceil(a),this.Nr.maxScrollY=Math.max(a,(n=this.Nr.maxScrollY)!==null&&n!==void 0?n:0),this.Nr.maxScrollHeight=Math.max(l,(r=this.Nr.maxScrollHeight)!==null&&r!==void 0?r:0),this.Nr.lastContentY=u,this.Nr.maxContentY=Math.max(u,(i=this.Nr.maxContentY)!==null&&i!==void 0?i:0),this.Nr.maxContentHeight=Math.max(c,(s=this.Nr.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=e}getContext(){return this.Nr}resetContext(){var e=this.Nr;return setTimeout(this.Lr,0),e}startMeasuringScrollPosition(){pe(T,"scroll",this.Lr,{capture:!0}),pe(T,"scrollend",this.Lr,{capture:!0}),pe(T,"resize",this.Lr)}scrollElement(){if(!this._instance.config.scroll_root_selector)return T==null?void 0:T.document.documentElement;var e=ie(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=T==null?void 0:T.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 T&&(T.scrollY||T.pageYOffset||T.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return T&&(T.scrollX||T.pageXOffset||T.document.documentElement.scrollLeft)||0}}var CN=t=>Zx(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties);class Kv{constructor(e,n,r,i){this.Ur=s=>{var o=this.zr();if(!o||o.sessionId!==s){var a={sessionId:s,props:this.Br(this._instance)};this.qr.register({[Fd]:a})}},this._instance=e,this.Hr=n,this.qr=r,this.Br=i||CN,this.Hr.onSessionId(this.Ur)}zr(){return this.qr.props[Fd]}getSetOnceProps(){var e,n=(e=this.zr())==null?void 0:e.props;return n?"r"in n?Jx(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return re(Wh(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+Td(r)]=n}),e}}var Ju=Re("[SessionId]");class Gv{on(e,n){return this.Wr.on(e,n)}constructor(e,n,r){var i;if(this.Gr=[],this.Wr=new op,this.Vr=(c,d)=>Math.abs(c-d)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.A=e.config,this.qr=e.persistence,this.pi=void 0,this.Ft=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Jr=n||jn,this.Kr=r||jn;var s=this.A.persistence_name||this.A.token,o=this.A.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*mt(o,60,36e3,Ju.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Yr(),this.Xr="ph_"+s+"_window_id",this.Qr="ph_"+s+"_primary_window_exists",this.Zr()){var a=Oe.K(this.Xr),l=Oe.K(this.Qr);a&&!l?this.pi=a:Oe.X(this.Xr),Oe.Y(this.Qr,!0)}if((i=this.A.bootstrap)!=null&&i.sessionID)try{var u=(c=>{var d=c.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.A.bootstrap.sessionID);this.ts(this.A.bootstrap.sessionID,new Date().getTime(),u)}catch(c){Ju.error("Invalid sessionID in bootstrap",c)}this.es()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return D(this.Gr)&&(this.Gr=[]),this.Gr.push(e),this.Ft&&e(this.Ft,this.pi),()=>{this.Gr=this.Gr.filter(n=>n!==e)}}Zr(){return this.A.persistence!=="memory"&&!this.qr.Le&&Oe.G()}rs(e){e!==this.pi&&(this.pi=e,this.Zr()&&Oe.Y(this.Xr,e))}ss(){return this.pi?this.pi:this.Zr()?Oe.K(this.Xr):null}ts(e,n,r){e===this.Ft&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Ft=e,this.qr.register({[Za]:[n,e,r]}))}ns(){if(this.Ft&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ft,this._sessionStartTimestamp];var e=this.qr.props[Za];return ie(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.ts(null,null,null)}es(){pe(T,"beforeunload",()=>{this.Zr()&&Oe.X(this.Qr)},{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.A.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[i,s,o]=this.ns(),a=this.ss(),l=He(o)&&o>0&&Math.abs(r-o)>864e5,u=!1,c=!s,d=!e&&this.Vr(r,i);c||d||l?(s=this.Jr(),a=this.Kr(),Ju.info("new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}}),o=r,u=!0):a||(a=this.Kr(),u=!0);var f=i===0||!e||l?r:i,h=o===0?new Date().getTime():o;return this.rs(a),this.ts(s,f,h),e||this.Yr(),u&&this.Gr.forEach(y=>y(s,a,u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0)),{sessionId:s,windowId:a,sessionStartTimestamp:h,changeReason:u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:i}}Yr(){clearTimeout(this.os),this.os=setTimeout(()=>{var[e]=this.ns();if(this.Vr(new Date().getTime(),e)){var n=this.Ft;this.resetSessionId(),this.Wr.emit("forcedIdleReset",{idleSessionId:n})}},1.1*this.sessionTimeoutMs)}}var PN=["$set_once","$set"],Rn=Re("[SiteApps]");class TN{constructor(e){this._instance=e,this.ls=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}us(e,n){if(n){var r=this.globalsForEvent(n);this.ls.push(r),this.ls.length>1e3&&(this.ls=this.ls.slice(10))}}get siteAppLoaders(){var e;return(e=H._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Xe(this.us.bind(this));this.hs=()=>{e(),this.ls=[],this.hs=void 0}}}globalsForEvent(e){var n,r,i,s,o,a,l;if(!e)throw new Error("Event payload is required");var u={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[f,h]of Object.entries(d))u[f]={id:c[f],type:f,properties:h};var{$set_once:y,$set:m}=e;return{event:O({},G1(e,PN),{properties:O({},e.properties,m?{$set:O({},(n=(r=e.properties)==null?void 0:r.$set)!==null&&n!==void 0?n:{},m)}:{},y?{$set_once:O({},(i=(s=e.properties)==null?void 0:s.$set_once)!==null&&i!==void 0?i:{},y)}:{}),elements_chain:(o=(a=e.properties)==null?void 0:a.$elements_chain)!==null&&o!==void 0?o:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var n=this.apps[e.id],r=()=>{var a;!n.errored&&this.ls.length&&(Rn.info("Processing "+this.ls.length+" events for site app with id "+e.id),this.ls.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.hs)==null||a.call(this))},i=!1,s=a=>{n.errored=!a,n.loaded=!0,Rn.info("Site app with id "+e.id+" "+(a?"loaded":"errored")),i&&r()};try{var{processEvent:o}=e.init({posthog:this._instance,callback:a=>{s(a)}});o&&(n.processEvent=o),i=!0}catch(a){Rn.error("Error while initializing PostHog app with config id "+e.id,a),s(!1)}if(i&&n.loaded)try{r()}catch(a){Rn.error("Error while processing buffered events PostHog app with config id "+e.id,a),n.errored=!0}}ds(){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)}vs(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){Rn.error("Error while processing event "+e.event+" for site app "+r.id,i)}}}onRemoteConfig(e){var n,r,i,s=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.ds(),void this._instance.on("eventCaptured",u=>this.vs(u))):void Rn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.hs)==null||r.call(this),(i=e.siteApps)!=null&&i.length)if(this.isEnabled){var o=function(u){var c;H["__$$ph_site_app_"+u]=s._instance,(c=H.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(s._instance,l,d=>{if(d)return Rn.error("Error while initializing PostHog app with config id "+u,d)})};for(var{id:a,url:l}of e.siteApps)o(a)}else Rn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var bN=["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"],qv=function(t,e){if(!t)return!1;var n=t.toLowerCase();return bN.concat(e||[]).some(r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1})},nS=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&qv(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(i=>qv(i==null?void 0:i.brand,e)))return!0}catch{}return!!t.webdriver},gs=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),Yv="i.posthog.com";class AN{constructor(e){this.cs={},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 uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+Yv,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.cs[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.cs[this.apiHost]=gs.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.cs[this.apiHost]=gs.EU:this.cs[this.apiHost]=gs.CUSTOM),this.cs[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(this.region===gs.CUSTOM)return this.apiHost+n;var r=Yv+n;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var RN={icontains:(t,e)=>!!T&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!T&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!T&&Ri(e.href,t),not_regex:(t,e)=>!!T&&!Ri(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class ze{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(i=>{ze.fs("retrieved web experiments from the server"),n.ps=new Map,i.forEach(s=>{if(s.feature_flag_key){var o;n.ps&&(ze.fs("setting flag key ",s.feature_flag_key," to web experiment ",s),(o=n.ps)==null||o.set(s.feature_flag_key,s));var a=n._instance.getFeatureFlag(s.feature_flag_key);xe(a)&&s.variants[a]&&n.gs(s.name,a,s.variants[a].transforms)}else if(s.variants)for(var l in s.variants){var u=s.variants[l];ze._s(u)&&n.gs(s.name,l,u.transforms)}})},r)},this._instance=e,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}onFeatureFlags(e){if(this._is_bot())ze.fs("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(X(this.ps))return this.ps=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ze.fs("applying feature flags",e),e.forEach(n=>{var r;if(this.ps&&(r=this.ps)!=null&&r.has(n)){var i,s=this._instance.getFeatureFlag(n),o=(i=this.ps)==null?void 0:i.get(n);s&&o!=null&&o.variants[s]&&this.gs(o.name,s,o.variants[s].transforms)}})}}previewWebExperiment(){var e=ze.getWindowLocation();if(e!=null&&e.search){var n=rl(e==null?void 0:e.search,"__experiment_id"),r=rl(e==null?void 0:e.search,"__experiment_variant");n&&r&&(ze.fs("previewing web experiments "+n+" && "+r),this.getWebExperiments(i=>{this.ys(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.Ce({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 o=s.json.experiments||[];return e(o)}})}ys(e,n,r){var i=r.filter(s=>s.id===e);i&&i.length>0&&(ze.fs("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this.gs(i[0].name,n,i[0].variants[n].transforms))}static _s(e){return!X(e.conditions)&&ze.bs(e)&&ze.ws(e)}static bs(e){var n;if(X(e.conditions)||X((n=e.conditions)==null?void 0:n.url))return!0;var r,i,s,o=ze.getWindowLocation();return!!o&&((r=e.conditions)==null||!r.url||RN[(i=(s=e.conditions)==null?void 0:s.urlMatchType)!==null&&i!==void 0?i:"icontains"](e.conditions.url,o))}static getWindowLocation(){return T==null?void 0:T.location}static ws(e){var n;if(X(e.conditions)||X((n=e.conditions)==null?void 0:n.utm))return!0;var r=qx();if(r.utm_source){var i,s,o,a,l,u,c,d,f=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,h=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,y=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,m=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return f&&y&&m&&h}return!1}static fs(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];F.info("[WebExperiments] "+e,r)}gs(e,n,r){this._is_bot()?ze.fs("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach(i=>{if(i.selector){var s;ze.fs("applying transform of variant "+n+" for experiment "+e+" ",i);var o=(s=document)==null?void 0:s.querySelectorAll(i.selector);o==null||o.forEach(a=>{var l=a;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)})}}):ze.fs("Control variants leave the page unmodified.")}_is_bot(){return gt&&this._instance?nS(gt,this._instance.config.custom_blocked_useragents):void 0}}var MN=Re("[PostHog ExternalIntegrations]"),IN={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class NN{constructor(e){this._instance=e}nt(e,n){var r;(r=H.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,i=>{if(i)return MN.error("failed to load script",i);n()})}startIfEnabledOrStop(){var e=this,n=function(o){var a,l,u;!i||(a=H.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[o]||e.nt(IN[o],()=>{var c;(c=H.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[o])==null||c.start(e._instance)}),!i&&(l=H.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[o]&&((u=H.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[o])==null||u.stop())};for(var[r,i]of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n(r)}}}var tf="[SessionRecording]",ts=Re(tf);class DN{get started(){var e;return!((e=this.Ss)==null||!e.isStarted)}get status(){var e;return((e=this.Ss)==null?void 0:e.status)||"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.ni=void 0,this._instance=e,!this._instance.sessionManager)throw ts.error("started without valid sessionManager"),new Error(tf+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(tf+' cannot be used with cookieless_mode="always"')}get Bt(){var e,n=!((e=this._instance.get_property(zu))==null||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return T&&n&&r&&!i}startIfEnabledOrStop(e){var n;if(!this.Bt||(n=this.Ss)==null||!n.isStarted){var r=!D(Object.assign)&&!D(Array.from);this.Bt&&r?(this.ks(e),ts.info("starting")):this.stopRecording()}}ks(e){var n,r,i;this.Bt&&(H!=null&&(n=H.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(r=H.__PosthogExtensions__)!=null&&r.initSessionRecording?this.Ri(e):(i=H.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,this.Pi,s=>{if(s)return ts.error("could not load recorder",s);this.Ri(e)}))}stopRecording(){var e;(e=this.Ss)==null||e.stop()}ki(){var e;(e=this._instance.persistence)==null||e.unregister(si)}Ei(e){if(this._instance.persistence){var n,r,i=this._instance.persistence,s=()=>{var o=e.sessionRecording,a=o==null?void 0:o.sampleRate,l=X(a)?null:parseFloat(a);X(l)&&this.ki();var u=o==null?void 0:o.minimumDurationMilliseconds;i.register({[zu]:O({enabled:!!o},o,{networkPayloadCapture:O({capturePerformance:e.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:l,minimumDurationMilliseconds:D(u)?null:u,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers})})};s(),(n=this.ni)==null||n.call(this),this.ni=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?(this.Ei(e),this.startIfEnabledOrStop()):ts.info("skipping remote config with no sessionRecording",e)}log(e,n){var r;n===void 0&&(n="log"),(r=this.Ss)!=null&&r.log?this.Ss.log(e,n):ts.warn("log called before recorder was ready")}get Pi(){var e,n,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(zu);return(r==null||(n=r.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}Ri(e){var n,r;if((n=H.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Ss||(this.Ss=(r=H.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.Ss._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Ss.start(e)}onRRwebEmit(e){var n;(n=this.Ss)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e;(e=this.Ss)==null||e.overrideLinkedFlag()}overrideSampling(){var e;(e=this.Ss)==null||e.overrideSampling()}overrideTrigger(e){var n;(n=this.Ss)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.Ss)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var r;return!((r=this.Ss)==null||!r.tryAddCustomEvent(e,n))}}var Is={},nf=()=>{},jr="posthog",rS=!qI&&(rt==null?void 0:rt.indexOf("MSIE"))===-1&&(rt==null?void 0:rt.indexOf("Mozilla"))===-1,Xv=t=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:V2(j==null?void 0:j.location),persistence:"localStorage+cookie",persistence_name:"",loaded:nf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:t!=="2025-05-24"||"history_change",capture_pageleave:"if_capture_pageview",defaults:t??"unset",debug:st&&xe(st==null?void 0:st.search)&&st.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(T==null||(e=T.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},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;F.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:ef},error_tracking:{},_onCapture:nf,__preview_eager_load_replay:!0}},Qv=t=>{var e={};D(t.process_person)||(e.person_profiles=t.process_person),D(t.xhr_headers)||(e.request_headers=t.xhr_headers),D(t.cookie_name)||(e.persistence_name=t.cookie_name),D(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),D(t.store_google)||(e.save_campaign_params=t.store_google),D(t.verbose)||(e.debug=t.verbose);var n=Ee({},e,t);return ie(t.property_blacklist)&&(D(t.property_denylist)?n.property_denylist=t.property_blacklist:ie(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:F.error("Invalid value for property_denylist config: "+t.property_denylist)),n};class LN{constructor(){this.__forceAllowLocalhost=!1}get $s(){return this.__forceAllowLocalhost}set $s(e){F.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Wl{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 LN,this.xs=!1,this.version=hn.LIB_VERSION,this.Es=new op,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Xv(),this.SentryIntegration=FI,this.sentryIntegration=e=>function(n,r){var i=Rx(n,r);return{name:Ax,processEvent:s=>i(s)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Rs=!1,this.Ps=null,this.Is=null,this.Ts=null,this.featureFlags=new fN(this),this.toolbar=new VI(this),this.scrollManager=new kN(this),this.pageViewManager=new KI(this),this.surveys=new yN(this),this.experiments=new ze(this),this.exceptions=new YI(this),this.rateLimiter=new _N(this),this.requestRouter=new AN(this),this.consent=new lI(this),this.externalIntegrations=new NN(this),this.people={set:(e,n,r)=>{var i=xe(e)?{[e]:n}:e;this.setPersonProperties(i),r==null||r({})},set_once:(e,n,r)=>{var i=xe(e)?{[e]:n}:e;this.setPersonProperties(void 0,i),r==null||r({})}},this.on("eventCaptured",e=>F.info('send "'+(e==null?void 0:e.event)+'"',e))}init(e,n,r){if(r&&r!==jr){var i,s=(i=Is[r])!==null&&i!==void 0?i:new Wl;return s._init(e,n,r),Is[r]=s,Is[jr][r]=s,s}return this._init(e,n,r)}_init(e,n,r){var i,s;if(n===void 0&&(n={}),D(e)||bd(e))return F.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 F.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.Cs=n,this.Ms=[],n.person_profiles&&(this.Is=n.person_profiles),this.set_config(Ee({},Xv(n.defaults),Qv(n),{name:r,token:e})),this.config.on_xhr_error&&F.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:pn.GZipJS;var o=this.Os();this.persistence=new Qu(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Qu(O({},this.config,{persistence:"sessionStorage"}),o);var a=O({},this.persistence.props),l=O({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Fs=new xN(v=>this.As(v),this.config.request_queue_config),this.Ds=new EN(this),this.__request_queue=[];var u=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new Gv(this),this.sessionPropsManager=new Kv(this,this.sessionManager,this.persistence)),new zI(this).startIfEnabledOrStop(),this.siteApps=new TN(this),(i=this.siteApps)==null||i.init(),u||(this.config.__preview_eager_load_replay?this.sessionRecording=new bv(this):this.sessionRecording=new DN(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new eI(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new WI(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new UI(this),this.exceptionObserver=new dI(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new _x(this,cI),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new fI(this),this.historyAutocapture.startIfEnabled(),hn.DEBUG=hn.DEBUG||this.config.debug,hn.DEBUG&&F.info("Starting in debug mode",{this:this,config:n,thisC:O({},this.config),p:a,s:l}),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var c,d,f=this.config.get_device_id(jn()),h=(c=n.bootstrap)!=null&&c.isIdentifiedID?f:n.bootstrap.distinctID;this.persistence.set_property(cn,(d=n.bootstrap)!=null&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:h})}if(this.js()){var y,m,_=Object.keys(((y=n.bootstrap)==null?void 0:y.featureFlags)||{}).filter(v=>{var w;return!((w=n.bootstrap)==null||(w=w.featureFlags)==null||!w[v])}).reduce((v,w)=>{var E;return v[w]=((E=n.bootstrap)==null||(E=E.featureFlags)==null?void 0:E[w])||!1,v},{}),p=Object.keys(((m=n.bootstrap)==null?void 0:m.featureFlagPayloads)||{}).filter(v=>_[v]).reduce((v,w)=>{var E,A;return(E=n.bootstrap)!=null&&(E=E.featureFlagPayloads)!=null&&E[w]&&(v[w]=(A=n.bootstrap)==null||(A=A.featureFlagPayloads)==null?void 0:A[w]),v},{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:p})}if(u)this.register_once({distinct_id:Yi,$device_id:null},"");else if(!this.get_distinct_id()){var g=this.config.get_device_id(jn());this.register_once({distinct_id:g,$device_id:g},""),this.persistence.set_property(cn,"anonymous")}return pe(T,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?$I(this,()=>this.Ls()):this.Ls(),At(this.config._onCapture)&&this.config._onCapture!==nf&&(F.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",v=>this.config._onCapture(v.event,v))),this.config.ip&&F.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}Me(e){var n,r,i,s,o,a,l,u;if(!j||!j.body)return F.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Me(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=q(e.supportedCompression,pn.GZipJS)?pn.GZipJS:q(e.supportedCompression,pn.Base64)?pn.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Is?this.Is:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(i=this.sessionRecording)==null||i.onRemoteConfig(e),(s=this.autocapture)==null||s.onRemoteConfig(e),(o=this.heatmaps)==null||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(a=this.webVitalsAutocapture)==null||a.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(u=this.deadClicksAutocapture)==null||u.onRemoteConfig(e)}Ls(){try{this.config.loaded(this)}catch(e){F.critical("`loaded` function failed",e)}this.Ns(),this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Us()},1),new wN(this).load(),this.featureFlags.flags()}Ns(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Fs)==null||e.enable())}_dom_loaded(){this.is_capturing()&&qn(this.__request_queue,e=>this.As(e)),this.__request_queue=[],this.Ns()}_handle_unload(){var e,n;this.config.request_batching?(this.zs()&&this.capture("$pageleave"),(e=this.Fs)==null||e.unload(),(n=this.Ds)==null||n.unload()):this.zs()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Ce(e){this.__loaded&&(rS?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=ul(e.url,{ip:this.config.ip?1:0}),e.headers=O({},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,s,o=O({},n);o.timeout=o.timeout||6e4,o.url=ul(o.url,{_:new Date().getTime().toString(),ver:hn.LIB_VERSION,compression:o.compression});var a=(r=o.transport)!==null&&r!==void 0?r:"fetch",l=ha.filter(c=>!o.disableTransport||!c.transport||!o.disableTransport.includes(c.transport)),u=(i=(s=tx(l,c=>c.transport===a))==null?void 0:s.method)!==null&&i!==void 0?i:l[0].method;if(!u)throw new Error("No available transport method");u(o)})(O({},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)}}))))}As(e){this.Ds?this.Ds.retriableRequest(e):this.Ce(e)}_execute_array(e){var n,r=[],i=[],s=[];qn(e,a=>{a&&(n=a[0],ie(n)?s.push(a):At(a)?a.call(this):ie(a)&&n==="alias"?r.push(a):ie(a)&&n.indexOf("capture")!==-1&&At(this[n])?s.push(a):i.push(a))});var o=function(a,l){qn(a,function(u){if(ie(u[0])){var c=l;re(u,function(d){c=c[d[0]].apply(c,d.slice(1))})}else this[u[0]].apply(this,u.slice(1))},l)};o(r,this),o(i,this),o(s,this)}js(){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.Fs){if(this.is_capturing())if(!D(e)&&xe(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){n!=null&&n.$current_url&&!xe(n==null?void 0:n.$current_url)&&(F.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,a=(r==null?void 0:r.timestamp)||o,l=jn(),u={uuid:l,event:e,properties:this.calculateEventProperties(e,n||{},a,l)};s&&(u.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),r!=null&&r.$set&&(u.$set=r==null?void 0:r.$set);var c,d=this.Bs(r==null?void 0:r.$set_once);if(d&&(u.$set_once=d),(u=F2(u,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,D(r==null?void 0:r.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o),e===pa.DISMISSED||e===pa.SENT){var f=n==null?void 0:n[Uv.SURVEY_ID],h=n==null?void 0:n[Uv.SURVEY_ITERATION];c={id:f,current_iteration:h},localStorage.getItem(Hv(c))||localStorage.setItem(Hv(c),"true"),u.$set=O({},u.$set,{[pN({id:f,current_iteration:h},e===pa.SENT?"responded":"dismissed")]:!0})}var y=O({},u.properties.$set,u.$set);if(ii(y)||this.setPersonPropertiesForFlags(y),!X(this.config.before_send)){var m=this.qs(u);if(!m)return;u=m}this.Es.emit("eventCaptured",u);var _={method:"POST",url:(i=r==null?void 0:r._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:r==null?void 0:r._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.As(_):this.Fs.enqueue(_),u}F.critical("This capture call is ignored due to client rate limiting.")}}else F.error("No event name provided to posthog.capture")}else F.uninitializedWarning("posthog.capture")}Xe(e){return this.on("eventCaptured",n=>e(n.event,n))}calculateEventProperties(e,n,r,i,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=s?void 0:this.persistence.remove_event_timer(e),a=O({},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=O({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!xe(a.distinct_id)&&!He(a.distinct_id)||bd(a.distinct_id))&&F.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=uN(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());a.$session_id=d,a.$window_id=f}this.sessionPropsManager&&Ee(a,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&Ee(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(h=this.Ds)==null?void 0:h.length}catch(p){a.$sdk_debug_error_capturing_properties=String(p)}if(this.requestRouter.region===gs.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u=e!=="$pageview"||s?e!=="$pageleave"||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),a=Ee(a,u),e==="$pageview"&&j&&(a.title=j.title),!D(o)){var y=r.getTime()-o;a.$duration=parseFloat((y/1e3).toFixed(3))}rt&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Ee({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),ie(this.config.property_denylist)?re(this.config.property_denylist,function(p){delete a[p]}):F.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(F.error("sanitize_properties is deprecated. Use before_send instead"),a=m(a,e));var _=this.Hs();return a.$process_person_profile=_,_&&!s&&this.Ws("_calculate_event_properties"),a}Bs(e){var n;if(!this.persistence||!this.Hs()||this.xs)return e;var r=this.persistence.get_initial_props(),i=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),s=Ee({},r,i||{},e||{}),o=this.config.sanitize_properties;return o&&(F.error("sanitize_properties is deprecated. Use before_send instead"),s=o(s,"$set_once")),this.xs=!0,ii(s)?void 0:s}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)}Gs(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.Es.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=mN),this.surveys.displaySurvey(e,n)}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 F.uninitializedWarning("posthog.identify");if(He(e)&&(e=e.toString(),F.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()))F.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!==Yi){if(this.Ws("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==i&&e!==this.get_property(ls)&&(this.unregister(ls),this.register({distinct_id:e}));var o=(this.persistence.get_property(cn)||"anonymous")==="anonymous";e!==i&&o?(this.persistence.set_property(cn,"identified"),this.setPersonPropertiesForFlags(O({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this.Ts=Dv(e,n,r),this.featureFlags.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(Ja))}}else F.critical('The string "'+Yi+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else F.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Ws("posthog.setPersonProperties")){var r=Dv(this.get_distinct_id(),e,n);this.Ts!==r?(this.setPersonPropertiesForFlags(O({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Ts=r):F.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,r){if(e&&n){if(this.Ws("posthog.group")){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:O({},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 F.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.Ws("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,r,i,s;if(F.info("reset"),!this.__loaded)return F.uninitializedWarning("posthog.reset");var o=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(cn,"anonymous"),(s=this.sessionManager)==null||s.resetSessionId(),this.Ts=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Yi,$device_id:null},"");else{var a=this.config.get_device_id(jn());this.register_once({distinct_id:a,$device_id:e?a:o},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&r){var s,o=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return i}alias(e,n){return e===this.get_property(nx)?(F.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ws("posthog.alias")?(D(n)&&(n=this.get_distinct_id()),e!==n?(this.Gs(ls,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(F.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=O({},this.config);if(we(e)){var r,i,s,o,a;Ee(this.config,Qv(e));var l=this.Os();(r=this.persistence)==null||r.update_config(this.config,n,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Qu(O({},this.config,{persistence:"sessionStorage"}),l),be.G()&&be.J("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(hn.DEBUG=!0,F.info("set_config",{config:e,oldConfig:n,newConfig:O({},this.config)})),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(s=this.autocapture)==null||s.startIfEnabled(),(o=this.heatmaps)==null||o.startIfEnabled(),this.surveys.loadIfEnabled(),this.Vs(),(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,s,o,a,l;(i=this.sessionManager)==null||i.checkAndGetSessionAndWindowId(),r.sampling&&((s=this.sessionRecording)==null||s.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)==null||o.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(O({},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:jr;return n!==jr&&(n=jr+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(cn))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(cn))==="identified"}Hs(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ii(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[ls])&&((n=this.persistence)==null||(n=n.props)==null||!n[tl]))}zs(){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.Hs()||this.Ws("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ws(e){return this.config.person_profiles==="never"?(F.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Gs(tl,!0),!0)}Os(){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}Vs(){var e,n,r,i,s=this.Os();return((e=this.persistence)==null?void 0:e.Le)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.Le)!==s&&((i=this.sessionPersistence)==null||i.set_disabled(s)),s}opt_in_capturing(e){if(this.config.cookieless_mode!=="always"){var n;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),this.sessionManager=new Gv(this),this.persistence&&(this.sessionPropsManager=new Kv(this,this.sessionManager,this.persistence)),this.sessionRecording=new bv(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Vs(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(D(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((n=e==null?void 0:e.captureEventName)!==null&&n!==void 0?n:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Us()}else F.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Vs(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Yi,$device_id:null}),this.sessionManager=void 0,this.sessionPropsManager=void 0,(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,this.Us())):F.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===dn.GRANTED?"granted":e===dn.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.Vs()}_is_bot(){return gt?nS(gt,this.config.custom_blocked_useragents):void 0}Us(){j&&(j.visibilityState==="visible"?this.Rs||(this.Rs=!0,this.capture("$pageview",{title:j.title},{send_instantly:!0}),this.Ps&&(j.removeEventListener("visibilitychange",this.Ps),this.Ps=null)):this.Ps||(this.Ps=this.Us.bind(this),pe(j,"visibilitychange",this.Ps)))}debug(e){e===!1?(T==null||T.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(T==null||T.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}L(){var e,n,r,i,s,o,a,l=this.Cs||{};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?(F.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,s=F,o=(n="advanced_disable_flags")in(e=l)&&!D(e[n]),a=r in e&&!D(e[r]),o?e[n]:a?(s&&s.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[r]):i)}qs(e){if(X(this.config.before_send))return e;var n=ie(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of n){if(r=i(r),X(r)){var s="Event '"+e.event+"' was rejected in beforeSend function";return f2(e.event)?F.warn(s+". This can cause unexpected behavior."):F.info(s),null}r.properties&&!ii(r.properties)||F.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.pe)==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)})}}(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=$2(t.prototype[e[n]])})(Wl,["identify"]);var Zv,Vr=(Zv=Is[jr]=new Wl,function(){function t(){t.done||(t.done=!0,rS=!1,re(Is,function(e){e._dom_loaded()}))}j!=null&&j.addEventListener?j.readyState==="complete"?t():pe(j,"DOMContentLoaded",t,{capture:!1}):T&&F.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Zv),iS=x.createContext({client:Vr});function sS(t,e,n){if(n===void 0&&(n=new WeakMap),t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(n.has(t)&&n.get(t)===e)return!0;n.set(t,e);var r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(var s=0,o=r;s<o.length;s++){var a=o[s];if(!i.includes(a)||!sS(t[a],e[a],n))return!1}return!0}function ON(t){var e=t.children,n=t.client,r=t.apiKey,i=t.options,s=x.useRef(null),o=x.useMemo(function(){return n?(r&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),i&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),n):(r||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),Vr)},[n,r,JSON.stringify(i)]);return x.useEffect(function(){if(!n){var a=s.current;a?(r!==a.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),i&&!sS(i,a.options)&&Vr.set_config(i),s.current={apiKey:r,options:i??{}}):(Vr.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),Vr.init(r,i),s.current={apiKey:r,options:i??{}})}},[n,r,JSON.stringify(i)]),ee.createElement(iS.Provider,{value:{client:o}},e)}var rf=function(t,e){return rf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},rf(t,e)};function $N(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");rf(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var ec=function(t){return typeof t=="function"},FN={componentStack:null,exceptionEvent:null,error:null},jN={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(t){$N(e,t);function e(n){var r=t.call(this,n)||this;return r.state=FN,r}return e.prototype.componentDidCatch=function(n,r){var i=this.props.additionalProperties,s;ec(i)?s=i(n):typeof i=="object"&&(s=i);var o=this.context.client,a=o.captureException(n,s),l=r.componentStack;this.setState({error:n,componentStack:l,exceptionEvent:a})},e.prototype.render=function(){var n=this.props,r=n.children,i=n.fallback,s=this.state;if(s.componentStack==null)return ec(r)?r():r;var o=ec(i)?ee.createElement(i,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):i;return ee.isValidElement(o)?o:(console.warn(jN.INVALID_FALLBACK),ee.createElement(ee.Fragment,null))},e.contextType=iS,e})(ee.Component);const VN="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",BN="https://us.i.posthog.com";tc.createRoot(document.getElementById("root")).render(C.jsx(ee.StrictMode,{children:C.jsx(ON,{apiKey:VN,options:{api_host:BN,capture_exceptions:!0,debug:!1},children:C.jsx(l2,{})})}));
|