tokentracker-cli 0.80.4 → 0.80.6
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/dashboard/dist/assets/{AchievementBadge-DX-LggX4.js → AchievementBadge-OqSGghQf.js} +1 -1
- package/dashboard/dist/assets/{AchievementsPage-B8wkE9xP.js → AchievementsPage-BCZ46WrR.js} +2 -2
- package/dashboard/dist/assets/{AchievementsSection-DtzmIf9I.js → AchievementsSection-SXKWuZ8e.js} +1 -1
- package/dashboard/dist/assets/{BadgeDetailModal-CZqdIWZQ.js → BadgeDetailModal-S9VvR5lw.js} +1 -1
- package/dashboard/dist/assets/{Card-BSUag_Em.js → Card-i_NCwD2z.js} +1 -1
- package/dashboard/dist/assets/{ClawdAnimated-Dkhj87ak.js → ClawdAnimated-0HKqcGs2.js} +1 -1
- package/dashboard/dist/assets/{CommunityStatsModal-C9mK6lce.js → CommunityStatsModal-gYpGWjMP.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-Bjh9H-Vd.js → ConfirmModal-bcdvnO5x.js} +1 -1
- package/dashboard/dist/assets/{Controls-BYSv1KGd.js → Controls-DGWMm7wU.js} +1 -1
- package/dashboard/dist/assets/{DashboardPage-BjYHD7cb.js → DashboardPage-B5I4egUO.js} +1 -1
- package/dashboard/dist/assets/{DevicePage-DHBd7LbW.js → DevicePage-BzU-OKx4.js} +1 -1
- package/dashboard/dist/assets/{DialogClose-Be-pyoVu.js → DialogClose-B_6ewtKf.js} +1 -1
- package/dashboard/dist/assets/DialogDescription-BNq3a5OL.js +1 -0
- package/dashboard/dist/assets/{DialogTitle-DeXrE3Jr.js → DialogTitle-BVxZYut1.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-BIj6T_Ni.js → FadeIn-ezcGpBSB.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-CVPu84a0.js → HeaderGithubStar-C2teTnDw.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-2JMGIL_x.js → IpCheckPage-BnC07aNN.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-B42AweLO.js → LandingPage-CI695ytW.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardAvatar-j3c8hJFh.js → LeaderboardAvatar-zLcCQBlE.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-cOLb_Ssc.js → LeaderboardPage-DvbAKYlA.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProfileModal-DvdDUUFU.js → LeaderboardProfileModal-CJwleLOK.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfilePage-Pg2Sggtd.js → LeaderboardProfilePage-B2SV6EV6.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-DNMNpIgQ.js → LimitsPage-BQLI731g.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-Bm0n3EVD.js → LocalOnlyNotice-DgHW77Bd.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-DlZ1jBtd.js → LoginPage-OJjtZSeT.js} +1 -1
- package/dashboard/dist/assets/{PetPage-5Qk5nTRF.js → PetPage-xb4RYIb2.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-RoYcoamh.js → PopoverPopup-CXCbgW5t.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-PbCAaF56.js → ResetPasswordPage-D8KIfmPD.js} +1 -1
- package/dashboard/dist/assets/{Select-B3plxksi.js → Select-CZipvgcj.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-Deyr9uQd.js → SelectItemText-D8xVLiJW.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-DloJH8fs.js → SettingsPage-DtoIzykD.js} +1 -1
- package/dashboard/dist/assets/{SkillsPage-DHhXoof-.js → SkillsPage-CM5KgkUG.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-CNGHvVDr.js → WidgetsPage-CmJkql-6.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-2ZN38qnG.js → WrappedPage-iJXvrCko.js} +1 -1
- package/dashboard/dist/assets/{agent-logos-DApZ1E-T.js → agent-logos-R_B0QhVz.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-DMGmqVqe.js → arrow-up-right-DWt3-hUw.js} +1 -1
- package/dashboard/dist/assets/check-CnALAJQD.js +1 -0
- package/dashboard/dist/assets/{copy-CvnjBsmb.js → copy-D3MU7PXn.js} +1 -1
- package/dashboard/dist/assets/{download-sDeO57uc.js → download-nqYmqGR6.js} +1 -1
- package/dashboard/dist/assets/{flame-CyiQUQcA.js → flame-DqrH9Z-t.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-DlkEG-2M.js → format-tokens-BYZoS7nO.js} +1 -1
- package/dashboard/dist/assets/{info-482LCF96.js → info-DZkdbByV.js} +1 -1
- package/dashboard/dist/assets/{link-2-DY_0gFgX.js → link-2-BRxYF86F.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-xebF61S5.js → loader-circle-KsU-6Vjy.js} +1 -1
- package/dashboard/dist/assets/{main-DY9GCwr_.js → main-BrFeiIEM.js} +2 -2
- package/dashboard/dist/assets/main-C1dVPkmn.css +1 -0
- package/dashboard/dist/assets/{provider-display-B6jUb-Ud.js → provider-display-BS09zsgc.js} +1 -1
- package/dashboard/dist/assets/{trash-2-D0iohG1v.js → trash-2--Xl7DSYw.js} +1 -1
- package/dashboard/dist/assets/use-community-stats-CGGKC45v.js +1 -0
- package/dashboard/dist/assets/{use-limits-display-prefs-BfSnFqTR.js → use-limits-display-prefs-DMBUtYO8.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-Cx_HZy8t.js → use-native-settings-Cevps8E5.js} +1 -1
- package/dashboard/dist/assets/{use-ordered-list-IRGftZaJ.js → use-ordered-list-BWzetQSF.js} +1 -1
- package/dashboard/dist/assets/{use-quality-per-dollar-pref-BoE3jESh.js → use-quality-per-dollar-pref-BjZu5vYY.js} +1 -1
- package/dashboard/dist/assets/{use-transform-BJNb33iJ.js → use-transform-C_EShtVw.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-Dyoqxe1m.js → use-usage-limits-CdDmT63X.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-f-244MeL.js → useCurrency-D_kT-lnV.js} +1 -1
- package/dashboard/dist/assets/{useScrollLock-D6X4FH8b.js → useScrollLock-CYj0Bhp0.js} +1 -1
- package/dashboard/dist/assets/useTokenFormat-DVhUBuX3.js +1 -0
- package/dashboard/dist/assets/{zap-DN1VaJU3.js → zap-APMI6clv.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +1 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/dashboard/dist/assets/DialogDescription-doJbC76C.js +0 -1
- package/dashboard/dist/assets/check-D1YFQP0r.js +0 -1
- package/dashboard/dist/assets/main-BbNuscIe.css +0 -1
- package/dashboard/dist/assets/use-community-stats-DPHOiIBu.js +0 -1
- package/dashboard/dist/assets/useTokenFormat-Cz_Gqk4n.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LimitsPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LimitsPage-BQLI731g.js","assets/use-usage-limits-CdDmT63X.js","assets/use-limits-display-prefs-DMBUtYO8.js","assets/Card-i_NCwD2z.js","assets/FadeIn-ezcGpBSB.js","assets/LocalOnlyNotice-DgHW77Bd.js","assets/arrow-up-right-DWt3-hUw.js","assets/download-nqYmqGR6.js","assets/LeaderboardPage-DvbAKYlA.js","assets/Select-CZipvgcj.js","assets/SelectItemText-D8xVLiJW.js","assets/useScrollLock-CYj0Bhp0.js","assets/check-CnALAJQD.js","assets/use-ordered-list-BWzetQSF.js","assets/useCurrency-D_kT-lnV.js","assets/useTokenFormat-DVhUBuX3.js","assets/LeaderboardAvatar-zLcCQBlE.js","assets/AchievementBadge-OqSGghQf.js","assets/zap-APMI6clv.js","assets/flame-DqrH9Z-t.js","assets/use-community-stats-CGGKC45v.js","assets/DashboardPage-B5I4egUO.js","assets/provider-display-BS09zsgc.js","assets/info-DZkdbByV.js","assets/DialogTitle-BVxZYut1.js","assets/DialogClose-B_6ewtKf.js","assets/PopoverPopup-CXCbgW5t.js","assets/use-transform-C_EShtVw.js","assets/loader-circle-KsU-6Vjy.js","assets/ClawdAnimated-0HKqcGs2.js","assets/use-quality-per-dollar-pref-BjZu5vYY.js","assets/agent-logos-R_B0QhVz.js","assets/AchievementsPage-BCZ46WrR.js","assets/AchievementsSection-SXKWuZ8e.js","assets/format-tokens-BYZoS7nO.js","assets/LandingPage-CI695ytW.js","assets/HeaderGithubStar-C2teTnDw.js","assets/copy-D3MU7PXn.js","assets/LeaderboardProfilePage-B2SV6EV6.js","assets/LeaderboardProfileModal-CJwleLOK.js","assets/link-2-BRxYF86F.js","assets/SettingsPage-DtoIzykD.js","assets/Controls-DGWMm7wU.js","assets/use-native-settings-Cevps8E5.js","assets/ConfirmModal-bcdvnO5x.js","assets/DialogDescription-BNq3a5OL.js","assets/SkillsPage-CM5KgkUG.js","assets/trash-2--Xl7DSYw.js","assets/WidgetsPage-CmJkql-6.js","assets/PetPage-xb4RYIb2.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function mR(t,e){for(var n=0;n<e.length;n++){const a=e[n];if(typeof a!="string"&&!Array.isArray(a)){for(const r in a)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(a,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>a[r]})}}}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 r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function FS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function gR(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function a(){var r=!1;try{r=this instanceof a}catch{}return r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(a){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}),n}var Tg={exports:{}},Oc={},Eg={exports:{}},ut={};var uw;function vR(){if(uw)return ut;uw=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=m&&O[m]||O["@@iterator"],typeof O=="function"?O:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,x={};function P(O,Y,ae){this.props=O,this.context=Y,this.refs=x,this.updater=ae||y}P.prototype.isReactComponent={},P.prototype.setState=function(O,Y){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,Y,"setState")},P.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function E(){}E.prototype=P.prototype;function L(O,Y,ae){this.props=O,this.context=Y,this.refs=x,this.updater=ae||y}var T=L.prototype=new E;T.constructor=L,b(T,P.prototype),T.isPureReactComponent=!0;var A=Array.isArray,D=Object.prototype.hasOwnProperty,B={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function S(O,Y,ae){var _e,fe={},ve=null,Ne=null;if(Y!=null)for(_e in Y.ref!==void 0&&(Ne=Y.ref),Y.key!==void 0&&(ve=""+Y.key),Y)D.call(Y,_e)&&!j.hasOwnProperty(_e)&&(fe[_e]=Y[_e]);var Oe=arguments.length-2;if(Oe===1)fe.children=ae;else if(1<Oe){for(var Ie=Array(Oe),St=0;St<Oe;St++)Ie[St]=arguments[St+2];fe.children=Ie}if(O&&O.defaultProps)for(_e in Oe=O.defaultProps,Oe)fe[_e]===void 0&&(fe[_e]=Oe[_e]);return{$$typeof:t,type:O,key:ve,ref:Ne,props:fe,_owner:B.current}}function N(O,Y){return{$$typeof:t,type:O.type,key:Y,ref:O.ref,props:O.props,_owner:O._owner}}function U(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function Q(O){var Y={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ae){return Y[ae]})}var ee=/\/+/g;function ce(O,Y){return typeof O=="object"&&O!==null&&O.key!=null?Q(""+O.key):Y.toString(36)}function le(O,Y,ae,_e,fe){var ve=typeof O;(ve==="undefined"||ve==="boolean")&&(O=null);var Ne=!1;if(O===null)Ne=!0;else switch(ve){case"string":case"number":Ne=!0;break;case"object":switch(O.$$typeof){case t:case e:Ne=!0}}if(Ne)return Ne=O,fe=fe(Ne),O=_e===""?"."+ce(Ne,0):_e,A(fe)?(ae="",O!=null&&(ae=O.replace(ee,"$&/")+"/"),le(fe,Y,ae,"",function(St){return St})):fe!=null&&(U(fe)&&(fe=N(fe,ae+(!fe.key||Ne&&Ne.key===fe.key?"":(""+fe.key).replace(ee,"$&/")+"/")+O)),Y.push(fe)),1;if(Ne=0,_e=_e===""?".":_e+":",A(O))for(var Oe=0;Oe<O.length;Oe++){ve=O[Oe];var Ie=_e+ce(ve,Oe);Ne+=le(ve,Y,ae,Ie,fe)}else if(Ie=v(O),typeof Ie=="function")for(O=Ie.call(O),Oe=0;!(ve=O.next()).done;)ve=ve.value,Ie=_e+ce(ve,Oe++),Ne+=le(ve,Y,ae,Ie,fe);else if(ve==="object")throw Y=String(O),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return Ne}function re(O,Y,ae){if(O==null)return O;var _e=[],fe=0;return le(O,_e,"","",function(ve){return Y.call(ae,ve,fe++)}),_e}function te(O){if(O._status===-1){var Y=O._result;Y=Y(),Y.then(function(ae){(O._status===0||O._status===-1)&&(O._status=1,O._result=ae)},function(ae){(O._status===0||O._status===-1)&&(O._status=2,O._result=ae)}),O._status===-1&&(O._status=0,O._result=Y)}if(O._status===1)return O._result.default;throw O._result}var ie={current:null},$={transition:null},X={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:$,ReactCurrentOwner:B};function W(){throw Error("act(...) is not supported in production builds of React.")}return ut.Children={map:re,forEach:function(O,Y,ae){re(O,function(){Y.apply(this,arguments)},ae)},count:function(O){var Y=0;return re(O,function(){Y++}),Y},toArray:function(O){return re(O,function(Y){return Y})||[]},only:function(O){if(!U(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},ut.Component=P,ut.Fragment=n,ut.Profiler=r,ut.PureComponent=L,ut.StrictMode=a,ut.Suspense=u,ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,ut.act=W,ut.cloneElement=function(O,Y,ae){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var _e=b({},O.props),fe=O.key,ve=O.ref,Ne=O._owner;if(Y!=null){if(Y.ref!==void 0&&(ve=Y.ref,Ne=B.current),Y.key!==void 0&&(fe=""+Y.key),O.type&&O.type.defaultProps)var Oe=O.type.defaultProps;for(Ie in Y)D.call(Y,Ie)&&!j.hasOwnProperty(Ie)&&(_e[Ie]=Y[Ie]===void 0&&Oe!==void 0?Oe[Ie]:Y[Ie])}var Ie=arguments.length-2;if(Ie===1)_e.children=ae;else if(1<Ie){Oe=Array(Ie);for(var St=0;St<Ie;St++)Oe[St]=arguments[St+2];_e.children=Oe}return{$$typeof:t,type:O.type,key:fe,ref:ve,props:_e,_owner:Ne}},ut.createContext=function(O){return O={$$typeof:l,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:s,_context:O},O.Consumer=O},ut.createElement=S,ut.createFactory=function(O){var Y=S.bind(null,O);return Y.type=O,Y},ut.createRef=function(){return{current:null}},ut.forwardRef=function(O){return{$$typeof:c,render:O}},ut.isValidElement=U,ut.lazy=function(O){return{$$typeof:p,_payload:{_status:-1,_result:O},_init:te}},ut.memo=function(O,Y){return{$$typeof:h,type:O,compare:Y===void 0?null:Y}},ut.startTransition=function(O){var Y=$.transition;$.transition={};try{O()}finally{$.transition=Y}},ut.unstable_act=W,ut.useCallback=function(O,Y){return ie.current.useCallback(O,Y)},ut.useContext=function(O){return ie.current.useContext(O)},ut.useDebugValue=function(){},ut.useDeferredValue=function(O){return ie.current.useDeferredValue(O)},ut.useEffect=function(O,Y){return ie.current.useEffect(O,Y)},ut.useId=function(){return ie.current.useId()},ut.useImperativeHandle=function(O,Y,ae){return ie.current.useImperativeHandle(O,Y,ae)},ut.useInsertionEffect=function(O,Y){return ie.current.useInsertionEffect(O,Y)},ut.useLayoutEffect=function(O,Y){return ie.current.useLayoutEffect(O,Y)},ut.useMemo=function(O,Y){return ie.current.useMemo(O,Y)},ut.useReducer=function(O,Y,ae){return ie.current.useReducer(O,Y,ae)},ut.useRef=function(O){return ie.current.useRef(O)},ut.useState=function(O){return ie.current.useState(O)},ut.useSyncExternalStore=function(O,Y,ae){return ie.current.useSyncExternalStore(O,Y,ae)},ut.useTransition=function(){return ie.current.useTransition()},ut.version="18.3.1",ut}var hw;function Kd(){return hw||(hw=1,Eg.exports=vR()),Eg.exports}var pw;function _R(){if(pw)return Oc;pw=1;var t=Kd(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(c,u,h){var p,m={},v=null,y=null;h!==void 0&&(v=""+h),u.key!==void 0&&(v=""+u.key),u.ref!==void 0&&(y=u.ref);for(p in u)a.call(u,p)&&!s.hasOwnProperty(p)&&(m[p]=u[p]);if(c&&c.defaultProps)for(p in u=c.defaultProps,u)m[p]===void 0&&(m[p]=u[p]);return{$$typeof:e,type:c,key:v,ref:y,props:m,_owner:r.current}}return Oc.Fragment=n,Oc.jsx=l,Oc.jsxs=l,Oc}var fw;function yR(){return fw||(fw=1,Tg.exports=_R()),Tg.exports}var R=yR(),k=Kd();const lo=FS(k),US=mR({__proto__:null,default:lo},[k]);var hh={},Ag={exports:{}},ga={},Rg={exports:{}},Lg={};var mw;function bR(){return mw||(mw=1,(function(t){function e($,X){var W=$.length;$.push(X);e:for(;0<W;){var O=W-1>>>1,Y=$[O];if(0<r(Y,X))$[O]=X,$[W]=Y,W=O;else break e}}function n($){return $.length===0?null:$[0]}function a($){if($.length===0)return null;var X=$[0],W=$.pop();if(W!==X){$[0]=W;e:for(var O=0,Y=$.length,ae=Y>>>1;O<ae;){var _e=2*(O+1)-1,fe=$[_e],ve=_e+1,Ne=$[ve];if(0>r(fe,W))ve<Y&&0>r(Ne,fe)?($[O]=Ne,$[ve]=W,O=ve):($[O]=fe,$[_e]=W,O=_e);else if(ve<Y&&0>r(Ne,W))$[O]=Ne,$[ve]=W,O=ve;else break e}}return X}function r($,X){var W=$.sortIndex-X.sortIndex;return W!==0?W:$.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}var u=[],h=[],p=1,m=null,v=3,y=!1,b=!1,x=!1,P=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T($){for(var X=n(h);X!==null;){if(X.callback===null)a(h);else if(X.startTime<=$)a(h),X.sortIndex=X.expirationTime,e(u,X);else break;X=n(h)}}function A($){if(x=!1,T($),!b)if(n(u)!==null)b=!0,te(D);else{var X=n(h);X!==null&&ie(A,X.startTime-$)}}function D($,X){b=!1,x&&(x=!1,E(S),S=-1),y=!0;var W=v;try{for(T(X),m=n(u);m!==null&&(!(m.expirationTime>X)||$&&!Q());){var O=m.callback;if(typeof O=="function"){m.callback=null,v=m.priorityLevel;var Y=O(m.expirationTime<=X);X=t.unstable_now(),typeof Y=="function"?m.callback=Y:m===n(u)&&a(u),T(X)}else a(u);m=n(u)}if(m!==null)var ae=!0;else{var _e=n(h);_e!==null&&ie(A,_e.startTime-X),ae=!1}return ae}finally{m=null,v=W,y=!1}}var B=!1,j=null,S=-1,N=5,U=-1;function Q(){return!(t.unstable_now()-U<N)}function ee(){if(j!==null){var $=t.unstable_now();U=$;var X=!0;try{X=j(!0,$)}finally{X?ce():(B=!1,j=null)}}else B=!1}var ce;if(typeof L=="function")ce=function(){L(ee)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,re=le.port2;le.port1.onmessage=ee,ce=function(){re.postMessage(null)}}else ce=function(){P(ee,0)};function te($){j=$,B||(B=!0,ce())}function ie($,X){S=P(function(){$(t.unstable_now())},X)}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($){$.callback=null},t.unstable_continueExecution=function(){b||y||(b=!0,te(D))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function($){switch(v){case 1:case 2:case 3:var X=3;break;default:X=v}var W=v;v=X;try{return $()}finally{v=W}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,X){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var W=v;v=$;try{return X()}finally{v=W}},t.unstable_scheduleCallback=function($,X,W){var O=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?O+W:O):W=O,$){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=W+Y,$={id:p++,callback:X,priorityLevel:$,startTime:W,expirationTime:Y,sortIndex:-1},W>O?($.sortIndex=W,e(h,$),n(u)===null&&$===n(h)&&(x?(E(S),S=-1):x=!0,ie(A,W-O))):($.sortIndex=Y,e(u,$),b||y||(b=!0,te(D))),$},t.unstable_shouldYield=Q,t.unstable_wrapCallback=function($){var X=v;return function(){var W=v;v=X;try{return $.apply(this,arguments)}finally{v=W}}}})(Lg)),Lg}var gw;function kR(){return gw||(gw=1,Rg.exports=bR()),Rg.exports}var vw;function wR(){if(vw)return ga;vw=1;var t=Kd(),e=kR();function n(i){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+i,d=1;d<arguments.length;d++)o+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,r={};function s(i,o){l(i,o),l(i+"Capture",o)}function l(i,o){for(r[i]=o,i=0;i<o.length;i++)a.add(o[i])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,h=/^[: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]*$/,p={},m={};function v(i){return u.call(m,i)?!0:u.call(p,i)?!1:h.test(i)?m[i]=!0:(p[i]=!0,!1)}function y(i,o,d,f){if(d!==null&&d.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return f?!1:d!==null?!d.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function b(i,o,d,f){if(o===null||typeof o>"u"||y(i,o,d,f))return!0;if(f)return!1;if(d!==null)switch(d.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function x(i,o,d,f,g,_,C){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=f,this.attributeNamespace=g,this.mustUseProperty=d,this.propertyName=i,this.type=o,this.sanitizeURL=_,this.removeEmptyString=C}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){P[i]=new x(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];P[o]=new x(o,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){P[i]=new x(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){P[i]=new x(i,2,!1,i,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(i){P[i]=new x(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){P[i]=new x(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){P[i]=new x(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){P[i]=new x(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){P[i]=new x(i,5,!1,i.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function L(i){return i[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(i){var o=i.replace(E,L);P[o]=new x(o,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(E,L);P[o]=new x(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(E,L);P[o]=new x(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){P[i]=new x(i,1,!1,i.toLowerCase(),null,!1,!1)}),P.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){P[i]=new x(i,1,!1,i.toLowerCase(),null,!0,!0)});function T(i,o,d,f){var g=P.hasOwnProperty(o)?P[o]:null;(g!==null?g.type!==0:f||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(b(o,d,g,f)&&(d=null),f||g===null?v(o)&&(d===null?i.removeAttribute(o):i.setAttribute(o,""+d)):g.mustUseProperty?i[g.propertyName]=d===null?g.type===3?!1:"":d:(o=g.attributeName,f=g.attributeNamespace,d===null?i.removeAttribute(o):(g=g.type,d=g===3||g===4&&d===!0?"":""+d,f?i.setAttributeNS(f,o,d):i.setAttribute(o,d))))}var A=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),B=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),Q=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),re=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),$=Symbol.iterator;function X(i){return i===null||typeof i!="object"?null:(i=$&&i[$]||i["@@iterator"],typeof i=="function"?i:null)}var W=Object.assign,O;function Y(i){if(O===void 0)try{throw Error()}catch(d){var o=d.stack.trim().match(/\n( *(at )?)/);O=o&&o[1]||""}return`
|
|
3
3
|
`+O+i}var ae=!1;function _e(i,o){if(!i||ae)return"";ae=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(J){var f=J}Reflect.construct(i,[],o)}else{try{o.call()}catch(J){f=J}i.call(o.prototype)}else{try{throw Error()}catch(J){f=J}i()}}catch(J){if(J&&f&&typeof J.stack=="string"){for(var g=J.stack.split(`
|
|
4
4
|
`),_=f.stack.split(`
|
|
@@ -1246,5 +1246,5 @@ achievements.page.suggest_link,dashboard,AchievementsPage,AchievementsPage,sugge
|
|
|
1246
1246
|
${A}px !important;
|
|
1247
1247
|
${D}px !important;
|
|
1248
1248
|
}
|
|
1249
|
-
`),()=>{c.current?.removeAttribute("data-motion-pop-id"),j.contains(B)&&j.removeChild(B)}},[e]),R.jsx(kU,{isPresent:e,childRef:c,sizeRef:u,pop:s,children:s===!1?t:k.cloneElement(t,{ref:m})})}const xU=({children:t,initial:e,isPresent:n,onExitComplete:a,custom:r,presenceAffectsLayout:s,mode:l,anchorX:c,anchorY:u,root:h})=>{const p=E0(PU),m=k.useId(),v=k.useRef(n),y=k.useRef(a);A0(()=>{v.current=n,y.current=a});let b=!0,x=k.useMemo(()=>(b=!1,{id:m,initial:e,isPresent:n,custom:r,onExitComplete:P=>{p.set(P,!0);for(const E of p.values())if(!E)return;a&&a()},register:P=>(p.set(P,!1),()=>{p.delete(P),!v.current&&!p.size&&y.current?.()})}),[n,p,a]);return s&&b&&(x={...x}),k.useMemo(()=>{p.forEach((P,E)=>p.set(E,!1))},[n]),k.useEffect(()=>{!n&&!p.size&&a&&a()},[n]),t=R.jsx(wU,{pop:l==="popLayout",isPresent:n,anchorX:c,anchorY:u,root:h,children:t}),R.jsx(zf.Provider,{value:x,children:t})};function PU(){return new Map}function I5(t=!0){const e=k.useContext(zf);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:r}=e,s=k.useId();k.useEffect(()=>{if(t)return r(s)},[t]);const l=k.useCallback(()=>t&&a&&a(s),[s,a,t]);return!n&&a?[!1,l]:[!0]}const xh=t=>t.key||"";function U2(t){const e=[];return k.Children.forEach(t,n=>{k.isValidElement(n)&&e.push(n)}),e}const M5=({children:t,custom:e,initial:n=!0,onExitComplete:a,presenceAffectsLayout:r=!0,mode:s="sync",propagate:l=!1,anchorX:c="left",anchorY:u="top",root:h})=>{const[p,m]=I5(l),v=k.useMemo(()=>U2(t),[t]),y=l&&!p?[]:v.map(xh),b=k.useRef(!0),x=k.useRef(v),P=E0(()=>new Map),E=k.useRef(new Set),[L,T]=k.useState(v),[A,D]=k.useState(v);A0(()=>{b.current=!1,x.current=v;for(let S=0;S<A.length;S++){const N=xh(A[S]);y.includes(N)?(P.delete(N),E.current.delete(N)):P.get(N)!==!0&&P.set(N,!1)}},[A,y.length,y.join("-")]);const B=[];if(v!==L){let S=[...v];for(let N=0;N<A.length;N++){const U=A[N],Q=xh(U);y.includes(Q)||(S.splice(N,0,U),B.push(U))}return s==="wait"&&B.length&&(S=B),D(U2(S)),T(v),null}const{forceRender:j}=k.useContext(T0);return R.jsx(R.Fragment,{children:A.map(S=>{const N=xh(S),U=l&&!p?!1:v===A||y.includes(N),Q=()=>{if(E.current.has(N))return;if(P.has(N))E.current.add(N),P.set(N,!0);else return;let ee=!0;P.forEach(ce=>{ce||(ee=!1)}),ee&&(j?.(),D(x.current),l&&m?.(),a&&a())};return R.jsx(xU,{isPresent:U,initial:!b.current||n?void 0:!1,custom:e,presenceAffectsLayout:r,mode:s,root:h,onExitComplete:U?void 0:Q,anchorX:c,anchorY:u,children:S},N)})})},N5=k.createContext({strict:!1}),B2={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"]};let $2=!1;function SU(){if($2)return;const t={};for(const e in B2)t[e]={isEnabled:n=>B2[e].some(a=>!!n[a])};d5(t),$2=!0}function O5(){return SU(),cF()}function CU(t){const e=O5();for(const n in t)e[n]={...e[n],...t[n]};d5(e)}const TU=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","propagate","ignoreStrict","viewport"]);function Yp(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||TU.has(t)}let j5=t=>!Yp(t);function EU(t){typeof t=="function"&&(j5=e=>e.startsWith("on")?!Yp(e):t(e))}try{EU(require("@emotion/is-prop-valid").default)}catch{}function AU(t,e,n){const a={};for(const r in t)r==="values"&&typeof t.values=="object"||Un(t[r])||(j5(r)||n===!0&&Yp(r)||!e&&!Yp(r)||t.draggable&&r.startsWith("onDrag"))&&(a[r]=t[r]);return a}const $f=k.createContext({});function RU(t,e){if(Bf(t)){const{initial:n,animate:a}=t;return{initial:n===!1||jd(n)?n:void 0,animate:jd(a)?a:void 0}}return t.inherit!==!1?e:{}}function LU(t){const{initial:e,animate:n}=RU(t,k.useContext($f));return k.useMemo(()=>({initial:e,animate:n}),[V2(e),V2(n)])}function V2(t){return Array.isArray(t)?t.join(" "):t}const nb=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function z5(t,e,n){for(const a in e)!Un(e[a])&&!v5(a,n)&&(t[a]=e[a])}function DU({transformTemplate:t},e){return k.useMemo(()=>{const n=nb();return X0(n,e,t),Object.assign({},n.vars,n.style)},[e])}function IU(t,e){const n=t.style||{},a={};return z5(a,n,t),Object.assign(a,DU(t,e)),a}function MU(t,e){const n={},a=IU(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.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=a,n}const F5=()=>({...nb(),attrs:{}});function NU(t,e,n,a){const r=k.useMemo(()=>{const s=F5();return _5(s,e,b5(a),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};z5(s,t.style,t),r.style={...s,...r.style}}return r}const OU=["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 ab(t){return typeof t!="string"||t.includes("-")?!1:!!(OU.indexOf(t)>-1||/[A-Z]/u.test(t))}function jU(t,e,n,{latestValues:a},r,s=!1,l){const u=(l??ab(t)?NU:MU)(e,a,r,t),h=AU(e,typeof t=="string",s),p=t!==k.Fragment?{...h,...u,ref:n}:{},{children:m}=e,v=k.useMemo(()=>Un(m)?m.get():m,[m]);return k.createElement(t,{...p,children:v})}function zU({scrapeMotionValuesFromProps:t,createRenderState:e},n,a,r){return{latestValues:FU(n,a,r,t),renderState:e()}}function FU(t,e,n,a){const r={},s=a(t,{});for(const v in s)r[v]=cp(s[v]);let{initial:l,animate:c}=t;const u=Bf(t),h=l5(t);e&&h&&!u&&t.inherit!==!1&&(l===void 0&&(l=e.initial),c===void 0&&(c=e.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const m=p?c:l;if(m&&typeof m!="boolean"&&!Uf(m)){const v=Array.isArray(m)?m:[m];for(let y=0;y<v.length;y++){const b=H0(t,v[y]);if(b){const{transitionEnd:x,transition:P,...E}=b;for(const L in E){let T=E[L];if(Array.isArray(T)){const A=p?T.length-1:0;T=T[A]}T!==null&&(r[L]=T)}for(const L in x)r[L]=x[L]}}}return r}const U5=t=>(e,n)=>{const a=k.useContext($f),r=k.useContext(zf),s=()=>zU(t,e,a,r);return n?s():E0(s)},UU=U5({scrapeMotionValuesFromProps:eb,createRenderState:nb}),BU=U5({scrapeMotionValuesFromProps:k5,createRenderState:F5}),$U=Symbol.for("motionComponentSymbol");function VU(t,e,n){const a=k.useRef(n);k.useInsertionEffect(()=>{a.current=n});const r=k.useRef(null);return k.useCallback(s=>{s&&t.onMount?.(s),e&&(s?e.mount(s):e.unmount());const l=a.current;if(typeof l=="function")if(s){const c=l(s);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):l(s);else l&&(l.current=s)},[e])}const B5=k.createContext({});function ul(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function HU(t,e,n,a,r,s){const{visualElement:l}=k.useContext($f),c=k.useContext(N5),u=k.useContext(zf),h=k.useContext(tb),p=h.reducedMotion,m=h.skipAnimations,v=k.useRef(null),y=k.useRef(!1);a=a||c.renderer,!v.current&&a&&(v.current=a(t,{visualState:e,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:p,skipAnimations:m,isSVG:s}),y.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const b=v.current,x=k.useContext(B5);b&&!b.projection&&r&&(b.type==="html"||b.type==="svg")&&WU(v.current,n,r,x);const P=k.useRef(!1);k.useInsertionEffect(()=>{b&&P.current&&b.update(n,u)});const E=n[ZT],L=k.useRef(!!E&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(E)&&window.MotionHasOptimisedAnimation?.(E));return A0(()=>{y.current=!0,b&&(P.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),L.current&&b.animationState&&b.animationState.animateChanges())}),k.useEffect(()=>{b&&(!L.current&&b.animationState&&b.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(E)}),L.current=!1),b.enteringChildren=void 0)}),b}function WU(t,e,n,a){const{layoutId:r,layout:s,drag:l,dragConstraints:c,layoutScroll:u,layoutRoot:h,layoutAnchor:p,layoutCrossfade:m}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:$5(t.parent)),t.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!l||c&&ul(c),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:a,crossfade:m,layoutScroll:u,layoutRoot:h,layoutAnchor:p})}function $5(t){if(t)return t.options.allowProjection!==!1?t.projection:$5(t.parent)}function iv(t,{forwardMotionProps:e=!1,type:n}={},a,r){a&&CU(a);const s=n?n==="svg":ab(t),l=s?BU:UU;function c(h,p){let m;const v={...k.useContext(tb),...h,layoutId:GU(h)},{isStatic:y}=v,b=LU(h),x=l(h,y);if(!y&&typeof window<"u"){qU();const P=KU(v);m=P.MeasureLayout,b.visualElement=HU(t,x,v,r,P.ProjectionNode,s)}return R.jsxs($f.Provider,{value:b,children:[m&&b.visualElement?R.jsx(m,{visualElement:b.visualElement,...v}):null,jU(t,h,VU(x,b.visualElement,p),x,y,e,s)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=k.forwardRef(c);return u[$U]=t,u}function GU({layoutId:t}){const e=k.useContext(T0).id;return e&&t!==void 0?e+"-"+t:t}function qU(t,e){k.useContext(N5).strict}function KU(t){const e=O5(),{drag:n,layout:a}=e;if(!n&&!a)return{};const r={...n,...a};return{MeasureLayout:n?.isEnabled(t)||a?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function YU(t,e){if(typeof Proxy>"u")return iv;const n=new Map,a=(s,l)=>iv(s,l,t,e),r=(s,l)=>a(s,l);return new Proxy(r,{get:(s,l)=>l==="create"?a:(n.has(l)||n.set(l,iv(l,void 0,t,e)),n.get(l))})}const ZU=(t,e)=>e.isSVG??ab(t)?new CF(e):new bF(e,{allowProjection:t!==k.Fragment});class JU extends vs{constructor(e){super(e),e.animationState||(e.animationState=LF(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Uf(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(){this.node.animationState.reset(),this.unmountControls?.()}}let QU=0;class XU extends vs{constructor(){super(...arguments),this.id=QU++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===a)return;if(e&&a===!1){if(this.isExitComplete){const{initial:s,custom:l}=this.node.getProps();if(typeof s=="string"||typeof s=="object"&&s!==null&&!Array.isArray(s)){const c=so(this.node,s,l);if(c){const{transition:u,transitionEnd:h,...p}=c;for(const m in p)this.node.getValue(m)?.jump(p[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const eB={animation:{Feature:JU},exit:{Feature:XU}};function su(t){return{point:{x:t.pageX,y:t.pageY}}}const tB=t=>e=>K0(e)&&t(e,su(e));function bd(t,e,n,a){return zd(t,e,tB(n),a)}const V5=({current:t})=>t?t.ownerDocument.defaultView:null,H2=(t,e)=>Math.abs(t-e);function nB(t,e){const n=H2(t.x,e.x),a=H2(t.y,e.y);return Math.sqrt(n**2+a**2)}const W2=new Set(["auto","scroll"]);class H5{constructor(e,n,{transformPagePoint:a,contextWindow:r=window,dragSnapToOrigin:s=!1,distanceThreshold:l=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=b=>{this.handleScroll(b.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ph(this.lastRawMoveEventInfo,this.transformPagePoint));const b=sv(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,P=nB(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!P)return;const{point:E}=b,{timestamp:L}=zn;this.history.push({...E,timestamp:L});const{onStart:T,onMove:A}=this.handlers;x||(T&&T(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=Ph(x,this.transformPagePoint),Ot.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:P,onSessionEnd:E,resumeAnimation:L}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&L&&L(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=sv(b.type==="pointercancel"?this.lastMoveEventInfo:Ph(x,this.transformPagePoint),this.history);this.startEvent&&P&&P(b,T),E&&E(b,T)},!K0(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=l,this.contextWindow=r||window;const u=su(e),h=Ph(u,this.transformPagePoint),{point:p}=h,{timestamp:m}=zn;this.history=[{...p,timestamp:m}];const{onSessionStart:v}=n;v&&v(e,sv(h,this.history));const y={passive:!0,capture:!0};this.removeListeners=au(bd(this.contextWindow,"pointermove",this.handlePointerMove,y),bd(this.contextWindow,"pointerup",this.handlePointerUp,y),bd(this.contextWindow,"pointercancel",this.handlePointerUp,y)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const a=getComputedStyle(n);(W2.has(a.overflowX)||W2.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const a=e===window,r=a?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:r.x-n.x,y:r.y-n.y};s.x===0&&s.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,r),Ot.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ps(this.updatePoint)}}function Ph(t,e){return e?{point:e(t.point)}:t}function G2(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sv({point:t},e){return{point:t,delta:G2(t,W5(e)),offset:G2(t,aB(e)),velocity:rB(e,.1)}}function aB(t){return t[0]}function W5(t){return t[t.length-1]}function rB(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,a=null;const r=W5(t);for(;n>=0&&(a=t[n],!(r.timestamp-a.timestamp>La(e)));)n--;if(!a)return{x:0,y:0};a===t[0]&&t.length>2&&r.timestamp-a.timestamp>La(e)*2&&(a=t[1]);const s=qa(r.timestamp-a.timestamp);if(s===0)return{x:0,y:0};const l={x:(r.x-a.x)/s,y:(r.y-a.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function iB(t,{min:e,max:n},a){return e!==void 0&&t<e?t=a?Nt(e,t,a.min):Math.max(t,e):n!==void 0&&t>n&&(t=a?Nt(n,t,a.max):Math.min(t,n)),t}function q2(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 sB(t,{top:e,left:n,bottom:a,right:r}){return{x:q2(t.x,n,r),y:q2(t.y,e,a)}}function K2(t,e){let n=e.min-t.min,a=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,a]=[a,n]),{min:n,max:a}}function oB(t,e){return{x:K2(t.x,e.x),y:K2(t.y,e.y)}}function lB(t,e){let n=.5;const a=ia(t),r=ia(e);return r>a?n=Nd(e.min,e.max-a,t.min):a>r&&(n=Nd(t.min,t.max-r,e.min)),Zr(0,1,n)}function cB(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 G_=.35;function dB(t=G_){return t===!1?t=0:t===!0&&(t=G_),{x:Y2(t,"left","right"),y:Y2(t,"top","bottom")}}function Y2(t,e,n){return{min:Z2(t,e),max:Z2(t,n)}}function Z2(t,e){return typeof t=="number"?t:t[e]||0}const uB=new WeakMap;class hB{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=Cn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=m=>{n&&this.snapToCursor(su(m).point),this.stopAnimation()},l=(m,v)=>{const{drag:y,dragPropagation:b,onDragStart:x}=this.getProps();if(y&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Uz(y),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),jr(E=>{let L=this.getAxisMotionValue(E).get()||0;if(Vr.test(L)){const{projection:T}=this.visualElement;if(T&&T.layout){const A=T.layout.layoutBox[E];A&&(L=ia(A)*(parseFloat(L)/100))}}this.originPoint[E]=L}),x&&Ot.update(()=>x(m,v),!1,!0),j_(this.visualElement,"transform");const{animationState:P}=this.visualElement;P&&P.setActive("whileDrag",!0)},c=(m,v)=>{this.latestPointerEvent=m,this.latestPanInfo=v;const{dragPropagation:y,dragDirectionLock:b,onDirectionLock:x,onDrag:P}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:E}=v;if(b&&this.currentDirection===null){this.currentDirection=fB(E),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",v.point,E),this.updateAxis("y",v.point,E),this.visualElement.render(),P&&Ot.update(()=>P(m,v),!1,!0)},u=(m,v)=>{this.latestPointerEvent=m,this.latestPanInfo=v,this.stop(m,v),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:m}=this.getProps();(m||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new H5(e,{onSessionStart:s,onStart:l,onMove:c,onSessionEnd:u,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:a,contextWindow:V5(this.visualElement),element:this.visualElement.current})}stop(e,n){const a=e||this.latestPointerEvent,r=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!r||!a)return;const{velocity:l}=r;this.startAnimation(l);const{onDragEnd:c}=this.getProps();c&&Ot.postRender(()=>c(a,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,a){const{drag:r}=this.getProps();if(!a||!Sh(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let l=this.originPoint[e]+a[e];this.constraints&&this.constraints[e]&&(l=iB(l,this.constraints[e],this.elastic[e])),s.set(l)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&ul(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&a?this.constraints=sB(a.layoutBox,e):this.constraints=!1,this.elastic=dB(n),r!==this.constraints&&!ul(e)&&a&&this.constraints&&!this.hasMutatedConstraints&&jr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=cB(a.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ul(e))return!1;const a=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());const s=fF(a,r.root,this.visualElement.getTransformPagePoint());let l=oB(r.layout.layoutBox,s);if(n){const c=n(uF(l));this.hasMutatedConstraints=!!c,c&&(l=h5(c))}return l}startAnimation(e){const{drag:n,dragMomentum:a,dragElastic:r,dragTransition:s,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),u=this.constraints||{},h=jr(p=>{if(!Sh(p,n,this.currentDirection))return;let m=u&&u[p]||{};(l===!0||l===p)&&(m={min:0,max:0});const v=r?200:1e6,y=r?40:1e7,b={type:"inertia",velocity:a?e[p]:0,bounceStiffness:v,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...s,...m};return this.startAxisValueAnimation(p,b)});return Promise.all(h).then(c)}startAxisValueAnimation(e,n){const a=this.getAxisMotionValue(e);return j_(this.visualElement,e),a.start(V0(e,a,0,n,this.visualElement,!1))}stopAnimation(){jr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps()[n];return r||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){jr(n=>{const{drag:a}=this.getProps();if(!Sh(n,a,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:l,max:c}=r.layout.layoutBox[n],u=s.get()||0;s.set(e[n]-Nt(l,c,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!ul(n)||!a||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};jr(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const u=c.get();r[l]=lB({min:u,max:u},this.constraints[l])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),jr(l=>{if(!Sh(l,e,null))return;const c=this.getAxisMotionValue(l),{min:u,max:h}=this.constraints[l];c.set(Nt(u,h,r[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;uB.set(this.visualElement,this);const e=this.visualElement.current,n=bd(e,"pointerdown",h=>{const{drag:p,dragListener:m=!0}=this.getProps(),v=h.target,y=v!==e&&Gz(v);p&&m&&!y&&this.start(h)});let a;const r=()=>{const{dragConstraints:h}=this.getProps();ul(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),a||(a=pB(e,h.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,l=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Ot.read(r);const c=zd(window,"resize",()=>this.scalePositionWithinConstraints()),u=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:p})=>{this.isDragging&&p&&(jr(m=>{const v=this.getAxisMotionValue(m);v&&(this.originPoint[m]+=h[m].translate,v.set(v.get()+h[m].translate))}),this.visualElement.render())}));return()=>{c(),n(),l(),u&&u(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:l=G_,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:a,dragPropagation:r,dragConstraints:s,dragElastic:l,dragMomentum:c}}}function J2(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function pB(t,e,n){const a=r2(t,J2(n)),r=r2(e,J2(n));return()=>{a(),r()}}function Sh(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function fB(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class mB extends vs{constructor(e){super(e),this.removeGroupControls=Za,this.removeListeners=Za,this.controls=new hB(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Za}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ov=t=>(e,n)=>{t&&Ot.update(()=>t(e,n),!1,!0)};class gB extends vs{constructor(){super(...arguments),this.removePointerDownListener=Za}onPointerDown(e){this.session=new H5(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:V5(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:a,onPanEnd:r}=this.node.getProps();return{onSessionStart:ov(e),onStart:ov(n),onMove:ov(a),onEnd:(s,l)=>{delete this.session,r&&Ot.postRender(()=>r(s,l))}}}mount(){this.removePointerDownListener=bd(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let lv=!1;class vB extends k.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:a,layoutId:r}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),a&&a.register&&r&&a.register(s),lv&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),dp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:a,drag:r,isPresent:s}=this.props,{projection:l}=a;return l&&(l.isPresent=s,e.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),lv=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==s?l.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?l.promote():l.relegate()||Ot.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:a}=e;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),q0.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:r}=e;lv=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),a&&a.deregister&&a.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function G5(t){const[e,n]=I5(),a=k.useContext(T0);return R.jsx(vB,{...t,layoutGroup:a,switchLayoutGroup:k.useContext(B5),isPresent:e,safeToRemove:n})}const _B={pan:{Feature:gB},drag:{Feature:mB,ProjectionNode:D5,MeasureLayout:G5}};function Q2(t,e,n){const{props:a}=t;t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=a[r];s&&Ot.postRender(()=>s(e,su(e)))}class yB extends vs{mount(){const{current:e}=this.node;e&&(this.unmount=$z(e,(n,a)=>(Q2(this.node,a,"Start"),r=>Q2(this.node,r,"End"))))}unmount(){}}class bB extends vs{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=au(zd(this.node.current,"focus",()=>this.onFocus()),zd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function X2(t,e,n){const{props:a}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&a.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=a[r];s&&Ot.postRender(()=>s(e,su(e)))}class kB extends vs{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=Kz(e,(r,s)=>(X2(this.node,s,"Start"),(l,{success:c})=>X2(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const q_=new WeakMap,cv=new WeakMap,wB=t=>{const e=q_.get(t.target);e&&e(t)},xB=t=>{t.forEach(wB)};function PB({root:t,...e}){const n=t||document;cv.has(n)||cv.set(n,{});const a=cv.get(n),r=JSON.stringify(e);return a[r]||(a[r]=new IntersectionObserver(xB,{root:t,...e})),a[r]}function SB(t,e,n){const a=PB(e);return q_.set(t,n),a.observe(t),()=>{q_.delete(t),a.unobserve(t)}}const CB={some:0,all:1};class TB extends vs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:a,amount:r="some",once:s}=e,l={root:n?n.current:void 0,rootMargin:a,threshold:typeof r=="number"?r:CB[r]},c=u=>{const{isIntersecting:h}=u;if(this.isInView===h||(this.isInView=h,s&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),v=h?p:m;v&&v(u)};this.stopObserver=SB(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(EB(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function EB({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const AB={inView:{Feature:TB},tap:{Feature:kB},focus:{Feature:bB},hover:{Feature:yB}},RB={layout:{ProjectionNode:D5,MeasureLayout:G5}},LB={...eB,...AB,..._B,...RB},DB=YU(LB,ZU);function IB(){!Q0.current&&c5();const[t]=k.useState(Wp.current);return t}const kd=DB;function q5(t){var e,n,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=q5(t[e]))&&(a&&(a+=" "),a+=n)}else for(n in t)t[n]&&(a&&(a+=" "),a+=n);return a}function MB(){for(var t,e,n=0,a="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=q5(t))&&(a&&(a+=" "),a+=e);return a}const NB=(t,e)=>{const n=new Array(t.length+e.length);for(let a=0;a<t.length;a++)n[a]=t[a];for(let a=0;a<e.length;a++)n[t.length+a]=e[a];return n},OB=(t,e)=>({classGroupId:t,validator:e}),K5=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Zp="-",eP=[],jB="arbitrary..",zB=t=>{const e=UB(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return FB(l);const c=l.split(Zp),u=c[0]===""&&c.length>1?1:0;return Y5(c,u,e)},getConflictingClassGroupIds:(l,c)=>{if(c){const u=a[l],h=n[l];return u?h?NB(h,u):u:h||eP}return n[l]||eP}}},Y5=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],s=n.nextPart.get(r);if(s){const h=Y5(t,e+1,s);if(h)return h}const l=n.validators;if(l===null)return;const c=e===0?t.join(Zp):t.slice(e).join(Zp),u=l.length;for(let h=0;h<u;h++){const p=l[h];if(p.validator(c))return p.classGroupId}},FB=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),a=e.slice(0,n);return a?jB+a:void 0})(),UB=t=>{const{theme:e,classGroups:n}=t;return BB(n,e)},BB=(t,e)=>{const n=K5();for(const a in t){const r=t[a];rb(r,n,a,e)}return n},rb=(t,e,n,a)=>{const r=t.length;for(let s=0;s<r;s++){const l=t[s];$B(l,e,n,a)}},$B=(t,e,n,a)=>{if(typeof t=="string"){VB(t,e,n);return}if(typeof t=="function"){HB(t,e,n,a);return}WB(t,e,n,a)},VB=(t,e,n)=>{const a=t===""?e:Z5(e,t);a.classGroupId=n},HB=(t,e,n,a)=>{if(GB(t)){rb(t(a),e,n,a);return}e.validators===null&&(e.validators=[]),e.validators.push(OB(n,t))},WB=(t,e,n,a)=>{const r=Object.entries(t),s=r.length;for(let l=0;l<s;l++){const[c,u]=r[l];rb(u,Z5(e,c),n,a)}},Z5=(t,e)=>{let n=t;const a=e.split(Zp),r=a.length;for(let s=0;s<r;s++){const l=a[s];let c=n.nextPart.get(l);c||(c=K5(),n.nextPart.set(l,c)),n=c}return n},GB=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,qB=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),a=Object.create(null);const r=(s,l)=>{n[s]=l,e++,e>t&&(e=0,a=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=a[s])!==void 0)return r(s,l),l},set(s,l){s in n?n[s]=l:r(s,l)}}},K_="!",tP=":",KB=[],nP=(t,e,n,a,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:a,isExternal:r}),YB=t=>{const{prefix:e,experimentalParseClassName:n}=t;let a=r=>{const s=[];let l=0,c=0,u=0,h;const p=r.length;for(let x=0;x<p;x++){const P=r[x];if(l===0&&c===0){if(P===tP){s.push(r.slice(u,x)),u=x+1;continue}if(P==="/"){h=x;continue}}P==="["?l++:P==="]"?l--:P==="("?c++:P===")"&&c--}const m=s.length===0?r:r.slice(u);let v=m,y=!1;m.endsWith(K_)?(v=m.slice(0,-1),y=!0):m.startsWith(K_)&&(v=m.slice(1),y=!0);const b=h&&h>u?h-u:void 0;return nP(s,y,v,b)};if(e){const r=e+tP,s=a;a=l=>l.startsWith(r)?s(l.slice(r.length)):nP(KB,!1,l,void 0,!0)}if(n){const r=a;a=s=>n({className:s,parseClassName:r})}return a},ZB=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,a)=>{e.set(n,1e6+a)}),n=>{const a=[];let r=[];for(let s=0;s<n.length;s++){const l=n[s],c=l[0]==="[",u=e.has(l);c||u?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(l)):r.push(l)}return r.length>0&&(r.sort(),a.push(...r)),a}},JB=t=>({cache:qB(t.cacheSize),parseClassName:YB(t),sortModifiers:ZB(t),postfixLookupClassGroupIds:QB(t),...zB(t)}),QB=t=>{const e=Object.create(null),n=t.postfixLookupClassGroups;if(n)for(let a=0;a<n.length;a++)e[n[a]]=!0;return e},XB=/\s+/,e$=(t,e)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:s,postfixLookupClassGroupIds:l}=e,c=[],u=t.trim().split(XB);let h="";for(let p=u.length-1;p>=0;p-=1){const m=u[p],{isExternal:v,modifiers:y,hasImportantModifier:b,baseClassName:x,maybePostfixModifierPosition:P}=n(m);if(v){h=m+(h.length>0?" "+h:h);continue}let E=!!P,L;if(E){const j=x.substring(0,P);L=a(j);const S=L&&l[L]?a(x):void 0;S&&S!==L&&(L=S,E=!1)}else L=a(x);if(!L){if(!E){h=m+(h.length>0?" "+h:h);continue}if(L=a(x),!L){h=m+(h.length>0?" "+h:h);continue}E=!1}const T=y.length===0?"":y.length===1?y[0]:s(y).join(":"),A=b?T+K_:T,D=A+L;if(c.indexOf(D)>-1)continue;c.push(D);const B=r(L,E);for(let j=0;j<B.length;++j){const S=B[j];c.push(A+S)}h=m+(h.length>0?" "+h:h)}return h},t$=(...t)=>{let e=0,n,a,r="";for(;e<t.length;)(n=t[e++])&&(a=J5(n))&&(r&&(r+=" "),r+=a);return r},J5=t=>{if(typeof t=="string")return t;let e,n="";for(let a=0;a<t.length;a++)t[a]&&(e=J5(t[a]))&&(n&&(n+=" "),n+=e);return n},n$=(t,...e)=>{let n,a,r,s;const l=u=>{const h=e.reduce((p,m)=>m(p),t());return n=JB(h),a=n.cache.get,r=n.cache.set,s=c,c(u)},c=u=>{const h=a(u);if(h)return h;const p=e$(u,n);return r(u,p),p};return s=l,(...u)=>s(t$(...u))},a$=[],Sn=t=>{const e=n=>n[t]||a$;return e.isThemeGetter=!0,e},Q5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,X5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,r$=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,i$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,s$=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,o$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,l$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,c$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ts=t=>r$.test(t),ct=t=>!!t&&!Number.isNaN(Number(t)),Dr=t=>!!t&&Number.isInteger(Number(t)),dv=t=>t.endsWith("%")&&ct(t.slice(0,-1)),pi=t=>i$.test(t),e4=()=>!0,d$=t=>s$.test(t)&&!o$.test(t),ib=()=>!1,u$=t=>l$.test(t),h$=t=>c$.test(t),p$=t=>!Te(t)&&!Ae(t),f$=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),m$=t=>_s(t,a4,ib),Te=t=>Q5.test(t),Os=t=>_s(t,r4,d$),aP=t=>_s(t,x$,ct),g$=t=>_s(t,s4,e4),v$=t=>_s(t,i4,ib),rP=t=>_s(t,t4,ib),_$=t=>_s(t,n4,h$),Ch=t=>_s(t,o4,u$),Ae=t=>X5.test(t),$c=t=>xo(t,r4),y$=t=>xo(t,i4),iP=t=>xo(t,t4),b$=t=>xo(t,a4),k$=t=>xo(t,n4),Th=t=>xo(t,o4,!0),w$=t=>xo(t,s4,!0),_s=(t,e,n)=>{const a=Q5.exec(t);return a?a[1]?e(a[1]):n(a[2]):!1},xo=(t,e,n=!1)=>{const a=X5.exec(t);return a?a[1]?e(a[1]):n:!1},t4=t=>t==="position"||t==="percentage",n4=t=>t==="image"||t==="url",a4=t=>t==="length"||t==="size"||t==="bg-size",r4=t=>t==="length",x$=t=>t==="number",i4=t=>t==="family-name",s4=t=>t==="number"||t==="weight",o4=t=>t==="shadow",P$=()=>{const t=Sn("color"),e=Sn("font"),n=Sn("text"),a=Sn("font-weight"),r=Sn("tracking"),s=Sn("leading"),l=Sn("breakpoint"),c=Sn("container"),u=Sn("spacing"),h=Sn("radius"),p=Sn("shadow"),m=Sn("inset-shadow"),v=Sn("text-shadow"),y=Sn("drop-shadow"),b=Sn("blur"),x=Sn("perspective"),P=Sn("aspect"),E=Sn("ease"),L=Sn("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...A(),Ae,Te],B=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],S=()=>[Ae,Te,u],N=()=>[ts,"full","auto",...S()],U=()=>[Dr,"none","subgrid",Ae,Te],Q=()=>["auto",{span:["full",Dr,Ae,Te]},Dr,Ae,Te],ee=()=>[Dr,"auto",Ae,Te],ce=()=>["auto","min","max","fr",Ae,Te],le=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],te=()=>["auto",...S()],ie=()=>[ts,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],$=()=>[ts,"screen","full","dvw","lvw","svw","min","max","fit",...S()],X=()=>[ts,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],W=()=>[t,Ae,Te],O=()=>[...A(),iP,rP,{position:[Ae,Te]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ae=()=>["auto","cover","contain",b$,m$,{size:[Ae,Te]}],_e=()=>[dv,$c,Os],fe=()=>["","none","full",h,Ae,Te],ve=()=>["",ct,$c,Os],Ne=()=>["solid","dashed","dotted","double"],Oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ie=()=>[ct,dv,iP,rP],St=()=>["","none",b,Ae,Te],un=()=>["none",ct,Ae,Te],jt=()=>["none",ct,Ae,Te],_t=()=>[ct,Ae,Te],Jt=()=>[ts,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pi],breakpoint:[pi],color:[e4],container:[pi],"drop-shadow":[pi],ease:["in","out","in-out"],font:[p$],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pi],shadow:[pi],spacing:["px",ct],text:[pi],"text-shadow":[pi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ts,Te,Ae,P]}],container:["container"],"container-type":[{"@container":["","normal","size",Ae,Te]}],"container-named":[f$],columns:[{columns:[ct,Te,Ae,c]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[Dr,"auto",Ae,Te]}],basis:[{basis:[ts,"full","auto",c,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ct,ts,"auto","initial","none",Te]}],grow:[{grow:["",ct,Ae,Te]}],shrink:[{shrink:["",ct,Ae,Te]}],order:[{order:[Dr,"first","last","none",Ae,Te]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ce()}],"auto-rows":[{"auto-rows":ce()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...le(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...le()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":le()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mbs:[{mbs:te()}],mbe:[{mbe:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:ie()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...X()]}],"min-block-size":[{"min-block":["auto",...X()]}],"max-block-size":[{"max-block":["none",...X()]}],w:[{w:[c,"screen",...ie()]}],"min-w":[{"min-w":[c,"screen","none",...ie()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...ie()]}],h:[{h:["screen","lh",...ie()]}],"min-h":[{"min-h":["screen","lh","none",...ie()]}],"max-h":[{"max-h":["screen","lh",...ie()]}],"font-size":[{text:["base",n,$c,Os]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,w$,g$]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",dv,Te]}],"font-family":[{font:[y$,v$,e]}],"font-features":[{"font-features":[Te]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,Ae,Te]}],"line-clamp":[{"line-clamp":[ct,"none",Ae,aP]}],leading:[{leading:[s,...S()]}],"list-image":[{"list-image":["none",Ae,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,Te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[ct,"from-font","auto",Ae,Os]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[ct,"auto",Ae,Te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"tab-size":[{tab:[Dr,Ae,Te]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,Te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dr,Ae,Te],radial:["",Ae,Te],conic:[Dr,Ae,Te]},k$,_$]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:_e()}],"gradient-via-pos":[{via:_e()}],"gradient-to-pos":[{to:_e()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:ve()}],"border-w-x":[{"border-x":ve()}],"border-w-y":[{"border-y":ve()}],"border-w-s":[{"border-s":ve()}],"border-w-e":[{"border-e":ve()}],"border-w-bs":[{"border-bs":ve()}],"border-w-be":[{"border-be":ve()}],"border-w-t":[{"border-t":ve()}],"border-w-r":[{"border-r":ve()}],"border-w-b":[{"border-b":ve()}],"border-w-l":[{"border-l":ve()}],"divide-x":[{"divide-x":ve()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ve()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ne(),"hidden","none"]}],"divide-style":[{divide:[...Ne(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ct,Ae,Te]}],"outline-w":[{outline:["",ct,$c,Os]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",p,Th,Ch]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",m,Th,Ch]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[ct,Os]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":ve()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",v,Th,Ch]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[ct,Ae,Te]}],"mix-blend":[{"mix-blend":[...Oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Oe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ct]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ie()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":Ie()}],"mask-image-t-to-pos":[{"mask-t-to":Ie()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":Ie()}],"mask-image-r-to-pos":[{"mask-r-to":Ie()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":Ie()}],"mask-image-b-to-pos":[{"mask-b-to":Ie()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":Ie()}],"mask-image-l-to-pos":[{"mask-l-to":Ie()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":Ie()}],"mask-image-x-to-pos":[{"mask-x-to":Ie()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":Ie()}],"mask-image-y-to-pos":[{"mask-y-to":Ie()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[Ae,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ie()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[ct]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ie()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,Te]}],filter:[{filter:["","none",Ae,Te]}],blur:[{blur:St()}],brightness:[{brightness:[ct,Ae,Te]}],contrast:[{contrast:[ct,Ae,Te]}],"drop-shadow":[{"drop-shadow":["","none",y,Th,Ch]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",ct,Ae,Te]}],"hue-rotate":[{"hue-rotate":[ct,Ae,Te]}],invert:[{invert:["",ct,Ae,Te]}],saturate:[{saturate:[ct,Ae,Te]}],sepia:[{sepia:["",ct,Ae,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,Te]}],"backdrop-blur":[{"backdrop-blur":St()}],"backdrop-brightness":[{"backdrop-brightness":[ct,Ae,Te]}],"backdrop-contrast":[{"backdrop-contrast":[ct,Ae,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ct,Ae,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ct,Ae,Te]}],"backdrop-invert":[{"backdrop-invert":["",ct,Ae,Te]}],"backdrop-opacity":[{"backdrop-opacity":[ct,Ae,Te]}],"backdrop-saturate":[{"backdrop-saturate":[ct,Ae,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",ct,Ae,Te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ct,"initial",Ae,Te]}],ease:[{ease:["linear","initial",E,Ae,Te]}],delay:[{delay:[ct,Ae,Te]}],animate:[{animate:["none",L,Ae,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Ae,Te]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:un()}],"rotate-x":[{"rotate-x":un()}],"rotate-y":[{"rotate-y":un()}],"rotate-z":[{"rotate-z":un()}],scale:[{scale:jt()}],"scale-x":[{"scale-x":jt()}],"scale-y":[{"scale-y":jt()}],"scale-z":[{"scale-z":jt()}],"scale-3d":["scale-3d"],skew:[{skew:_t()}],"skew-x":[{"skew-x":_t()}],"skew-y":[{"skew-y":_t()}],transform:[{transform:[Ae,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Jt()}],"translate-x":[{"translate-x":Jt()}],"translate-y":[{"translate-y":Jt()}],"translate-z":[{"translate-z":Jt()}],"translate-none":["translate-none"],zoom:[{zoom:[Dr,Ae,Te]}],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ae,Te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":W()}],"scrollbar-track-color":[{"scrollbar-track":W()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ae,Te]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[ct,$c,Os,aP]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},S$=n$(P$);function $t(...t){return S$(MB(t))}const C$=R.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[R.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),R.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),R.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),R.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),T$=R.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:R.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),E$={google:C$,github:T$},A$={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function R$(t){return A$[t]||String(t||"").replace(/-/g," ")}function L$(t){if(typeof t=="string"&&t.trim())return t.trim();if(t&&typeof t=="object"){if(typeof t.token=="string"&&t.token.trim())return t.token.trim();if(typeof t.otp=="string"&&t.otp.trim())return t.otp.trim()}return""}function D$({title:t,subtitle:e,className:n="",onSuccess:a,hideLogo:r=!1,initialMode:s="signin",tokenFromUrl:l="",initialEmail:c="",initialCode:u=""}){Kl();const{enabled:h,signedIn:p,refreshUser:m,signInWithPassword:v,signUp:y,signInWithOAuth:b,getPublicAuthConfig:x,sendResetPasswordEmail:P,exchangeResetPasswordToken:E,resetPassword:L}=wo(),[T,A]=k.useState(s),[D,B]=k.useState(c),[j,S]=k.useState(""),[N,U]=k.useState(""),[Q,ee]=k.useState(""),[ce,le]=k.useState(u),[re,te]=k.useState(!1),[ie,$]=k.useState(null),[X,W]=k.useState(null),[O,Y]=k.useState(!1),[ae,_e]=k.useState(!!(s!=="signin"||c)),[fe,ve]=k.useState(!0),[Ne,Oe]=k.useState([]),[Ie,St]=k.useState(8);k.useEffect(()=>{s&&A(s)},[s]),k.useEffect(()=>{c&&B(c)},[c]),k.useEffect(()=>{u&&le(u)},[u]),k.useEffect(()=>{if(!h)return;let Xe=!0;return ve(!0),(async()=>{const{data:ot,error:Dt}=await x();if(Xe){if(Dt||!ot)Oe(["google","github"]);else{const Et=Array.isArray(ot.oAuthProviders)?ot.oAuthProviders:[],Nn=Array.isArray(ot.customOAuthProviders)?ot.customOAuthProviders:[];Oe([...Et,...Nn]),typeof ot.passwordMinLength=="number"&&ot.passwordMinLength>0&&St(ot.passwordMinLength)}ve(!1)}})(),()=>{Xe=!1}},[h,x]),k.useEffect(()=>{p&&a&&a()},[p,a]);const un=k.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),jt=k.useMemo(()=>typeof window>"u"?"/reset-password":`${window.location.origin}/reset-password`,[]),_t=k.useCallback(async Xe=>{$(null),te(!0);try{const{error:ot}=await b(Xe,un);ot&&$(ot.message||String(ot))}finally{te(!1)}},[b,un]);k.useEffect(()=>{if(!h||fe||p||typeof window>"u")return;const Xe=window.location.search;if(!Xe)return;const ot=new URLSearchParams(Xe),Dt=ot.get("native")==="1",Et=ot.get("provider");Dt&&Et&&[...Ne].includes(Et)&&_t(Et)},[h,fe,p,Ne,_t]);const Jt=k.useCallback(async Xe=>{Xe.preventDefault(),$(null),te(!0);try{if(T==="signup"){const{data:Dt,error:Et}=await y({email:D.trim(),password:j,name:Q.trim()||void 0});if(Et){$(Et.message||String(Et));return}if(Dt?.requireEmailVerification){W(we("login.verify_email_pending")),A("signin");return}await m();return}const{error:ot}=await v({email:D.trim(),password:j});if(ot){$(ot.message||String(ot));return}await m()}finally{te(!1)}},[T,D,j,Q,y,v,m]),nr=k.useCallback(async Xe=>{Xe.preventDefault(),$(null),te(!0);try{const ot=D.trim(),{error:Dt}=await P({email:ot,redirectTo:jt});if(Dt){$(Dt.message||String(Dt));return}B(ot),W(we("reset_password.request.sent")),A("reset_confirm")}finally{te(!1)}},[D,jt,P]),Mn=k.useCallback(async Xe=>{if(Xe.preventDefault(),$(null),j!==N){$(we("reset_password.error.password_mismatch"));return}te(!0);try{let ot=l;if(!ot){const{data:Et,error:Nn}=await E({email:D.trim(),code:ce.trim()});if(Nn){$(Nn.message||String(Nn));return}if(ot=L$(Et),!ot){$(we("reset_password.error.missing_token"));return}}const{error:Dt}=await L({newPassword:j,otp:ot});if(Dt){$(Dt.message||String(Dt));return}Y(!0),W(we("reset_password.success"))}finally{te(!1)}},[ce,N,D,E,j,L,l]);if(!h)return null;const Vt=T==="reset_email"||T==="reset_confirm";return R.jsxs("div",{className:$t("w-full bg-white dark:bg-oai-gray-950 p-6 transition-colors duration-200",n),children:[Vt&&R.jsxs("button",{type:"button",onClick:()=>{A("signin"),W(null),$(null),Y(!1),S(""),U("")},className:"flex items-center gap-1.5 text-xs font-medium text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors mb-4 focus:outline-none",children:[R.jsx(KN,{className:"h-3.5 w-3.5"}),we("reset_password.back_to_sign_in")]}),R.jsxs("div",{className:$t("mb-6",Vt?"text-left":"text-center"),children:[!r&&!Vt&&R.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[R.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),R.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white font-oai tracking-tight",children:we("shared.app_name")})]}),R.jsx("h2",{className:$t("text-sm font-semibold text-oai-black dark:text-white tracking-tight mb-1",(r||Vt)&&"text-base font-bold md:text-lg"),children:Vt?we("reset_password.title"):t||we("login_modal.subtitle")}),!Vt&&e&&R.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400 mt-1.5 leading-relaxed max-w-[320px] mx-auto",children:e}),Vt&&R.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400 mt-1.5 leading-relaxed max-w-[320px]",children:X&&T==="reset_confirm"&&!O?X:we("reset_password.subtitle")})]}),X&&(!Vt||O)&&R.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:X}),ie&&R.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400 text-center",role:"alert",children:ie}),T==="reset_email"&&R.jsxs("form",{onSubmit:nr,className:"space-y-3",children:[R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-reset-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("login.field.email")}),R.jsx("input",{id:"card-reset-email",type:"email",autoComplete:"email",required:!0,value:D,onChange:Xe=>B(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),R.jsx("button",{type:"submit",disabled:re,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:we("reset_password.request.submit")})]}),T==="reset_confirm"&&(O?R.jsx("button",{type:"button",onClick:()=>{A("signin"),Y(!1),W(null),$(null),S(""),U("")},className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors text-center shadow-sm",children:we("reset_password.success_cta")}):R.jsxs("form",{onSubmit:Mn,className:"space-y-3",children:[!l&&R.jsxs(R.Fragment,{children:[R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-reset-email-confirm",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("login.field.email")}),R.jsx("input",{id:"card-reset-email-confirm",type:"email",autoComplete:"email",required:!0,value:D,onChange:Xe=>B(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-reset-code",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("reset_password.field.code")}),R.jsx("input",{id:"card-reset-code",type:"text",inputMode:"numeric",autoComplete:"one-time-code",required:!0,value:ce,onChange:Xe=>le(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]})]}),R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-reset-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("reset_password.field.new_password")}),R.jsx("input",{id:"card-reset-password",type:"password",autoComplete:"new-password",required:!0,minLength:8,value:j,onChange:Xe=>S(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-reset-password-confirm",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("reset_password.field.confirm_password")}),R.jsx("input",{id:"card-reset-password-confirm",type:"password",autoComplete:"new-password",required:!0,minLength:8,value:N,onChange:Xe=>U(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),R.jsx("button",{type:"submit",disabled:re,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:we("reset_password.reset.submit")})]})),!Vt&&R.jsxs(R.Fragment,{children:[R.jsx("div",{className:"space-y-2.5 mb-5",children:fe?R.jsxs("div",{className:"space-y-2.5",children:[R.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"}),R.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"})]}):Ne.map(Xe=>R.jsxs("button",{type:"button",disabled:re,onClick:()=>_t(Xe),className:$t("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[E$[Xe]||null,we("login.oauth.continue",{provider:R$(Xe)})]},Xe))}),ae?R.jsxs(R.Fragment,{children:[R.jsxs("div",{className:"relative mb-5",children:[R.jsx("div",{className:"absolute inset-0 flex items-center",children:R.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),R.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:R.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:we("login_modal.divider_email")})})]}),R.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[R.jsx("button",{type:"button",className:$t("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",T==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{A("signin"),$(null)},children:we("login.tab.sign_in")}),R.jsx("button",{type:"button",className:$t("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",T==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{A("signup"),$(null)},children:we("login.tab.sign_up")})]}),R.jsxs("form",{onSubmit:Jt,className:"space-y-3",children:[T==="signup"&&R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("login.field.name")}),R.jsx("input",{id:"card-name",type:"text",autoComplete:"name",value:Q,onChange:Xe=>ee(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:we("login.field.name_placeholder")})]}),R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("login.field.email")}),R.jsx("input",{id:"card-email",type:"email",autoComplete:"email",required:!0,value:D,onChange:Xe=>B(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("login.field.password")}),R.jsx("input",{id:"card-password",type:"password",autoComplete:T==="signup"?"new-password":"current-password",required:!0,minLength:T==="signup"?Ie:void 0,value:j,onChange:Xe=>S(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),T==="signup"&&R.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:we("login.password_hint",{min:String(Ie)})}),T==="signin"&&R.jsx("div",{className:"mt-1 text-right",children:R.jsx("button",{type:"button",onClick:()=>{A("reset_email"),$(null),W(null)},className:"text-xs font-medium text-oai-gray-500 hover:text-oai-black dark:hover:text-white no-underline bg-transparent border-0 p-0 cursor-pointer focus:outline-none",children:we("login.forgot_password")})})]}),R.jsx("button",{type:"submit",disabled:re,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:we(T==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):R.jsxs(R.Fragment,{children:[R.jsxs("div",{className:"relative mb-5",children:[R.jsx("div",{className:"absolute inset-0 flex items-center",children:R.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),R.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:R.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:we("login.divider")})})]}),R.jsxs("button",{type:"button",onClick:()=>_e(!0),className:$t("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[R.jsx(lO,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),we("login_modal.continue_email")]})]})]})]})}function I$(){const{isOpen:t,closeLoginModal:e}=lT(),{enabled:n}=wo();return k.useEffect(()=>{if(!t)return;const a=r=>{r.key==="Escape"&&e()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t,e]),n?R.jsx(M5,{children:t&&R.jsxs(kd.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[R.jsx(kd.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60",onClick:e,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),R.jsxs(kd.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 shadow-2xl overflow-hidden",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:a=>a.stopPropagation(),children:[R.jsx("button",{type:"button",onClick:e,className:"absolute right-4 top-4 z-10 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:R.jsx(C0,{className:"h-5 w-5"})}),R.jsx(D$,{onSuccess:e,className:"p-6 bg-transparent"})]})]})}):null}const M$={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"},QY="https://tokentracker.statuspage.io/",N$="https://github.com/mm7894215/TokenTracker",l4=`${N$}/releases/latest`,XY=`${l4}/download/TokenTrackerBar.dmg`,eZ=`${l4}/download/TokenTracker-Setup.exe`;function O$(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const e=typeof import.meta<"u"?M$:void 0;return(e?.VITE_TOKENTRACKER_BACKEND_BASE_URL||e?.VITE_INSFORGE_BASE_URL||Yr()).trim()}function j$(){return Yr()}function z$(t=""){if(typeof t!="string"||t.length===0)return!1;const e=new URLSearchParams(t),n=String(e.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const F$=300*1e3,U$=720*60*1e3;function sb(t){return typeof t=="string"&&/^https?:\/\//i.test(t.trim())}function B$(t,e=Date.now()){if(!t?.token||!t?.deviceId||!t?.issuedAt)return!0;const n=Date.parse(t.issuedAt);return Number.isFinite(n)?n+U$<=e:!0}async function c4(t,e){const n=Yr();if(!sb(n)||!t)return;const a=n.replace(/\/$/,""),r=Gl(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${t}`};r&&(s.apikey=r);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:s,body:JSON.stringify({period:"week",source:e})})}catch{}}async function $$(){try{const t=await fetch("/functions/tokentracker-machine-id",{headers:{Accept:"application/json"},cache:"no-store"});if(t.ok){const e=await t.json().catch(()=>null),n=typeof e?.machineId=="string"?e.machineId.trim():null;if(n&&n.length>=8)return n}}catch{}return null}async function V$(t){const e=Yr();if(!sb(e)||!t)return null;const n=e.replace(/\/$/,""),a=Gl(),r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${t}`};a&&(r.apikey=a);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",l=await $$();if(!l)return null;const c=`Token Tracker (dashboard) #${l.slice(0,8)}`,u=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:r,body:JSON.stringify({device_name:c,platform:s,machine_id:l})});if(!u.ok)return null;const h=await u.json().catch(()=>null),p=typeof h?.token=="string"?h.token:null,m=typeof h?.device_id=="string"?h.device_id:null;return!p||!m?null:{token:p,deviceId:m,issuedAt:typeof h?.created_at=="string"?h.created_at:new Date().toISOString()}}async function sP(t){const{deviceToken:e,insforgeBaseUrl:n,drain:a}=t,r={deviceToken:e};a===!0&&(r.drain=!0);const s=n||Yr();sb(s)&&(r.insforgeBaseUrl=s.trim());const l=await eu(),c=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...l},body:JSON.stringify(r)}),u=await c.json().catch(()=>({}));if(!c.ok){const h=typeof u.error=="string"?u.error:`HTTP ${c.status}`;throw new Error(h)}return u}async function oP(t){const e=await t();if(!e)return null;const n=vC();if(n&&!B$(n))return n;const a=await V$(e);return a?(L7(a),a):null}async function d4(t,e={}){let n=await t();if(!n)return null;let a=await oP(async()=>n);if(!a)return n;try{return await sP({deviceToken:a.token,insforgeBaseUrl:Yr(),drain:e.drain===!0}),wx(),n}catch(r){if(!vC()||(_C(),n=await t(),!n)||(a=await oP(async()=>n),!a))throw r;return await sP({deviceToken:a.token,insforgeBaseUrl:Yr(),drain:e.drain===!0}),wx(),n}}async function H$(t){const e=D7(),n=v_();if(n&&Date.now()-e<F$)return;const a=await d4(t,{drain:!n});a&&(bC(Date.now()),await c4(a,"cloud-sync-auto"))}async function tZ(t){const e=await d4(t,{drain:!0});e&&(bC(Date.now()),await c4(e,"cloud-sync-now"))}function W$(t){const e=t.replace(/\/+$/,"")||"/";return e==="/share"||e==="/share.html"||e.startsWith("/share/")}function G$(t){const e=t.replace(/\/+$/,"")||"/";return e==="/login"||e==="/landing"||W$(e)?!1:e==="/"||e==="/dashboard"||e.startsWith("/leaderboard")}function q$(){const t=ya(),e=wo(),n=k.useRef(!1);k.useEffect(()=>{if(!Rp()||!G$(t.pathname||"/")||!e.enabled||!e.signedIn||e.loading||!Lp())return;let a=!1;const r=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await H$(()=>e.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(r)}},[t.pathname,e.enabled,e.signedIn,e.loading,e.getAccessToken])}function K$(){const t=k.useContext(sT);if(t===null)throw new Error("useTheme must be used within a ThemeProvider");return t}function Y$({prefersReducedMotion:t,screenshotCapture:e}){return!(e||t)}function Z$(t){if(!t||typeof t!="object")return null;const e=t.user_metadata&&typeof t.user_metadata=="object"?t.user_metadata:{},n=t.profile&&typeof t.profile=="object"?t.profile:{},a=e.avatar_url||e.picture||n.avatar_url||t.avatar_url;return typeof a=="string"&&a.trim()?a.trim():null}function J$(t){return t?Nf()?`/api/avatar-proxy?url=${encodeURIComponent(t)}`:t:null}function Eh(t){const e=String(t||"").trim();if(!e)return"?";const n=e.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function lP({className:t,variant:e="header",collapsed:n=!1,onAfterAction:a}){Kl();const r=e==="sidebar",{enabled:s,loading:l,signedIn:c,user:u,displayName:h}=wo(),{openLoginModal:p}=lT(),m=$l(),v=k.useMemo(()=>Z$(u),[u]),y=k.useMemo(()=>J$(v),[v]),[b,x]=lo.useState(!1);if(lo.useEffect(()=>{x(!1)},[y]),!s)return null;if(l)return R.jsx("div",{className:$t("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",t),"aria-hidden":!0});if(!c)return r?R.jsxs("button",{type:"button",onClick:()=>{p(),a?.()},className:$t("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] font-medium text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 min-w-0",n?"h-8 w-8 justify-center px-0":"w-full",t),"aria-label":we("header.auth.sign_in_aria"),title:n?we("header.auth.sign_in_aria"):void 0,children:[R.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:R.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&R.jsx("span",{className:"truncate flex-1 text-left",children:we("header.auth.sign_in_aria")})]}):R.jsx("button",{type:"button",onClick:p,className:$t("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-md px-4 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",t),"aria-label":we("header.auth.sign_in_aria"),children:we("header.auth.sign_in_aria")});const P=()=>{m("/settings"),a?.()};return R.jsx("div",{className:$t(r?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",t),children:R.jsxs("button",{type:"button",onClick:P,className:$t(r?$t("flex w-full items-center gap-2 rounded-md px-2 py-1.5 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 transition-colors min-w-0",n&&"justify-center px-0 py-0 h-9 w-9"):"flex items-center gap-2 rounded-md pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors"),"aria-label":we("header.auth.open_settings"),title:r&&n?h:void 0,children:[r?R.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:y&&!b?R.jsx("img",{src:y,alt:"",width:20,height:20,className:"h-5 w-5 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer",onError:()=>x(!0)}):Eh(h)==="?"?R.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:R.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-3 h-3 opacity-80",children:R.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):R.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600 text-[9px] font-semibold text-white ring-1 ring-oai-brand-500/50",children:Eh(h)})}):y&&!b?R.jsx("img",{src:y,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700 shrink-0",referrerPolicy:"no-referrer",onError:()=>x(!0)}):Eh(h)==="?"?R.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:R.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-4 h-4 opacity-80",children:R.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):R.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:Eh(h)}),r?!n&&R.jsx("span",{className:"truncate text-[13px] font-medium text-oai-gray-900 dark:text-oai-gray-200 flex-1 text-left min-w-0",children:h}):R.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:h})]})})}const Y_="tt.sidebarCollapsed";function u4(){return[{id:"general",label:we("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:QN,label:we("nav.usage")},{id:"limits",to:"/limits",icon:nO,label:we("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:EO,label:we("nav.leaderboard")},{id:"achievements",to:"/achievements",icon:ZN,label:we("nav.achievements")}]},{id:"tools",label:we("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:sO,label:we("nav.widgets")},{id:"pet",to:"/pet-settings",icon:mO,label:we("nav.pet")},{id:"skills",to:"/skills",icon:vO,label:we("nav.skills")},{id:"ip-check",to:"/ip-check",icon:rO,label:we("nav.ip_check")}]},{id:"account",label:we("nav.group.account"),items:[{id:"settings",to:"/settings",icon:xO,label:we("nav.settings")}]}]}function Q$(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Y_)==="1"}catch{return!1}}function X$(){const[t,e]=k.useState(Q$),n=k.useCallback(()=>{e(a=>{const r=!a;try{typeof window<"u"&&window.localStorage.setItem(Y_,r?"1":"0")}catch{}return r})},[]);return k.useEffect(()=>{if(typeof window>"u")return;const a=r=>{r.key===Y_&&e(r.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:t,toggle:n}}function eV(t,e){const n=t.replace(/\/+$/,"")||"/";return e==="/dashboard"?n==="/dashboard"||n==="/":e==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===e}function tV({label:t,collapsed:e,first:n}){return e?n?null:R.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):R.jsx("div",{className:$t("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:t})}function nV({item:t,collapsed:e,active:n,onClick:a}){const r=t.icon;return R.jsxs(Ef,{to:t.to,onClick:a,title:e?t.label:void 0,"aria-current":n?"page":void 0,className:$t("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",e&&"justify-center px-0 py-2",n?"bg-oai-gray-200/70 text-oai-black font-medium dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/50 hover:text-oai-black dark:hover:bg-oai-gray-800/60 dark:hover:text-white"),children:[R.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:R.jsx(r,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!e&&R.jsx("span",{className:"truncate",children:t.label})]})}function aV({as:t="button",title:e,onClick:n,href:a,children:r,className:s,...l}){const c=$t("flex h-10 w-10 items-center justify-center rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",s);return t==="a"?R.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:e,"aria-label":e,className:c,...l,children:r}):R.jsx("button",{type:"button",title:e,"aria-label":e,onClick:n,className:c,...l,children:r})}function rV({repo:t="mm7894215/TokenTracker",glassChrome:e=!1}){const[n,a]=k.useState(null);return k.useEffect(()=>{if(typeof window>"u")return;const r=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;Y$({prefersReducedMotion:r,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${t}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&a(s.stargazers_count)}).catch(()=>{})},[t]),R.jsxs("a",{href:`https://github.com/${t}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:$t("inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",e?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:[R.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:R.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),R.jsx("span",{children:"Star"}),n!==null&&R.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const iV=[{value:"light",label:"Light",Icon:iT},{value:"dark",label:"Dark",Icon:rT},{value:"system",label:"System",Icon:hO}];function sV({theme:t,resolvedTheme:e,onSetTheme:n,glassChrome:a=!1}){const[r,s]=k.useState(!1),l=k.useRef(null),c=e==="dark"?rT:iT;return k.useEffect(()=>{if(!r)return;const u=p=>{l.current&&!l.current.contains(p.target)&&s(!1)},h=p=>{p.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",h)}},[r]),R.jsxs("div",{ref:l,className:"relative",children:[R.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":r,"aria-haspopup":"menu",title:"Theme",onClick:()=>s(u=>!u),className:$t("inline-flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",a?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:R.jsx(c,{className:"h-3.5 w-3.5","aria-hidden":!0})}),r&&R.jsx("div",{role:"menu",className:"absolute bottom-full left-0 mb-2 z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg",children:iV.map(({value:u,label:h,Icon:p})=>{const m=t===u;return R.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(u),s(!1)},className:$t("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",m?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"),children:[R.jsx(p,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),R.jsx("span",{children:h})]},u)})})]})}function h4({collapsed:t,onToggleCollapsed:e,onItemClick:n,showCloseButton:a=!1,onClose:r,glassChrome:s=!1}){const c=ya()?.pathname||"/",{theme:u,resolvedTheme:h,setTheme:p}=K$(),{resolvedLocale:m}=Kl(),v=k.useMemo(()=>u4(),[m]);return R.jsxs(R.Fragment,{children:[R.jsx("div",{className:$t("px-2 pt-2 pb-2",t&&"flex justify-center"),children:a?R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("div",{className:"flex-1 min-w-0",children:R.jsx(lP,{variant:"sidebar",collapsed:t,onAfterAction:n})}),R.jsx("button",{type:"button",onClick:r,"aria-label":we("nav.close_menu"),title:we("nav.close_menu"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-500 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-gray-900 dark:hover:text-oai-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:R.jsx(C0,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):R.jsx(lP,{variant:"sidebar",collapsed:t,onAfterAction:n})}),R.jsx("nav",{"aria-label":we("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:v.map((y,b)=>R.jsxs("div",{className:"flex flex-col",children:[R.jsx(tV,{label:y.label,collapsed:t,first:b===0}),R.jsx("div",{className:"flex flex-col gap-0.5",children:y.items.filter(x=>!(x.to==="/widgets"&&Of())).map(x=>R.jsx(nV,{item:x,collapsed:t,active:eV(c,x.to),onClick:n},x.id))})]},y.id))}),R.jsxs("div",{className:$t("flex items-center px-2 py-3",t?"flex-col justify-center gap-2":"justify-between gap-2"),children:[R.jsx(sV,{theme:u,resolvedTheme:h,onSetTheme:p,glassChrome:s}),R.jsx("div",{className:"flex items-center gap-1.5",children:!t&&R.jsx(rV,{glassChrome:s})})]})]})}function oV({collapsed:t,onToggleCollapsed:e}){const n=k.useMemo(()=>typeof window>"u"?!1:Ga()||Nf(),[]);return R.jsx("aside",{"data-native-sidebar":!0,"aria-label":we("nav.aside_label"),className:$t("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",t?"w-[72px]":"w-[220px]"),children:R.jsx(h4,{collapsed:t,onToggleCollapsed:e,glassChrome:n})})}function lV({open:t,onClose:e}){return k.useEffect(()=>{if(!t)return;const n=a=>{a.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t,e]),k.useEffect(()=>{if(!t)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[t]),t?R.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[R.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:e,"aria-hidden":!0}),R.jsx("aside",{"aria-label":we("nav.aside_label"),className:"relative w-[260px] max-w-[80vw] flex flex-col bg-oai-white dark:bg-oai-gray-900 border-r border-oai-gray-200 dark:border-oai-gray-800 shadow-2xl",children:R.jsx(h4,{collapsed:!1,showCloseButton:!0,onClose:e,onItemClick:e})})]}):null}function cV({onOpenDrawer:t}){return R.jsxs("div",{className:"lg:hidden flex items-center justify-between gap-2 px-3 h-14 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[R.jsx(aV,{title:we("nav.menu"),onClick:t,children:R.jsx(dO,{className:"h-5 w-5","aria-hidden":!0})}),R.jsxs(Ef,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[R.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),R.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),R.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function dV({children:t}){const{collapsed:e,toggle:n}=X$(),[a,r]=k.useState(!1),s=k.useCallback(()=>r(!0),[]),l=k.useCallback(()=>r(!1),[]),c=k.useMemo(()=>typeof window>"u"?!1:Ga()||Nf(),[]);return R.jsxs("div",{className:$t("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",Of()&&"tt-native-glass-shell",c?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[c&&R.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),R.jsxs("div",{className:"flex-1 min-h-0 flex",children:[R.jsx(oV,{collapsed:e,onToggleCollapsed:n}),R.jsx(lV,{open:a,onClose:l}),R.jsx("div",{className:"flex-1 min-w-0 min-h-0 p-2 lg:pl-0 lg:pr-3 lg:pb-3 flex flex-col",children:R.jsxs("div",{className:$t("flex-1 min-h-0 flex flex-col bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",c?"tt-native-main-card":"rounded-2xl",!c&&"shadow-sm"),children:[R.jsx(cV,{onOpenDrawer:s}),R.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:t})]})})]})]})}function uV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function cP({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:e,children:R.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function hV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function pV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function fV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})})}function mV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function gV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function vV({size:t=16,className:e=""}){return R.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:[R.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),R.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function _V({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function dP({size:t=16,className:e=""}){return R.jsxs("svg",{width:t,height:t,viewBox:"0 0 64 60",fill:"none",className:e,"aria-hidden":"true",children:[R.jsx("path",{fill:"currentColor",d:"M37.2114 3.75318C37.6821 3.33106 37.7106 3.31457 38.0558 3.29385C38.6149 3.2531 39.1272 3.52199 39.9989 4.31564C42.0356 6.16652 44.8714 9.97183 46.6346 13.2212L47.3163 14.4819L48.2782 14.9605C49.2072 15.4299 50.7308 16.3923 51.3672 16.9085C51.655 17.1464 51.6956 17.1508 51.9947 17.0344C53.3454 16.5084 55.2803 17.206 56.9869 18.8432C58.5231 20.3155 59.9943 22.8312 60.558 24.9308C60.6403 25.2687 60.7493 25.9952 60.7891 26.5362C60.9177 28.4358 60.3092 29.9532 59.1362 30.64C58.8965 30.7784 58.8801 30.8158 58.8868 31.4132C58.9409 34.2583 58.1741 37.0985 56.6335 39.8679C54.8946 42.9773 51.7981 46.1938 47.6074 49.2243C45.357 50.8619 40.0323 53.964 37.6248 55.0532C31.8578 57.6496 27.2346 58.646 23.2188 58.154C20.8236 57.8638 18.1124 56.9287 16.5082 55.8433C16.086 55.5515 16.0191 55.5329 15.6966 55.6251C13.9793 56.1185 11.73 55.1053 9.81931 52.9844C9.05725 52.1366 7.82714 50.0548 7.42839 48.9409C6.50606 46.3339 6.68976 43.9816 7.91836 42.5767C8.23573 42.2149 8.2453 42.1995 8.17598 41.5912C8.06148 40.5951 8.00971 39.1206 8.06202 38.1692L8.10361 37.2803L6.76977 34.9212C4.70378 31.2451 3.3912 28.1582 2.88489 25.7998C2.61762 24.5066 2.63385 23.9324 2.96214 23.5078C3.16198 23.2515 3.81796 22.9866 4.60785 22.8407C6.59665 22.4917 10.9334 22.8076 15.7581 23.6595L16.259 23.7458L17.3608 22.7713C19.1891 21.1519 20.4038 20.244 22.6429 18.8478C24.9768 17.3876 27.6108 16.1858 30.577 15.2346L31.5295 14.9294L32.0526 13.5561C33.9257 8.61146 35.8437 4.96584 37.2114 3.75318ZM21.5208 29.0919C19.404 30.314 18.3453 30.9251 17.5676 31.6099C14.4179 34.3835 13.2414 38.777 14.5823 42.7537C14.9135 43.7357 15.5247 44.7942 16.7469 46.9111C17.9691 49.0279 18.5801 50.0865 19.2649 50.8643C22.0385 54.014 26.4316 55.1918 30.4084 53.8509C31.3904 53.5198 32.4489 52.9085 34.5657 51.6863L46.7442 44.6551C48.8613 43.4328 49.9205 42.8214 50.6983 42.1365C53.8479 39.363 55.0245 34.9695 53.6835 30.9927C53.3524 30.0107 52.7412 28.9522 51.519 26.8354C50.2968 24.7185 49.6858 23.66 49.0009 22.8822C46.2274 19.7325 41.8342 18.5547 37.8575 19.8956C36.8754 20.2267 35.8163 20.8383 33.6993 22.0606L21.5208 29.0919Z"}),R.jsx("g",{transform:"rotate(-30 22.6953 37.6011)",children:R.jsx("rect",{x:"22.6953",y:"37.6011",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})}),R.jsx("g",{transform:"rotate(-30 35.6748 30.1074)",children:R.jsx("rect",{x:"35.6748",y:"30.1074",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})})]})}function yV({size:t=16,className:e=""}){return R.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:e,children:[R.jsx("path",{d:"M5.938 12.835c.127-.039.285.02.373.143.028.038.036.092.046.14.003.014-.02.033-.04.05-.124-.098-.24-.194-.354-.291-.011-.01-.016-.027-.025-.042zM8.396 9.412c.195-.032.39-.06.588-.05a.54.54 0 01.148.026c.202.071.402.147.601.224.028.01.05.036.075.055l-.013.027a9.203 9.203 0 01-.26-.089c-.115-.038-.213-.077-.315-.098-.25-.05-.25-.046-.292-.014l.574.144c.275.139.55.276.823.417.042.022.09.057.107.098.026.06.063.076.117.072.066-.006.132-.017.213-.027l-.04.086c.051.08.142.02.216.064-.074.13-.247.09-.334.199l.061.074-.12.087c0 .106-.038.168-.306.243l.026.085-.196.042.07.124h-.25l-.007.137c-.081-.01-.161-.018-.244-.027l-.053.123c-.027-.008-.052-.011-.073-.023-.067-.038-.128-.056-.195.006-.019.017-.063.014-.093.008-.026-.006-.05-.029-.07-.042-.11.095-.11.095-.208.003-.057.046-.12.074-.186.011-.063.027-.123-.02-.178-.014-.07.007-.097-.035-.133-.07l-.13.033c-.013-.236-.194-.19-.34-.203.005-.072.05-.092.095-.094a.474.474 0 01.159.022c.164.05.32.12.496.138.203.021.405.029.601-.015.265-.059.52-.149.707-.365.049-.056.083-.127.117-.195.019-.038.02-.084-.02-.116a1.397 1.397 0 00-.382-.217c.024.12-.031.182-.115.221 0 .014-.004.025 0 .03.08.115.084.16-.007.267a1.39 1.39 0 01-.218.211.477.477 0 01-.641-.05 1.36 1.36 0 01-.133-.152c-.078-.107-.076-.108-.033-.236-.165-.08-.128-.226-.104-.364.008-.05.028-.096.049-.163-.04.014-.067.017-.087.032a.897.897 0 00-.316.357c-.007.016-.01.034-.02.047-.012.015-.034.038-.045.035-.02-.006-.037-.027-.05-.045-.008-.012-.007-.032-.012-.057h-.126l.053-.172a14.82 14.82 0 00-.039-.049l.11-.284c-.06.026-.091.044-.124.051-.03.007-.064 0-.095 0 0-.031-.01-.07.004-.092.149-.22.305-.428.593-.476z"}),R.jsx("path",{d:"M8.06 10.788c-.003-.038-.004-.075.037-.062.016.006.034.048.028.067-.01.04-.038.032-.064-.005z"}),R.jsx("path",{d:"M11.981.009c.226-.012.453-.011.679 0 .247.01.495.024.74.062.401.064.798.157 1.19.273.463.138.92.299 1.356.511a7.31 7.31 0 012.948 2.642c.292.469.536.963.739 1.479.219.556.446 1.11.623 1.683.204.654.329 1.326.458 1.997.097.504.182 1.01.29 1.511.156.722.329 1.44.494 2.16.186.812.4 1.615.63 2.415.102.355.193.713.282 1.072.11.436.202.876.254 1.323.031.278.066.557.073.837a7.56 7.56 0 01-.017.88c-.037.413-.1.818-.226 1.212a5.017 5.017 0 01-.915 1.649l-.13.156.018.023c.043-.023.088-.041.127-.068.2-.138.373-.307.531-.49.4-.46.721-.973.975-1.529a3.59 3.59 0 00.325-1.72c-.024-.424-.097-.834-.3-1.213-.013-.027-.015-.06-.03-.121.05.035.082.048.101.072.107.13.22.258.315.398.33.494.46 1.052.486 1.64a3.75 3.75 0 01-.47 1.97c-.36.655-.887 1.14-1.526 1.506-.193.111-.394.21-.595.308-.157.078-.248.211-.318.365a.522.522 0 00-.033.406.359.359 0 01.013.139c-.005.077-.077.155-.14.162-.054.006-.125-.043-.15-.116a1.206 1.206 0 01-.06-.233c-.04-.314-.155-.6-.308-.87a3.906 3.906 0 00-.73-.91 2.129 2.129 0 00-.897-.524 4.093 4.093 0 00-.692-.131c-.075-.008-.15-.04-.22.01.18.06.363.11.538.18.434.173.82.43 1.18.728.308.255.58.543.794.884.098.155.186.315.227.496.027.123.042.25.067.375.013.062-.002.109-.053.144-.047.033-.122.034-.163-.01a.455.455 0 01-.08-.14c-.03-.073-.038-.159-.078-.225a7.314 7.314 0 00-1.423-1.664c-.16-.137-.329-.26-.537-.323-.376-.114-.753-.203-1.15-.154-.213.025-.427.032-.64.053a1.6 1.6 0 00-.736.278 5.14 5.14 0 00-.834.72c-.329.342-.642.699-.955 1.055-.136.155-.264.319-.314.531a5.227 5.227 0 00-.012.051.096.096 0 01-.09.076h-.31c-.046 0-.082-.048-.072-.094.023-.108.045-.216.07-.324.075-.325.19-.635.368-.917.024-.039.04-.088.104-.08l.01.049.027.077c.28-.435.571-.834.996-1.135.283-.204.584-.378.89-.55a.196.196 0 00-.098-.002c-.162.043-.325.084-.485.134-.402.124-.764.33-1.11.566-.147.1-.298.193-.414.333a7.314 7.314 0 00-1.07 1.767.845.845 0 00-.04.12.075.075 0 01-.072.056h-.494c-.04 0-.062-.051-.036-.082.123-.14.246-.282.377-.415.275-.281.58-.532.777-.884.027-.048.063-.09.095-.135.238-.333.54-.607.818-.902.082-.086.175-.16.26-.24.029-.027.053-.057.079-.085l-.018-.025-.135.041c-.034.017-.07.031-.102.05-.248.144-.494.292-.743.433-.408.23-.825.439-1.209.711-.281.2-.591.358-.889.533-.02.012-.044.015-.08.028-.015-.135.143-.201.108-.336-.033.014-.064.02-.085.038-.111.096-.227.19-.328.296-.148.157-.284.325-.425.488-.125.143-.25.286-.373.431A.153.153 0 019.89 24H8.762a.316.316 0 00.016-.042c.028-.09.085-.172.083-.28-.091-.018-.162.001-.212.077a4.45 4.45 0 00-.136.215c-.01.016-.024.03-.042.03h-.093c-.019 0-.029-.022-.017-.037.071-.088.14-.178.209-.268.001-.002-.006-.012-.012-.024-.014.004-.03.006-.045.013-.176.09-.352.181-.527.274a.363.363 0 01-.168.042H5.202c-.026 0-.039-.036-.019-.053.21-.178.402-.374.558-.605.335-.496.538-1.047.667-1.629.004-.02-.003-.043-.006-.091-.037.048-.059.072-.076.1a1.943 1.943 0 01-.334.415c-.28.258-.59.448-.983.464-.297.012-.588 0-.865-.127-.46-.21-.722-.57-.794-1.072-.025-.17-.017-.171-.182-.219A3.513 3.513 0 011.97 20.6a2.286 2.286 0 01-.808-1.13 3.569 3.569 0 01-.16-1.245c.002-.034.016-.067.024-.1.032.023.046.043.05.066.033.153.059.308.096.46.086.355.257.664.516.92.258.256.571.419.91.532.358.118.717.138 1.07-.016a1.89 1.89 0 00.621-.452c.328-.348.533-.76.648-1.223.009-.034.005-.071.007-.11-.015.006-.026.006-.03.011-.031.05-.064.1-.093.152-.284.502-.679.887-1.196 1.135-.351.17-.718.255-1.11.159a1.607 1.607 0 01-.971-.64 2.006 2.006 0 01-.368-.924 2.903 2.903 0 01.02-.886c.05-.439.466-1.17.742-1.271-.02.063-.035.112-.053.16-.043.116-.097.227-.13.345a1.901 1.901 0 00-.05.82c.033.212.09.416.204.6.147.236.346.407.62.465.11.023.225.014.338.018a.576.576 0 00.386-.131c.164-.128.282-.292.366-.481.168-.375.24-.777.309-1.179.05-.296.093-.594.133-.893.039-.281.071-.563.104-.845.026-.232.048-.464.074-.696.024-.228.052-.455.076-.683.024-.227.047-.455.069-.683.013-.14.022-.28.034-.42l.037-.417c.022-.25.041-.5.065-.748.008-.082-.02-.132-.09-.177a2.46 2.46 0 01-.492-.418c-.1-.109-.188-.228-.282-.342-.035-.042-.056-.097-.116-.118a2.084 2.084 0 00.275.597c.06.092.131.176.196.265.063.086.182.115.234.226-.028.003-.046.01-.06.006a4.74 4.74 0 01-.22-.057 2.71 2.71 0 01-1.287-.819c-.435-.487-.656-1.076-.71-1.723a5.206 5.206 0 01.014-1.06c.072-.602.22-1.186.45-1.745.155-.376.338-.741.526-1.102.205-.393.466-.75.765-1.076.512-.559 1.104-1.024 1.726-1.448.717-.49 1.478-.898 2.277-1.233C8.244.828 8.767.632 9.31.494c.655-.166 1.31-.33 1.982-.415.229-.03.458-.058.688-.07zm-1.847 22.82c-.07.06-.147.111-.207.18-.238.27-.464.549-.668.869l-.044.108a.177.177 0 00.093-.057c.174-.19.351-.378.519-.574.104-.122.195-.255.288-.386.024-.034.03-.08.046-.12l-.027-.02zm1.65-3.695a5.51 5.51 0 00-.653.593l-.37.386a.963.963 0 01-.377.25 1.372 1.372 0 01-.467.09c-.044 0-.087.006-.151.012.028.058.043.097.064.131.15.242.301.482.45.724.136.22.276.438.399.666.068.125.105.267.156.404.077.027.14-.018.202-.048.29-.135.579-.274.867-.412.213-.101.437-.186.636-.31.347-.215.68-.455 1.018-.685.015-.01.026-.028.042-.046-.023-.019-.038-.037-.056-.044-.287-.111-.527-.3-.77-.482a5.319 5.319 0 01-.506-.42 1.757 1.757 0 01-.41-.653c-.019-.049-.045-.095-.075-.156zm-5.847.264c-.06.096-.097.194-.132.293a3.38 3.38 0 01-.555 1.01c-.2.25-.455.412-.762.493-.23.06-.464.076-.7.07-.048-.002-.097.002-.158.005.016.04.021.066.035.085.1.145.23.246.4.295.157.046.316.034.498.023.181-.037.343-.115.485-.234.238-.199.402-.454.536-.732.175-.363.264-.751.342-1.144.01-.053.008-.11.011-.164zm14.945-4.586c.008.029.016.057.027.107.024.155.051.31.072.464.03.219.067.437.078.657.017.344.027.689-.014 1.033-.037.315-.063.633-.116.946a6.153 6.153 0 01-.46 1.518c-.008.018-.01.039-.02.082.047-.03.077-.042.098-.064.085-.083.17-.167.248-.255.271-.305.458-.66.596-1.043.18-.498.228-1.011.145-1.531-.103-.65-.33-1.263-.597-1.881a9.055 9.055 0 00-.024-.055l-.033.022zM5.797 8.29a.26.26 0 00.018.153c.124.251.25.501.379.75.025.049.066.09.03.163-.284.06-.578.119-.88.255.059.038.097.06.132.087.042.032.112.058.09.12-.01.033-.075.048-.117.072.017.01.043.021.067.036.166.102.33.207.447.368.138.192.229.404.188.644-.079.469-.306.85-.69 1.132-.054.04-.106.083-.161.122a.243.243 0 00-.103.245.77.77 0 00.055.195c.083.196.22.35.375.492.083.076.159.164.222.257a.37.37 0 01.025.377c-.023.05-.05.099-.076.148-.03.06-.028.111.022.162.041.042.08.089.112.138.038.058.078.079.147.05a.486.486 0 01.333-.006c.16.046.302.126.444.21.13.077.264.149.4.219.067.035.14.05.219.026.071-.022.124.01.145.076.02.064-.003.108-.074.139-.07.03-.137.063-.209.088-.1.035-.201.073-.314.077-.013-.107.11-.088.127-.159-.206-.126-.643-.145-.801-.034.063.112.035.21-.096.313-.13-.1-.025-.202.002-.3a.209.209 0 00-.249.17c-.015.101.067.216.178.224.108.007.218-.005.326-.012.06-.005.12-.027.199 0-.103.123-.248.127-.357.19.002.05.07.086.019.131-.053.048-.095-.001-.132-.03-.08-.063-.16-.126-.231-.197a.474.474 0 01-.157-.311.52.52 0 00-.043-.172c-.032-.074-.032-.137.033-.19-.018-.03-.028-.053-.045-.072a1.222 1.222 0 01-.196-.369c-.053-.137-.046-.264.048-.381.024-.03.05-.06.064-.095a.664.664 0 00.047-.168c.017-.165-.064-.287-.182-.387-.186-.156-.36-.322-.46-.551-.005-.011-.024-.017-.037-.026-.011.017-.024.027-.025.038-.019.185-.045.37-.052.557-.014.377.058.743.162 1.104.118.41.289.798.488 1.173.267.502.537 1.002.812 1.5.055.098.13.189.208.27.198.202.452.272.724.273.202 0 .404-.006.605-.026.295-.03.59-.073.884-.113.183-.025.365-.057.548-.08.21-.026.38.073.522.21.16.156.305.327.447.5.22.265.397.56.554.867.05.098.07.1.147.03.13-.121.26-.242.394-.36.067-.059.088-.12.067-.213a3.535 3.535 0 01-.085-.796c.002-.157.006-.314.018-.471.015-.224.03-.45.06-.672a59.114 59.114 0 01.362-2.298c.087-.493.182-.984.268-1.477.06-.347.118-.694.162-1.043.034-.273.055-.55.063-.825.011-.332.003-.665.002-.998 0-.077.004-.155-.01-.23-.028-.142-.01-.155-.162-.19a5.826 5.826 0 00-.607-.107c-.146-.018-.207-.053-.221-.19-.006-.049-.025-.098-.041-.146-.009-.025-.024-.048-.046-.09l-.025.264c-.009.096-.029.116-.127.115-.055 0-.11-.008-.164-.008-.476 0-.952-.008-1.426.032-.095.008-.173-.015-.226-.103-.04-.066-.088-.126-.134-.186-.063-.084-.086-.093-.182-.06-.195.068-.388.138-.582.21a2.71 2.71 0 00-.675.394.986.986 0 01-.323.168c-.033.01-.07.008-.127.013.02-.066.024-.114.047-.15.064-.105.135-.205.205-.306.023-.033.049-.063.073-.095l-.015-.023-.201.037c-.146.04-.296.07-.437.122-.148.053-.266.023-.386-.072a3.623 3.623 0 01-.733-.786l-.093-.132zm8.592 8.963l-.147.09c-.22.134-.44.266-.659.402-.093.058-.184.12-.27.188-.085.07-.124.161-.072.272.047.1.093.2.147.294.047.08.124.138.213.147.11.01.228.012.336-.012.217-.05.372-.205.528-.357a.291.291 0 00.087-.308c-.046-.18-.079-.365-.118-.547-.011-.052-.027-.103-.045-.169zm-.257-2.409c-.12.291-.205.597-.325.91-.151.433-.294.87-.435 1.323.036-.01.054-.01.067-.018.261-.16.522-.324.785-.484.054-.033.071-.078.065-.138-.012-.13-.024-.262-.034-.393l-.068-.886c-.008-.103-.02-.206-.029-.31-.009 0-.017-.002-.026-.004zm3.081-8.13l.099.285c.08.231.159.463.24.714l.58 1.952c.187.63.372 1.262.558 1.893.114.382.235.762.343 1.146.072.257.126.519.186.799.044.206.087.413.127.64.034.106.023.226.077.325l.025-.006-.068-.362c-.038-.206-.077-.412-.113-.638-.015-.07-.029-.141-.046-.211-.095-.396-.177-.796-.29-1.187-.196-.685-.413-1.364-.618-2.046-.165-.549-.322-1.1-.488-1.648-.069-.227-.15-.45-.226-.695l-.117-.336c-.037-.107-.075-.216-.115-.322-.04-.106-.084-.21-.127-.314a7.558 7.558 0 01-.027.01zM6.225 14.304c-.063-.001-.115.014-.134.083a.35.35 0 00.41.012 4.533 4.533 0 00-.276-.095zM5.23 11.98c-.026-.027-.057-.048-.075.002-.012.032-.007.07-.01.113.082-.037.082-.037.085-.115zm.062-1.189a.135.135 0 00-.088.056.197.197 0 00-.025.11c.005.152.01.306.026.457a.751.751 0 00.066.218c.061.136.157.167.288.101.055-.027.06-.054.025-.11a4.52 4.52 0 01-.129-.211c-.015-.068-.066-.131-.033-.207.04-.09-.076-.116-.074-.19V10.874c-.003-.038-.006-.087-.056-.083zm-.017-.968a.867.867 0 00-.467.127c-.076.045-.084.07-.05.158.034.087.07.173.115.254.064.117.09.125.21.077a.657.657 0 01.336-.053c.202.022.357.136.504.264l.092.077c.007-.006.014-.013.022-.018-.019-.105-.035-.226-.149-.264-.157-.053-.324-.075-.508-.117l-.24-.005c.24-.169.452-.044.687.009-.063-.115-.153-.147-.23-.193-.082-.05-.17-.092-.25-.144-.06-.037-.12-.08-.072-.172zm10.233.325c-.23-.01-.427.08-.608.211-.034.026-.06.065-.105.117.087.026.15.046.232.065.044-.015.088-.03.13-.046.306-.114.61-.115.904.031.126.063.237.04.366-.005-.02-.031-.03-.054-.045-.071a.986.986 0 00-.448-.273c-.14-.044-.284-.024-.426-.03zM7.99 6.483a.308.308 0 00.002.133c.08.321.156.643.242.962.104.387.27.75.456 1.103.02.037.061.08.098.087a.404.404 0 00.253-.051l-.472-.84c-.23-.448-.405-.92-.579-1.394zM10.397.497c-.2-.008-.405.004-.603.034-.236.035-.47.087-.7.152-.287.08-.569.18-.852.273-.04.013-.074.038-.11.058.028.014.05.018.07.014.287-.068.58-.085.873-.09.134-.002.269.009.402.025.19.024.382.048.57.09.456.104.874.3 1.265.556.464.306.888.66 1.257 1.078.205.232.395.475.56.739.17.274.315.561.449.856.273.601.456 1.232.6 1.876.04.173.07.348.1.524.017.104.065.167.17.19.122.028.2.105.22.251-.003.102-.06.174-.129.24a1.065 1.065 0 00-.268.358.164.164 0 00.083-.039c.08-.086.162-.172.235-.265a.56.56 0 00.13-.333c.009-.05.022-.1.024-.15.007-.124-.017-.15-.143-.168-.025-.004-.049-.014-.073-.015-.082-.007-.125-.063-.137-.131-.033-.198-.004-.355.247-.408.086-.018.174-.03.26-.042.158-.023.315-.053.473-.067.14-.012.19.033.226.167.008.029.018.057.021.087.019.179-.008.225-.141.288-.027.013-.055.024-.078.042a.148.148 0 00-.051.067c-.039.144.073.382.206.445l.673.32c.023.011.05.015.075.023l.018-.026c-.015-.008-.032-.013-.044-.024a2.27 2.27 0 00-.544-.32 4.898 4.898 0 00-.173-.075.203.203 0 01-.126-.191c-.003-.085.045-.154.128-.187l.059-.025c.099-.044.118-.076.112-.187a.384.384 0 00-.008-.063c-.067-.294-.123-.59-.205-.88a9.478 9.478 0 00-.826-2.036 7.465 7.465 0 00-1.39-1.805 4.536 4.536 0 00-1.177-.824 3.656 3.656 0 00-1.016-.328 6.155 6.155 0 00-.712-.074zm6.719 5.955c.01.014.018.028.038.034l-.022-.044-.016.01zM4.103 3.917a.062.062 0 01-.03.012.455.455 0 01-.04.039c-.01.01-.02.02-.045.04l-.363.354c-.088.085-.17.178-.266.253-.284.22-.425.53-.544.855a.132.132 0 00-.007.071c.013.055.033.108.052.168l.074.026c-.017.056-.03.105-.047.152-.058.164-.118.327-.175.491-.005.015.008.036.019.077.08-.175.158-.33.225-.489.228-.544.484-1.074.819-1.561.09-.133.182-.266.283-.401.004-.006.007-.013.022-.03.001-.016.003-.032.015-.04l.008-.017zm12.976 2.408a.023.023 0 01.009.019.073.073 0 00-.006.01.188.188 0 00.007.02l.018.022c.002-.007.007-.016.005-.021-.003-.01-.012-.018-.02-.038a1.331 1.331 0 01-.013-.012zM4.199 4.48c-.003.004-.008.008-.027.014-.005.013-.011.025-.031.047a2.085 2.085 0 01-.124.167c-.048.07-.116.055-.181.041-.134-.028-.228.016-.287.143-.089.187-.187.37-.273.56-.049.108-.11.216-.118.36.081.003.154.007.228.008h.228a2.563 2.563 0 01-.079.264c-.01.052-.022.103-.033.155l.02.004c.018-.046.037-.092.067-.153.066-.142.13-.285.2-.426.02-.04.034-.1.116-.092 0 .043.004.084 0 .124-.005.045-.017.09-.028.143.141.043.086.174.115.269.102-.022.104-.195.248-.144v.205l.017.002.439-1.059c-.13 0-.246-.02-.358.033-.024.011-.058-.001-.108-.004.075-.15.139-.278.211-.417a.128.128 0 01.025-.036c0-.015-.001-.03.008-.038l.006-.02c-.005.006-.01.011-.028.017-.004.012-.009.024-.026.045a.085.085 0 01-.032.033c-.123.157-.09.164-.258.106-.079-.027-.078-.028-.047-.144.028-.046.056-.093.098-.15 0-.016-.001-.032.007-.042L4.2 4.48zm2.073-.67c-.003.006-.007.011-.027.016-.094.125-.194.246-.28.377-.155.238-.301.481-.451.723-.14.224-.345.368-.575.481-.017.008-.04.006-.079.011.012-.059.016-.109.033-.153a6.076 6.076 0 01.229-.518l-.007-.02a.138.138 0 01-.035.025c-.028.05-.055.1-.093.164-.26.424-.443.817-.442.95.024.004.048.011.073.013.177.013.188.007.26-.165.03-.07.077-.12.147-.15l.175-.07c.044-.018.085-.057.146-.032.003.05-.01.11.014.145.042.062.044.125.047.193.002.049.017.098.026.147.029-.034.039-.065.05-.097.142-.39.277-.782.428-1.17.1-.256.22-.504.33-.756.013-.03.013-.067.03-.092V3.81zm3.987-.34c0 .045.01.084.021.123.042.16.094.318.124.48.024.133.023.27.028.406 0 .033-.019.067-.032.11-.094-.058-.047-.158-.106-.215h-.125c-.015.072-.01.152-.046.2-.066.085-.155.154-.236.227-.043.038-.078.018-.103-.025l-.046-.087c-.065.035-.117.069-.172.093-.116.051-.235.095-.35.147-.085.038-.09.053-.07.147.014.075.034.148.047.223.013.072.05.109.123.124.233.05.462.115.657.265.058-.102.058-.102.168-.151.03-.014.06-.03.092-.042.08-.03.115-.017.15.06.023.048.041.098.066.158.06-.14-.042-.267.017-.416.157.18.24.39.375.567a.235.235 0 00.022-.098c.002-.124 0-.247.002-.371 0-.034.013-.067.02-.1l.032-.003c.11.155.13.354.226.52a3.036 3.036 0 00-.01-.392c-.004-.045 0-.074.05-.088.08.036.116.14.215.158-.03-.275-.423-1.137-.798-1.635-.114-.127-.2-.28-.34-.386zm-2.667.696c-.019.034-.03.05-.037.067-.061.185-.125.37-.18.556-.031.105-.087.169-.195.19-.09.019-.178.052-.268.073-.038.009-.089.015-.118-.003-.024-.016-.025-.069-.036-.106-.064.076-.082.087-.17.047-.133-.062-.262-.135-.393-.201-.048-.025-.093-.063-.17-.03-.043.12-.091.25-.137.382-.099.28-.087.242.095.453.046.048.102.03.154.023.054-.009.106-.03.16-.036.13-.013.26-.08.367-.015.204-.064.387-.122.571-.178.05-.015.089.005.114.054.022.042.034.093.082.121.038-.056-.013-.128.063-.178l.14.241-.042-1.46zm.278.358c-.096-.01-.107.01-.11.108-.002.038-.003.078.002.115.03.2.099.386.174.57.002.006.012.01.022.015l.078-.05c.052.036.081.088.153.088.205-.002.41.014.616.012.099-.001.158.042.205.12.018.03.024.077.088.066l-.08-.394c-.05-.195-.085-.395-.172-.589-.057.057-.114.068-.18.046a.72.72 0 00-.135-.028c-.22-.028-.44-.059-.66-.08zm10.254-1.727c.089.163.155.316.139.491-.016.168.026.342-.044.516-.047-.033-.088-.082-.112-.075-.117.035-.164-.057-.227-.115a4.772 4.772 0 01-.286-.29l-.104-.113a4.856 4.856 0 01-.023.019c.035.046.07.093.11.156.04.064.084.127.122.193.034.058.065.118.031.205-.082-.01-.164-.019-.246-.032-.06-.01-.101 0-.124.07-.031.098-.037.096-.15.09.02.042.036.08.057.116.041.074.03.138-.03.196-.06.06-.118.122-.178.181a.175.175 0 01-.185.046c-.222-.061-.447-.113-.67-.174-.032-.009-.063-.04-.086-.068-.03-.04-.052-.087-.08-.13-.044-.07-.09-.138-.136-.207a.18.18 0 00-.014.105c.012.127.03.253.035.38.005.1-.024.12-.121.104-.104-.017-.206-.04-.31-.058-.064-.012-.131-.028-.202.03l.081.208c.09 0 .166-.01.237.002a.819.819 0 01.458.251c.078.083.154.168.241.26l.018-.005c-.004-.006-.008-.013-.01-.04.014-.056-.062-.118.018-.178.031.03.064.057.088.09.058.078.111.159.169.257l.089.141.024-.013a2093.819 2093.819 0 01-.427-.934c.055.007.083.007.108.016.193.07.385.142.577.216.074.028.147.06.219.094.062.028.112.018.157-.033.05-.056.102-.112.154-.167.05-.051.095-.046.132.014.016.025.026.053.04.08.071.138.143.277.217.433l.159.308.025-.011c-.044-.106-.07-.218-.138-.334-.057-.182-.168-.346-.206-.545.136.034.362.326.567.732l.057.074.018-.011a1.563 1.563 0 01-.052-.127c-.046-.145-.097-.29-.136-.436-.022-.083-.036-.173.022-.26l.109.058-.026-.207.027-.016c.022.02.05.036.065.06.073.108.143.22.215.33.01.016.029.029.043.043-.036-.217-.2-.38-.229-.626l.155.112c.014-.166.012-.319.042-.465.032-.158-.023-.297-.063-.445.024.004.036.006.055.025.092.124.183.249.277.371.02.027.05.047.069.087l.04.063.019-.015a.293.293 0 01-.053-.082 27.922 27.922 0 01-.332-.49c-.221-.311-.363-.467-.485-.521zm-6.57.327c-.003.161.092.275.069.415l-.368.087c.09.139.032.237-.052.331-.05.057-.092.122-.143.178-.037.04-.046.078-.018.126l.16.275c.029.048.072.066.128.064.076-.003.152 0 .228-.001.116-.003.216.022.275.137.006.014.02.024.044.052.004-.059-.003-.098.01-.13.016-.04.04-.099.072-.108.084-.023.173-.024.26-.03.013-.001.027.018.04.029l.071.065c.019-.11-.082-.198-.024-.31l.126.04c-.026-.123-.07-.245-.071-.366 0-.123.051-.243.115-.36.107.062.16.156.234.253.183.265.36.533.494.834.165-.078.27.068.407.088-.003-.106-.133-.441-.197-.492a.142.142 0 00-.102-.028c-.06.011-.119.039-.191.063-.025-.039-.056-.078-.077-.122a3.936 3.936 0 00-.473-.783c-.076-.094-.16-.182-.228-.26l-.391.285c-.049.035-.094.03-.132-.017l-.169-.207c-.025-.03-.053-.059-.097-.108z"})]})}function bV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"currentColor",className:e,children:R.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function kV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:e,children:R.jsx("path",{d:"M23.955 13.587l-1.342-4.135-2.664-8.189c-.135-.423-.73-.423-.867 0L16.418 9.45H7.582L4.919 1.263c-.135-.423-.73-.423-.867 0L1.388 9.452.045 13.587a.924.924 0 0 0 .331 1.03L12 23.054l11.625-8.436a.92.92 0 0 0 .33-1.031"})})}function wV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":"true",children:R.jsx("g",{transform:"translate(3.4502, 3)",fill:"#9570BE",children:R.jsx("path",{d:"M3.17890888,3.6 L3.17890888,0 L16,0 L16,3.6 L3.17890888,3.6 Z M9.642,7.2 L9.64218223,10.8 L0,10.8 L0,3.6 L16,3.6 L16,7.2 L9.642,7.2 Z M3.17890888,18 L3.178,14.4 L0,14.4 L0,10.8 L16,10.8 L16,18 L3.17890888,18 Z",fillRule:"nonzero"})})})}function xV({size:t=16,className:e=""}){return R.jsxs("svg",{width:t,height:t,viewBox:"0 0 120 90",fill:"currentColor",className:e,children:[R.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),R.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),R.jsx("rect",{x:"75",y:"20",width:"12",height:"45",rx:"2"}),R.jsx("rect",{x:"71",y:"55",width:"20",height:"16",rx:"3"}),R.jsx("rect",{x:"76",y:"71",width:"3",height:"8",rx:"1"}),R.jsx("rect",{x:"82",y:"71",width:"3",height:"8",rx:"1"})]})}function PV({size:t=16,className:e=""}){return R.jsxs("svg",{width:t,height:t,viewBox:"0 0 120 90",fill:"currentColor",className:e,children:[R.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),R.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),R.jsx("rect",{x:"83",y:"20",width:"12",height:"62",rx:"2"})]})}function SV({size:t=16,className:e=""}){return R.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[R.jsx("path",{d:"M9 3v2"}),R.jsx("path",{d:"M15 3v2"}),R.jsx("rect",{x:"4",y:"6",width:"16",height:"13",rx:"3"}),R.jsx("circle",{cx:"9",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),R.jsx("circle",{cx:"15",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),R.jsx("path",{d:"M9 16h6"})]})}function CV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"})})}function TV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M20.113 5.5l-.442 1.557a.157.157 0 01-.196.106l-7.414-2.157a.16.16 0 00-.143.028l-7.342 5.74a.159.159 0 01-.074.032l-4.37.656a.154.154 0 00-.132.162l.02.245c.005.078.071.14.152.141l5.074.128.058.002 3.75-1.953a.16.16 0 01.164.01l2.657 1.847a.152.152 0 01.066.125l-.023 2.45c0 .032.01.063.028.089l3.737 5.227c.03.04.077.065.129.065h1.182a.153.153 0 00.14-.224l-2.664-4.919a.15.15 0 01.005-.152l1.389-2.169a.156.156 0 01.062-.055l4.965-2.456a.16.16 0 01.158.01l1.418.921a.16.16 0 00.087.026h1.289c.125 0 .2-.136.13-.237l-3.578-5.29c-.074-.109-.246-.082-.282.044z"})})}function EV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M21.595 23.61c1.167-.254 2.405-.944 2.405-.944l-2.167-1.784a12.124 12.124 0 01-2.695-3.131 12.127 12.127 0 00-3.97-4.049l-.794-.462a1.115 1.115 0 01-.488-.815.844.844 0 01.154-.575c.413-.582 2.548-3.115 2.94-3.44.503-.416 1.065-.762 1.586-1.159.074-.056.148-.112.221-.17.003-.002.007-.004.009-.007.167-.131.325-.272.45-.438.453-.524.563-.988.59-1.193-.061-.197-.244-.639-.753-1.148.319.02.705.272 1.056.569.235-.376.481-.773.727-1.171.165-.266-.08-.465-.086-.471h-.001V3.22c-.007-.007-.206-.25-.471-.086-.567.35-1.134.702-1.639 1.021 0 0-.597-.012-1.305.599a2.464 2.464 0 00-.438.45l-.007.009c-.058.072-.114.147-.17.221-.397.521-.743 1.083-1.16 1.587-.323.391-2.857 2.526-3.44 2.94a.842.842 0 01-.574.153 1.115 1.115 0 01-.815-.488l-.462-.794a12.123 12.123 0 00-4.049-3.97 12.133 12.133 0 01-3.13-2.695L1.332 0S.643 1.238.39 2.405c.352.428 1.27 1.49 2.34 2.302C1.58 4.167.73 3.75.06 3.4c-.103.765-.063 1.92.043 2.816.726.317 1.961.806 3.219 1.066-1.006.236-2.11.278-2.961.262.15.554.358 1.119.64 1.688.119.263.25.52.39.77.452.125 2.222.383 3.164.171l-2.51.897a27.776 27.776 0 002.544 2.726c2.031-1.092 2.494-1.241 4.018-2.238-2.467 2.008-3.108 2.828-3.8 3.67l-.483.678c-.25.351-.469.725-.65 1.117-.61 1.31-1.47 4.1-1.47 4.1-.154.486.202.842.674.674 0 0 2.79-.861 4.1-1.47.392-.182.766-.4 1.118-.65l.677-.483c.227-.187.453-.37.701-.586 0 0 1.705 2.02 3.458 3.349l.896-2.511c-.211.942.046 2.712.17 3.163.252.142.509.272.772.392.569.28 1.134.49 1.688.64-.016-.853.026-1.956.261-2.962.26 1.258.75 2.493 1.067 3.219.895.106 2.051.146 2.816.043a73.87 73.87 0 01-1.308-2.67c.811 1.07 1.874 1.988 2.302 2.34h-.001z"})})}function AV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M0 0v24h24V0H0zm22.222 22.222H1.778V1.778h20.444v20.444zm-7.555-4.964h2.222v1.778h-2.794L12.89 17.83v-2.794h1.778v2.222zm4 0h-1.778v-2.222h-2.222v-1.778h2.793l1.207 1.207v2.793zm-7.556-2.591H9.333v-1.778h1.778v1.778zm-5.778-1.778h1.778v4h4v1.778H6.54L5.333 17.46V12.89zm13.334-3.556v1.778h-5.778V9.333h1.987V7.111h-1.987V5.333h2.558l1.206 1.207v2.793h2.014zm-11.556-2h2.222l1.778 1.778v2H9.333v-2H7.111v2H5.333V5.333h1.778v2zm4 0H9.333v-2h1.778v2z"})})}function RV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:e,children:R.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.125 2.75C2.9179 2.75 2.75 2.9179 2.75 3.125V11.375H2V3.125C2 2.50368 2.50368 2 3.125 2H13.1723C13.6735 2 13.9244 2.6059 13.5701 2.96025L7.38189 9.14843H9.125V8.375H9.875V9.33593C9.875 9.6466 9.6232 9.8984 9.3125 9.8984H6.63189L5.34282 11.1875H11.1875V6.5H11.9375V11.1875C11.9375 11.6017 11.6017 11.9375 11.1875 11.9375H4.59282L3.28032 13.25H12.875C13.0821 13.25 13.25 13.0821 13.25 12.875V4.625H14V12.875C14 13.4963 13.4963 14 12.875 14H2.82767C2.32653 14 2.07557 13.3941 2.42992 13.0397L8.59468 6.875H6.875V7.625H6.125V6.6875C6.125 6.37684 6.37684 6.125 6.6875 6.125H9.34468L10.6571 4.8125H4.8125V9.5H4.0625V4.8125C4.0625 4.39829 4.39829 4.0625 4.8125 4.0625H11.4071L12.7197 2.75H3.125Z"})})}function LV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",className:e,children:R.jsx("path",{d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"})})}const DV={CLAUDE:uV,ZCODE:CV,CODEBUDDY:dP,WORKBUDDY:dP,CODEX:cP,COPILOT:_V,CRAFT:wV,CURSOR:hV,DEEPSEEK:LV,DROID:SV,"EVERY-CODE":cP,GEMINI:pV,GITHUB:bV,GITLAB:kV,GOOSE:EV,GROK:fV,HERMES:yV,KIMI:vV,KIRO:mV,KILOCODE:AV,OPENCODE:gV,OMP:xV,PI:PV,ROOCODE:TV,ZED:RV},IV={ANTIGRAVITY:"/brand-logos/antigravity.svg",ANYTHINGLLM:"/brand-logos/anythingllm.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",DEEPSEEK:"/brand-logos/deepseek.svg",GEMINI:"/brand-logos/gemini.svg","KILO-CLI":"/brand-logos/kilo.svg","KILO-CODE":"/brand-logos/kilo.svg",MIMO:"/brand-logos/mimo.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"},MV={ANYTHINGLLM:"brightness-0 dark:brightness-100"};function NV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:R.jsx("circle",{cx:"12",cy:"12",r:"7.5",strokeDasharray:"3 3"})})}function OV({provider:t,size:e=16,color:n,className:a=""}){const r=t?.toUpperCase?.()||"",s=IV[r];if(s){const c=`${MV[r]||""} ${a}`.trim();return R.jsx("img",{src:s,alt:"",width:e,height:e,className:c,style:{width:e,height:e,objectFit:"contain"},"aria-hidden":!0})}const l=DV[r];return l?R.jsx(l,{size:e,className:a}):R.jsx(NV,{size:e,className:`text-oai-gray-400 dark:text-oai-gray-500 shrink-0 ${a}`})}const p4="tokentracker-skills";async function Po(t){const e=new URL(`/functions/${p4}`,window.location.origin);if(t)for(const[r,s]of Object.entries(t))s!=null&&s!==""&&e.searchParams.set(r,String(s));const n=await fetch(e.toString(),{headers:{Accept:"application/json"},cache:"no-store"}),a=await n.json().catch(()=>null);if(!n.ok)throw new Error(a?.error||`Request failed with HTTP ${n.status}`);return a}async function ys(t){const e=await eu(),n=await fetch(`/functions/${p4}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...e},cache:"no-store",body:JSON.stringify(t)}),a=await n.json().catch(()=>null);if(!n.ok||a?.ok===!1)throw new Error(a?.error||`Request failed with HTTP ${n.status}`);return a}function jV(){return Po({mode:"installed"})}function nZ(t={}){return Po({mode:"discover",...t.force?{force:1}:{}})}function aZ(t,e=0,n=20){return Po({mode:"search",q:t,offset:e,limit:n})}function rZ(){return Po({mode:"repos"})}function iZ(t,e){return ys({action:"install",skill:t,targets:e})}function sZ(t){return ys({action:"uninstall",id:t})}function oZ(t){return ys({action:"restore",id:t})}function lZ(t,e){return ys({action:"set_targets",id:t,targets:e})}function cZ(t,e){return ys({action:"import_local",directory:t,targets:e})}function dZ(t,e){return ys({action:"delete_local",directory:t,targets:e||[]})}function uZ(t){return ys({action:"add_repo",repo:t})}function hZ(t,e){return ys({action:"remove_repo",owner:t,name:e})}function pZ(t={}){return Po({mode:"popular",...t.force?{force:1}:{}})}function fZ(t={}){return Po({mode:"updates",...t.force?{force:1}:{}})}function mZ(t={}){return Po({mode:"skill_usage",...t.force?{force:1}:{}})}const zV=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function FV(){const t=$l(),e=IB(),[n,a]=k.useState(!1),[r,s]=k.useState(""),[l,c]=k.useState(0),[u,h]=k.useState([]),p=k.useRef(null),m=k.useRef(null);k.useEffect(()=>{const T=A=>{(A.metaKey||A.ctrlKey)&&(A.key==="k"||A.key==="K")&&(A.preventDefault(),a(B=>!B))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[]),k.useEffect(()=>{if(!n)return;s(""),c(0);const T=requestAnimationFrame(()=>p.current?.focus());return zV&&!u.length&&jV().then(A=>h(A?.skills||[])).catch(()=>h([])),()=>cancelAnimationFrame(T)},[n,u.length]);const v=k.useMemo(()=>{const T=u4().flatMap(D=>D.items.map(B=>({kind:"page",id:`page:${B.id}`,label:B.label,sub:we("cmdk.group.pages"),Icon:B.icon,run:()=>t(B.to)}))),A=(u||[]).map(D=>({kind:"skill",id:`skill:${D.id||D.directory}`,label:D.name||D.directory,sub:D.repoOwner&&D.repoName?`${D.repoOwner}/${D.repoName}`:we("cmdk.group.skills"),provider:(D.targets||[])[0]||"claude",run:()=>t(`/skills?skill=${encodeURIComponent(D.directory||D.id)}`)}));return[...T,...A]},[t,u]),y=k.useMemo(()=>{const T=r.trim().toLowerCase();return T?v.filter(A=>A.label.toLowerCase().includes(T)||String(A.sub||"").toLowerCase().includes(T)):v},[v,r]);k.useEffect(()=>{l>=y.length&&c(y.length?y.length-1:0)},[l,y.length]),k.useEffect(()=>{if(!n)return;m.current?.querySelector(`[data-cmdk-index="${l}"]`)?.scrollIntoView({block:"nearest"})},[l,n]);const b=k.useCallback(()=>a(!1),[]),x=k.useCallback(T=>{T&&(b(),T.run())},[b]),P=T=>{T.key==="ArrowDown"?(T.preventDefault(),c(A=>Math.min(A+1,Math.max(0,y.length-1)))):T.key==="ArrowUp"?(T.preventDefault(),c(A=>Math.max(A-1,0))):T.key==="Enter"?(T.preventDefault(),x(y[l])):T.key==="Escape"&&(T.preventDefault(),b())},E={duration:e?0:.12},L=e?{duration:0}:{type:"spring",stiffness:460,damping:34,mass:.6};return R.jsx(M5,{children:n?R.jsxs(kd.div,{className:"fixed inset-0 z-[120] flex items-start justify-center px-4 pt-[16vh]",initial:e?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:E,children:[R.jsx("button",{type:"button","aria-label":we("cmdk.close"),onClick:b,className:"absolute inset-0 cursor-default bg-oai-black/40"}),R.jsxs(kd.div,{role:"dialog","aria-modal":"true","aria-label":we("cmdk.open_aria"),initial:e?!1:{opacity:0,y:-8,scale:.985},animate:{opacity:1,y:0,scale:1},exit:e?{opacity:0}:{opacity:0,y:-8,scale:.985},transition:L,className:"relative w-full max-w-xl overflow-hidden rounded-2xl border border-oai-gray-200 bg-oai-white shadow-2xl dark:border-oai-gray-800 dark:bg-oai-gray-950",children:[R.jsxs("div",{className:"flex items-center gap-2.5 border-b border-oai-gray-200 px-4 dark:border-oai-gray-800",children:[R.jsx(kO,{className:"h-4 w-4 shrink-0 text-oai-gray-400","aria-hidden":!0}),R.jsx("input",{ref:p,type:"text",value:r,onChange:T=>{s(T.target.value),c(0)},onKeyDown:P,"aria-label":we("cmdk.placeholder"),"aria-controls":"cmdk-listbox","aria-activedescendant":y[l]?`cmdk-opt-${l}`:void 0,role:"combobox","aria-expanded":"true",placeholder:we("cmdk.placeholder"),className:"h-12 w-full bg-transparent text-sm text-oai-black placeholder:text-oai-gray-400 focus:outline-none dark:text-white"})]}),R.jsx("div",{ref:m,id:"cmdk-listbox",role:"listbox",className:"max-h-[min(56vh,22rem)] overflow-y-auto p-1.5",children:y.length===0?R.jsx("div",{className:"px-3 py-8 text-center text-sm text-oai-gray-500 dark:text-oai-gray-400",children:we("cmdk.empty")}):y.map((T,A)=>{const D=A===l;return R.jsxs("button",{type:"button",role:"option",id:`cmdk-opt-${A}`,"data-cmdk-index":A,"aria-selected":D,onMouseMove:()=>c(A),onClick:()=>x(T),className:$t("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition-colors",D?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800/70 dark:text-white":"text-oai-gray-700 dark:text-oai-gray-200"),children:[R.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center text-oai-gray-500 dark:text-oai-gray-400",children:T.kind==="skill"?R.jsx(OV,{provider:T.provider,size:16}):R.jsx(T.Icon,{className:"h-4 w-4","aria-hidden":!0})}),R.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:T.label}),R.jsx("span",{className:"shrink-0 truncate text-xs text-oai-gray-400 dark:text-oai-gray-500",children:T.sub}),D?R.jsx(eO,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-400","aria-hidden":!0}):null]},T.id)})})]})]}):null})}const UV=[];function ob(t){k.useEffect(t,UV)}const uP={};function Ql(t,e){const n=k.useRef(uP);return n.current===uP&&(n.current=t(e)),n}const BV=()=>{},Ka=typeof document<"u"?k.useLayoutEffect:BV;function $V(t,e){return function(a,...r){const s=new URL(t);return s.searchParams.set("code",a.toString()),r.forEach(l=>s.searchParams.append("args[]",l)),`${e} error #${a}; visit ${s} for the full message.`}}const Xl=$V("https://base-ui.com/production-error","Base UI"),lb=k.createContext(void 0);function cb(){const t=k.useContext(lb);if(!t)throw new Error(Xl(73));return t}const fr=(t,e,n,a,r,s,...l)=>{if(l.length>0)throw new Error(Xl(1));let c;if(t&&e&&n&&a&&r&&s)c=(u,h,p,m)=>{const v=t(u,h,p,m),y=e(u,h,p,m),b=n(u,h,p,m),x=a(u,h,p,m),P=r(u,h,p,m);return s(v,y,b,x,P,h,p,m)};else if(t&&e&&n&&a&&r)c=(u,h,p,m)=>{const v=t(u,h,p,m),y=e(u,h,p,m),b=n(u,h,p,m),x=a(u,h,p,m);return r(v,y,b,x,h,p,m)};else if(t&&e&&n&&a)c=(u,h,p,m)=>{const v=t(u,h,p,m),y=e(u,h,p,m),b=n(u,h,p,m);return a(v,y,b,h,p,m)};else if(t&&e&&n)c=(u,h,p,m)=>{const v=t(u,h,p,m),y=e(u,h,p,m);return n(v,y,h,p,m)};else if(t&&e)c=(u,h,p,m)=>{const v=t(u,h,p,m);return e(v,h,p,m)};else if(t)c=t;else throw new Error("Missing arguments");return c};var uv={exports:{}},hv={};var hP;function VV(){if(hP)return hv;hP=1;var t=Kd();function e(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:e,a=t.useState,r=t.useEffect,s=t.useLayoutEffect,l=t.useDebugValue;function c(m,v){var y=v(),b=a({inst:{value:y,getSnapshot:v}}),x=b[0].inst,P=b[1];return s(function(){x.value=y,x.getSnapshot=v,u(x)&&P({inst:x})},[m,y,v]),r(function(){return u(x)&&P({inst:x}),m(function(){u(x)&&P({inst:x})})},[m]),l(y),y}function u(m){var v=m.getSnapshot;m=m.value;try{var y=v();return!n(m,y)}catch{return!0}}function h(m,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return hv.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p,hv}var pP;function f4(){return pP||(pP=1,uv.exports=VV()),uv.exports}var HV=f4(),pv={exports:{}},fv={};var fP;function WV(){if(fP)return fv;fP=1;var t=Kd(),e=f4();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var a=typeof Object.is=="function"?Object.is:n,r=e.useSyncExternalStore,s=t.useRef,l=t.useEffect,c=t.useMemo,u=t.useDebugValue;return fv.useSyncExternalStoreWithSelector=function(h,p,m,v,y){var b=s(null);if(b.current===null){var x={hasValue:!1,value:null};b.current=x}else x=b.current;b=c(function(){function E(B){if(!L){if(L=!0,T=B,B=v(B),y!==void 0&&x.hasValue){var j=x.value;if(y(j,B))return A=j}return A=B}if(j=A,a(T,B))return j;var S=v(B);return y!==void 0&&y(j,S)?(T=B,j):(T=B,A=S)}var L=!1,T,A,D=m===void 0?null:m;return[function(){return E(p())},D===null?void 0:function(){return E(D())}]},[p,m,v,y]);var P=r(h,b[0],b[1]);return l(function(){x.hasValue=!0,x.value=P},[P]),u(P),P},fv}var mP;function GV(){return mP||(mP=1,pv.exports=WV()),pv.exports}var qV=GV();const KV=parseInt(k.version,10);function db(t){return KV>=t}const YV=db(19),ZV=YV?QV:XV;function m4(t,e,n,a,r){return ZV(t,e,n,a,r)}function JV(t,e,n,a,r){const s=k.useCallback(()=>e(t.getSnapshot(),n,a,r),[t,e,n,a,r]);return HV.useSyncExternalStore(t.subscribe,s,s)}function QV(t,e,n,a,r){return JV(t,e,n,a,r)}function XV(t,e,n,a,r){return qV.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,s=>e(s,n,a,r))}class eH{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const a of this.listeners){if(n!==this.updateTick)return;a(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){this.setState({...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||this.setState({...this.state,[e]:n})}notifyAll(){const e={...this.state};this.setState(e)}use(e,n,a,r){return m4(this,e,n,a,r)}}const ub={...US},mv=ub.useInsertionEffect,tH=mv&&mv!==ub.useLayoutEffect?mv:t=>t();function vo(t){const e=Ql(nH).current;return e.next=t,tH(e.effect),e.trampoline}function nH(){const t={next:void 0,callback:aH,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function aH(){}function rH(){}const gZ=Object.freeze([]),eo=Object.freeze({});class iH extends eH{constructor(e,n={},a){super(e),this.context=n,this.selectors=a}useSyncedValue(e,n){k.useDebugValue(e);const a=this;Ka(()=>{a.state[e]!==n&&a.set(e,n)},[a,e,n])}useSyncedValueWithCleanup(e,n){const a=this;Ka(()=>(a.state[e]!==n&&a.set(e,n),()=>{a.set(e,void 0)}),[a,e,n])}useSyncedValues(e){const n=this,a=Object.values(e);Ka(()=>{n.update(e)},[n,...a])}useControlledProp(e,n){k.useDebugValue(e);const a=this,r=n!==void 0;Ka(()=>{r&&!Object.is(a.state[e],n)&&a.setState({...a.state,[e]:n})},[a,e,n,r])}select(e,n,a,r){const s=this.selectors[e];return s(this.state,n,a,r)}useState(e,n,a,r){return k.useDebugValue(e),m4(this,this.selectors[e],n,a,r)}useContextCallback(e,n){k.useDebugValue(e);const a=vo(n??rH);this.context[e]=a}useStateSetter(e){const n=k.useRef(void 0);return n.current===void 0&&(n.current=a=>{this.set(e,a)}),n.current}observe(e,n){let a;typeof e=="function"?a=e:a=this.selectors[e];let r=a(this.state);return n(r,r,this),this.subscribe(s=>{const l=a(s);if(!Object.is(r,l)){const c=r;r=l,n(l,c,this)}})}}function Vf(){return typeof window<"u"}function wr(t){return hb(t)?(t.nodeName||"").toLowerCase():"#document"}function Ei(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function sH(t){var e;return(e=(hb(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function hb(t){return Vf()?t instanceof Node||t instanceof Ei(t).Node:!1}function pb(t){return Vf()?t instanceof Element||t instanceof Ei(t).Element:!1}function fs(t){return Vf()?t instanceof HTMLElement||t instanceof Ei(t).HTMLElement:!1}function Jp(t){return!Vf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ei(t).ShadowRoot}function g4(t){const{overflow:e,overflowX:n,overflowY:a,display:r}=Hf(t);return/auto|scroll|overlay|hidden|clip/.test(e+a+n)&&r!=="inline"&&r!=="contents"}function vZ(t){return/^(table|td|th)$/.test(wr(t))}function oH(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const lH=/transform|translate|scale|rotate|perspective|filter/,cH=/paint|layout|strict|content/,js=t=>!!t&&t!=="none";let gv;function dH(t){const e=pb(t)?Hf(t):t;return js(e.transform)||js(e.translate)||js(e.scale)||js(e.rotate)||js(e.perspective)||!uH()&&(js(e.backdropFilter)||js(e.filter))||lH.test(e.willChange||"")||cH.test(e.contain||"")}function _Z(t){let e=Z_(t);for(;fs(e)&&!v4(e);){if(dH(e))return e;if(oH(e))return null;e=Z_(e)}return null}function uH(){return gv==null&&(gv=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gv}function v4(t){return/^(html|body|#document)$/.test(wr(t))}function Hf(t){return Ei(t).getComputedStyle(t)}function yZ(t){return pb(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Z_(t){if(wr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Jp(t)&&t.host||sH(t);return Jp(e)?e.host:e}function _4(t){const e=Z_(t);return v4(e)?t.ownerDocument?t.ownerDocument.body:t.body:fs(e)&&g4(e)?e:_4(e)}function gP(t,e,n){var a;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=_4(t),s=r===((a=t.ownerDocument)==null?void 0:a.body),l=Ei(r);if(s){const c=hH(l);return e.concat(l,l.visualViewport||[],g4(r)?r:[],c&&n?gP(c):[])}else return e.concat(r,gP(r,[],n))}function hH(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function y4(...t){return()=>{for(let e=0;e<t.length;e+=1){const n=t[e];n&&n()}}}function br(t){return t?.ownerDocument||document}function to(t,e,n,a){return t.addEventListener(e,n,a),()=>{t.removeEventListener(e,n,a)}}const Ah=null;class pH{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,a=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,a>0)for(let r=0;r<n.length;r+=1)n[r]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Rh=new pH;class fb{static create(){return new fb}static request(e){return Rh.request(e)}static cancel(e){return Rh.cancel(e)}currentId=Ah;request(e){this.cancel(),this.currentId=Rh.request(()=>{this.currentId=Ah,e()})}cancel=()=>{this.currentId!==Ah&&(Rh.cancel(this.currentId),this.currentId=Ah)};disposeEffect=()=>this.cancel}function fH(){const t=Ql(fb.create).current;return ob(t.disposeEffect),t}const Vc=0;class Fd{static create(){return new Fd}currentId=Vc;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Vc,n()},e)}isStarted(){return this.currentId!==Vc}clear=()=>{this.currentId!==Vc&&(clearTimeout(this.currentId),this.currentId=Vc)};disposeEffect=()=>this.clear}function mH(){const t=Ql(Fd.create).current;return ob(t.disposeEffect),t}let vP=0;function b4(t){return vP+=1,`${t}-${Math.random().toString(36).slice(2,6)}-${vP}`}function vv(t,e){if(typeof t=="string")return{description:t};if(typeof t=="function"){const n=t(e);return typeof n=="string"?{description:n}:n}return t}function gH(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:vH,platform:_H,maxTouchPoints:yH}=gH(),Wf=vH.toLowerCase(),Ud=_H.toLowerCase(),k4=/^i(os$|p)/.test(Ud)||Ud==="macintel"&&yH>1,_P="android",bZ=Ud===_P||Wf.includes(_P),bH=!k4&&Ud.startsWith("mac");Ud.startsWith("win");const kH=bH||k4,mb=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!mb&&Wf.includes("firefox");!mb&&Wf.includes("chrom");const wH=kH,xH=/jsdom|happydom/.test(Wf),yP="data-base-ui-focusable",w4="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",kZ="ArrowLeft",wZ="ArrowRight",xZ="ArrowUp",PZ="ArrowDown";function Pl(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Ai(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&Jp(n)){let a=e;for(;a;){if(t===a)return!0;a=a.parentNode||a.host}}return!1}function no(t){return"composedPath"in t?t.composedPath()[0]:t.target}function SZ(t,e){if(!pb(t))return!1;const n=t;if(e.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,a]of e.entries())if(Ai(a,n))return!a.hasAttribute("data-trigger-disabled");return!1}function CZ(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function TZ(t){return t.matches("html,body")}function PH(t){return fs(t)&&t.matches(w4)}function EZ(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${w4}`)!=null}function AZ(t){return t?t.getAttribute("role")==="combobox"&&PH(t):!1}function J_(t){if(!t||xH)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function RZ(t){return t?t.hasAttribute(yP)?t:t.querySelector(`[${yP}]`)||t:null}function LZ(t,e){return e<0||e>=t.length}function DZ(t,e){return x4(t.current,{disabledIndices:e})}function IZ(t,e){return x4(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function x4(t,{startingIndex:e=-1,decrement:n=!1,disabledIndices:a,amount:r=1}={}){let s=e;do s+=n?-r:r;while(s>=0&&s<=t.length-1&&SH(t,s,a));return s}function SH(t,e,n){if(typeof n=="function"?n(e):n?.includes(e)??!1)return!0;const r=t[e];return r?P4(r)?!n&&(r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"):!0:!1}function CH(t){return t.visibility==="hidden"||t.visibility==="collapse"}function P4(t,e=t?Hf(t):null){return!t||!t.isConnected||!e||CH(e)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():e.display!=="none"&&e.display!=="contents"}const TH='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function EH(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const n=t.getRootNode();return Jp(n)?n.host:null}function Q_(t){for(const e of Array.from(t.children))if(wr(e)==="summary")return e;return null}function AH(t,e){const n=Q_(e);return!!n&&(t===n||Ai(n,t))}function S4(t){const e=t?wr(t):"";return t!=null&&t.matches(TH)&&(e!=="summary"||t.parentElement!=null&&wr(t.parentElement)==="details"&&Q_(t.parentElement)===t)&&(e!=="details"||Q_(t)==null)&&(e!=="input"||t.type!=="hidden")}function C4(t){if(!S4(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=EH(e)){const n=e!==t,a=wr(e)==="slot";if(e.hasAttribute("inert")||n&&wr(e)==="details"&&!e.open&&!AH(t,e)||e.hasAttribute("hidden")||!a&&!RH(e,n))return!1}return!0}function RH(t,e){const n=Hf(t);return e?n.display!=="none":P4(t,n)}function T4(t){const e=t.tabIndex;if(e<0){const n=wr(t);if(n==="details"||n==="audio"||n==="video"||fs(t)&&t.isContentEditable)return 0}return e}function _v(t){if(wr(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function LH(t,e){const n=_v(t);if(!n)return!0;const a=e.find(r=>{const s=_v(r);return s?.name===n.name&&s.form===n.form&&s.checked});return a?a===n:e.find(r=>{const s=_v(r);return s?.name===n.name&&s.form===n.form})===n}function E4(t){if(fs(t)&&wr(t)==="slot"){const e=t.assignedElements({flatten:!0});if(e.length>0)return e}return fs(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function A4(t,e){E4(t).forEach(n=>{S4(n)&&e.push(n),A4(n,e)})}function R4(t,e,n){E4(t).forEach(a=>{fs(a)&&a.matches(e)&&n.push(a),R4(a,e,n)})}function MZ(t){return C4(t)&&T4(t)>=0}function DH(t){const e=[];return A4(t,e),e.filter(C4)}function gb(t){const e=DH(t);return e.filter(n=>T4(n)>=0&&LH(n,e))}function L4(t,e){const n=gb(t),a=n.length;if(a===0)return;const r=Pl(br(t)),s=n.indexOf(r),l=s===-1?e===1?0:a-1:s+e;return n[l]}function IH(t){return L4(br(t).body,1)||t}function MH(t){return L4(br(t).body,-1)||t}function D4(t,e){if(!t)return null;const n=gb(br(t).body),a=n.length;if(a===0)return null;const r=n.indexOf(t);if(r===-1)return null;const s=(r+e+a)%a;return n[s]}function NZ(t){return D4(t,1)}function OZ(t){return D4(t,-1)}function yv(t,e){const n=e||t.currentTarget,a=t.relatedTarget;return!a||!Ai(n,a)}function NH(t){gb(t).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function bP(t){const e=[];R4(t,"[data-tabindex]",e),e.forEach(n=>{const a=n.dataset.tabindex;delete n.dataset.tabindex,a?n.setAttribute("tabindex",a):n.removeAttribute("tabindex")})}function Lh(t){const e=new Map;let n=0,a=0;return t.forEach((r,s)=>{const l=r.transitionStatus==="ending";e.set(r.id,{value:r,domIndex:s,visibleIndex:l?-1:n,offsetY:a}),a+=r.height||0,l||(n+=1)}),e}function bv(t,e){let n=0;return t.map(a=>{if(a.transitionStatus==="ending")return a;const r=n>=e;return n+=1,a.limited===r?a:{...a,limited:r}})}const Dh=t=>t.toastMetadata,Ir={toasts:fr(t=>t.toasts),isEmpty:fr(t=>t.toasts.length===0),toast:fr(Dh,(t,e)=>t.get(e)?.value),toastIndex:fr(Dh,(t,e)=>t.get(e)?.domIndex??-1),toastOffsetY:fr(Dh,(t,e)=>t.get(e)?.offsetY??0),toastVisibleIndex:fr(Dh,(t,e)=>t.get(e)?.visibleIndex??-1),hovering:fr(t=>t.hovering),focused:fr(t=>t.focused),expanded:fr(t=>t.hovering||t.focused),expandedOrOutOfFocus:fr(t=>t.hovering||t.focused||!t.isWindowFocused),prevFocusElement:fr(t=>t.prevFocusElement)};class OH extends iH{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:Lh(e.toasts)},{},Ir)}setFocused(e){this.set("focused",e)}setHovering(e){this.set("hovering",e)}setIsWindowFocused(e){this.set("isWindowFocused",e)}setPrevFocusElement(e){this.set("prevFocusElement",e)}setViewport=e=>{this.set("viewport",e)};syncProviderProps(e){const n=this.state.limit!==e.limit;if(this.state.timeout===e.timeout&&!n)return;const a={timeout:e.timeout,limit:e.limit};if(n){const r=bv(this.state.toasts,e.limit);a.toasts=r,a.toastMetadata=Lh(r)}this.update(a)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,n={}){const a=Ir.toastIndex(this.state,e);if(a===-1)return;const r=this.state.toasts[a];n.skipOnRemove||r?.onRemove?.();const s=[...this.state.toasts];s.splice(a,1),this.setToasts(s)}addToast=e=>{const{timeout:n,limit:a}=this.state,r=e.id||b4("toast");if(e.id){const u=Ir.toast(this.state,e.id);if(u)if(u.transitionStatus==="ending")this.removeToast(e.id,{skipOnRemove:!0});else{const{id:h,transitionStatus:p,...m}=e;return this.updateToastInternal(e.id,m,{resetTimer:!0,markUpdated:!0}),e.id}}const s={...e,id:r,updateKey:0,transitionStatus:"starting"},l=[s,...this.state.toasts];this.setToasts(bv(l,a));const c=s.timeout??n;return s.type!=="loading"&&c>0&&this.scheduleTimer(r,c,()=>this.closeToast(r)),Ir.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,n)=>{this.updateToastInternal(e,n,{markUpdated:!0})};updateToastInternal=(e,n,a={})=>{const{timeout:r,toasts:s}=this.state,l=Ir.toast(this.state,e)??null;if(!l||l.transitionStatus==="ending")return;const c={...l,...n,...a.markUpdated&&{updateKey:(l.updateKey??0)+1}};this.setToasts(s.map(x=>x.id===e?c:x));const u=c.timeout??r,h=l?.timeout??r,p=Object.hasOwn(n,"timeout"),m=c.transitionStatus!=="ending"&&c.type!=="loading"&&u>0,v=this.timers.has(e),y=h!==u,b=l?.type==="loading";if(!m&&v){this.clearTimer(e);return}m&&(!v||y||p||b||a.resetTimer)&&(this.clearTimer(e),this.scheduleTimer(e,u,()=>this.closeToast(e)),Ir.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{const n=e===void 0,{limit:a,toasts:r}=this.state;let s;if(n)s=r,this.clearTimers();else{const p=Ir.toast(this.state,e);if(!p)return;s=[p],this.clearTimer(e)}const l=r.map(p=>n||p.id===e?{...p,transitionStatus:"ending",height:0}:p),c=bv(l,a),u={toasts:c,toastMetadata:Lh(c)};c.some(p=>p.transitionStatus!=="ending")||(u.hovering=!1,u.focused=!1),this.update(u),s.forEach(p=>{p.transitionStatus!=="ending"&&p.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,n)=>{const a=vv(n.loading),r=this.addToast({...a,type:"loading"}),s=e.then(l=>{const c=vv(n.success,l);return this.updateToast(r,{...c,type:"success",timeout:c.timeout}),l}).catch(l=>{const c=vv(n.error,l);return this.updateToast(r,{...c,type:"error",timeout:c.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(s),s};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{if(e.timeout){e.timeout.clear();const n=Date.now()-e.start,a=e.delay-n;e.remaining=a>0?a:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,n)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=Fd.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(n),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!=="touch")return;const n=no(e);Ai(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,n,a){const r=Date.now(),s=!Ir.expandedOrOutOfFocus(this.state),l=s?Fd.create():void 0;l?.start(n,()=>{this.handleTimerFired(e),a()}),this.timers.set(e,{timeout:l,start:s?r:0,delay:n,remaining:n,callback:a})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e){const n={toasts:e,toastMetadata:Lh(e)};e.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){const n=Pl(br(this.state.viewport));if(!this.state.viewport||!Ai(this.state.viewport,n)||!J_(n))return;if(e===void 0){this.restoreFocusToPrevElement();return}const a=Ir.toasts(this.state),r=Ir.toastIndex(this.state,e);let s=null,l=r+1;for(;l<a.length;){if(a[l].transitionStatus!=="ending"){s=a[l];break}l+=1}if(!s)for(l=r-1;l>=0;){if(a[l].transitionStatus!=="ending"){s=a[l];break}l-=1}s?s.ref?.current?.focus():this.restoreFocusToPrevElement()}}const jH=function(e){const{children:n,timeout:a=5e3,limit:r=3,toastManager:s}=e,l=Ql(()=>new OH({timeout:a,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return ob(l.disposeEffect),k.useEffect(function(){return s?s[" subscribe"](({action:h,options:p})=>{const m=p.id;h==="promise"&&p.promise?l.promiseToast(p.promise,p):h==="update"&&m?l.updateToast(m,p):h==="close"?l.closeToast(m):l.addToast(p)}):void 0},[l,s]),Ka(()=>{l.syncProviderProps({timeout:a,limit:r})},[l,a,r]),R.jsx(lb.Provider,{value:l,children:n})},I4={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},M4={...I4,position:"fixed",top:0,left:0},jZ={...I4,position:"absolute"},wd=k.forwardRef(function(e,n){const[a,r]=k.useState();Ka(()=>{wH&&mb&&r("button")},[]);const s={tabIndex:0,role:a};return R.jsx("span",{...e,ref:n,style:M4,"aria-hidden":a?void 0:!0,...s,"data-base-ui-focus-guard":""})});function kP(t,e,n,a){const r=Ql(N4).current;return FH(r,t,e,n,a)&&O4(r,[t,e,n,a]),r.callback}function zH(t){const e=Ql(N4).current;return UH(e,t)&&O4(e,t),e.callback}function N4(){return{callback:null,cleanup:null,refs:[]}}function FH(t,e,n,a,r){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==a||t.refs[3]!==r}function UH(t,e){return t.refs.length!==e.length||t.refs.some((n,a)=>n!==e[a])}function O4(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const a=Array(e.length).fill(null);for(let r=0;r<e.length;r+=1){const s=e[r];if(s!=null)switch(typeof s){case"function":{const l=s(n);typeof l=="function"&&(a[r]=l);break}case"object":{s.current=n;break}}}t.cleanup=()=>{for(let r=0;r<e.length;r+=1){const s=e[r];if(s!=null)switch(typeof s){case"function":{const l=a[r];typeof l=="function"?l():s(null);break}case"object":{s.current=null;break}}}}}}}function wP(t){if(!k.isValidElement(t))return null;const e=t,n=e.props;return(db(19)?n?.ref:e.ref)??null}function X_(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function BH(t,e){const n={};for(const a in t){const r=t[a];if(e?.hasOwnProperty(a)){const s=e[a](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${a.toLowerCase()}`]="":r&&(n[`data-${a.toLowerCase()}`]=r.toString())}return n}function $H(t,e){return typeof t=="function"?t(e):t}function VH(t,e){return typeof t=="function"?t(e):t}const vb={};function _b(t,e,n,a,r){if(!n&&!a&&!r&&!t)return Qp(e);let s=Qp(t);return e&&(s=sd(s,e)),n&&(s=sd(s,n)),a&&(s=sd(s,a)),r&&(s=sd(s,r)),s}function HH(t){if(t.length===0)return vb;if(t.length===1)return Qp(t[0]);let e=Qp(t[0]);for(let n=1;n<t.length;n+=1)e=sd(e,t[n]);return e}function Qp(t){return yb(t)?{...z4(t,vb)}:WH(t)}function sd(t,e){return yb(e)?z4(e,t):GH(t,e)}function WH(t){const e={...t};for(const n in e){const a=e[n];j4(n,a)&&(e[n]=F4(a))}return e}function GH(t,e){if(!e)return t;for(const n in e){const a=e[n];switch(n){case"style":{t[n]=X_(t.style,a);break}case"className":{t[n]=U4(t.className,a);break}default:j4(n,a)?t[n]=qH(t[n],a):t[n]=a}}return t}function j4(t,e){const n=t.charCodeAt(0),a=t.charCodeAt(1),r=t.charCodeAt(2);return n===111&&a===110&&r>=65&&r<=90&&(typeof e=="function"||typeof e>"u")}function yb(t){return typeof t=="function"}function z4(t,e){return yb(t)?t(e):t??vb}function qH(t,e){return e?t?(...n)=>{const a=n[0];if(B4(a)){const s=a;Xp(s);const l=e(...n);return s.baseUIHandlerPrevented||t?.(...n),l}const r=e(...n);return t?.(...n),r}:F4(e):t}function F4(t){return t&&((...e)=>{const n=e[0];return B4(n)&&Xp(n),t(...e)})}function Xp(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function U4(t,e){return e?t?e+" "+t:e:t}function B4(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function ou(t,e,n={}){const a=e.render,r=KH(e,n);if(n.enabled===!1)return null;const s=n.state??eo;return JH(t,a,r,s)}function KH(t,e={}){const{className:n,style:a,render:r}=t,{state:s=eo,ref:l,props:c,stateAttributesMapping:u,enabled:h=!0}=e,p=h?$H(n,s):void 0,m=h?VH(a,s):void 0,v=h?BH(s,u):eo,y=h&&c?YH(c):void 0,b=h?X_(v,y)??{}:eo;return typeof document<"u"&&(h?Array.isArray(l)?b.ref=zH([b.ref,wP(r),...l]):b.ref=kP(b.ref,wP(r),l):kP(null,null)),h?(p!==void 0&&(b.className=U4(b.className,p)),m!==void 0&&(b.style=X_(b.style,m)),b):eo}function YH(t){return Array.isArray(t)?HH(t):_b(void 0,t)}const ZH=Symbol.for("react.lazy");function JH(t,e,n,a){if(e){if(typeof e=="function")return e(n,a);const r=_b(n,e.props);r.ref=n.ref;let s=e;return s?.$$typeof===ZH&&(s=k.Children.toArray(e)[0]),k.cloneElement(s,r)}if(t&&typeof t=="string")return QH(t,n);throw new Error(Xl(8))}function QH(t,e){return t==="button"?k.createElement("button",{type:"button",...e,key:e.key}):t==="img"?k.createElement("img",{alt:"",...e,key:e.key}):k.createElement(t,e)}let XH=(function(t){return t.frontmostHeight="--toast-frontmost-height",t})({});const eW=k.forwardRef(function(e,n){const{render:a,className:r,style:s,children:l,...c}=e,u=cb(),h=mH(),p=k.useRef(!1),m=k.useRef(!1),v=k.useRef(!1),y=u.useState("isEmpty"),b=u.useState("toasts"),x=u.useState("focused"),P=u.useState("expanded"),E=u.useState("prevFocusElement"),L=b[0]?.height??0,T=k.useMemo(()=>b.some($=>$.transitionStatus==="ending"),[b]),A=k.useMemo(()=>b.filter($=>$.priority==="high"),[b]);k.useEffect(()=>{const $=u.state.viewport;if(!$)return;function X(O){y||O.key==="F6"&&no(O)!==$&&(O.preventDefault(),u.setPrevFocusElement(Pl(br($))),$?.focus({preventScroll:!0}),u.pauseTimers(),u.setFocused(!0))}const W=Ei($);return to(W,"keydown",X)},[u,y]),k.useEffect(()=>{const $=u.state.viewport;if(!$||y)return;const X=Ei($);function W(Y){no(Y)===X&&(u.setIsWindowFocused(!1),u.pauseTimers())}function O(Y){if(Y.relatedTarget)return;const ae=no(Y),_e=Pl(br($));(ae===X||!Ai($,ae)||!J_(_e))&&u.resumeTimers(),h.start(0,()=>u.setIsWindowFocused(!0))}return y4(to(X,"blur",W,!0),to(X,"focus",O,!0))},[u,h,y]),k.useEffect(()=>{const $=u.state.viewport;if(!$||y)return;const X=br($);return to(X,"pointerdown",u.handleDocumentPointerDown,!0)},[y,u]);function D($){const X=u.state.viewport;if(X)if(p.current=!0,$.relatedTarget===X){const W=b.find(O=>O.transitionStatus!=="ending"&&!O.limited);W?W.ref?.current?.focus():u.restoreFocusToPrevElement()}else u.restoreFocusToPrevElement()}function B($){$.key==="Tab"&&$.shiftKey&&no($.nativeEvent)===u.state.viewport&&($.preventDefault(),u.restoreFocusToPrevElement(),u.resumeTimers())}function j(){u.state.toasts.some(X=>X.transitionStatus==="ending")||v.current||!m.current||(u.state.isWindowFocused&&u.resumeTimers(),u.setHovering(!1),m.current=!1)}k.useEffect(j,[T,u]);function S(){u.pauseTimers(),u.setHovering(!0),m.current=!1}function N(){u.state.isWindowFocused&&u.resumeTimers()}function U(){u.state.toasts.some(X=>X.transitionStatus==="ending")||v.current?m.current=!0:(N(),u.setHovering(!1))}function Q($){$.pointerType==="touch"&&(v.current=!0)}function ee($){$.pointerType==="touch"&&(v.current=!1,j())}function ce(){if(p.current){p.current=!1;return}x||J_(Pl(br(u.state.viewport)))&&(u.setFocused(!0),u.pauseTimers())}function le($){!x||Ai(u.state.viewport,$.relatedTarget)||(u.setFocused(!1),N())}const re={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:S,onMouseMove:S,onMouseLeave:U,onFocus:ce,onBlur:le,onKeyDown:B,onClick:ce,onPointerDown:Q,onPointerUp:ee,onPointerCancel:ee},te={expanded:P},ie=ou("div",e,{ref:[n,u.setViewport],state:te,props:[re,{style:{[XH.frontmostHeight]:L?`${L}px`:void 0}},c,{children:R.jsxs(k.Fragment,{children:[!y&&E&&R.jsx(wd,{onFocus:D}),l,!y&&E&&R.jsx(wd,{onFocus:D})]})}]});return R.jsxs(k.Fragment,{children:[!y&&E&&R.jsx(wd,{onFocus:D}),ie,!x&&A.length>0&&R.jsx("div",{style:M4,children:A.map($=>R.jsxs("div",{role:"alert","aria-atomic":!0,children:[R.jsx("div",{children:$.title}),R.jsx("div",{children:$.description})]},$.id))})]})});function tW(t){return db(19)?t:t?"true":void 0}const $4=k.createContext(void 0);function V4(){const t=k.useContext($4);if(!t)throw new Error(Xl(66));return t}let bb=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const nW={[bb.startingStyle]:""},aW={[bb.endingStyle]:""},rW={transitionStatus(t){return t==="starting"?nW:t==="ending"?aW:null}};function iW(t){return t==null?t:"current"in t?t.current:t}function sW(t,e=!1,n=!0){const a=fH();return vo((r,s=null)=>{a.cancel();const l=iW(t);if(l==null)return;const c=l,u=()=>{Vl.flushSync(r)};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function h(){Promise.all(c.getAnimations().map(p=>p.finished)).then(()=>{s?.aborted||u()}).catch(()=>{if(n){s?.aborted||u();return}const p=c.getAnimations();!s?.aborted&&p.length>0&&p.some(m=>m.pending||m.playState!=="finished")&&h()})}if(e){const p=bb.startingStyle;if(!c.hasAttribute(p)){a.request(h);return}const m=new MutationObserver(()=>{c.hasAttribute(p)||(m.disconnect(),h())});m.observe(c,{attributes:!0,attributeFilter:[p]}),s?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}a.request(h)})}function oW(t){const{enabled:e=!0,open:n,ref:a,onComplete:r}=t,s=vo(r),l=sW(a,n,!1);k.useEffect(()=>{if(!e)return;const c=new AbortController;return l(s,c.signal),()=>{c.abort()}},[e,n,s,l])}let zs=(function(t){return t.index="--toast-index",t.offsetY="--toast-offset-y",t.height="--toast-height",t.swipeMovementX="--toast-swipe-movement-x",t.swipeMovementY="--toast-swipe-movement-y",t})({});const zZ=500,FZ={style:{transition:"none"}},UZ="data-base-ui-click-trigger",lW="data-base-ui-swipe-ignore",cW="data-swipe-ignore",dW=`[${lW}]`,uW=`[${cW}]`,BZ={fallbackAxisSide:"none"},$Z={fallbackAxisSide:"end"},hW={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function xP(t,e,n){switch(t){case"up":return-n;case"down":return n;case"left":return-e;case"right":return e;default:return 0}}function pW(t){const n=Ei(t).getComputedStyle(t).transform;let a=0,r=0,s=1;if(n&&n!=="none"){const l=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(l){const c=l[1].split(", ").map(parseFloat);c.length===6?(a=c[4],r=c[5],s=Math.sqrt(c[0]*c[0]+c[1]*c[1])):c.length===16&&(a=c[12],r=c[13],s=c[0])}}return{x:a,y:r,scale:s}}const fW={...rW,swipeDirection(t){return t?{"data-swipe-direction":t}:null}},Hc=40,mW=10,ns=.5,gW=1,vW=`${dW},${uW}`,_W=k.forwardRef(function(e,n){const{toast:a,render:r,className:s,swipeDirection:l=["down","right"],style:c,...u}=e,h=a.positionerProps?.anchor!==void 0;let p=[];h||(p=Array.isArray(l)?l:[l]);const m=p.length>0,v=cb(),[y,b]=k.useState(void 0),[x,P]=k.useState(!1),[E,L]=k.useState(!1),[T,A]=k.useState(!1),[D,B]=k.useState({x:0,y:0}),[j,S]=k.useState({x:0,y:0,scale:1}),[N,U]=k.useState(),[Q,ee]=k.useState(),[ce,le]=k.useState(null),re=k.useRef(null),te=k.useRef({x:0,y:0}),ie=k.useRef({x:0,y:0,scale:1}),$=k.useRef(void 0),X=k.useRef(0),W=k.useRef(!1),O=k.useRef({x:0,y:0}),Y=k.useRef(!1),ae=k.useRef({x:0,y:0}),_e=k.useRef(null),fe=k.useRef(null),ve=v.useState("toastIndex",a.id),Ne=v.useState("toastVisibleIndex",a.id),Oe=v.useState("toastOffsetY",a.id),Ie=v.useState("focused"),St=v.useState("expanded");oW({open:a.transitionStatus!=="ending",ref:re,onComplete(){a.transitionStatus==="ending"&&v.removeToast(a.id)}});const un=vo((tt=!1)=>{const et=re.current;if(!et)return;const kt=et.style.height;et.style.height="auto";const an=et.offsetHeight;et.style.height=kt;function zt(){v.updateToastInternal(a.id,{ref:re,height:an,...a.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}tt?Vl.flushSync(zt):zt()});Ka(un,[un]);function jt(tt){ae.current=tt,B(tt)}Ka(()=>()=>{fe.current?.abort()},[]);function _t(tt,et){let kt=tt,an=et;return!p.includes("left")&&!p.includes("right")?kt=tt>0?tt**ns:-(Math.abs(tt)**ns):(!p.includes("right")&&tt>0&&(kt=tt**ns),!p.includes("left")&&tt<0&&(kt=-(Math.abs(tt)**ns))),!p.includes("up")&&!p.includes("down")?an=et>0?et**ns:-(Math.abs(et)**ns):(!p.includes("down")&&et>0&&(an=et**ns),!p.includes("up")&&et<0&&(an=-(Math.abs(et)**ns))),{x:kt,y:an}}const Jt=vo(tt=>{if(tt.pointerId!==_e.current)return;_e.current=null,fe.current?.abort(),fe.current=null,P(!1),L(!1),le(null);const et=ie.current;if(tt.type==="pointercancel"||W.current){jt({x:et.x,y:et.y}),b(void 0);return}let kt=!1;const an=ae.current,zt=an.x-et.x,At=an.y-et.y;let xt;for(const ar of p){switch(ar){case"right":zt>Hc&&(kt=!0,xt="right");break;case"left":zt<-Hc&&(kt=!0,xt="left");break;case"down":At>Hc&&(kt=!0,xt="down");break;case"up":At<-Hc&&(kt=!0,xt="up");break}if(kt)break}kt?(b(xt),A(!0),v.closeToast(a.id)):(jt({x:et.x,y:et.y}),b(void 0))});function nr(tt){if(tt.button!==0)return;tt.pointerType==="touch"&&v.pauseTimers();const et=no(tt.nativeEvent);if(et?et.closest(`button,a,input,textarea,[role="button"],${vW}`):!1)return;if(W.current=!1,$.current=void 0,X.current=0,_e.current=tt.pointerId,te.current={x:tt.clientX,y:tt.clientY},O.current=te.current,re.current){const zt=pW(re.current);ie.current=zt,S(zt),jt({x:zt.x,y:zt.y})}v.setHovering(!0),P(!0),L(!1),le(null),Y.current=!0;const an=re.current;if(an){fe.current?.abort();const zt=new AbortController;fe.current=zt;const At=br(an);At.addEventListener("pointerup",Jt,{signal:zt.signal}),At.addEventListener("pointercancel",Jt,{signal:zt.signal}),an.setPointerCapture?.(tt.pointerId)}}function Mn(tt){if(tt.pointerId!==_e.current)return;tt.preventDefault(),Y.current&&(te.current={x:tt.clientX,y:tt.clientY},Y.current=!1);const{clientY:et,clientX:kt,movementX:an,movementY:zt}=tt;(zt<0&&et>O.current.y||zt>0&&et<O.current.y)&&(O.current={x:O.current.x,y:et}),(an<0&&kt>O.current.x||an>0&&kt<O.current.x)&&(O.current={x:kt,y:O.current.y});const At=kt-te.current.x,xt=et-te.current.y,ar=et-O.current.y,ec=kt-O.current.x;if(!E&&Math.sqrt(At*At+xt*xt)>=gW&&(L(!0),ce===null)){const rr=p.includes("left")||p.includes("right"),bs=p.includes("up")||p.includes("down");if(rr&&bs){const Ri=Math.abs(At),wa=Math.abs(xt);le(Ri>wa?"horizontal":"vertical")}}let En;if(!$.current)ce==="vertical"?xt>0?En="down":xt<0&&(En="up"):ce==="horizontal"?At>0?En="right":At<0&&(En="left"):Math.abs(At)>=Math.abs(xt)?En=At>0?"right":"left":En=xt>0?"down":"up",En&&p.includes(En)&&($.current=En,X.current=xP(En,At,xt),b(En));else{const Sr=$.current,rr=xP(Sr,ec,ar);rr>Hc?(W.current=!1,b(Sr)):!(p.includes("left")&&p.includes("right"))&&!(p.includes("up")&&p.includes("down"))&&X.current-rr>=mW&&(W.current=!0)}const ti=_t(At,xt);let Xn=ie.current.x,Pr=ie.current.y;ce==="horizontal"?(p.includes("left")||p.includes("right"))&&(Xn+=ti.x):(ce==="vertical"||(p.includes("left")||p.includes("right"))&&(Xn+=ti.x),(p.includes("up")||p.includes("down"))&&(Pr+=ti.y)),jt({x:Xn,y:Pr})}function Vt(tt){if(tt.key==="Escape"){if(!re.current||!Ai(re.current,Pl(br(re.current))))return;v.closeToast(a.id)}}k.useEffect(()=>{if(!m)return;const tt=re.current;if(!tt)return;function et(kt){_e.current===null||!Ai(tt,no(kt))||kt.preventDefault()}return to(tt,"touchmove",et,{passive:!1})},[m]);function Xe(){if(!x&&D.x===j.x&&D.y===j.y&&!T)return{[zs.swipeMovementX]:"0px",[zs.swipeMovementY]:"0px"};const tt=D.x-j.x,et=D.y-j.y;return{transition:x?"none":void 0,transform:x?`translateX(${D.x}px) translateY(${D.y}px) scale(${j.scale})`:void 0,[zs.swipeMovementX]:`${tt}px`,[zs.swipeMovementY]:`${et}px`}}const ot=a.priority==="high",Dt={role:ot?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":N,"aria-describedby":Q,"aria-hidden":ot&&!Ie?!0:void 0,onPointerDown:m?nr:void 0,onPointerMove:m?Mn:void 0,onPointerUp:m?Jt:void 0,onPointerCancel:m?Jt:void 0,onKeyDown:Vt,inert:tW(a.limited),style:{...Xe(),[zs.index]:a.transitionStatus==="ending"?ve:Ne,[zs.offsetY]:`${Oe}px`,[zs.height]:a.height?`${a.height}px`:void 0}},Et=k.useMemo(()=>({rootRef:re,toast:a,titleId:N,setTitleId:U,descriptionId:Q,setDescriptionId:ee,swiping:x,swipeDirection:y,recalculateHeight:un,index:ve,visibleIndex:Ne,expanded:St}),[a,N,Q,x,y,un,ve,Ne,St]),Nn={transitionStatus:a.transitionStatus,expanded:St,limited:a.limited||!1,type:a.type,swiping:Et.swiping,swipeDirection:Et.swipeDirection},xr=ou("div",e,{ref:[n,Et.rootRef],state:Nn,stateAttributesMapping:fW,props:[Dt,u]});return R.jsx($4.Provider,{value:Et,children:xr})});let PP=0;function yW(t,e="mui"){const[n,a]=k.useState(t),r=t||n;return k.useEffect(()=>{n==null&&(PP+=1,a(`${e}-${PP}`))},[n,e]),r}const SP=ub.useId;function H4(t,e){if(SP!==void 0){const n=SP();return t??(e?`${e}-${n}`:n)}return yW(t,e)}const bW=k.forwardRef(function(e,n){const{render:a,className:r,style:s,id:l,children:c,...u}=e,{toast:h,setTitleId:p}=V4(),m=c??h.title,v=!!m,y=H4(l);Ka(()=>{if(v)return p(y),()=>{p(void 0)}},[v,y,p]);const b={type:h.type},x=ou("h2",e,{ref:n,state:b,props:{...u,id:y,children:m}});return v?x:null}),kW=k.createContext(void 0);function wW(t=!1){const e=k.useContext(kW);if(e===void 0&&!t)throw new Error(Xl(16));return e}function xW(t){const{focusableWhenDisabled:e,disabled:n,composite:a=!1,tabIndex:r=0,isNativeButton:s}=t,l=a&&e!==!1,c=a&&e===!1;return{props:k.useMemo(()=>{const h={onKeyDown(p){n&&e&&p.key!=="Tab"&&p.preventDefault()}};return a||(h.tabIndex=r,!s&&n&&(h.tabIndex=e?r:-1)),(s&&(e||l)||!s&&n)&&(h["aria-disabled"]=n),s&&(!e||c)&&(h.disabled=n),h},[a,n,e,l,c,s,r])}}function PW(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:a=0,native:r=!0,composite:s}=t,l=k.useRef(null),c=wW(!0),u=s??c!==void 0,{props:h}=xW({focusableWhenDisabled:n,disabled:e,composite:u,tabIndex:a,isNativeButton:r}),p=k.useCallback(()=>{const y=l.current;kv(y)&&u&&e&&h.disabled===void 0&&y.disabled&&(y.disabled=!1)},[e,h.disabled,u]);Ka(p,[p]);const m=k.useCallback((y={})=>{const{onClick:b,onMouseDown:x,onKeyUp:P,onKeyDown:E,onPointerDown:L,...T}=y;return _b({onClick(A){if(e){A.preventDefault();return}b?.(A)},onMouseDown(A){e||x?.(A)},onKeyDown(A){if(e||(Xp(A),E?.(A),A.baseUIHandlerPrevented))return;const D=A.target===A.currentTarget,B=A.currentTarget,j=kv(B),S=!r&&SW(B),N=D&&(r?j:!S),U=A.key==="Enter",Q=A.key===" ",ee=B.getAttribute("role"),ce=ee?.startsWith("menuitem")||ee==="option"||ee==="gridcell";if(D&&u&&Q){if(A.defaultPrevented&&ce)return;A.preventDefault(),S||r&&j?(B.click(),A.preventBaseUIHandler()):N&&(b?.(A),A.preventBaseUIHandler());return}N&&(!r&&(Q||U)&&A.preventDefault(),!r&&U&&b?.(A))},onKeyUp(A){if(!e){if(Xp(A),P?.(A),A.target===A.currentTarget&&r&&u&&kv(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!r&&!u&&A.key===" "&&b?.(A)}},onPointerDown(A){if(e){A.preventDefault();return}L?.(A)}},r?{type:"button"}:{role:"button"},h,T)},[e,h,u,r]),v=vo(y=>{l.current=y,p()});return{getButtonProps:m,buttonRef:v}}function kv(t){return fs(t)&&t.tagName==="BUTTON"}function SW(t){return!!(t?.tagName==="A"&&t?.href)}const CW=k.forwardRef(function(e,n){const{render:a,className:r,style:s,disabled:l,nativeButton:c=!0,...u}=e,h=cb(),{toast:p}=V4(),m=h.useState("expanded"),[v,y]=k.useState(!1),{getButtonProps:b,buttonRef:x}=PW({disabled:l,native:c}),P={type:p.type};return ou("button",e,{ref:[n,x],state:P,props:[{"aria-hidden":!m&&!v,onClick(){h.closeToast(p.id)},onFocus(){y(!0)},onBlur(){y(!1)}},u,b]})}),VZ="none",HZ="trigger-press",WZ="trigger-hover",GZ="outside-press",qZ="item-press",KZ="close-press",TW="focus-out",YZ="escape-key",ZZ="list-navigation",JZ="cancel-open",QZ="imperative-action",XZ="window-resize";function EW(t,e,n,a){let r=!1,s=!1;const l=eo;return{reason:t,event:e??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...l}}function AW(t){return`data-base-ui-${t}`}const W4=k.createContext(null),RW=()=>k.useContext(W4),LW=AW("portal");function G4(t={}){const{ref:e,container:n,componentProps:a=eo,elementProps:r}=t,s=H4(),c=RW()?.portalNode,[u,h]=k.useState(null),[p,m]=k.useState(null),v=vo(P=>{P!==null&&m(P)}),y=k.useRef(null);Ka(()=>{if(n===null){y.current&&(y.current=null,m(null),h(null));return}if(s==null)return;const P=(n&&(hb(n)?n:n.current))??c??document.body;if(P==null){y.current&&(y.current=null,m(null),h(null));return}y.current!==P&&(y.current=P,m(null),h(P))},[n,c,s]);const b=ou("div",a,{ref:[e,v],props:[{id:s,[LW]:""},r]});return{portalNode:p,portalSubtree:u&&b?Vl.createPortal(b,u):null}}const eJ=k.forwardRef(function(e,n){const{render:a,className:r,style:s,children:l,container:c,renderGuards:u,...h}=e,{portalNode:p,portalSubtree:m}=G4({container:c,ref:n,componentProps:e,elementProps:h}),v=k.useRef(null),y=k.useRef(null),b=k.useRef(null),x=k.useRef(null),[P,E]=k.useState(null),L=k.useRef(!1),T=P?.modal,A=P?.open,D=typeof u=="boolean"?u:!!P&&!P.modal&&P.open&&!!p;k.useEffect(()=>{if(!p||T)return;function j(S){p&&S.relatedTarget&&yv(S)&&(S.type==="focusin"?L.current&&(bP(p),L.current=!1):(NH(p),L.current=!0))}return y4(to(p,"focusin",j,!0),to(p,"focusout",j,!0))},[p,T]),Ka(()=>{!p||A!==!0||!L.current||(bP(p),L.current=!1)},[A,p]);const B=k.useMemo(()=>({beforeOutsideRef:v,afterOutsideRef:y,beforeInsideRef:b,afterInsideRef:x,portalNode:p,setFocusManagerState:E}),[p]);return R.jsxs(k.Fragment,{children:[m,R.jsxs(W4.Provider,{value:B,children:[D&&p&&R.jsx(wd,{"data-type":"outside",ref:v,onFocus:j=>{if(yv(j,p))b.current?.focus();else{const S=P?P.domReference:null;MH(S)?.focus()}}}),D&&p&&R.jsx("span",{"aria-owns":p.id,style:hW}),p&&Vl.createPortal(l,p),D&&p&&R.jsx(wd,{"data-type":"outside",ref:y,onFocus:j=>{if(yv(j,p))x.current?.focus();else{const S=P?P.domReference:null;IH(S)?.focus(),P?.closeOnFocusOut&&P?.onOpenChange(!1,EW(TW,j.nativeEvent))}}})]})]})}),DW=k.forwardRef(function(e,n){const{children:a,container:r,className:s,render:l,style:c,...u}=e,{portalNode:h,portalSubtree:p}=G4({container:r,ref:n,componentProps:e,elementProps:u});return!p&&!h?null:R.jsxs(k.Fragment,{children:[p,h&&Vl.createPortal(a,h)]})}),IW=DW;function MW(){const t=k.useContext(lb);if(!t)throw new Error(Xl(73));const e=t.useState("toasts");return k.useMemo(()=>({toasts:e,add:t.addToast,close:t.closeToast,update:t.updateToast,promise:t.promiseToast}),[e,t])}function NW(){const t=new Set;function e(n){t.forEach(a=>a(n))}return{" subscribe":function(a){return t.add(a),()=>{t.delete(a)}},add(n){const a=n.id||b4("toast"),r={...n,id:a,transitionStatus:"starting"};return e({action:"add",options:r}),a},close(n){e({action:"close",options:{id:n}})},update(n,a){e({action:"update",options:{...a,id:n}})},promise(n,a){let r=n;return e({action:"promise",options:{...a,promise:n,setPromise(s){r=s}}}),r}}}const kb=NW();function tJ(t){return kb.add(t)}function OW({children:t}){return R.jsxs(jH,{toastManager:kb,children:[t,R.jsx(IW,{children:R.jsx(eW,{className:"fixed inset-x-0 top-6 z-[100] mx-auto flex w-full max-w-sm flex-col items-center gap-2 px-4 outline-none",children:R.jsx(jW,{})})})]})}function jW(){const{toasts:t}=MW();return t.map(e=>{const n=e.data?.onUndo;return R.jsxs(_W,{toast:e,className:$t("pointer-events-auto flex w-full items-center gap-3 rounded-xl border border-oai-gray-200 bg-oai-white px-4 py-3 shadow-xl transition-all duration-200 ease-out","data-[starting-style]:-translate-y-3 data-[starting-style]:opacity-0","data-[ending-style]:-translate-y-3 data-[ending-style]:opacity-0","dark:border-oai-gray-800 dark:bg-oai-gray-900"),children:[R.jsx(bW,{className:"min-w-0 flex-1 text-sm font-medium text-oai-black dark:text-white"}),n?R.jsx("button",{type:"button",onClick:()=>{n(),kb.close(e.id)},className:"shrink-0 rounded-md px-2 py-1 text-xs font-semibold text-oai-gray-600 transition-colors hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:we("shared.action.undo")}):null,R.jsx(CW,{"aria-label":we("shared.action.dismiss"),className:"-mr-1 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-oai-gray-400 transition-colors hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:R.jsx(C0,{className:"h-3.5 w-3.5","aria-hidden":!0})})]},e.id)})}const wb=Object.freeze(["limits","leaderboard"]),zW=Object.freeze({limits:"/limits",leaderboard:"/leaderboard"}),FW=Object.freeze({limits:()=>In(()=>import("./LimitsPage-DNMNpIgQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),leaderboard:()=>In(()=>import("./LeaderboardPage-cOLb_Ssc.js"),__vite__mapDeps([8,9,10,11,12,13,14,15,16,17,18,19,20]))}),q4="total",K4=0,CP=20,UW=Object.freeze([10,20,50,100]),BW="tokentracker:leaderboard:pageSize",$W=20,VW=Object.freeze(["dashboard-existing","silent-preload","page-load","manual-refresh"]);let TP=0,Ja;class HW{constructor(e={}){this.limits=null,this.leaderboard=new Map,this.leaderboardMaxEntries=qW(e.leaderboardMaxEntries)}read(e,n){return lu(e),e==="limits"?!this.limits||this.limits.contextKey!==n?null:up(this.limits):n?up(this.leaderboard.get(n)):null}write(e,n={}){if(e.targetKey==="limits"){this.limits=e;return}this.leaderboard.has(e.contextKey)&&this.leaderboard.delete(e.contextKey),this.leaderboard.set(e.contextKey,e),this.evictLeaderboardEntries(n.activeContextKey||e.contextKey)}evictLeaderboardEntries(e=null){for(;this.leaderboard.size>this.leaderboardMaxEntries;){const n=Array.from(this.leaderboard.keys()).find(a=>a!==e)||this.leaderboard.keys().next().value;this.leaderboard.delete(n)}}snapshot(){return{limits:up(this.limits),leaderboard:{maxEntries:this.leaderboardMaxEntries,size:this.leaderboard.size,keys:Array.from(this.leaderboard.keys())}}}}class WW{constructor(e={}){TP+=1,this.sessionId=`dashboard-preload-${TP}`,this.createdAt=Date.now(),this.completedAt=null,this.startedAfterMainContentVisible=!1,this.cache=new HW(e),this.targets={limits:EP("limits"),leaderboard:EP("leaderboard")}}}function EP(t){return{key:t,route:zW[t],resourceStatus:"idle",stateStatus:"idle",error:null,resourcePromise:null,resourceModule:null,resourceRequestId:0,statePromise:null,stateRequestId:0,pendingStateContextKey:null}}function GW(t={}){return new WW(t)}function qW(t){const e=Number(t);return!Number.isInteger(e)||e<1?$W:e}Ja=GW();function lu(t){if(!wb.includes(t))throw new Error(`Unknown dashboard preload target: ${t}`)}function Y4(t){return t?typeof t=="string"?t:t.message||String(t):null}function KW(t,e){return VW.includes(t)?t:e}function YW(t){const e=Number(t);return Number.isFinite(e)?e:Date.now()}function up(t){return t?{...t}:null}function AP(){const t=wb.every(e=>{const n=Ja.targets[e];return n.resourceStatus==="fulfilled"||n.resourceStatus==="rejected"});Ja.completedAt=t?Date.now():null}function ZW(){Ja.startedAfterMainContentVisible=!0}function xb(t,e={}){lu(t);const n=Object.entries(e).filter(([,a])=>a!==void 0).sort(([a],[r])=>a.localeCompare(r)).map(([a,r])=>`${a}=${r===null?"null":String(r)}`);return`${t}:${n.join("|")}`}function JW(t,e={}){lu(t);const n=Ja.targets[t];if(n.resourceStatus==="fulfilled")return Promise.resolve(n.resourceModule);if(n.resourceStatus==="pending"&&n.resourcePromise)return n.resourcePromise;const a=e.loader||FW[t],r=n.resourceRequestId+1;n.resourceRequestId=r,n.resourceStatus="pending",n.error=null;const s=Promise.resolve().then(()=>a()).then(l=>n.resourceRequestId!==r||n.resourcePromise!==s?null:(n.resourceStatus="fulfilled",n.resourceModule=l,n.error=null,AP(),l)).catch(l=>(n.resourceRequestId!==r||n.resourcePromise!==s||(n.resourceStatus="rejected",n.error=Y4(l),AP()),null));return n.resourcePromise=s,s}function QW(t={}){const e=t.loaders||{};return Promise.all(wb.map(n=>JW(n,{loader:e[n]})))}function Z4(t,e){lu(t);const n=Ja.targets[t],a=e?.status||"fulfilled",r={targetKey:t,status:a,data:e?.data??null,error:Y4(e?.error),source:KW(e?.source,"silent-preload"),generatedAt:YW(e?.generatedAt),updatedAt:Date.now(),contextKey:e?.contextKey||xb(t,e?.context||{})};return n.stateStatus=a,a==="rejected"||a==="skipped"?n.error=r.error:a==="fulfilled"&&(n.error=null,Ja.cache.write(r,{activeContextKey:e?.activeContextKey})),up(r)}function J4(t,e){return lu(t),Ja.cache.read(t,e)}function nJ(t,e={}){return Z4("limits",{data:t,source:e.source||"dashboard-existing",contextKey:e.contextKey||Q4(e.context||{}),generatedAt:e.generatedAt,status:e.status||"fulfilled",error:e.error})}function Q4(t={}){return xb("limits",{state:"current",...t})}function aJ(t=Q4()){return J4("limits",t)}function ey(t,e={}){return Z4("leaderboard",{activeContextKey:e.activeContextKey,data:t,source:e.source||"silent-preload",contextKey:e.contextKey||Pb(e.context||{}),generatedAt:e.generatedAt,status:e.status||"fulfilled",error:e.error})}function XW(t){return J4("leaderboard",t)}function X4(){if(typeof window>"u")return CP;try{const t=window.localStorage.getItem(BW),e=Number(t);if(UW.includes(e))return e}catch{}return CP}function eE(t={}){const e=t.userId;return e!==void 0?e||null:t.cloudUser?.id||null}function tE(t={}){return typeof t.accessMode=="string"&&t.accessMode.trim()?t.accessMode.trim():t.mockEnabled?"mock":t.baseUrl?"cloud":"unavailable"}function Pb(t={}){const e=!!t.mockEnabled,n=t.baseUrl??"";return xb("leaderboard",{accessMode:tE({...t,baseUrl:n,mockEnabled:e}),baseUrl:n,mockEnabled:e,offset:t.offset??K4,pageSize:t.pageSize??X4(),period:t.period||q4,userId:eE(t)})}function Ih(t,e){const n=Ja.targets.leaderboard;return n.stateRequestId+=1,n.statePromise=null,n.pendingStateContextKey=null,ey(null,{contextKey:e,status:"skipped",error:t})}function eG(t={}){const e=Ja,n=!!t.mockEnabled,a=t.baseUrl??"",r=tE({...t,baseUrl:a,mockEnabled:n}),s=t.period||q4,l=t.pageSize??X4(),c=t.offset??K4,u=eE(t),h=Pb({accessMode:r,baseUrl:a,mockEnabled:n,offset:c,pageSize:l,period:s,userId:u});if(!n&&t.authLoading)return Promise.resolve(Ih("auth-loading",h));if(!n&&!t.signedIn&&r!=="public")return Promise.resolve(Ih("not-signed-in",h));if(!n&&!a)return Promise.resolve(Ih("missing-base-url",h));if(!n&&r==="unavailable")return Promise.resolve(Ih("access-unavailable",h));const p=e.targets.leaderboard,m=XW(h);if(m)return Promise.resolve(m);if(p.stateStatus==="pending"&&p.statePromise&&p.pendingStateContextKey===h)return p.statePromise;const v=p.stateRequestId+1;p.stateRequestId=v,p.stateStatus="pending",p.pendingStateContextKey=h,p.error=null;const y=Promise.resolve().then(()=>w9({userId:u,period:s,limit:l,offset:c})).then(b=>Ja!==e||p.stateRequestId!==v||p.statePromise!==y?null:(p.pendingStateContextKey=null,ey(b,{contextKey:h}))).catch(b=>(Ja!==e||p.stateRequestId!==v||p.statePromise!==y||(p.pendingStateContextKey=null,ey(null,{contextKey:h,status:"rejected",error:b})),null));return p.statePromise=y,y}const tG=typeof window<"u"?window.location.search:"",RP=new URLSearchParams(tG),Mh=RP.get("insforge_code")||RP.get("code")||null,nG=typeof window<"u"&&!!window.webkit?.messageHandlers?.nativeOAuth;function aG(){Kl();const{loading:t,signedIn:e}=wo(),n=$l(),[a,r]=k.useState("processing"),[s,l]=k.useState(null),c=k.useRef(!1);k.useEffect(()=>{if(!(!Mh||c.current)){if(c.current=!0,nG){l(!1);return}(async()=>{try{const p=await(await fetch("/api/auth-bridge/verifier")).json();l(!!p?.native)}catch{l(!1)}})()}},[]),k.useEffect(()=>{if(s!==!0||!Mh)return;r("redirecting");const h=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(Mh)}`},200);return()=>clearTimeout(h)},[s]),k.useEffect(()=>{if(s!==!1||t)return;if(e){n("/dashboard",{replace:!0});return}const h=setTimeout(()=>{e||r("failed")},12e3);return()=>clearTimeout(h)},[s,t,e,n]),k.useEffect(()=>{if(!Mh&&s===null){const h=setTimeout(()=>r("failed"),3e3);return()=>clearTimeout(h)}},[s]);const u=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&s!==!0&&(s===null||s===!1&&t)?R.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):R.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:R.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&R.jsxs(R.Fragment,{children:[R.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),R.jsx("p",{className:"text-oai-gray-400 text-sm",children:we("auth.callback.processing")})]}),a==="redirecting"&&R.jsxs(R.Fragment,{children:[R.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:R.jsx("svg",{className:"w-6 h-6 text-green-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:R.jsx("path",{d:"M20 6 9 17l-5-5"})})}),R.jsx("p",{className:"text-white text-sm font-medium",children:we("auth.callback.success")}),R.jsx("p",{className:"text-oai-gray-500 text-xs",children:we("auth.callback.redirecting")})]}),a==="failed"&&R.jsxs("div",{className:"space-y-3",children:[R.jsx("p",{className:"text-oai-gray-300 text-sm",children:we("auth.callback.failed")}),R.jsx("button",{type:"button",onClick:u,className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:we("auth.callback.close")})]})]})})}const rG=k.lazy(()=>In(()=>import("./DashboardPage-BjYHD7cb.js"),__vite__mapDeps([21,13,1,14,15,22,23,24,11,25,3,9,10,12,26,27,28,4,29,30,31])).then(t=>({default:t.DashboardPage}))),iG=k.lazy(()=>In(()=>import("./IpCheckPage-2JMGIL_x.js"),[])),sG=k.lazy(()=>In(()=>import("./AchievementsPage-B8wkE9xP.js"),__vite__mapDeps([32,33,17,18,19,34]))),oG=k.lazy(()=>In(()=>import("./LandingPage-B42AweLO.js"),__vite__mapDeps([35,36,20,12,37,7,31,34])).then(t=>({default:t.LandingPage}))),lG=k.lazy(()=>In(()=>import("./LeaderboardPage-cOLb_Ssc.js"),__vite__mapDeps([8,9,10,11,12,13,14,15,16,17,18,19,20])).then(t=>({default:t.LeaderboardPage}))),cG=k.lazy(()=>In(()=>import("./LeaderboardProfilePage-Pg2Sggtd.js"),__vite__mapDeps([38,14,36,39,22,15,23,16,17,18,19,33,34,6,40,12,24,11,7])).then(t=>({default:t.LeaderboardProfilePage}))),dG=k.lazy(()=>In(()=>import("./LimitsPage-DNMNpIgQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(t=>({default:t.LimitsPage}))),uG=k.lazy(()=>In(()=>import("./LoginPage-DlZ1jBtd.js"),[]).then(t=>({default:t.LoginPage}))),hG=k.lazy(()=>In(()=>import("./ResetPasswordPage-PbCAaF56.js"),[]).then(t=>({default:t.ResetPasswordPage}))),pG=k.lazy(()=>In(()=>import("./DevicePage-DHBd7LbW.js"),[])),fG=k.lazy(()=>In(()=>import("./WrappedPage-2ZN38qnG.js"),[])),mG=k.lazy(()=>In(()=>import("./SettingsPage-DloJH8fs.js"),__vite__mapDeps([41,2,42,3,30,12,37,14,15,9,10,11,23,43,44,24,45,7])).then(t=>({default:t.SettingsPage}))),gG=k.lazy(()=>In(()=>import("./SkillsPage-DHhXoof-.js"),__vite__mapDeps([46,5,6,7,3,44,24,11,45,23,14,28,12,47,10,19,26])).then(t=>({default:t.SkillsPage}))),vG=k.lazy(()=>In(()=>import("./WidgetsPage-CNGHvVDr.js"),__vite__mapDeps([48,9,10,11,12,43,42,3,4,6,7])).then(t=>({default:t.WidgetsPage}))),_G=k.lazy(()=>In(()=>import("./PetPage-5Qk5nTRF.js"),__vite__mapDeps([49,42,3,29,4,40,28,18,47])).then(t=>({default:t.PetPage})));function yG(){const{resolvedLocale:t}=Kl(),e=ya(),n=wo();q$();const a=k.useRef(!1),r=k.useRef(!1),s=k.useRef(new Set),l=bn(),c=k.useMemo(()=>typeof window>"u"?!1:z$(window.location.search),[]),u=e?.pathname||"/",h=new URL(window.location.href),p=h.pathname.replace(/\/+$/,"")||"/",v=p.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,y=h.searchParams.get("token")||null,b=v||y,x=p==="/share"||p==="/share.html"||p.startsWith("/share/"),P=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),E=u.replace(/\/+$/,"")||"/",L=E==="/"||E==="/dashboard",T=E==="/leaderboard",A=E.match(/^\/u\/([^/]+)$/i),D=A?A[1]:null,B=!!(n.enabled&&n.signedIn),j=P||B,S=!1,N=O$(),U=!j&&!l&&!P,Q=l?"mock":n.loading?"unavailable":B?"cloud":j?"local":"unavailable",ee=k.useCallback(()=>{if(!a.current||!l&&n.loading||!l&&!j)return;const Ne={accessMode:Q,baseUrl:j$(),mockEnabled:l,signedIn:j,authLoading:!!n.loading,userId:B&&n.user?.id||null},Oe=Pb(Ne);s.current.has(Oe)||(s.current.add(Oe),eG(Ne))},[B,n.loading,n.user?.id,Q,l,j]),ce=k.useCallback(()=>{L&&(a.current||(a.current=!0,ZW()),r.current||(r.current=!0,QW()),ee())},[L,ee]);k.useEffect(()=>{ee()},[ee]);const le=k.useMemo(()=>!n.enabled||!B?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[B,n]);let re=P||l||c?"dashboard":"landing";E==="/landing"&&(re="landing"),E==="/dashboard"&&(re="dashboard"),T&&(re="dashboard"),D&&(re="dashboard");const te=E==="/limits",ie=E==="/settings",$=E==="/skills",X=E==="/widgets",W=E==="/pet-settings",O=E==="/ip-check",Y=E==="/achievements";(te||ie||$||X||W||O||Y)&&(re="dashboard");let ae=rG;D?ae=cG:E==="/leaderboard"?ae=lG:te?ae=dG:ie?ae=mG:$?ae=gG:X?ae=vG:W?ae=_G:O?ae=iG:Y&&(ae=sG);const _e=!x&&!U&&(E==="/dashboard"||E==="/"||T||te||ie||$||X||W||O||Y);if(!P&&!B&&!x&&!n.loading&&re==="dashboard"&&!T&&!D&&E!=="/login"&&E!=="/reset-password"&&E!=="/landing"&&E!=="/auth/callback"&&E!=="/auth/native-callback")return R.jsx(d8,{to:"/login",replace:!0});let ve=null;if(E==="/auth/callback"||E==="/auth/native-callback")ve=R.jsx(aG,{});else if(E==="/login")ve=R.jsx(uG,{});else if(E==="/reset-password")ve=R.jsx(hG,{});else if(E==="/device")ve=R.jsx(pG,{});else if(E==="/wrapped")ve=R.jsx(fG,{});else if(re==="landing")ve=R.jsx(oG,{signInUrl:"/login",signUpUrl:"/login"});else{const Ne=R.jsx(ae,{baseUrl:N,auth:le,signedIn:j,sessionSoftExpired:S,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:x,publicToken:b,userId:D,signInUrl:"/login",signUpUrl:"/login",onMainContentVisible:ce},t);_e?ve=R.jsx(dV,{children:Ne}):ve=Ne}return R.jsx(LO,{children:R.jsx(MO,{children:R.jsx(OW,{children:R.jsxs(NO,{children:[R.jsx(k.Suspense,{fallback:null,children:ve}),_e?R.jsx(FV,{}):null,R.jsx(I$,{}),R.jsx(AN,{}),R.jsx(UN,{})]})})})})}var Z=typeof window<"u"?window:void 0,Tn=typeof globalThis<"u"?globalThis:Z;typeof self>"u"&&(Tn.self=Tn),typeof File>"u"&&(Tn.File=function(){});var sa=Tn?.navigator,xe=Tn?.document,fn=Tn?.location,Sb=Tn?.fetch,ty=Tn!=null&&Tn.XMLHttpRequest&&"withCredentials"in new Tn.XMLHttpRequest?Tn.XMLHttpRequest:void 0,LP=Tn?.AbortController,bG=Tn?.CompressionStream,va=sa?.userAgent,Be=Z??{};function nE(){return!(!Z||Z.navigator.onLine===!1)}var DP="1.402.0",en={DEBUG:!1,LIB_VERSION:DP,LIB_NAME:"web",JS_SDK_VERSION:DP};function IP(t,e,n,a,r,s,l){try{var c=t[s](l),u=c.value}catch(h){return void n(h)}c.done?e(u):Promise.resolve(u).then(a,r)}function cn(t){return function(){var e=this,n=arguments;return new Promise((function(a,r){var s=t.apply(e,n);function l(u){IP(s,a,r,l,c,"next",u)}function c(u){IP(s,a,r,l,c,"throw",u)}l(void 0)}))}}function he(){return he=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var a in n)({}).hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},he.apply(null,arguments)}function aE(t,e){if(t==null)return{};var n={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;n[a]=t[a]}return n}var MP=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function NP(t){return typeof t=="string"||t}function OP(t){return typeof t=="string"?t:void 0}var Wc,ki=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),jP=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),kG=["$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"],wG=["token"],rE="NativeGzipValidationError",ny=t=>t.length>=2&&t[0]===31&&t[1]===139,zP=(t,e)=>t===jP.GZipJS||e===jP.GZipJS||e==="gzip",FP=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Nh=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=rE,e},xG=(function(){var t=cn((function*(e,n){18>e.size&&Nh("too-short");var a=new Uint8Array(yield e.slice(0,10).arrayBuffer());ny(a)&&a[2]===8||Nh("invalid-header");var r=new DataView(yield e.slice(e.size-8).arrayBuffer());r.getUint32(0,!0)!==(l=>{for(var c=(()=>{if(Wc)return Wc;Wc=[];for(var p=0;256>p;p++){for(var m=p,v=0;8>v;v++)m=1&m?3988292384^m>>>1:m>>>1;Wc[p]=m>>>0}return Wc})(),u=4294967295,h=0;l.length>h;h++)u=c[255&(u^l[h])]^u>>>8;return(4294967295^u)>>>0})(n)&&Nh("invalid-crc");var s=n.length>>>0;r.getUint32(4,!0)!==s&&Nh("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function ay(){return ay=cn((function*(t,e,n){e===void 0&&(e=!0);try{var a=new TextEncoder().encode(t),r=new CompressionStream("gzip"),s=r.writable.getWriter(),l=s.write(a).then((()=>s.close())).catch((function(){var h=cn((function*(p){try{yield s.abort(p)}catch{}throw p}));return function(p){return h.apply(this,arguments)}})()),c=new Response(r.readable).blob(),u=(yield Promise.all([c,l]))[0];return yield xG(u,a),u}catch(h){if(n!=null&&n.rethrow)throw h;return e&&console.error("Failed to gzip compress data",h),null}})),ay.apply(this,arguments)}var PG=["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"],UP=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return PG.concat(e).some((a=>{var r=a.toLowerCase();return n.indexOf(r)!==-1}))};function Ke(t,e){return t.indexOf(e)!==-1}var Gf=function(t){return t.trim()},ry=function(t){return t.replace(/^\$/,"")};function iE(t){var e,n=[];return(e=JSON.stringify(t,(function(a,r){if(typeof r=="bigint")return r.toString();if(typeof r!="function"&&typeof r!="symbol"){if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&typeof r=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(r))return"[Circular]";n.push(r)}return r}})))!==null&&e!==void 0?e:"null"}var sE=Object.prototype,oE=sE.hasOwnProperty,qf=sE.toString,it=Array.isArray||function(t){return qf.call(t)==="[object Array]"},yr=t=>typeof t=="function",qt=t=>t===Object(t)&&!it(t),cs=t=>{if(qt(t)){for(var e in t)if(oE.call(t,e))return!1;return!0}return!1},ke=t=>t===void 0,Lt=t=>qf.call(t)=="[object String]",iy=t=>Lt(t)&&t.trim().length===0,la=t=>t===null,nt=t=>ke(t)||la(t),Bn=t=>qf.call(t)=="[object Number]"&&t==t,yi=t=>Bn(t)&&t>0,Hr=t=>qf.call(t)==="[object Boolean]",SG=t=>t instanceof FormData,CG=t=>Ke(kG,t),TG=t=>Ke(wG,t);function lE(t){return t===null||typeof t!="object"}function ef(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Cb(t){return typeof Event<"u"&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var EG=[!0,"true",1,"1","yes"],wv=t=>Ke(EG,t),AG=[!1,"false",0,"0","no"];function Br(t,e,n,a,r){return e>n&&(a.warn("min cannot be greater than max."),e=n),Bn(t)?t>n?(a.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(a.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(a.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),Br(r||n,e,n,a))}class RG{constructor(e){this.Pe={},this.Oe=e.Oe,this.Fe=Br(e.bucketSize,0,100,e.Ae),this.$e=Br(e.refillRate,0,this.Fe,e.Ae),this.Ne=Br(e.refillInterval,0,864e5,e.Ae)}De(e,n){var a=Math.floor((n-e.lastAccess)/this.Ne);a>0&&(e.tokens=Math.min(e.tokens+a*this.$e,this.Fe),e.lastAccess=e.lastAccess+a*this.Ne)}consumeRateLimit(e){var n,a=Date.now(),r=String(e),s=this.Pe[r];return s?this.De(s,a):this.Pe[r]=s={tokens:this.Fe,lastAccess:a},s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.Oe)==null||n.call(this,e)),s.tokens===0)}stop(){this.Pe={}}}var Da="Mobile",tf="iOS",Si="Android",Nl="Tablet",cE=Si+" "+Nl,dE="iPad",uE="Apple",hE=uE+" Watch",xd="Safari",Ol="BlackBerry",pE="Samsung",fE=pE+"Browser",mE=pE+" Internet",oo="Chrome",LG=oo+" OS",gE=oo+" "+tf,Tb="Internet Explorer",vE=Tb+" "+Da,Eb="Opera",DG=Eb+" Mini",Ab="Edge",_E="Microsoft "+Ab,Sl="Firefox",yE=Sl+" "+tf,Bd="Nintendo",$d="PlayStation",Cl="Xbox",bE=Si+" "+Da,kE=Da+" "+xd,od="Windows",sy=od+" Phone",BP="Nokia",oy="Ouya",wE="Generic",IG=wE+" "+Da.toLowerCase(),xE=wE+" "+Nl.toLowerCase(),ly="Konqueror",PE="Oculus Browser",nf="Vivaldi",SE="Yandex",af="Whale",cy="DuckDuckGo",CE="Pale Moon",rf="Waterfox",Pd="Brave",TE="Google Search App",Xt="(\\d+(\\.\\d+)?)",xv=new RegExp("Version/"+Xt),MG=new RegExp(Cl,"i"),NG=new RegExp($d+" \\w+","i"),OG=new RegExp(Bd+" \\w+","i"),Rb=new RegExp(Ol+"|PlayBook|BB10","i"),jG={"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"},EE=function(t,e,n,a){e=e||"";var r=(function(s){return s!=null&&s.brave?Pd:null})(n);return r||(a!=null&&a.detectGoogleSearchApp&&Ke(t,"GSA/")?TE:Ke(t," OPR/")&&Ke(t,"Mini")?DG:Ke(t," OPR/")?Eb:Rb.test(t)?Ol:Ke(t,"IE"+Da)||Ke(t,"WPDesktop")?vE:Ke(t,"OculusBrowser")?PE:Ke(t,fE)?mE:Ke(t,Ab)||Ke(t,"Edg/")?_E:Ke(t,nf+"/")?nf:Ke(t,"YaBrowser/")?SE:Ke(t,af+"/")?af:Ke(t,cy+"/")||Ke(t,"Ddg/")?cy:Ke(t,"FBIOS")?"Facebook "+Da:Ke(t,"UCWEB")||Ke(t,"UCBrowser")?"UC Browser":Ke(t,"CriOS")?gE:Ke(t,"CrMo")||Ke(t,oo)?oo:Ke(t,Si)&&Ke(t,xd)?bE:Ke(t,"FxiOS")?yE:Ke(t.toLowerCase(),ly.toLowerCase())?ly:Ke(t,Pd+"/")?Pd:((s,l)=>l&&Ke(l,uE)||(function(c){return Ke(c,xd)&&!Ke(c,oo)&&!Ke(c,Si)})(s))(t,e)?Ke(t,Da)?kE:xd:Ke(t,"PaleMoon/")?CE:Ke(t,rf+"/")?rf:Ke(t,Sl)?Sl:Ke(t,"MSIE")||Ke(t,"Trident/")?Tb:Ke(t,"Gecko")?Sl:"")},zG={[vE]:[new RegExp("rv:"+Xt)],[_E]:[new RegExp(Ab+"?\\/"+Xt)],[oo]:[new RegExp("("+oo+"|CrMo)\\/"+Xt)],[gE]:[new RegExp("CriOS\\/"+Xt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Xt)],[xd]:[xv],[kE]:[xv],[Eb]:[new RegExp("(Opera|OPR)\\/"+Xt)],[Sl]:[new RegExp(Sl+"\\/"+Xt)],[yE]:[new RegExp("FxiOS\\/"+Xt)],[ly]:[new RegExp("Konqueror[:/]?"+Xt,"i")],[Ol]:[new RegExp(Ol+" "+Xt),xv],[bE]:[new RegExp("android\\s"+Xt,"i")],[mE]:[new RegExp(fE+"\\/"+Xt)],[PE]:[new RegExp("OculusBrowser\\/"+Xt)],[nf]:[new RegExp(nf+"\\/"+Xt)],[SE]:[new RegExp("YaBrowser\\/"+Xt)],[af]:[new RegExp(af+"\\/"+Xt)],[Pd]:[new RegExp(Pd+"\\/"+Xt)],[cy]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Xt)],[CE]:[new RegExp("PaleMoon\\/"+Xt)],[rf]:[new RegExp(rf+"\\/"+Xt)],[TE]:[new RegExp("GSA\\/"+Xt)],[Tb]:[new RegExp("(rv:|MSIE )"+Xt)],Mozilla:[new RegExp("rv:"+Xt)]},FG=function(t,e,n,a){var r=EE(t,e,n,a),s=zG[r];if(ke(s))return null;for(var l=0;s.length>l;l++){var c=t.match(s[l]);if(c)return parseFloat(c[c.length-2])}return null},$P=[[new RegExp(Cl+"; "+Cl+" (.*?)[);]","i"),t=>[Cl,t&&t[1]||""]],[new RegExp(Bd,"i"),[Bd,""]],[new RegExp($d,"i"),[$d,""]],[Rb,[Ol,""]],[new RegExp(od,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[sy,""];if(new RegExp(Da).test(e)&&!/IEMobile\b/.test(e))return[od+" "+Da,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var a=jG[n[1]]||"";return/arm/i.test(e)&&(a="RT"),[od,a]}return[od,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[tf,[t[3],t[4],t[5]||"0"].join(".")]:[tf,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ke(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Si+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Si+")","i"),t=>t&&t[2]?[Si,[t[2],t[3],t[4]||"0"].join(".")]:[Si,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[LG,""]],[/Linux|debian/i,["Linux",""]]],VP=function(t){return OG.test(t)?Bd:NG.test(t)?$d:MG.test(t)?Cl:new RegExp(oy,"i").test(t)?oy:new RegExp("("+sy+"|WPDesktop)","i").test(t)?sy:/iPad/.test(t)?dE:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?hE:Rb.test(t)?Ol:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(BP,"i").test(t)?BP:/(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(Da).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)?Si:cE:new RegExp("(pda|"+Da+")","i").test(t)?IG:new RegExp(Nl,"i").test(t)&&!new RegExp(Nl+" pc","i").test(t)?xE:""},UG=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function HP(t,e){return typeof(n=t)=="string"&&UG.test(n)?t:e();var n}function ms(t){return t&&t.split("#")[0]}function hp(t,e){var n=setTimeout(t,e);return n?.unref&&n?.unref(),n}var BG=t=>t instanceof Error,AE={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},$G=AE.info;function RE(t){if(Hr(t))return{boolValue:t};if(typeof t=="number")return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if(typeof t=="string")return{stringValue:t};if(it(t))return{arrayValue:{values:t.map((e=>RE(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function sf(t){var e=[];for(var n in t){var a=t[n];la(a)||ke(a)||e.push({key:n,value:RE(a)})}return e}function VG(t,e){var n=AE[t.level||"info"]||$G,a=n.text,r=n.number,s=String(Date.now())+"000000",l={};e.distinctId&&(l.posthogDistinctId=e.distinctId),e.sessionId&&(l.sessionId=e.sessionId),e.windowId&&(l["window.id"]=e.windowId),nt(e.sessionStartTimestamp)||(l.sessionStartTimestamp=String(e.sessionStartTimestamp)),nt(e.lastActivityTimestamp)||(l.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(l["url.full"]=e.currentUrl),e.screenName&&(l["screen.name"]=e.screenName),e.appState&&(l["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(l.feature_flags=e.activeFeatureFlags);var c=he({},l,t.attributes||{}),u={timeUnixNano:s,observedTimeUnixNano:s,severityNumber:r,severityText:a,body:{stringValue:t.body},attributes:sf(c)};return t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),ke(t.trace_flags)||(u.flags=t.trace_flags),u}function LE(t,e,n){return he({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}function DE(t,e,n,a){return{resourceLogs:[{resource:{attributes:sf(e)},scopeLogs:[{scope:{name:n,version:a},logRecords:t}]}]}}let HG=class{constructor(t,e,n,a,r,s,l){var c;s===void 0&&(s=()=>Promise.resolve()),this._instance=t,this.Se=e,this.Ae=n,this.qe=a,this.je=r,this.Be=s,this.He=l,this.Ue=null,this.ze=0,this.We=0,this.Ve=0,this.Ze=0,this.Ge=!1,this.Qe=e.maxBufferSize,this.Je=Math.max((c=e.maxQueueSize)!==null&&c!==void 0?c:e.maxBufferSize,e.maxBufferSize),this.Ke=e.flushIntervalMs,this.Ye=e.maxBatchRecordsPerPost,this.Xe=e.rateCapWindowMs,this.et=e.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.Ve=0,this.Ze=0,this.Ge=!1,this.ze=0,this.We=0,this.Ye=this.Se.maxBatchRecordsPerPost}onReconnect(){this.We=0,this.rt()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.it(t);if(e!==null)if(e.body){if(this.nt()){var n={record:VG(e,this.qe())};this.je((()=>this.st(n)))}}else this.Ae.info("Log was rejected in beforeSend function")}}it(t){var e=this.Se.beforeSend;if(!e)return t;var n=it(e)?e:[e],a=t;for(var r of n)try{var s=r(a);if(!s)return this.Ae.info("Log was rejected in beforeSend function"),null;a=s}catch(l){return this.Ae.error("Error in beforeSend function for log:",l),null}return a}nt(){if(this.et===void 0)return!0;var t=Date.now(),e=t-this.Ve;return this.Xe>e&&e>=0||(this.Ve=t,this.Ze=0,this.Ge=!1),this.et>this.Ze?(this.Ze++,!0):(this.Ge||(this.Ae.warn("captureLog dropping logs: exceeded "+this.et+" logs per "+this.Xe+"ms"),this.Ge=!0),!1)}flush(){var t=this;return cn((function*(){if(!t._instance.isDisabled)return t.Ue||(t.Ue=t.ot().finally((()=>{t.Ue=null}))),t.Ue}))()}ot(){var t=this;return cn((function*(){var e;t.tt();var n=(e=t._instance.getPersistedProperty(ki.LogsQueue))!==null&&e!==void 0?e:[];if(n.length!==0)for(var a=n.length,r=0;n.length>0&&a>r;){var s,l;t.ze=0;var c=Math.min(n.length,t.Ye),u=n.slice(0,c),h=DE(u.map((m=>m.record)),t.ut(),(s=t.He)!==null&&s!==void 0?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),p=yield t._instance.ht(h);if(p.kind==="too-large"&&u.length>1)t.Ye=Math.max(1,Math.floor(u.length/2)),t.Ae.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+t.Ye);else if(p.kind==="retry-later"||(p.kind==="too-large"?t.Ae.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):p.kind==="ok"&&t.Se.maxBatchRecordsPerPost>t.Ye&&(t.Ye=Math.min(t.Se.maxBatchRecordsPerPost,t.Ye+1)),yield t.dt(u.length),n=(l=t._instance.getPersistedProperty(ki.LogsQueue))!==null&&l!==void 0?l:[],r+=u.length,p.kind==="fatal"))throw p.error}}))()}dt(t){var e=this;return cn((function*(){var n,a=Math.max(0,t-e.ze),r=(n=e._instance.getPersistedProperty(ki.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(ki.LogsQueue,r.slice(a)),yield e.Be()}))()}ut(){return LE(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(ki.LogsQueue))!==null&&e!==void 0?e:[];this.Je>n.length||(n.shift(),this.ze++,this.Ae.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(ki.LogsQueue,n),this.Qe>n.length?this.ct():this.rt()}}ct(t){t===void 0&&(t=this.Ke),this.vt||(this.vt=hp((()=>{this.vt=void 0,this.rt()}),t))}ft(){var t=Math.min(Math.max(0,this.We-1),6);return this.Ke*Math.pow(2,t)}yt(){var t=this._instance.getPersistedProperty(ki.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return cn((function*(){e.tt();var n=e.flush().catch((()=>{}));t!==void 0?yield Promise.race([n,new Promise((a=>hp(a,t)))]):yield n}))()}flushWithTimeout(t){var e=this;return cn((function*(){var n=!1,a=e.flush(),r=new Promise((s=>hp((()=>{n=!0,s()}),t)));try{yield Promise.race([a,r])}finally{n&&a.catch((()=>{}))}}))()}rt(){this.flush().then((()=>{this.We=0}),(t=>{this.We++,this.Ae.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())}))}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}};var Pv=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function WP(t){return String(t)+"000000"}function GP(t,e,n,a){var r="";return a&&(r=Object.keys(a).sort().map((s=>JSON.stringify(s)+":"+JSON.stringify(a[s]))).join(",")),t+"\0"+e+"\0"+(n??"")+"\0"+r}let WG=class{constructor(t,e,n){this._instance=t,this.Se=e,this.Ae=n,this.bt=new Map,this.Ue=null,this._t=!1,this.wt=new Map,this.xt=new Set}count(t,e,n){e===void 0&&(e=1),this.kt({name:t,type:"count",value:e,unit:n?.unit,attributes:n?.attributes})}gauge(t,e,n){this.kt({name:t,type:"gauge",value:e,unit:n?.unit,attributes:n?.attributes})}histogram(t,e,n){this.kt({name:t,type:"histogram",value:e,unit:n?.unit,attributes:n?.attributes})}flush(){var t=this,e=this.Ue,n=(function(){var r=cn((function*(){e&&(yield e.catch((()=>{}))),yield t.St()}));return function(){return r.apply(this,arguments)}})(),a=n().finally((()=>{this.Ue===a&&(this.Ue=null)}));return this.Ue=a,a}drainWindow(){if(this.bt.size===0)return null;var t=this.bt;return this.bt=new Map,this._t=!1,this.wt=new Map,this.xt=new Set,this.Ct(t)}reset(){this.tt(),this.bt=new Map,this.Ue=null,this._t=!1,this.wt=new Map,this.xt=new Set}kt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.it(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.Ae.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n=this.wt.get(e.name);n===void 0?this.wt.set(e.name,e.type):n===e.type||this.xt.has(e.name)||(this.xt.add(e.name),this.Ae.warn("Metric name '"+e.name+"' is already used as a "+n+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name."));var a=GP(e.type,e.name,e.unit,e.attributes),r=this.bt.get(a);if(!r){if(this.bt.size>=this.Se.maxSeriesPerFlush)return void(this._t||(this._t=!0,this.Ae.warn("Metric series cap reached ("+this.Se.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")));r={name:e.name,type:e.type,unit:e.unit,attributes:e.attributes?he({},e.attributes):void 0,windowStartMs:Date.now()},this.bt.set(a,r)}this.Tt(r,e.value),this.ct()}else this.Ae.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.Ae.warn("Dropping metric with empty name")}}Tt(t,e){var n;switch(t.type){case"count":t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Pv.length+1).fill(0)});var a=t.hist;a.count+=1,a.sum+=e,a.min=Math.min(a.min,e),a.max=Math.max(a.max,e),a.bucketCounts[(function(r,s){for(var l=0;s.length>l;l++)if(s[l]>=r)return l;return s.length})(e,Pv)]+=1}}it(t){var e=this.Se.beforeSend;if(!e)return t;var n=it(e)?e:[e],a=t;for(var r of n)try{var s=r(a);if(!s)return this.Ae.info("Metric was rejected in beforeSend function"),null;a=s}catch(l){return this.Ae.error("Error in beforeSend function for metric:",l),null}return a}ct(){this.vt||(this.vt=hp((()=>{this.vt=void 0,this.flush().catch((()=>{}))}),this.Se.flushIntervalMs))}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}St(){var t=this;return cn((function*(){if(t.bt.size!==0){var e=t.bt;t.bt=new Map,t._t=!1,t.wt=new Map,t.xt=new Set;var n=yield t._instance.It(t.Ct(e));switch(n.kind){case"ok":return;case"retry-later":return t.Mt(e),void t.ct();case"too-large":return void t.Ae.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.Ae.error("Failed to send metrics batch:",n.error)}}}))()}Ct(t){return(function(r,s,l,c){return{resourceMetrics:[{resource:{attributes:sf(s)},scopeMetrics:[{scope:{name:l,version:c},metrics:r}]}]}})(this.Et(t),(e=this.Se,n=this._instance.getLibraryId(),a=this._instance.getLibraryVersion(),he({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":n,"telemetry.sdk.version":a})),this._instance.getLibraryId(),this._instance.getLibraryVersion());var e,n,a}Et(t){var e=WP(Date.now()),n=new Map;for(var a of t.values()){var r,s=GP(a.type,a.name,a.unit,void 0),l=n.get(s);l||(l=he({name:a.name},a.unit&&{unit:a.unit}),a.type==="count"?l.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:a.type==="gauge"?l.gauge={dataPoints:[]}:l.histogram={aggregationTemporality:1,dataPoints:[]},n.set(s,l));var c=sf((r=a.attributes)!==null&&r!==void 0?r:{}),u=WP(a.windowStartMs);if(a.type==="count"){var h,p={attributes:c,startTimeUnixNano:u,timeUnixNano:e,asDouble:(h=a.total)!==null&&h!==void 0?h:0};l.sum.dataPoints.push(p)}else if(a.type==="gauge"){var m,v={attributes:c,timeUnixNano:e,asDouble:(m=a.last)!==null&&m!==void 0?m:0};l.gauge.dataPoints.push(v)}else a.hist&&l.histogram.dataPoints.push({attributes:c,startTimeUnixNano:u,timeUnixNano:e,count:a.hist.count,sum:a.hist.sum,min:a.hist.min,max:a.hist.max,bucketCounts:a.hist.bucketCounts,explicitBounds:Pv})}return Array.from(n.values())}Mt(t){var e,n;for(var a of t){var r=a[0],s=a[1],l=this.bt.get(r);if(l)switch(l.windowStartMs=Math.min(l.windowStartMs,s.windowStartMs),l.type){case"count":l.total=((e=l.total)!==null&&e!==void 0?e:0)+((n=s.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(s.hist)if(l.hist){l.hist.count+=s.hist.count,l.hist.sum+=s.hist.sum,l.hist.min=Math.min(l.hist.min,s.hist.min),l.hist.max=Math.max(l.hist.max,s.hist.max);for(var c=0;l.hist.bucketCounts.length>c;c++)l.hist.bucketCounts[c]+=s.hist.bucketCounts[c]}else l.hist=s.hist}else this.bt.set(r,s)}}};var Oh,qP,Sv;function GG(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return Sv&&n.length===qP||(qP=n.length,Sv=n.reduce(((a,r)=>{Oh||(Oh={});var s=Oh[r];if(s)a[s[0]]=s[1];else for(var l=t(r),c=l.length-1;c>=0;c--){var u=l[c],h=u?.filename,p=e[r];if(h&&p){a[h]=p,Oh[r]=[h,p];break}}return a}),{})),Sv}}class qG{constructor(e,n,a){a===void 0&&(a=[]),this.coercers=e,this.stackParser=n,this.modifiers=a}buildFromUnknown(e,n){n===void 0&&(n={});var a=n&&n.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(a,n,0).apply(e),s=this.buildParsingContext(n),l=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(l,a),$exception_level:"error"}}modifyFrames(e){var n=this;return cn((function*(){for(var a of e)a.stacktrace&&a.stacktrace.frames&&it(a.stacktrace.frames)&&(a.stacktrace.frames=yield n.applyModifiers(a.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 a,r;return e.cause!=null&&(a=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),he({},e,{cause:a,stack:r})}applyChunkIds(e,n){return e.map((a=>(a.filename&&n&&(a.chunk_id=n[a.filename]),a)))}applyCoercers(e,n){for(var a of this.coercers)if(a.match(e))return a.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return cn((function*(){var a=e;for(var r of n.modifiers)a=yield r(a);return a}))()}convertToExceptionList(e,n){var a,r,s,l={type:e.type,value:e.value,mechanism:{type:(a=n.type)!==null&&a!==void 0?a:"generic",handled:(r=n.handled)===null||r===void 0||r,synthetic:(s=e.synthetic)!==null&&s!==void 0&&s}};e.stack&&(l.stacktrace={type:"raw",frames:e.stack});var c=[l];return e.cause!=null&&c.push(...this.convertToExceptionList(e.cause,he({},n,{handled:!0}))),c}buildParsingContext(e){var n;return{chunkIdMap:GG(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,a){a===void 0&&(a=0);var r=(s,l)=>{if(4>=l){var c=this.buildCoercingContext(e,n,l);return this.applyCoercers(s,c)}};return he({},n,{syntheticException:a==0?n.syntheticException:void 0,mechanism:e,apply:s=>r(s,a),next:s=>r(s,a+1)})}}var jl="?";function dy(t,e,n,a,r){var s={platform:t,filename:e,function:n==="<anonymous>"?jl:n,in_app:!0};return ke(a)||(s.lineno=a),ke(r)||(s.colno=r),s}var IE=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,a=t.indexOf("safari-web-extension")!==-1;return n||a?[t.indexOf("@")!==-1?t.split("@")[0]:jl,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},KG=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,YG=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ZG=/\((\S*)(?::(\d+))(?::(\d+))\)/,JG=(t,e)=>{var n=KG.exec(t);if(n)return dy(e,n[1],jl,+n[2],+n[3]);var a=YG.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var r=ZG.exec(a[2]);r&&(a[2]=r[1],a[3]=r[2],a[4]=r[3])}var s=IE(a[1]||jl,a[2]);return dy(e,s[1],s[0],a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},QG=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,XG=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,eq=(t,e)=>{var n=QG.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var a=XG.exec(n[3]);a&&(n[1]=n[1]||"eval",n[3]=a[1],n[4]=a[2],n[5]="")}var r=n[3],s=n[1]||jl,l=IE(s,r);return dy(e,r=l[1],s=l[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},KP=/\(error: (.*)\)/;class tq{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var a=Lt(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:a?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 ef(e,"DOMException")}isDOMError(e){return ef(e,"DOMError")}}class nq{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 a=e.message;return String(a.error&&typeof a.error.message=="string"?a.error.message:a)}getStack(e){return e.stacktrace||e.stack||void 0}}class aq{constructor(){}match(e){return ef(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var a;return n.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(a=n.syntheticException)==null?void 0:a.stack,synthetic:!0}}}var rq=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class iq{match(e){return typeof e=="string"}coerce(e,n){var a,r=this.getInfos(e),s=r[0],l=r[1];return{type:s??"Error",value:l??e,stack:(a=n.syntheticException)==null?void 0:a.stack,synthetic:!0}}getInfos(e){var n="Error",a=e,r=e.match(rq);return r&&(n=r[1],a=r[2]),[n,a]}}var sq=["fatal","error","warning","log","info","debug"];function ME(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var a=n.length;a>0;a--){var r=n.slice(0,a).join(", ");if(e>=r.length)return a===n.length?r:r.length>e?r.slice(0,e)+"...":r}return""}class oq{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var a,r=this.getErrorPropertyFromObject(e);return r?n.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(a=n.syntheticException)==null?void 0:a.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Cb(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 a=this.getObjectClassName(e);return(a&&a!=="Object"?"'"+a+"'":"Object")+" captured as exception with keys: "+ME(e)}isSeverityLevel(e){return Lt(e)&&!iy(e)&&sq.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var a=e[n];if(BG(a))return a}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class lq{match(e){return Cb(e)}coerce(e,n){var a,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+ME(e),stack:(a=n.syntheticException)==null?void 0:a.stack,synthetic:!0}}}class cq{match(e){return lE(e)}coerce(e,n){var a;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(a=n.syntheticException)==null?void 0:a.stack,synthetic:!0}}}class dq{match(e){return ef(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Cb(e))return!1;try{var n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var a,r=this.getUnhandledRejectionReason(e);return lE(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(a=n.syntheticException)==null?void 0:a.stack,synthetic:!0}:n.apply(r)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var of="$message",lf="$timestamp",uq=new Set([of,lf]),Cv={enabled:!0,max_bytes:32768};function cf(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:Cv.enabled,max_bytes:pq(t.max_bytes,Cv.max_bytes)}:he({},Cv)}class hq{constructor(e){this.Rt=[],this.Pt=0,this.Se=cf(e)}setConfig(e){this.Se=cf(e),this.Ot()}add(e){var n=(function(r){var s;try{s=iE(r)}catch{return}try{var l=JSON.parse(s);if(!qt(l))return;var c=l,u=c[of],h=c[lf];return!Lt(u)||u.trim().length===0||!Lt(h)&&!Bn(h)?void 0:{step:c,json:s}}catch{return}})(e);if(n){var a=(function(r){if(typeof TextEncoder<"u")return new TextEncoder().encode(r).length;for(var s=encodeURIComponent(r),l=0,c=0;s.length>c;c++)s[c]==="%"?(l+=1,c+=2):l+=1;return l})(n.json);a>this.Se.max_bytes||(this.Rt.push({step:n.step,bytes:a}),this.Pt+=a,this.Ot())}}getAttachable(){return this.Rt.map((e=>e.step))}clear(){this.Rt=[],this.Pt=0}size(){return this.Rt.length}Ot(){for(;this.Pt>this.Se.max_bytes&&this.Rt.length>0;){var e=this.Rt.shift();e&&(this.Pt-=e.bytes)}}}function pq(t,e){if(!Bn(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var NE=function(t,e){var n=(e===void 0?{}:e).debugEnabled,a={k(r){if(Z&&(en.DEBUG||Be.POSTHOG_DEBUG||n)&&!ke(Z.console)&&Z.console){for(var s=("__rrweb_original__"in Z.console[r])?Z.console[r].__rrweb_original__:Z.console[r],l=arguments.length,c=new Array(l>1?l-1:0),u=1;l>u;u++)c[u-1]=arguments[u];s(t,...c)}},debug(){for(var r=arguments.length,s=new Array(r),l=0;r>l;l++)s[l]=arguments[l];a.k("debug",...s)},info(){for(var r=arguments.length,s=new Array(r),l=0;r>l;l++)s[l]=arguments[l];a.k("log",...s)},warn(){for(var r=arguments.length,s=new Array(r),l=0;r>l;l++)s[l]=arguments[l];a.k("warn",...s)},error(){for(var r=arguments.length,s=new Array(r),l=0;r>l;l++)s[l]=arguments[l];a.k("error",...s)},critical(){for(var r=arguments.length,s=new Array(r),l=0;r>l;l++)s[l]=arguments[l];console.error(t,...s)},uninitializedWarning(r){a.error("You must initialize PostHog before calling "+r)},createLogger:(r,s)=>NE(t+" "+r,s)};return a},be=NE("[PostHog.js]"),Zt=be.createLogger,fq=Zt("[ExternalScriptsLoader]"),Tv=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return fq.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var a=xe?.querySelectorAll("script");if(a){for(var r,s=function(){if(a[l].src===e){var u=a[l];return u.__posthog_loading_callback_fired?{v:n()}:(u.addEventListener("load",(h=>{u.__posthog_loading_callback_fired=!0,n(void 0,h)})),u.onerror=h=>n(h),{v:void 0})}},l=0;a.length>l;l++)if(r=s())return r.v}var c=()=>{if(!xe)return n("document not found");var u=xe.createElement("script");if(u.type="text/javascript",u.crossOrigin="anonymous",u.src=e,u.onload=m=>{u.__posthog_loading_callback_fired=!0,n(void 0,m)},u.onerror=m=>n(m),t.config.prepare_external_dependency_script&&(u=t.config.prepare_external_dependency_script(u)),!u)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")xe.head.appendChild(u);else{var h,p=xe.querySelectorAll("body > script");p.length>0?(h=p[0].parentNode)==null||h.insertBefore(u,p[0]):xe.body.appendChild(u)}};xe!=null&&xe.body?c():xe?.addEventListener("DOMContentLoaded",c)};Be.__PosthogExtensions__=Be.__PosthogExtensions__||{},Be.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var a;if(t.config.strict_script_versioning)a=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var r="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var s=3e5;r=r+"&t="+Math.floor(Date.now()/s)*s}a=t.requestRouter.endpointFor("assets",r)}Tv(t,a,n)}else{var l=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");Tv(t,l,n)}},Be.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var a=t.requestRouter.endpointFor("api",e);Tv(t,a,n)};var OE="$people_distinct_id",df="$device_id",Ev="$device_model",ld="__alias",cd="__timers",uy="$autocapture_disabled_server_side",hy="$heatmaps_enabled_server_side",py="$exception_capture_enabled_server_side",fy="$error_tracking_suppression_rules",my="$error_tracking_capture_extension_exceptions",gy="$web_vitals_enabled_server_side",Lb="$dead_clicks_enabled_server_side",Db="$product_tours_enabled_server_side",vy="$web_vitals_allowed_metrics",ao="$session_recording_remote_config",jE="$replay_sample_rate",zE="$replay_override_sampling",FE="$replay_override_linked_flag",UE="$replay_override_url_trigger",BE="$replay_override_event_trigger",bl="$sesid",Ib="$session_is_sampled",Ys="$enabled_feature_flags",pp="$active_feature_flags",dd="$early_access_features",_y="$feature_flag_details",fp="$feature_flag_payloads",yy="$feature_flag_request_id",bi="$override_feature_flags",hl="$override_feature_flag_payloads",Gs="$stored_person_properties",qs="$stored_group_properties",by="$surveys",uf="$surveys_loaded_at",ky="$surveys_activated",ud="ph_product_tours",Sd="$flag_call_reported",wy="$flag_call_reported_session_id",xy="$feature_flag_errors",Vd="$feature_flag_evaluated_at",vr="$user_state",Py="$client_session_props",Sy="$capture_rate_limit",Cy="$initial_campaign_params",Ty="$initial_referrer_info",hf="$initial_person_info",pf="$epp",$E="__POSTHOG_TOOLBAR__",jh="$posthog_cookieless",VE="$sdk_debug_extensions_init_method",HE="$sdk_debug_extensions_init_time_ms",WE="$sdk_debug_recording_script_not_loaded",Mb="PostHog loadExternalDependency extension not found.",Ks="on_reject",xi="always",nl="anonymous",al="identified",Ey="identified_only",ff="visibilitychange",mf="beforeunload",pl="$pageview",Av="$pageleave",Rv="$identify",YP="$groupidentify";function zh(t,e){it(t)&&t.forEach(e)}function Mt(t,e){if(!nt(t))if(it(t))t.forEach(e);else if(SG(t))t.forEach(((a,r)=>e(a,r)));else for(var n in t)oE.call(t,n)&&e(t[n],n)}var Bt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),a=1;e>a;a++)n[a-1]=arguments[a];for(var r of n)for(var s in r)r[s]!==void 0&&(t[s]=r[s]);return t};function mp(t){for(var e=Object.keys(t),n=e.length,a=new Array(n);n--;)a[n]=[e[n],t[e[n]]];return a}var ZP=function(t){try{return t()}catch{return}},mq=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),a=0;e>a;a++)n[a]=arguments[a];return t.apply(this,n)}catch(r){be.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),be.critical(r)}}},Nb=function(t){var e={};return Mt(t,(function(n,a){(Lt(n)&&n.length>0||Bn(n))&&(e[a]=n)})),e},gq=["herokuapp.com","vercel.app","netlify.app"];function vq(t){var e=t?.hostname;if(!Lt(e))return!1;var n=e.split(".").slice(-2).join(".");for(var a of gq)if(n===a)return!1;return!0}function tn(t,e,n,a){var r=a??{},s=r.capture,l=r.passive;t?.addEventListener(e,n,{capture:s!==void 0&&s,passive:l===void 0||l})}function GE(t){return t.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Bn(t)&&isFinite(t)&&Math.floor(t)===t});class gf{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,a,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(a)||!Number.isInteger(r)||0>e||0>n||0>a||0>r||e>0xffffffffffff||n>4095||a>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|n>>>8,s[7]=n,s[8]=128|a>>>24,s[9]=a>>>16,s[10]=a>>>8,s[11]=a,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new gf(s)}toString(){for(var e="",n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),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 gf(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;16>n;n++){var a=this.bytes[n]-e.bytes[n];if(a!==0)return Math.sign(a)}return 0}}class _q{constructor(){this.S=0,this.C=0,this.I=new yq}generate(){var e=this.generateOrAbort();if(ke(e)){this.S=0;var n=this.generateOrAbort();if(ke(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return gf.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var JP,qE=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Z&&!ke(Z.crypto)&&crypto.getRandomValues&&(qE=t=>crypto.getRandomValues(t));class yq{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(qE(this.R),this.O=0),this.R[this.O++]}}var wi=()=>bq().toString(),bq=()=>(JP||(JP=new _q)).generate(),Gc="",kq=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Fr={N:()=>!!xe,D(t){be.error("cookieStore error: "+t)},A(t){if(xe){try{for(var e=t+"=",n=xe.cookie.split(";").filter((s=>s.length)),a=0;n.length>a;a++){for(var r=n[a];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},F(t){var e;try{e=JSON.parse(Fr.A(t))||{}}catch{}return e},q(t,e,n,a,r){if(!xe)return!1;try{var s="",l="",c=(function(p,m){if(m){var v=(function(b,x){if(x===void 0&&(x=xe),Gc)return Gc;if(!x||["localhost","127.0.0.1"].includes(b))return"";for(var P=b.split("."),E=Math.min(P.length,8),L="dmn_chk_"+wi();!Gc&&E--;){var T=P.slice(E).join("."),A=L+"=1;domain=."+T+";path=/";x.cookie=A+";max-age=3",x.cookie.includes(L)&&(x.cookie=A+";max-age=0",Gc=T)}return Gc})(p);if(!v){var y=(b=>{var x=b.match(kq);return x?x[0]:""})(p);y!==v&&be.info("Warning: cookie subdomain discovery mismatch",y,v),v=y}return v?"; domain=."+v:""}return""})(xe.location.hostname,a);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),s="; expires="+u.toUTCString()}r&&(l="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+c+l;return h.length>3686.4&&be.warn("cookieStore warning: large cookie, len="+h.length),xe.cookie=h,!0}catch{return!1}},P(t,e){if(xe!=null&&xe.cookie)try{Fr.q(t,"",-1,e)}catch{return}}},Lv=null,It={N(){if(!la(Lv))return Lv;var t=!0;if(ke(Z))t=!1;else try{var e="__mplssupport__";It.q(e,"xyz"),It.A(e)!=='"xyz"'&&(t=!1),It.P(e)}catch{t=!1}return t||be.error("localStorage unsupported; falling back to cookie store"),Lv=t,t},D(t){be.error("localStorage error: "+t)},A(t){try{return Z?.localStorage.getItem(t)}catch(e){It.D(e)}return null},F(t){try{return JSON.parse(It.A(t))||{}}catch{}return null},q(t,e){try{return Z?.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){It.D(n)}return!1},P(t){try{Z?.localStorage.removeItem(t)}catch(e){It.D(e)}}},wq=[df,"distinct_id",bl,Ib,pf,hf,vr],Fh={},xq={N:()=>!0,D(t){be.error("memoryStorage error: "+t)},A:t=>Fh[t]||null,F:t=>Fh[t]||null,q:(t,e)=>(Fh[t]=e,!0),P(t){delete Fh[t]}},Fs=null,Fn={N(){if(!la(Fs))return Fs;if(Fs=!0,ke(Z))Fs=!1;else try{var t="__support__";Fn.q(t,"xyz"),Fn.A(t)!=='"xyz"'&&(Fs=!1),Fn.P(t)}catch{Fs=!1}return Fs},D(t){be.error("sessionStorage error: ",t)},A(t){try{return Z?.sessionStorage.getItem(t)}catch(e){Fn.D(e)}return null},F(t){try{return JSON.parse(Fn.A(t))||null}catch{}return null},q(t,e){try{return Z?.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Fn.D(n)}return!1},P(t){try{Z?.sessionStorage.removeItem(t)}catch(e){Fn.D(e)}}};class Pq{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.At()?0:this.$t}isOptedOut(){return this.Se.cookieless_mode===xi||this.isRejected()||this.consent===-1&&this.Se.cookieless_mode===Ks}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Nt.q(this.Dt,e?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Nt.P(this.Dt,this.Se.cross_subdomain_cookie)}get Dt(){var e=this._instance.config,n=e.token,a=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(a?a+n:"__ph_opt_in_out_"+n)}get $t(){var e=this.Nt.A(this.Dt);return wv(e)?1:Ke(AG,e)?0:-1}get Nt(){var e=this.Se.opt_out_capturing_persistence_type,n=e==="localStorage"?It:Fr;if(!this.qt||this.qt!==n){this.qt=n;var a=e==="localStorage"?Fr:It;a.A(this.Dt)&&(this.qt.A(this.Dt)||this.optInOut(wv(a.A(this.Dt))),a.P(this.Dt,this.Se.cross_subdomain_cookie))}return this.qt}At(){return!!this.Se.respect_dnt&&[sa?.doNotTrack,sa?.msDoNotTrack,Be.doNotTrack].some((e=>wv(e)))}}function KE(t,e){var n,a=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!yr(a))return e;try{var r=a(e);return Lt(r)&&r?r:e}catch(s){return be.error("Error in get_current_url, falling back to window.location.href",s),e}}var Sq=1,Cq=3,Tq=11;function QP(t){return t instanceof Element&&(t.id===$E||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function gs(t){return!!t&&t.nodeType===Sq}function Ra(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function YE(t){return!!t&&t.nodeType===Cq}function ZE(t){return!!t&&t.nodeType===Tq&&gs(t.host)}var JE=1e3;function Ob(t){return t?Gf(t).split(/\s+/):[]}function XP(t,e){var n=(function(a){var r,s=Z==null||(r=Z.location)==null?void 0:r.href;return ke(s)?void 0:KE(a,s)})(e);return!!(n&&t&&t.some((a=>n.match(a))))}function vf(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return Ob(e)}function QE(t){return nt(t)?null:Gf(t).split(/(\s+)/).filter((e=>Cd(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Hd(t){var e="";return Ry(t)&&!n6(t)&&t.childNodes&&t.childNodes.length&&Mt(t.childNodes,(function(n){var a;YE(n)&&n.textContent&&(e+=(a=QE(n.textContent))!==null&&a!==void 0?a:"")})),Gf(e)}function Dv(t){return ke(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var jb=["a","button","form","input","select","textarea","label"];function Ay(t,e){if(ke(e))return!0;var n,a=function(s){if(e.some((l=>(function(c,u){var h=c.matches||c.matchesSelector||c.msMatchesSelector||c.mozMatchesSelector||c.webkitMatchesSelector||c.oMatchesSelector;try{return!!h&&h.call(c,u)}catch{return!1}})(s,l))))return{v:!0}};for(var r of t)if(n=a(r))return n.v;return!1}function XE(t){var e=t.parentNode;return!(!e||!gs(e))&&e}var Eq=[".ph-no-autocapture","[data-ph-no-autocapture]"],e6=["next","previous","prev",">","<"],Aq=[...e6,"+","-","−","–"],eS=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,tS=[".ph-no-rageclick",".ph-no-capture"],Rq=["","text","search","email","password","url","tel","number"];function nS(t,e){if(!Z||zb(t))return!1;var n,a,r,s,l;if(Hr(e)?(n=!!e&&tS,a=void 0,r=!1):(n=(s=e?.css_selector_ignorelist)!==null&&s!==void 0?s:tS,a=e?.content_ignorelist,r=(l=e?.ignore_text_selection)!==null&&l!==void 0&&l),n===!1||r&&(function(u){return!(!u||!gs(u))&&(!!Ra(u,"textarea")||(Ra(u,"input")?Ke(Rq,(u.getAttribute("type")||"").toLowerCase()):(function(h){if(h.isContentEditable)return!0;var p=h.getAttribute==null?void 0:h.getAttribute("contenteditable");return p==="true"||p===""})(u)))})(t))return!1;var c=t6(t,!1).targetElementList;return!(function(u,h){if(u===!1||ke(u))return!1;var p;if(u===!0)p=e6;else{if(!it(u))return!1;if(u.length>10)return be.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;p=u.map((m=>m.toLowerCase()))}return h.some((m=>{var v=m.safeText,y=m.ariaLabel;return p.some((b=>eS(v,b)||eS(y,b)))}))})(a,c.map((u=>{var h;return{safeText:Hd(u).toLowerCase(),ariaLabel:((h=u.getAttribute("aria-label"))==null?void 0:h.toLowerCase().trim())||""}})))&&!Ay(c,n)}var zb=t=>!t||Ra(t,"html")||!gs(t),t6=(t,e)=>{if(!Z||zb(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,a=[t],r=t;r.parentNode&&!Ra(r,"body");)if(ZE(r.parentNode))a.push(r.parentNode.host),r=r.parentNode.host;else{var s=XE(r);if(!s)break;if(e||jb.indexOf(s.tagName.toLowerCase())>-1)n=!0;else try{var l=Z.getComputedStyle(s);l&&l.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}a.push(s),r=s}return{parentIsUsefulElement:n,targetElementList:a}};function Ry(t){for(var e=new Set,n=0,a=t;a.parentNode&&!Ra(a,"body");a=a.parentNode){if(n++>=JE||e.has(a))return!1;e.add(a);var r=vf(a);if(Ke(r,"ph-sensitive")||Ke(r,"ph-no-capture"))return!1}if(Ke(vf(t),"ph-include"))return!0;var s=t.type||"";if(Lt(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var l=t.name||t.id||"";return!Lt(l)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(l.replace(/[^a-zA-Z0-9]/g,""))}function n6(t){return!!(Ra(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Ra(t,"select")||Ra(t,"textarea")||t.getAttribute("contenteditable")==="true")}var a6="(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})",Lq=new RegExp("^(?:"+a6+")$"),Dq=new RegExp(a6),r6="\\d{3}-?\\d{2}-?\\d{4}",Iq=new RegExp("^("+r6+")$"),Mq=new RegExp("("+r6+")");function Cd(t,e){return e===void 0&&(e=!0),!(nt(t)||Lt(t)&&(t=Gf(t),(e?Lq:Dq).test((t||"").replace(/[- ]/g,""))||(e?Iq:Mq).test(t)))}function aS(t){var e=Hd(t);return Cd(e=(e+" "+i6(t)).trim())?e:""}function i6(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Mt(t.childNodes,(function(n){var a;if(n&&((a=n.tagName)==null?void 0:a.toLowerCase())==="span")try{var r=Hd(n);e=(e+" "+r).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+i6(n)).trim())}catch(s){be.error("[AutoCapture]",s)}})),e}function rS(t){return t.replace(/"|\\"/g,'\\"')}function Nq(t){var e=t.attr__class;return e?it(e)?e:Ob(e):void 0}var Uh=Zt("[Dead Clicks]"),Oq=()=>!0,jq=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(Lb)),a=t.instance.config.capture_dead_clicks;return Hr(a)?a:!!qt(a)||n};class iS{get lazyLoadedDeadClicksAutocapture(){return this.jt}constructor(e,n,a){this.instance=e,this.isEnabled=n,this.onCapture=a,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Lb]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Bt((()=>{this.Ht()})):this.stop()}Bt(e){var n,a;(n=Be.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(a=Be.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this.instance,"dead-clicks-autocapture",(r=>{r?Uh.error("failed to load script",r):e()}))}Ht(){var e;if(xe){if(!this.jt&&(e=Be.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=qt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.jt=Be.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.jt.start(xe),Uh.info("starting...")}}else Uh.error("`document` not found. Cannot start.")}stop(){this.jt&&(this.jt.stop(),this.jt=void 0,Uh.info("stopping..."))}}var Iv=Zt("[SegmentIntegration]"),s6="posthog-js";function o6(t,e){var n=e===void 0?{}:e,a=n.organization,r=n.projectId,s=n.prefix,l=n.severityAllowList,c=l===void 0?["error"]:l,u=n.sendExceptionsToPostHog,h=u===void 0||u;return p=>{var m,v,y,b,x;if(c!=="*"&&!c.includes(p.level)||!t.__loaded)return p;p.tags||(p.tags={});var P=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());p.tags["PostHog Person URL"]=P,t.sessionRecordingStarted()&&(p.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var E,L=((m=p.exception)==null?void 0:m.values)||[],T=L.map((D=>he({},D,{stacktrace:D.stacktrace?he({},D.stacktrace,{type:"raw",frames:(D.stacktrace.frames||[]).map((B=>he({},B,{platform:"web:javascript"})))}):void 0}))),A={$exception_message:((v=L[0])==null?void 0:v.value)||p.message,$exception_type:(y=L[0])==null?void 0:y.type,$exception_level:p.level,$exception_list:T,$sentry_event_id:p.event_id,$sentry_exception:p.exception,$sentry_exception_message:((b=L[0])==null?void 0:b.value)||p.message,$sentry_exception_type:(x=L[0])==null?void 0:x.type,$sentry_tags:p.tags};return a&&r&&(A.$sentry_url=(s||"https://sentry.io/organizations/")+a+"/issues/?project="+r+"&query="+p.event_id),h&&((E=t.exceptions)==null||E.sendExceptionEvent(A)),p}}class zq{constructor(e,n,a,r,s,l){this.name=s6,this.setupOnce=function(c){c(o6(e,{organization:n,projectId:a,prefix:r,severityAllowList:s,sendExceptionsToPostHog:l==null||l}))}}}class sS{constructor(e){this.Ut=(n,a,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(be.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:r}),this.zt=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Wt()}Wt(){var e;this.Vt=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Ut)}destroy(){var e;(e=this.Vt)==null||e.call(this),this.Vt=void 0}doPageView(e,n){var a,r=this.Zt(e,n);return this.zt={pathname:(a=Z?.location.pathname)!==null&&a!==void 0?a:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var n;return this.Zt(e,(n=this.zt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.zt)==null?void 0:e.pageViewId}}Zt(e,n){var a=this.zt;if(!a)return{$pageview_id:n};var r={$pageview_id:n,$prev_pageview_id:a.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var l=s.maxScrollHeight,c=s.lastScrollY,u=s.maxScrollY,h=s.maxContentHeight,p=s.lastContentY,m=s.maxContentY;if(!(ke(l)||ke(c)||ke(u)||ke(h)||ke(p)||ke(m))){l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),h=Math.ceil(h),p=Math.ceil(p),m=Math.ceil(m);var v=l>1?Br(c/l,0,1,be):1,y=l>1?Br(u/l,0,1,be):1,b=h>1?Br(p/h,0,1,be):1,x=h>1?Br(m/h,0,1,be):1;r=Bt(r,{$prev_pageview_last_scroll:c,$prev_pageview_last_scroll_percentage:v,$prev_pageview_max_scroll:u,$prev_pageview_max_scroll_percentage:y,$prev_pageview_last_content:p,$prev_pageview_last_content_percentage:b,$prev_pageview_max_content:m,$prev_pageview_max_content_percentage:x})}}return a.pathname&&(r.$prev_pageview_pathname=a.pathname),a.timestamp&&(r.$prev_pageview_duration=(e.getTime()-a.timestamp.getTime())/1e3),r}}var Bh=["flags","surveys"],Fq={[OE]:{exposure:"hidden"},[ld]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[cd]:{exposure:"hidden"},[uy]:{exposure:"event"},[hy]:{exposure:"hidden"},[py]:{exposure:"event"},[fy]:{exposure:"hidden"},[my]:{exposure:"event"},[gy]:{exposure:"event"},[Lb]:{exposure:"event"},[Db]:{exposure:"hidden"},[vy]:{exposure:"event"},[ao]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[bl]:{exposure:"hidden"},[Ib]:{exposure:"event"},[jE]:{exposure:"event",shouldSkipFromEventProperties:t=>la(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[Ys]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!qt(t))return{};for(var e={},n=Object.keys(t),a=0;n.length>a;a++)e["$feature/"+n[a]]=t[n[a]];return e}},[pp]:{exposure:"event",storageGroup:"flags"},[dd]:{exposure:"hidden"},[_y]:{exposure:"hidden",storageGroup:"flags"},[fp]:{exposure:"event",storageGroup:"flags"},[yy]:{exposure:"event",storageGroup:"flags",volatile:!0},[bi]:{exposure:"event"},[hl]:{exposure:"hidden"},[Gs]:{exposure:"hidden"},[qs]:{exposure:"hidden"},[by]:{exposure:"hidden",storageGroup:"surveys"},[uf]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ky]:{exposure:"event"},[ud]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Sd]:{exposure:"hidden"},[wy]:{exposure:"hidden"},[xy]:{exposure:"hidden"},[Vd]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[vr]:{exposure:"hidden"},[Py]:{exposure:"hidden"},[Sy]:{exposure:"hidden"},[Cy]:{exposure:"hidden"},[Ty]:{exposure:"hidden"},[hf]:{exposure:"hidden"},[pf]:{exposure:"hidden"},[zE]:{exposure:"event"},[FE]:{exposure:"event"},[UE]:{exposure:"event"},[BE]:{exposure:"event"},[VE]:{exposure:"event"},[HE]:{exposure:"event"},[WE]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Uq=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Us=t=>{var e=Fq[t];if(e)return e;for(var n of Uq){var a=n[1];if(t.indexOf(n[0])===0)return a}},Wd=t=>{var e=xe?.createElement("a");return ke(e)?null:(e.href=t,e)},zl=function(t,e){for(var n,a=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;a.length>r;r++){var s=a[r].split("=");if(s[0]===e){n=s;break}}if(!it(n)||2>n.length)return"";var l=n[1];try{l=decodeURIComponent(l)}catch{be.error("Skipping decoding for malformed query param: "+l)}return l.replace(/\+/g," ")},Gd=function(t,e,n){if(!t||!e||!e.length)return t;for(var a=t.split("#"),r=a[1],s=(a[0]||"").split("?"),l=s[1],c=s[0],u=(l||"").split("&"),h=[],p=0;u.length>p;p++){var m=u[p].split("=");it(m)&&(e.includes(m[0])?h.push(m[0]+"="+n):h.push(u[p]))}var v=c;return l!=null&&(v+="?"+h.join("&")),r!=null&&(v+="#"+r),v},_f=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},l6=(t,e)=>t>=e&&nE(),c6=(t,e,n,a)=>{if(t===0){if(nE()){var r=e+1;return r===n&&a(),r}return e}return 0},$h="https?://(.*)",Fl=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Bq=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Fl],qd="<masked>",$q=["li_fat_id"];function d6(t,e,n){if(!xe)return{};var a,r=e?[...Fl,...n||[]]:[],s=u6(Gd(xe.URL,r,qd),t),l=(a={},Mt($q,(function(c){var u=Fr.A(c);a[c]=u||null})),a);return Bt(l,s)}function u6(t,e){var n=Bq.concat(e||[]),a={};return Mt(n,(function(r){var s=zl(t,r);a[r]=s||null})),a}function h6(t){var e=(function(s){return s?s.search($h+"google.([^/?]*)")===0?"google":s.search($h+"bing.com")===0?"bing":s.search($h+"yahoo.com")===0?"yahoo":s.search($h+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",a={};if(!la(e)){a.$search_engine=e;var r=xe?zl(xe.referrer,n):"";r.length&&(a.ph_keyword=r)}return a}function oS(){return navigator.language||navigator.userLanguage}var yf="$direct";function p6(){return xe?.referrer||yf}function f6(t,e,n){n===void 0&&(n=!1);var a=t?[...Fl,...e||[]]:[],r=n?ms(fn?.href):fn?.href,s=r?.substring(0,1e3);return{r:p6().substring(0,1e3),u:s?Gd(s,a,qd):void 0}}function m6(t,e){var n;e===void 0&&(e=!1);var a=t.r,r=t.u,s=e?ms(r):r,l={$referrer:a,$referring_domain:a==null?void 0:a==yf?yf:(n=Wd(a))==null?void 0:n.host};if(s){l.$current_url=s;var c=Wd(s);l.$host=c?.host,l.$pathname=c?.pathname;var u=u6(s);Bt(l,u)}if(a){var h=h6(a);Bt(l,h)}return l}function g6(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Vq(){try{return new Date().getTimezoneOffset()}catch{return}}var Hq={flags:Vd,surveys:uf},Wq=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],rl="main";class Mv{constructor(e,n,a){if(a===void 0&&(a=!0),this.Gt={},this.Qt=!1,this.Jt=!1,this.Se=e,this.Kt=a,this.props={},this.Yt=!1,this.Xt=(s=>{var l="";return s.token&&(l=s.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),s.persistence_name?"ph_"+s.persistence_name:"ph_"+l+"_posthog"})(e),this.Nt=this.er(e),this.Jt=this.tr(e),this.load(),e.debug&&be.info("Persistence loaded",e.persistence,he({},this.props)),this.update_config(e,e,n),this.save(),Z){var r=()=>this.flush();tn(Z,"beforeunload",r,{capture:!1}),tn(Z,"pagehide",r,{capture:!1})}}rr(){var e,n=(e=this.Se)==null?void 0:e.persistence_save_debounce_ms;return Bn(n)&&n>0?n:0}isDisabled(){return!!this.ir}er(e){Wq.indexOf(e.persistence.toLowerCase())===-1&&(be.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,a=(function(l,c){l===void 0&&(l=[]),c===void 0&&(c=!1);var u=[...wq,...l];return he({},It,{F(h){try{var p={};try{p=Fr.F(h)||{}}catch{}var m,v=JSON.parse(It.A(h)||"{}");if(c){var y={};for(var b in p){var x=p[b];la(x)||x===""||(y[b]=x)}m=Bt(v,y)}else m=Bt(p,v);return It.q(h,m),m}catch{}return null},q(h,p,m,v,y,b){var x=It.q(h,p,void 0,void 0,b);try{var P={};u.forEach((E=>{p[E]&&(P[E]=p[E])})),Object.keys(P).length&&Fr.q(h,P,m,v,y,b)}catch(E){It.D(E)}return x},P(h,p){try{Z?.localStorage.removeItem(h),Fr.P(h,p)}catch(m){It.D(m)}}})})(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),r=!1,s=e.persistence.toLowerCase();return s==="localstorage"&&It.N()?(n=It,r=!0):s==="localstorage+cookie"&&a.N()?(n=a,r=!0):s==="sessionstorage"&&Fn.N()?n=Fn:s==="memory"?n=xq:s==="cookie"?n=Fr:a.N()?(n=a,r=!0):n=Fr,this.Qt=r,n}nr(e){return this.Xt+"__"+e}tr(e){return this.Qt&&!!e.split_storage}sr(e){var n=e??this.Se.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var a=this.props[Vd];return!a||typeof a!="number"||Date.now()-a>n}properties(){var e={};return Mt(this.props,((n,a)=>{var r=Us(a);if(r?.exposure==="derived"){if(r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(n,a===Ys?()=>this.sr():()=>!1))return;r.transformToEventProperties&&Bt(e,r.transformToEventProperties(n))}else if(!r||r.exposure==="event"){if(r!=null&&r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(n,(()=>!1)))return;e[a]=n}})),e}load(){if(!this.ir){var e=this.Nt.F(this.Xt);e&&(this.props=Bt({},e)),this.Jt&&this.ar()}}ar(){for(var e of Bh){var n=It.F(this.nr(e));if(n&&!cs(n)){var a=this.lr(e);a.persisted=!0,this.ur(e)||(a.fingerprint=this.hr(n,e)),this.dr(e,n)||Bt(this.props,n)}}}ur(e){return Object.keys(this.props).some((n=>{var a;return((a=Us(n))==null?void 0:a.storageGroup)===e}))}dr(e,n){var a=Hq[e];if(!a)return!1;var r=n[a],s=this.props[a];return Bn(r)&&Bn(s)&&s>r}refreshKey(e){var n;if(!this.ir){var a=this.Jt?(n=Us(e))==null?void 0:n.storageGroup:void 0,r=a?It.F(this.nr(a)):this.Nt.F(this.Xt);if(r&&e in r)this.cr(e,r[e]);else{if(a){var s=this.Nt.F(this.Xt);if(s&&e in s)return void this.cr(e,s[e])}this.vr(e)}}}save(){if(!this.ir){var e=this.rr();e>0?ke(this.pr)&&(this.pr=setTimeout((()=>{this.pr=void 0,this.gr()}),e)):this.gr()}}flush(){ke(this.pr)||(clearTimeout(this.pr),this.pr=void 0,this.gr())}gr(){this.ir||(this.Jt?this.mr():this.yr(this.Nt,this.Xt,this.props,rl))}mr(){var e=this.br(),n=e.main,a=e.groups;for(var r of(this.yr(this.Nt,this.Xt,n,rl),Bh)){var s,l=a[r];(!cs(l)||(s=this.Gt[r])!=null&&s.persisted)&&this.yr(It,this.nr(r),l,r)}}br(){var e={},n={};for(var a of Bh)n[a]={};return Mt(this.props,((r,s)=>{var l,c=(l=Us(s))==null?void 0:l.storageGroup;c?n[c][s]=r:e[s]=r})),{main:e,groups:n}}hr(e,n){if(n===rl)return JSON.stringify(e)+"|"+this._r+"|"+this.wr+"|"+this.kr;var a={};return Mt(e,((r,s)=>{var l;a[s]=(l=Us(s))!=null&&l.volatile?"__volatile__":r})),JSON.stringify(a)}yr(e,n,a,r){var s=this.lr(r);if(r===rl||s.dirty||ke(s.fingerprint)){var l;try{if((l=this.hr(a,r))===s.fingerprint)return void(s.dirty=!1)}catch{l=void 0}e.q(n,a,this._r,this.wr,this.kr,this.Se.debug)?(s.dirty=!1,r!==rl&&(s.persisted=!0),ke(l)||(s.fingerprint=l)):this.Se.debug&&be.warn('failed to persist storage entry "'+n+'"; will retry on next save')}}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,a=n!==void 0&&n;if(ke(this.pr)||(clearTimeout(this.pr),this.pr=void 0),this.Nt.P(this.Xt,!1),this.Nt.P(this.Xt,!0),!a&&this.Kt)for(var r of Bh)It.P(this.nr(r));a?delete this.Gt[rl]:this.Gt={}}clear(){this.remove(),this.props={}}register_once(e,n,a){if(qt(e)){ke(n)&&(n="None"),this._r=ke(a)?this.Sr:a;var r=!1;if(Mt(e,((s,l)=>{this.props.hasOwnProperty(l)&&this.props[l]!==n||(this.cr(l,s),r=!0)})),r)return this.save(),!0}return!1}register(e,n){if(qt(e)){this._r=ke(n)?this.Sr:n;var a=!1;if(Mt(e,((r,s)=>{e.hasOwnProperty(s)&&this.props[s]!==r&&(this.cr(s,r),a=!0)})),a)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.vr(e),this.save())}update_campaign_params(){if(!this.Yt){var e=d6(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);cs(Nb(e))||this.register(e),this.Yt=!0}}update_search_keyword(){var e;this.register((e=xe?.referrer)?h6(e):{})}update_referrer_info(){var e;this.register_once({$referrer:p6(),$referring_domain:xe!=null&&xe.referrer&&((e=Wd(xe.referrer))==null?void 0:e.host)||yf},void 0)}set_initial_person_info(){this.props[Cy]||this.props[Ty]||this.register_once({[hf]:f6(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};Mt([Ty,Cy],(r=>{var s=this.props[r];s&&Mt(s,(function(l,c){e["$initial_"+ry(c)]=l}))}));var n=this.props[hf];if(n){var a=(function(r,s){s===void 0&&(s=!1);var l=m6(r,s),c={};return Mt(l,(function(u,h){c["$initial_"+ry(h)]=u})),c})(n,this.Se.disable_capture_url_hashes);Bt(e,a)}return e}safe_merge(e){return Mt(this.props,(function(n,a){a in e||(e[a]=n)})),e}update_config(e,n,a){this.Sr=this._r=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var r=e.persistence!==n.persistence||!((u,h)=>{if(u.length!==h.length)return!1;var p=[...u].sort(),m=[...h].sort();return p.every(((v,y)=>v===m[y]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),s=r?this.er(e):this.Nt,l=this.tr(e);if(r||l!==this.Jt){var c=this.props;this.clear(),this.Nt=s,this.Jt=l,this.props=c,this.save()}}set_disabled(e){this.ir=e,this.ir?this.remove():this.save()}set_cross_subdomain(e){e!==this.wr&&(this.wr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.kr&&(this.kr=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var a=this.props[cd]||{};a[e]=n,this.cr(cd,a),this.save()}remove_event_timer(e){var n=this.props[cd]||{},a=n[e];return ke(a)||(delete n[e],this.cr(cd,n),this.save()),a}get_property(e){return this.props[e]}set_property(e,n){this.cr(e,n),this.save()}cr(e,n){var a;this.props[e]=n,(a=Us(e))!=null&&a.volatile||this.Cr(e)}vr(e){delete this.props[e],this.Cr(e)}Cr(e){var n,a=(n=Us(e))==null?void 0:n.storageGroup;a&&(this.lr(a).dirty=!0)}lr(e){return this.Gt[e]||(this.Gt[e]={})}}var qc={Activation:"events",Cancellation:"cancelEvents"},Nv={Popover:"popover",API:"api",Widget:"widget"},Pi={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Ov={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Ly={Popover:"popover",Inline:"inline"},Gq={SHOWN:"product tour shown"},lS={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},cS=Zt("[RateLimiter]");class qq{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var a=n.text;if(a&&a.length)try{(JSON.parse(a).quota_limited||[]).forEach((r=>{cS.info((r||"events")+" is quota limited."),this.serverLimits[r]=new Date().getTime()+6e4}))}catch(r){return void cS.warn('could not rate limit - continuing. Error: "'+r?.message+'"',{text:a})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,a,r;e===void 0&&(e=!1);var s=this.captureEventsBurstLimit,l=this.captureEventsPerSecond,c=new Date().getTime(),u=(n=(a=this.instance.persistence)==null?void 0:a.get_property(Sy))!==null&&n!==void 0?n:{tokens:s,last:c};u.tokens+=(c-u.last)/1e3*l,u.last=c,u.tokens>s&&(u.tokens=s);var h=1>u.tokens;return h||e||(u.tokens=Math.max(0,u.tokens-1)),!h||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+l+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=h,(r=this.instance.persistence)==null||r.set_property(Sy,u),{isRateLimited:h,remainingTokens:u.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Kc=Zt("[RemoteConfig]");class v6{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Be._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Tr(e){var n,a;(n=Be.__PosthogExtensions__)!=null&&n.loadExternalDependency?(a=Be.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}Ir(e){this._instance._send_request({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 Kc.info("Using preloaded remote config",this.remoteConfig),this.Mr(this.remoteConfig),void this.Er();if(this._instance.Rr())return void Kc.warn("Remote config is disabled. Falling back to local config.");this.Tr((e=>{if(!e)return Kc.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ir((n=>{this.Mr(n),this.Er()}));this.Mr(e),this.Er()}))}catch(e){Kc.error("Error loading remote config",e)}}stop(){this.Pr&&(clearInterval(this.Pr),this.Pr=void 0)}refresh(){!this._instance.Rr()&&xe&&xe.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Er(){var e;if(!this.Pr){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.Pr=setInterval((()=>{this.refresh()}),n))}}Mr(e){var n;e||Kc.error("Failed to fetch remote config from PostHog."),this._instance.Mr(e??{}),e?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var aa={GZipJS:"gzip-js",Base64:"base64"},Qa=Uint8Array,_a=Uint16Array,Ul=Uint32Array,Fb=new Qa([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]),Ub=new Qa([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]),dS=new Qa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_6=function(t,e){for(var n=new _a(31),a=0;31>a;++a)n[a]=e+=1<<t[a-1];var r=new Ul(n[30]);for(a=1;30>a;++a)for(var s=n[a];n[a+1]>s;++s)r[s]=s-n[a]<<5|a;return[n,r]},y6=_6(Fb,2),Dy=y6[1];y6[0][28]=258,Dy[258]=28;for(var uS=_6(Ub,0)[1],b6=new _a(32768),Yt=0;32768>Yt;++Yt){var il=(43690&Yt)>>>1|(21845&Yt)<<1;b6[Yt]=((65280&(il=(61680&(il=(52428&il)>>>2|(13107&il)<<2))>>>4|(3855&il)<<4))>>>8|(255&il)<<8)>>>1}var Td=function(t,e,n){for(var a=t.length,r=0,s=new _a(e);a>r;++r)++s[t[r]-1];var l,c=new _a(e);for(r=0;e>r;++r)c[r]=c[r-1]+s[r-1]<<1;for(l=new _a(a),r=0;a>r;++r)l[r]=b6[c[t[r]-1]++]>>>15-t[r];return l},_o=new Qa(288);for(Yt=0;144>Yt;++Yt)_o[Yt]=8;for(Yt=144;256>Yt;++Yt)_o[Yt]=9;for(Yt=256;280>Yt;++Yt)_o[Yt]=7;for(Yt=280;288>Yt;++Yt)_o[Yt]=8;var bf=new Qa(32);for(Yt=0;32>Yt;++Yt)bf[Yt]=5;var Kq=Td(_o,9),Yq=Td(bf,5),k6=function(t){return(t/8>>0)+(7&t&&1)},w6=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var a=new(t instanceof _a?_a:t instanceof Ul?Ul:Qa)(n-e);return a.set(t.subarray(e,n)),a},fi=function(t,e,n){var a=e/8>>0;t[a]|=n<<=7&e,t[a+1]|=n>>>8},Yc=function(t,e,n){var a=e/8>>0;t[a]|=n<<=7&e,t[a+1]|=n>>>8,t[a+2]|=n>>>16},jv=function(t,e){for(var n=[],a=0;t.length>a;++a)t[a]&&n.push({s:a,f:t[a]});var r=n.length,s=n.slice();if(!r)return[new Qa(0),0];if(r==1){var l=new Qa(n[0].s+1);return l[n[0].s]=1,[l,1]}n.sort((function(D,B){return D.f-B.f})),n.push({s:-1,f:25001});var c=n[0],u=n[1],h=0,p=1,m=2;for(n[0]={s:-1,f:c.f+u.f,l:c,r:u};p!=r-1;)c=n[n[m].f>n[h].f?h++:m++],u=n[h!=p&&n[m].f>n[h].f?h++:m++],n[p++]={s:-1,f:c.f+u.f,l:c,r:u};var v=s[0].s;for(a=1;r>a;++a)s[a].s>v&&(v=s[a].s);var y=new _a(v+1),b=Iy(n[p-1],y,0);if(b>e){a=0;var x=0,P=b-e,E=1<<P;for(s.sort((function(D,B){return y[B.s]-y[D.s]||D.f-B.f}));r>a;++a){var L=s[a].s;if(e>=y[L])break;x+=E-(1<<b-y[L]),y[L]=e}for(x>>>=P;x>0;){var T=s[a].s;e>y[T]?x-=1<<e-y[T]++-1:++a}for(;a>=0&&x;--a){var A=s[a].s;y[A]==e&&(--y[A],++x)}b=e}return[new Qa(y),b]},Iy=function(t,e,n){return t.s==-1?Math.max(Iy(t.l,e,n+1),Iy(t.r,e,n+1)):e[t.s]=n},hS=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new _a(++e),a=0,r=t[0],s=1,l=function(u){n[a++]=u},c=1;e>=c;++c)if(t[c]==r&&c!=e)++s;else{if(!r&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(r),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(r);s=1,r=t[c]}return[n.subarray(0,a),e]},Zc=function(t,e){for(var n=0,a=0;e.length>a;++a)n+=t[a]*e[a];return n},My=function(t,e,n){var a=n.length,r=k6(e+2);t[r]=255&a,t[r+1]=a>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;a>s;++s)t[r+s+4]=n[s];return 8*(r+4+a)},pS=function(t,e,n,a,r,s,l,c,u,h,p){fi(e,p++,n),++r[256];for(var m=jv(r,15),v=m[0],y=m[1],b=jv(s,15),x=b[0],P=b[1],E=hS(v),L=E[0],T=E[1],A=hS(x),D=A[0],B=A[1],j=new _a(19),S=0;L.length>S;++S)j[31&L[S]]++;for(S=0;D.length>S;++S)j[31&D[S]]++;for(var N=jv(j,7),U=N[0],Q=N[1],ee=19;ee>4&&!U[dS[ee-1]];--ee);var ce,le,re,te,ie=h+5<<3,$=Zc(r,_o)+Zc(s,bf)+l,X=Zc(r,v)+Zc(s,x)+l+14+3*ee+Zc(j,U)+(2*j[16]+3*j[17]+7*j[18]);if($>=ie&&X>=ie)return My(e,p,t.subarray(u,u+h));if(fi(e,p,1+($>X)),p+=2,$>X){ce=Td(v,y),le=v,re=Td(x,P),te=x;var W=Td(U,Q);for(fi(e,p,T-257),fi(e,p+5,B-1),fi(e,p+10,ee-4),p+=14,S=0;ee>S;++S)fi(e,p+3*S,U[dS[S]]);p+=3*ee;for(var O=[L,D],Y=0;2>Y;++Y){var ae=O[Y];for(S=0;ae.length>S;++S)fi(e,p,W[_e=31&ae[S]]),p+=U[_e],_e>15&&(fi(e,p,ae[S]>>>5&127),p+=ae[S]>>>12)}}else ce=Kq,le=_o,re=Yq,te=bf;for(S=0;c>S;++S)if(a[S]>255){var _e;Yc(e,p,ce[257+(_e=a[S]>>>18&31)]),p+=le[_e+257],_e>7&&(fi(e,p,a[S]>>>23&31),p+=Fb[_e]);var fe=31&a[S];Yc(e,p,re[fe]),p+=te[fe],fe>3&&(Yc(e,p,a[S]>>>5&8191),p+=Ub[fe])}else Yc(e,p,ce[a[S]]),p+=le[a[S]];return Yc(e,p,ce[256]),p+le[256]},Zq=new Ul([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Jq=(function(){for(var t=new Ul(256),e=0;256>e;++e){for(var n=e,a=9;--a;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),zv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function Qq(t,e){e===void 0&&(e={});var n=(function(){var m=4294967295;return{p(v){for(var y=m,b=0;v.length>b;++b)y=Jq[255&y^v[b]]^y>>>8;m=y},d(){return 4294967295^m}}})(),a=t.length;n.p(t);var r,s,l,c,u,h=(c=10+((r=e).filename&&r.filename.length+1||0),u=8,(function(m,v,y,b,x,P){var E=m.length,L=new Qa(b+E+5*(1+Math.floor(E/7e3))+x),T=L.subarray(b,L.length-x),A=0;if(!v||8>E)for(var D=0;E>=D;D+=65535){var B=D+65535;E>B?A=My(T,A,m.subarray(D,B)):(T[D]=!0,A=My(T,A,m.subarray(D,E)))}else{for(var j=Zq[v-1],S=j>>>13,N=8191&j,U=(1<<y)-1,Q=new _a(32768),ee=new _a(U+1),ce=Math.ceil(y/3),le=2*ce,re=function(xr){return(m[xr]^m[xr+1]<<ce^m[xr+2]<<le)&U},te=new Ul(25e3),ie=new _a(288),$=new _a(32),X=0,W=0,O=(D=0,0),Y=0,ae=0;E>D;++D){var _e=re(D),fe=32767&D,ve=ee[_e];if(Q[fe]=ve,ee[_e]=fe,D>=Y){var Ne=E-D;if((X>7e3||O>24576)&&Ne>423){A=pS(m,T,0,te,ie,$,W,O,ae,D-ae,A),O=X=W=0,ae=D;for(var Oe=0;286>Oe;++Oe)ie[Oe]=0;for(Oe=0;30>Oe;++Oe)$[Oe]=0}var Ie=2,St=0,un=N,jt=fe-ve&32767;if(Ne>2&&_e==re(D-jt))for(var _t=Math.min(S,Ne)-1,Jt=Math.min(32767,D),nr=Math.min(258,Ne);Jt>=jt&&--un&&fe!=ve;){if(m[D+Ie]==m[D+Ie-jt]){for(var Mn=0;nr>Mn&&m[D+Mn]==m[D+Mn-jt];++Mn);if(Mn>Ie){if(Ie=Mn,St=jt,Mn>_t)break;var Vt=Math.min(jt,Mn-2),Xe=0;for(Oe=0;Vt>Oe;++Oe){var ot=D-jt+Oe+32768&32767,Dt=ot-Q[ot]+32768&32767;Dt>Xe&&(Xe=Dt,ve=ot)}}}jt+=(fe=ve)-(ve=Q[fe])+32768&32767}if(St){te[O++]=268435456|Dy[Ie]<<18|uS[St];var Et=31&Dy[Ie],Nn=31&uS[St];W+=Fb[Et]+Ub[Nn],++ie[257+Et],++$[Nn],Y=D+Ie,++X}else te[O++]=m[D],++ie[m[D]]}}A=pS(m,T,!0,te,ie,$,W,O,ae,D-ae,A)}return w6(L,0,b+k6(A)+x)})(s=t,(l=e).level==null?6:l.level,l.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+l.mem,c,u)),p=h.length;return(function(m,v){var y=v.filename;if(m[0]=31,m[1]=139,m[2]=8,m[8]=2>v.level?4:v.level==9?2:0,m[9]=3,v.mtime!=0&&zv(m,4,Math.floor(new Date(v.mtime||Date.now())/1e3)),y){m[3]=8;for(var b=0;y.length>=b;++b)m[b+10]=y.charCodeAt(b)}})(h,e),zv(h,p-8,n.d()),zv(h,p-4,a),h}var Xq=!!ty||!!Sb,x6="text/plain",gp=!1,Ny=(t,e)=>{var n=t.split("#"),a=n[1],r=n[0].split("?"),s=r[0],l=r[1];if(!l)return t;var c=l.split("&").filter((u=>u.split("=")[0]!==e)).join("&");return s+(c?"?"+c:"")+(a?"#"+a:"")},Bb=function(t,e,n){var a;n===void 0&&(n=!0);var r=t.split("?"),s=r[0],l=r[1],c=he({},e),u=(a=l?.split("&").map((p=>{var m,v=p.split("="),y=v[0],b=n&&(m=c[y])!==null&&m!==void 0?m:v[1];return delete c[y],y+"="+b})))!==null&&a!==void 0?a:[],h=(function(p,m){var v,y;m===void 0&&(m="&");var b=[];return Mt(p,(function(x,P){ke(x)||ke(P)||P==="undefined"||(v=encodeURIComponent((E=>E instanceof File)(x)?x.name:x.toString()),y=encodeURIComponent(P),b[b.length]=y+"="+v)})),b.join(m)})(c);return h&&u.push(h),s+"?"+u.join("&")},kl=(t,e)=>{try{return JSON.stringify(t,((n,a)=>typeof a=="bigint"?a.toString():a),e)}catch{return iE(t)}},Fv=t=>{if(t.Lt)return t.Lt;var e=t.data,n=t.compression;if(e){if(n===aa.GZipJS){var a=Qq((function(c,u){var h=c.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(c);for(var p=new Qa(c.length+(c.length>>>1)),m=0,v=function(P){p[m++]=P},y=0;h>y;++y){if(m+5>p.length){var b=new Qa(m+8+(h-y<<1));b.set(p),p=b}var x=c.charCodeAt(y);128>x?v(x):2048>x?(v(192|x>>>6),v(128|63&x)):x>55295&&57344>x?(v(240|(x=65536+(1047552&x)|1023&c.charCodeAt(++y))>>>18),v(128|x>>>12&63),v(128|x>>>6&63),v(128|63&x)):(v(224|x>>>12),v(128|x>>>6&63),v(128|63&x))}return w6(p,0,m)})(kl(e)),{mtime:0});return{contentType:x6,body:a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength),estimatedSize:a.byteLength}}if(n===aa.Base64){var r=(function(c){return c&&btoa(encodeURIComponent(c).replace(/%([0-9A-F]{2})/g,((u,h)=>String.fromCharCode(parseInt(h,16)))))})(kl(e)),s=(c=>"data="+encodeURIComponent(typeof c=="string"?c:kl(c)))(r);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var l=kl(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},P6=t=>{var e,n,a=()=>t.transport==="sendBeacon"?{url:Bb(t.url,{compression:aa.Base64}),encodedBody:Fv(he({},t,{compression:aa.Base64,Lt:void 0}))}:{url:Ny(t.url,"compression"),encodedBody:Fv(he({},t,{compression:void 0,Lt:void 0}))};try{e=Fv(t)}catch(r){if(zP(t.compression,zl(t.url,"compression")))return be.error("Failed to gzip request body, sending uncompressed payload",r),a();throw r}return e&&zP(t.compression,zl(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?ny(new Uint8Array(n)):ArrayBuffer.isView(n)&&ny(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(gp=!0,a()):{url:t.url,encodedBody:e}},S6=t=>{try{return P6(t)}catch(e){return be.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},eK=(function(){var t=cn((function*(e){var n=kl(e.data),a=yield(function(s,l,c){return ay.apply(this,arguments)})(n,en.DEBUG,{rethrow:!0});if(!a)return e;var r=yield a.arrayBuffer();return he({},e,{Lt:{contentType:x6,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),tK=/Failed to fetch|NetworkError|Load failed/i,C6=t=>{var e,n=S6(t);if(n){var a=n.url,r=n.encodedBody,s=r??{},l=s.contentType,c=s.body,u=s.estimatedSize,h=new Headers;Mt(t.headers,(function(y,b){h.append(b,y)})),l&&h.append("Content-Type",l);var p=null,m=!1;if(LP){var v=new LP;p={signal:v.signal,timeout:setTimeout((()=>{var y,b;m=!0,v.abort((y=t.timeout,(b=new Error("PostHog request timed out"+(y?" after "+y+"ms":""))).name="AbortError",b))}),t.timeout)}}Sb(a,he({method:t?.method||"GET",headers:h,keepalive:t.method==="POST"&&!t.Ft&&52428.8>(u||0),body:c,signal:(e=p)==null?void 0:e.signal},t.fetchOptions)).then((y=>y.text().then((b=>{var x={statusCode:y.status,text:b};if(y.status===200)try{x.json=JSON.parse(b)}catch(P){be.error(P)}t.callback==null||t.callback(x)})))).catch((y=>{m&&y?.name==="AbortError"||(b=>b?.name==="TypeError"&&tK.test(b?.message||""))(y)?be.warn(y):be.error(y),t.callback==null||t.callback({statusCode:0,error:y})})).finally((()=>p?clearTimeout(p.timeout):null))}},Oy=t=>{try{var e=P6(t),n=e.url,a=e.encodedBody,r=a??{},s=r.body,l=r.estimatedSize;if(!s)return;var c=s instanceof Blob?s:new Blob([s],{type:r.contentType});if(sa.sendBeacon(n,c))return;if(it(t.data)&&t.data.length>1&&(l??0)>16384){var u=Math.ceil(t.data.length/2);return Oy(he({},t,{data:t.data.slice(0,u)})),void Oy(he({},t,{data:t.data.slice(u)}))}be.warn("Beacon of ~"+(l??0)+" bytes was rejected by the browser, falling back to fetch"),C6(he({},t,{Ft:!0}))}catch(h){be.warn("Beacon send failed",h)}},nK=["/e/","/s/"],fS=(t,e)=>{var n=(r=>{var s=(l=>{var c=Wd(l),u=c?.pathname||l.split(/[?#]/)[0];return u?u[0]==="/"?u:"/"+u:"/"})(r);return nK.some((l=>((c,u)=>c.slice(c.length-u.length)===u)(s,l)))})(t),a=n?Ny(t,"ver"):t;return Bb(e===aa.GZipJS?Ny(a,"compression"):a,he({_:new Date().getTime().toString()},n?{}:{ver:en.JS_SDK_VERSION},e===aa.GZipJS?{}:{compression:e}))},vp=[];Sb&&vp.push({transport:"fetch",method:C6}),ty&&vp.push({transport:"XHR",method(t){var e=S6(t);if(e){var n=new ty,a=e.encodedBody;n.open(t.method||"GET",e.url,!0);var r=a??{},s=r.contentType,l=r.body;Mt(t.headers,(function(c,u){n.setRequestHeader(u,c)})),s&&n.setRequestHeader("Content-Type",s),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var c={statusCode:n.status,text:n.responseText};if(n.status===200)try{c.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(c)}},n.send(l)}}}),sa!=null&&sa.sendBeacon&&vp.push({transport:"sendBeacon",method:Oy});var jy=3e3;class aK{constructor(e,n){this.Or=!0,this.Lr=[],this.Fr=Br(n?.flush_interval_ms||jy,250,5e3,be.createLogger("flush interval"),jy),this.Ar=e}enqueue(e){this.Lr.push(e),this.$r||this.Nr()}unload(){this.Dr();var e=this.Lr.length>0?this.qr():{},n=Object.values(e);[...n.filter((a=>a.url.indexOf("/e")===0)),...n.filter((a=>a.url.indexOf("/e")!==0))].map((a=>{this.jr(he({},a,{transport:"sendBeacon"}))}))}enable(){this.Or=!1,this.Nr()}Nr(){var e=this;this.Or||(this.$r=setTimeout((()=>{if(this.Dr(),this.Lr.length>0){var n=this.qr(),a=function(){var s=n[r],l=new Date().getTime();s.data&&it(s.data)&&Mt(s.data,(c=>{c.offset=Math.abs(c.timestamp-l),delete c.timestamp})),e.jr(s)};for(var r in n)a()}}),this.Fr))}jr(e){try{this.Ar(e)}catch(n){be.error(n)}}Dr(){clearTimeout(this.$r),this.$r=void 0}qr(){var e={};return Mt(this.Lr,(n=>{var a,r=n,s=(r?r.batchKey:null)||r.url;ke(e[s])&&(e[s]=he({},r,{data:[]})),(a=e[s].data)==null||a.push(r.data)})),this.Lr=[],e}}var rK=["retriesPerformedSoFar"];class iK{constructor(e){this.Br=!1,this.Hr=3e3,this.Lr=[],this._instance=e,this.Lr=[],this.Ur=!0,!ke(Z)&&"onLine"in Z.navigator&&(this.Ur=Z.navigator.onLine,this.zr=()=>{this.Ur=!0,this.Wr()},this.Vr=()=>{this.Ur=!1},tn(Z,"online",this.zr),tn(Z,"offline",this.Vr))}get length(){return this.Lr.length}retriableRequest(e){var n=e.retriesPerformedSoFar,a=aE(e,rK);yi(n)&&(a.url=Bb(a.url,{retry_count:n})),this._instance._send_request(he({},a,{callback:r=>{if(r.statusCode!==200&&(400>r.statusCode||r.statusCode>=500)){if((r.statusCode===0?3:10)>(n??0))return void this.st(he({retriesPerformedSoFar:n},a));r.statusCode===0&&be.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(n??0)+" retries.")}a.callback==null||a.callback(r)}}))}st(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var a=(function(l){var c=3e3*Math.pow(2,l),u=c/2,h=Math.min(18e5,c),p=Math.random()-.5;return Math.ceil(h+p*(h-u))})(n),r=Date.now()+a;this.Lr.push({retryAt:r,requestOptions:e});var s="Enqueued failed request for retry in "+a;navigator.onLine||(s+=" (Browser is offline)"),be.warn(s),this.Br||(this.Br=!0,this.Zr())}Zr(){if(this.Gr&&clearTimeout(this.Gr),this.Lr.length===0)return this.Br=!1,void(this.Gr=void 0);this.Gr=setTimeout((()=>{this.Ur&&this.Lr.length>0&&this.Wr(),this.Zr()}),this.Hr)}Wr(){var e=Date.now(),n=[],a=this.Lr.filter((s=>e>s.retryAt||(n.push(s),!1)));if(this.Lr=n,a.length>0)for(var r of a)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.Gr&&(clearTimeout(this.Gr),this.Gr=void 0),this.Br=!1,ke(Z)||(this.zr&&(Z.removeEventListener("online",this.zr),this.zr=void 0),this.Vr&&(Z.removeEventListener("offline",this.Vr),this.Vr=void 0)),this.Lr)){var n=e.requestOptions;try{this._instance._send_request(he({},n,{transport:"sendBeacon"}))}catch(a){be.error(a)}}this.Lr=[]}}class sK{constructor(e){this.Qr=()=>{var n,a,r,s;this.Jr||(this.Jr={});var l=this.scrollElement(),c=this.scrollY(),u=l?Math.max(0,l.scrollHeight-l.clientHeight):0,h=c+(l?.clientHeight||0),p=l?.scrollHeight||0;this.Jr.lastScrollY=Math.ceil(c),this.Jr.maxScrollY=Math.max(c,(n=this.Jr.maxScrollY)!==null&&n!==void 0?n:0),this.Jr.maxScrollHeight=Math.max(u,(a=this.Jr.maxScrollHeight)!==null&&a!==void 0?a:0),this.Jr.lastContentY=h,this.Jr.maxContentY=Math.max(h,(r=this.Jr.maxContentY)!==null&&r!==void 0?r:0),this.Jr.maxContentHeight=Math.max(p,(s=this.Jr.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=e}get Kr(){return this._instance.config.scroll_root_selector}getContext(){return this.Jr}resetContext(){var e=this.Jr;return setTimeout(this.Qr,0),e}startMeasuringScrollPosition(){tn(Z,"scroll",this.Qr,{capture:!0}),tn(Z,"scrollend",this.Qr,{capture:!0}),tn(Z,"resize",this.Qr)}scrollElement(){if(!this.Kr)return Z?.document.documentElement;var e=it(this.Kr)?this.Kr:[this.Kr];for(var n of e){var a=Z?.document.querySelector(n);if(a)return a}}Yr(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.Kr){var a=this.scrollElement();return a&&a[n]||0}return Z?e==="y"?Z.scrollY||Z.pageYOffset||Z.document.documentElement.scrollTop||0:Z.scrollX||Z.pageXOffset||Z.document.documentElement.scrollLeft||0:0}scrollY(){return this.Yr("y")}scrollX(){return this.Yr("x")}}var oK=t=>f6(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties,t?.config.disable_capture_url_hashes);class mS{constructor(e,n,a,r){this.Xr=s=>{var l=this.ei();if(!l||l.sessionId!==s){var c={sessionId:s,props:this.ti(this._instance)};this.ri.register({[Py]:c})}},this._instance=e,this.ii=n,this.ri=a,this.ti=r||oK,this.ii.onSessionId(this.Xr)}ei(){return this.ri.props[Py]}getSetOnceProps(){var e,n=(e=this.ei())==null?void 0:e.props;return n?"r"in n?m6(n,this._instance.config.disable_capture_url_hashes):{$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 Mt(Nb(this.getSetOnceProps()),((n,a)=>{a==="$current_url"&&(a="url"),e["$session_entry_"+ry(a)]=n})),e}}class $b{constructor(){this.ni={}}on(e,n){return this.ni[e]||(this.ni[e]=[]),this.ni[e].push(n),()=>{this.ni[e]=this.ni[e].filter((a=>a!==n))}}emit(e,n){for(var a of this.ni[e]||[])a(n);for(var r of this.ni["*"]||[])r(e,n)}}var Jc=Zt("[SessionId]");class gS{on(e,n){return this.si.on(e,n)}constructor(e,n,a){var r;if(this.oi=null,this.ai=[],this.li=void 0,this.ui=!1,this.si=new $b,this.hi=(h,p)=>!(!yi(h)||!yi(p))&&Math.abs(h-p)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===xi)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=e.config,this.ri=e.persistence,this.di=void 0,this.ci=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=n||wi,this.fi=a||wi;var s=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*Br(this.Se.session_idle_timeout_seconds||1800,60,36e3,Jc.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+s+"_window_id",this.mi="ph_"+s+"_primary_window_exists",this.yi()){var l=Fn.F(this.gi),c=Fn.F(this.mi);l&&!c?this.di=l:Fn.P(this.gi),Fn.q(this.mi,!0)}if((r=this.Se.bootstrap)!=null&&r.sessionID)try{var u=(h=>{var p=this.Se.bootstrap.sessionID.replace(/-/g,"");if(p.length!==32)throw new Error("Not a valid UUID");if(p[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(p.substring(0,12),16)})();this.bi(this.Se.bootstrap.sessionID,new Date().getTime(),u)}catch(h){Jc.error("Invalid sessionID in bootstrap",h)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ke(this.ai)&&(this.ai=[]),this.ai.push(e),this.ci&&e(this.ci,this.di),()=>{this.ai=this.ai.filter((n=>n!==e))}}yi(){return this.Se.persistence!=="memory"&&!this.ri.ir&&Fn.N()}xi(e){e!==this.di&&(this.di=e,this.yi()&&Fn.q(this.gi,e))}ki(){return this.di?this.di:this.yi()?Fn.F(this.gi):null}Si(e){var n=this.oi;return!la(n)&&!la(e)&&5e3>Math.abs(e-n)}bi(e,n,a){var r=n!==this._sessionActivityTimestamp,s=!(e!==this.ci||a!==this._sessionStartTimestamp);this._sessionStartTimestamp=a,this._sessionActivityTimestamp=n,this.ci=e,s&&!r||s&&this.Si(n)||(this.oi=n,this.ri.register({[bl]:[n,e,a]}))}Ci(){var e,n=(e=this.Se)==null?void 0:e.persistence_save_debounce_ms;return yi(n)&&n>0}Ti(){this.Ci()?this.ri.refreshKey(bl):(this.ri.flush(),this.ri.load())}Ii(){var e;if(!la(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.oi){this.Ti();var n=this.Mi();n[1]===this.ci&&n[2]===this._sessionStartTimestamp&&(this.oi=this._sessionActivityTimestamp,this.ri.register({[bl]:[this._sessionActivityTimestamp,(e=this.ci)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.ri.flush())}}Ei(){var e=this.Mi()[0],n=yi(e)?e:0,a=yi(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,a)}Ri(e){return this.Ti(),this.hi(e,this.Ei())}Mi(){var e=this.ri.props[bl];return it(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.oi=null,clearTimeout(this.Pi),this.Pi=void 0,this.bi(null,null,null)}destroy(){this.ui=!0,this.Ii(),clearTimeout(this.Pi),this.Pi=void 0,this.li&&Z&&(Z.removeEventListener(mf,this.li,{capture:!1}),this.li=void 0),this.ai=[]}wi(){this.li=()=>{this.Ii(),this.yi()&&Fn.P(this.mi)},tn(Z,mf,this.li,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.Se.cookieless_mode===xi)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var a=n||new Date().getTime(),r=this.Mi(),s=r[1],l=r[2],c=this.Ei(),u=this.ki(),h=yi(l)&&Math.abs(a-l)>864e5,p=!1,m=!1,v=!s,y=s,b=!v&&!e&&this.hi(a,c);if(b){(b=this.Ri(a))||Jc.info("cross-tab refresh kept the session alive",{sessionId:s});var x=this.Mi();s=x[1],l=x[2]}v||b||h?(s=this.vi(),u=this.fi(),Jc.info("new session ID generated",{sessionId:s,windowId:u,changeReason:{noSessionId:v,activityTimeout:b,sessionPastMaximumLength:h}}),l=a,p=!0):(u||(u=this.fi(),p=!0),(m=s!==y)&&(Jc.info("adopted cross-tab session id",{sessionId:s,windowId:u}),p=!0));var P=yi(c)&&e&&!h?c:a,E=yi(l)?l:new Date().getTime();this.xi(u),this.bi(s,P,E),e||this.pi();var L={noSessionId:v,activityTimeout:b,sessionPastMaximumLength:h,crossTabAdoption:m};return p&&this.ai.forEach((T=>T(s,u,L))),{sessionId:s,windowId:u,sessionStartTimestamp:E,changeReason:p?L:void 0,lastActivityTimestamp:c}}pi(){this.ui||(clearTimeout(this.Pi),this.Pi=setTimeout((()=>{if(!this.ui)if(this.Ri(new Date().getTime())){var e=this.ci;this.resetSessionId(),this.si.emit("forcedIdleReset",{idleSessionId:e})}else this.pi()}),1.1*this.sessionTimeoutMs))}}var T6=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&UP(n,e))return!0;try{var a=t?.userAgentData;if(a!=null&&a.brands&&a.brands.some((r=>UP(r?.brand,e))))return!0}catch{}return!!t.webdriver};function E6(){return(E6=cn((function*(){var t=sa?.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e?.model;return Lt(n)&&n.length>0?n:void 0}catch(a){return void be.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",a)}}))).apply(this,arguments)}var kf=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 vS(t,e,n){return kl({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var A6={exact:(t,e)=>e.some((n=>t.some((a=>n===a)))),is_not:(t,e)=>e.every((n=>t.every((a=>n!==a)))),regex:(t,e)=>e.some((n=>t.some((a=>kf(n,a))))),not_regex:(t,e)=>e.every((n=>t.every((a=>!kf(n,a))))),icontains:(t,e)=>e.map(Vh).some((n=>t.map(Vh).some((a=>n.includes(a))))),not_icontains:(t,e)=>e.map(Vh).every((n=>t.map(Vh).every((a=>!n.includes(a))))),gt:(t,e)=>e.some((n=>{var a=parseFloat(n);return!isNaN(a)&&t.some((r=>a>parseFloat(r)))})),lt:(t,e)=>e.some((n=>{var a=parseFloat(n);return!isNaN(a)&&t.some((r=>a<parseFloat(r)))}))},Vh=t=>t.toLowerCase();function R6(t,e){return!t||Object.entries(t).every((n=>{var a=n[1],r=e?.[n[0]];if(ke(r)||la(r))return!1;var s=[String(r)],l=A6[a.operator];return!!l&&l(a.values,s)}))}var zy="custom",_S="i.posthog.com",lK=/^\/static\//;class cK{constructor(e){this.Oi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+_S,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Oi[this.apiHost]||(this.Oi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":zy),this.Oi[this.apiHost]}Li(e){if(lK.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(e==="assets"){var a=this.Li(n);if(a)return""+a+n}if(this.region===zy)return this.apiHost+n;var r=_S+n;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}function L6(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var Rt=Zt("[Surveys]"),D6="seenSurvey_",I6=t=>{try{var e=(n=>((a,r)=>""+D6+(function(s){return s.current_iteration&&s.current_iteration>0?s.id+"_"+s.current_iteration:s.id})(r))(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(n){Rt.error("Failed to persist survey seen state",n)}},dK=[Nv.Popover,Nv.Widget,Nv.API],uK={ignoreConditions:!1,ignoreDelay:!1,displayType:Ly.Popover},hK=Zt("[PostHog ExternalIntegrations]"),pK={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class fK{constructor(e){this._instance=e}Bt(e,n){var a;(a=Be.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this._instance,e,(r=>{if(r)return hK.error("failed to load script",r);n()}))}startIfEnabledOrStop(){var e=this,n=function(){var s,l,c,u=a[0],h=a[1];!h||(s=Be.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[u]||e.Bt(pK[u],(()=>{var p;(p=Be.__PosthogExtensions__)==null||(p=p.integrations)==null||(p=p[u])==null||p.start(e._instance)})),!h&&(l=Be.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[u]&&((c=Be.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[u])==null||c.stop())};for(var a of Object.entries((r=this._instance.config.integrations)!==null&&r!==void 0?r:{})){var r;n()}}}var Ed={},Uv=0,wf=()=>{},yS='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Qc="Surveys module not available",bS="sanitize_properties is deprecated. Use before_send instead",M6="Invalid value for property_denylist config: ",fl="posthog",N6=!Xq&&va?.indexOf("MSIE")===-1&&va?.indexOf("Mozilla")===-1,kS=t=>{var e;return he({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:vq(xe?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:wf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:fn&&Lt(fn?.search)&&fn.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(Z==null||(e=Z.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!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){be.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Ey,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:jy},error_tracking:{},_onCapture:wf},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:Aq,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n)}))(t))},mK=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],wS=t=>{var e={};for(var n of mK){var a=n[0],r=n[1];ke(t[a])||(e[r]=t[a])}var s=Bt({},e,t),l=t.__preview_external_dependency_versioned_paths;return ke(l)||(ke(t.strict_script_versioning)&&(s.strict_script_versioning=!!l),Lt(l)&&ke(t.asset_host)&&(s.asset_host=l)),it(t.property_blacklist)&&(ke(t.property_denylist)?s.property_denylist=t.property_blacklist:it(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:be.error(M6+t.property_denylist)),s};class gK{constructor(){this.__forceAllowLocalhost=!1}get Fi(){return this.__forceAllowLocalhost}set Fi(e){be.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Wa{Ai(e,n){if(e){var a=this.$i.indexOf(e);a!==-1&&this.$i.splice(a,1)}return this.$i.push(n),n.initialize==null||n.initialize(),n}Ni(){return this.config.cookieless_mode===xi||this.config.cookieless_mode===Ks&&this.consent.isRejected()}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(){var e;this.webPerformance=new gK,this.Di=!1,this.version=en.LIB_VERSION,this.qi=new $b,this.$i=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=kS(),this.SentryIntegration=zq,this.sentryIntegration=a=>(function(r,s){var l=o6(r,s);return{name:s6,processEvent:c=>l(c)}})(this,a),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.ji=!1,this.Bi=null,this.Hi=null,this.Ui=null,this.scrollManager=new sK(this),this.pageViewManager=new sS(this),this.rateLimiter=new qq(this),this.requestRouter=new cK(this),this.consent=new Pq(this),this.externalIntegrations=new fK(this);var n=(e=Wa.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(a,r,s)=>{var l=Lt(a)?{[a]:r}:a;this.setPersonProperties(l),s?.({})},set_once:(a,r,s)=>{var l=Lt(a)?{[a]:r}:a;this.setPersonProperties(void 0,l),s?.({})}},this.on("eventCaptured",(a=>be.info('send "'+a?.event+'"',a)))}init(e,n,a){if(a&&a!==fl){var r,s=(r=Ed[a])!==null&&r!==void 0?r:new Wa;return s._init(e,n,a),Ed[a]=s,Ed[fl][a]=s,s}return this._init(e,n,a)}_init(e,n,a){var r,s;n===void 0&&(n={});var l=Lt(e)?e.trim():"";if(!l)return be.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.zi(n.debug),this.Wi=n,this.Vi=[],n.person_profiles?this.Hi=n.person_profiles:n.process_person&&(this.Hi=n.process_person);var c=kS(n.defaults),u=wS(n),h=Bt({},c,u,{name:a,token:l});qt(c.rageclick)&&qt(u.rageclick)&&(h.rageclick=Bt({},c.rageclick,u.rageclick)),qt(c.session_recording)&&qt(u.session_recording)&&(h.session_recording=Bt({},c.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&be.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:aa.GZipJS;var p=this.Zi();this.persistence=new Mv(this.config,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Mv(he({},this.config,{persistence:"sessionStorage"}),p,!1);var m=he({},this.persistence.props),v=he({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Gi=new aK((A=>this.Qi(A)),this.config.request_queue_config),this.Ji=new iK(this),this.__request_queue=[];var y=this.Ni();if(y||(this.sessionManager=new gS(this),this.sessionPropsManager=new mS(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(be.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Ki(y)}),0)):(be.info("Initializing extensions synchronously"),this.Ki(y)),en.DEBUG=en.DEBUG||this.config.debug,en.DEBUG&&be.info("Starting in debug mode",{this:this,config:n,thisC:he({},this.config),p:m,s:v}),!this.config.identity_distinct_id||(r=n.bootstrap)!=null&&r.distinctID||(n.bootstrap=he({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var b=n.bootstrap.distinctID,x=this.get_distinct_id(),P=this.persistence.get_property(vr);if(n.bootstrap.isIdentifiedID&&x!=null&&x!==b&&P===nl)this.identify(b);else if(n.bootstrap.isIdentifiedID&&x!=null&&x!==b&&P===al)be.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var E=this.config.get_device_id(wi()),L=n.bootstrap.isIdentifiedID?E:b;this.persistence.set_property(vr,n.bootstrap.isIdentifiedID?al:nl),this.register({distinct_id:b,$device_id:L})}}if(y)this.register_once({distinct_id:jh,$device_id:null},"");else if(!this.get_distinct_id()){var T=this.config.get_device_id(wi());this.register_once({distinct_id:T,$device_id:T},""),this.persistence.set_property(vr,nl)}return tn(Z,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(A,D){var B=A.config.segment;if(!B)return D();(function(j,S){var N=j.config.segment;if(!N)return S();var U=ee=>{var ce=()=>ee.anonymousId()||wi();j.config.get_device_id=ce,ee.id()&&(j.register({distinct_id:ee.id(),$device_id:ce()}),j.persistence.set_property(vr,al)),S()},Q=N.user();"then"in Q&&yr(Q.then)?Q.then(U):U(Q)})(A,(()=>{B.register((j=>{typeof Promise<"u"&&Promise.resolve||Iv.warn("This browser does not have Promise support, and can not use the segment integration");var S=(N,U)=>{if(!U)return N;N.event.userId||N.event.anonymousId===j.get_distinct_id()||(Iv.info("No userId set, resetting PostHog"),j.reset()),N.event.userId&&N.event.userId!==j.get_distinct_id()&&(Iv.info("UserId set, identifying with PostHog"),j.identify(N.event.userId));var Q=j.calculateEventProperties(U,N.event.properties);return N.event.properties=Object.assign({},Q,N.event.properties),N};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:N=>S(N,N.event.event),page:N=>S(N,pl),identify:N=>S(N,Rv),screen:N=>S(N,"$screen")}})(A)).then((()=>{D()}))}))})(this,(()=>this.Yi())):this.Yi(),yr(this.config._onCapture)&&this.config._onCapture!==wf&&(be.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(A=>this.config._onCapture(A.event,A)))),this.config.ip&&be.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.config.disableDeviceModel||(function(){return E6.apply(this,arguments)})().then((A=>{A&&this.register({[Ev]:A})})).catch(wf),this}Ki(e){var n,a,r,s,l,c,u,h,p=performance.now(),m=he({},Wa.__defaultExtensionClasses,this.config.__extensionClasses),v=[];m.featureFlags&&this.$i.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new m.featureFlags(this)),m.exceptions&&this.$i.push(this.exceptions=(a=this.exceptions)!==null&&a!==void 0?a:new m.exceptions(this)),m.historyAutocapture&&this.$i.push(this.historyAutocapture=new m.historyAutocapture(this)),m.tracingHeaders&&this.$i.push(this.tracingHeaders=new m.tracingHeaders(this)),m.siteApps&&this.$i.push(this.siteApps=new m.siteApps(this)),m.sessionRecording&&!e&&this.$i.push(this.sessionRecording=new m.sessionRecording(this)),this.config.disable_scroll_properties||v.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),m.autocapture&&this.$i.push(this.autocapture=new m.autocapture(this)),m.surveys&&this.$i.push(this.surveys=(r=this.surveys)!==null&&r!==void 0?r:new m.surveys(this)),m.logs&&this.$i.push(this.logs=(s=this.logs)!==null&&s!==void 0?s:new m.logs(this)),m.metrics&&this.$i.push(this.metrics=(l=this.metrics)!==null&&l!==void 0?l:new m.metrics(this)),m.conversations&&this.$i.push(this.conversations=(c=this.conversations)!==null&&c!==void 0?c:new m.conversations(this)),m.productTours&&this.$i.push(this.productTours=new m.productTours(this)),m.heatmaps&&this.$i.push(this.heatmaps=new m.heatmaps(this)),m.webVitalsAutocapture&&this.$i.push(this.webVitalsAutocapture=new m.webVitalsAutocapture(this)),m.exceptionObserver&&this.$i.push(this.exceptionObserver=new m.exceptionObserver(this)),m.deadClicksAutocapture&&this.$i.push(this.deadClicksAutocapture=new m.deadClicksAutocapture(this,jq)),m.toolbar&&this.$i.push(this.toolbar=(u=this.toolbar)!==null&&u!==void 0?u:new m.toolbar(this)),m.experiments&&this.$i.push(this.experiments=(h=this.experiments)!==null&&h!==void 0?h:new m.experiments(this)),this.$i.forEach((y=>{y.initialize&&v.push((()=>{y.initialize==null||y.initialize()}))})),v.push((()=>{if(this.Xi){var y=this.Xi;this.Xi=void 0,this.Mr(y)}})),this.en(v,p)}en(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.en(e,n)}),0);var a=e.shift();if(a)try{a()}catch(s){be.error("Error initializing extension:",s)}}var r=Math.round(performance.now()-n);this.register_for_session({[VE]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[HE]:r}),this.config.__preview_deferred_init_extensions&&be.info("PostHog extensions initialized ("+r+"ms)")}Mr(e){var n;if(!xe||!xe.body)return be.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Mr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Xi=e),this.tn=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Ke(e.supportedCompression,aa.GZipJS)?aa.GZipJS:Ke(e.supportedCompression,aa.Base64)?aa.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Hi?this.Hi:Ey}),this.$i.forEach((a=>a.onRemoteConfig==null?void 0:a.onRemoteConfig(e)))}Yi(){try{this.config.loaded(this)}catch(a){be.critical("`loaded` function failed",a)}if(this.rn(),this.config.internal_or_test_user_hostname&&fn!=null&&fn.hostname){var e=fn.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ni())&&this.nn()}),1),this.sn=new v6(this),this.sn.load()}rn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Gi)==null||e.enable())}_dom_loaded(){this.is_capturing()&&zh(this.__request_queue,(e=>this.Qi(e))),this.__request_queue=[],this.rn()}_handle_unload(){var e,n,a,r,s;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.an()&&this.capture(Av),(a=this.logs)==null||a.flushLogs("sendBeacon"),(r=this.Gi)==null||r.unload(),(s=this.Ji)==null||s.unload()):this.an()&&this.capture(Av,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?N6?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=he({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(ke(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var a,r,s,l=he({},n);l.timeout=l.timeout||6e4;var c=(a=l.transport)!==null&&a!==void 0?a:"fetch";c==="sendBeacon"&&ke(l.compression)&&l.data&&(l.compression=aa.Base64),l.url=fS(l.url,l.compression);var u=vp.filter((p=>!l.disableTransport||!p.transport||!l.disableTransport.includes(p.transport))),h=(r=(s=(function(p,m){for(var v=0;p.length>v;v++)if(p[v].transport===c)return p[v]})(u))==null?void 0:s.method)!==null&&r!==void 0?r:u[0].method;if(!h)throw new Error("No available transport method");c!=="sendBeacon"&&l.data&&l.compression===aa.GZipJS&&bG&&typeof Promise<"u"&&!gp?eK(l).then((p=>{h(p)})).catch((p=>{if(FP(p))return gp=!0,void h(he({},l,{compression:void 0,url:fS(n.url,void 0)}));(m=>{if(!m||typeof m!="object")return!1;var v="name"in m?String(m.name):"";return FP(m)||v===rE})(p)&&(gp=!0),h(l)})):h(l)})(he({},e,{callback:n=>{var a,r;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(a=(r=this.config).on_request_error)==null||a.call(r,n),e.callback==null||e.callback(n)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}Qi(e){this.Ji?this.Ji.retriableRequest(e):this._send_request(e)}_execute_array(e){Uv++;try{var n,a=[],r=[],s=[];zh(e,(c=>{if(c)if(it(n=c[0]))s.push(c);else if(yr(c))try{c.call(this)}catch(u){be.error("Error executing queued PostHog call",c,u)}else it(c)&&n==="alias"?a.push(c):it(c)&&n.indexOf("capture")!==-1&&yr(this[n])?s.push(c):r.push(c)}));var l=function(c,u){zh(c,(function(h){try{if(it(h[0])){var p=u;Mt(h,(function(m){p=p[m[0]].apply(p,m.slice(1))}))}else u[h[0]].apply(u,h.slice(1))}catch(m){be.error("Error executing queued PostHog call",h,m)}}))};l(a,this),l(r,this),l(s,this)}finally{Uv--}}push(e){if(Uv>0&&it(e)&&Lt(e[0])){var n=Wa.prototype[e[0]];yr(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,a){var r,s,l,c,u;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Gi){if(this.is_capturing())if(!ke(e)&&Lt(e)){var h=!this.config.opt_out_useragent_filter&&this._is_bot();if(!h||this.config.__preview_capture_bot_pageviews){var p=a!=null&&a.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(p==null||!p.isRateLimited){n!=null&&n.$current_url&&!Lt(n?.$current_url)&&(be.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||a!=null&&a.ln||be.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),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 m=new Date,v=a?.timestamp||m,y=HP(a?.uuid,wi),b={uuid:y,event:e,properties:this.calculateEventProperties(e,n||{},v,y)};e===pl&&this.config.__preview_capture_bot_pageviews&&h&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),p&&(b.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens),a?.$set&&(b.$set=a?.$set);var x=a?.$unset;x&&(b.$unset=x);var P,E,L,T=this.un(a?.$set_once,e!==YP,e===Rv);if(T&&(b.$set_once=T),a!=null&&a._noTruncate||(s=this.config.properties_string_max_length,l=b,c=U=>Lt(U)?U.slice(0,s):U,u=new Set,b=(function U(Q,ee){return Q!==Object(Q)?c?c(Q):Q:u.has(Q)?void 0:(u.add(Q),it(Q)?(ce=[],zh(Q,(le=>{ce.push(U(le))}))):(ce={},Mt(Q,((le,re)=>{u.has(le)||(ce[re]=U(le))}))),ce);var ce})(l)),b.timestamp=v,ke(a?.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=m),e===Pi.DISMISSED||e===Pi.SENT){var A=n?.[Ov.SURVEY_ID],D=n?.[Ov.SURVEY_ITERATION];I6({id:A,current_iteration:D}),b.$set=he({},b.$set,{[(P={id:A,current_iteration:D},E=e===Pi.SENT?"responded":"dismissed",L="$survey_"+E+"/"+P.id,P.current_iteration&&P.current_iteration>0&&(L="$survey_"+E+"/"+P.id+"/"+P.current_iteration),L)]:!0})}else e===Pi.SHOWN&&(b.$set=he({},b.$set,{[Ov.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===Gq.SHOWN){var B=n?.[lS.TOUR_TYPE];B&&(b.$set=he({},b.$set,{[lS.TOUR_LAST_SEEN_DATE+"/"+B]:new Date().toISOString()}))}var j=he({},b.properties.$set,b.$set);if(cs(j)||this.setPersonPropertiesForFlags(j),!nt(this.config.before_send)){var S=this.it(b);if(!S)return;(b=S).uuid=HP(b.uuid,wi)}this.qi.emit("eventCaptured",b);var N={method:"POST",url:(r=a?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:b,compression:"best-available",batchKey:a?._batchKey,transport:a?.transport};return!this.config.request_batching||a&&(a==null||!a._batchKey)||a!=null&&a.send_instantly?this.Qi(N):this.Gi.enqueue(N),b}be.critical("This capture call is ignored due to client rate limiting.")}}else be.error("No event name provided to posthog.capture")}else be.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,a,r,s){if(a=a||new Date,!this.persistence||!this.sessionPersistence)return n;var l=s?void 0:this.persistence.remove_event_timer(e),c=he({},n);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.Ni()&&(c.$cookieless_mode=!0),e==="$snapshot"){var u=he({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=u.distinct_id,(!Lt(c.distinct_id)&&!Bn(c.distinct_id)||iy(c.distinct_id))&&be.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var h,p=(function(E,L,T,A){var D,B,j,S;if(A===void 0&&(A=!1),!va)return{};var N,U,Q,ee,ce,le,re,te,ie,$=E?[...Fl,...L||[]]:[],X=(function(ae){for(var _e=0;$P.length>_e;_e++){var fe=$P[_e],ve=fe[1],Ne=fe[0].exec(ae),Oe=Ne&&(yr(ve)?ve(Ne,ae):ve);if(Oe)return Oe}return["",""]})(va),W=(N=typeof navigator<"u"?navigator:void 0)!=null&&N.brave?{brave:!0}:{},O={detectGoogleSearchApp:T},Y=Bt(Nb({$os:X[0],$os_version:X[1],$browser:EE(va,navigator.vendor,W,O),$device:VP(va),$device_type:(Q=va,ee={userAgentDataPlatform:(D=navigator)==null||(D=D.userAgentData)==null?void 0:D.platform,maxTouchPoints:(B=navigator)==null?void 0:B.maxTouchPoints,screenWidth:Z==null||(j=Z.screen)==null?void 0:j.width,screenHeight:Z==null||(S=Z.screen)==null?void 0:S.height,devicePixelRatio:Z?.devicePixelRatio},ie=VP(Q),ie===dE||ie===cE||ie==="Kobo"||ie==="Kindle Fire"||ie===xE?Nl:ie===Bd||ie===Cl||ie===$d||ie===oy?"Console":ie===hE?"Wearable":ie?Da:ee?.userAgentDataPlatform==="Android"&&((ce=ee?.maxTouchPoints)!==null&&ce!==void 0?ce:0)>0?600>Math.min((le=ee?.screenWidth)!==null&&le!==void 0?le:0,(re=ee?.screenHeight)!==null&&re!==void 0?re:0)/((te=ee?.devicePixelRatio)!==null&&te!==void 0?te:1)?Da:Nl:"Desktop"),$timezone:g6(),$timezone_offset:Vq()}),{$current_url:Gd(A?ms(fn?.href):fn?.href,$,qd),$host:fn?.host,$pathname:fn?.pathname,$raw_user_agent:va.length>1e3?va.substring(0,997)+"...":va,$browser_version:FG(va,navigator.vendor,W,O),$browser_language:oS(),$browser_language_prefix:(U=oS(),typeof U=="string"?U.split("-")[0]:void 0),$screen_height:Z?.screen.height,$screen_width:Z?.screen.width,$viewport_height:Z?.innerHeight,$viewport_width:Z?.innerWidth,$lib:en.LIB_NAME,$lib_version:en.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return en.SDK_DIST_CHANNEL&&(Y.$sdk_dist_channel=en.SDK_DIST_CHANNEL),Y})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var m=this.sessionManager.checkAndGetSessionAndWindowId(s,a.getTime()),v=m.windowId;c.$session_id=m.sessionId,c.$window_id=v}this.sessionPropsManager&&Bt(c,this.sessionPropsManager.getSessionProps());try{var y;this.sessionRecording&&Bt(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=(y=this.Ji)==null?void 0:y.length}catch(E){c.$sdk_debug_error_capturing_properties=String(E)}if(this.requestRouter.region===zy&&(c.$lib_custom_api_host=this.config.api_host),h=e!==pl||s?e!==Av||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(a):this.pageViewManager.doPageView(a,r),c=Bt(c,h),e===pl&&xe&&(c.title=xe.title),!ke(l)){var b=a.getTime()-l;c.$duration=parseFloat((b/1e3).toFixed(3))}va&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser"),(c=Bt({},p,this.persistence.properties(),this.sessionPersistence.properties(),c)).$is_identified=this._isIdentified(),it(this.config.property_denylist)?Mt(this.config.property_denylist,(function(E){delete c[E]})):be.error(M6+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var x=this.config.sanitize_properties;x&&(be.error(bS),c=x(c,e));var P=this.hn();return c.$process_person_profile=P,P&&!s&&this.dn("_calculate_event_properties"),c}un(e,n,a){var r;if(n===void 0&&(n=!0),a===void 0&&(a=!1),!this.persistence||!this.hn()||this.Di&&!a)return e;var s=this.persistence.get_initial_props(),l=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),c=Bt({},s,l||{},e||{}),u=this.config.sanitize_properties;return u&&(be.error(bS),c=u(c,"$set_once")),n&&(this.Di=!0),cs(c)?void 0:c}register(e,n){var a;(a=this.persistence)==null||a.register(e,n)}register_once(e,n,a){var r;(r=this.persistence)==null||r.register_once(e,n,a)}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)}cn(e,n){this.register({[e]:n})}getFeatureFlag(e,n){var a;return(a=this.featureFlags)==null?void 0:a.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var a;return(a=this.featureFlags)==null?void 0:a.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var a;return(a=this.featureFlags)==null?void 0:a.isFeatureEnabled(e,n)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,n,a){var r;(r=this.featureFlags)==null||r.updateFlags(e,n,a)}updateEarlyAccessFeatureEnrollment(e,n,a){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,n,a)}getEarlyAccessFeatures(e,n,a){var r;return n===void 0&&(n=!1),(r=this.featureFlags)==null?void 0:r.getEarlyAccessFeatures(e,n,a)}on(e,n){return this.qi.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Qc}),()=>{})}onSessionId(e){var n,a;return(n=(a=this.sessionManager)==null?void 0:a.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:Qc})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:Qc})}renderSurvey(e,n){var a;(a=this.surveys)==null||a.renderSurvey(e,n)}displaySurvey(e,n){var a;n===void 0&&(n=uK),(a=this.surveys)==null||a.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)==null||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,a;return(n=(a=this.surveys)==null?void 0:a.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:Qc}}canRenderSurveyAsync(e,n){var a,r;return n===void 0&&(n=!1),(a=(r=this.surveys)==null?void 0:r.canRenderSurveyAsync(e,n))!==null&&a!==void 0?a:Promise.resolve({visible:!1,disabledReason:Qc})}vn(e){return!e||iy(e)?(be.critical("Unique user id has not been set in posthog.identify"),!1):e===jh?(be.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(be.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.'),!1)}identify(e,n,a){if(!this.__loaded||!this.persistence)return be.uninitializedWarning("posthog.identify");if(Bn(e)&&(e=e.toString(),be.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.vn(e)&&this.dn("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(df)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(ld)&&(this.unregister(ld),this.register({distinct_id:e}));var s,l=(this.persistence.get_property(vr)||nl)===nl;e!==r&&l?(this.persistence.set_property(vr,al),this.setPersonPropertiesForFlags({$set:n||{},$set_once:a||{}},!1),this.capture(Rv,{distinct_id:e,$anon_distinct_id:r},{$set:n||{},$set_once:a||{}}),this.Ui=vS(e,n,a),(s=this.featureFlags)==null||s.setAnonymousDistinctId(r)):(n||a)&&this.setPersonProperties(n,a),e!==r&&(this.reloadFeatureFlags(),this.unregister(Sd))}}setPersonProperties(e,n){if((e||n)&&this.dn("posthog.setPersonProperties")){var a=vS(this.get_distinct_id(),e,n);this.Ui!==a?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Ui=a):be.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,a=(it(e)?e:[e]).filter((r=>Lt(r)&&r.length>0));a.length!==0&&this.dn("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(a,!0),this.capture("$set",{$unset:a}),this.Ui=null)}group(e,n,a){if(e&&n){var r=this.getGroups(),s=r[e]!==n;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:he({},r,{[e]:n})}),s||a){var l={$group_type:e,$group_key:n};a&&(l.$group_set=a),this.capture(YP,l)}a&&this.setGroupPropertiesForFlags({[e]:a}),s&&!a&&this.reloadFeatureFlags()}else be.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){var a;n===void 0&&(n=!0),(a=this.featureFlags)==null||a.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e){var n;e===void 0&&(e=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n){var a;n===void 0&&(n=!0),this.dn("posthog.setGroupPropertiesForFlags")&&((a=this.featureFlags)==null||a.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(e)}reset(e){var n,a,r,s,l,c,u,h,p,m;if(be.info("reset"),!this.__loaded)return be.uninitializedWarning("posthog.reset");var v,y=this.get_property(df),b=this.get_property(Ev),x=this.get_property(ao);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(a=this.sessionPersistence)==null||a.clear(),ke(x)||(v=this.persistence)==null||v.register({[ao]:x}),(r=this.surveys)==null||r.reset(),(s=this.sn)==null||s.stop(),(l=this.featureFlags)==null||l.reset(),(c=this.conversations)==null||c.reset(),(u=this.logs)==null||u.reset(),(h=this.metrics)==null||h.reset(),(p=this.persistence)==null||p.set_property(vr,nl),(m=this.sessionManager)==null||m.resetSessionId(),this.Ui=null,this.config.cookieless_mode===xi)this.register_once({distinct_id:jh,$device_id:null},"");else{var P=this.config.get_device_id(wi());this.register_once({distinct_id:P,$device_id:e?P:y},""),e||ke(b)||this.register({[Ev]:b})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var n=this;return cn((function*(){var a,r,s,l,c;n.__loaded?((a=n.logs)==null||a.flushLogs("sendBeacon"),(r=n.metrics)==null||r.flush("sendBeacon"),(s=n.Gi)==null||s.unload(),(l=n.Ji)==null||l.unload(),(c=n.featureFlags)==null||c.destroy()):be.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,n){var a;this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(a=this.conversations)==null||a.fn()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.pn()}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 n=this.sessionManager.checkAndGetSessionAndWindowId(!0),a=n.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);if(e!=null&&e.withTimestamp&&a){var s,l=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!a)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-a)/1e3)-l,0)}return r}alias(e,n){return e===this.get_property(OE)?(be.critical("Attempting to create alias for existing People user - aborting."),-2):this.dn("posthog.alias")?(ke(n)&&(n=this.get_distinct_id()),e!==n?(this.cn(ld,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(be.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=he({},this.config);if(qt(e)){var a,r,s,l,c,u,h,p,m,v,y;Bt(this.config,wS(e));var b=this.Zi();(a=this.persistence)==null||a.update_config(this.config,n,b),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Mv(he({},this.config,{persistence:"sessionStorage"}),b,!1);var x=this.zi(this.config.debug);Hr(x)&&(this.config.debug=x),Hr(this.config.debug)&&(this.config.debug?(en.DEBUG=!0,It.N()&&It.q("ph_debug",!0),be.info("set_config",{config:e,oldConfig:n,newConfig:he({},this.config)})):(en.DEBUG=!1,It.N()&&It.P("ph_debug"))),(r=this.exceptionObserver)==null||r.onConfigChange(),(s=this.exceptions)==null||s.onConfigChange(),(l=this.sessionRecording)==null||l.startIfEnabledOrStop(),(c=this.tracingHeaders)==null||c.startIfEnabledOrStop(),(u=this.autocapture)==null||u.startIfEnabled(),(h=this.heatmaps)==null||h.startIfEnabled(),(p=this.exceptionObserver)==null||p.startIfEnabledOrStop(),(m=this.deadClicksAutocapture)==null||m.startIfEnabledOrStop(),(v=this.surveys)==null||v.loadIfEnabled(),this.gn(),(y=this.externalIntegrations)==null||y.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){en.LIB_NAME=e,en.LIB_VERSION=n}startSessionRecording(e){var n,a,r,s,l,c=e===!0,u={sampling:c||!(e==null||!e.sampling),linked_flag:c||!(e==null||!e.linked_flag),url_trigger:c||!(e==null||!e.url_trigger),event_trigger:c||!(e==null||!e.event_trigger)};Object.values(u).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),u.sampling&&((a=this.sessionRecording)==null||a.overrideSampling()),u.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),u.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),u.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){if(this.exceptions){var a=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:a});return this.exceptions.sendExceptionEvent(he({},r,n))}}addExceptionStep(e,n){var a;(a=this.exceptions)==null||a.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)==null||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)==null?void 0:n.logger)!==null&&e!==void 0?e:Wa.mn}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,a;return(n=(a=this.toolbar)==null?void 0:a.loadToolbar(e))!==null&&n!==void 0&&n}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:fl;return n!==fl&&(n=fl+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(vr))===al||((n=this.sessionPersistence)==null?void 0:n.get_property(vr))===al}hn(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===Ey&&!this._isIdentified()&&cs(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[ld])&&((n=this.persistence)==null||(n=n.props)==null||!n[pf]))}an(){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.hn()||this.dn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.dn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}dn(e){return this.config.person_profiles==="never"?(be.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.cn(pf,!0),!0)}Zi(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Ks)}gn(){var e,n,a,r,s=this.Zi();return((e=this.persistence)==null?void 0:e.ir)!==s&&((a=this.persistence)==null||a.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.ir)!==s&&((r=this.sessionPersistence)==null||r.set_disabled(s)),s}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==xi){if(this.Ni()){var a,r,s,l,c;this.reset(!0),(a=this.sessionManager)==null||a.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=new gS(this),this.pageViewManager=new sS(this),this.persistence&&(this.sessionPropsManager=new mS(this,this.sessionManager,this.persistence));var u,h=(s=(l=this.config.__extensionClasses)==null?void 0:l.sessionRecording)!==null&&s!==void 0?s:(c=Wa.__defaultExtensionClasses)==null?void 0:c.sessionRecording;h&&(this.sessionRecording=this.Ai(this.sessionRecording,new h(this)),this.tn&&((u=this.sessionRecording)==null||u.onRemoteConfig==null||u.onRemoteConfig(this.tn)))}var p,m;this.consent.optInOut(!0),this.gn(),this.rn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Ks&&((p=this.surveys)==null||p.loadIfEnabled()),(ke(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((m=e?.captureEventName)!==null&&m!==void 0?m:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.nn()}else be.warn(yS)}opt_out_capturing(){var e,n,a;this.config.cookieless_mode!==xi?(this.config.cookieless_mode===Ks&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.gn(),this.config.cookieless_mode===Ks&&(this.register({distinct_id:jh,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(n=this.sessionManager)==null||n.destroy(),(a=this.pageViewManager)==null||a.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.nn(),this.rn())):be.warn(yS)}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===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===xi||(this.config.cookieless_mode===Ks?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.gn()}_is_bot(){return sa?T6(sa,this.config.custom_blocked_useragents):void 0}nn(){xe&&(xe.visibilityState==="visible"?this.ji||(this.ji=!0,this.capture(pl,{title:xe.title},{send_instantly:!0}),this.Bi&&(xe.removeEventListener(ff,this.Bi),this.Bi=null)):this.Bi||(this.Bi=this.nn.bind(this),tn(xe,ff,this.Bi)))}debug(e){e===!1?(Z?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(Z?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Rr(){var e,n,a,r,s,l,c=this.Wi||{};return"advanced_disable_flags"in c?!!c.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(be.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):(a="advanced_disable_decide",r=be,s=(n="advanced_disable_flags")in(e=c)&&!nt(e[n]),l=a in e&&!nt(e[a]),s?e[n]:!!l&&(r&&r.warn("Config field '"+a+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[a]))}it(e){var n;if(nt(this.config.before_send))return e;var a=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(TG),r=it(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(var l of r){if(s=l(s),nt(s)){var c="Event '"+e.event+"' was rejected in beforeSend function";return CG(e.event)?be.warn(c+". This can cause unexpected behavior."):be.info(c),null}s.properties&&!cs(s.properties)||be.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var u of a)if(s.properties&&nt(s.properties[u]))return be.warn("Event '"+e.event+"' had its '"+u+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var e;return(e=this.pageViewManager.zt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,a){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(a)})}zi(e){var n=Hr(e)&&!e,a=It.N()&&It.A("ph_debug")==="true";return!n&&(!!a||e)}}Wa.__defaultExtensionClasses={},Wa.mn=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(var n=0;e.length>n;n++)t.prototype[e[n]]=mq(t.prototype[e[n]])})(Wa,["identify"]);class xS{constructor(e){this.disabled=e===!1;var n=qt(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,a){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(n-r.y)<this.thresholdPx&&this.timeoutMs>a-r.timestamp){if(this.clicks.push({x:e,y:n,timestamp:a}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:a}];return!1}}var Bv="$copy_autocapture",$v=Zt("[AutoCapture]");function Vv(t,e){return e.length>t?e.slice(0,t)+"...":e}function vK(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!gs(e));return e}function _K(t,e){var n,a,r=e.e,s=e.maskAllElementAttributes,l=e.maskAllText,c=e.elementAttributeIgnoreList,u=e.elementsChainAsString,h=e.disableCaptureUrlHashes;if(!gs(t))return{props:{}};for(var p=[t],m=new Set([t]),v=t;v.parentNode&&!Ra(v,"body")&&JE>p.length;)if(ZE(v.parentNode)){var y=v.parentNode.host;if(m.has(y))break;m.add(y),p.push(y),v=y}else{if(!gs(v.parentNode)||m.has(v.parentNode))break;m.add(v.parentNode),p.push(v.parentNode),v=v.parentNode}var b,x,P=[],E={},L=!1,T=!1;if(Mt(p,(S=>{var N=Ry(S);if(Ra(S,"a")){var U=S.getAttribute("href");L=!!(N&&U&&Cd(U))&&(h?ms(U):U)}Ke(vf(S),"ph-no-capture")&&(T=!0),P.push((function(ee,ce,le,re,te){te===void 0&&(te=!1);var ie=ee.tagName.toLowerCase(),$={tag_name:ie};jb.indexOf(ie)>-1&&!le&&($.$el_text=ie.toLowerCase()==="a"||ie.toLowerCase()==="button"?Vv(1024,aS(ee)):Vv(1024,Hd(ee)));var X=vf(ee);X.length>0&&($.classes=X.filter((function(ae){return ae!==""}))),Mt(ee.attributes,(function(ae){var _e;if((!n6(ee)||["name","id","class","aria-label"].indexOf(ae.name)!==-1)&&(re==null||!re.includes(ae.name))&&!ce&&Cd(ae.value)&&(!Lt(_e=ae.name)||_e.substring(0,10)!=="_ngcontent"&&_e.substring(0,7)!=="_nghost")){var fe=ae.value;ae.name==="class"&&(fe=Ob(fe).join(" ")),$["attr__"+ae.name]=Vv(1024,ae.name==="href"&&te?ms(fe):fe)}}));for(var W=1,O=1,Y=ee;Y=vK(Y);)W++,Y.tagName===ee.tagName&&O++;return $.nth_child=W,$.nth_of_type=O,$})(S,s,l,c,h));var Q=(function(ee){if(!Ry(ee))return{};var ce={};return Mt(ee.attributes,(function(le){if(le.name&&le.name.indexOf("data-ph-capture-attribute")===0){var re=le.name.replace("data-ph-capture-attribute-",""),te=le.value;re&&te&&Cd(te)&&(ce[re]=te)}})),ce})(S);Bt(E,Q)})),T)return{props:{},explicitNoCapture:T};if(l||(P[0].$el_text=Ra(t,"a")||Ra(t,"button")?aS(t):Hd(t)),L){var A,D;P[0].attr__href=L;var B=(A=Wd(L))==null?void 0:A.host,j=Z==null||(D=Z.location)==null?void 0:D.host;B&&j&&B!==j&&(b=L)}return{props:Bt({$event_type:r.type,$ce_version:1},u?{}:{$elements:P},{$elements_chain:(x=P,(function(S){return S.map((N=>{var U,Q,ee="";if(N.tag_name&&(ee+=N.tag_name),N.attr_class)for(var ce of(N.attr_class.sort(),N.attr_class))ee+="."+ce.replace(/"/g,"");var le=he({},N.text?{text:N.text}:{},{"nth-child":(U=N.nth_child)!==null&&U!==void 0?U:0,"nth-of-type":(Q=N.nth_of_type)!==null&&Q!==void 0?Q:0},N.href?{href:N.href}:{},N.attr_id?{attr_id:N.attr_id}:{},N.attributes),re={};return mp(le).sort(((te,ie)=>te[0].localeCompare(ie[0]))).forEach((te=>{var ie=te[1];return re[rS(te[0].toString())]=rS(ie.toString())})),(ee+=":")+mp(re).map((te=>te[0]+'="'+te[1]+'"')).join("")})).join(";")})((function(S){return S.map((N=>{var U,Q,ee={text:(U=N.$el_text)==null?void 0:U.slice(0,400),tag_name:N.tag_name,href:(Q=N.attr__href)==null?void 0:Q.slice(0,2048),attr_class:Nq(N),attr_id:N.attr__id,nth_child:N.nth_child,nth_of_type:N.nth_of_type,attributes:{}};return mp(N).filter((ce=>ce[0].indexOf("attr__")===0)).forEach((ce=>ee.attributes[ce[0]]=ce[1])),ee}))})(x)))},(n=P[0])!=null&&n.$el_text?{$el_text:(a=P[0])==null?void 0:a.$el_text}:{},b&&r.type==="click"?{$external_click_url:b}:{},E)}}var Xc=Zt("[ExceptionAutocapture]"),PS=()=>{},yK=Zt("[TracingHeaders]"),Bs=Zt("[Web Vitals]"),SS=9e5,CS="disabled",TS="lazy_loading",ed="awaiting_config",Hh="missing_config";Zt("[SessionRecording]"),Zt("[SessionRecording]");var Fy="[SessionRecording]",mi=Zt(Fy),bK=Zt("[Heatmaps]");function ES(t){return qt(t)&&"clientX"in t&&"clientY"in t&&Bn(t.clientX)&&Bn(t.clientY)}var Hv=Zt("[Product Tours]"),Wv=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(Db))},kK=["$set_once","$set"],Mr=Zt("[SiteApps]"),AS="Error while initializing PostHog app with config id ";function sl(t,e,n){if(nt(t))return!1;switch(n){case"exact":return t===e;case"contains":var a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(a,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class wK{constructor(e){this.yn=new $b,this.bn=(n,a)=>this._n(n,a)&&this.wn(n,a)&&this.xn(n,a)&&this.kn(n,a),this._n=(n,a)=>a==null||!a.event||n?.event===a?.event,this._instance=e,this.Sn=new Set,this.Cn=new Set}init(){var e,n;ke((e=this._instance)==null?void 0:e._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((a,r)=>{this.on(a,r)}))}register(e){var n,a;if(!ke((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((l=>{var c,u;(c=this.Cn)==null||c.add(l),(u=l.steps)==null||u.forEach((h=>{var p;(p=this.Sn)==null||p.add(h?.event||"")}))})),(a=this._instance)!=null&&a.autocapture)){var r,s=new Set;e.forEach((l=>{var c;(c=l.steps)==null||c.forEach((u=>{u!=null&&u.selector&&s.add(u?.selector)}))})),(r=this._instance)==null||r.autocapture.setElementSelectors(s)}}on(e,n){var a;n!=null&&e.length!=0&&(this.Sn.has(e)||this.Sn.has(n?.event))&&this.Cn&&((a=this.Cn)==null?void 0:a.size)>0&&this.Cn.forEach((r=>{this.Tn(n,r)&&this.yn.emit("actionCaptured",r.name)}))}In(e){this.onAction("actionCaptured",(n=>e(n)))}Tn(e,n){if(n?.steps==null)return!1;for(var a of n.steps)if(this.bn(e,a))return!0;return!1}onAction(e,n){return this.yn.on(e,n)}wn(e,n){if(n!=null&&n.url){var a,r=e==null||(a=e.properties)==null?void 0:a.$current_url;if(!r||typeof r!="string"||!sl(r,n.url,n.url_matching||"contains"))return!1}return!0}xn(e,n){return!!this.Mn(e,n)&&!!this.En(e,n)&&!!this.Rn(e,n)}Mn(e,n){var a;if(n==null||!n.href)return!0;var r=this.Pn(e);if(r.length>0)return r.some((c=>sl(c.href,n.href,n.href_matching||"exact")));var s,l=(e==null||(a=e.properties)==null?void 0:a.$elements_chain)||"";return!!l&&sl((s=l.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}En(e,n){var a;if(n==null||!n.text)return!0;var r=this.Pn(e);if(r.length>0)return r.some((h=>sl(h.text,n.text,n.text_matching||"exact")||sl(h.$el_text,n.text,n.text_matching||"exact")));var s,l,c,u=(e==null||(a=e.properties)==null?void 0:a.$elements_chain)||"";return!!u&&(s=(function(h){for(var p,m=[],v=/(?::|")text="(.*?)"/g;!nt(p=v.exec(h));)m.includes(p[1])||m.push(p[1]);return m})(u),l=n.text,c=n.text_matching||"exact",s.some((h=>sl(h,l,c))))}Rn(e,n){var a,r;if(n==null||!n.selector)return!0;var s=e==null||(a=e.properties)==null?void 0:a.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(n.selector_regex&&l)try{return new RegExp(n.selector_regex).test(l)}catch{return!1}return!1}Pn(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}kn(e,n){return n==null||!n.properties||n.properties.length===0||R6(n.properties.reduce(((a,r)=>{var s=it(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return a[r.key]={values:s,operator:r.operator||"exact"},a}),{}),e?.properties)}}class xK{constructor(e){this.On=[],this._instance=e,this.Ln=new Map,this.Fn=new Map,this.An=new Map}$n(e,n){return!!e&&R6(e.propertyFilters,n?.properties)}Nn(e,n){var a=new Map;return e.forEach((r=>{var s;(s=r.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach((l=>{if(l!=null&&l.name){var c=a.get(l.name)||[];c.push(r.id),a.set(l.name,c)}}))})),a}Dn(e,n,a){var r=(a===qc.Activation?this.Ln:this.Fn).get(e),s=[];return this.qn((l=>{s=l.filter((c=>r?.includes(c.id)))})),s.filter((l=>{var c,u=(c=l.conditions)==null||(c=c[a])==null||(c=c.values)==null?void 0:c.find((h=>h.name===e));return this.$n(u,n)}))}register(e){var n;ke((n=this._instance)==null?void 0:n._addCaptureHook)||(this.jn(e),this.Bn(e))}Bn(e){var n=e.filter((a=>{var r,s;return((r=a.conditions)==null?void 0:r.actions)&&((s=a.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0}));n.length!==0&&(this.Hn==null&&(this.Hn=new wK(this._instance),this.Hn.init(),this.Hn.In((a=>{this.onAction(a)}))),n.forEach((a=>{var r,s,l,c,u;a.conditions&&(r=a.conditions)!=null&&r.actions&&(s=a.conditions)!=null&&(s=s.actions)!=null&&s.values&&((l=a.conditions)==null||(l=l.actions)==null||(l=l.values)==null?void 0:l.length)>0&&((c=this.Hn)==null||c.register(a.conditions.actions.values),(u=a.conditions)==null||(u=u.actions)==null||(u=u.values)==null||u.forEach((h=>{if(h&&h.name){var p=this.An.get(h.name);p&&p.push(a.id),this.An.set(h.name,p||[a.id])}})))})))}jn(e){var n,a=e.filter((s=>{var l,c;return((l=s.conditions)==null?void 0:l.events)&&((c=s.conditions)==null||(c=c.events)==null||(c=c.values)==null?void 0:c.length)>0})),r=e.filter((s=>{var l,c;return((l=s.conditions)==null?void 0:l.cancelEvents)&&((c=s.conditions)==null||(c=c.cancelEvents)==null||(c=c.values)==null?void 0:c.length)>0}));a.length===0&&r.length===0||((n=this._instance)==null||n._addCaptureHook(((s,l)=>{this.onEvent(s,l)})),this.Ln=this.Nn(e,qc.Activation),this.Fn=this.Nn(e,qc.Cancellation))}onEvent(e,n){var a,r,s=this.Un(),l=(n==null||(a=n.properties)==null?void 0:a.$survey_id)||(n==null||(r=n.properties)==null?void 0:r.$product_tour_id);if(l&&this.getActivatedIds().includes(l)){var c=this.zn(e,l);if(c==="consume")return s.info("event consumed activated item, removing it",{event:e,itemId:l}),void this.Wn([l]);if(c==="persist")return s.info("shown item promoted to persisted activation",{event:e,itemId:l}),void this.Vn(l)}if(this.Fn.has(e)){var u=this.Dn(e,n,qc.Cancellation);u.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:u.map((p=>p.id))}),this.Wn(u.map((p=>p.id))),u.forEach((p=>this.Zn(p.id))))}if(this.Ln.has(e)){s.info("event name matched",{event:e,eventPayload:n,items:this.Ln.get(e)});var h=this.Dn(e,n,qc.Activation);this.Gn(h.map((p=>p.id)))}}onAction(e){this.An.has(e)&&this.Gn(this.An.get(e)||[])}Gn(e){e.length!==0&&(this.On=[...new Set([...this.On,...e])],this.Un().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Vn(e){this.On=this.On.filter((a=>a!==e));var n=this.Qn();n.includes(e)||this.Jn([...n,e])}Wn(e){var n=new Set(e);this.On=this.On.filter((s=>!n.has(s)));var a=this.Qn(),r=a.filter((s=>!n.has(s)));r.length!==a.length&&this.Jn(r)}Qn(){var e,n=this.Kn();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}getActivatedIds(){return[...new Set([...this.Qn(),...this.On])].filter((e=>!this.Yn(e)))}reset(){this.On=[],this.Qn().length>0&&this.Jn([])}getEventToItemsMap(){return this.Ln}Xn(){return this.Hn}}class PK extends xK{constructor(e){super(e)}Kn(){return ky}es(){return Pi.SHOWN}qn(e){var n;(n=this._instance)==null||n.getSurveys(e)}Zn(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}Un(){return Rt}Jn(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[ky]:e})}Yn(){return!1}zn(e,n){var a;this.qn((s=>{a=s.find((l=>l.id===n))}));var r=!a||(function(s){var l;return L6(s)&&!((l=s.conditions)==null||(l=l.events)==null||!l.repeatedActivation)||s.schedule==="always"})(a);return r?e===Pi.SHOWN?"consume":"ignore":e===Pi.SHOWN?"persist":e===Pi.DISMISSED||e===Pi.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Gv="SDK is not enabled or survey functionality is not yet loaded",RS="Disabled. Not loading surveys.",SK=Z!=null&&Z.location?_f(Z.location.hash,"__posthog")||_f(location.hash,"state"):null,LS="_postHogToolbarParams",DS=Zt("[Toolbar]"),gn=Zt("[FeatureFlags]"),$s=Zt("[FeatureFlags]",{debugEnabled:!0}),qv=`" failed. Feature flags didn't load in time.`,IS=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},MS=t=>{var e={};for(var n of mp(t||{})){var a=n[1];a&&(e[n[0]]=a)}return e},gi=Zt("[Error tracking]"),NS="Refusing to render web experiment since the viewer is a likely bot",CK={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>kf(e,t),not_regex:(t,e)=>!kf(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Zn{get Se(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(a){a===void 0&&(a=!1),n.getWebExperiments((r=>{Zn.ts("retrieved web experiments from the server"),n.rs=new Map,r.forEach((s=>{if(s.feature_flag_key){var l;n.rs&&(Zn.ts("setting flag key ",s.feature_flag_key," to web experiment ",s),(l=n.rs)==null||l.set(s.feature_flag_key,s));var c=n._instance.getFeatureFlag(s.feature_flag_key);Lt(c)&&s.variants[c]&&n.ns(s.name,c,s.variants[c].transforms)}else if(s.variants)for(var u in s.variants){var h=s.variants[u];Zn.ss(h,n._instance)&&n.ns(s.name,u,h.transforms)}}))}),a)},this._instance=e,this._instance.onFeatureFlags((a=>{this.onFeatureFlags(a)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Zn.ts(NS);else if(!this.Se.disable_web_experiments){if(nt(this.rs))return this.rs=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Zn.ts("applying feature flags",e),e.forEach((n=>{var a;if(this.rs&&(a=this.rs)!=null&&a.has(n)){var r,s=this._instance.getFeatureFlag(n),l=(r=this.rs)==null?void 0:r.get(n);s&&l!=null&&l.variants[s]&&this.ns(l.name,s,l.variants[s].transforms)}}))}}previewWebExperiment(){var e=Zn.getWindowLocation();if(e!=null&&e.search){var n=zl(e?.search,"__experiment_id"),a=zl(e?.search,"__experiment_variant");n&&a&&(Zn.ts("previewing web experiments "+n+" && "+a),this.getWebExperiments((r=>{this.os(parseInt(n),a,r)}),!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,a){if(this.Se.disable_web_experiments&&!a)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!n)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Se.token),method:"GET",callback:s=>e(s.statusCode===200&&s.json&&s.json.experiments||[])})}os(e,n,a){var r=a.filter((s=>s.id===e));r&&r.length>0&&(Zn.ts("Previewing web experiment ["+r[0].name+"] with variant ["+n+"]"),this.ns(r[0].name,n,r[0].variants[n].transforms))}static ss(e,n){return!nt(e.conditions)&&Zn.ls(e,n)&&Zn.us(e)}static ls(e,n){var a;if(nt(e.conditions)||nt((a=e.conditions)==null?void 0:a.url))return!0;var r=Zn.getWindowLocation();if(r){var s,l,c,u=KE(n,r.href);return(s=e.conditions)==null||!s.url||CK[(l=(c=e.conditions)==null?void 0:c.urlMatchType)!==null&&l!==void 0?l:"icontains"](e.conditions.url,u)}return!1}static getWindowLocation(){return Z?.location}static us(e){var n;if(nt(e.conditions)||nt((n=e.conditions)==null?void 0:n.utm))return!0;var a=d6();if(a.utm_source){var r,s,l,c,u,h,p,m,v=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==a.utm_campaign,y=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_source||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_source)==a.utm_source,b=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_medium||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_medium)==a.utm_medium,x=(p=e.conditions)==null||(p=p.utm)==null||!p.utm_term||((m=e.conditions)==null||(m=m.utm)==null?void 0:m.utm_term)==a.utm_term;return v&&b&&x&&y}return!1}static ts(e){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;n>r;r++)a[r-1]=arguments[r];be.info("[WebExperiments] "+e,a)}ns(e,n,a){this._is_bot()?Zn.ts(NS):n!=="control"?a.forEach((r=>{if(r.selector){var s;Zn.ts("applying transform of variant "+n+" for experiment "+e+" ",r);var l=(s=document)==null?void 0:s.querySelectorAll(r.selector);l?.forEach((c=>{var u=c;r.html&&(u.innerHTML=r.html),r.css&&u.setAttribute("style",r.css)}))}})):Zn.ts("Control variants leave the page unmodified.")}_is_bot(){return sa&&this._instance?T6(sa,this.Se.custom_blocked_useragents):void 0}}var Ba=Zt("[Conversations]"),Vs="Conversations not available yet.",OS="console",Kf={featureFlags:class{constructor(t){this.hs=!1,this.ds=!1,this.cs=!1,this.vs=!1,this.fs=!1,this.ps=!1,this.gs=!1,this.ys=!1,this.bs=0,this._s=()=>{var e=this.ws();this.bs=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],Z&&tn(Z,"online",this._s)}destroy(){Z?.removeEventListener("online",this._s)}get Se(){return this._instance.config}get ri(){return this._instance.persistence}xs(t){return this._instance.get_property(t)}ks(){var t,e;return(t=(e=this.ri)==null?void 0:e.sr(this.Se.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}Ss(){return!!this.ks()&&(this.ys||this.cs||(this.ys=!0,gn.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Cs(){var t,e=(t=this.Se.evaluation_contexts)!==null&&t!==void 0?t:this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.gs||(gn.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.gs=!0),e!=null&&e.length?e.filter((n=>{var a=n&&typeof n=="string"&&n.trim().length>0;return a||gn.error("Invalid evaluation context found:",n,"Expected non-empty string"),a})):[]}Ts(){return this.Cs().length>0}Is(){var t=this.Se.flag_keys;if(!ke(t)){if(it(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||gn.error("Invalid flag key found:",e,"Expected non-empty string"),n}));gn.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,n=this._instance.config,a=(t=(e=n.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(a).length){var r,s,l=(r=(s=n.bootstrap)==null?void 0:s.featureFlagPayloads)!==null&&r!==void 0?r:{},c=Object.keys(a).filter((h=>!!a[h])).reduce(((h,p)=>(h[p]=a[p]||!1,h)),{}),u=Object.keys(l).filter((h=>c[h])).reduce(((h,p)=>(l[p]&&(h[p]=l[p]),h)),{});this.receivedFeatureFlags({featureFlags:c,featureFlagPayloads:u})}}updateFlags(t,e,n){var a,r,s=n!=null&&n.merge&&(a=this.xs(Ys))!==null&&a!==void 0?a:{},l=n!=null&&n.merge&&(r=this.xs(fp))!==null&&r!==void 0?r:{},c=he({},s,t),u=he({},l,e),h={};for(var p of Object.entries(c)){var m=p[0],v=p[1];h[m]={key:m,enabled:NP(v),variant:OP(v),reason:void 0,metadata:ke(u?.[m])?void 0:{id:0,version:void 0,description:void 0,payload:u[m]}}}this.receivedFeatureFlags({flags:h})}get hasLoadedFlags(){return this.ds}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.xs(_y),e=this.xs(bi),n=this.xs(hl);if(!n&&!e)return t||{};var a=Bt({},t||{}),r=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var s of r){var l,c,u=a[s],h=e?.[s],p=ke(h)?(l=u?.enabled)!==null&&l!==void 0&&l:!!h,m=ke(h)?u.variant:typeof h=="string"?h:void 0,v=n?.[s],y=he({},u,{enabled:p,variant:p?m??u?.variant:void 0});p!==u?.enabled&&(y.original_enabled=u?.enabled),m!==u?.variant&&(y.original_variant=u?.variant),v&&(y.metadata=he({},u?.metadata,{payload:v,original_payload:u==null||(c=u.metadata)==null?void 0:c.payload})),a[s]=y}return this.hs||(gn.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:a}),this.hs=!0),a}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var a=t[n];return{key:n,enabled:NP(a),variant:OP(a),payload:MP(e[n])}}))}getFlagVariants(){var t=this.xs(Ys),e=this.xs(bi);if(!e)return t||{};for(var n=Bt({},t),a=Object.keys(e),r=0;a.length>r;r++)n[a[r]]=e[a[r]];return this.hs||(gn.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.hs=!0),n}getFlagPayloads(){var t=this.xs(fp),e=this.xs(hl);if(!e)return t||{};for(var n=Bt({},t||{}),a=Object.keys(e),r=0;a.length>r;r++)n[a[r]]=e[a[r]];return this.hs||(gn.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.hs=!0),n}reloadFeatureFlags(){this.vs||this.Se.advanced_disable_feature_flags||this.ws()||this.Ms||(this._instance.qi.emit("featureFlagsReloading",!0),this.Ms=setTimeout((()=>{this.Es()}),5))}Rs(){clearTimeout(this.Ms),this.Ms=void 0}ensureFlagsLoaded(){this.ds||this.cs||this.Ms||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.vs=t}Es(t){var e;if(this.Rs(),!this._instance.Rr()&&!this.ws())if(this.cs)this.fs=!0;else{var n=this.Se.token,a=this.xs(df),r={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:he({},((e=this.ri)==null?void 0:e.get_initial_props())||{},this.xs(Gs)||{}),group_properties:this.xs(qs),timezone:g6()};la(a)||ke(a)||(r.$device_id=a),(t!=null&&t.disableFlags||this.Se.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.Ts()&&(r.evaluation_contexts=this.Cs());var s=this.Is();ke(s)||(r.flag_keys=s);var l=!!this.Se.advanced_only_evaluate_survey_feature_flags,c=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Se.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.cs=!0,this._instance._send_request({method:"POST",url:c,data:r,compression:this.Se.disable_compression?void 0:aa.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback:u=>{var h,p,m,v=!0;if(this.Ps(u.statusCode),u.statusCode===200&&(this.fs||(this.$anon_distinct_id=void 0),v=!1),this.cs=!1,!r.disable_flags||this.fs){this.ps=!v;var y=[];u.error?u.error instanceof Error?y.push(u.error.name==="AbortError"?"timeout":"connection_error"):y.push("unknown_error"):u.statusCode!==200&&y.push("api_error_"+u.statusCode),(h=u.json)!=null&&h.errorsWhileComputingFlags&&y.push("errors_while_computing_flags");var b,x=!((p=u.json)==null||(p=p.quotaLimited)==null||!p.includes("feature_flags"));x&&y.push("quota_limited"),(m=this.ri)==null||m.register({[xy]:y}),x?gn.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."):(r.disable_flags||this.receivedFeatureFlags((b=u.json)!==null&&b!==void 0?b:{},v,{partialResponse:l}),this.fs&&(this.fs=!1,this.Es()))}}})}}ws(){return l6(this.bs,3)}Ps(t){this.bs=c6(t,this.bs,3,(()=>gn.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var n;if(e===void 0&&(e={}),!e.fresh||this.ps)if(this.ds||this.getFlags()&&this.getFlags().length>0){if(!this.Ss()){var a=this.getFeatureFlagResult(t,e);return(n=a?.variant)!==null&&n!==void 0?n:a?.enabled}}else gn.warn('getFeatureFlag for key "'+t+qv)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e?.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.ps)if(this.ds||this.getFlags()&&this.getFlags().length>0){if(!this.Ss()){var n=this.getFlagVariants(),a=t in n,r=n[t],s=this.getFlagPayloads()[t],l=String(r),c=this.xs(yy)||void 0,u=this.xs(Vd)||void 0,h=this.xs(Sd)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var p,m=this._instance.get_session_id(),v=this.xs(wy);m&&m!==v&&(h={},(p=this.ri)==null||p.register({[Sd]:h,[wy]:m}))}if((e.send_event||!("send_event"in e))&&(!(t in h)||!h[t].includes(l))){var y,b,x,P,E,L,T,A,D,B;it(h[t])?h[t].push(l):h[t]=[l],(y=this.ri)==null||y.register({[Sd]:h});var j=this.getFeatureFlagDetails(t),S=[...(b=this.xs(xy))!==null&&b!==void 0?b:[]];ke(r)&&S.push("flag_missing");var N={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:s||null,$feature_flag_request_id:c,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:((x=this.Se.bootstrap)==null||(x=x.featureFlags)==null?void 0:x[t])||null,$feature_flag_bootstrapped_payload:((P=this.Se.bootstrap)==null||(P=P.featureFlagPayloads)==null?void 0:P[t])||null,$used_bootstrap_value:!this.ps};ke(j==null||(E=j.metadata)==null?void 0:E.version)||(N.$feature_flag_version=j.metadata.version);var U,Q=(L=j==null||(T=j.reason)==null?void 0:T.description)!==null&&L!==void 0?L:j==null||(A=j.reason)==null?void 0:A.code;Q&&(N.$feature_flag_reason=Q),j!=null&&(D=j.metadata)!=null&&D.id&&(N.$feature_flag_id=j.metadata.id),ke(j?.original_variant)&&ke(j?.original_enabled)||(N.$feature_flag_original_response=ke(j.original_variant)?j.original_enabled:j.original_variant),j!=null&&(B=j.metadata)!=null&&B.original_payload&&(N.$feature_flag_original_payload=j==null||(U=j.metadata)==null?void 0:U.original_payload),S.length&&(N.$feature_flag_error=S.join(",")),this._instance.capture("$feature_flag_called",N)}if(a)return{key:t,enabled:!!r,variant:typeof r=="string"?r:void 0,payload:MP(s)}}}else gn.warn('getFeatureFlagResult for key "'+t+qv)}getRemoteConfigPayload(t,e){var n=this.Se.token,a={distinct_id:this._instance.get_distinct_id(),token:n};this.Ts()&&(a.evaluation_contexts=this.Cs());var r=this.Is();ke(r)||(a.flag_keys=r),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:a,compression:this.Se.disable_compression?void 0:aa.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback(s){var l,c=(l=s.json)==null?void 0:l.featureFlagPayloads;e(c?.[t]||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),!e.fresh||this.ps){if(this.ds||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(t,e);return ke(n)?void 0:!!n}gn.warn('isFeatureEnabled for key "'+t+qv)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,n){if(this.ri){this.ds=!0;var a=this.getFlagVariants(),r=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(l,c,u,h,p,m){u===void 0&&(u={}),h===void 0&&(h={}),p===void 0&&(p={});var v=(S=>{var N=S.flags;return N?(S.featureFlags=Object.fromEntries(Object.keys(N).map((U=>{var Q;return[U,(Q=N[U].variant)!==null&&Q!==void 0?Q:N[U].enabled]}))),S.featureFlagPayloads=Object.fromEntries(Object.keys(N).filter((U=>N[U].enabled)).filter((U=>{var Q;return(Q=N[U].metadata)==null?void 0:Q.payload})).map((U=>{var Q;return[U,(Q=N[U].metadata)==null?void 0:Q.payload]})))):S.featureFlags&&gn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),S})(l),y=v.flags,b=v.featureFlags,x=v.featureFlagPayloads;if(b){var P=l.requestId,E=l.evaluatedAt;if(it(b)){gn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var L={};if(b)for(var T=0;b.length>T;T++)L[b[T]]=!0;c&&c.register({[pp]:b,[Ys]:L})}else{var A=b,D=x,B=y;if(m!=null&&m.partialResponse)A=he({},u,A),D=he({},h,D),B=he({},p,B);else if(l.errorsWhileComputingFlags)if(y){var j=new Set(Object.keys(y).filter((S=>{var N;return!((N=y[S])!=null&&N.failed)})));A=he({},u,Object.fromEntries(Object.entries(A).filter((S=>j.has(S[0]))))),D=he({},h,Object.fromEntries(Object.entries(D||{}).filter((S=>j.has(S[0]))))),B=he({},p,Object.fromEntries(Object.entries(B||{}).filter((S=>j.has(S[0])))))}else A=he({},u,A),D=he({},h,D),B=he({},p,B);c&&c.register(he({[pp]:Object.keys(MS(A)),[Ys]:A||{},[fp]:D||{},[_y]:B||{}},P?{[yy]:P}:{},E?{[Vd]:E}:{}))}}})(t,this.ri,a,r,s,n),e||(this.ys=!1),this.Os(e)}}override(t,e){e===void 0&&(e=!1),gn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.ri)return gn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.ri.unregister(bi),this.ri.unregister(hl),this.Os(),$s.info("All overrides cleared");if(it(t)){var e=IS(t);return this.ri.register({[bi]:e}),this.Os(),$s.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,a=t;if(this.hs=!!((n=a.suppressWarning)!==null&&n!==void 0&&n),"flags"in a){if(a.flags===!1)this.ri.unregister(bi),$s.info("Flag overrides cleared");else if(a.flags){if(it(a.flags)){var r=IS(a.flags);this.ri.register({[bi]:r})}else this.ri.register({[bi]:a.flags});$s.info("Flag overrides set",{flags:a.flags})}}return"payloads"in a&&(a.payloads===!1?(this.ri.unregister(hl),$s.info("Payload overrides cleared")):a.payloads&&(this.ri.register({[hl]:a.payloads}),$s.info("Payload overrides set",{payloads:a.payloads}))),void this.Os()}if(t&&typeof t=="object")return this.ri.register({[bi]:t}),this.Os(),$s.info("Flag overrides set",{flags:t});gn.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ds){var e=this.Ls(),n=e.flags,a=e.flagVariants;try{t(n,a)}catch(r){gn.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var a,r=(this.xs(dd)||[]).find((u=>u.flagKey===t)),s={["$feature_enrollment/"+t]:e},l={$feature_flag:t,$feature_enrollment:e,$set:s};r&&(l.$early_access_feature_name=r.name),n&&(l.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(s,!1);var c=he({},this.getFlagVariants(),{[t]:e});(a=this.ri)==null||a.register({[pp]:Object.keys(MS(c)),[Ys]:c}),this.Os()}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var a=this.xs(dd),r=n?"&"+n.map((s=>"stage="+s)).join("&"):"";if(a&&!e)return t(a);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Se.token+r),method:"GET",callback:s=>{var l,c;if(s.json){var u=s.json.earlyAccessFeatures;return(l=this.ri)==null||l.unregister(dd),(c=this.ri)==null||c.register({[dd]:u}),t(u)}}})}Ls(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((n=>e[n])),flagVariants:Object.keys(e).filter((n=>e[n])).reduce(((n,a)=>(n[a]=e[a],n)),{})}}Os(t){var e=this.Ls(),n=e.flags,a=e.flagVariants;this.featureFlagEventHandlers.forEach((r=>{try{r(n,a,{errorsLoading:t})}catch(s){gn.error("Error while running feature flags callback",s)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.xs(Gs)||{},a=t?.$set||(t!=null&&t.$set_once?{}:t),r=t?.$set_once,s={};if(r)for(var l in r)({}).hasOwnProperty.call(r,l)&&(l in n||(s[l]=r[l]));this._instance.register({[Gs]:he({},n,s,a)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=he({},this.xs(Gs)||{});t.forEach((a=>{delete n[a]})),this._instance.register({[Gs]:n}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(Gs),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.xs(qs)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((a=>{n[a]=he({},n[a],t[a]),delete t[a]})),this._instance.register({[qs]:he({},n,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.xs(qs)||{};this._instance.register({[qs]:he({},e,{[t]:{}})})}else this._instance.unregister(qs)}reset(){this.ds=!1,this.cs=!1,this.vs=!1,this.fs=!1,this.ps=!1,this.$anon_distinct_id=void 0,this.Rs(),this.hs=!1,this.bs=0}}},TK={sessionRecording:class{get Se(){return this._instance.config}get ri(){return this._instance.persistence}get started(){var t;return!((t=this.Fs)==null||!t.isStarted)}get status(){var t,e;return this.As===ed||this.As===Hh?this.As:(t=(e=this.Fs)==null?void 0:e.status)!==null&&t!==void 0?t:this.As}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.As=CS,this.$s=void 0,this._instance=t,!this._instance.sessionManager)throw mi.error("started without valid sessionManager"),new Error(Fy+" started without valid sessionManager. This is a bug.");if(this.Se.cookieless_mode===xi)throw new Error(Fy+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ns(){var t,e=!((t=this._instance.get_property(ao))==null||!t.enabled),n=!this.Se.disable_session_recording,a=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return Z&&e&&n&&!a}startIfEnabledOrStop(t){var e;if(!this.Ns||(e=this.Fs)==null||!e.isStarted){var n=!ke(Object.assign)&&!ke(Array.from);this.Ns&&n?(this.Ds(t),mi.info("starting")):(this.As=CS,this.stopRecording())}}Ds(t){var e,n,a;this.Ns&&(this.As!==ed&&this.As!==Hh&&(this.As=TS),Be!=null&&(e=Be.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=Be.__PosthogExtensions__)!=null&&n.initSessionRecording?this.qs(t):(a=Be.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this._instance,this.js,(r=>{if(r)return mi.error("could not load recorder",r);this.qs(t)})))}stopRecording(){var t,e;(t=this.$s)==null||t.call(this),this.$s=void 0,(e=this.Fs)==null||e.stop()}Bs(){var t,e;(t=this.$s)==null||t.call(this),this.$s=void 0,(e=this.Fs)==null||e.discard()}Hs(){var t,e;(t=this.ri)==null||t.unregister(Ib),(e=this.ri)==null||e.unregister(jE)}Us(t,e){if(nt(t))return null;var n,a=Bn(t)?t:parseFloat(t);return typeof(n=a)!="number"||!Number.isFinite(n)||0>n||n>1?(mi.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):a}zs(t){if(this.ri){var e,n,a=this.ri,r=()=>{var s,l=t.sessionRecording===!1?void 0:t.sessionRecording,c=this.Us((s=this.Se.session_recording)==null?void 0:s.sampleRate,"session_recording.sampleRate"),u=this.Us(l?.sampleRate,"remote config sampleRate"),h=c??u;nt(h)&&this.Hs();var p=l?.minimumDurationMilliseconds;a.register({[ao]:he({cache_timestamp:Date.now(),enabled:!!l},l,{networkPayloadCapture:he({capturePerformance:t.capturePerformance},l?.networkPayloadCapture),canvasRecording:{enabled:l?.recordCanvas,fps:l?.canvasFps,quality:l?.canvasQuality},sampleRate:h,minimumDurationMilliseconds:ke(p)?null:p,endpoint:l?.endpoint,triggerMatchType:l?.triggerMatchType,masking:l?.masking,urlTriggers:l?.urlTriggers,version:l?.version,triggerGroups:l?.triggerGroups})})};r(),(e=this.$s)==null||e.call(this),this.$s=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(r)}}onRemoteConfig(t){return"sessionRecording"in t?t.sessionRecording===!1?(this.zs(t),void this.Bs()):(this.zs(t),void this.startIfEnabledOrStop()):(this.As===ed&&(this.As=Hh,mi.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var n;e===void 0&&(e="log"),(n=this.Fs)!=null&&n.log?this.Fs.log(t,e):mi.warn("log called before recorder was ready")}get js(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(ao);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}Ws(){var t,e,n=this._instance.get_property(ao);if(!n)return!1;try{e=typeof n=="object"?n:JSON.parse(n)}catch(r){return mi.warn("persisted remote config for session recording is invalid and will be ignored",r),!1}var a=(t=e.cache_timestamp)!==null&&t!==void 0?t:Date.now();return 36e5>=Date.now()-a}qs(t){var e,n;if((e=Be.__PosthogExtensions__)==null||!e.initSessionRecording)return mi.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[WE]:!0});if(this.Fs||(this.Fs=(n=Be.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.Fs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ws())return this.As===Hh||this.As===ed?void 0:(this.As=ed,mi.info("persisted remote config is stale, requesting fresh config before starting"),void new v6(this._instance).load());this.As=TS,this.Fs.start(t)}onRRwebEmit(t){var e;(e=this.Fs)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Fs||(e=this.ri)==null||e.register({[FE]:!0}),(t=this.Fs)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Fs||(e=this.ri)==null||e.register({[zE]:!0}),(t=this.Fs)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.Fs||(n=this.ri)==null||n.register({[t==="url"?UE:BE]:!0}),(e=this.Fs)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.Fs)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.Fs)==null||!n.tryAddCustomEvent(t,e))}}},EK={autocapture:class{constructor(t){this.Vs=!1,this.Zs=null,this.Gs=!1,this.instance=t,this.rageclicks=new xS(t.config.rageclick),this.Qs=null}initialize(){this.startIfEnabled()}get Se(){var t,e,n=qt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map((a=>new RegExp(a))),n.url_ignorelist=(e=n.url_ignorelist)==null?void 0:e.map((a=>new RegExp(a))),n}Js(){if(this.isBrowserSupported()){if(Z&&xe){var t=n=>{n=n||Z?.event;try{this.Ks(n)}catch(a){$v.error("Failed to capture event",a)}};if(tn(xe,"submit",t,{capture:!0}),tn(xe,"change",t,{capture:!0}),tn(xe,"click",t,{capture:!0}),this.Se.capture_copied_text){var e=n=>{n=n||Z?.event;try{this.Ks(n,Bv)}catch(a){$v.error("Failed to capture copy/cut event",a)}};tn(xe,"copy",e,{capture:!0}),tn(xe,"cut",e,{capture:!0})}}}else $v.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Vs&&(this.Js(),this.Vs=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Gs=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[uy]:!!t.autocapture_opt_out}),this.Zs=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Qs=t}getElementSelectors(t){var e,n=[];return(e=this.Qs)==null||e.forEach((a=>{var r=xe?.querySelectorAll(a);r?.forEach((s=>{t===s&&n.push(a)}))})),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[uy];if(la(this.Zs)&&!Hr(n)&&!this.instance.Rr())return!1;var a=(e=this.Zs)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!a}Ks(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,a=Dv(t);YE(a)&&(a=a.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&nS(a,this.instance.config.rageclick)&&this.Ks(t,"$rageclick");var r=e===Bv;if(a&&(function(m,v,y,b,x,P){var E,L,T,A,D,B;if(y===void 0&&(y=void 0),!Z||zb(m)||(E=y)!=null&&E.url_allowlist&&!XP(y.url_allowlist,P)||(L=y)!=null&&L.url_ignorelist&&XP(y.url_ignorelist,P))return!1;if((T=y)!=null&&T.dom_event_allowlist){var j=y.dom_event_allowlist;if(j&&!j.some((ce=>v.type===ce)))return!1}var S=t6(m,b),N=S.parentIsUsefulElement,U=S.targetElementList;if(!(function(ce,le){var re=le?.element_allowlist;if(ke(re))return!0;var te,ie=function(X){if(re.some((W=>X.tagName.toLowerCase()===W)))return{v:!0}};for(var $ of ce)if(te=ie($))return te.v;return!1})(U,y)||!Ay(U,(A=y)==null?void 0:A.css_selector_allowlist)||Ay(U,(D=(B=y)==null?void 0:B.css_selector_ignorelist)!==null&&D!==void 0?D:Eq))return!1;try{var Q=Z.getComputedStyle(m);if(Q&&Q.getPropertyValue("cursor")==="pointer"&&v.type==="click")return!0}catch{}var ee=m.tagName.toLowerCase();switch(ee){case"html":return!1;case"form":return(x||["submit"]).indexOf(v.type)>=0;case"input":case"select":case"textarea":return(x||["change","click"]).indexOf(v.type)>=0;default:return N?(x||["click"]).indexOf(v.type)>=0:(x||["click"]).indexOf(v.type)>=0&&(jb.indexOf(ee)>-1||m.getAttribute("contenteditable")==="true")}})(a,t,this.Se,r,r?["copy","cut"]:void 0,this.instance)){var s=_K(a,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.Gs,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),l=s.props;if(s.explicitNoCapture)return!1;var c=this.getElementSelectors(a);if(c&&c.length>0&&(l.$element_selectors=c),e===Bv){var u,h=QE(Z==null||(u=Z.getSelection())==null?void 0:u.toString()),p=t.type||"clipboard";if(!h)return!1;l.$selected_content=h,l.$copy_type=p}return this.instance.capture(e,l),!0}}}isBrowserSupported(){return yr(xe?.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Ys=(Z==null||(e=Z.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(be.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Xs&&this.Xs(),this.Xs=void 0,be.info("History API monitoring stopped")}monitorHistoryChanges(){Z&&Z.history&&(this.eo("pushState"),this.eo("replaceState"),this.ro())}eo(t){var e;if(Z&&((e=Z.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(a,r,s){try{if(!(r in a))return PS;var l={next:a[r]},c=s((function(){for(var u=arguments.length,h=new Array(u),p=0;u>p;p++)h[p]=arguments[p];return l.next.apply(this,h)}));return yr(c)&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:l}})),a[r]=c,()=>{if(a[r]!==c)for(var u=a[r];yr(u)&&u.__posthog_layer__;){var h=u.__posthog_layer__;if(h.next===c)return void(h.next=l.next);u=h.next}else a[r]=l.next}}catch{return PS}})(Z.history,t,(a=>function(r,s,l){a.call(this,r,s,l),n.io(t)}))}}io(t){try{var e,n=Z==null||(e=Z.location)==null?void 0:e.pathname;if(!n)return;n!==this.Ys&&this.isEnabled&&this._instance.capture(pl,{navigation_type:t}),this.Ys=n}catch(a){be.error("Error capturing "+t+" pageview",a)}}ro(){if(!this.Xs){var t=()=>{this.io("popstate")};tn(Z,"popstate",t),this.Xs=()=>{Z&&Z.removeEventListener("popstate",t)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(t){var e;this.no=!1,this.Vs=!1,this.so=null,this.instance=t,this.no=!((e=this.instance.persistence)==null||!e.props[hy]),this.rageclicks=new xS(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return qt(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(t=this.Se.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return nt(this.Se.capture_heatmaps)?nt(this.Se.enable_heatmaps)?this.no:this.Se.enable_heatmaps:this.Se.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Vs)return;bK.info("starting..."),this.oo(),this.ke()}else{var t;clearInterval((t=this.so)!==null&&t!==void 0?t:void 0),this.ao(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[hy]:e}),this.no=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}lo(t){this.fe(t.originalEvent,"deadclick")}ke(){this.so&&clearInterval(this.so),this.so=xe?.visibilityState==="visible"?setInterval(this.Wr.bind(this),this.flushIntervalMilliseconds):null}oo(){Z&&xe&&(this.uo=this.Wr.bind(this),tn(Z,mf,this.uo),this.ho=t=>this.fe(t||Z?.event),tn(xe,"click",this.ho,{capture:!0}),this.do=t=>this.co(t||Z?.event),tn(xe,"mousemove",this.do,{capture:!0}),this.vo=new iS(this.instance,Oq,this.lo.bind(this)),this.vo.startIfEnabledOrStop(),this.fo=this.ke.bind(this),tn(xe,ff,this.fo),this.Vs=!0)}ao(){var t;Z&&xe&&(this.uo&&Z.removeEventListener(mf,this.uo),this.ho&&xe.removeEventListener("click",this.ho,{capture:!0}),this.do&&xe.removeEventListener("mousemove",this.do,{capture:!0}),this.fo&&xe.removeEventListener(ff,this.fo),clearTimeout(this.po),(t=this.vo)==null||t.stop(),this.Vs=!1)}mo(t,e){var n=this.instance.scrollManager.scrollY(),a=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),s=(function(l,c,u){for(var h=l;h&&gs(h)&&!Ra(h,"body");){if(h===u)return!1;var p=void 0;try{var m,v,y;p=(m=(v=(y=h.ownerDocument)==null?void 0:y.defaultView)!==null&&v!==void 0?v:Z)==null?void 0:m.getComputedStyle(h).position}catch{return!1}if(Ke(c,p))return!0;h=XE(h)}return!1})(Dv(t),["fixed","sticky"],r);return{x:t.clientX+(s?0:a),y:t.clientY+(s?0:n),target_fixed:s,type:e}}fe(t,e){var n;if(e===void 0&&(e="click"),!QP(t.target)&&ES(t)){var a=this.mo(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&nS(Dv(t),this.instance.config.rageclick)&&this.kt(he({},a,{type:"rageclick"})),this.kt(a)}}co(t){!QP(t.target)&&ES(t)&&(clearTimeout(this.po),this.po=setTimeout((()=>{this.kt(this.mo(t,"mousemove"))}),500))}kt(t){if(Z){var e=this.Se.disable_capture_url_hashes?ms(Z.location.href):Z.location.href,n=this.Se.custom_personal_data_properties,a=this.Se.mask_personal_data_properties?[...Fl,...n||[]]:[],r=Gd(e,a,qd);this.R=this.R||{},this.R[r]||(this.R[r]=[]),this.R[r].push(t)}}Wr(){this.R&&!cs(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:iS,webVitalsAutocapture:class{constructor(t){var e;this.no=!1,this.Vs=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.yo=()=>{clearTimeout(this.bo),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((n,a)=>he({},n,{["$web_vitals_"+a.name+"_event"]:he({},a),["$web_vitals_"+a.name+"_value"]:a.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._o=n=>{var a;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.wo();if(!ke(r))if(nt(n?.name)||nt(n?.value))Bs.error("Invalid metric received",n);else if(!this.xo||this.xo>n.value){this.R.url!==r&&(this.yo(),this.bo=setTimeout(this.yo,this.flushToCaptureTimeoutMs)),ke(this.R.url)&&(this.R.url=r),this.R.firstMetricTimestamp=ke(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var s=(a=this._instance.sessionManager)==null?void 0:a.checkAndGetSessionAndWindowId(!0),l=he({},n,{$current_url:r,timestamp:Date.now()});ke(s)||(l.$session_id=s.sessionId,l.$window_id=s.windowId),this.R.metrics.push(l),this.R.metrics.length===this.allowedMetrics.length&&this.yo()}else Bs.error("Ignoring metric with value >= "+this.xo,n)},this.ko=()=>{if(!this.Vs){var n,a,r,s,l=Be.__PosthogExtensions__;if(!ke(l)&&!ke(l.postHogWebVitalsCallbacks)){var c=l.postHogWebVitalsCallbacks;n=c.onLCP,a=c.onCLS,r=c.onFCP,s=c.onINP}n&&a&&r&&s?(this.allowedMetrics.indexOf("LCP")>-1&&n(this._o.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&a(this._o.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this._o.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this._o.bind(this)),this.Vs=!0):Bs.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.no=!((e=this._instance.persistence)==null||!e.props[gy]),this.startIfEnabled()}get So(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=qt(this.So)?(t=this.So)==null?void 0:t.web_vitals_allowed_metrics:void 0;return nt(n)?((e=this._instance.persistence)==null?void 0:e.props[vy])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(qt(this.So)?this.So.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=qt(this.So)?this.So.web_vitals_attribution:void 0;return t!=null&&t}get xo(){var t=qt(this.So)&&Bn(this.So.__web_vitals_max_value)?this.So.__web_vitals_max_value:SS;return t>0&&6e4>=t?SS:t}get isEnabled(){var t=fn?.protocol;if(t!=="http:"&&t!=="https:")return Bs.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=qt(this.So)?this.So.web_vitals:Hr(this.So)?this.So:void 0;return Hr(e)?e:this.no}startIfEnabled(){this.isEnabled&&!this.Vs&&(Bs.info("enabled, starting..."),this.Bt(this.ko))}onRemoteConfig(t){if("capturePerformance"in t){var e=qt(t.capturePerformance)&&!!t.capturePerformance.web_vitals,n=qt(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[gy]:e}),this._instance.persistence.register({[vy]:n})),this.no=e,this.startIfEnabled()}}Bt(t){var e,n;(e=Be.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?t():(n=Be.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(a=>{a?Bs.error("failed to load script",a):t()}))}wo(){var t=Z?this._instance.config.disable_capture_url_hashes?ms(Z.location.href):Z.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Fl,...e||[]]:[];return Gd(t,n,qd)}Bs.error("Could not determine current URL")}}},AK={exceptionObserver:class{constructor(t){var e,n,a,r,s,l;this.ko=()=>{var c;if(Z&&this.isEnabled&&(c=Be.__PosthogExtensions__)!=null&&c.errorWrappingFunctions){var u=Be.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,h=Be.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,p=Be.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Co&&this.Se.capture_unhandled_errors&&(this.Co=u(this.captureException.bind(this))),!this.To&&this.Se.capture_unhandled_rejections&&(this.To=h(this.captureException.bind(this))),!this.Io&&this.Se.capture_console_errors&&(this.Io=p(this.captureException.bind(this)))}catch(m){Xc.error("failed to start",m),this.Mo()}}},this._instance=t,this.Eo=!((e=this._instance.persistence)==null||!e.props[py]),this.Ro=new RG(he({},((n=this._instance.config.error_tracking)===void 0&&(n={}),{refillRate:(a=(r=n.exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:n.__exceptionRateLimiterRefillRate)!==null&&a!==void 0?a:1,bucketSize:(s=(l=n.exceptionRateLimiterBucketSize)!==null&&l!==void 0?l:n.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10}),{refillInterval:1e4,Ae:Xc})),this.Se=this.Po(),this.startIfEnabledOrStop()}Po(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return qt(t)?e=he({},e,t):(ke(t)?this.Eo:t)&&(e=he({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Xc.info("enabled"),this.Mo(),this.Bt(this.ko)):this.Mo()}Bt(t){var e,n;(e=Be.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=Be.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(a=>{if(a)return Xc.error("failed to load script",a);t()}))}Mo(){var t,e,n;(t=this.Co)==null||t.call(this),this.Co=void 0,(e=this.To)==null||e.call(this),this.To=void 0,(n=this.Io)==null||n.call(this),this.Io=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.Eo=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[py]:this.Eo}),this.Se=this.Po(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this.Po()}captureException(t){var e,n,a,r=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.Ro.consumeRateLimit(r)?Xc.info("Skipping exception capture because of client rate limiting.",{exception:r}):(a=this._instance.exceptions)==null||a.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,n;this.Oo=[],this.Lo=new qG([new tq,new dq,new aq,new nq,new lq,new oq,new iq,new cq],(function(a){for(var r=arguments.length,s=new Array(r>1?r-1:0),l=1;r>l;l++)s[l-1]=arguments[l];return function(c,u){u===void 0&&(u=0);for(var h=[],p=c.split(`
|
|
1249
|
+
`),()=>{c.current?.removeAttribute("data-motion-pop-id"),j.contains(B)&&j.removeChild(B)}},[e]),R.jsx(kU,{isPresent:e,childRef:c,sizeRef:u,pop:s,children:s===!1?t:k.cloneElement(t,{ref:m})})}const xU=({children:t,initial:e,isPresent:n,onExitComplete:a,custom:r,presenceAffectsLayout:s,mode:l,anchorX:c,anchorY:u,root:h})=>{const p=E0(PU),m=k.useId(),v=k.useRef(n),y=k.useRef(a);A0(()=>{v.current=n,y.current=a});let b=!0,x=k.useMemo(()=>(b=!1,{id:m,initial:e,isPresent:n,custom:r,onExitComplete:P=>{p.set(P,!0);for(const E of p.values())if(!E)return;a&&a()},register:P=>(p.set(P,!1),()=>{p.delete(P),!v.current&&!p.size&&y.current?.()})}),[n,p,a]);return s&&b&&(x={...x}),k.useMemo(()=>{p.forEach((P,E)=>p.set(E,!1))},[n]),k.useEffect(()=>{!n&&!p.size&&a&&a()},[n]),t=R.jsx(wU,{pop:l==="popLayout",isPresent:n,anchorX:c,anchorY:u,root:h,children:t}),R.jsx(zf.Provider,{value:x,children:t})};function PU(){return new Map}function I5(t=!0){const e=k.useContext(zf);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:r}=e,s=k.useId();k.useEffect(()=>{if(t)return r(s)},[t]);const l=k.useCallback(()=>t&&a&&a(s),[s,a,t]);return!n&&a?[!1,l]:[!0]}const xh=t=>t.key||"";function U2(t){const e=[];return k.Children.forEach(t,n=>{k.isValidElement(n)&&e.push(n)}),e}const M5=({children:t,custom:e,initial:n=!0,onExitComplete:a,presenceAffectsLayout:r=!0,mode:s="sync",propagate:l=!1,anchorX:c="left",anchorY:u="top",root:h})=>{const[p,m]=I5(l),v=k.useMemo(()=>U2(t),[t]),y=l&&!p?[]:v.map(xh),b=k.useRef(!0),x=k.useRef(v),P=E0(()=>new Map),E=k.useRef(new Set),[L,T]=k.useState(v),[A,D]=k.useState(v);A0(()=>{b.current=!1,x.current=v;for(let S=0;S<A.length;S++){const N=xh(A[S]);y.includes(N)?(P.delete(N),E.current.delete(N)):P.get(N)!==!0&&P.set(N,!1)}},[A,y.length,y.join("-")]);const B=[];if(v!==L){let S=[...v];for(let N=0;N<A.length;N++){const U=A[N],Q=xh(U);y.includes(Q)||(S.splice(N,0,U),B.push(U))}return s==="wait"&&B.length&&(S=B),D(U2(S)),T(v),null}const{forceRender:j}=k.useContext(T0);return R.jsx(R.Fragment,{children:A.map(S=>{const N=xh(S),U=l&&!p?!1:v===A||y.includes(N),Q=()=>{if(E.current.has(N))return;if(P.has(N))E.current.add(N),P.set(N,!0);else return;let ee=!0;P.forEach(ce=>{ce||(ee=!1)}),ee&&(j?.(),D(x.current),l&&m?.(),a&&a())};return R.jsx(xU,{isPresent:U,initial:!b.current||n?void 0:!1,custom:e,presenceAffectsLayout:r,mode:s,root:h,onExitComplete:U?void 0:Q,anchorX:c,anchorY:u,children:S},N)})})},N5=k.createContext({strict:!1}),B2={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"]};let $2=!1;function SU(){if($2)return;const t={};for(const e in B2)t[e]={isEnabled:n=>B2[e].some(a=>!!n[a])};d5(t),$2=!0}function O5(){return SU(),cF()}function CU(t){const e=O5();for(const n in t)e[n]={...e[n],...t[n]};d5(e)}const TU=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","propagate","ignoreStrict","viewport"]);function Yp(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||TU.has(t)}let j5=t=>!Yp(t);function EU(t){typeof t=="function"&&(j5=e=>e.startsWith("on")?!Yp(e):t(e))}try{EU(require("@emotion/is-prop-valid").default)}catch{}function AU(t,e,n){const a={};for(const r in t)r==="values"&&typeof t.values=="object"||Un(t[r])||(j5(r)||n===!0&&Yp(r)||!e&&!Yp(r)||t.draggable&&r.startsWith("onDrag"))&&(a[r]=t[r]);return a}const $f=k.createContext({});function RU(t,e){if(Bf(t)){const{initial:n,animate:a}=t;return{initial:n===!1||jd(n)?n:void 0,animate:jd(a)?a:void 0}}return t.inherit!==!1?e:{}}function LU(t){const{initial:e,animate:n}=RU(t,k.useContext($f));return k.useMemo(()=>({initial:e,animate:n}),[V2(e),V2(n)])}function V2(t){return Array.isArray(t)?t.join(" "):t}const nb=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function z5(t,e,n){for(const a in e)!Un(e[a])&&!v5(a,n)&&(t[a]=e[a])}function DU({transformTemplate:t},e){return k.useMemo(()=>{const n=nb();return X0(n,e,t),Object.assign({},n.vars,n.style)},[e])}function IU(t,e){const n=t.style||{},a={};return z5(a,n,t),Object.assign(a,DU(t,e)),a}function MU(t,e){const n={},a=IU(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.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=a,n}const F5=()=>({...nb(),attrs:{}});function NU(t,e,n,a){const r=k.useMemo(()=>{const s=F5();return _5(s,e,b5(a),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};z5(s,t.style,t),r.style={...s,...r.style}}return r}const OU=["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 ab(t){return typeof t!="string"||t.includes("-")?!1:!!(OU.indexOf(t)>-1||/[A-Z]/u.test(t))}function jU(t,e,n,{latestValues:a},r,s=!1,l){const u=(l??ab(t)?NU:MU)(e,a,r,t),h=AU(e,typeof t=="string",s),p=t!==k.Fragment?{...h,...u,ref:n}:{},{children:m}=e,v=k.useMemo(()=>Un(m)?m.get():m,[m]);return k.createElement(t,{...p,children:v})}function zU({scrapeMotionValuesFromProps:t,createRenderState:e},n,a,r){return{latestValues:FU(n,a,r,t),renderState:e()}}function FU(t,e,n,a){const r={},s=a(t,{});for(const v in s)r[v]=cp(s[v]);let{initial:l,animate:c}=t;const u=Bf(t),h=l5(t);e&&h&&!u&&t.inherit!==!1&&(l===void 0&&(l=e.initial),c===void 0&&(c=e.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const m=p?c:l;if(m&&typeof m!="boolean"&&!Uf(m)){const v=Array.isArray(m)?m:[m];for(let y=0;y<v.length;y++){const b=H0(t,v[y]);if(b){const{transitionEnd:x,transition:P,...E}=b;for(const L in E){let T=E[L];if(Array.isArray(T)){const A=p?T.length-1:0;T=T[A]}T!==null&&(r[L]=T)}for(const L in x)r[L]=x[L]}}}return r}const U5=t=>(e,n)=>{const a=k.useContext($f),r=k.useContext(zf),s=()=>zU(t,e,a,r);return n?s():E0(s)},UU=U5({scrapeMotionValuesFromProps:eb,createRenderState:nb}),BU=U5({scrapeMotionValuesFromProps:k5,createRenderState:F5}),$U=Symbol.for("motionComponentSymbol");function VU(t,e,n){const a=k.useRef(n);k.useInsertionEffect(()=>{a.current=n});const r=k.useRef(null);return k.useCallback(s=>{s&&t.onMount?.(s),e&&(s?e.mount(s):e.unmount());const l=a.current;if(typeof l=="function")if(s){const c=l(s);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):l(s);else l&&(l.current=s)},[e])}const B5=k.createContext({});function ul(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function HU(t,e,n,a,r,s){const{visualElement:l}=k.useContext($f),c=k.useContext(N5),u=k.useContext(zf),h=k.useContext(tb),p=h.reducedMotion,m=h.skipAnimations,v=k.useRef(null),y=k.useRef(!1);a=a||c.renderer,!v.current&&a&&(v.current=a(t,{visualState:e,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:p,skipAnimations:m,isSVG:s}),y.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const b=v.current,x=k.useContext(B5);b&&!b.projection&&r&&(b.type==="html"||b.type==="svg")&&WU(v.current,n,r,x);const P=k.useRef(!1);k.useInsertionEffect(()=>{b&&P.current&&b.update(n,u)});const E=n[ZT],L=k.useRef(!!E&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(E)&&window.MotionHasOptimisedAnimation?.(E));return A0(()=>{y.current=!0,b&&(P.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),L.current&&b.animationState&&b.animationState.animateChanges())}),k.useEffect(()=>{b&&(!L.current&&b.animationState&&b.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(E)}),L.current=!1),b.enteringChildren=void 0)}),b}function WU(t,e,n,a){const{layoutId:r,layout:s,drag:l,dragConstraints:c,layoutScroll:u,layoutRoot:h,layoutAnchor:p,layoutCrossfade:m}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:$5(t.parent)),t.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!l||c&&ul(c),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:a,crossfade:m,layoutScroll:u,layoutRoot:h,layoutAnchor:p})}function $5(t){if(t)return t.options.allowProjection!==!1?t.projection:$5(t.parent)}function iv(t,{forwardMotionProps:e=!1,type:n}={},a,r){a&&CU(a);const s=n?n==="svg":ab(t),l=s?BU:UU;function c(h,p){let m;const v={...k.useContext(tb),...h,layoutId:GU(h)},{isStatic:y}=v,b=LU(h),x=l(h,y);if(!y&&typeof window<"u"){qU();const P=KU(v);m=P.MeasureLayout,b.visualElement=HU(t,x,v,r,P.ProjectionNode,s)}return R.jsxs($f.Provider,{value:b,children:[m&&b.visualElement?R.jsx(m,{visualElement:b.visualElement,...v}):null,jU(t,h,VU(x,b.visualElement,p),x,y,e,s)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=k.forwardRef(c);return u[$U]=t,u}function GU({layoutId:t}){const e=k.useContext(T0).id;return e&&t!==void 0?e+"-"+t:t}function qU(t,e){k.useContext(N5).strict}function KU(t){const e=O5(),{drag:n,layout:a}=e;if(!n&&!a)return{};const r={...n,...a};return{MeasureLayout:n?.isEnabled(t)||a?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function YU(t,e){if(typeof Proxy>"u")return iv;const n=new Map,a=(s,l)=>iv(s,l,t,e),r=(s,l)=>a(s,l);return new Proxy(r,{get:(s,l)=>l==="create"?a:(n.has(l)||n.set(l,iv(l,void 0,t,e)),n.get(l))})}const ZU=(t,e)=>e.isSVG??ab(t)?new CF(e):new bF(e,{allowProjection:t!==k.Fragment});class JU extends vs{constructor(e){super(e),e.animationState||(e.animationState=LF(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Uf(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(){this.node.animationState.reset(),this.unmountControls?.()}}let QU=0;class XU extends vs{constructor(){super(...arguments),this.id=QU++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===a)return;if(e&&a===!1){if(this.isExitComplete){const{initial:s,custom:l}=this.node.getProps();if(typeof s=="string"||typeof s=="object"&&s!==null&&!Array.isArray(s)){const c=so(this.node,s,l);if(c){const{transition:u,transitionEnd:h,...p}=c;for(const m in p)this.node.getValue(m)?.jump(p[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const eB={animation:{Feature:JU},exit:{Feature:XU}};function su(t){return{point:{x:t.pageX,y:t.pageY}}}const tB=t=>e=>K0(e)&&t(e,su(e));function bd(t,e,n,a){return zd(t,e,tB(n),a)}const V5=({current:t})=>t?t.ownerDocument.defaultView:null,H2=(t,e)=>Math.abs(t-e);function nB(t,e){const n=H2(t.x,e.x),a=H2(t.y,e.y);return Math.sqrt(n**2+a**2)}const W2=new Set(["auto","scroll"]);class H5{constructor(e,n,{transformPagePoint:a,contextWindow:r=window,dragSnapToOrigin:s=!1,distanceThreshold:l=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=b=>{this.handleScroll(b.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ph(this.lastRawMoveEventInfo,this.transformPagePoint));const b=sv(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,P=nB(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!P)return;const{point:E}=b,{timestamp:L}=zn;this.history.push({...E,timestamp:L});const{onStart:T,onMove:A}=this.handlers;x||(T&&T(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=Ph(x,this.transformPagePoint),Ot.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:P,onSessionEnd:E,resumeAnimation:L}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&L&&L(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=sv(b.type==="pointercancel"?this.lastMoveEventInfo:Ph(x,this.transformPagePoint),this.history);this.startEvent&&P&&P(b,T),E&&E(b,T)},!K0(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=l,this.contextWindow=r||window;const u=su(e),h=Ph(u,this.transformPagePoint),{point:p}=h,{timestamp:m}=zn;this.history=[{...p,timestamp:m}];const{onSessionStart:v}=n;v&&v(e,sv(h,this.history));const y={passive:!0,capture:!0};this.removeListeners=au(bd(this.contextWindow,"pointermove",this.handlePointerMove,y),bd(this.contextWindow,"pointerup",this.handlePointerUp,y),bd(this.contextWindow,"pointercancel",this.handlePointerUp,y)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const a=getComputedStyle(n);(W2.has(a.overflowX)||W2.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const a=e===window,r=a?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:r.x-n.x,y:r.y-n.y};s.x===0&&s.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,r),Ot.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ps(this.updatePoint)}}function Ph(t,e){return e?{point:e(t.point)}:t}function G2(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sv({point:t},e){return{point:t,delta:G2(t,W5(e)),offset:G2(t,aB(e)),velocity:rB(e,.1)}}function aB(t){return t[0]}function W5(t){return t[t.length-1]}function rB(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,a=null;const r=W5(t);for(;n>=0&&(a=t[n],!(r.timestamp-a.timestamp>La(e)));)n--;if(!a)return{x:0,y:0};a===t[0]&&t.length>2&&r.timestamp-a.timestamp>La(e)*2&&(a=t[1]);const s=qa(r.timestamp-a.timestamp);if(s===0)return{x:0,y:0};const l={x:(r.x-a.x)/s,y:(r.y-a.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function iB(t,{min:e,max:n},a){return e!==void 0&&t<e?t=a?Nt(e,t,a.min):Math.max(t,e):n!==void 0&&t>n&&(t=a?Nt(n,t,a.max):Math.min(t,n)),t}function q2(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 sB(t,{top:e,left:n,bottom:a,right:r}){return{x:q2(t.x,n,r),y:q2(t.y,e,a)}}function K2(t,e){let n=e.min-t.min,a=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,a]=[a,n]),{min:n,max:a}}function oB(t,e){return{x:K2(t.x,e.x),y:K2(t.y,e.y)}}function lB(t,e){let n=.5;const a=ia(t),r=ia(e);return r>a?n=Nd(e.min,e.max-a,t.min):a>r&&(n=Nd(t.min,t.max-r,e.min)),Zr(0,1,n)}function cB(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 G_=.35;function dB(t=G_){return t===!1?t=0:t===!0&&(t=G_),{x:Y2(t,"left","right"),y:Y2(t,"top","bottom")}}function Y2(t,e,n){return{min:Z2(t,e),max:Z2(t,n)}}function Z2(t,e){return typeof t=="number"?t:t[e]||0}const uB=new WeakMap;class hB{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=Cn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=m=>{n&&this.snapToCursor(su(m).point),this.stopAnimation()},l=(m,v)=>{const{drag:y,dragPropagation:b,onDragStart:x}=this.getProps();if(y&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Uz(y),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),jr(E=>{let L=this.getAxisMotionValue(E).get()||0;if(Vr.test(L)){const{projection:T}=this.visualElement;if(T&&T.layout){const A=T.layout.layoutBox[E];A&&(L=ia(A)*(parseFloat(L)/100))}}this.originPoint[E]=L}),x&&Ot.update(()=>x(m,v),!1,!0),j_(this.visualElement,"transform");const{animationState:P}=this.visualElement;P&&P.setActive("whileDrag",!0)},c=(m,v)=>{this.latestPointerEvent=m,this.latestPanInfo=v;const{dragPropagation:y,dragDirectionLock:b,onDirectionLock:x,onDrag:P}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:E}=v;if(b&&this.currentDirection===null){this.currentDirection=fB(E),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",v.point,E),this.updateAxis("y",v.point,E),this.visualElement.render(),P&&Ot.update(()=>P(m,v),!1,!0)},u=(m,v)=>{this.latestPointerEvent=m,this.latestPanInfo=v,this.stop(m,v),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:m}=this.getProps();(m||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new H5(e,{onSessionStart:s,onStart:l,onMove:c,onSessionEnd:u,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:a,contextWindow:V5(this.visualElement),element:this.visualElement.current})}stop(e,n){const a=e||this.latestPointerEvent,r=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!r||!a)return;const{velocity:l}=r;this.startAnimation(l);const{onDragEnd:c}=this.getProps();c&&Ot.postRender(()=>c(a,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,a){const{drag:r}=this.getProps();if(!a||!Sh(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let l=this.originPoint[e]+a[e];this.constraints&&this.constraints[e]&&(l=iB(l,this.constraints[e],this.elastic[e])),s.set(l)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&ul(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&a?this.constraints=sB(a.layoutBox,e):this.constraints=!1,this.elastic=dB(n),r!==this.constraints&&!ul(e)&&a&&this.constraints&&!this.hasMutatedConstraints&&jr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=cB(a.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ul(e))return!1;const a=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());const s=fF(a,r.root,this.visualElement.getTransformPagePoint());let l=oB(r.layout.layoutBox,s);if(n){const c=n(uF(l));this.hasMutatedConstraints=!!c,c&&(l=h5(c))}return l}startAnimation(e){const{drag:n,dragMomentum:a,dragElastic:r,dragTransition:s,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),u=this.constraints||{},h=jr(p=>{if(!Sh(p,n,this.currentDirection))return;let m=u&&u[p]||{};(l===!0||l===p)&&(m={min:0,max:0});const v=r?200:1e6,y=r?40:1e7,b={type:"inertia",velocity:a?e[p]:0,bounceStiffness:v,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...s,...m};return this.startAxisValueAnimation(p,b)});return Promise.all(h).then(c)}startAxisValueAnimation(e,n){const a=this.getAxisMotionValue(e);return j_(this.visualElement,e),a.start(V0(e,a,0,n,this.visualElement,!1))}stopAnimation(){jr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps()[n];return r||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){jr(n=>{const{drag:a}=this.getProps();if(!Sh(n,a,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:l,max:c}=r.layout.layoutBox[n],u=s.get()||0;s.set(e[n]-Nt(l,c,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!ul(n)||!a||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};jr(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const u=c.get();r[l]=lB({min:u,max:u},this.constraints[l])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),jr(l=>{if(!Sh(l,e,null))return;const c=this.getAxisMotionValue(l),{min:u,max:h}=this.constraints[l];c.set(Nt(u,h,r[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;uB.set(this.visualElement,this);const e=this.visualElement.current,n=bd(e,"pointerdown",h=>{const{drag:p,dragListener:m=!0}=this.getProps(),v=h.target,y=v!==e&&Gz(v);p&&m&&!y&&this.start(h)});let a;const r=()=>{const{dragConstraints:h}=this.getProps();ul(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),a||(a=pB(e,h.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,l=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Ot.read(r);const c=zd(window,"resize",()=>this.scalePositionWithinConstraints()),u=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:p})=>{this.isDragging&&p&&(jr(m=>{const v=this.getAxisMotionValue(m);v&&(this.originPoint[m]+=h[m].translate,v.set(v.get()+h[m].translate))}),this.visualElement.render())}));return()=>{c(),n(),l(),u&&u(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:l=G_,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:a,dragPropagation:r,dragConstraints:s,dragElastic:l,dragMomentum:c}}}function J2(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function pB(t,e,n){const a=r2(t,J2(n)),r=r2(e,J2(n));return()=>{a(),r()}}function Sh(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function fB(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class mB extends vs{constructor(e){super(e),this.removeGroupControls=Za,this.removeListeners=Za,this.controls=new hB(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Za}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ov=t=>(e,n)=>{t&&Ot.update(()=>t(e,n),!1,!0)};class gB extends vs{constructor(){super(...arguments),this.removePointerDownListener=Za}onPointerDown(e){this.session=new H5(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:V5(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:a,onPanEnd:r}=this.node.getProps();return{onSessionStart:ov(e),onStart:ov(n),onMove:ov(a),onEnd:(s,l)=>{delete this.session,r&&Ot.postRender(()=>r(s,l))}}}mount(){this.removePointerDownListener=bd(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let lv=!1;class vB extends k.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:a,layoutId:r}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),a&&a.register&&r&&a.register(s),lv&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),dp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:a,drag:r,isPresent:s}=this.props,{projection:l}=a;return l&&(l.isPresent=s,e.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),lv=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==s?l.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?l.promote():l.relegate()||Ot.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:a}=e;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),q0.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:r}=e;lv=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),a&&a.deregister&&a.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function G5(t){const[e,n]=I5(),a=k.useContext(T0);return R.jsx(vB,{...t,layoutGroup:a,switchLayoutGroup:k.useContext(B5),isPresent:e,safeToRemove:n})}const _B={pan:{Feature:gB},drag:{Feature:mB,ProjectionNode:D5,MeasureLayout:G5}};function Q2(t,e,n){const{props:a}=t;t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=a[r];s&&Ot.postRender(()=>s(e,su(e)))}class yB extends vs{mount(){const{current:e}=this.node;e&&(this.unmount=$z(e,(n,a)=>(Q2(this.node,a,"Start"),r=>Q2(this.node,r,"End"))))}unmount(){}}class bB extends vs{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=au(zd(this.node.current,"focus",()=>this.onFocus()),zd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function X2(t,e,n){const{props:a}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&a.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=a[r];s&&Ot.postRender(()=>s(e,su(e)))}class kB extends vs{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=Kz(e,(r,s)=>(X2(this.node,s,"Start"),(l,{success:c})=>X2(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const q_=new WeakMap,cv=new WeakMap,wB=t=>{const e=q_.get(t.target);e&&e(t)},xB=t=>{t.forEach(wB)};function PB({root:t,...e}){const n=t||document;cv.has(n)||cv.set(n,{});const a=cv.get(n),r=JSON.stringify(e);return a[r]||(a[r]=new IntersectionObserver(xB,{root:t,...e})),a[r]}function SB(t,e,n){const a=PB(e);return q_.set(t,n),a.observe(t),()=>{q_.delete(t),a.unobserve(t)}}const CB={some:0,all:1};class TB extends vs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:a,amount:r="some",once:s}=e,l={root:n?n.current:void 0,rootMargin:a,threshold:typeof r=="number"?r:CB[r]},c=u=>{const{isIntersecting:h}=u;if(this.isInView===h||(this.isInView=h,s&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),v=h?p:m;v&&v(u)};this.stopObserver=SB(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(EB(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function EB({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const AB={inView:{Feature:TB},tap:{Feature:kB},focus:{Feature:bB},hover:{Feature:yB}},RB={layout:{ProjectionNode:D5,MeasureLayout:G5}},LB={...eB,...AB,..._B,...RB},DB=YU(LB,ZU);function IB(){!Q0.current&&c5();const[t]=k.useState(Wp.current);return t}const kd=DB;function q5(t){var e,n,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=q5(t[e]))&&(a&&(a+=" "),a+=n)}else for(n in t)t[n]&&(a&&(a+=" "),a+=n);return a}function MB(){for(var t,e,n=0,a="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=q5(t))&&(a&&(a+=" "),a+=e);return a}const NB=(t,e)=>{const n=new Array(t.length+e.length);for(let a=0;a<t.length;a++)n[a]=t[a];for(let a=0;a<e.length;a++)n[t.length+a]=e[a];return n},OB=(t,e)=>({classGroupId:t,validator:e}),K5=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Zp="-",eP=[],jB="arbitrary..",zB=t=>{const e=UB(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return FB(l);const c=l.split(Zp),u=c[0]===""&&c.length>1?1:0;return Y5(c,u,e)},getConflictingClassGroupIds:(l,c)=>{if(c){const u=a[l],h=n[l];return u?h?NB(h,u):u:h||eP}return n[l]||eP}}},Y5=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],s=n.nextPart.get(r);if(s){const h=Y5(t,e+1,s);if(h)return h}const l=n.validators;if(l===null)return;const c=e===0?t.join(Zp):t.slice(e).join(Zp),u=l.length;for(let h=0;h<u;h++){const p=l[h];if(p.validator(c))return p.classGroupId}},FB=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),a=e.slice(0,n);return a?jB+a:void 0})(),UB=t=>{const{theme:e,classGroups:n}=t;return BB(n,e)},BB=(t,e)=>{const n=K5();for(const a in t){const r=t[a];rb(r,n,a,e)}return n},rb=(t,e,n,a)=>{const r=t.length;for(let s=0;s<r;s++){const l=t[s];$B(l,e,n,a)}},$B=(t,e,n,a)=>{if(typeof t=="string"){VB(t,e,n);return}if(typeof t=="function"){HB(t,e,n,a);return}WB(t,e,n,a)},VB=(t,e,n)=>{const a=t===""?e:Z5(e,t);a.classGroupId=n},HB=(t,e,n,a)=>{if(GB(t)){rb(t(a),e,n,a);return}e.validators===null&&(e.validators=[]),e.validators.push(OB(n,t))},WB=(t,e,n,a)=>{const r=Object.entries(t),s=r.length;for(let l=0;l<s;l++){const[c,u]=r[l];rb(u,Z5(e,c),n,a)}},Z5=(t,e)=>{let n=t;const a=e.split(Zp),r=a.length;for(let s=0;s<r;s++){const l=a[s];let c=n.nextPart.get(l);c||(c=K5(),n.nextPart.set(l,c)),n=c}return n},GB=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,qB=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),a=Object.create(null);const r=(s,l)=>{n[s]=l,e++,e>t&&(e=0,a=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=a[s])!==void 0)return r(s,l),l},set(s,l){s in n?n[s]=l:r(s,l)}}},K_="!",tP=":",KB=[],nP=(t,e,n,a,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:a,isExternal:r}),YB=t=>{const{prefix:e,experimentalParseClassName:n}=t;let a=r=>{const s=[];let l=0,c=0,u=0,h;const p=r.length;for(let x=0;x<p;x++){const P=r[x];if(l===0&&c===0){if(P===tP){s.push(r.slice(u,x)),u=x+1;continue}if(P==="/"){h=x;continue}}P==="["?l++:P==="]"?l--:P==="("?c++:P===")"&&c--}const m=s.length===0?r:r.slice(u);let v=m,y=!1;m.endsWith(K_)?(v=m.slice(0,-1),y=!0):m.startsWith(K_)&&(v=m.slice(1),y=!0);const b=h&&h>u?h-u:void 0;return nP(s,y,v,b)};if(e){const r=e+tP,s=a;a=l=>l.startsWith(r)?s(l.slice(r.length)):nP(KB,!1,l,void 0,!0)}if(n){const r=a;a=s=>n({className:s,parseClassName:r})}return a},ZB=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,a)=>{e.set(n,1e6+a)}),n=>{const a=[];let r=[];for(let s=0;s<n.length;s++){const l=n[s],c=l[0]==="[",u=e.has(l);c||u?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(l)):r.push(l)}return r.length>0&&(r.sort(),a.push(...r)),a}},JB=t=>({cache:qB(t.cacheSize),parseClassName:YB(t),sortModifiers:ZB(t),postfixLookupClassGroupIds:QB(t),...zB(t)}),QB=t=>{const e=Object.create(null),n=t.postfixLookupClassGroups;if(n)for(let a=0;a<n.length;a++)e[n[a]]=!0;return e},XB=/\s+/,e$=(t,e)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:s,postfixLookupClassGroupIds:l}=e,c=[],u=t.trim().split(XB);let h="";for(let p=u.length-1;p>=0;p-=1){const m=u[p],{isExternal:v,modifiers:y,hasImportantModifier:b,baseClassName:x,maybePostfixModifierPosition:P}=n(m);if(v){h=m+(h.length>0?" "+h:h);continue}let E=!!P,L;if(E){const j=x.substring(0,P);L=a(j);const S=L&&l[L]?a(x):void 0;S&&S!==L&&(L=S,E=!1)}else L=a(x);if(!L){if(!E){h=m+(h.length>0?" "+h:h);continue}if(L=a(x),!L){h=m+(h.length>0?" "+h:h);continue}E=!1}const T=y.length===0?"":y.length===1?y[0]:s(y).join(":"),A=b?T+K_:T,D=A+L;if(c.indexOf(D)>-1)continue;c.push(D);const B=r(L,E);for(let j=0;j<B.length;++j){const S=B[j];c.push(A+S)}h=m+(h.length>0?" "+h:h)}return h},t$=(...t)=>{let e=0,n,a,r="";for(;e<t.length;)(n=t[e++])&&(a=J5(n))&&(r&&(r+=" "),r+=a);return r},J5=t=>{if(typeof t=="string")return t;let e,n="";for(let a=0;a<t.length;a++)t[a]&&(e=J5(t[a]))&&(n&&(n+=" "),n+=e);return n},n$=(t,...e)=>{let n,a,r,s;const l=u=>{const h=e.reduce((p,m)=>m(p),t());return n=JB(h),a=n.cache.get,r=n.cache.set,s=c,c(u)},c=u=>{const h=a(u);if(h)return h;const p=e$(u,n);return r(u,p),p};return s=l,(...u)=>s(t$(...u))},a$=[],Sn=t=>{const e=n=>n[t]||a$;return e.isThemeGetter=!0,e},Q5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,X5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,r$=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,i$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,s$=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,o$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,l$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,c$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ts=t=>r$.test(t),ct=t=>!!t&&!Number.isNaN(Number(t)),Dr=t=>!!t&&Number.isInteger(Number(t)),dv=t=>t.endsWith("%")&&ct(t.slice(0,-1)),pi=t=>i$.test(t),e4=()=>!0,d$=t=>s$.test(t)&&!o$.test(t),ib=()=>!1,u$=t=>l$.test(t),h$=t=>c$.test(t),p$=t=>!Te(t)&&!Ae(t),f$=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),m$=t=>_s(t,a4,ib),Te=t=>Q5.test(t),Os=t=>_s(t,r4,d$),aP=t=>_s(t,x$,ct),g$=t=>_s(t,s4,e4),v$=t=>_s(t,i4,ib),rP=t=>_s(t,t4,ib),_$=t=>_s(t,n4,h$),Ch=t=>_s(t,o4,u$),Ae=t=>X5.test(t),$c=t=>xo(t,r4),y$=t=>xo(t,i4),iP=t=>xo(t,t4),b$=t=>xo(t,a4),k$=t=>xo(t,n4),Th=t=>xo(t,o4,!0),w$=t=>xo(t,s4,!0),_s=(t,e,n)=>{const a=Q5.exec(t);return a?a[1]?e(a[1]):n(a[2]):!1},xo=(t,e,n=!1)=>{const a=X5.exec(t);return a?a[1]?e(a[1]):n:!1},t4=t=>t==="position"||t==="percentage",n4=t=>t==="image"||t==="url",a4=t=>t==="length"||t==="size"||t==="bg-size",r4=t=>t==="length",x$=t=>t==="number",i4=t=>t==="family-name",s4=t=>t==="number"||t==="weight",o4=t=>t==="shadow",P$=()=>{const t=Sn("color"),e=Sn("font"),n=Sn("text"),a=Sn("font-weight"),r=Sn("tracking"),s=Sn("leading"),l=Sn("breakpoint"),c=Sn("container"),u=Sn("spacing"),h=Sn("radius"),p=Sn("shadow"),m=Sn("inset-shadow"),v=Sn("text-shadow"),y=Sn("drop-shadow"),b=Sn("blur"),x=Sn("perspective"),P=Sn("aspect"),E=Sn("ease"),L=Sn("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...A(),Ae,Te],B=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],S=()=>[Ae,Te,u],N=()=>[ts,"full","auto",...S()],U=()=>[Dr,"none","subgrid",Ae,Te],Q=()=>["auto",{span:["full",Dr,Ae,Te]},Dr,Ae,Te],ee=()=>[Dr,"auto",Ae,Te],ce=()=>["auto","min","max","fr",Ae,Te],le=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],te=()=>["auto",...S()],ie=()=>[ts,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],$=()=>[ts,"screen","full","dvw","lvw","svw","min","max","fit",...S()],X=()=>[ts,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],W=()=>[t,Ae,Te],O=()=>[...A(),iP,rP,{position:[Ae,Te]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ae=()=>["auto","cover","contain",b$,m$,{size:[Ae,Te]}],_e=()=>[dv,$c,Os],fe=()=>["","none","full",h,Ae,Te],ve=()=>["",ct,$c,Os],Ne=()=>["solid","dashed","dotted","double"],Oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ie=()=>[ct,dv,iP,rP],St=()=>["","none",b,Ae,Te],un=()=>["none",ct,Ae,Te],jt=()=>["none",ct,Ae,Te],_t=()=>[ct,Ae,Te],Jt=()=>[ts,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pi],breakpoint:[pi],color:[e4],container:[pi],"drop-shadow":[pi],ease:["in","out","in-out"],font:[p$],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pi],shadow:[pi],spacing:["px",ct],text:[pi],"text-shadow":[pi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ts,Te,Ae,P]}],container:["container"],"container-type":[{"@container":["","normal","size",Ae,Te]}],"container-named":[f$],columns:[{columns:[ct,Te,Ae,c]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[Dr,"auto",Ae,Te]}],basis:[{basis:[ts,"full","auto",c,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ct,ts,"auto","initial","none",Te]}],grow:[{grow:["",ct,Ae,Te]}],shrink:[{shrink:["",ct,Ae,Te]}],order:[{order:[Dr,"first","last","none",Ae,Te]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ce()}],"auto-rows":[{"auto-rows":ce()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...le(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...le()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":le()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mbs:[{mbs:te()}],mbe:[{mbe:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:ie()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...X()]}],"min-block-size":[{"min-block":["auto",...X()]}],"max-block-size":[{"max-block":["none",...X()]}],w:[{w:[c,"screen",...ie()]}],"min-w":[{"min-w":[c,"screen","none",...ie()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...ie()]}],h:[{h:["screen","lh",...ie()]}],"min-h":[{"min-h":["screen","lh","none",...ie()]}],"max-h":[{"max-h":["screen","lh",...ie()]}],"font-size":[{text:["base",n,$c,Os]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,w$,g$]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",dv,Te]}],"font-family":[{font:[y$,v$,e]}],"font-features":[{"font-features":[Te]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,Ae,Te]}],"line-clamp":[{"line-clamp":[ct,"none",Ae,aP]}],leading:[{leading:[s,...S()]}],"list-image":[{"list-image":["none",Ae,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,Te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[ct,"from-font","auto",Ae,Os]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[ct,"auto",Ae,Te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"tab-size":[{tab:[Dr,Ae,Te]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,Te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dr,Ae,Te],radial:["",Ae,Te],conic:[Dr,Ae,Te]},k$,_$]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:_e()}],"gradient-via-pos":[{via:_e()}],"gradient-to-pos":[{to:_e()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:ve()}],"border-w-x":[{"border-x":ve()}],"border-w-y":[{"border-y":ve()}],"border-w-s":[{"border-s":ve()}],"border-w-e":[{"border-e":ve()}],"border-w-bs":[{"border-bs":ve()}],"border-w-be":[{"border-be":ve()}],"border-w-t":[{"border-t":ve()}],"border-w-r":[{"border-r":ve()}],"border-w-b":[{"border-b":ve()}],"border-w-l":[{"border-l":ve()}],"divide-x":[{"divide-x":ve()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ve()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ne(),"hidden","none"]}],"divide-style":[{divide:[...Ne(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ct,Ae,Te]}],"outline-w":[{outline:["",ct,$c,Os]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",p,Th,Ch]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",m,Th,Ch]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[ct,Os]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":ve()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",v,Th,Ch]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[ct,Ae,Te]}],"mix-blend":[{"mix-blend":[...Oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Oe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ct]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ie()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":Ie()}],"mask-image-t-to-pos":[{"mask-t-to":Ie()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":Ie()}],"mask-image-r-to-pos":[{"mask-r-to":Ie()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":Ie()}],"mask-image-b-to-pos":[{"mask-b-to":Ie()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":Ie()}],"mask-image-l-to-pos":[{"mask-l-to":Ie()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":Ie()}],"mask-image-x-to-pos":[{"mask-x-to":Ie()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":Ie()}],"mask-image-y-to-pos":[{"mask-y-to":Ie()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[Ae,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ie()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[ct]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ie()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,Te]}],filter:[{filter:["","none",Ae,Te]}],blur:[{blur:St()}],brightness:[{brightness:[ct,Ae,Te]}],contrast:[{contrast:[ct,Ae,Te]}],"drop-shadow":[{"drop-shadow":["","none",y,Th,Ch]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",ct,Ae,Te]}],"hue-rotate":[{"hue-rotate":[ct,Ae,Te]}],invert:[{invert:["",ct,Ae,Te]}],saturate:[{saturate:[ct,Ae,Te]}],sepia:[{sepia:["",ct,Ae,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,Te]}],"backdrop-blur":[{"backdrop-blur":St()}],"backdrop-brightness":[{"backdrop-brightness":[ct,Ae,Te]}],"backdrop-contrast":[{"backdrop-contrast":[ct,Ae,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ct,Ae,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ct,Ae,Te]}],"backdrop-invert":[{"backdrop-invert":["",ct,Ae,Te]}],"backdrop-opacity":[{"backdrop-opacity":[ct,Ae,Te]}],"backdrop-saturate":[{"backdrop-saturate":[ct,Ae,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",ct,Ae,Te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ct,"initial",Ae,Te]}],ease:[{ease:["linear","initial",E,Ae,Te]}],delay:[{delay:[ct,Ae,Te]}],animate:[{animate:["none",L,Ae,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Ae,Te]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:un()}],"rotate-x":[{"rotate-x":un()}],"rotate-y":[{"rotate-y":un()}],"rotate-z":[{"rotate-z":un()}],scale:[{scale:jt()}],"scale-x":[{"scale-x":jt()}],"scale-y":[{"scale-y":jt()}],"scale-z":[{"scale-z":jt()}],"scale-3d":["scale-3d"],skew:[{skew:_t()}],"skew-x":[{"skew-x":_t()}],"skew-y":[{"skew-y":_t()}],transform:[{transform:[Ae,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Jt()}],"translate-x":[{"translate-x":Jt()}],"translate-y":[{"translate-y":Jt()}],"translate-z":[{"translate-z":Jt()}],"translate-none":["translate-none"],zoom:[{zoom:[Dr,Ae,Te]}],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ae,Te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":W()}],"scrollbar-track-color":[{"scrollbar-track":W()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ae,Te]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[ct,$c,Os,aP]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},S$=n$(P$);function $t(...t){return S$(MB(t))}const C$=R.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[R.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),R.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),R.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),R.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),T$=R.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:R.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),E$={google:C$,github:T$},A$={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function R$(t){return A$[t]||String(t||"").replace(/-/g," ")}function L$(t){if(typeof t=="string"&&t.trim())return t.trim();if(t&&typeof t=="object"){if(typeof t.token=="string"&&t.token.trim())return t.token.trim();if(typeof t.otp=="string"&&t.otp.trim())return t.otp.trim()}return""}function D$({title:t,subtitle:e,className:n="",onSuccess:a,hideLogo:r=!1,initialMode:s="signin",tokenFromUrl:l="",initialEmail:c="",initialCode:u=""}){Kl();const{enabled:h,signedIn:p,refreshUser:m,signInWithPassword:v,signUp:y,signInWithOAuth:b,getPublicAuthConfig:x,sendResetPasswordEmail:P,exchangeResetPasswordToken:E,resetPassword:L}=wo(),[T,A]=k.useState(s),[D,B]=k.useState(c),[j,S]=k.useState(""),[N,U]=k.useState(""),[Q,ee]=k.useState(""),[ce,le]=k.useState(u),[re,te]=k.useState(!1),[ie,$]=k.useState(null),[X,W]=k.useState(null),[O,Y]=k.useState(!1),[ae,_e]=k.useState(!!(s!=="signin"||c)),[fe,ve]=k.useState(!0),[Ne,Oe]=k.useState([]),[Ie,St]=k.useState(8);k.useEffect(()=>{s&&A(s)},[s]),k.useEffect(()=>{c&&B(c)},[c]),k.useEffect(()=>{u&&le(u)},[u]),k.useEffect(()=>{if(!h)return;let Xe=!0;return ve(!0),(async()=>{const{data:ot,error:Dt}=await x();if(Xe){if(Dt||!ot)Oe(["google","github"]);else{const Et=Array.isArray(ot.oAuthProviders)?ot.oAuthProviders:[],Nn=Array.isArray(ot.customOAuthProviders)?ot.customOAuthProviders:[];Oe([...Et,...Nn]),typeof ot.passwordMinLength=="number"&&ot.passwordMinLength>0&&St(ot.passwordMinLength)}ve(!1)}})(),()=>{Xe=!1}},[h,x]),k.useEffect(()=>{p&&a&&a()},[p,a]);const un=k.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),jt=k.useMemo(()=>typeof window>"u"?"/reset-password":`${window.location.origin}/reset-password`,[]),_t=k.useCallback(async Xe=>{$(null),te(!0);try{const{error:ot}=await b(Xe,un);ot&&$(ot.message||String(ot))}finally{te(!1)}},[b,un]);k.useEffect(()=>{if(!h||fe||p||typeof window>"u")return;const Xe=window.location.search;if(!Xe)return;const ot=new URLSearchParams(Xe),Dt=ot.get("native")==="1",Et=ot.get("provider");Dt&&Et&&[...Ne].includes(Et)&&_t(Et)},[h,fe,p,Ne,_t]);const Jt=k.useCallback(async Xe=>{Xe.preventDefault(),$(null),te(!0);try{if(T==="signup"){const{data:Dt,error:Et}=await y({email:D.trim(),password:j,name:Q.trim()||void 0});if(Et){$(Et.message||String(Et));return}if(Dt?.requireEmailVerification){W(we("login.verify_email_pending")),A("signin");return}await m();return}const{error:ot}=await v({email:D.trim(),password:j});if(ot){$(ot.message||String(ot));return}await m()}finally{te(!1)}},[T,D,j,Q,y,v,m]),nr=k.useCallback(async Xe=>{Xe.preventDefault(),$(null),te(!0);try{const ot=D.trim(),{error:Dt}=await P({email:ot,redirectTo:jt});if(Dt){$(Dt.message||String(Dt));return}B(ot),W(we("reset_password.request.sent")),A("reset_confirm")}finally{te(!1)}},[D,jt,P]),Mn=k.useCallback(async Xe=>{if(Xe.preventDefault(),$(null),j!==N){$(we("reset_password.error.password_mismatch"));return}te(!0);try{let ot=l;if(!ot){const{data:Et,error:Nn}=await E({email:D.trim(),code:ce.trim()});if(Nn){$(Nn.message||String(Nn));return}if(ot=L$(Et),!ot){$(we("reset_password.error.missing_token"));return}}const{error:Dt}=await L({newPassword:j,otp:ot});if(Dt){$(Dt.message||String(Dt));return}Y(!0),W(we("reset_password.success"))}finally{te(!1)}},[ce,N,D,E,j,L,l]);if(!h)return null;const Vt=T==="reset_email"||T==="reset_confirm";return R.jsxs("div",{className:$t("w-full bg-white dark:bg-oai-gray-950 p-6 transition-colors duration-200",n),children:[Vt&&R.jsxs("button",{type:"button",onClick:()=>{A("signin"),W(null),$(null),Y(!1),S(""),U("")},className:"flex items-center gap-1.5 text-xs font-medium text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors mb-4 focus:outline-none",children:[R.jsx(KN,{className:"h-3.5 w-3.5"}),we("reset_password.back_to_sign_in")]}),R.jsxs("div",{className:$t("mb-6",Vt?"text-left":"text-center"),children:[!r&&!Vt&&R.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[R.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),R.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white font-oai tracking-tight",children:we("shared.app_name")})]}),R.jsx("h2",{className:$t("text-sm font-semibold text-oai-black dark:text-white tracking-tight mb-1",(r||Vt)&&"text-base font-bold md:text-lg"),children:Vt?we("reset_password.title"):t||we("login_modal.subtitle")}),!Vt&&e&&R.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400 mt-1.5 leading-relaxed max-w-[320px] mx-auto",children:e}),Vt&&R.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400 mt-1.5 leading-relaxed max-w-[320px]",children:X&&T==="reset_confirm"&&!O?X:we("reset_password.subtitle")})]}),X&&(!Vt||O)&&R.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:X}),ie&&R.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400 text-center",role:"alert",children:ie}),T==="reset_email"&&R.jsxs("form",{onSubmit:nr,className:"space-y-3",children:[R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-reset-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("login.field.email")}),R.jsx("input",{id:"card-reset-email",type:"email",autoComplete:"email",required:!0,value:D,onChange:Xe=>B(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),R.jsx("button",{type:"submit",disabled:re,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:we("reset_password.request.submit")})]}),T==="reset_confirm"&&(O?R.jsx("button",{type:"button",onClick:()=>{A("signin"),Y(!1),W(null),$(null),S(""),U("")},className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors text-center shadow-sm",children:we("reset_password.success_cta")}):R.jsxs("form",{onSubmit:Mn,className:"space-y-3",children:[!l&&R.jsxs(R.Fragment,{children:[R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-reset-email-confirm",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("login.field.email")}),R.jsx("input",{id:"card-reset-email-confirm",type:"email",autoComplete:"email",required:!0,value:D,onChange:Xe=>B(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-reset-code",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("reset_password.field.code")}),R.jsx("input",{id:"card-reset-code",type:"text",inputMode:"numeric",autoComplete:"one-time-code",required:!0,value:ce,onChange:Xe=>le(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]})]}),R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-reset-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("reset_password.field.new_password")}),R.jsx("input",{id:"card-reset-password",type:"password",autoComplete:"new-password",required:!0,minLength:8,value:j,onChange:Xe=>S(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-reset-password-confirm",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("reset_password.field.confirm_password")}),R.jsx("input",{id:"card-reset-password-confirm",type:"password",autoComplete:"new-password",required:!0,minLength:8,value:N,onChange:Xe=>U(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),R.jsx("button",{type:"submit",disabled:re,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:we("reset_password.reset.submit")})]})),!Vt&&R.jsxs(R.Fragment,{children:[R.jsx("div",{className:"space-y-2.5 mb-5",children:fe?R.jsxs("div",{className:"space-y-2.5",children:[R.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"}),R.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"})]}):Ne.map(Xe=>R.jsxs("button",{type:"button",disabled:re,onClick:()=>_t(Xe),className:$t("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[E$[Xe]||null,we("login.oauth.continue",{provider:R$(Xe)})]},Xe))}),ae?R.jsxs(R.Fragment,{children:[R.jsxs("div",{className:"relative mb-5",children:[R.jsx("div",{className:"absolute inset-0 flex items-center",children:R.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),R.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:R.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:we("login_modal.divider_email")})})]}),R.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[R.jsx("button",{type:"button",className:$t("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",T==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{A("signin"),$(null)},children:we("login.tab.sign_in")}),R.jsx("button",{type:"button",className:$t("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",T==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{A("signup"),$(null)},children:we("login.tab.sign_up")})]}),R.jsxs("form",{onSubmit:Jt,className:"space-y-3",children:[T==="signup"&&R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("login.field.name")}),R.jsx("input",{id:"card-name",type:"text",autoComplete:"name",value:Q,onChange:Xe=>ee(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:we("login.field.name_placeholder")})]}),R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("login.field.email")}),R.jsx("input",{id:"card-email",type:"email",autoComplete:"email",required:!0,value:D,onChange:Xe=>B(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),R.jsxs("div",{children:[R.jsx("label",{htmlFor:"card-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:we("login.field.password")}),R.jsx("input",{id:"card-password",type:"password",autoComplete:T==="signup"?"new-password":"current-password",required:!0,minLength:T==="signup"?Ie:void 0,value:j,onChange:Xe=>S(Xe.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),T==="signup"&&R.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:we("login.password_hint",{min:String(Ie)})}),T==="signin"&&R.jsx("div",{className:"mt-1 text-right",children:R.jsx("button",{type:"button",onClick:()=>{A("reset_email"),$(null),W(null)},className:"text-xs font-medium text-oai-gray-500 hover:text-oai-black dark:hover:text-white no-underline bg-transparent border-0 p-0 cursor-pointer focus:outline-none",children:we("login.forgot_password")})})]}),R.jsx("button",{type:"submit",disabled:re,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:we(T==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):R.jsxs(R.Fragment,{children:[R.jsxs("div",{className:"relative mb-5",children:[R.jsx("div",{className:"absolute inset-0 flex items-center",children:R.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),R.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:R.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:we("login.divider")})})]}),R.jsxs("button",{type:"button",onClick:()=>_e(!0),className:$t("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[R.jsx(lO,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),we("login_modal.continue_email")]})]})]})]})}function I$(){const{isOpen:t,closeLoginModal:e}=lT(),{enabled:n}=wo();return k.useEffect(()=>{if(!t)return;const a=r=>{r.key==="Escape"&&e()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t,e]),n?R.jsx(M5,{children:t&&R.jsxs(kd.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[R.jsx(kd.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60",onClick:e,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),R.jsxs(kd.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 shadow-2xl overflow-hidden",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:a=>a.stopPropagation(),children:[R.jsx("button",{type:"button",onClick:e,className:"absolute right-4 top-4 z-10 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:R.jsx(C0,{className:"h-5 w-5"})}),R.jsx(D$,{onSuccess:e,className:"p-6 bg-transparent"})]})]})}):null}const M$={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"},QY="https://tokentracker.statuspage.io/",N$="https://github.com/mm7894215/TokenTracker",l4=`${N$}/releases/latest`,XY=`${l4}/download/TokenTrackerBar.dmg`,eZ=`${l4}/download/TokenTracker-Setup.exe`;function O$(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const e=typeof import.meta<"u"?M$:void 0;return(e?.VITE_TOKENTRACKER_BACKEND_BASE_URL||e?.VITE_INSFORGE_BASE_URL||Yr()).trim()}function j$(){return Yr()}function z$(t=""){if(typeof t!="string"||t.length===0)return!1;const e=new URLSearchParams(t),n=String(e.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const F$=300*1e3,U$=720*60*1e3;function sb(t){return typeof t=="string"&&/^https?:\/\//i.test(t.trim())}function B$(t,e=Date.now()){if(!t?.token||!t?.deviceId||!t?.issuedAt)return!0;const n=Date.parse(t.issuedAt);return Number.isFinite(n)?n+U$<=e:!0}async function c4(t,e){const n=Yr();if(!sb(n)||!t)return;const a=n.replace(/\/$/,""),r=Gl(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${t}`};r&&(s.apikey=r);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:s,body:JSON.stringify({period:"week",source:e})})}catch{}}async function $$(){try{const t=await fetch("/functions/tokentracker-machine-id",{headers:{Accept:"application/json"},cache:"no-store"});if(t.ok){const e=await t.json().catch(()=>null),n=typeof e?.machineId=="string"?e.machineId.trim():null;if(n&&n.length>=8)return n}}catch{}return null}async function V$(t){const e=Yr();if(!sb(e)||!t)return null;const n=e.replace(/\/$/,""),a=Gl(),r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${t}`};a&&(r.apikey=a);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",l=await $$();if(!l)return null;const c=`Token Tracker (dashboard) #${l.slice(0,8)}`,u=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:r,body:JSON.stringify({device_name:c,platform:s,machine_id:l})});if(!u.ok)return null;const h=await u.json().catch(()=>null),p=typeof h?.token=="string"?h.token:null,m=typeof h?.device_id=="string"?h.device_id:null;return!p||!m?null:{token:p,deviceId:m,issuedAt:typeof h?.created_at=="string"?h.created_at:new Date().toISOString()}}async function sP(t){const{deviceToken:e,insforgeBaseUrl:n,drain:a}=t,r={deviceToken:e};a===!0&&(r.drain=!0);const s=n||Yr();sb(s)&&(r.insforgeBaseUrl=s.trim());const l=await eu(),c=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...l},body:JSON.stringify(r)}),u=await c.json().catch(()=>({}));if(!c.ok){const h=typeof u.error=="string"?u.error:`HTTP ${c.status}`;throw new Error(h)}return u}async function oP(t){const e=await t();if(!e)return null;const n=vC();if(n&&!B$(n))return n;const a=await V$(e);return a?(L7(a),a):null}async function d4(t,e={}){let n=await t();if(!n)return null;let a=await oP(async()=>n);if(!a)return n;try{return await sP({deviceToken:a.token,insforgeBaseUrl:Yr(),drain:e.drain===!0}),wx(),n}catch(r){if(!vC()||(_C(),n=await t(),!n)||(a=await oP(async()=>n),!a))throw r;return await sP({deviceToken:a.token,insforgeBaseUrl:Yr(),drain:e.drain===!0}),wx(),n}}async function H$(t){const e=D7(),n=v_();if(n&&Date.now()-e<F$)return;const a=await d4(t,{drain:!n});a&&(bC(Date.now()),await c4(a,"cloud-sync-auto"))}async function tZ(t){const e=await d4(t,{drain:!0});e&&(bC(Date.now()),await c4(e,"cloud-sync-now"))}function W$(t){const e=t.replace(/\/+$/,"")||"/";return e==="/share"||e==="/share.html"||e.startsWith("/share/")}function G$(t){const e=t.replace(/\/+$/,"")||"/";return e==="/login"||e==="/landing"||W$(e)?!1:e==="/"||e==="/dashboard"||e.startsWith("/leaderboard")}function q$(){const t=ya(),e=wo(),n=k.useRef(!1);k.useEffect(()=>{if(!Rp()||!G$(t.pathname||"/")||!e.enabled||!e.signedIn||e.loading||!Lp())return;let a=!1;const r=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await H$(()=>e.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(r)}},[t.pathname,e.enabled,e.signedIn,e.loading,e.getAccessToken])}function K$(){const t=k.useContext(sT);if(t===null)throw new Error("useTheme must be used within a ThemeProvider");return t}function Y$({prefersReducedMotion:t,screenshotCapture:e}){return!(e||t)}function Z$(t){if(!t||typeof t!="object")return null;const e=t.user_metadata&&typeof t.user_metadata=="object"?t.user_metadata:{},n=t.profile&&typeof t.profile=="object"?t.profile:{},a=e.avatar_url||e.picture||n.avatar_url||t.avatar_url;return typeof a=="string"&&a.trim()?a.trim():null}function J$(t){return t?Nf()?`/api/avatar-proxy?url=${encodeURIComponent(t)}`:t:null}function Eh(t){const e=String(t||"").trim();if(!e)return"?";const n=e.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function lP({className:t,variant:e="header",collapsed:n=!1,onAfterAction:a}){Kl();const r=e==="sidebar",{enabled:s,loading:l,signedIn:c,user:u,displayName:h}=wo(),{openLoginModal:p}=lT(),m=$l(),v=k.useMemo(()=>Z$(u),[u]),y=k.useMemo(()=>J$(v),[v]),[b,x]=lo.useState(!1);if(lo.useEffect(()=>{x(!1)},[y]),!s)return null;if(l)return R.jsx("div",{className:$t("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",t),"aria-hidden":!0});if(!c)return r?R.jsxs("button",{type:"button",onClick:()=>{p(),a?.()},className:$t("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] font-medium text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 min-w-0",n?"h-8 w-8 justify-center px-0":"w-full",t),"aria-label":we("header.auth.sign_in_aria"),title:n?we("header.auth.sign_in_aria"):void 0,children:[R.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:R.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&R.jsx("span",{className:"truncate flex-1 text-left",children:we("header.auth.sign_in_aria")})]}):R.jsx("button",{type:"button",onClick:p,className:$t("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-md px-4 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",t),"aria-label":we("header.auth.sign_in_aria"),children:we("header.auth.sign_in_aria")});const P=()=>{m("/settings"),a?.()};return R.jsx("div",{className:$t(r?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",t),children:R.jsxs("button",{type:"button",onClick:P,className:$t(r?$t("flex w-full items-center gap-2 rounded-md px-2 py-1.5 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 transition-colors min-w-0",n&&"justify-center px-0 py-0 h-9 w-9"):"flex items-center gap-2 rounded-md pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors"),"aria-label":we("header.auth.open_settings"),title:r&&n?h:void 0,children:[r?R.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:y&&!b?R.jsx("img",{src:y,alt:"",width:20,height:20,className:"h-5 w-5 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer",onError:()=>x(!0)}):Eh(h)==="?"?R.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:R.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-3 h-3 opacity-80",children:R.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):R.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600 text-[9px] font-semibold text-white ring-1 ring-oai-brand-500/50",children:Eh(h)})}):y&&!b?R.jsx("img",{src:y,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700 shrink-0",referrerPolicy:"no-referrer",onError:()=>x(!0)}):Eh(h)==="?"?R.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:R.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-4 h-4 opacity-80",children:R.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):R.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:Eh(h)}),r?!n&&R.jsx("span",{className:"truncate text-[13px] font-medium text-oai-gray-900 dark:text-oai-gray-200 flex-1 text-left min-w-0",children:h}):R.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:h})]})})}const Y_="tt.sidebarCollapsed";function u4(){return[{id:"general",label:we("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:QN,label:we("nav.usage")},{id:"limits",to:"/limits",icon:nO,label:we("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:EO,label:we("nav.leaderboard")},{id:"achievements",to:"/achievements",icon:ZN,label:we("nav.achievements")}]},{id:"tools",label:we("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:sO,label:we("nav.widgets")},{id:"pet",to:"/pet-settings",icon:mO,label:we("nav.pet")},{id:"skills",to:"/skills",icon:vO,label:we("nav.skills")},{id:"ip-check",to:"/ip-check",icon:rO,label:we("nav.ip_check")}]},{id:"account",label:we("nav.group.account"),items:[{id:"settings",to:"/settings",icon:xO,label:we("nav.settings")}]}]}function Q$(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Y_)==="1"}catch{return!1}}function X$(){const[t,e]=k.useState(Q$),n=k.useCallback(()=>{e(a=>{const r=!a;try{typeof window<"u"&&window.localStorage.setItem(Y_,r?"1":"0")}catch{}return r})},[]);return k.useEffect(()=>{if(typeof window>"u")return;const a=r=>{r.key===Y_&&e(r.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:t,toggle:n}}function eV(t,e){const n=t.replace(/\/+$/,"")||"/";return e==="/dashboard"?n==="/dashboard"||n==="/":e==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===e}function tV({label:t,collapsed:e,first:n}){return e?n?null:R.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):R.jsx("div",{className:$t("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:t})}function nV({item:t,collapsed:e,active:n,onClick:a}){const r=t.icon;return R.jsxs(Ef,{to:t.to,onClick:a,title:e?t.label:void 0,"aria-current":n?"page":void 0,className:$t("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",e&&"justify-center px-0 py-2",n?"bg-oai-gray-200/70 text-oai-black font-medium dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/50 hover:text-oai-black dark:hover:bg-oai-gray-800/60 dark:hover:text-white"),children:[R.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:R.jsx(r,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!e&&R.jsx("span",{className:"truncate",children:t.label})]})}function aV({as:t="button",title:e,onClick:n,href:a,children:r,className:s,...l}){const c=$t("flex h-10 w-10 items-center justify-center rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",s);return t==="a"?R.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:e,"aria-label":e,className:c,...l,children:r}):R.jsx("button",{type:"button",title:e,"aria-label":e,onClick:n,className:c,...l,children:r})}function rV({repo:t="mm7894215/TokenTracker",glassChrome:e=!1}){const[n,a]=k.useState(null);return k.useEffect(()=>{if(typeof window>"u")return;const r=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;Y$({prefersReducedMotion:r,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${t}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&a(s.stargazers_count)}).catch(()=>{})},[t]),R.jsxs("a",{href:`https://github.com/${t}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:$t("inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",e?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:[R.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:R.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),R.jsx("span",{children:"Star"}),n!==null&&R.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const iV=[{value:"light",label:"Light",Icon:iT},{value:"dark",label:"Dark",Icon:rT},{value:"system",label:"System",Icon:hO}];function sV({theme:t,resolvedTheme:e,onSetTheme:n,glassChrome:a=!1}){const[r,s]=k.useState(!1),l=k.useRef(null),c=e==="dark"?rT:iT;return k.useEffect(()=>{if(!r)return;const u=p=>{l.current&&!l.current.contains(p.target)&&s(!1)},h=p=>{p.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",h)}},[r]),R.jsxs("div",{ref:l,className:"relative",children:[R.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":r,"aria-haspopup":"menu",title:"Theme",onClick:()=>s(u=>!u),className:$t("inline-flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",a?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:R.jsx(c,{className:"h-3.5 w-3.5","aria-hidden":!0})}),r&&R.jsx("div",{role:"menu",className:"absolute bottom-full left-0 mb-2 z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg",children:iV.map(({value:u,label:h,Icon:p})=>{const m=t===u;return R.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(u),s(!1)},className:$t("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",m?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"),children:[R.jsx(p,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),R.jsx("span",{children:h})]},u)})})]})}function h4({collapsed:t,onToggleCollapsed:e,onItemClick:n,showCloseButton:a=!1,onClose:r,glassChrome:s=!1}){const c=ya()?.pathname||"/",{theme:u,resolvedTheme:h,setTheme:p}=K$(),{resolvedLocale:m}=Kl(),v=k.useMemo(()=>u4(),[m]);return R.jsxs(R.Fragment,{children:[R.jsx("div",{className:$t("px-2 pt-2 pb-2",t&&"flex justify-center"),children:a?R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("div",{className:"flex-1 min-w-0",children:R.jsx(lP,{variant:"sidebar",collapsed:t,onAfterAction:n})}),R.jsx("button",{type:"button",onClick:r,"aria-label":we("nav.close_menu"),title:we("nav.close_menu"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-500 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-gray-900 dark:hover:text-oai-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:R.jsx(C0,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):R.jsx(lP,{variant:"sidebar",collapsed:t,onAfterAction:n})}),R.jsx("nav",{"aria-label":we("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:v.map((y,b)=>R.jsxs("div",{className:"flex flex-col",children:[R.jsx(tV,{label:y.label,collapsed:t,first:b===0}),R.jsx("div",{className:"flex flex-col gap-0.5",children:y.items.filter(x=>!(x.to==="/widgets"&&Of())).map(x=>R.jsx(nV,{item:x,collapsed:t,active:eV(c,x.to),onClick:n},x.id))})]},y.id))}),R.jsxs("div",{className:$t("flex items-center px-2 py-3",t?"flex-col justify-center gap-2":"justify-between gap-2"),children:[R.jsx(sV,{theme:u,resolvedTheme:h,onSetTheme:p,glassChrome:s}),R.jsx("div",{className:"flex items-center gap-1.5",children:!t&&R.jsx(rV,{glassChrome:s})})]})]})}function oV({collapsed:t,onToggleCollapsed:e}){const n=k.useMemo(()=>typeof window>"u"?!1:Ga()||Nf(),[]);return R.jsx("aside",{"data-native-sidebar":!0,"aria-label":we("nav.aside_label"),className:$t("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",t?"w-[72px]":"w-[220px]"),children:R.jsx(h4,{collapsed:t,onToggleCollapsed:e,glassChrome:n})})}function lV({open:t,onClose:e}){return k.useEffect(()=>{if(!t)return;const n=a=>{a.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t,e]),k.useEffect(()=>{if(!t)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[t]),t?R.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[R.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:e,"aria-hidden":!0}),R.jsx("aside",{"aria-label":we("nav.aside_label"),className:"relative w-[260px] max-w-[80vw] flex flex-col bg-oai-white dark:bg-oai-gray-900 border-r border-oai-gray-200 dark:border-oai-gray-800 shadow-2xl",children:R.jsx(h4,{collapsed:!1,showCloseButton:!0,onClose:e,onItemClick:e})})]}):null}function cV({onOpenDrawer:t}){return R.jsxs("div",{className:"lg:hidden flex items-center justify-between gap-2 px-3 h-14 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[R.jsx(aV,{title:we("nav.menu"),onClick:t,children:R.jsx(dO,{className:"h-5 w-5","aria-hidden":!0})}),R.jsxs(Ef,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[R.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),R.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),R.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function dV({children:t}){const{collapsed:e,toggle:n}=X$(),[a,r]=k.useState(!1),s=k.useCallback(()=>r(!0),[]),l=k.useCallback(()=>r(!1),[]),c=k.useMemo(()=>typeof window>"u"?!1:Ga()||Nf(),[]);return R.jsxs("div",{className:$t("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",Of()&&"tt-native-glass-shell",c?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[c&&R.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),R.jsxs("div",{className:"flex-1 min-h-0 flex",children:[R.jsx(oV,{collapsed:e,onToggleCollapsed:n}),R.jsx(lV,{open:a,onClose:l}),R.jsx("div",{className:"flex-1 min-w-0 min-h-0 p-2 lg:pl-0 lg:pr-3 lg:pb-3 flex flex-col",children:R.jsxs("div",{className:$t("flex-1 min-h-0 flex flex-col bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",c?"tt-native-main-card":"rounded-2xl",!c&&"shadow-sm"),children:[R.jsx(cV,{onOpenDrawer:s}),R.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:t})]})})]})]})}function uV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function cP({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:e,children:R.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function hV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function pV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function fV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})})}function mV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function gV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function vV({size:t=16,className:e=""}){return R.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:[R.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),R.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function _V({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function dP({size:t=16,className:e=""}){return R.jsxs("svg",{width:t,height:t,viewBox:"0 0 64 60",fill:"none",className:e,"aria-hidden":"true",children:[R.jsx("path",{fill:"currentColor",d:"M37.2114 3.75318C37.6821 3.33106 37.7106 3.31457 38.0558 3.29385C38.6149 3.2531 39.1272 3.52199 39.9989 4.31564C42.0356 6.16652 44.8714 9.97183 46.6346 13.2212L47.3163 14.4819L48.2782 14.9605C49.2072 15.4299 50.7308 16.3923 51.3672 16.9085C51.655 17.1464 51.6956 17.1508 51.9947 17.0344C53.3454 16.5084 55.2803 17.206 56.9869 18.8432C58.5231 20.3155 59.9943 22.8312 60.558 24.9308C60.6403 25.2687 60.7493 25.9952 60.7891 26.5362C60.9177 28.4358 60.3092 29.9532 59.1362 30.64C58.8965 30.7784 58.8801 30.8158 58.8868 31.4132C58.9409 34.2583 58.1741 37.0985 56.6335 39.8679C54.8946 42.9773 51.7981 46.1938 47.6074 49.2243C45.357 50.8619 40.0323 53.964 37.6248 55.0532C31.8578 57.6496 27.2346 58.646 23.2188 58.154C20.8236 57.8638 18.1124 56.9287 16.5082 55.8433C16.086 55.5515 16.0191 55.5329 15.6966 55.6251C13.9793 56.1185 11.73 55.1053 9.81931 52.9844C9.05725 52.1366 7.82714 50.0548 7.42839 48.9409C6.50606 46.3339 6.68976 43.9816 7.91836 42.5767C8.23573 42.2149 8.2453 42.1995 8.17598 41.5912C8.06148 40.5951 8.00971 39.1206 8.06202 38.1692L8.10361 37.2803L6.76977 34.9212C4.70378 31.2451 3.3912 28.1582 2.88489 25.7998C2.61762 24.5066 2.63385 23.9324 2.96214 23.5078C3.16198 23.2515 3.81796 22.9866 4.60785 22.8407C6.59665 22.4917 10.9334 22.8076 15.7581 23.6595L16.259 23.7458L17.3608 22.7713C19.1891 21.1519 20.4038 20.244 22.6429 18.8478C24.9768 17.3876 27.6108 16.1858 30.577 15.2346L31.5295 14.9294L32.0526 13.5561C33.9257 8.61146 35.8437 4.96584 37.2114 3.75318ZM21.5208 29.0919C19.404 30.314 18.3453 30.9251 17.5676 31.6099C14.4179 34.3835 13.2414 38.777 14.5823 42.7537C14.9135 43.7357 15.5247 44.7942 16.7469 46.9111C17.9691 49.0279 18.5801 50.0865 19.2649 50.8643C22.0385 54.014 26.4316 55.1918 30.4084 53.8509C31.3904 53.5198 32.4489 52.9085 34.5657 51.6863L46.7442 44.6551C48.8613 43.4328 49.9205 42.8214 50.6983 42.1365C53.8479 39.363 55.0245 34.9695 53.6835 30.9927C53.3524 30.0107 52.7412 28.9522 51.519 26.8354C50.2968 24.7185 49.6858 23.66 49.0009 22.8822C46.2274 19.7325 41.8342 18.5547 37.8575 19.8956C36.8754 20.2267 35.8163 20.8383 33.6993 22.0606L21.5208 29.0919Z"}),R.jsx("g",{transform:"rotate(-30 22.6953 37.6011)",children:R.jsx("rect",{x:"22.6953",y:"37.6011",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})}),R.jsx("g",{transform:"rotate(-30 35.6748 30.1074)",children:R.jsx("rect",{x:"35.6748",y:"30.1074",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})})]})}function yV({size:t=16,className:e=""}){return R.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:e,children:[R.jsx("path",{d:"M5.938 12.835c.127-.039.285.02.373.143.028.038.036.092.046.14.003.014-.02.033-.04.05-.124-.098-.24-.194-.354-.291-.011-.01-.016-.027-.025-.042zM8.396 9.412c.195-.032.39-.06.588-.05a.54.54 0 01.148.026c.202.071.402.147.601.224.028.01.05.036.075.055l-.013.027a9.203 9.203 0 01-.26-.089c-.115-.038-.213-.077-.315-.098-.25-.05-.25-.046-.292-.014l.574.144c.275.139.55.276.823.417.042.022.09.057.107.098.026.06.063.076.117.072.066-.006.132-.017.213-.027l-.04.086c.051.08.142.02.216.064-.074.13-.247.09-.334.199l.061.074-.12.087c0 .106-.038.168-.306.243l.026.085-.196.042.07.124h-.25l-.007.137c-.081-.01-.161-.018-.244-.027l-.053.123c-.027-.008-.052-.011-.073-.023-.067-.038-.128-.056-.195.006-.019.017-.063.014-.093.008-.026-.006-.05-.029-.07-.042-.11.095-.11.095-.208.003-.057.046-.12.074-.186.011-.063.027-.123-.02-.178-.014-.07.007-.097-.035-.133-.07l-.13.033c-.013-.236-.194-.19-.34-.203.005-.072.05-.092.095-.094a.474.474 0 01.159.022c.164.05.32.12.496.138.203.021.405.029.601-.015.265-.059.52-.149.707-.365.049-.056.083-.127.117-.195.019-.038.02-.084-.02-.116a1.397 1.397 0 00-.382-.217c.024.12-.031.182-.115.221 0 .014-.004.025 0 .03.08.115.084.16-.007.267a1.39 1.39 0 01-.218.211.477.477 0 01-.641-.05 1.36 1.36 0 01-.133-.152c-.078-.107-.076-.108-.033-.236-.165-.08-.128-.226-.104-.364.008-.05.028-.096.049-.163-.04.014-.067.017-.087.032a.897.897 0 00-.316.357c-.007.016-.01.034-.02.047-.012.015-.034.038-.045.035-.02-.006-.037-.027-.05-.045-.008-.012-.007-.032-.012-.057h-.126l.053-.172a14.82 14.82 0 00-.039-.049l.11-.284c-.06.026-.091.044-.124.051-.03.007-.064 0-.095 0 0-.031-.01-.07.004-.092.149-.22.305-.428.593-.476z"}),R.jsx("path",{d:"M8.06 10.788c-.003-.038-.004-.075.037-.062.016.006.034.048.028.067-.01.04-.038.032-.064-.005z"}),R.jsx("path",{d:"M11.981.009c.226-.012.453-.011.679 0 .247.01.495.024.74.062.401.064.798.157 1.19.273.463.138.92.299 1.356.511a7.31 7.31 0 012.948 2.642c.292.469.536.963.739 1.479.219.556.446 1.11.623 1.683.204.654.329 1.326.458 1.997.097.504.182 1.01.29 1.511.156.722.329 1.44.494 2.16.186.812.4 1.615.63 2.415.102.355.193.713.282 1.072.11.436.202.876.254 1.323.031.278.066.557.073.837a7.56 7.56 0 01-.017.88c-.037.413-.1.818-.226 1.212a5.017 5.017 0 01-.915 1.649l-.13.156.018.023c.043-.023.088-.041.127-.068.2-.138.373-.307.531-.49.4-.46.721-.973.975-1.529a3.59 3.59 0 00.325-1.72c-.024-.424-.097-.834-.3-1.213-.013-.027-.015-.06-.03-.121.05.035.082.048.101.072.107.13.22.258.315.398.33.494.46 1.052.486 1.64a3.75 3.75 0 01-.47 1.97c-.36.655-.887 1.14-1.526 1.506-.193.111-.394.21-.595.308-.157.078-.248.211-.318.365a.522.522 0 00-.033.406.359.359 0 01.013.139c-.005.077-.077.155-.14.162-.054.006-.125-.043-.15-.116a1.206 1.206 0 01-.06-.233c-.04-.314-.155-.6-.308-.87a3.906 3.906 0 00-.73-.91 2.129 2.129 0 00-.897-.524 4.093 4.093 0 00-.692-.131c-.075-.008-.15-.04-.22.01.18.06.363.11.538.18.434.173.82.43 1.18.728.308.255.58.543.794.884.098.155.186.315.227.496.027.123.042.25.067.375.013.062-.002.109-.053.144-.047.033-.122.034-.163-.01a.455.455 0 01-.08-.14c-.03-.073-.038-.159-.078-.225a7.314 7.314 0 00-1.423-1.664c-.16-.137-.329-.26-.537-.323-.376-.114-.753-.203-1.15-.154-.213.025-.427.032-.64.053a1.6 1.6 0 00-.736.278 5.14 5.14 0 00-.834.72c-.329.342-.642.699-.955 1.055-.136.155-.264.319-.314.531a5.227 5.227 0 00-.012.051.096.096 0 01-.09.076h-.31c-.046 0-.082-.048-.072-.094.023-.108.045-.216.07-.324.075-.325.19-.635.368-.917.024-.039.04-.088.104-.08l.01.049.027.077c.28-.435.571-.834.996-1.135.283-.204.584-.378.89-.55a.196.196 0 00-.098-.002c-.162.043-.325.084-.485.134-.402.124-.764.33-1.11.566-.147.1-.298.193-.414.333a7.314 7.314 0 00-1.07 1.767.845.845 0 00-.04.12.075.075 0 01-.072.056h-.494c-.04 0-.062-.051-.036-.082.123-.14.246-.282.377-.415.275-.281.58-.532.777-.884.027-.048.063-.09.095-.135.238-.333.54-.607.818-.902.082-.086.175-.16.26-.24.029-.027.053-.057.079-.085l-.018-.025-.135.041c-.034.017-.07.031-.102.05-.248.144-.494.292-.743.433-.408.23-.825.439-1.209.711-.281.2-.591.358-.889.533-.02.012-.044.015-.08.028-.015-.135.143-.201.108-.336-.033.014-.064.02-.085.038-.111.096-.227.19-.328.296-.148.157-.284.325-.425.488-.125.143-.25.286-.373.431A.153.153 0 019.89 24H8.762a.316.316 0 00.016-.042c.028-.09.085-.172.083-.28-.091-.018-.162.001-.212.077a4.45 4.45 0 00-.136.215c-.01.016-.024.03-.042.03h-.093c-.019 0-.029-.022-.017-.037.071-.088.14-.178.209-.268.001-.002-.006-.012-.012-.024-.014.004-.03.006-.045.013-.176.09-.352.181-.527.274a.363.363 0 01-.168.042H5.202c-.026 0-.039-.036-.019-.053.21-.178.402-.374.558-.605.335-.496.538-1.047.667-1.629.004-.02-.003-.043-.006-.091-.037.048-.059.072-.076.1a1.943 1.943 0 01-.334.415c-.28.258-.59.448-.983.464-.297.012-.588 0-.865-.127-.46-.21-.722-.57-.794-1.072-.025-.17-.017-.171-.182-.219A3.513 3.513 0 011.97 20.6a2.286 2.286 0 01-.808-1.13 3.569 3.569 0 01-.16-1.245c.002-.034.016-.067.024-.1.032.023.046.043.05.066.033.153.059.308.096.46.086.355.257.664.516.92.258.256.571.419.91.532.358.118.717.138 1.07-.016a1.89 1.89 0 00.621-.452c.328-.348.533-.76.648-1.223.009-.034.005-.071.007-.11-.015.006-.026.006-.03.011-.031.05-.064.1-.093.152-.284.502-.679.887-1.196 1.135-.351.17-.718.255-1.11.159a1.607 1.607 0 01-.971-.64 2.006 2.006 0 01-.368-.924 2.903 2.903 0 01.02-.886c.05-.439.466-1.17.742-1.271-.02.063-.035.112-.053.16-.043.116-.097.227-.13.345a1.901 1.901 0 00-.05.82c.033.212.09.416.204.6.147.236.346.407.62.465.11.023.225.014.338.018a.576.576 0 00.386-.131c.164-.128.282-.292.366-.481.168-.375.24-.777.309-1.179.05-.296.093-.594.133-.893.039-.281.071-.563.104-.845.026-.232.048-.464.074-.696.024-.228.052-.455.076-.683.024-.227.047-.455.069-.683.013-.14.022-.28.034-.42l.037-.417c.022-.25.041-.5.065-.748.008-.082-.02-.132-.09-.177a2.46 2.46 0 01-.492-.418c-.1-.109-.188-.228-.282-.342-.035-.042-.056-.097-.116-.118a2.084 2.084 0 00.275.597c.06.092.131.176.196.265.063.086.182.115.234.226-.028.003-.046.01-.06.006a4.74 4.74 0 01-.22-.057 2.71 2.71 0 01-1.287-.819c-.435-.487-.656-1.076-.71-1.723a5.206 5.206 0 01.014-1.06c.072-.602.22-1.186.45-1.745.155-.376.338-.741.526-1.102.205-.393.466-.75.765-1.076.512-.559 1.104-1.024 1.726-1.448.717-.49 1.478-.898 2.277-1.233C8.244.828 8.767.632 9.31.494c.655-.166 1.31-.33 1.982-.415.229-.03.458-.058.688-.07zm-1.847 22.82c-.07.06-.147.111-.207.18-.238.27-.464.549-.668.869l-.044.108a.177.177 0 00.093-.057c.174-.19.351-.378.519-.574.104-.122.195-.255.288-.386.024-.034.03-.08.046-.12l-.027-.02zm1.65-3.695a5.51 5.51 0 00-.653.593l-.37.386a.963.963 0 01-.377.25 1.372 1.372 0 01-.467.09c-.044 0-.087.006-.151.012.028.058.043.097.064.131.15.242.301.482.45.724.136.22.276.438.399.666.068.125.105.267.156.404.077.027.14-.018.202-.048.29-.135.579-.274.867-.412.213-.101.437-.186.636-.31.347-.215.68-.455 1.018-.685.015-.01.026-.028.042-.046-.023-.019-.038-.037-.056-.044-.287-.111-.527-.3-.77-.482a5.319 5.319 0 01-.506-.42 1.757 1.757 0 01-.41-.653c-.019-.049-.045-.095-.075-.156zm-5.847.264c-.06.096-.097.194-.132.293a3.38 3.38 0 01-.555 1.01c-.2.25-.455.412-.762.493-.23.06-.464.076-.7.07-.048-.002-.097.002-.158.005.016.04.021.066.035.085.1.145.23.246.4.295.157.046.316.034.498.023.181-.037.343-.115.485-.234.238-.199.402-.454.536-.732.175-.363.264-.751.342-1.144.01-.053.008-.11.011-.164zm14.945-4.586c.008.029.016.057.027.107.024.155.051.31.072.464.03.219.067.437.078.657.017.344.027.689-.014 1.033-.037.315-.063.633-.116.946a6.153 6.153 0 01-.46 1.518c-.008.018-.01.039-.02.082.047-.03.077-.042.098-.064.085-.083.17-.167.248-.255.271-.305.458-.66.596-1.043.18-.498.228-1.011.145-1.531-.103-.65-.33-1.263-.597-1.881a9.055 9.055 0 00-.024-.055l-.033.022zM5.797 8.29a.26.26 0 00.018.153c.124.251.25.501.379.75.025.049.066.09.03.163-.284.06-.578.119-.88.255.059.038.097.06.132.087.042.032.112.058.09.12-.01.033-.075.048-.117.072.017.01.043.021.067.036.166.102.33.207.447.368.138.192.229.404.188.644-.079.469-.306.85-.69 1.132-.054.04-.106.083-.161.122a.243.243 0 00-.103.245.77.77 0 00.055.195c.083.196.22.35.375.492.083.076.159.164.222.257a.37.37 0 01.025.377c-.023.05-.05.099-.076.148-.03.06-.028.111.022.162.041.042.08.089.112.138.038.058.078.079.147.05a.486.486 0 01.333-.006c.16.046.302.126.444.21.13.077.264.149.4.219.067.035.14.05.219.026.071-.022.124.01.145.076.02.064-.003.108-.074.139-.07.03-.137.063-.209.088-.1.035-.201.073-.314.077-.013-.107.11-.088.127-.159-.206-.126-.643-.145-.801-.034.063.112.035.21-.096.313-.13-.1-.025-.202.002-.3a.209.209 0 00-.249.17c-.015.101.067.216.178.224.108.007.218-.005.326-.012.06-.005.12-.027.199 0-.103.123-.248.127-.357.19.002.05.07.086.019.131-.053.048-.095-.001-.132-.03-.08-.063-.16-.126-.231-.197a.474.474 0 01-.157-.311.52.52 0 00-.043-.172c-.032-.074-.032-.137.033-.19-.018-.03-.028-.053-.045-.072a1.222 1.222 0 01-.196-.369c-.053-.137-.046-.264.048-.381.024-.03.05-.06.064-.095a.664.664 0 00.047-.168c.017-.165-.064-.287-.182-.387-.186-.156-.36-.322-.46-.551-.005-.011-.024-.017-.037-.026-.011.017-.024.027-.025.038-.019.185-.045.37-.052.557-.014.377.058.743.162 1.104.118.41.289.798.488 1.173.267.502.537 1.002.812 1.5.055.098.13.189.208.27.198.202.452.272.724.273.202 0 .404-.006.605-.026.295-.03.59-.073.884-.113.183-.025.365-.057.548-.08.21-.026.38.073.522.21.16.156.305.327.447.5.22.265.397.56.554.867.05.098.07.1.147.03.13-.121.26-.242.394-.36.067-.059.088-.12.067-.213a3.535 3.535 0 01-.085-.796c.002-.157.006-.314.018-.471.015-.224.03-.45.06-.672a59.114 59.114 0 01.362-2.298c.087-.493.182-.984.268-1.477.06-.347.118-.694.162-1.043.034-.273.055-.55.063-.825.011-.332.003-.665.002-.998 0-.077.004-.155-.01-.23-.028-.142-.01-.155-.162-.19a5.826 5.826 0 00-.607-.107c-.146-.018-.207-.053-.221-.19-.006-.049-.025-.098-.041-.146-.009-.025-.024-.048-.046-.09l-.025.264c-.009.096-.029.116-.127.115-.055 0-.11-.008-.164-.008-.476 0-.952-.008-1.426.032-.095.008-.173-.015-.226-.103-.04-.066-.088-.126-.134-.186-.063-.084-.086-.093-.182-.06-.195.068-.388.138-.582.21a2.71 2.71 0 00-.675.394.986.986 0 01-.323.168c-.033.01-.07.008-.127.013.02-.066.024-.114.047-.15.064-.105.135-.205.205-.306.023-.033.049-.063.073-.095l-.015-.023-.201.037c-.146.04-.296.07-.437.122-.148.053-.266.023-.386-.072a3.623 3.623 0 01-.733-.786l-.093-.132zm8.592 8.963l-.147.09c-.22.134-.44.266-.659.402-.093.058-.184.12-.27.188-.085.07-.124.161-.072.272.047.1.093.2.147.294.047.08.124.138.213.147.11.01.228.012.336-.012.217-.05.372-.205.528-.357a.291.291 0 00.087-.308c-.046-.18-.079-.365-.118-.547-.011-.052-.027-.103-.045-.169zm-.257-2.409c-.12.291-.205.597-.325.91-.151.433-.294.87-.435 1.323.036-.01.054-.01.067-.018.261-.16.522-.324.785-.484.054-.033.071-.078.065-.138-.012-.13-.024-.262-.034-.393l-.068-.886c-.008-.103-.02-.206-.029-.31-.009 0-.017-.002-.026-.004zm3.081-8.13l.099.285c.08.231.159.463.24.714l.58 1.952c.187.63.372 1.262.558 1.893.114.382.235.762.343 1.146.072.257.126.519.186.799.044.206.087.413.127.64.034.106.023.226.077.325l.025-.006-.068-.362c-.038-.206-.077-.412-.113-.638-.015-.07-.029-.141-.046-.211-.095-.396-.177-.796-.29-1.187-.196-.685-.413-1.364-.618-2.046-.165-.549-.322-1.1-.488-1.648-.069-.227-.15-.45-.226-.695l-.117-.336c-.037-.107-.075-.216-.115-.322-.04-.106-.084-.21-.127-.314a7.558 7.558 0 01-.027.01zM6.225 14.304c-.063-.001-.115.014-.134.083a.35.35 0 00.41.012 4.533 4.533 0 00-.276-.095zM5.23 11.98c-.026-.027-.057-.048-.075.002-.012.032-.007.07-.01.113.082-.037.082-.037.085-.115zm.062-1.189a.135.135 0 00-.088.056.197.197 0 00-.025.11c.005.152.01.306.026.457a.751.751 0 00.066.218c.061.136.157.167.288.101.055-.027.06-.054.025-.11a4.52 4.52 0 01-.129-.211c-.015-.068-.066-.131-.033-.207.04-.09-.076-.116-.074-.19V10.874c-.003-.038-.006-.087-.056-.083zm-.017-.968a.867.867 0 00-.467.127c-.076.045-.084.07-.05.158.034.087.07.173.115.254.064.117.09.125.21.077a.657.657 0 01.336-.053c.202.022.357.136.504.264l.092.077c.007-.006.014-.013.022-.018-.019-.105-.035-.226-.149-.264-.157-.053-.324-.075-.508-.117l-.24-.005c.24-.169.452-.044.687.009-.063-.115-.153-.147-.23-.193-.082-.05-.17-.092-.25-.144-.06-.037-.12-.08-.072-.172zm10.233.325c-.23-.01-.427.08-.608.211-.034.026-.06.065-.105.117.087.026.15.046.232.065.044-.015.088-.03.13-.046.306-.114.61-.115.904.031.126.063.237.04.366-.005-.02-.031-.03-.054-.045-.071a.986.986 0 00-.448-.273c-.14-.044-.284-.024-.426-.03zM7.99 6.483a.308.308 0 00.002.133c.08.321.156.643.242.962.104.387.27.75.456 1.103.02.037.061.08.098.087a.404.404 0 00.253-.051l-.472-.84c-.23-.448-.405-.92-.579-1.394zM10.397.497c-.2-.008-.405.004-.603.034-.236.035-.47.087-.7.152-.287.08-.569.18-.852.273-.04.013-.074.038-.11.058.028.014.05.018.07.014.287-.068.58-.085.873-.09.134-.002.269.009.402.025.19.024.382.048.57.09.456.104.874.3 1.265.556.464.306.888.66 1.257 1.078.205.232.395.475.56.739.17.274.315.561.449.856.273.601.456 1.232.6 1.876.04.173.07.348.1.524.017.104.065.167.17.19.122.028.2.105.22.251-.003.102-.06.174-.129.24a1.065 1.065 0 00-.268.358.164.164 0 00.083-.039c.08-.086.162-.172.235-.265a.56.56 0 00.13-.333c.009-.05.022-.1.024-.15.007-.124-.017-.15-.143-.168-.025-.004-.049-.014-.073-.015-.082-.007-.125-.063-.137-.131-.033-.198-.004-.355.247-.408.086-.018.174-.03.26-.042.158-.023.315-.053.473-.067.14-.012.19.033.226.167.008.029.018.057.021.087.019.179-.008.225-.141.288-.027.013-.055.024-.078.042a.148.148 0 00-.051.067c-.039.144.073.382.206.445l.673.32c.023.011.05.015.075.023l.018-.026c-.015-.008-.032-.013-.044-.024a2.27 2.27 0 00-.544-.32 4.898 4.898 0 00-.173-.075.203.203 0 01-.126-.191c-.003-.085.045-.154.128-.187l.059-.025c.099-.044.118-.076.112-.187a.384.384 0 00-.008-.063c-.067-.294-.123-.59-.205-.88a9.478 9.478 0 00-.826-2.036 7.465 7.465 0 00-1.39-1.805 4.536 4.536 0 00-1.177-.824 3.656 3.656 0 00-1.016-.328 6.155 6.155 0 00-.712-.074zm6.719 5.955c.01.014.018.028.038.034l-.022-.044-.016.01zM4.103 3.917a.062.062 0 01-.03.012.455.455 0 01-.04.039c-.01.01-.02.02-.045.04l-.363.354c-.088.085-.17.178-.266.253-.284.22-.425.53-.544.855a.132.132 0 00-.007.071c.013.055.033.108.052.168l.074.026c-.017.056-.03.105-.047.152-.058.164-.118.327-.175.491-.005.015.008.036.019.077.08-.175.158-.33.225-.489.228-.544.484-1.074.819-1.561.09-.133.182-.266.283-.401.004-.006.007-.013.022-.03.001-.016.003-.032.015-.04l.008-.017zm12.976 2.408a.023.023 0 01.009.019.073.073 0 00-.006.01.188.188 0 00.007.02l.018.022c.002-.007.007-.016.005-.021-.003-.01-.012-.018-.02-.038a1.331 1.331 0 01-.013-.012zM4.199 4.48c-.003.004-.008.008-.027.014-.005.013-.011.025-.031.047a2.085 2.085 0 01-.124.167c-.048.07-.116.055-.181.041-.134-.028-.228.016-.287.143-.089.187-.187.37-.273.56-.049.108-.11.216-.118.36.081.003.154.007.228.008h.228a2.563 2.563 0 01-.079.264c-.01.052-.022.103-.033.155l.02.004c.018-.046.037-.092.067-.153.066-.142.13-.285.2-.426.02-.04.034-.1.116-.092 0 .043.004.084 0 .124-.005.045-.017.09-.028.143.141.043.086.174.115.269.102-.022.104-.195.248-.144v.205l.017.002.439-1.059c-.13 0-.246-.02-.358.033-.024.011-.058-.001-.108-.004.075-.15.139-.278.211-.417a.128.128 0 01.025-.036c0-.015-.001-.03.008-.038l.006-.02c-.005.006-.01.011-.028.017-.004.012-.009.024-.026.045a.085.085 0 01-.032.033c-.123.157-.09.164-.258.106-.079-.027-.078-.028-.047-.144.028-.046.056-.093.098-.15 0-.016-.001-.032.007-.042L4.2 4.48zm2.073-.67c-.003.006-.007.011-.027.016-.094.125-.194.246-.28.377-.155.238-.301.481-.451.723-.14.224-.345.368-.575.481-.017.008-.04.006-.079.011.012-.059.016-.109.033-.153a6.076 6.076 0 01.229-.518l-.007-.02a.138.138 0 01-.035.025c-.028.05-.055.1-.093.164-.26.424-.443.817-.442.95.024.004.048.011.073.013.177.013.188.007.26-.165.03-.07.077-.12.147-.15l.175-.07c.044-.018.085-.057.146-.032.003.05-.01.11.014.145.042.062.044.125.047.193.002.049.017.098.026.147.029-.034.039-.065.05-.097.142-.39.277-.782.428-1.17.1-.256.22-.504.33-.756.013-.03.013-.067.03-.092V3.81zm3.987-.34c0 .045.01.084.021.123.042.16.094.318.124.48.024.133.023.27.028.406 0 .033-.019.067-.032.11-.094-.058-.047-.158-.106-.215h-.125c-.015.072-.01.152-.046.2-.066.085-.155.154-.236.227-.043.038-.078.018-.103-.025l-.046-.087c-.065.035-.117.069-.172.093-.116.051-.235.095-.35.147-.085.038-.09.053-.07.147.014.075.034.148.047.223.013.072.05.109.123.124.233.05.462.115.657.265.058-.102.058-.102.168-.151.03-.014.06-.03.092-.042.08-.03.115-.017.15.06.023.048.041.098.066.158.06-.14-.042-.267.017-.416.157.18.24.39.375.567a.235.235 0 00.022-.098c.002-.124 0-.247.002-.371 0-.034.013-.067.02-.1l.032-.003c.11.155.13.354.226.52a3.036 3.036 0 00-.01-.392c-.004-.045 0-.074.05-.088.08.036.116.14.215.158-.03-.275-.423-1.137-.798-1.635-.114-.127-.2-.28-.34-.386zm-2.667.696c-.019.034-.03.05-.037.067-.061.185-.125.37-.18.556-.031.105-.087.169-.195.19-.09.019-.178.052-.268.073-.038.009-.089.015-.118-.003-.024-.016-.025-.069-.036-.106-.064.076-.082.087-.17.047-.133-.062-.262-.135-.393-.201-.048-.025-.093-.063-.17-.03-.043.12-.091.25-.137.382-.099.28-.087.242.095.453.046.048.102.03.154.023.054-.009.106-.03.16-.036.13-.013.26-.08.367-.015.204-.064.387-.122.571-.178.05-.015.089.005.114.054.022.042.034.093.082.121.038-.056-.013-.128.063-.178l.14.241-.042-1.46zm.278.358c-.096-.01-.107.01-.11.108-.002.038-.003.078.002.115.03.2.099.386.174.57.002.006.012.01.022.015l.078-.05c.052.036.081.088.153.088.205-.002.41.014.616.012.099-.001.158.042.205.12.018.03.024.077.088.066l-.08-.394c-.05-.195-.085-.395-.172-.589-.057.057-.114.068-.18.046a.72.72 0 00-.135-.028c-.22-.028-.44-.059-.66-.08zm10.254-1.727c.089.163.155.316.139.491-.016.168.026.342-.044.516-.047-.033-.088-.082-.112-.075-.117.035-.164-.057-.227-.115a4.772 4.772 0 01-.286-.29l-.104-.113a4.856 4.856 0 01-.023.019c.035.046.07.093.11.156.04.064.084.127.122.193.034.058.065.118.031.205-.082-.01-.164-.019-.246-.032-.06-.01-.101 0-.124.07-.031.098-.037.096-.15.09.02.042.036.08.057.116.041.074.03.138-.03.196-.06.06-.118.122-.178.181a.175.175 0 01-.185.046c-.222-.061-.447-.113-.67-.174-.032-.009-.063-.04-.086-.068-.03-.04-.052-.087-.08-.13-.044-.07-.09-.138-.136-.207a.18.18 0 00-.014.105c.012.127.03.253.035.38.005.1-.024.12-.121.104-.104-.017-.206-.04-.31-.058-.064-.012-.131-.028-.202.03l.081.208c.09 0 .166-.01.237.002a.819.819 0 01.458.251c.078.083.154.168.241.26l.018-.005c-.004-.006-.008-.013-.01-.04.014-.056-.062-.118.018-.178.031.03.064.057.088.09.058.078.111.159.169.257l.089.141.024-.013a2093.819 2093.819 0 01-.427-.934c.055.007.083.007.108.016.193.07.385.142.577.216.074.028.147.06.219.094.062.028.112.018.157-.033.05-.056.102-.112.154-.167.05-.051.095-.046.132.014.016.025.026.053.04.08.071.138.143.277.217.433l.159.308.025-.011c-.044-.106-.07-.218-.138-.334-.057-.182-.168-.346-.206-.545.136.034.362.326.567.732l.057.074.018-.011a1.563 1.563 0 01-.052-.127c-.046-.145-.097-.29-.136-.436-.022-.083-.036-.173.022-.26l.109.058-.026-.207.027-.016c.022.02.05.036.065.06.073.108.143.22.215.33.01.016.029.029.043.043-.036-.217-.2-.38-.229-.626l.155.112c.014-.166.012-.319.042-.465.032-.158-.023-.297-.063-.445.024.004.036.006.055.025.092.124.183.249.277.371.02.027.05.047.069.087l.04.063.019-.015a.293.293 0 01-.053-.082 27.922 27.922 0 01-.332-.49c-.221-.311-.363-.467-.485-.521zm-6.57.327c-.003.161.092.275.069.415l-.368.087c.09.139.032.237-.052.331-.05.057-.092.122-.143.178-.037.04-.046.078-.018.126l.16.275c.029.048.072.066.128.064.076-.003.152 0 .228-.001.116-.003.216.022.275.137.006.014.02.024.044.052.004-.059-.003-.098.01-.13.016-.04.04-.099.072-.108.084-.023.173-.024.26-.03.013-.001.027.018.04.029l.071.065c.019-.11-.082-.198-.024-.31l.126.04c-.026-.123-.07-.245-.071-.366 0-.123.051-.243.115-.36.107.062.16.156.234.253.183.265.36.533.494.834.165-.078.27.068.407.088-.003-.106-.133-.441-.197-.492a.142.142 0 00-.102-.028c-.06.011-.119.039-.191.063-.025-.039-.056-.078-.077-.122a3.936 3.936 0 00-.473-.783c-.076-.094-.16-.182-.228-.26l-.391.285c-.049.035-.094.03-.132-.017l-.169-.207c-.025-.03-.053-.059-.097-.108z"})]})}function bV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"currentColor",className:e,children:R.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function kV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:e,children:R.jsx("path",{d:"M23.955 13.587l-1.342-4.135-2.664-8.189c-.135-.423-.73-.423-.867 0L16.418 9.45H7.582L4.919 1.263c-.135-.423-.73-.423-.867 0L1.388 9.452.045 13.587a.924.924 0 0 0 .331 1.03L12 23.054l11.625-8.436a.92.92 0 0 0 .33-1.031"})})}function wV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":"true",children:R.jsx("g",{transform:"translate(3.4502, 3)",fill:"#9570BE",children:R.jsx("path",{d:"M3.17890888,3.6 L3.17890888,0 L16,0 L16,3.6 L3.17890888,3.6 Z M9.642,7.2 L9.64218223,10.8 L0,10.8 L0,3.6 L16,3.6 L16,7.2 L9.642,7.2 Z M3.17890888,18 L3.178,14.4 L0,14.4 L0,10.8 L16,10.8 L16,18 L3.17890888,18 Z",fillRule:"nonzero"})})})}function xV({size:t=16,className:e=""}){return R.jsxs("svg",{width:t,height:t,viewBox:"0 0 120 90",fill:"currentColor",className:e,children:[R.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),R.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),R.jsx("rect",{x:"75",y:"20",width:"12",height:"45",rx:"2"}),R.jsx("rect",{x:"71",y:"55",width:"20",height:"16",rx:"3"}),R.jsx("rect",{x:"76",y:"71",width:"3",height:"8",rx:"1"}),R.jsx("rect",{x:"82",y:"71",width:"3",height:"8",rx:"1"})]})}function PV({size:t=16,className:e=""}){return R.jsxs("svg",{width:t,height:t,viewBox:"0 0 120 90",fill:"currentColor",className:e,children:[R.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),R.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),R.jsx("rect",{x:"83",y:"20",width:"12",height:"62",rx:"2"})]})}function SV({size:t=16,className:e=""}){return R.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[R.jsx("path",{d:"M9 3v2"}),R.jsx("path",{d:"M15 3v2"}),R.jsx("rect",{x:"4",y:"6",width:"16",height:"13",rx:"3"}),R.jsx("circle",{cx:"9",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),R.jsx("circle",{cx:"15",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),R.jsx("path",{d:"M9 16h6"})]})}function CV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"})})}function TV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M20.113 5.5l-.442 1.557a.157.157 0 01-.196.106l-7.414-2.157a.16.16 0 00-.143.028l-7.342 5.74a.159.159 0 01-.074.032l-4.37.656a.154.154 0 00-.132.162l.02.245c.005.078.071.14.152.141l5.074.128.058.002 3.75-1.953a.16.16 0 01.164.01l2.657 1.847a.152.152 0 01.066.125l-.023 2.45c0 .032.01.063.028.089l3.737 5.227c.03.04.077.065.129.065h1.182a.153.153 0 00.14-.224l-2.664-4.919a.15.15 0 01.005-.152l1.389-2.169a.156.156 0 01.062-.055l4.965-2.456a.16.16 0 01.158.01l1.418.921a.16.16 0 00.087.026h1.289c.125 0 .2-.136.13-.237l-3.578-5.29c-.074-.109-.246-.082-.282.044z"})})}function EV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M21.595 23.61c1.167-.254 2.405-.944 2.405-.944l-2.167-1.784a12.124 12.124 0 01-2.695-3.131 12.127 12.127 0 00-3.97-4.049l-.794-.462a1.115 1.115 0 01-.488-.815.844.844 0 01.154-.575c.413-.582 2.548-3.115 2.94-3.44.503-.416 1.065-.762 1.586-1.159.074-.056.148-.112.221-.17.003-.002.007-.004.009-.007.167-.131.325-.272.45-.438.453-.524.563-.988.59-1.193-.061-.197-.244-.639-.753-1.148.319.02.705.272 1.056.569.235-.376.481-.773.727-1.171.165-.266-.08-.465-.086-.471h-.001V3.22c-.007-.007-.206-.25-.471-.086-.567.35-1.134.702-1.639 1.021 0 0-.597-.012-1.305.599a2.464 2.464 0 00-.438.45l-.007.009c-.058.072-.114.147-.17.221-.397.521-.743 1.083-1.16 1.587-.323.391-2.857 2.526-3.44 2.94a.842.842 0 01-.574.153 1.115 1.115 0 01-.815-.488l-.462-.794a12.123 12.123 0 00-4.049-3.97 12.133 12.133 0 01-3.13-2.695L1.332 0S.643 1.238.39 2.405c.352.428 1.27 1.49 2.34 2.302C1.58 4.167.73 3.75.06 3.4c-.103.765-.063 1.92.043 2.816.726.317 1.961.806 3.219 1.066-1.006.236-2.11.278-2.961.262.15.554.358 1.119.64 1.688.119.263.25.52.39.77.452.125 2.222.383 3.164.171l-2.51.897a27.776 27.776 0 002.544 2.726c2.031-1.092 2.494-1.241 4.018-2.238-2.467 2.008-3.108 2.828-3.8 3.67l-.483.678c-.25.351-.469.725-.65 1.117-.61 1.31-1.47 4.1-1.47 4.1-.154.486.202.842.674.674 0 0 2.79-.861 4.1-1.47.392-.182.766-.4 1.118-.65l.677-.483c.227-.187.453-.37.701-.586 0 0 1.705 2.02 3.458 3.349l.896-2.511c-.211.942.046 2.712.17 3.163.252.142.509.272.772.392.569.28 1.134.49 1.688.64-.016-.853.026-1.956.261-2.962.26 1.258.75 2.493 1.067 3.219.895.106 2.051.146 2.816.043a73.87 73.87 0 01-1.308-2.67c.811 1.07 1.874 1.988 2.302 2.34h-.001z"})})}function AV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:R.jsx("path",{d:"M0 0v24h24V0H0zm22.222 22.222H1.778V1.778h20.444v20.444zm-7.555-4.964h2.222v1.778h-2.794L12.89 17.83v-2.794h1.778v2.222zm4 0h-1.778v-2.222h-2.222v-1.778h2.793l1.207 1.207v2.793zm-7.556-2.591H9.333v-1.778h1.778v1.778zm-5.778-1.778h1.778v4h4v1.778H6.54L5.333 17.46V12.89zm13.334-3.556v1.778h-5.778V9.333h1.987V7.111h-1.987V5.333h2.558l1.206 1.207v2.793h2.014zm-11.556-2h2.222l1.778 1.778v2H9.333v-2H7.111v2H5.333V5.333h1.778v2zm4 0H9.333v-2h1.778v2z"})})}function RV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:e,children:R.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.125 2.75C2.9179 2.75 2.75 2.9179 2.75 3.125V11.375H2V3.125C2 2.50368 2.50368 2 3.125 2H13.1723C13.6735 2 13.9244 2.6059 13.5701 2.96025L7.38189 9.14843H9.125V8.375H9.875V9.33593C9.875 9.6466 9.6232 9.8984 9.3125 9.8984H6.63189L5.34282 11.1875H11.1875V6.5H11.9375V11.1875C11.9375 11.6017 11.6017 11.9375 11.1875 11.9375H4.59282L3.28032 13.25H12.875C13.0821 13.25 13.25 13.0821 13.25 12.875V4.625H14V12.875C14 13.4963 13.4963 14 12.875 14H2.82767C2.32653 14 2.07557 13.3941 2.42992 13.0397L8.59468 6.875H6.875V7.625H6.125V6.6875C6.125 6.37684 6.37684 6.125 6.6875 6.125H9.34468L10.6571 4.8125H4.8125V9.5H4.0625V4.8125C4.0625 4.39829 4.39829 4.0625 4.8125 4.0625H11.4071L12.7197 2.75H3.125Z"})})}function LV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",className:e,children:R.jsx("path",{d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"})})}const DV={CLAUDE:uV,ZCODE:CV,CODEBUDDY:dP,WORKBUDDY:dP,CODEX:cP,COPILOT:_V,CRAFT:wV,CURSOR:hV,DEEPSEEK:LV,DROID:SV,"EVERY-CODE":cP,GEMINI:pV,GITHUB:bV,GITLAB:kV,GOOSE:EV,GROK:fV,HERMES:yV,KIMI:vV,KIRO:mV,KILOCODE:AV,OPENCODE:gV,OMP:xV,PI:PV,ROOCODE:TV,ZED:RV},IV={ANTIGRAVITY:"/brand-logos/antigravity.svg",ANYTHINGLLM:"/brand-logos/anythingllm.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",DEEPSEEK:"/brand-logos/deepseek.svg",GEMINI:"/brand-logos/gemini.svg","KILO-CLI":"/brand-logos/kilo.svg","KILO-CODE":"/brand-logos/kilo.svg",MIMO:"/brand-logos/mimo.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"},MV={ANYTHINGLLM:"brightness-0 dark:brightness-100"};function NV({size:t=16,className:e=""}){return R.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:R.jsx("circle",{cx:"12",cy:"12",r:"7.5",strokeDasharray:"3 3"})})}function OV({provider:t,size:e=16,color:n,className:a=""}){const r=t?.toUpperCase?.()||"",s=IV[r];if(s){const c=`${MV[r]||""} ${a}`.trim();return R.jsx("img",{src:s,alt:"",width:e,height:e,className:c,style:{width:e,height:e,objectFit:"contain"},"aria-hidden":!0})}const l=DV[r];return l?R.jsx(l,{size:e,className:a}):R.jsx(NV,{size:e,className:`text-oai-gray-400 dark:text-oai-gray-500 shrink-0 ${a}`})}const p4="tokentracker-skills";async function Po(t){const e=new URL(`/functions/${p4}`,window.location.origin);if(t)for(const[r,s]of Object.entries(t))s!=null&&s!==""&&e.searchParams.set(r,String(s));const n=await fetch(e.toString(),{headers:{Accept:"application/json"},cache:"no-store"}),a=await n.json().catch(()=>null);if(!n.ok)throw new Error(a?.error||`Request failed with HTTP ${n.status}`);return a}async function ys(t){const e=await eu(),n=await fetch(`/functions/${p4}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...e},cache:"no-store",body:JSON.stringify(t)}),a=await n.json().catch(()=>null);if(!n.ok||a?.ok===!1)throw new Error(a?.error||`Request failed with HTTP ${n.status}`);return a}function jV(){return Po({mode:"installed"})}function nZ(t={}){return Po({mode:"discover",...t.force?{force:1}:{}})}function aZ(t,e=0,n=20){return Po({mode:"search",q:t,offset:e,limit:n})}function rZ(){return Po({mode:"repos"})}function iZ(t,e){return ys({action:"install",skill:t,targets:e})}function sZ(t){return ys({action:"uninstall",id:t})}function oZ(t){return ys({action:"restore",id:t})}function lZ(t,e){return ys({action:"set_targets",id:t,targets:e})}function cZ(t,e){return ys({action:"import_local",directory:t,targets:e})}function dZ(t,e){return ys({action:"delete_local",directory:t,targets:e||[]})}function uZ(t){return ys({action:"add_repo",repo:t})}function hZ(t,e){return ys({action:"remove_repo",owner:t,name:e})}function pZ(t={}){return Po({mode:"popular",...t.force?{force:1}:{}})}function fZ(t={}){return Po({mode:"updates",...t.force?{force:1}:{}})}function mZ(t={}){return Po({mode:"skill_usage",...t.force?{force:1}:{}})}const zV=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function FV(){const t=$l(),e=IB(),[n,a]=k.useState(!1),[r,s]=k.useState(""),[l,c]=k.useState(0),[u,h]=k.useState([]),p=k.useRef(null),m=k.useRef(null);k.useEffect(()=>{const T=A=>{(A.metaKey||A.ctrlKey)&&(A.key==="k"||A.key==="K")&&(A.preventDefault(),a(B=>!B))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[]),k.useEffect(()=>{if(!n)return;s(""),c(0);const T=requestAnimationFrame(()=>p.current?.focus());return zV&&!u.length&&jV().then(A=>h(A?.skills||[])).catch(()=>h([])),()=>cancelAnimationFrame(T)},[n,u.length]);const v=k.useMemo(()=>{const T=u4().flatMap(D=>D.items.map(B=>({kind:"page",id:`page:${B.id}`,label:B.label,sub:we("cmdk.group.pages"),Icon:B.icon,run:()=>t(B.to)}))),A=(u||[]).map(D=>({kind:"skill",id:`skill:${D.id||D.directory}`,label:D.name||D.directory,sub:D.repoOwner&&D.repoName?`${D.repoOwner}/${D.repoName}`:we("cmdk.group.skills"),provider:(D.targets||[])[0]||"claude",run:()=>t(`/skills?skill=${encodeURIComponent(D.directory||D.id)}`)}));return[...T,...A]},[t,u]),y=k.useMemo(()=>{const T=r.trim().toLowerCase();return T?v.filter(A=>A.label.toLowerCase().includes(T)||String(A.sub||"").toLowerCase().includes(T)):v},[v,r]);k.useEffect(()=>{l>=y.length&&c(y.length?y.length-1:0)},[l,y.length]),k.useEffect(()=>{if(!n)return;m.current?.querySelector(`[data-cmdk-index="${l}"]`)?.scrollIntoView({block:"nearest"})},[l,n]);const b=k.useCallback(()=>a(!1),[]),x=k.useCallback(T=>{T&&(b(),T.run())},[b]),P=T=>{T.key==="ArrowDown"?(T.preventDefault(),c(A=>Math.min(A+1,Math.max(0,y.length-1)))):T.key==="ArrowUp"?(T.preventDefault(),c(A=>Math.max(A-1,0))):T.key==="Enter"?(T.preventDefault(),x(y[l])):T.key==="Escape"&&(T.preventDefault(),b())},E={duration:e?0:.12},L=e?{duration:0}:{type:"spring",stiffness:460,damping:34,mass:.6};return R.jsx(M5,{children:n?R.jsxs(kd.div,{className:"fixed inset-0 z-[120] flex items-start justify-center px-4 pt-[16vh]",initial:e?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:E,children:[R.jsx("button",{type:"button","aria-label":we("cmdk.close"),onClick:b,className:"absolute inset-0 cursor-default bg-oai-black/40"}),R.jsxs(kd.div,{role:"dialog","aria-modal":"true","aria-label":we("cmdk.open_aria"),initial:e?!1:{opacity:0,y:-8,scale:.985},animate:{opacity:1,y:0,scale:1},exit:e?{opacity:0}:{opacity:0,y:-8,scale:.985},transition:L,className:"relative w-full max-w-xl overflow-hidden rounded-2xl border border-oai-gray-200 bg-oai-white shadow-2xl dark:border-oai-gray-800 dark:bg-oai-gray-950",children:[R.jsxs("div",{className:"flex items-center gap-2.5 border-b border-oai-gray-200 px-4 dark:border-oai-gray-800",children:[R.jsx(kO,{className:"h-4 w-4 shrink-0 text-oai-gray-400","aria-hidden":!0}),R.jsx("input",{ref:p,type:"text",value:r,onChange:T=>{s(T.target.value),c(0)},onKeyDown:P,"aria-label":we("cmdk.placeholder"),"aria-controls":"cmdk-listbox","aria-activedescendant":y[l]?`cmdk-opt-${l}`:void 0,role:"combobox","aria-expanded":"true",placeholder:we("cmdk.placeholder"),className:"h-12 w-full bg-transparent text-sm text-oai-black placeholder:text-oai-gray-400 focus:outline-none dark:text-white"})]}),R.jsx("div",{ref:m,id:"cmdk-listbox",role:"listbox",className:"max-h-[min(56vh,22rem)] overflow-y-auto p-1.5",children:y.length===0?R.jsx("div",{className:"px-3 py-8 text-center text-sm text-oai-gray-500 dark:text-oai-gray-400",children:we("cmdk.empty")}):y.map((T,A)=>{const D=A===l;return R.jsxs("button",{type:"button",role:"option",id:`cmdk-opt-${A}`,"data-cmdk-index":A,"aria-selected":D,onMouseMove:()=>c(A),onClick:()=>x(T),className:$t("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition-colors",D?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800/70 dark:text-white":"text-oai-gray-700 dark:text-oai-gray-200"),children:[R.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center text-oai-gray-500 dark:text-oai-gray-400",children:T.kind==="skill"?R.jsx(OV,{provider:T.provider,size:16}):R.jsx(T.Icon,{className:"h-4 w-4","aria-hidden":!0})}),R.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:T.label}),R.jsx("span",{className:"shrink-0 truncate text-xs text-oai-gray-400 dark:text-oai-gray-500",children:T.sub}),D?R.jsx(eO,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-400","aria-hidden":!0}):null]},T.id)})})]})]}):null})}const UV=[];function ob(t){k.useEffect(t,UV)}const uP={};function Ql(t,e){const n=k.useRef(uP);return n.current===uP&&(n.current=t(e)),n}const BV=()=>{},Ka=typeof document<"u"?k.useLayoutEffect:BV;function $V(t,e){return function(a,...r){const s=new URL(t);return s.searchParams.set("code",a.toString()),r.forEach(l=>s.searchParams.append("args[]",l)),`${e} error #${a}; visit ${s} for the full message.`}}const Xl=$V("https://base-ui.com/production-error","Base UI"),lb=k.createContext(void 0);function cb(){const t=k.useContext(lb);if(!t)throw new Error(Xl(73));return t}const fr=(t,e,n,a,r,s,...l)=>{if(l.length>0)throw new Error(Xl(1));let c;if(t&&e&&n&&a&&r&&s)c=(u,h,p,m)=>{const v=t(u,h,p,m),y=e(u,h,p,m),b=n(u,h,p,m),x=a(u,h,p,m),P=r(u,h,p,m);return s(v,y,b,x,P,h,p,m)};else if(t&&e&&n&&a&&r)c=(u,h,p,m)=>{const v=t(u,h,p,m),y=e(u,h,p,m),b=n(u,h,p,m),x=a(u,h,p,m);return r(v,y,b,x,h,p,m)};else if(t&&e&&n&&a)c=(u,h,p,m)=>{const v=t(u,h,p,m),y=e(u,h,p,m),b=n(u,h,p,m);return a(v,y,b,h,p,m)};else if(t&&e&&n)c=(u,h,p,m)=>{const v=t(u,h,p,m),y=e(u,h,p,m);return n(v,y,h,p,m)};else if(t&&e)c=(u,h,p,m)=>{const v=t(u,h,p,m);return e(v,h,p,m)};else if(t)c=t;else throw new Error("Missing arguments");return c};var uv={exports:{}},hv={};var hP;function VV(){if(hP)return hv;hP=1;var t=Kd();function e(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:e,a=t.useState,r=t.useEffect,s=t.useLayoutEffect,l=t.useDebugValue;function c(m,v){var y=v(),b=a({inst:{value:y,getSnapshot:v}}),x=b[0].inst,P=b[1];return s(function(){x.value=y,x.getSnapshot=v,u(x)&&P({inst:x})},[m,y,v]),r(function(){return u(x)&&P({inst:x}),m(function(){u(x)&&P({inst:x})})},[m]),l(y),y}function u(m){var v=m.getSnapshot;m=m.value;try{var y=v();return!n(m,y)}catch{return!0}}function h(m,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return hv.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p,hv}var pP;function f4(){return pP||(pP=1,uv.exports=VV()),uv.exports}var HV=f4(),pv={exports:{}},fv={};var fP;function WV(){if(fP)return fv;fP=1;var t=Kd(),e=f4();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var a=typeof Object.is=="function"?Object.is:n,r=e.useSyncExternalStore,s=t.useRef,l=t.useEffect,c=t.useMemo,u=t.useDebugValue;return fv.useSyncExternalStoreWithSelector=function(h,p,m,v,y){var b=s(null);if(b.current===null){var x={hasValue:!1,value:null};b.current=x}else x=b.current;b=c(function(){function E(B){if(!L){if(L=!0,T=B,B=v(B),y!==void 0&&x.hasValue){var j=x.value;if(y(j,B))return A=j}return A=B}if(j=A,a(T,B))return j;var S=v(B);return y!==void 0&&y(j,S)?(T=B,j):(T=B,A=S)}var L=!1,T,A,D=m===void 0?null:m;return[function(){return E(p())},D===null?void 0:function(){return E(D())}]},[p,m,v,y]);var P=r(h,b[0],b[1]);return l(function(){x.hasValue=!0,x.value=P},[P]),u(P),P},fv}var mP;function GV(){return mP||(mP=1,pv.exports=WV()),pv.exports}var qV=GV();const KV=parseInt(k.version,10);function db(t){return KV>=t}const YV=db(19),ZV=YV?QV:XV;function m4(t,e,n,a,r){return ZV(t,e,n,a,r)}function JV(t,e,n,a,r){const s=k.useCallback(()=>e(t.getSnapshot(),n,a,r),[t,e,n,a,r]);return HV.useSyncExternalStore(t.subscribe,s,s)}function QV(t,e,n,a,r){return JV(t,e,n,a,r)}function XV(t,e,n,a,r){return qV.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,s=>e(s,n,a,r))}class eH{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const a of this.listeners){if(n!==this.updateTick)return;a(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){this.setState({...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||this.setState({...this.state,[e]:n})}notifyAll(){const e={...this.state};this.setState(e)}use(e,n,a,r){return m4(this,e,n,a,r)}}const ub={...US},mv=ub.useInsertionEffect,tH=mv&&mv!==ub.useLayoutEffect?mv:t=>t();function vo(t){const e=Ql(nH).current;return e.next=t,tH(e.effect),e.trampoline}function nH(){const t={next:void 0,callback:aH,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function aH(){}function rH(){}const gZ=Object.freeze([]),eo=Object.freeze({});class iH extends eH{constructor(e,n={},a){super(e),this.context=n,this.selectors=a}useSyncedValue(e,n){k.useDebugValue(e);const a=this;Ka(()=>{a.state[e]!==n&&a.set(e,n)},[a,e,n])}useSyncedValueWithCleanup(e,n){const a=this;Ka(()=>(a.state[e]!==n&&a.set(e,n),()=>{a.set(e,void 0)}),[a,e,n])}useSyncedValues(e){const n=this,a=Object.values(e);Ka(()=>{n.update(e)},[n,...a])}useControlledProp(e,n){k.useDebugValue(e);const a=this,r=n!==void 0;Ka(()=>{r&&!Object.is(a.state[e],n)&&a.setState({...a.state,[e]:n})},[a,e,n,r])}select(e,n,a,r){const s=this.selectors[e];return s(this.state,n,a,r)}useState(e,n,a,r){return k.useDebugValue(e),m4(this,this.selectors[e],n,a,r)}useContextCallback(e,n){k.useDebugValue(e);const a=vo(n??rH);this.context[e]=a}useStateSetter(e){const n=k.useRef(void 0);return n.current===void 0&&(n.current=a=>{this.set(e,a)}),n.current}observe(e,n){let a;typeof e=="function"?a=e:a=this.selectors[e];let r=a(this.state);return n(r,r,this),this.subscribe(s=>{const l=a(s);if(!Object.is(r,l)){const c=r;r=l,n(l,c,this)}})}}function Vf(){return typeof window<"u"}function wr(t){return hb(t)?(t.nodeName||"").toLowerCase():"#document"}function Ei(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function sH(t){var e;return(e=(hb(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function hb(t){return Vf()?t instanceof Node||t instanceof Ei(t).Node:!1}function pb(t){return Vf()?t instanceof Element||t instanceof Ei(t).Element:!1}function fs(t){return Vf()?t instanceof HTMLElement||t instanceof Ei(t).HTMLElement:!1}function Jp(t){return!Vf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ei(t).ShadowRoot}function g4(t){const{overflow:e,overflowX:n,overflowY:a,display:r}=Hf(t);return/auto|scroll|overlay|hidden|clip/.test(e+a+n)&&r!=="inline"&&r!=="contents"}function vZ(t){return/^(table|td|th)$/.test(wr(t))}function oH(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const lH=/transform|translate|scale|rotate|perspective|filter/,cH=/paint|layout|strict|content/,js=t=>!!t&&t!=="none";let gv;function dH(t){const e=pb(t)?Hf(t):t;return js(e.transform)||js(e.translate)||js(e.scale)||js(e.rotate)||js(e.perspective)||!uH()&&(js(e.backdropFilter)||js(e.filter))||lH.test(e.willChange||"")||cH.test(e.contain||"")}function _Z(t){let e=Z_(t);for(;fs(e)&&!v4(e);){if(dH(e))return e;if(oH(e))return null;e=Z_(e)}return null}function uH(){return gv==null&&(gv=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gv}function v4(t){return/^(html|body|#document)$/.test(wr(t))}function Hf(t){return Ei(t).getComputedStyle(t)}function yZ(t){return pb(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Z_(t){if(wr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Jp(t)&&t.host||sH(t);return Jp(e)?e.host:e}function _4(t){const e=Z_(t);return v4(e)?t.ownerDocument?t.ownerDocument.body:t.body:fs(e)&&g4(e)?e:_4(e)}function gP(t,e,n){var a;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=_4(t),s=r===((a=t.ownerDocument)==null?void 0:a.body),l=Ei(r);if(s){const c=hH(l);return e.concat(l,l.visualViewport||[],g4(r)?r:[],c&&n?gP(c):[])}else return e.concat(r,gP(r,[],n))}function hH(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function y4(...t){return()=>{for(let e=0;e<t.length;e+=1){const n=t[e];n&&n()}}}function br(t){return t?.ownerDocument||document}function to(t,e,n,a){return t.addEventListener(e,n,a),()=>{t.removeEventListener(e,n,a)}}const Ah=null;class pH{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,a=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,a>0)for(let r=0;r<n.length;r+=1)n[r]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Rh=new pH;class fb{static create(){return new fb}static request(e){return Rh.request(e)}static cancel(e){return Rh.cancel(e)}currentId=Ah;request(e){this.cancel(),this.currentId=Rh.request(()=>{this.currentId=Ah,e()})}cancel=()=>{this.currentId!==Ah&&(Rh.cancel(this.currentId),this.currentId=Ah)};disposeEffect=()=>this.cancel}function fH(){const t=Ql(fb.create).current;return ob(t.disposeEffect),t}const Vc=0;class Fd{static create(){return new Fd}currentId=Vc;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Vc,n()},e)}isStarted(){return this.currentId!==Vc}clear=()=>{this.currentId!==Vc&&(clearTimeout(this.currentId),this.currentId=Vc)};disposeEffect=()=>this.clear}function mH(){const t=Ql(Fd.create).current;return ob(t.disposeEffect),t}let vP=0;function b4(t){return vP+=1,`${t}-${Math.random().toString(36).slice(2,6)}-${vP}`}function vv(t,e){if(typeof t=="string")return{description:t};if(typeof t=="function"){const n=t(e);return typeof n=="string"?{description:n}:n}return t}function gH(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:vH,platform:_H,maxTouchPoints:yH}=gH(),Wf=vH.toLowerCase(),Ud=_H.toLowerCase(),k4=/^i(os$|p)/.test(Ud)||Ud==="macintel"&&yH>1,_P="android",bZ=Ud===_P||Wf.includes(_P),bH=!k4&&Ud.startsWith("mac");Ud.startsWith("win");const kH=bH||k4,mb=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!mb&&Wf.includes("firefox");!mb&&Wf.includes("chrom");const wH=kH,xH=/jsdom|happydom/.test(Wf),yP="data-base-ui-focusable",w4="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",kZ="ArrowLeft",wZ="ArrowRight",xZ="ArrowUp",PZ="ArrowDown";function Pl(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Ai(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&Jp(n)){let a=e;for(;a;){if(t===a)return!0;a=a.parentNode||a.host}}return!1}function no(t){return"composedPath"in t?t.composedPath()[0]:t.target}function SZ(t,e){if(!pb(t))return!1;const n=t;if(e.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,a]of e.entries())if(Ai(a,n))return!a.hasAttribute("data-trigger-disabled");return!1}function CZ(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function TZ(t){return t.matches("html,body")}function PH(t){return fs(t)&&t.matches(w4)}function EZ(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${w4}`)!=null}function AZ(t){return t?t.getAttribute("role")==="combobox"&&PH(t):!1}function J_(t){if(!t||xH)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function RZ(t){return t?t.hasAttribute(yP)?t:t.querySelector(`[${yP}]`)||t:null}function LZ(t,e){return e<0||e>=t.length}function DZ(t,e){return x4(t.current,{disabledIndices:e})}function IZ(t,e){return x4(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function x4(t,{startingIndex:e=-1,decrement:n=!1,disabledIndices:a,amount:r=1}={}){let s=e;do s+=n?-r:r;while(s>=0&&s<=t.length-1&&SH(t,s,a));return s}function SH(t,e,n){if(typeof n=="function"?n(e):n?.includes(e)??!1)return!0;const r=t[e];return r?P4(r)?!n&&(r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"):!0:!1}function CH(t){return t.visibility==="hidden"||t.visibility==="collapse"}function P4(t,e=t?Hf(t):null){return!t||!t.isConnected||!e||CH(e)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():e.display!=="none"&&e.display!=="contents"}const TH='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function EH(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const n=t.getRootNode();return Jp(n)?n.host:null}function Q_(t){for(const e of Array.from(t.children))if(wr(e)==="summary")return e;return null}function AH(t,e){const n=Q_(e);return!!n&&(t===n||Ai(n,t))}function S4(t){const e=t?wr(t):"";return t!=null&&t.matches(TH)&&(e!=="summary"||t.parentElement!=null&&wr(t.parentElement)==="details"&&Q_(t.parentElement)===t)&&(e!=="details"||Q_(t)==null)&&(e!=="input"||t.type!=="hidden")}function C4(t){if(!S4(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=EH(e)){const n=e!==t,a=wr(e)==="slot";if(e.hasAttribute("inert")||n&&wr(e)==="details"&&!e.open&&!AH(t,e)||e.hasAttribute("hidden")||!a&&!RH(e,n))return!1}return!0}function RH(t,e){const n=Hf(t);return e?n.display!=="none":P4(t,n)}function T4(t){const e=t.tabIndex;if(e<0){const n=wr(t);if(n==="details"||n==="audio"||n==="video"||fs(t)&&t.isContentEditable)return 0}return e}function _v(t){if(wr(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function LH(t,e){const n=_v(t);if(!n)return!0;const a=e.find(r=>{const s=_v(r);return s?.name===n.name&&s.form===n.form&&s.checked});return a?a===n:e.find(r=>{const s=_v(r);return s?.name===n.name&&s.form===n.form})===n}function E4(t){if(fs(t)&&wr(t)==="slot"){const e=t.assignedElements({flatten:!0});if(e.length>0)return e}return fs(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function A4(t,e){E4(t).forEach(n=>{S4(n)&&e.push(n),A4(n,e)})}function R4(t,e,n){E4(t).forEach(a=>{fs(a)&&a.matches(e)&&n.push(a),R4(a,e,n)})}function MZ(t){return C4(t)&&T4(t)>=0}function DH(t){const e=[];return A4(t,e),e.filter(C4)}function gb(t){const e=DH(t);return e.filter(n=>T4(n)>=0&&LH(n,e))}function L4(t,e){const n=gb(t),a=n.length;if(a===0)return;const r=Pl(br(t)),s=n.indexOf(r),l=s===-1?e===1?0:a-1:s+e;return n[l]}function IH(t){return L4(br(t).body,1)||t}function MH(t){return L4(br(t).body,-1)||t}function D4(t,e){if(!t)return null;const n=gb(br(t).body),a=n.length;if(a===0)return null;const r=n.indexOf(t);if(r===-1)return null;const s=(r+e+a)%a;return n[s]}function NZ(t){return D4(t,1)}function OZ(t){return D4(t,-1)}function yv(t,e){const n=e||t.currentTarget,a=t.relatedTarget;return!a||!Ai(n,a)}function NH(t){gb(t).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function bP(t){const e=[];R4(t,"[data-tabindex]",e),e.forEach(n=>{const a=n.dataset.tabindex;delete n.dataset.tabindex,a?n.setAttribute("tabindex",a):n.removeAttribute("tabindex")})}function Lh(t){const e=new Map;let n=0,a=0;return t.forEach((r,s)=>{const l=r.transitionStatus==="ending";e.set(r.id,{value:r,domIndex:s,visibleIndex:l?-1:n,offsetY:a}),a+=r.height||0,l||(n+=1)}),e}function bv(t,e){let n=0;return t.map(a=>{if(a.transitionStatus==="ending")return a;const r=n>=e;return n+=1,a.limited===r?a:{...a,limited:r}})}const Dh=t=>t.toastMetadata,Ir={toasts:fr(t=>t.toasts),isEmpty:fr(t=>t.toasts.length===0),toast:fr(Dh,(t,e)=>t.get(e)?.value),toastIndex:fr(Dh,(t,e)=>t.get(e)?.domIndex??-1),toastOffsetY:fr(Dh,(t,e)=>t.get(e)?.offsetY??0),toastVisibleIndex:fr(Dh,(t,e)=>t.get(e)?.visibleIndex??-1),hovering:fr(t=>t.hovering),focused:fr(t=>t.focused),expanded:fr(t=>t.hovering||t.focused),expandedOrOutOfFocus:fr(t=>t.hovering||t.focused||!t.isWindowFocused),prevFocusElement:fr(t=>t.prevFocusElement)};class OH extends iH{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:Lh(e.toasts)},{},Ir)}setFocused(e){this.set("focused",e)}setHovering(e){this.set("hovering",e)}setIsWindowFocused(e){this.set("isWindowFocused",e)}setPrevFocusElement(e){this.set("prevFocusElement",e)}setViewport=e=>{this.set("viewport",e)};syncProviderProps(e){const n=this.state.limit!==e.limit;if(this.state.timeout===e.timeout&&!n)return;const a={timeout:e.timeout,limit:e.limit};if(n){const r=bv(this.state.toasts,e.limit);a.toasts=r,a.toastMetadata=Lh(r)}this.update(a)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,n={}){const a=Ir.toastIndex(this.state,e);if(a===-1)return;const r=this.state.toasts[a];n.skipOnRemove||r?.onRemove?.();const s=[...this.state.toasts];s.splice(a,1),this.setToasts(s)}addToast=e=>{const{timeout:n,limit:a}=this.state,r=e.id||b4("toast");if(e.id){const u=Ir.toast(this.state,e.id);if(u)if(u.transitionStatus==="ending")this.removeToast(e.id,{skipOnRemove:!0});else{const{id:h,transitionStatus:p,...m}=e;return this.updateToastInternal(e.id,m,{resetTimer:!0,markUpdated:!0}),e.id}}const s={...e,id:r,updateKey:0,transitionStatus:"starting"},l=[s,...this.state.toasts];this.setToasts(bv(l,a));const c=s.timeout??n;return s.type!=="loading"&&c>0&&this.scheduleTimer(r,c,()=>this.closeToast(r)),Ir.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,n)=>{this.updateToastInternal(e,n,{markUpdated:!0})};updateToastInternal=(e,n,a={})=>{const{timeout:r,toasts:s}=this.state,l=Ir.toast(this.state,e)??null;if(!l||l.transitionStatus==="ending")return;const c={...l,...n,...a.markUpdated&&{updateKey:(l.updateKey??0)+1}};this.setToasts(s.map(x=>x.id===e?c:x));const u=c.timeout??r,h=l?.timeout??r,p=Object.hasOwn(n,"timeout"),m=c.transitionStatus!=="ending"&&c.type!=="loading"&&u>0,v=this.timers.has(e),y=h!==u,b=l?.type==="loading";if(!m&&v){this.clearTimer(e);return}m&&(!v||y||p||b||a.resetTimer)&&(this.clearTimer(e),this.scheduleTimer(e,u,()=>this.closeToast(e)),Ir.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{const n=e===void 0,{limit:a,toasts:r}=this.state;let s;if(n)s=r,this.clearTimers();else{const p=Ir.toast(this.state,e);if(!p)return;s=[p],this.clearTimer(e)}const l=r.map(p=>n||p.id===e?{...p,transitionStatus:"ending",height:0}:p),c=bv(l,a),u={toasts:c,toastMetadata:Lh(c)};c.some(p=>p.transitionStatus!=="ending")||(u.hovering=!1,u.focused=!1),this.update(u),s.forEach(p=>{p.transitionStatus!=="ending"&&p.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,n)=>{const a=vv(n.loading),r=this.addToast({...a,type:"loading"}),s=e.then(l=>{const c=vv(n.success,l);return this.updateToast(r,{...c,type:"success",timeout:c.timeout}),l}).catch(l=>{const c=vv(n.error,l);return this.updateToast(r,{...c,type:"error",timeout:c.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(s),s};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{if(e.timeout){e.timeout.clear();const n=Date.now()-e.start,a=e.delay-n;e.remaining=a>0?a:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,n)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=Fd.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(n),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!=="touch")return;const n=no(e);Ai(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,n,a){const r=Date.now(),s=!Ir.expandedOrOutOfFocus(this.state),l=s?Fd.create():void 0;l?.start(n,()=>{this.handleTimerFired(e),a()}),this.timers.set(e,{timeout:l,start:s?r:0,delay:n,remaining:n,callback:a})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e){const n={toasts:e,toastMetadata:Lh(e)};e.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){const n=Pl(br(this.state.viewport));if(!this.state.viewport||!Ai(this.state.viewport,n)||!J_(n))return;if(e===void 0){this.restoreFocusToPrevElement();return}const a=Ir.toasts(this.state),r=Ir.toastIndex(this.state,e);let s=null,l=r+1;for(;l<a.length;){if(a[l].transitionStatus!=="ending"){s=a[l];break}l+=1}if(!s)for(l=r-1;l>=0;){if(a[l].transitionStatus!=="ending"){s=a[l];break}l-=1}s?s.ref?.current?.focus():this.restoreFocusToPrevElement()}}const jH=function(e){const{children:n,timeout:a=5e3,limit:r=3,toastManager:s}=e,l=Ql(()=>new OH({timeout:a,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return ob(l.disposeEffect),k.useEffect(function(){return s?s[" subscribe"](({action:h,options:p})=>{const m=p.id;h==="promise"&&p.promise?l.promiseToast(p.promise,p):h==="update"&&m?l.updateToast(m,p):h==="close"?l.closeToast(m):l.addToast(p)}):void 0},[l,s]),Ka(()=>{l.syncProviderProps({timeout:a,limit:r})},[l,a,r]),R.jsx(lb.Provider,{value:l,children:n})},I4={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},M4={...I4,position:"fixed",top:0,left:0},jZ={...I4,position:"absolute"},wd=k.forwardRef(function(e,n){const[a,r]=k.useState();Ka(()=>{wH&&mb&&r("button")},[]);const s={tabIndex:0,role:a};return R.jsx("span",{...e,ref:n,style:M4,"aria-hidden":a?void 0:!0,...s,"data-base-ui-focus-guard":""})});function kP(t,e,n,a){const r=Ql(N4).current;return FH(r,t,e,n,a)&&O4(r,[t,e,n,a]),r.callback}function zH(t){const e=Ql(N4).current;return UH(e,t)&&O4(e,t),e.callback}function N4(){return{callback:null,cleanup:null,refs:[]}}function FH(t,e,n,a,r){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==a||t.refs[3]!==r}function UH(t,e){return t.refs.length!==e.length||t.refs.some((n,a)=>n!==e[a])}function O4(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const a=Array(e.length).fill(null);for(let r=0;r<e.length;r+=1){const s=e[r];if(s!=null)switch(typeof s){case"function":{const l=s(n);typeof l=="function"&&(a[r]=l);break}case"object":{s.current=n;break}}}t.cleanup=()=>{for(let r=0;r<e.length;r+=1){const s=e[r];if(s!=null)switch(typeof s){case"function":{const l=a[r];typeof l=="function"?l():s(null);break}case"object":{s.current=null;break}}}}}}}function wP(t){if(!k.isValidElement(t))return null;const e=t,n=e.props;return(db(19)?n?.ref:e.ref)??null}function X_(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function BH(t,e){const n={};for(const a in t){const r=t[a];if(e?.hasOwnProperty(a)){const s=e[a](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${a.toLowerCase()}`]="":r&&(n[`data-${a.toLowerCase()}`]=r.toString())}return n}function $H(t,e){return typeof t=="function"?t(e):t}function VH(t,e){return typeof t=="function"?t(e):t}const vb={};function _b(t,e,n,a,r){if(!n&&!a&&!r&&!t)return Qp(e);let s=Qp(t);return e&&(s=sd(s,e)),n&&(s=sd(s,n)),a&&(s=sd(s,a)),r&&(s=sd(s,r)),s}function HH(t){if(t.length===0)return vb;if(t.length===1)return Qp(t[0]);let e=Qp(t[0]);for(let n=1;n<t.length;n+=1)e=sd(e,t[n]);return e}function Qp(t){return yb(t)?{...z4(t,vb)}:WH(t)}function sd(t,e){return yb(e)?z4(e,t):GH(t,e)}function WH(t){const e={...t};for(const n in e){const a=e[n];j4(n,a)&&(e[n]=F4(a))}return e}function GH(t,e){if(!e)return t;for(const n in e){const a=e[n];switch(n){case"style":{t[n]=X_(t.style,a);break}case"className":{t[n]=U4(t.className,a);break}default:j4(n,a)?t[n]=qH(t[n],a):t[n]=a}}return t}function j4(t,e){const n=t.charCodeAt(0),a=t.charCodeAt(1),r=t.charCodeAt(2);return n===111&&a===110&&r>=65&&r<=90&&(typeof e=="function"||typeof e>"u")}function yb(t){return typeof t=="function"}function z4(t,e){return yb(t)?t(e):t??vb}function qH(t,e){return e?t?(...n)=>{const a=n[0];if(B4(a)){const s=a;Xp(s);const l=e(...n);return s.baseUIHandlerPrevented||t?.(...n),l}const r=e(...n);return t?.(...n),r}:F4(e):t}function F4(t){return t&&((...e)=>{const n=e[0];return B4(n)&&Xp(n),t(...e)})}function Xp(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function U4(t,e){return e?t?e+" "+t:e:t}function B4(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function ou(t,e,n={}){const a=e.render,r=KH(e,n);if(n.enabled===!1)return null;const s=n.state??eo;return JH(t,a,r,s)}function KH(t,e={}){const{className:n,style:a,render:r}=t,{state:s=eo,ref:l,props:c,stateAttributesMapping:u,enabled:h=!0}=e,p=h?$H(n,s):void 0,m=h?VH(a,s):void 0,v=h?BH(s,u):eo,y=h&&c?YH(c):void 0,b=h?X_(v,y)??{}:eo;return typeof document<"u"&&(h?Array.isArray(l)?b.ref=zH([b.ref,wP(r),...l]):b.ref=kP(b.ref,wP(r),l):kP(null,null)),h?(p!==void 0&&(b.className=U4(b.className,p)),m!==void 0&&(b.style=X_(b.style,m)),b):eo}function YH(t){return Array.isArray(t)?HH(t):_b(void 0,t)}const ZH=Symbol.for("react.lazy");function JH(t,e,n,a){if(e){if(typeof e=="function")return e(n,a);const r=_b(n,e.props);r.ref=n.ref;let s=e;return s?.$$typeof===ZH&&(s=k.Children.toArray(e)[0]),k.cloneElement(s,r)}if(t&&typeof t=="string")return QH(t,n);throw new Error(Xl(8))}function QH(t,e){return t==="button"?k.createElement("button",{type:"button",...e,key:e.key}):t==="img"?k.createElement("img",{alt:"",...e,key:e.key}):k.createElement(t,e)}let XH=(function(t){return t.frontmostHeight="--toast-frontmost-height",t})({});const eW=k.forwardRef(function(e,n){const{render:a,className:r,style:s,children:l,...c}=e,u=cb(),h=mH(),p=k.useRef(!1),m=k.useRef(!1),v=k.useRef(!1),y=u.useState("isEmpty"),b=u.useState("toasts"),x=u.useState("focused"),P=u.useState("expanded"),E=u.useState("prevFocusElement"),L=b[0]?.height??0,T=k.useMemo(()=>b.some($=>$.transitionStatus==="ending"),[b]),A=k.useMemo(()=>b.filter($=>$.priority==="high"),[b]);k.useEffect(()=>{const $=u.state.viewport;if(!$)return;function X(O){y||O.key==="F6"&&no(O)!==$&&(O.preventDefault(),u.setPrevFocusElement(Pl(br($))),$?.focus({preventScroll:!0}),u.pauseTimers(),u.setFocused(!0))}const W=Ei($);return to(W,"keydown",X)},[u,y]),k.useEffect(()=>{const $=u.state.viewport;if(!$||y)return;const X=Ei($);function W(Y){no(Y)===X&&(u.setIsWindowFocused(!1),u.pauseTimers())}function O(Y){if(Y.relatedTarget)return;const ae=no(Y),_e=Pl(br($));(ae===X||!Ai($,ae)||!J_(_e))&&u.resumeTimers(),h.start(0,()=>u.setIsWindowFocused(!0))}return y4(to(X,"blur",W,!0),to(X,"focus",O,!0))},[u,h,y]),k.useEffect(()=>{const $=u.state.viewport;if(!$||y)return;const X=br($);return to(X,"pointerdown",u.handleDocumentPointerDown,!0)},[y,u]);function D($){const X=u.state.viewport;if(X)if(p.current=!0,$.relatedTarget===X){const W=b.find(O=>O.transitionStatus!=="ending"&&!O.limited);W?W.ref?.current?.focus():u.restoreFocusToPrevElement()}else u.restoreFocusToPrevElement()}function B($){$.key==="Tab"&&$.shiftKey&&no($.nativeEvent)===u.state.viewport&&($.preventDefault(),u.restoreFocusToPrevElement(),u.resumeTimers())}function j(){u.state.toasts.some(X=>X.transitionStatus==="ending")||v.current||!m.current||(u.state.isWindowFocused&&u.resumeTimers(),u.setHovering(!1),m.current=!1)}k.useEffect(j,[T,u]);function S(){u.pauseTimers(),u.setHovering(!0),m.current=!1}function N(){u.state.isWindowFocused&&u.resumeTimers()}function U(){u.state.toasts.some(X=>X.transitionStatus==="ending")||v.current?m.current=!0:(N(),u.setHovering(!1))}function Q($){$.pointerType==="touch"&&(v.current=!0)}function ee($){$.pointerType==="touch"&&(v.current=!1,j())}function ce(){if(p.current){p.current=!1;return}x||J_(Pl(br(u.state.viewport)))&&(u.setFocused(!0),u.pauseTimers())}function le($){!x||Ai(u.state.viewport,$.relatedTarget)||(u.setFocused(!1),N())}const re={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:S,onMouseMove:S,onMouseLeave:U,onFocus:ce,onBlur:le,onKeyDown:B,onClick:ce,onPointerDown:Q,onPointerUp:ee,onPointerCancel:ee},te={expanded:P},ie=ou("div",e,{ref:[n,u.setViewport],state:te,props:[re,{style:{[XH.frontmostHeight]:L?`${L}px`:void 0}},c,{children:R.jsxs(k.Fragment,{children:[!y&&E&&R.jsx(wd,{onFocus:D}),l,!y&&E&&R.jsx(wd,{onFocus:D})]})}]});return R.jsxs(k.Fragment,{children:[!y&&E&&R.jsx(wd,{onFocus:D}),ie,!x&&A.length>0&&R.jsx("div",{style:M4,children:A.map($=>R.jsxs("div",{role:"alert","aria-atomic":!0,children:[R.jsx("div",{children:$.title}),R.jsx("div",{children:$.description})]},$.id))})]})});function tW(t){return db(19)?t:t?"true":void 0}const $4=k.createContext(void 0);function V4(){const t=k.useContext($4);if(!t)throw new Error(Xl(66));return t}let bb=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const nW={[bb.startingStyle]:""},aW={[bb.endingStyle]:""},rW={transitionStatus(t){return t==="starting"?nW:t==="ending"?aW:null}};function iW(t){return t==null?t:"current"in t?t.current:t}function sW(t,e=!1,n=!0){const a=fH();return vo((r,s=null)=>{a.cancel();const l=iW(t);if(l==null)return;const c=l,u=()=>{Vl.flushSync(r)};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function h(){Promise.all(c.getAnimations().map(p=>p.finished)).then(()=>{s?.aborted||u()}).catch(()=>{if(n){s?.aborted||u();return}const p=c.getAnimations();!s?.aborted&&p.length>0&&p.some(m=>m.pending||m.playState!=="finished")&&h()})}if(e){const p=bb.startingStyle;if(!c.hasAttribute(p)){a.request(h);return}const m=new MutationObserver(()=>{c.hasAttribute(p)||(m.disconnect(),h())});m.observe(c,{attributes:!0,attributeFilter:[p]}),s?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}a.request(h)})}function oW(t){const{enabled:e=!0,open:n,ref:a,onComplete:r}=t,s=vo(r),l=sW(a,n,!1);k.useEffect(()=>{if(!e)return;const c=new AbortController;return l(s,c.signal),()=>{c.abort()}},[e,n,s,l])}let zs=(function(t){return t.index="--toast-index",t.offsetY="--toast-offset-y",t.height="--toast-height",t.swipeMovementX="--toast-swipe-movement-x",t.swipeMovementY="--toast-swipe-movement-y",t})({});const zZ=500,FZ={style:{transition:"none"}},UZ="data-base-ui-click-trigger",lW="data-base-ui-swipe-ignore",cW="data-swipe-ignore",dW=`[${lW}]`,uW=`[${cW}]`,BZ={fallbackAxisSide:"none"},$Z={fallbackAxisSide:"end"},hW={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function xP(t,e,n){switch(t){case"up":return-n;case"down":return n;case"left":return-e;case"right":return e;default:return 0}}function pW(t){const n=Ei(t).getComputedStyle(t).transform;let a=0,r=0,s=1;if(n&&n!=="none"){const l=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(l){const c=l[1].split(", ").map(parseFloat);c.length===6?(a=c[4],r=c[5],s=Math.sqrt(c[0]*c[0]+c[1]*c[1])):c.length===16&&(a=c[12],r=c[13],s=c[0])}}return{x:a,y:r,scale:s}}const fW={...rW,swipeDirection(t){return t?{"data-swipe-direction":t}:null}},Hc=40,mW=10,ns=.5,gW=1,vW=`${dW},${uW}`,_W=k.forwardRef(function(e,n){const{toast:a,render:r,className:s,swipeDirection:l=["down","right"],style:c,...u}=e,h=a.positionerProps?.anchor!==void 0;let p=[];h||(p=Array.isArray(l)?l:[l]);const m=p.length>0,v=cb(),[y,b]=k.useState(void 0),[x,P]=k.useState(!1),[E,L]=k.useState(!1),[T,A]=k.useState(!1),[D,B]=k.useState({x:0,y:0}),[j,S]=k.useState({x:0,y:0,scale:1}),[N,U]=k.useState(),[Q,ee]=k.useState(),[ce,le]=k.useState(null),re=k.useRef(null),te=k.useRef({x:0,y:0}),ie=k.useRef({x:0,y:0,scale:1}),$=k.useRef(void 0),X=k.useRef(0),W=k.useRef(!1),O=k.useRef({x:0,y:0}),Y=k.useRef(!1),ae=k.useRef({x:0,y:0}),_e=k.useRef(null),fe=k.useRef(null),ve=v.useState("toastIndex",a.id),Ne=v.useState("toastVisibleIndex",a.id),Oe=v.useState("toastOffsetY",a.id),Ie=v.useState("focused"),St=v.useState("expanded");oW({open:a.transitionStatus!=="ending",ref:re,onComplete(){a.transitionStatus==="ending"&&v.removeToast(a.id)}});const un=vo((tt=!1)=>{const et=re.current;if(!et)return;const kt=et.style.height;et.style.height="auto";const an=et.offsetHeight;et.style.height=kt;function zt(){v.updateToastInternal(a.id,{ref:re,height:an,...a.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}tt?Vl.flushSync(zt):zt()});Ka(un,[un]);function jt(tt){ae.current=tt,B(tt)}Ka(()=>()=>{fe.current?.abort()},[]);function _t(tt,et){let kt=tt,an=et;return!p.includes("left")&&!p.includes("right")?kt=tt>0?tt**ns:-(Math.abs(tt)**ns):(!p.includes("right")&&tt>0&&(kt=tt**ns),!p.includes("left")&&tt<0&&(kt=-(Math.abs(tt)**ns))),!p.includes("up")&&!p.includes("down")?an=et>0?et**ns:-(Math.abs(et)**ns):(!p.includes("down")&&et>0&&(an=et**ns),!p.includes("up")&&et<0&&(an=-(Math.abs(et)**ns))),{x:kt,y:an}}const Jt=vo(tt=>{if(tt.pointerId!==_e.current)return;_e.current=null,fe.current?.abort(),fe.current=null,P(!1),L(!1),le(null);const et=ie.current;if(tt.type==="pointercancel"||W.current){jt({x:et.x,y:et.y}),b(void 0);return}let kt=!1;const an=ae.current,zt=an.x-et.x,At=an.y-et.y;let xt;for(const ar of p){switch(ar){case"right":zt>Hc&&(kt=!0,xt="right");break;case"left":zt<-Hc&&(kt=!0,xt="left");break;case"down":At>Hc&&(kt=!0,xt="down");break;case"up":At<-Hc&&(kt=!0,xt="up");break}if(kt)break}kt?(b(xt),A(!0),v.closeToast(a.id)):(jt({x:et.x,y:et.y}),b(void 0))});function nr(tt){if(tt.button!==0)return;tt.pointerType==="touch"&&v.pauseTimers();const et=no(tt.nativeEvent);if(et?et.closest(`button,a,input,textarea,[role="button"],${vW}`):!1)return;if(W.current=!1,$.current=void 0,X.current=0,_e.current=tt.pointerId,te.current={x:tt.clientX,y:tt.clientY},O.current=te.current,re.current){const zt=pW(re.current);ie.current=zt,S(zt),jt({x:zt.x,y:zt.y})}v.setHovering(!0),P(!0),L(!1),le(null),Y.current=!0;const an=re.current;if(an){fe.current?.abort();const zt=new AbortController;fe.current=zt;const At=br(an);At.addEventListener("pointerup",Jt,{signal:zt.signal}),At.addEventListener("pointercancel",Jt,{signal:zt.signal}),an.setPointerCapture?.(tt.pointerId)}}function Mn(tt){if(tt.pointerId!==_e.current)return;tt.preventDefault(),Y.current&&(te.current={x:tt.clientX,y:tt.clientY},Y.current=!1);const{clientY:et,clientX:kt,movementX:an,movementY:zt}=tt;(zt<0&&et>O.current.y||zt>0&&et<O.current.y)&&(O.current={x:O.current.x,y:et}),(an<0&&kt>O.current.x||an>0&&kt<O.current.x)&&(O.current={x:kt,y:O.current.y});const At=kt-te.current.x,xt=et-te.current.y,ar=et-O.current.y,ec=kt-O.current.x;if(!E&&Math.sqrt(At*At+xt*xt)>=gW&&(L(!0),ce===null)){const rr=p.includes("left")||p.includes("right"),bs=p.includes("up")||p.includes("down");if(rr&&bs){const Ri=Math.abs(At),wa=Math.abs(xt);le(Ri>wa?"horizontal":"vertical")}}let En;if(!$.current)ce==="vertical"?xt>0?En="down":xt<0&&(En="up"):ce==="horizontal"?At>0?En="right":At<0&&(En="left"):Math.abs(At)>=Math.abs(xt)?En=At>0?"right":"left":En=xt>0?"down":"up",En&&p.includes(En)&&($.current=En,X.current=xP(En,At,xt),b(En));else{const Sr=$.current,rr=xP(Sr,ec,ar);rr>Hc?(W.current=!1,b(Sr)):!(p.includes("left")&&p.includes("right"))&&!(p.includes("up")&&p.includes("down"))&&X.current-rr>=mW&&(W.current=!0)}const ti=_t(At,xt);let Xn=ie.current.x,Pr=ie.current.y;ce==="horizontal"?(p.includes("left")||p.includes("right"))&&(Xn+=ti.x):(ce==="vertical"||(p.includes("left")||p.includes("right"))&&(Xn+=ti.x),(p.includes("up")||p.includes("down"))&&(Pr+=ti.y)),jt({x:Xn,y:Pr})}function Vt(tt){if(tt.key==="Escape"){if(!re.current||!Ai(re.current,Pl(br(re.current))))return;v.closeToast(a.id)}}k.useEffect(()=>{if(!m)return;const tt=re.current;if(!tt)return;function et(kt){_e.current===null||!Ai(tt,no(kt))||kt.preventDefault()}return to(tt,"touchmove",et,{passive:!1})},[m]);function Xe(){if(!x&&D.x===j.x&&D.y===j.y&&!T)return{[zs.swipeMovementX]:"0px",[zs.swipeMovementY]:"0px"};const tt=D.x-j.x,et=D.y-j.y;return{transition:x?"none":void 0,transform:x?`translateX(${D.x}px) translateY(${D.y}px) scale(${j.scale})`:void 0,[zs.swipeMovementX]:`${tt}px`,[zs.swipeMovementY]:`${et}px`}}const ot=a.priority==="high",Dt={role:ot?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":N,"aria-describedby":Q,"aria-hidden":ot&&!Ie?!0:void 0,onPointerDown:m?nr:void 0,onPointerMove:m?Mn:void 0,onPointerUp:m?Jt:void 0,onPointerCancel:m?Jt:void 0,onKeyDown:Vt,inert:tW(a.limited),style:{...Xe(),[zs.index]:a.transitionStatus==="ending"?ve:Ne,[zs.offsetY]:`${Oe}px`,[zs.height]:a.height?`${a.height}px`:void 0}},Et=k.useMemo(()=>({rootRef:re,toast:a,titleId:N,setTitleId:U,descriptionId:Q,setDescriptionId:ee,swiping:x,swipeDirection:y,recalculateHeight:un,index:ve,visibleIndex:Ne,expanded:St}),[a,N,Q,x,y,un,ve,Ne,St]),Nn={transitionStatus:a.transitionStatus,expanded:St,limited:a.limited||!1,type:a.type,swiping:Et.swiping,swipeDirection:Et.swipeDirection},xr=ou("div",e,{ref:[n,Et.rootRef],state:Nn,stateAttributesMapping:fW,props:[Dt,u]});return R.jsx($4.Provider,{value:Et,children:xr})});let PP=0;function yW(t,e="mui"){const[n,a]=k.useState(t),r=t||n;return k.useEffect(()=>{n==null&&(PP+=1,a(`${e}-${PP}`))},[n,e]),r}const SP=ub.useId;function H4(t,e){if(SP!==void 0){const n=SP();return t??(e?`${e}-${n}`:n)}return yW(t,e)}const bW=k.forwardRef(function(e,n){const{render:a,className:r,style:s,id:l,children:c,...u}=e,{toast:h,setTitleId:p}=V4(),m=c??h.title,v=!!m,y=H4(l);Ka(()=>{if(v)return p(y),()=>{p(void 0)}},[v,y,p]);const b={type:h.type},x=ou("h2",e,{ref:n,state:b,props:{...u,id:y,children:m}});return v?x:null}),kW=k.createContext(void 0);function wW(t=!1){const e=k.useContext(kW);if(e===void 0&&!t)throw new Error(Xl(16));return e}function xW(t){const{focusableWhenDisabled:e,disabled:n,composite:a=!1,tabIndex:r=0,isNativeButton:s}=t,l=a&&e!==!1,c=a&&e===!1;return{props:k.useMemo(()=>{const h={onKeyDown(p){n&&e&&p.key!=="Tab"&&p.preventDefault()}};return a||(h.tabIndex=r,!s&&n&&(h.tabIndex=e?r:-1)),(s&&(e||l)||!s&&n)&&(h["aria-disabled"]=n),s&&(!e||c)&&(h.disabled=n),h},[a,n,e,l,c,s,r])}}function PW(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:a=0,native:r=!0,composite:s}=t,l=k.useRef(null),c=wW(!0),u=s??c!==void 0,{props:h}=xW({focusableWhenDisabled:n,disabled:e,composite:u,tabIndex:a,isNativeButton:r}),p=k.useCallback(()=>{const y=l.current;kv(y)&&u&&e&&h.disabled===void 0&&y.disabled&&(y.disabled=!1)},[e,h.disabled,u]);Ka(p,[p]);const m=k.useCallback((y={})=>{const{onClick:b,onMouseDown:x,onKeyUp:P,onKeyDown:E,onPointerDown:L,...T}=y;return _b({onClick(A){if(e){A.preventDefault();return}b?.(A)},onMouseDown(A){e||x?.(A)},onKeyDown(A){if(e||(Xp(A),E?.(A),A.baseUIHandlerPrevented))return;const D=A.target===A.currentTarget,B=A.currentTarget,j=kv(B),S=!r&&SW(B),N=D&&(r?j:!S),U=A.key==="Enter",Q=A.key===" ",ee=B.getAttribute("role"),ce=ee?.startsWith("menuitem")||ee==="option"||ee==="gridcell";if(D&&u&&Q){if(A.defaultPrevented&&ce)return;A.preventDefault(),S||r&&j?(B.click(),A.preventBaseUIHandler()):N&&(b?.(A),A.preventBaseUIHandler());return}N&&(!r&&(Q||U)&&A.preventDefault(),!r&&U&&b?.(A))},onKeyUp(A){if(!e){if(Xp(A),P?.(A),A.target===A.currentTarget&&r&&u&&kv(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!r&&!u&&A.key===" "&&b?.(A)}},onPointerDown(A){if(e){A.preventDefault();return}L?.(A)}},r?{type:"button"}:{role:"button"},h,T)},[e,h,u,r]),v=vo(y=>{l.current=y,p()});return{getButtonProps:m,buttonRef:v}}function kv(t){return fs(t)&&t.tagName==="BUTTON"}function SW(t){return!!(t?.tagName==="A"&&t?.href)}const CW=k.forwardRef(function(e,n){const{render:a,className:r,style:s,disabled:l,nativeButton:c=!0,...u}=e,h=cb(),{toast:p}=V4(),m=h.useState("expanded"),[v,y]=k.useState(!1),{getButtonProps:b,buttonRef:x}=PW({disabled:l,native:c}),P={type:p.type};return ou("button",e,{ref:[n,x],state:P,props:[{"aria-hidden":!m&&!v,onClick(){h.closeToast(p.id)},onFocus(){y(!0)},onBlur(){y(!1)}},u,b]})}),VZ="none",HZ="trigger-press",WZ="trigger-hover",GZ="outside-press",qZ="item-press",KZ="close-press",TW="focus-out",YZ="escape-key",ZZ="list-navigation",JZ="cancel-open",QZ="imperative-action",XZ="window-resize";function EW(t,e,n,a){let r=!1,s=!1;const l=eo;return{reason:t,event:e??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...l}}function AW(t){return`data-base-ui-${t}`}const W4=k.createContext(null),RW=()=>k.useContext(W4),LW=AW("portal");function G4(t={}){const{ref:e,container:n,componentProps:a=eo,elementProps:r}=t,s=H4(),c=RW()?.portalNode,[u,h]=k.useState(null),[p,m]=k.useState(null),v=vo(P=>{P!==null&&m(P)}),y=k.useRef(null);Ka(()=>{if(n===null){y.current&&(y.current=null,m(null),h(null));return}if(s==null)return;const P=(n&&(hb(n)?n:n.current))??c??document.body;if(P==null){y.current&&(y.current=null,m(null),h(null));return}y.current!==P&&(y.current=P,m(null),h(P))},[n,c,s]);const b=ou("div",a,{ref:[e,v],props:[{id:s,[LW]:""},r]});return{portalNode:p,portalSubtree:u&&b?Vl.createPortal(b,u):null}}const eJ=k.forwardRef(function(e,n){const{render:a,className:r,style:s,children:l,container:c,renderGuards:u,...h}=e,{portalNode:p,portalSubtree:m}=G4({container:c,ref:n,componentProps:e,elementProps:h}),v=k.useRef(null),y=k.useRef(null),b=k.useRef(null),x=k.useRef(null),[P,E]=k.useState(null),L=k.useRef(!1),T=P?.modal,A=P?.open,D=typeof u=="boolean"?u:!!P&&!P.modal&&P.open&&!!p;k.useEffect(()=>{if(!p||T)return;function j(S){p&&S.relatedTarget&&yv(S)&&(S.type==="focusin"?L.current&&(bP(p),L.current=!1):(NH(p),L.current=!0))}return y4(to(p,"focusin",j,!0),to(p,"focusout",j,!0))},[p,T]),Ka(()=>{!p||A!==!0||!L.current||(bP(p),L.current=!1)},[A,p]);const B=k.useMemo(()=>({beforeOutsideRef:v,afterOutsideRef:y,beforeInsideRef:b,afterInsideRef:x,portalNode:p,setFocusManagerState:E}),[p]);return R.jsxs(k.Fragment,{children:[m,R.jsxs(W4.Provider,{value:B,children:[D&&p&&R.jsx(wd,{"data-type":"outside",ref:v,onFocus:j=>{if(yv(j,p))b.current?.focus();else{const S=P?P.domReference:null;MH(S)?.focus()}}}),D&&p&&R.jsx("span",{"aria-owns":p.id,style:hW}),p&&Vl.createPortal(l,p),D&&p&&R.jsx(wd,{"data-type":"outside",ref:y,onFocus:j=>{if(yv(j,p))x.current?.focus();else{const S=P?P.domReference:null;IH(S)?.focus(),P?.closeOnFocusOut&&P?.onOpenChange(!1,EW(TW,j.nativeEvent))}}})]})]})}),DW=k.forwardRef(function(e,n){const{children:a,container:r,className:s,render:l,style:c,...u}=e,{portalNode:h,portalSubtree:p}=G4({container:r,ref:n,componentProps:e,elementProps:u});return!p&&!h?null:R.jsxs(k.Fragment,{children:[p,h&&Vl.createPortal(a,h)]})}),IW=DW;function MW(){const t=k.useContext(lb);if(!t)throw new Error(Xl(73));const e=t.useState("toasts");return k.useMemo(()=>({toasts:e,add:t.addToast,close:t.closeToast,update:t.updateToast,promise:t.promiseToast}),[e,t])}function NW(){const t=new Set;function e(n){t.forEach(a=>a(n))}return{" subscribe":function(a){return t.add(a),()=>{t.delete(a)}},add(n){const a=n.id||b4("toast"),r={...n,id:a,transitionStatus:"starting"};return e({action:"add",options:r}),a},close(n){e({action:"close",options:{id:n}})},update(n,a){e({action:"update",options:{...a,id:n}})},promise(n,a){let r=n;return e({action:"promise",options:{...a,promise:n,setPromise(s){r=s}}}),r}}}const kb=NW();function tJ(t){return kb.add(t)}function OW({children:t}){return R.jsxs(jH,{toastManager:kb,children:[t,R.jsx(IW,{children:R.jsx(eW,{className:"fixed inset-x-0 top-6 z-[100] mx-auto flex w-full max-w-sm flex-col items-center gap-2 px-4 outline-none",children:R.jsx(jW,{})})})]})}function jW(){const{toasts:t}=MW();return t.map(e=>{const n=e.data?.onUndo;return R.jsxs(_W,{toast:e,className:$t("pointer-events-auto flex w-full items-center gap-3 rounded-xl border border-oai-gray-200 bg-oai-white px-4 py-3 shadow-xl transition-all duration-200 ease-out","data-[starting-style]:-translate-y-3 data-[starting-style]:opacity-0","data-[ending-style]:-translate-y-3 data-[ending-style]:opacity-0","dark:border-oai-gray-800 dark:bg-oai-gray-900"),children:[R.jsx(bW,{className:"min-w-0 flex-1 text-sm font-medium text-oai-black dark:text-white"}),n?R.jsx("button",{type:"button",onClick:()=>{n(),kb.close(e.id)},className:"shrink-0 rounded-md px-2 py-1 text-xs font-semibold text-oai-gray-600 transition-colors hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:we("shared.action.undo")}):null,R.jsx(CW,{"aria-label":we("shared.action.dismiss"),className:"-mr-1 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-oai-gray-400 transition-colors hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:R.jsx(C0,{className:"h-3.5 w-3.5","aria-hidden":!0})})]},e.id)})}const wb=Object.freeze(["limits","leaderboard"]),zW=Object.freeze({limits:"/limits",leaderboard:"/leaderboard"}),FW=Object.freeze({limits:()=>In(()=>import("./LimitsPage-BQLI731g.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),leaderboard:()=>In(()=>import("./LeaderboardPage-DvbAKYlA.js"),__vite__mapDeps([8,9,10,11,12,13,14,15,16,17,18,19,20]))}),q4="total",K4=0,CP=20,UW=Object.freeze([10,20,50,100]),BW="tokentracker:leaderboard:pageSize",$W=20,VW=Object.freeze(["dashboard-existing","silent-preload","page-load","manual-refresh"]);let TP=0,Ja;class HW{constructor(e={}){this.limits=null,this.leaderboard=new Map,this.leaderboardMaxEntries=qW(e.leaderboardMaxEntries)}read(e,n){return lu(e),e==="limits"?!this.limits||this.limits.contextKey!==n?null:up(this.limits):n?up(this.leaderboard.get(n)):null}write(e,n={}){if(e.targetKey==="limits"){this.limits=e;return}this.leaderboard.has(e.contextKey)&&this.leaderboard.delete(e.contextKey),this.leaderboard.set(e.contextKey,e),this.evictLeaderboardEntries(n.activeContextKey||e.contextKey)}evictLeaderboardEntries(e=null){for(;this.leaderboard.size>this.leaderboardMaxEntries;){const n=Array.from(this.leaderboard.keys()).find(a=>a!==e)||this.leaderboard.keys().next().value;this.leaderboard.delete(n)}}snapshot(){return{limits:up(this.limits),leaderboard:{maxEntries:this.leaderboardMaxEntries,size:this.leaderboard.size,keys:Array.from(this.leaderboard.keys())}}}}class WW{constructor(e={}){TP+=1,this.sessionId=`dashboard-preload-${TP}`,this.createdAt=Date.now(),this.completedAt=null,this.startedAfterMainContentVisible=!1,this.cache=new HW(e),this.targets={limits:EP("limits"),leaderboard:EP("leaderboard")}}}function EP(t){return{key:t,route:zW[t],resourceStatus:"idle",stateStatus:"idle",error:null,resourcePromise:null,resourceModule:null,resourceRequestId:0,statePromise:null,stateRequestId:0,pendingStateContextKey:null}}function GW(t={}){return new WW(t)}function qW(t){const e=Number(t);return!Number.isInteger(e)||e<1?$W:e}Ja=GW();function lu(t){if(!wb.includes(t))throw new Error(`Unknown dashboard preload target: ${t}`)}function Y4(t){return t?typeof t=="string"?t:t.message||String(t):null}function KW(t,e){return VW.includes(t)?t:e}function YW(t){const e=Number(t);return Number.isFinite(e)?e:Date.now()}function up(t){return t?{...t}:null}function AP(){const t=wb.every(e=>{const n=Ja.targets[e];return n.resourceStatus==="fulfilled"||n.resourceStatus==="rejected"});Ja.completedAt=t?Date.now():null}function ZW(){Ja.startedAfterMainContentVisible=!0}function xb(t,e={}){lu(t);const n=Object.entries(e).filter(([,a])=>a!==void 0).sort(([a],[r])=>a.localeCompare(r)).map(([a,r])=>`${a}=${r===null?"null":String(r)}`);return`${t}:${n.join("|")}`}function JW(t,e={}){lu(t);const n=Ja.targets[t];if(n.resourceStatus==="fulfilled")return Promise.resolve(n.resourceModule);if(n.resourceStatus==="pending"&&n.resourcePromise)return n.resourcePromise;const a=e.loader||FW[t],r=n.resourceRequestId+1;n.resourceRequestId=r,n.resourceStatus="pending",n.error=null;const s=Promise.resolve().then(()=>a()).then(l=>n.resourceRequestId!==r||n.resourcePromise!==s?null:(n.resourceStatus="fulfilled",n.resourceModule=l,n.error=null,AP(),l)).catch(l=>(n.resourceRequestId!==r||n.resourcePromise!==s||(n.resourceStatus="rejected",n.error=Y4(l),AP()),null));return n.resourcePromise=s,s}function QW(t={}){const e=t.loaders||{};return Promise.all(wb.map(n=>JW(n,{loader:e[n]})))}function Z4(t,e){lu(t);const n=Ja.targets[t],a=e?.status||"fulfilled",r={targetKey:t,status:a,data:e?.data??null,error:Y4(e?.error),source:KW(e?.source,"silent-preload"),generatedAt:YW(e?.generatedAt),updatedAt:Date.now(),contextKey:e?.contextKey||xb(t,e?.context||{})};return n.stateStatus=a,a==="rejected"||a==="skipped"?n.error=r.error:a==="fulfilled"&&(n.error=null,Ja.cache.write(r,{activeContextKey:e?.activeContextKey})),up(r)}function J4(t,e){return lu(t),Ja.cache.read(t,e)}function nJ(t,e={}){return Z4("limits",{data:t,source:e.source||"dashboard-existing",contextKey:e.contextKey||Q4(e.context||{}),generatedAt:e.generatedAt,status:e.status||"fulfilled",error:e.error})}function Q4(t={}){return xb("limits",{state:"current",...t})}function aJ(t=Q4()){return J4("limits",t)}function ey(t,e={}){return Z4("leaderboard",{activeContextKey:e.activeContextKey,data:t,source:e.source||"silent-preload",contextKey:e.contextKey||Pb(e.context||{}),generatedAt:e.generatedAt,status:e.status||"fulfilled",error:e.error})}function XW(t){return J4("leaderboard",t)}function X4(){if(typeof window>"u")return CP;try{const t=window.localStorage.getItem(BW),e=Number(t);if(UW.includes(e))return e}catch{}return CP}function eE(t={}){const e=t.userId;return e!==void 0?e||null:t.cloudUser?.id||null}function tE(t={}){return typeof t.accessMode=="string"&&t.accessMode.trim()?t.accessMode.trim():t.mockEnabled?"mock":t.baseUrl?"cloud":"unavailable"}function Pb(t={}){const e=!!t.mockEnabled,n=t.baseUrl??"";return xb("leaderboard",{accessMode:tE({...t,baseUrl:n,mockEnabled:e}),baseUrl:n,mockEnabled:e,offset:t.offset??K4,pageSize:t.pageSize??X4(),period:t.period||q4,userId:eE(t)})}function Ih(t,e){const n=Ja.targets.leaderboard;return n.stateRequestId+=1,n.statePromise=null,n.pendingStateContextKey=null,ey(null,{contextKey:e,status:"skipped",error:t})}function eG(t={}){const e=Ja,n=!!t.mockEnabled,a=t.baseUrl??"",r=tE({...t,baseUrl:a,mockEnabled:n}),s=t.period||q4,l=t.pageSize??X4(),c=t.offset??K4,u=eE(t),h=Pb({accessMode:r,baseUrl:a,mockEnabled:n,offset:c,pageSize:l,period:s,userId:u});if(!n&&t.authLoading)return Promise.resolve(Ih("auth-loading",h));if(!n&&!t.signedIn&&r!=="public")return Promise.resolve(Ih("not-signed-in",h));if(!n&&!a)return Promise.resolve(Ih("missing-base-url",h));if(!n&&r==="unavailable")return Promise.resolve(Ih("access-unavailable",h));const p=e.targets.leaderboard,m=XW(h);if(m)return Promise.resolve(m);if(p.stateStatus==="pending"&&p.statePromise&&p.pendingStateContextKey===h)return p.statePromise;const v=p.stateRequestId+1;p.stateRequestId=v,p.stateStatus="pending",p.pendingStateContextKey=h,p.error=null;const y=Promise.resolve().then(()=>w9({userId:u,period:s,limit:l,offset:c})).then(b=>Ja!==e||p.stateRequestId!==v||p.statePromise!==y?null:(p.pendingStateContextKey=null,ey(b,{contextKey:h}))).catch(b=>(Ja!==e||p.stateRequestId!==v||p.statePromise!==y||(p.pendingStateContextKey=null,ey(null,{contextKey:h,status:"rejected",error:b})),null));return p.statePromise=y,y}const tG=typeof window<"u"?window.location.search:"",RP=new URLSearchParams(tG),Mh=RP.get("insforge_code")||RP.get("code")||null,nG=typeof window<"u"&&!!window.webkit?.messageHandlers?.nativeOAuth;function aG(){Kl();const{loading:t,signedIn:e}=wo(),n=$l(),[a,r]=k.useState("processing"),[s,l]=k.useState(null),c=k.useRef(!1);k.useEffect(()=>{if(!(!Mh||c.current)){if(c.current=!0,nG){l(!1);return}(async()=>{try{const p=await(await fetch("/api/auth-bridge/verifier")).json();l(!!p?.native)}catch{l(!1)}})()}},[]),k.useEffect(()=>{if(s!==!0||!Mh)return;r("redirecting");const h=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(Mh)}`},200);return()=>clearTimeout(h)},[s]),k.useEffect(()=>{if(s!==!1||t)return;if(e){n("/dashboard",{replace:!0});return}const h=setTimeout(()=>{e||r("failed")},12e3);return()=>clearTimeout(h)},[s,t,e,n]),k.useEffect(()=>{if(!Mh&&s===null){const h=setTimeout(()=>r("failed"),3e3);return()=>clearTimeout(h)}},[s]);const u=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&s!==!0&&(s===null||s===!1&&t)?R.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):R.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:R.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&R.jsxs(R.Fragment,{children:[R.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),R.jsx("p",{className:"text-oai-gray-400 text-sm",children:we("auth.callback.processing")})]}),a==="redirecting"&&R.jsxs(R.Fragment,{children:[R.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:R.jsx("svg",{className:"w-6 h-6 text-green-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:R.jsx("path",{d:"M20 6 9 17l-5-5"})})}),R.jsx("p",{className:"text-white text-sm font-medium",children:we("auth.callback.success")}),R.jsx("p",{className:"text-oai-gray-500 text-xs",children:we("auth.callback.redirecting")})]}),a==="failed"&&R.jsxs("div",{className:"space-y-3",children:[R.jsx("p",{className:"text-oai-gray-300 text-sm",children:we("auth.callback.failed")}),R.jsx("button",{type:"button",onClick:u,className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:we("auth.callback.close")})]})]})})}const rG=k.lazy(()=>In(()=>import("./DashboardPage-B5I4egUO.js"),__vite__mapDeps([21,13,1,14,15,22,23,24,11,25,3,9,10,12,26,27,28,4,29,30,31])).then(t=>({default:t.DashboardPage}))),iG=k.lazy(()=>In(()=>import("./IpCheckPage-BnC07aNN.js"),[])),sG=k.lazy(()=>In(()=>import("./AchievementsPage-BCZ46WrR.js"),__vite__mapDeps([32,33,17,18,19,34]))),oG=k.lazy(()=>In(()=>import("./LandingPage-CI695ytW.js"),__vite__mapDeps([35,36,20,12,37,7,31,34])).then(t=>({default:t.LandingPage}))),lG=k.lazy(()=>In(()=>import("./LeaderboardPage-DvbAKYlA.js"),__vite__mapDeps([8,9,10,11,12,13,14,15,16,17,18,19,20])).then(t=>({default:t.LeaderboardPage}))),cG=k.lazy(()=>In(()=>import("./LeaderboardProfilePage-B2SV6EV6.js"),__vite__mapDeps([38,14,36,39,22,15,23,16,17,18,19,33,34,6,40,12,24,11,7])).then(t=>({default:t.LeaderboardProfilePage}))),dG=k.lazy(()=>In(()=>import("./LimitsPage-BQLI731g.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(t=>({default:t.LimitsPage}))),uG=k.lazy(()=>In(()=>import("./LoginPage-OJjtZSeT.js"),[]).then(t=>({default:t.LoginPage}))),hG=k.lazy(()=>In(()=>import("./ResetPasswordPage-D8KIfmPD.js"),[]).then(t=>({default:t.ResetPasswordPage}))),pG=k.lazy(()=>In(()=>import("./DevicePage-BzU-OKx4.js"),[])),fG=k.lazy(()=>In(()=>import("./WrappedPage-iJXvrCko.js"),[])),mG=k.lazy(()=>In(()=>import("./SettingsPage-DtoIzykD.js"),__vite__mapDeps([41,2,42,3,30,12,37,14,15,9,10,11,23,43,44,24,45,7])).then(t=>({default:t.SettingsPage}))),gG=k.lazy(()=>In(()=>import("./SkillsPage-CM5KgkUG.js"),__vite__mapDeps([46,5,6,7,3,44,24,11,45,23,14,28,12,47,10,19,26])).then(t=>({default:t.SkillsPage}))),vG=k.lazy(()=>In(()=>import("./WidgetsPage-CmJkql-6.js"),__vite__mapDeps([48,9,10,11,12,43,42,3,4,6,7])).then(t=>({default:t.WidgetsPage}))),_G=k.lazy(()=>In(()=>import("./PetPage-xb4RYIb2.js"),__vite__mapDeps([49,42,3,29,4,40,28,18,47])).then(t=>({default:t.PetPage})));function yG(){const{resolvedLocale:t}=Kl(),e=ya(),n=wo();q$();const a=k.useRef(!1),r=k.useRef(!1),s=k.useRef(new Set),l=bn(),c=k.useMemo(()=>typeof window>"u"?!1:z$(window.location.search),[]),u=e?.pathname||"/",h=new URL(window.location.href),p=h.pathname.replace(/\/+$/,"")||"/",v=p.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,y=h.searchParams.get("token")||null,b=v||y,x=p==="/share"||p==="/share.html"||p.startsWith("/share/"),P=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),E=u.replace(/\/+$/,"")||"/",L=E==="/"||E==="/dashboard",T=E==="/leaderboard",A=E.match(/^\/u\/([^/]+)$/i),D=A?A[1]:null,B=!!(n.enabled&&n.signedIn),j=P||B,S=!1,N=O$(),U=!j&&!l&&!P,Q=l?"mock":n.loading?"unavailable":B?"cloud":j?"local":"unavailable",ee=k.useCallback(()=>{if(!a.current||!l&&n.loading||!l&&!j)return;const Ne={accessMode:Q,baseUrl:j$(),mockEnabled:l,signedIn:j,authLoading:!!n.loading,userId:B&&n.user?.id||null},Oe=Pb(Ne);s.current.has(Oe)||(s.current.add(Oe),eG(Ne))},[B,n.loading,n.user?.id,Q,l,j]),ce=k.useCallback(()=>{L&&(a.current||(a.current=!0,ZW()),r.current||(r.current=!0,QW()),ee())},[L,ee]);k.useEffect(()=>{ee()},[ee]);const le=k.useMemo(()=>!n.enabled||!B?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[B,n]);let re=P||l||c?"dashboard":"landing";E==="/landing"&&(re="landing"),E==="/dashboard"&&(re="dashboard"),T&&(re="dashboard"),D&&(re="dashboard");const te=E==="/limits",ie=E==="/settings",$=E==="/skills",X=E==="/widgets",W=E==="/pet-settings",O=E==="/ip-check",Y=E==="/achievements";(te||ie||$||X||W||O||Y)&&(re="dashboard");let ae=rG;D?ae=cG:E==="/leaderboard"?ae=lG:te?ae=dG:ie?ae=mG:$?ae=gG:X?ae=vG:W?ae=_G:O?ae=iG:Y&&(ae=sG);const _e=!x&&!U&&(E==="/dashboard"||E==="/"||T||te||ie||$||X||W||O||Y);if(!P&&!B&&!x&&!n.loading&&re==="dashboard"&&!T&&!D&&E!=="/login"&&E!=="/reset-password"&&E!=="/landing"&&E!=="/auth/callback"&&E!=="/auth/native-callback")return R.jsx(d8,{to:"/login",replace:!0});let ve=null;if(E==="/auth/callback"||E==="/auth/native-callback")ve=R.jsx(aG,{});else if(E==="/login")ve=R.jsx(uG,{});else if(E==="/reset-password")ve=R.jsx(hG,{});else if(E==="/device")ve=R.jsx(pG,{});else if(E==="/wrapped")ve=R.jsx(fG,{});else if(re==="landing")ve=R.jsx(oG,{signInUrl:"/login",signUpUrl:"/login"});else{const Ne=R.jsx(ae,{baseUrl:N,auth:le,signedIn:j,sessionSoftExpired:S,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:x,publicToken:b,userId:D,signInUrl:"/login",signUpUrl:"/login",onMainContentVisible:ce},t);_e?ve=R.jsx(dV,{children:Ne}):ve=Ne}return R.jsx(LO,{children:R.jsx(MO,{children:R.jsx(OW,{children:R.jsxs(NO,{children:[R.jsx(k.Suspense,{fallback:null,children:ve}),_e?R.jsx(FV,{}):null,R.jsx(I$,{}),R.jsx(AN,{}),R.jsx(UN,{})]})})})})}var Z=typeof window<"u"?window:void 0,Tn=typeof globalThis<"u"?globalThis:Z;typeof self>"u"&&(Tn.self=Tn),typeof File>"u"&&(Tn.File=function(){});var sa=Tn?.navigator,xe=Tn?.document,fn=Tn?.location,Sb=Tn?.fetch,ty=Tn!=null&&Tn.XMLHttpRequest&&"withCredentials"in new Tn.XMLHttpRequest?Tn.XMLHttpRequest:void 0,LP=Tn?.AbortController,bG=Tn?.CompressionStream,va=sa?.userAgent,Be=Z??{};function nE(){return!(!Z||Z.navigator.onLine===!1)}var DP="1.402.0",en={DEBUG:!1,LIB_VERSION:DP,LIB_NAME:"web",JS_SDK_VERSION:DP};function IP(t,e,n,a,r,s,l){try{var c=t[s](l),u=c.value}catch(h){return void n(h)}c.done?e(u):Promise.resolve(u).then(a,r)}function cn(t){return function(){var e=this,n=arguments;return new Promise((function(a,r){var s=t.apply(e,n);function l(u){IP(s,a,r,l,c,"next",u)}function c(u){IP(s,a,r,l,c,"throw",u)}l(void 0)}))}}function he(){return he=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var a in n)({}).hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},he.apply(null,arguments)}function aE(t,e){if(t==null)return{};var n={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;n[a]=t[a]}return n}var MP=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function NP(t){return typeof t=="string"||t}function OP(t){return typeof t=="string"?t:void 0}var Wc,ki=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),jP=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),kG=["$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"],wG=["token"],rE="NativeGzipValidationError",ny=t=>t.length>=2&&t[0]===31&&t[1]===139,zP=(t,e)=>t===jP.GZipJS||e===jP.GZipJS||e==="gzip",FP=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Nh=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=rE,e},xG=(function(){var t=cn((function*(e,n){18>e.size&&Nh("too-short");var a=new Uint8Array(yield e.slice(0,10).arrayBuffer());ny(a)&&a[2]===8||Nh("invalid-header");var r=new DataView(yield e.slice(e.size-8).arrayBuffer());r.getUint32(0,!0)!==(l=>{for(var c=(()=>{if(Wc)return Wc;Wc=[];for(var p=0;256>p;p++){for(var m=p,v=0;8>v;v++)m=1&m?3988292384^m>>>1:m>>>1;Wc[p]=m>>>0}return Wc})(),u=4294967295,h=0;l.length>h;h++)u=c[255&(u^l[h])]^u>>>8;return(4294967295^u)>>>0})(n)&&Nh("invalid-crc");var s=n.length>>>0;r.getUint32(4,!0)!==s&&Nh("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function ay(){return ay=cn((function*(t,e,n){e===void 0&&(e=!0);try{var a=new TextEncoder().encode(t),r=new CompressionStream("gzip"),s=r.writable.getWriter(),l=s.write(a).then((()=>s.close())).catch((function(){var h=cn((function*(p){try{yield s.abort(p)}catch{}throw p}));return function(p){return h.apply(this,arguments)}})()),c=new Response(r.readable).blob(),u=(yield Promise.all([c,l]))[0];return yield xG(u,a),u}catch(h){if(n!=null&&n.rethrow)throw h;return e&&console.error("Failed to gzip compress data",h),null}})),ay.apply(this,arguments)}var PG=["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"],UP=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return PG.concat(e).some((a=>{var r=a.toLowerCase();return n.indexOf(r)!==-1}))};function Ke(t,e){return t.indexOf(e)!==-1}var Gf=function(t){return t.trim()},ry=function(t){return t.replace(/^\$/,"")};function iE(t){var e,n=[];return(e=JSON.stringify(t,(function(a,r){if(typeof r=="bigint")return r.toString();if(typeof r!="function"&&typeof r!="symbol"){if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&typeof r=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(r))return"[Circular]";n.push(r)}return r}})))!==null&&e!==void 0?e:"null"}var sE=Object.prototype,oE=sE.hasOwnProperty,qf=sE.toString,it=Array.isArray||function(t){return qf.call(t)==="[object Array]"},yr=t=>typeof t=="function",qt=t=>t===Object(t)&&!it(t),cs=t=>{if(qt(t)){for(var e in t)if(oE.call(t,e))return!1;return!0}return!1},ke=t=>t===void 0,Lt=t=>qf.call(t)=="[object String]",iy=t=>Lt(t)&&t.trim().length===0,la=t=>t===null,nt=t=>ke(t)||la(t),Bn=t=>qf.call(t)=="[object Number]"&&t==t,yi=t=>Bn(t)&&t>0,Hr=t=>qf.call(t)==="[object Boolean]",SG=t=>t instanceof FormData,CG=t=>Ke(kG,t),TG=t=>Ke(wG,t);function lE(t){return t===null||typeof t!="object"}function ef(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Cb(t){return typeof Event<"u"&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var EG=[!0,"true",1,"1","yes"],wv=t=>Ke(EG,t),AG=[!1,"false",0,"0","no"];function Br(t,e,n,a,r){return e>n&&(a.warn("min cannot be greater than max."),e=n),Bn(t)?t>n?(a.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(a.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(a.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),Br(r||n,e,n,a))}class RG{constructor(e){this.Pe={},this.Oe=e.Oe,this.Fe=Br(e.bucketSize,0,100,e.Ae),this.$e=Br(e.refillRate,0,this.Fe,e.Ae),this.Ne=Br(e.refillInterval,0,864e5,e.Ae)}De(e,n){var a=Math.floor((n-e.lastAccess)/this.Ne);a>0&&(e.tokens=Math.min(e.tokens+a*this.$e,this.Fe),e.lastAccess=e.lastAccess+a*this.Ne)}consumeRateLimit(e){var n,a=Date.now(),r=String(e),s=this.Pe[r];return s?this.De(s,a):this.Pe[r]=s={tokens:this.Fe,lastAccess:a},s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.Oe)==null||n.call(this,e)),s.tokens===0)}stop(){this.Pe={}}}var Da="Mobile",tf="iOS",Si="Android",Nl="Tablet",cE=Si+" "+Nl,dE="iPad",uE="Apple",hE=uE+" Watch",xd="Safari",Ol="BlackBerry",pE="Samsung",fE=pE+"Browser",mE=pE+" Internet",oo="Chrome",LG=oo+" OS",gE=oo+" "+tf,Tb="Internet Explorer",vE=Tb+" "+Da,Eb="Opera",DG=Eb+" Mini",Ab="Edge",_E="Microsoft "+Ab,Sl="Firefox",yE=Sl+" "+tf,Bd="Nintendo",$d="PlayStation",Cl="Xbox",bE=Si+" "+Da,kE=Da+" "+xd,od="Windows",sy=od+" Phone",BP="Nokia",oy="Ouya",wE="Generic",IG=wE+" "+Da.toLowerCase(),xE=wE+" "+Nl.toLowerCase(),ly="Konqueror",PE="Oculus Browser",nf="Vivaldi",SE="Yandex",af="Whale",cy="DuckDuckGo",CE="Pale Moon",rf="Waterfox",Pd="Brave",TE="Google Search App",Xt="(\\d+(\\.\\d+)?)",xv=new RegExp("Version/"+Xt),MG=new RegExp(Cl,"i"),NG=new RegExp($d+" \\w+","i"),OG=new RegExp(Bd+" \\w+","i"),Rb=new RegExp(Ol+"|PlayBook|BB10","i"),jG={"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"},EE=function(t,e,n,a){e=e||"";var r=(function(s){return s!=null&&s.brave?Pd:null})(n);return r||(a!=null&&a.detectGoogleSearchApp&&Ke(t,"GSA/")?TE:Ke(t," OPR/")&&Ke(t,"Mini")?DG:Ke(t," OPR/")?Eb:Rb.test(t)?Ol:Ke(t,"IE"+Da)||Ke(t,"WPDesktop")?vE:Ke(t,"OculusBrowser")?PE:Ke(t,fE)?mE:Ke(t,Ab)||Ke(t,"Edg/")?_E:Ke(t,nf+"/")?nf:Ke(t,"YaBrowser/")?SE:Ke(t,af+"/")?af:Ke(t,cy+"/")||Ke(t,"Ddg/")?cy:Ke(t,"FBIOS")?"Facebook "+Da:Ke(t,"UCWEB")||Ke(t,"UCBrowser")?"UC Browser":Ke(t,"CriOS")?gE:Ke(t,"CrMo")||Ke(t,oo)?oo:Ke(t,Si)&&Ke(t,xd)?bE:Ke(t,"FxiOS")?yE:Ke(t.toLowerCase(),ly.toLowerCase())?ly:Ke(t,Pd+"/")?Pd:((s,l)=>l&&Ke(l,uE)||(function(c){return Ke(c,xd)&&!Ke(c,oo)&&!Ke(c,Si)})(s))(t,e)?Ke(t,Da)?kE:xd:Ke(t,"PaleMoon/")?CE:Ke(t,rf+"/")?rf:Ke(t,Sl)?Sl:Ke(t,"MSIE")||Ke(t,"Trident/")?Tb:Ke(t,"Gecko")?Sl:"")},zG={[vE]:[new RegExp("rv:"+Xt)],[_E]:[new RegExp(Ab+"?\\/"+Xt)],[oo]:[new RegExp("("+oo+"|CrMo)\\/"+Xt)],[gE]:[new RegExp("CriOS\\/"+Xt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Xt)],[xd]:[xv],[kE]:[xv],[Eb]:[new RegExp("(Opera|OPR)\\/"+Xt)],[Sl]:[new RegExp(Sl+"\\/"+Xt)],[yE]:[new RegExp("FxiOS\\/"+Xt)],[ly]:[new RegExp("Konqueror[:/]?"+Xt,"i")],[Ol]:[new RegExp(Ol+" "+Xt),xv],[bE]:[new RegExp("android\\s"+Xt,"i")],[mE]:[new RegExp(fE+"\\/"+Xt)],[PE]:[new RegExp("OculusBrowser\\/"+Xt)],[nf]:[new RegExp(nf+"\\/"+Xt)],[SE]:[new RegExp("YaBrowser\\/"+Xt)],[af]:[new RegExp(af+"\\/"+Xt)],[Pd]:[new RegExp(Pd+"\\/"+Xt)],[cy]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Xt)],[CE]:[new RegExp("PaleMoon\\/"+Xt)],[rf]:[new RegExp(rf+"\\/"+Xt)],[TE]:[new RegExp("GSA\\/"+Xt)],[Tb]:[new RegExp("(rv:|MSIE )"+Xt)],Mozilla:[new RegExp("rv:"+Xt)]},FG=function(t,e,n,a){var r=EE(t,e,n,a),s=zG[r];if(ke(s))return null;for(var l=0;s.length>l;l++){var c=t.match(s[l]);if(c)return parseFloat(c[c.length-2])}return null},$P=[[new RegExp(Cl+"; "+Cl+" (.*?)[);]","i"),t=>[Cl,t&&t[1]||""]],[new RegExp(Bd,"i"),[Bd,""]],[new RegExp($d,"i"),[$d,""]],[Rb,[Ol,""]],[new RegExp(od,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[sy,""];if(new RegExp(Da).test(e)&&!/IEMobile\b/.test(e))return[od+" "+Da,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var a=jG[n[1]]||"";return/arm/i.test(e)&&(a="RT"),[od,a]}return[od,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[tf,[t[3],t[4],t[5]||"0"].join(".")]:[tf,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ke(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Si+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Si+")","i"),t=>t&&t[2]?[Si,[t[2],t[3],t[4]||"0"].join(".")]:[Si,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[LG,""]],[/Linux|debian/i,["Linux",""]]],VP=function(t){return OG.test(t)?Bd:NG.test(t)?$d:MG.test(t)?Cl:new RegExp(oy,"i").test(t)?oy:new RegExp("("+sy+"|WPDesktop)","i").test(t)?sy:/iPad/.test(t)?dE:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?hE:Rb.test(t)?Ol:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(BP,"i").test(t)?BP:/(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(Da).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)?Si:cE:new RegExp("(pda|"+Da+")","i").test(t)?IG:new RegExp(Nl,"i").test(t)&&!new RegExp(Nl+" pc","i").test(t)?xE:""},UG=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function HP(t,e){return typeof(n=t)=="string"&&UG.test(n)?t:e();var n}function ms(t){return t&&t.split("#")[0]}function hp(t,e){var n=setTimeout(t,e);return n?.unref&&n?.unref(),n}var BG=t=>t instanceof Error,AE={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},$G=AE.info;function RE(t){if(Hr(t))return{boolValue:t};if(typeof t=="number")return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if(typeof t=="string")return{stringValue:t};if(it(t))return{arrayValue:{values:t.map((e=>RE(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function sf(t){var e=[];for(var n in t){var a=t[n];la(a)||ke(a)||e.push({key:n,value:RE(a)})}return e}function VG(t,e){var n=AE[t.level||"info"]||$G,a=n.text,r=n.number,s=String(Date.now())+"000000",l={};e.distinctId&&(l.posthogDistinctId=e.distinctId),e.sessionId&&(l.sessionId=e.sessionId),e.windowId&&(l["window.id"]=e.windowId),nt(e.sessionStartTimestamp)||(l.sessionStartTimestamp=String(e.sessionStartTimestamp)),nt(e.lastActivityTimestamp)||(l.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(l["url.full"]=e.currentUrl),e.screenName&&(l["screen.name"]=e.screenName),e.appState&&(l["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(l.feature_flags=e.activeFeatureFlags);var c=he({},l,t.attributes||{}),u={timeUnixNano:s,observedTimeUnixNano:s,severityNumber:r,severityText:a,body:{stringValue:t.body},attributes:sf(c)};return t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),ke(t.trace_flags)||(u.flags=t.trace_flags),u}function LE(t,e,n){return he({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}function DE(t,e,n,a){return{resourceLogs:[{resource:{attributes:sf(e)},scopeLogs:[{scope:{name:n,version:a},logRecords:t}]}]}}let HG=class{constructor(t,e,n,a,r,s,l){var c;s===void 0&&(s=()=>Promise.resolve()),this._instance=t,this.Se=e,this.Ae=n,this.qe=a,this.je=r,this.Be=s,this.He=l,this.Ue=null,this.ze=0,this.We=0,this.Ve=0,this.Ze=0,this.Ge=!1,this.Qe=e.maxBufferSize,this.Je=Math.max((c=e.maxQueueSize)!==null&&c!==void 0?c:e.maxBufferSize,e.maxBufferSize),this.Ke=e.flushIntervalMs,this.Ye=e.maxBatchRecordsPerPost,this.Xe=e.rateCapWindowMs,this.et=e.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.Ve=0,this.Ze=0,this.Ge=!1,this.ze=0,this.We=0,this.Ye=this.Se.maxBatchRecordsPerPost}onReconnect(){this.We=0,this.rt()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.it(t);if(e!==null)if(e.body){if(this.nt()){var n={record:VG(e,this.qe())};this.je((()=>this.st(n)))}}else this.Ae.info("Log was rejected in beforeSend function")}}it(t){var e=this.Se.beforeSend;if(!e)return t;var n=it(e)?e:[e],a=t;for(var r of n)try{var s=r(a);if(!s)return this.Ae.info("Log was rejected in beforeSend function"),null;a=s}catch(l){return this.Ae.error("Error in beforeSend function for log:",l),null}return a}nt(){if(this.et===void 0)return!0;var t=Date.now(),e=t-this.Ve;return this.Xe>e&&e>=0||(this.Ve=t,this.Ze=0,this.Ge=!1),this.et>this.Ze?(this.Ze++,!0):(this.Ge||(this.Ae.warn("captureLog dropping logs: exceeded "+this.et+" logs per "+this.Xe+"ms"),this.Ge=!0),!1)}flush(){var t=this;return cn((function*(){if(!t._instance.isDisabled)return t.Ue||(t.Ue=t.ot().finally((()=>{t.Ue=null}))),t.Ue}))()}ot(){var t=this;return cn((function*(){var e;t.tt();var n=(e=t._instance.getPersistedProperty(ki.LogsQueue))!==null&&e!==void 0?e:[];if(n.length!==0)for(var a=n.length,r=0;n.length>0&&a>r;){var s,l;t.ze=0;var c=Math.min(n.length,t.Ye),u=n.slice(0,c),h=DE(u.map((m=>m.record)),t.ut(),(s=t.He)!==null&&s!==void 0?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),p=yield t._instance.ht(h);if(p.kind==="too-large"&&u.length>1)t.Ye=Math.max(1,Math.floor(u.length/2)),t.Ae.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+t.Ye);else if(p.kind==="retry-later"||(p.kind==="too-large"?t.Ae.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):p.kind==="ok"&&t.Se.maxBatchRecordsPerPost>t.Ye&&(t.Ye=Math.min(t.Se.maxBatchRecordsPerPost,t.Ye+1)),yield t.dt(u.length),n=(l=t._instance.getPersistedProperty(ki.LogsQueue))!==null&&l!==void 0?l:[],r+=u.length,p.kind==="fatal"))throw p.error}}))()}dt(t){var e=this;return cn((function*(){var n,a=Math.max(0,t-e.ze),r=(n=e._instance.getPersistedProperty(ki.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(ki.LogsQueue,r.slice(a)),yield e.Be()}))()}ut(){return LE(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(ki.LogsQueue))!==null&&e!==void 0?e:[];this.Je>n.length||(n.shift(),this.ze++,this.Ae.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(ki.LogsQueue,n),this.Qe>n.length?this.ct():this.rt()}}ct(t){t===void 0&&(t=this.Ke),this.vt||(this.vt=hp((()=>{this.vt=void 0,this.rt()}),t))}ft(){var t=Math.min(Math.max(0,this.We-1),6);return this.Ke*Math.pow(2,t)}yt(){var t=this._instance.getPersistedProperty(ki.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return cn((function*(){e.tt();var n=e.flush().catch((()=>{}));t!==void 0?yield Promise.race([n,new Promise((a=>hp(a,t)))]):yield n}))()}flushWithTimeout(t){var e=this;return cn((function*(){var n=!1,a=e.flush(),r=new Promise((s=>hp((()=>{n=!0,s()}),t)));try{yield Promise.race([a,r])}finally{n&&a.catch((()=>{}))}}))()}rt(){this.flush().then((()=>{this.We=0}),(t=>{this.We++,this.Ae.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())}))}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}};var Pv=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function WP(t){return String(t)+"000000"}function GP(t,e,n,a){var r="";return a&&(r=Object.keys(a).sort().map((s=>JSON.stringify(s)+":"+JSON.stringify(a[s]))).join(",")),t+"\0"+e+"\0"+(n??"")+"\0"+r}let WG=class{constructor(t,e,n){this._instance=t,this.Se=e,this.Ae=n,this.bt=new Map,this.Ue=null,this._t=!1,this.wt=new Map,this.xt=new Set}count(t,e,n){e===void 0&&(e=1),this.kt({name:t,type:"count",value:e,unit:n?.unit,attributes:n?.attributes})}gauge(t,e,n){this.kt({name:t,type:"gauge",value:e,unit:n?.unit,attributes:n?.attributes})}histogram(t,e,n){this.kt({name:t,type:"histogram",value:e,unit:n?.unit,attributes:n?.attributes})}flush(){var t=this,e=this.Ue,n=(function(){var r=cn((function*(){e&&(yield e.catch((()=>{}))),yield t.St()}));return function(){return r.apply(this,arguments)}})(),a=n().finally((()=>{this.Ue===a&&(this.Ue=null)}));return this.Ue=a,a}drainWindow(){if(this.bt.size===0)return null;var t=this.bt;return this.bt=new Map,this._t=!1,this.wt=new Map,this.xt=new Set,this.Ct(t)}reset(){this.tt(),this.bt=new Map,this.Ue=null,this._t=!1,this.wt=new Map,this.xt=new Set}kt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.it(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.Ae.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n=this.wt.get(e.name);n===void 0?this.wt.set(e.name,e.type):n===e.type||this.xt.has(e.name)||(this.xt.add(e.name),this.Ae.warn("Metric name '"+e.name+"' is already used as a "+n+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name."));var a=GP(e.type,e.name,e.unit,e.attributes),r=this.bt.get(a);if(!r){if(this.bt.size>=this.Se.maxSeriesPerFlush)return void(this._t||(this._t=!0,this.Ae.warn("Metric series cap reached ("+this.Se.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")));r={name:e.name,type:e.type,unit:e.unit,attributes:e.attributes?he({},e.attributes):void 0,windowStartMs:Date.now()},this.bt.set(a,r)}this.Tt(r,e.value),this.ct()}else this.Ae.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.Ae.warn("Dropping metric with empty name")}}Tt(t,e){var n;switch(t.type){case"count":t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Pv.length+1).fill(0)});var a=t.hist;a.count+=1,a.sum+=e,a.min=Math.min(a.min,e),a.max=Math.max(a.max,e),a.bucketCounts[(function(r,s){for(var l=0;s.length>l;l++)if(s[l]>=r)return l;return s.length})(e,Pv)]+=1}}it(t){var e=this.Se.beforeSend;if(!e)return t;var n=it(e)?e:[e],a=t;for(var r of n)try{var s=r(a);if(!s)return this.Ae.info("Metric was rejected in beforeSend function"),null;a=s}catch(l){return this.Ae.error("Error in beforeSend function for metric:",l),null}return a}ct(){this.vt||(this.vt=hp((()=>{this.vt=void 0,this.flush().catch((()=>{}))}),this.Se.flushIntervalMs))}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}St(){var t=this;return cn((function*(){if(t.bt.size!==0){var e=t.bt;t.bt=new Map,t._t=!1,t.wt=new Map,t.xt=new Set;var n=yield t._instance.It(t.Ct(e));switch(n.kind){case"ok":return;case"retry-later":return t.Mt(e),void t.ct();case"too-large":return void t.Ae.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.Ae.error("Failed to send metrics batch:",n.error)}}}))()}Ct(t){return(function(r,s,l,c){return{resourceMetrics:[{resource:{attributes:sf(s)},scopeMetrics:[{scope:{name:l,version:c},metrics:r}]}]}})(this.Et(t),(e=this.Se,n=this._instance.getLibraryId(),a=this._instance.getLibraryVersion(),he({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":n,"telemetry.sdk.version":a})),this._instance.getLibraryId(),this._instance.getLibraryVersion());var e,n,a}Et(t){var e=WP(Date.now()),n=new Map;for(var a of t.values()){var r,s=GP(a.type,a.name,a.unit,void 0),l=n.get(s);l||(l=he({name:a.name},a.unit&&{unit:a.unit}),a.type==="count"?l.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:a.type==="gauge"?l.gauge={dataPoints:[]}:l.histogram={aggregationTemporality:1,dataPoints:[]},n.set(s,l));var c=sf((r=a.attributes)!==null&&r!==void 0?r:{}),u=WP(a.windowStartMs);if(a.type==="count"){var h,p={attributes:c,startTimeUnixNano:u,timeUnixNano:e,asDouble:(h=a.total)!==null&&h!==void 0?h:0};l.sum.dataPoints.push(p)}else if(a.type==="gauge"){var m,v={attributes:c,timeUnixNano:e,asDouble:(m=a.last)!==null&&m!==void 0?m:0};l.gauge.dataPoints.push(v)}else a.hist&&l.histogram.dataPoints.push({attributes:c,startTimeUnixNano:u,timeUnixNano:e,count:a.hist.count,sum:a.hist.sum,min:a.hist.min,max:a.hist.max,bucketCounts:a.hist.bucketCounts,explicitBounds:Pv})}return Array.from(n.values())}Mt(t){var e,n;for(var a of t){var r=a[0],s=a[1],l=this.bt.get(r);if(l)switch(l.windowStartMs=Math.min(l.windowStartMs,s.windowStartMs),l.type){case"count":l.total=((e=l.total)!==null&&e!==void 0?e:0)+((n=s.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(s.hist)if(l.hist){l.hist.count+=s.hist.count,l.hist.sum+=s.hist.sum,l.hist.min=Math.min(l.hist.min,s.hist.min),l.hist.max=Math.max(l.hist.max,s.hist.max);for(var c=0;l.hist.bucketCounts.length>c;c++)l.hist.bucketCounts[c]+=s.hist.bucketCounts[c]}else l.hist=s.hist}else this.bt.set(r,s)}}};var Oh,qP,Sv;function GG(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return Sv&&n.length===qP||(qP=n.length,Sv=n.reduce(((a,r)=>{Oh||(Oh={});var s=Oh[r];if(s)a[s[0]]=s[1];else for(var l=t(r),c=l.length-1;c>=0;c--){var u=l[c],h=u?.filename,p=e[r];if(h&&p){a[h]=p,Oh[r]=[h,p];break}}return a}),{})),Sv}}class qG{constructor(e,n,a){a===void 0&&(a=[]),this.coercers=e,this.stackParser=n,this.modifiers=a}buildFromUnknown(e,n){n===void 0&&(n={});var a=n&&n.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(a,n,0).apply(e),s=this.buildParsingContext(n),l=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(l,a),$exception_level:"error"}}modifyFrames(e){var n=this;return cn((function*(){for(var a of e)a.stacktrace&&a.stacktrace.frames&&it(a.stacktrace.frames)&&(a.stacktrace.frames=yield n.applyModifiers(a.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 a,r;return e.cause!=null&&(a=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),he({},e,{cause:a,stack:r})}applyChunkIds(e,n){return e.map((a=>(a.filename&&n&&(a.chunk_id=n[a.filename]),a)))}applyCoercers(e,n){for(var a of this.coercers)if(a.match(e))return a.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return cn((function*(){var a=e;for(var r of n.modifiers)a=yield r(a);return a}))()}convertToExceptionList(e,n){var a,r,s,l={type:e.type,value:e.value,mechanism:{type:(a=n.type)!==null&&a!==void 0?a:"generic",handled:(r=n.handled)===null||r===void 0||r,synthetic:(s=e.synthetic)!==null&&s!==void 0&&s}};e.stack&&(l.stacktrace={type:"raw",frames:e.stack});var c=[l];return e.cause!=null&&c.push(...this.convertToExceptionList(e.cause,he({},n,{handled:!0}))),c}buildParsingContext(e){var n;return{chunkIdMap:GG(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,a){a===void 0&&(a=0);var r=(s,l)=>{if(4>=l){var c=this.buildCoercingContext(e,n,l);return this.applyCoercers(s,c)}};return he({},n,{syntheticException:a==0?n.syntheticException:void 0,mechanism:e,apply:s=>r(s,a),next:s=>r(s,a+1)})}}var jl="?";function dy(t,e,n,a,r){var s={platform:t,filename:e,function:n==="<anonymous>"?jl:n,in_app:!0};return ke(a)||(s.lineno=a),ke(r)||(s.colno=r),s}var IE=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,a=t.indexOf("safari-web-extension")!==-1;return n||a?[t.indexOf("@")!==-1?t.split("@")[0]:jl,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},KG=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,YG=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ZG=/\((\S*)(?::(\d+))(?::(\d+))\)/,JG=(t,e)=>{var n=KG.exec(t);if(n)return dy(e,n[1],jl,+n[2],+n[3]);var a=YG.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var r=ZG.exec(a[2]);r&&(a[2]=r[1],a[3]=r[2],a[4]=r[3])}var s=IE(a[1]||jl,a[2]);return dy(e,s[1],s[0],a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},QG=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,XG=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,eq=(t,e)=>{var n=QG.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var a=XG.exec(n[3]);a&&(n[1]=n[1]||"eval",n[3]=a[1],n[4]=a[2],n[5]="")}var r=n[3],s=n[1]||jl,l=IE(s,r);return dy(e,r=l[1],s=l[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},KP=/\(error: (.*)\)/;class tq{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var a=Lt(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:a?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 ef(e,"DOMException")}isDOMError(e){return ef(e,"DOMError")}}class nq{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 a=e.message;return String(a.error&&typeof a.error.message=="string"?a.error.message:a)}getStack(e){return e.stacktrace||e.stack||void 0}}class aq{constructor(){}match(e){return ef(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var a;return n.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(a=n.syntheticException)==null?void 0:a.stack,synthetic:!0}}}var rq=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class iq{match(e){return typeof e=="string"}coerce(e,n){var a,r=this.getInfos(e),s=r[0],l=r[1];return{type:s??"Error",value:l??e,stack:(a=n.syntheticException)==null?void 0:a.stack,synthetic:!0}}getInfos(e){var n="Error",a=e,r=e.match(rq);return r&&(n=r[1],a=r[2]),[n,a]}}var sq=["fatal","error","warning","log","info","debug"];function ME(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var a=n.length;a>0;a--){var r=n.slice(0,a).join(", ");if(e>=r.length)return a===n.length?r:r.length>e?r.slice(0,e)+"...":r}return""}class oq{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var a,r=this.getErrorPropertyFromObject(e);return r?n.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(a=n.syntheticException)==null?void 0:a.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Cb(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 a=this.getObjectClassName(e);return(a&&a!=="Object"?"'"+a+"'":"Object")+" captured as exception with keys: "+ME(e)}isSeverityLevel(e){return Lt(e)&&!iy(e)&&sq.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var a=e[n];if(BG(a))return a}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class lq{match(e){return Cb(e)}coerce(e,n){var a,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+ME(e),stack:(a=n.syntheticException)==null?void 0:a.stack,synthetic:!0}}}class cq{match(e){return lE(e)}coerce(e,n){var a;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(a=n.syntheticException)==null?void 0:a.stack,synthetic:!0}}}class dq{match(e){return ef(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Cb(e))return!1;try{var n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var a,r=this.getUnhandledRejectionReason(e);return lE(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(a=n.syntheticException)==null?void 0:a.stack,synthetic:!0}:n.apply(r)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var of="$message",lf="$timestamp",uq=new Set([of,lf]),Cv={enabled:!0,max_bytes:32768};function cf(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:Cv.enabled,max_bytes:pq(t.max_bytes,Cv.max_bytes)}:he({},Cv)}class hq{constructor(e){this.Rt=[],this.Pt=0,this.Se=cf(e)}setConfig(e){this.Se=cf(e),this.Ot()}add(e){var n=(function(r){var s;try{s=iE(r)}catch{return}try{var l=JSON.parse(s);if(!qt(l))return;var c=l,u=c[of],h=c[lf];return!Lt(u)||u.trim().length===0||!Lt(h)&&!Bn(h)?void 0:{step:c,json:s}}catch{return}})(e);if(n){var a=(function(r){if(typeof TextEncoder<"u")return new TextEncoder().encode(r).length;for(var s=encodeURIComponent(r),l=0,c=0;s.length>c;c++)s[c]==="%"?(l+=1,c+=2):l+=1;return l})(n.json);a>this.Se.max_bytes||(this.Rt.push({step:n.step,bytes:a}),this.Pt+=a,this.Ot())}}getAttachable(){return this.Rt.map((e=>e.step))}clear(){this.Rt=[],this.Pt=0}size(){return this.Rt.length}Ot(){for(;this.Pt>this.Se.max_bytes&&this.Rt.length>0;){var e=this.Rt.shift();e&&(this.Pt-=e.bytes)}}}function pq(t,e){if(!Bn(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var NE=function(t,e){var n=(e===void 0?{}:e).debugEnabled,a={k(r){if(Z&&(en.DEBUG||Be.POSTHOG_DEBUG||n)&&!ke(Z.console)&&Z.console){for(var s=("__rrweb_original__"in Z.console[r])?Z.console[r].__rrweb_original__:Z.console[r],l=arguments.length,c=new Array(l>1?l-1:0),u=1;l>u;u++)c[u-1]=arguments[u];s(t,...c)}},debug(){for(var r=arguments.length,s=new Array(r),l=0;r>l;l++)s[l]=arguments[l];a.k("debug",...s)},info(){for(var r=arguments.length,s=new Array(r),l=0;r>l;l++)s[l]=arguments[l];a.k("log",...s)},warn(){for(var r=arguments.length,s=new Array(r),l=0;r>l;l++)s[l]=arguments[l];a.k("warn",...s)},error(){for(var r=arguments.length,s=new Array(r),l=0;r>l;l++)s[l]=arguments[l];a.k("error",...s)},critical(){for(var r=arguments.length,s=new Array(r),l=0;r>l;l++)s[l]=arguments[l];console.error(t,...s)},uninitializedWarning(r){a.error("You must initialize PostHog before calling "+r)},createLogger:(r,s)=>NE(t+" "+r,s)};return a},be=NE("[PostHog.js]"),Zt=be.createLogger,fq=Zt("[ExternalScriptsLoader]"),Tv=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return fq.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var a=xe?.querySelectorAll("script");if(a){for(var r,s=function(){if(a[l].src===e){var u=a[l];return u.__posthog_loading_callback_fired?{v:n()}:(u.addEventListener("load",(h=>{u.__posthog_loading_callback_fired=!0,n(void 0,h)})),u.onerror=h=>n(h),{v:void 0})}},l=0;a.length>l;l++)if(r=s())return r.v}var c=()=>{if(!xe)return n("document not found");var u=xe.createElement("script");if(u.type="text/javascript",u.crossOrigin="anonymous",u.src=e,u.onload=m=>{u.__posthog_loading_callback_fired=!0,n(void 0,m)},u.onerror=m=>n(m),t.config.prepare_external_dependency_script&&(u=t.config.prepare_external_dependency_script(u)),!u)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")xe.head.appendChild(u);else{var h,p=xe.querySelectorAll("body > script");p.length>0?(h=p[0].parentNode)==null||h.insertBefore(u,p[0]):xe.body.appendChild(u)}};xe!=null&&xe.body?c():xe?.addEventListener("DOMContentLoaded",c)};Be.__PosthogExtensions__=Be.__PosthogExtensions__||{},Be.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var a;if(t.config.strict_script_versioning)a=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var r="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var s=3e5;r=r+"&t="+Math.floor(Date.now()/s)*s}a=t.requestRouter.endpointFor("assets",r)}Tv(t,a,n)}else{var l=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");Tv(t,l,n)}},Be.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var a=t.requestRouter.endpointFor("api",e);Tv(t,a,n)};var OE="$people_distinct_id",df="$device_id",Ev="$device_model",ld="__alias",cd="__timers",uy="$autocapture_disabled_server_side",hy="$heatmaps_enabled_server_side",py="$exception_capture_enabled_server_side",fy="$error_tracking_suppression_rules",my="$error_tracking_capture_extension_exceptions",gy="$web_vitals_enabled_server_side",Lb="$dead_clicks_enabled_server_side",Db="$product_tours_enabled_server_side",vy="$web_vitals_allowed_metrics",ao="$session_recording_remote_config",jE="$replay_sample_rate",zE="$replay_override_sampling",FE="$replay_override_linked_flag",UE="$replay_override_url_trigger",BE="$replay_override_event_trigger",bl="$sesid",Ib="$session_is_sampled",Ys="$enabled_feature_flags",pp="$active_feature_flags",dd="$early_access_features",_y="$feature_flag_details",fp="$feature_flag_payloads",yy="$feature_flag_request_id",bi="$override_feature_flags",hl="$override_feature_flag_payloads",Gs="$stored_person_properties",qs="$stored_group_properties",by="$surveys",uf="$surveys_loaded_at",ky="$surveys_activated",ud="ph_product_tours",Sd="$flag_call_reported",wy="$flag_call_reported_session_id",xy="$feature_flag_errors",Vd="$feature_flag_evaluated_at",vr="$user_state",Py="$client_session_props",Sy="$capture_rate_limit",Cy="$initial_campaign_params",Ty="$initial_referrer_info",hf="$initial_person_info",pf="$epp",$E="__POSTHOG_TOOLBAR__",jh="$posthog_cookieless",VE="$sdk_debug_extensions_init_method",HE="$sdk_debug_extensions_init_time_ms",WE="$sdk_debug_recording_script_not_loaded",Mb="PostHog loadExternalDependency extension not found.",Ks="on_reject",xi="always",nl="anonymous",al="identified",Ey="identified_only",ff="visibilitychange",mf="beforeunload",pl="$pageview",Av="$pageleave",Rv="$identify",YP="$groupidentify";function zh(t,e){it(t)&&t.forEach(e)}function Mt(t,e){if(!nt(t))if(it(t))t.forEach(e);else if(SG(t))t.forEach(((a,r)=>e(a,r)));else for(var n in t)oE.call(t,n)&&e(t[n],n)}var Bt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),a=1;e>a;a++)n[a-1]=arguments[a];for(var r of n)for(var s in r)r[s]!==void 0&&(t[s]=r[s]);return t};function mp(t){for(var e=Object.keys(t),n=e.length,a=new Array(n);n--;)a[n]=[e[n],t[e[n]]];return a}var ZP=function(t){try{return t()}catch{return}},mq=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),a=0;e>a;a++)n[a]=arguments[a];return t.apply(this,n)}catch(r){be.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),be.critical(r)}}},Nb=function(t){var e={};return Mt(t,(function(n,a){(Lt(n)&&n.length>0||Bn(n))&&(e[a]=n)})),e},gq=["herokuapp.com","vercel.app","netlify.app"];function vq(t){var e=t?.hostname;if(!Lt(e))return!1;var n=e.split(".").slice(-2).join(".");for(var a of gq)if(n===a)return!1;return!0}function tn(t,e,n,a){var r=a??{},s=r.capture,l=r.passive;t?.addEventListener(e,n,{capture:s!==void 0&&s,passive:l===void 0||l})}function GE(t){return t.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Bn(t)&&isFinite(t)&&Math.floor(t)===t});class gf{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,a,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(a)||!Number.isInteger(r)||0>e||0>n||0>a||0>r||e>0xffffffffffff||n>4095||a>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|n>>>8,s[7]=n,s[8]=128|a>>>24,s[9]=a>>>16,s[10]=a>>>8,s[11]=a,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new gf(s)}toString(){for(var e="",n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),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 gf(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;16>n;n++){var a=this.bytes[n]-e.bytes[n];if(a!==0)return Math.sign(a)}return 0}}class _q{constructor(){this.S=0,this.C=0,this.I=new yq}generate(){var e=this.generateOrAbort();if(ke(e)){this.S=0;var n=this.generateOrAbort();if(ke(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return gf.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var JP,qE=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Z&&!ke(Z.crypto)&&crypto.getRandomValues&&(qE=t=>crypto.getRandomValues(t));class yq{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(qE(this.R),this.O=0),this.R[this.O++]}}var wi=()=>bq().toString(),bq=()=>(JP||(JP=new _q)).generate(),Gc="",kq=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Fr={N:()=>!!xe,D(t){be.error("cookieStore error: "+t)},A(t){if(xe){try{for(var e=t+"=",n=xe.cookie.split(";").filter((s=>s.length)),a=0;n.length>a;a++){for(var r=n[a];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},F(t){var e;try{e=JSON.parse(Fr.A(t))||{}}catch{}return e},q(t,e,n,a,r){if(!xe)return!1;try{var s="",l="",c=(function(p,m){if(m){var v=(function(b,x){if(x===void 0&&(x=xe),Gc)return Gc;if(!x||["localhost","127.0.0.1"].includes(b))return"";for(var P=b.split("."),E=Math.min(P.length,8),L="dmn_chk_"+wi();!Gc&&E--;){var T=P.slice(E).join("."),A=L+"=1;domain=."+T+";path=/";x.cookie=A+";max-age=3",x.cookie.includes(L)&&(x.cookie=A+";max-age=0",Gc=T)}return Gc})(p);if(!v){var y=(b=>{var x=b.match(kq);return x?x[0]:""})(p);y!==v&&be.info("Warning: cookie subdomain discovery mismatch",y,v),v=y}return v?"; domain=."+v:""}return""})(xe.location.hostname,a);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),s="; expires="+u.toUTCString()}r&&(l="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+c+l;return h.length>3686.4&&be.warn("cookieStore warning: large cookie, len="+h.length),xe.cookie=h,!0}catch{return!1}},P(t,e){if(xe!=null&&xe.cookie)try{Fr.q(t,"",-1,e)}catch{return}}},Lv=null,It={N(){if(!la(Lv))return Lv;var t=!0;if(ke(Z))t=!1;else try{var e="__mplssupport__";It.q(e,"xyz"),It.A(e)!=='"xyz"'&&(t=!1),It.P(e)}catch{t=!1}return t||be.error("localStorage unsupported; falling back to cookie store"),Lv=t,t},D(t){be.error("localStorage error: "+t)},A(t){try{return Z?.localStorage.getItem(t)}catch(e){It.D(e)}return null},F(t){try{return JSON.parse(It.A(t))||{}}catch{}return null},q(t,e){try{return Z?.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){It.D(n)}return!1},P(t){try{Z?.localStorage.removeItem(t)}catch(e){It.D(e)}}},wq=[df,"distinct_id",bl,Ib,pf,hf,vr],Fh={},xq={N:()=>!0,D(t){be.error("memoryStorage error: "+t)},A:t=>Fh[t]||null,F:t=>Fh[t]||null,q:(t,e)=>(Fh[t]=e,!0),P(t){delete Fh[t]}},Fs=null,Fn={N(){if(!la(Fs))return Fs;if(Fs=!0,ke(Z))Fs=!1;else try{var t="__support__";Fn.q(t,"xyz"),Fn.A(t)!=='"xyz"'&&(Fs=!1),Fn.P(t)}catch{Fs=!1}return Fs},D(t){be.error("sessionStorage error: ",t)},A(t){try{return Z?.sessionStorage.getItem(t)}catch(e){Fn.D(e)}return null},F(t){try{return JSON.parse(Fn.A(t))||null}catch{}return null},q(t,e){try{return Z?.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Fn.D(n)}return!1},P(t){try{Z?.sessionStorage.removeItem(t)}catch(e){Fn.D(e)}}};class Pq{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.At()?0:this.$t}isOptedOut(){return this.Se.cookieless_mode===xi||this.isRejected()||this.consent===-1&&this.Se.cookieless_mode===Ks}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Nt.q(this.Dt,e?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Nt.P(this.Dt,this.Se.cross_subdomain_cookie)}get Dt(){var e=this._instance.config,n=e.token,a=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(a?a+n:"__ph_opt_in_out_"+n)}get $t(){var e=this.Nt.A(this.Dt);return wv(e)?1:Ke(AG,e)?0:-1}get Nt(){var e=this.Se.opt_out_capturing_persistence_type,n=e==="localStorage"?It:Fr;if(!this.qt||this.qt!==n){this.qt=n;var a=e==="localStorage"?Fr:It;a.A(this.Dt)&&(this.qt.A(this.Dt)||this.optInOut(wv(a.A(this.Dt))),a.P(this.Dt,this.Se.cross_subdomain_cookie))}return this.qt}At(){return!!this.Se.respect_dnt&&[sa?.doNotTrack,sa?.msDoNotTrack,Be.doNotTrack].some((e=>wv(e)))}}function KE(t,e){var n,a=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!yr(a))return e;try{var r=a(e);return Lt(r)&&r?r:e}catch(s){return be.error("Error in get_current_url, falling back to window.location.href",s),e}}var Sq=1,Cq=3,Tq=11;function QP(t){return t instanceof Element&&(t.id===$E||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function gs(t){return!!t&&t.nodeType===Sq}function Ra(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function YE(t){return!!t&&t.nodeType===Cq}function ZE(t){return!!t&&t.nodeType===Tq&&gs(t.host)}var JE=1e3;function Ob(t){return t?Gf(t).split(/\s+/):[]}function XP(t,e){var n=(function(a){var r,s=Z==null||(r=Z.location)==null?void 0:r.href;return ke(s)?void 0:KE(a,s)})(e);return!!(n&&t&&t.some((a=>n.match(a))))}function vf(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return Ob(e)}function QE(t){return nt(t)?null:Gf(t).split(/(\s+)/).filter((e=>Cd(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Hd(t){var e="";return Ry(t)&&!n6(t)&&t.childNodes&&t.childNodes.length&&Mt(t.childNodes,(function(n){var a;YE(n)&&n.textContent&&(e+=(a=QE(n.textContent))!==null&&a!==void 0?a:"")})),Gf(e)}function Dv(t){return ke(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var jb=["a","button","form","input","select","textarea","label"];function Ay(t,e){if(ke(e))return!0;var n,a=function(s){if(e.some((l=>(function(c,u){var h=c.matches||c.matchesSelector||c.msMatchesSelector||c.mozMatchesSelector||c.webkitMatchesSelector||c.oMatchesSelector;try{return!!h&&h.call(c,u)}catch{return!1}})(s,l))))return{v:!0}};for(var r of t)if(n=a(r))return n.v;return!1}function XE(t){var e=t.parentNode;return!(!e||!gs(e))&&e}var Eq=[".ph-no-autocapture","[data-ph-no-autocapture]"],e6=["next","previous","prev",">","<"],Aq=[...e6,"+","-","−","–"],eS=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,tS=[".ph-no-rageclick",".ph-no-capture"],Rq=["","text","search","email","password","url","tel","number"];function nS(t,e){if(!Z||zb(t))return!1;var n,a,r,s,l;if(Hr(e)?(n=!!e&&tS,a=void 0,r=!1):(n=(s=e?.css_selector_ignorelist)!==null&&s!==void 0?s:tS,a=e?.content_ignorelist,r=(l=e?.ignore_text_selection)!==null&&l!==void 0&&l),n===!1||r&&(function(u){return!(!u||!gs(u))&&(!!Ra(u,"textarea")||(Ra(u,"input")?Ke(Rq,(u.getAttribute("type")||"").toLowerCase()):(function(h){if(h.isContentEditable)return!0;var p=h.getAttribute==null?void 0:h.getAttribute("contenteditable");return p==="true"||p===""})(u)))})(t))return!1;var c=t6(t,!1).targetElementList;return!(function(u,h){if(u===!1||ke(u))return!1;var p;if(u===!0)p=e6;else{if(!it(u))return!1;if(u.length>10)return be.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;p=u.map((m=>m.toLowerCase()))}return h.some((m=>{var v=m.safeText,y=m.ariaLabel;return p.some((b=>eS(v,b)||eS(y,b)))}))})(a,c.map((u=>{var h;return{safeText:Hd(u).toLowerCase(),ariaLabel:((h=u.getAttribute("aria-label"))==null?void 0:h.toLowerCase().trim())||""}})))&&!Ay(c,n)}var zb=t=>!t||Ra(t,"html")||!gs(t),t6=(t,e)=>{if(!Z||zb(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,a=[t],r=t;r.parentNode&&!Ra(r,"body");)if(ZE(r.parentNode))a.push(r.parentNode.host),r=r.parentNode.host;else{var s=XE(r);if(!s)break;if(e||jb.indexOf(s.tagName.toLowerCase())>-1)n=!0;else try{var l=Z.getComputedStyle(s);l&&l.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}a.push(s),r=s}return{parentIsUsefulElement:n,targetElementList:a}};function Ry(t){for(var e=new Set,n=0,a=t;a.parentNode&&!Ra(a,"body");a=a.parentNode){if(n++>=JE||e.has(a))return!1;e.add(a);var r=vf(a);if(Ke(r,"ph-sensitive")||Ke(r,"ph-no-capture"))return!1}if(Ke(vf(t),"ph-include"))return!0;var s=t.type||"";if(Lt(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var l=t.name||t.id||"";return!Lt(l)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(l.replace(/[^a-zA-Z0-9]/g,""))}function n6(t){return!!(Ra(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Ra(t,"select")||Ra(t,"textarea")||t.getAttribute("contenteditable")==="true")}var a6="(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})",Lq=new RegExp("^(?:"+a6+")$"),Dq=new RegExp(a6),r6="\\d{3}-?\\d{2}-?\\d{4}",Iq=new RegExp("^("+r6+")$"),Mq=new RegExp("("+r6+")");function Cd(t,e){return e===void 0&&(e=!0),!(nt(t)||Lt(t)&&(t=Gf(t),(e?Lq:Dq).test((t||"").replace(/[- ]/g,""))||(e?Iq:Mq).test(t)))}function aS(t){var e=Hd(t);return Cd(e=(e+" "+i6(t)).trim())?e:""}function i6(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Mt(t.childNodes,(function(n){var a;if(n&&((a=n.tagName)==null?void 0:a.toLowerCase())==="span")try{var r=Hd(n);e=(e+" "+r).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+i6(n)).trim())}catch(s){be.error("[AutoCapture]",s)}})),e}function rS(t){return t.replace(/"|\\"/g,'\\"')}function Nq(t){var e=t.attr__class;return e?it(e)?e:Ob(e):void 0}var Uh=Zt("[Dead Clicks]"),Oq=()=>!0,jq=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(Lb)),a=t.instance.config.capture_dead_clicks;return Hr(a)?a:!!qt(a)||n};class iS{get lazyLoadedDeadClicksAutocapture(){return this.jt}constructor(e,n,a){this.instance=e,this.isEnabled=n,this.onCapture=a,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Lb]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Bt((()=>{this.Ht()})):this.stop()}Bt(e){var n,a;(n=Be.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(a=Be.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this.instance,"dead-clicks-autocapture",(r=>{r?Uh.error("failed to load script",r):e()}))}Ht(){var e;if(xe){if(!this.jt&&(e=Be.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=qt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.jt=Be.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.jt.start(xe),Uh.info("starting...")}}else Uh.error("`document` not found. Cannot start.")}stop(){this.jt&&(this.jt.stop(),this.jt=void 0,Uh.info("stopping..."))}}var Iv=Zt("[SegmentIntegration]"),s6="posthog-js";function o6(t,e){var n=e===void 0?{}:e,a=n.organization,r=n.projectId,s=n.prefix,l=n.severityAllowList,c=l===void 0?["error"]:l,u=n.sendExceptionsToPostHog,h=u===void 0||u;return p=>{var m,v,y,b,x;if(c!=="*"&&!c.includes(p.level)||!t.__loaded)return p;p.tags||(p.tags={});var P=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());p.tags["PostHog Person URL"]=P,t.sessionRecordingStarted()&&(p.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var E,L=((m=p.exception)==null?void 0:m.values)||[],T=L.map((D=>he({},D,{stacktrace:D.stacktrace?he({},D.stacktrace,{type:"raw",frames:(D.stacktrace.frames||[]).map((B=>he({},B,{platform:"web:javascript"})))}):void 0}))),A={$exception_message:((v=L[0])==null?void 0:v.value)||p.message,$exception_type:(y=L[0])==null?void 0:y.type,$exception_level:p.level,$exception_list:T,$sentry_event_id:p.event_id,$sentry_exception:p.exception,$sentry_exception_message:((b=L[0])==null?void 0:b.value)||p.message,$sentry_exception_type:(x=L[0])==null?void 0:x.type,$sentry_tags:p.tags};return a&&r&&(A.$sentry_url=(s||"https://sentry.io/organizations/")+a+"/issues/?project="+r+"&query="+p.event_id),h&&((E=t.exceptions)==null||E.sendExceptionEvent(A)),p}}class zq{constructor(e,n,a,r,s,l){this.name=s6,this.setupOnce=function(c){c(o6(e,{organization:n,projectId:a,prefix:r,severityAllowList:s,sendExceptionsToPostHog:l==null||l}))}}}class sS{constructor(e){this.Ut=(n,a,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(be.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:r}),this.zt=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Wt()}Wt(){var e;this.Vt=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Ut)}destroy(){var e;(e=this.Vt)==null||e.call(this),this.Vt=void 0}doPageView(e,n){var a,r=this.Zt(e,n);return this.zt={pathname:(a=Z?.location.pathname)!==null&&a!==void 0?a:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var n;return this.Zt(e,(n=this.zt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.zt)==null?void 0:e.pageViewId}}Zt(e,n){var a=this.zt;if(!a)return{$pageview_id:n};var r={$pageview_id:n,$prev_pageview_id:a.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var l=s.maxScrollHeight,c=s.lastScrollY,u=s.maxScrollY,h=s.maxContentHeight,p=s.lastContentY,m=s.maxContentY;if(!(ke(l)||ke(c)||ke(u)||ke(h)||ke(p)||ke(m))){l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),h=Math.ceil(h),p=Math.ceil(p),m=Math.ceil(m);var v=l>1?Br(c/l,0,1,be):1,y=l>1?Br(u/l,0,1,be):1,b=h>1?Br(p/h,0,1,be):1,x=h>1?Br(m/h,0,1,be):1;r=Bt(r,{$prev_pageview_last_scroll:c,$prev_pageview_last_scroll_percentage:v,$prev_pageview_max_scroll:u,$prev_pageview_max_scroll_percentage:y,$prev_pageview_last_content:p,$prev_pageview_last_content_percentage:b,$prev_pageview_max_content:m,$prev_pageview_max_content_percentage:x})}}return a.pathname&&(r.$prev_pageview_pathname=a.pathname),a.timestamp&&(r.$prev_pageview_duration=(e.getTime()-a.timestamp.getTime())/1e3),r}}var Bh=["flags","surveys"],Fq={[OE]:{exposure:"hidden"},[ld]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[cd]:{exposure:"hidden"},[uy]:{exposure:"event"},[hy]:{exposure:"hidden"},[py]:{exposure:"event"},[fy]:{exposure:"hidden"},[my]:{exposure:"event"},[gy]:{exposure:"event"},[Lb]:{exposure:"event"},[Db]:{exposure:"hidden"},[vy]:{exposure:"event"},[ao]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[bl]:{exposure:"hidden"},[Ib]:{exposure:"event"},[jE]:{exposure:"event",shouldSkipFromEventProperties:t=>la(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[Ys]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!qt(t))return{};for(var e={},n=Object.keys(t),a=0;n.length>a;a++)e["$feature/"+n[a]]=t[n[a]];return e}},[pp]:{exposure:"event",storageGroup:"flags"},[dd]:{exposure:"hidden"},[_y]:{exposure:"hidden",storageGroup:"flags"},[fp]:{exposure:"event",storageGroup:"flags"},[yy]:{exposure:"event",storageGroup:"flags",volatile:!0},[bi]:{exposure:"event"},[hl]:{exposure:"hidden"},[Gs]:{exposure:"hidden"},[qs]:{exposure:"hidden"},[by]:{exposure:"hidden",storageGroup:"surveys"},[uf]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ky]:{exposure:"event"},[ud]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Sd]:{exposure:"hidden"},[wy]:{exposure:"hidden"},[xy]:{exposure:"hidden"},[Vd]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[vr]:{exposure:"hidden"},[Py]:{exposure:"hidden"},[Sy]:{exposure:"hidden"},[Cy]:{exposure:"hidden"},[Ty]:{exposure:"hidden"},[hf]:{exposure:"hidden"},[pf]:{exposure:"hidden"},[zE]:{exposure:"event"},[FE]:{exposure:"event"},[UE]:{exposure:"event"},[BE]:{exposure:"event"},[VE]:{exposure:"event"},[HE]:{exposure:"event"},[WE]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Uq=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Us=t=>{var e=Fq[t];if(e)return e;for(var n of Uq){var a=n[1];if(t.indexOf(n[0])===0)return a}},Wd=t=>{var e=xe?.createElement("a");return ke(e)?null:(e.href=t,e)},zl=function(t,e){for(var n,a=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;a.length>r;r++){var s=a[r].split("=");if(s[0]===e){n=s;break}}if(!it(n)||2>n.length)return"";var l=n[1];try{l=decodeURIComponent(l)}catch{be.error("Skipping decoding for malformed query param: "+l)}return l.replace(/\+/g," ")},Gd=function(t,e,n){if(!t||!e||!e.length)return t;for(var a=t.split("#"),r=a[1],s=(a[0]||"").split("?"),l=s[1],c=s[0],u=(l||"").split("&"),h=[],p=0;u.length>p;p++){var m=u[p].split("=");it(m)&&(e.includes(m[0])?h.push(m[0]+"="+n):h.push(u[p]))}var v=c;return l!=null&&(v+="?"+h.join("&")),r!=null&&(v+="#"+r),v},_f=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},l6=(t,e)=>t>=e&&nE(),c6=(t,e,n,a)=>{if(t===0){if(nE()){var r=e+1;return r===n&&a(),r}return e}return 0},$h="https?://(.*)",Fl=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Bq=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Fl],qd="<masked>",$q=["li_fat_id"];function d6(t,e,n){if(!xe)return{};var a,r=e?[...Fl,...n||[]]:[],s=u6(Gd(xe.URL,r,qd),t),l=(a={},Mt($q,(function(c){var u=Fr.A(c);a[c]=u||null})),a);return Bt(l,s)}function u6(t,e){var n=Bq.concat(e||[]),a={};return Mt(n,(function(r){var s=zl(t,r);a[r]=s||null})),a}function h6(t){var e=(function(s){return s?s.search($h+"google.([^/?]*)")===0?"google":s.search($h+"bing.com")===0?"bing":s.search($h+"yahoo.com")===0?"yahoo":s.search($h+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",a={};if(!la(e)){a.$search_engine=e;var r=xe?zl(xe.referrer,n):"";r.length&&(a.ph_keyword=r)}return a}function oS(){return navigator.language||navigator.userLanguage}var yf="$direct";function p6(){return xe?.referrer||yf}function f6(t,e,n){n===void 0&&(n=!1);var a=t?[...Fl,...e||[]]:[],r=n?ms(fn?.href):fn?.href,s=r?.substring(0,1e3);return{r:p6().substring(0,1e3),u:s?Gd(s,a,qd):void 0}}function m6(t,e){var n;e===void 0&&(e=!1);var a=t.r,r=t.u,s=e?ms(r):r,l={$referrer:a,$referring_domain:a==null?void 0:a==yf?yf:(n=Wd(a))==null?void 0:n.host};if(s){l.$current_url=s;var c=Wd(s);l.$host=c?.host,l.$pathname=c?.pathname;var u=u6(s);Bt(l,u)}if(a){var h=h6(a);Bt(l,h)}return l}function g6(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Vq(){try{return new Date().getTimezoneOffset()}catch{return}}var Hq={flags:Vd,surveys:uf},Wq=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],rl="main";class Mv{constructor(e,n,a){if(a===void 0&&(a=!0),this.Gt={},this.Qt=!1,this.Jt=!1,this.Se=e,this.Kt=a,this.props={},this.Yt=!1,this.Xt=(s=>{var l="";return s.token&&(l=s.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),s.persistence_name?"ph_"+s.persistence_name:"ph_"+l+"_posthog"})(e),this.Nt=this.er(e),this.Jt=this.tr(e),this.load(),e.debug&&be.info("Persistence loaded",e.persistence,he({},this.props)),this.update_config(e,e,n),this.save(),Z){var r=()=>this.flush();tn(Z,"beforeunload",r,{capture:!1}),tn(Z,"pagehide",r,{capture:!1})}}rr(){var e,n=(e=this.Se)==null?void 0:e.persistence_save_debounce_ms;return Bn(n)&&n>0?n:0}isDisabled(){return!!this.ir}er(e){Wq.indexOf(e.persistence.toLowerCase())===-1&&(be.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,a=(function(l,c){l===void 0&&(l=[]),c===void 0&&(c=!1);var u=[...wq,...l];return he({},It,{F(h){try{var p={};try{p=Fr.F(h)||{}}catch{}var m,v=JSON.parse(It.A(h)||"{}");if(c){var y={};for(var b in p){var x=p[b];la(x)||x===""||(y[b]=x)}m=Bt(v,y)}else m=Bt(p,v);return It.q(h,m),m}catch{}return null},q(h,p,m,v,y,b){var x=It.q(h,p,void 0,void 0,b);try{var P={};u.forEach((E=>{p[E]&&(P[E]=p[E])})),Object.keys(P).length&&Fr.q(h,P,m,v,y,b)}catch(E){It.D(E)}return x},P(h,p){try{Z?.localStorage.removeItem(h),Fr.P(h,p)}catch(m){It.D(m)}}})})(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),r=!1,s=e.persistence.toLowerCase();return s==="localstorage"&&It.N()?(n=It,r=!0):s==="localstorage+cookie"&&a.N()?(n=a,r=!0):s==="sessionstorage"&&Fn.N()?n=Fn:s==="memory"?n=xq:s==="cookie"?n=Fr:a.N()?(n=a,r=!0):n=Fr,this.Qt=r,n}nr(e){return this.Xt+"__"+e}tr(e){return this.Qt&&!!e.split_storage}sr(e){var n=e??this.Se.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var a=this.props[Vd];return!a||typeof a!="number"||Date.now()-a>n}properties(){var e={};return Mt(this.props,((n,a)=>{var r=Us(a);if(r?.exposure==="derived"){if(r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(n,a===Ys?()=>this.sr():()=>!1))return;r.transformToEventProperties&&Bt(e,r.transformToEventProperties(n))}else if(!r||r.exposure==="event"){if(r!=null&&r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(n,(()=>!1)))return;e[a]=n}})),e}load(){if(!this.ir){var e=this.Nt.F(this.Xt);e&&(this.props=Bt({},e)),this.Jt&&this.ar()}}ar(){for(var e of Bh){var n=It.F(this.nr(e));if(n&&!cs(n)){var a=this.lr(e);a.persisted=!0,this.ur(e)||(a.fingerprint=this.hr(n,e)),this.dr(e,n)||Bt(this.props,n)}}}ur(e){return Object.keys(this.props).some((n=>{var a;return((a=Us(n))==null?void 0:a.storageGroup)===e}))}dr(e,n){var a=Hq[e];if(!a)return!1;var r=n[a],s=this.props[a];return Bn(r)&&Bn(s)&&s>r}refreshKey(e){var n;if(!this.ir){var a=this.Jt?(n=Us(e))==null?void 0:n.storageGroup:void 0,r=a?It.F(this.nr(a)):this.Nt.F(this.Xt);if(r&&e in r)this.cr(e,r[e]);else{if(a){var s=this.Nt.F(this.Xt);if(s&&e in s)return void this.cr(e,s[e])}this.vr(e)}}}save(){if(!this.ir){var e=this.rr();e>0?ke(this.pr)&&(this.pr=setTimeout((()=>{this.pr=void 0,this.gr()}),e)):this.gr()}}flush(){ke(this.pr)||(clearTimeout(this.pr),this.pr=void 0,this.gr())}gr(){this.ir||(this.Jt?this.mr():this.yr(this.Nt,this.Xt,this.props,rl))}mr(){var e=this.br(),n=e.main,a=e.groups;for(var r of(this.yr(this.Nt,this.Xt,n,rl),Bh)){var s,l=a[r];(!cs(l)||(s=this.Gt[r])!=null&&s.persisted)&&this.yr(It,this.nr(r),l,r)}}br(){var e={},n={};for(var a of Bh)n[a]={};return Mt(this.props,((r,s)=>{var l,c=(l=Us(s))==null?void 0:l.storageGroup;c?n[c][s]=r:e[s]=r})),{main:e,groups:n}}hr(e,n){if(n===rl)return JSON.stringify(e)+"|"+this._r+"|"+this.wr+"|"+this.kr;var a={};return Mt(e,((r,s)=>{var l;a[s]=(l=Us(s))!=null&&l.volatile?"__volatile__":r})),JSON.stringify(a)}yr(e,n,a,r){var s=this.lr(r);if(r===rl||s.dirty||ke(s.fingerprint)){var l;try{if((l=this.hr(a,r))===s.fingerprint)return void(s.dirty=!1)}catch{l=void 0}e.q(n,a,this._r,this.wr,this.kr,this.Se.debug)?(s.dirty=!1,r!==rl&&(s.persisted=!0),ke(l)||(s.fingerprint=l)):this.Se.debug&&be.warn('failed to persist storage entry "'+n+'"; will retry on next save')}}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,a=n!==void 0&&n;if(ke(this.pr)||(clearTimeout(this.pr),this.pr=void 0),this.Nt.P(this.Xt,!1),this.Nt.P(this.Xt,!0),!a&&this.Kt)for(var r of Bh)It.P(this.nr(r));a?delete this.Gt[rl]:this.Gt={}}clear(){this.remove(),this.props={}}register_once(e,n,a){if(qt(e)){ke(n)&&(n="None"),this._r=ke(a)?this.Sr:a;var r=!1;if(Mt(e,((s,l)=>{this.props.hasOwnProperty(l)&&this.props[l]!==n||(this.cr(l,s),r=!0)})),r)return this.save(),!0}return!1}register(e,n){if(qt(e)){this._r=ke(n)?this.Sr:n;var a=!1;if(Mt(e,((r,s)=>{e.hasOwnProperty(s)&&this.props[s]!==r&&(this.cr(s,r),a=!0)})),a)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.vr(e),this.save())}update_campaign_params(){if(!this.Yt){var e=d6(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);cs(Nb(e))||this.register(e),this.Yt=!0}}update_search_keyword(){var e;this.register((e=xe?.referrer)?h6(e):{})}update_referrer_info(){var e;this.register_once({$referrer:p6(),$referring_domain:xe!=null&&xe.referrer&&((e=Wd(xe.referrer))==null?void 0:e.host)||yf},void 0)}set_initial_person_info(){this.props[Cy]||this.props[Ty]||this.register_once({[hf]:f6(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};Mt([Ty,Cy],(r=>{var s=this.props[r];s&&Mt(s,(function(l,c){e["$initial_"+ry(c)]=l}))}));var n=this.props[hf];if(n){var a=(function(r,s){s===void 0&&(s=!1);var l=m6(r,s),c={};return Mt(l,(function(u,h){c["$initial_"+ry(h)]=u})),c})(n,this.Se.disable_capture_url_hashes);Bt(e,a)}return e}safe_merge(e){return Mt(this.props,(function(n,a){a in e||(e[a]=n)})),e}update_config(e,n,a){this.Sr=this._r=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var r=e.persistence!==n.persistence||!((u,h)=>{if(u.length!==h.length)return!1;var p=[...u].sort(),m=[...h].sort();return p.every(((v,y)=>v===m[y]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),s=r?this.er(e):this.Nt,l=this.tr(e);if(r||l!==this.Jt){var c=this.props;this.clear(),this.Nt=s,this.Jt=l,this.props=c,this.save()}}set_disabled(e){this.ir=e,this.ir?this.remove():this.save()}set_cross_subdomain(e){e!==this.wr&&(this.wr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.kr&&(this.kr=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var a=this.props[cd]||{};a[e]=n,this.cr(cd,a),this.save()}remove_event_timer(e){var n=this.props[cd]||{},a=n[e];return ke(a)||(delete n[e],this.cr(cd,n),this.save()),a}get_property(e){return this.props[e]}set_property(e,n){this.cr(e,n),this.save()}cr(e,n){var a;this.props[e]=n,(a=Us(e))!=null&&a.volatile||this.Cr(e)}vr(e){delete this.props[e],this.Cr(e)}Cr(e){var n,a=(n=Us(e))==null?void 0:n.storageGroup;a&&(this.lr(a).dirty=!0)}lr(e){return this.Gt[e]||(this.Gt[e]={})}}var qc={Activation:"events",Cancellation:"cancelEvents"},Nv={Popover:"popover",API:"api",Widget:"widget"},Pi={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Ov={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Ly={Popover:"popover",Inline:"inline"},Gq={SHOWN:"product tour shown"},lS={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},cS=Zt("[RateLimiter]");class qq{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var a=n.text;if(a&&a.length)try{(JSON.parse(a).quota_limited||[]).forEach((r=>{cS.info((r||"events")+" is quota limited."),this.serverLimits[r]=new Date().getTime()+6e4}))}catch(r){return void cS.warn('could not rate limit - continuing. Error: "'+r?.message+'"',{text:a})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,a,r;e===void 0&&(e=!1);var s=this.captureEventsBurstLimit,l=this.captureEventsPerSecond,c=new Date().getTime(),u=(n=(a=this.instance.persistence)==null?void 0:a.get_property(Sy))!==null&&n!==void 0?n:{tokens:s,last:c};u.tokens+=(c-u.last)/1e3*l,u.last=c,u.tokens>s&&(u.tokens=s);var h=1>u.tokens;return h||e||(u.tokens=Math.max(0,u.tokens-1)),!h||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+l+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=h,(r=this.instance.persistence)==null||r.set_property(Sy,u),{isRateLimited:h,remainingTokens:u.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Kc=Zt("[RemoteConfig]");class v6{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Be._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Tr(e){var n,a;(n=Be.__PosthogExtensions__)!=null&&n.loadExternalDependency?(a=Be.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}Ir(e){this._instance._send_request({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 Kc.info("Using preloaded remote config",this.remoteConfig),this.Mr(this.remoteConfig),void this.Er();if(this._instance.Rr())return void Kc.warn("Remote config is disabled. Falling back to local config.");this.Tr((e=>{if(!e)return Kc.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ir((n=>{this.Mr(n),this.Er()}));this.Mr(e),this.Er()}))}catch(e){Kc.error("Error loading remote config",e)}}stop(){this.Pr&&(clearInterval(this.Pr),this.Pr=void 0)}refresh(){!this._instance.Rr()&&xe&&xe.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Er(){var e;if(!this.Pr){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.Pr=setInterval((()=>{this.refresh()}),n))}}Mr(e){var n;e||Kc.error("Failed to fetch remote config from PostHog."),this._instance.Mr(e??{}),e?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var aa={GZipJS:"gzip-js",Base64:"base64"},Qa=Uint8Array,_a=Uint16Array,Ul=Uint32Array,Fb=new Qa([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]),Ub=new Qa([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]),dS=new Qa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_6=function(t,e){for(var n=new _a(31),a=0;31>a;++a)n[a]=e+=1<<t[a-1];var r=new Ul(n[30]);for(a=1;30>a;++a)for(var s=n[a];n[a+1]>s;++s)r[s]=s-n[a]<<5|a;return[n,r]},y6=_6(Fb,2),Dy=y6[1];y6[0][28]=258,Dy[258]=28;for(var uS=_6(Ub,0)[1],b6=new _a(32768),Yt=0;32768>Yt;++Yt){var il=(43690&Yt)>>>1|(21845&Yt)<<1;b6[Yt]=((65280&(il=(61680&(il=(52428&il)>>>2|(13107&il)<<2))>>>4|(3855&il)<<4))>>>8|(255&il)<<8)>>>1}var Td=function(t,e,n){for(var a=t.length,r=0,s=new _a(e);a>r;++r)++s[t[r]-1];var l,c=new _a(e);for(r=0;e>r;++r)c[r]=c[r-1]+s[r-1]<<1;for(l=new _a(a),r=0;a>r;++r)l[r]=b6[c[t[r]-1]++]>>>15-t[r];return l},_o=new Qa(288);for(Yt=0;144>Yt;++Yt)_o[Yt]=8;for(Yt=144;256>Yt;++Yt)_o[Yt]=9;for(Yt=256;280>Yt;++Yt)_o[Yt]=7;for(Yt=280;288>Yt;++Yt)_o[Yt]=8;var bf=new Qa(32);for(Yt=0;32>Yt;++Yt)bf[Yt]=5;var Kq=Td(_o,9),Yq=Td(bf,5),k6=function(t){return(t/8>>0)+(7&t&&1)},w6=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var a=new(t instanceof _a?_a:t instanceof Ul?Ul:Qa)(n-e);return a.set(t.subarray(e,n)),a},fi=function(t,e,n){var a=e/8>>0;t[a]|=n<<=7&e,t[a+1]|=n>>>8},Yc=function(t,e,n){var a=e/8>>0;t[a]|=n<<=7&e,t[a+1]|=n>>>8,t[a+2]|=n>>>16},jv=function(t,e){for(var n=[],a=0;t.length>a;++a)t[a]&&n.push({s:a,f:t[a]});var r=n.length,s=n.slice();if(!r)return[new Qa(0),0];if(r==1){var l=new Qa(n[0].s+1);return l[n[0].s]=1,[l,1]}n.sort((function(D,B){return D.f-B.f})),n.push({s:-1,f:25001});var c=n[0],u=n[1],h=0,p=1,m=2;for(n[0]={s:-1,f:c.f+u.f,l:c,r:u};p!=r-1;)c=n[n[m].f>n[h].f?h++:m++],u=n[h!=p&&n[m].f>n[h].f?h++:m++],n[p++]={s:-1,f:c.f+u.f,l:c,r:u};var v=s[0].s;for(a=1;r>a;++a)s[a].s>v&&(v=s[a].s);var y=new _a(v+1),b=Iy(n[p-1],y,0);if(b>e){a=0;var x=0,P=b-e,E=1<<P;for(s.sort((function(D,B){return y[B.s]-y[D.s]||D.f-B.f}));r>a;++a){var L=s[a].s;if(e>=y[L])break;x+=E-(1<<b-y[L]),y[L]=e}for(x>>>=P;x>0;){var T=s[a].s;e>y[T]?x-=1<<e-y[T]++-1:++a}for(;a>=0&&x;--a){var A=s[a].s;y[A]==e&&(--y[A],++x)}b=e}return[new Qa(y),b]},Iy=function(t,e,n){return t.s==-1?Math.max(Iy(t.l,e,n+1),Iy(t.r,e,n+1)):e[t.s]=n},hS=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new _a(++e),a=0,r=t[0],s=1,l=function(u){n[a++]=u},c=1;e>=c;++c)if(t[c]==r&&c!=e)++s;else{if(!r&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(r),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(r);s=1,r=t[c]}return[n.subarray(0,a),e]},Zc=function(t,e){for(var n=0,a=0;e.length>a;++a)n+=t[a]*e[a];return n},My=function(t,e,n){var a=n.length,r=k6(e+2);t[r]=255&a,t[r+1]=a>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;a>s;++s)t[r+s+4]=n[s];return 8*(r+4+a)},pS=function(t,e,n,a,r,s,l,c,u,h,p){fi(e,p++,n),++r[256];for(var m=jv(r,15),v=m[0],y=m[1],b=jv(s,15),x=b[0],P=b[1],E=hS(v),L=E[0],T=E[1],A=hS(x),D=A[0],B=A[1],j=new _a(19),S=0;L.length>S;++S)j[31&L[S]]++;for(S=0;D.length>S;++S)j[31&D[S]]++;for(var N=jv(j,7),U=N[0],Q=N[1],ee=19;ee>4&&!U[dS[ee-1]];--ee);var ce,le,re,te,ie=h+5<<3,$=Zc(r,_o)+Zc(s,bf)+l,X=Zc(r,v)+Zc(s,x)+l+14+3*ee+Zc(j,U)+(2*j[16]+3*j[17]+7*j[18]);if($>=ie&&X>=ie)return My(e,p,t.subarray(u,u+h));if(fi(e,p,1+($>X)),p+=2,$>X){ce=Td(v,y),le=v,re=Td(x,P),te=x;var W=Td(U,Q);for(fi(e,p,T-257),fi(e,p+5,B-1),fi(e,p+10,ee-4),p+=14,S=0;ee>S;++S)fi(e,p+3*S,U[dS[S]]);p+=3*ee;for(var O=[L,D],Y=0;2>Y;++Y){var ae=O[Y];for(S=0;ae.length>S;++S)fi(e,p,W[_e=31&ae[S]]),p+=U[_e],_e>15&&(fi(e,p,ae[S]>>>5&127),p+=ae[S]>>>12)}}else ce=Kq,le=_o,re=Yq,te=bf;for(S=0;c>S;++S)if(a[S]>255){var _e;Yc(e,p,ce[257+(_e=a[S]>>>18&31)]),p+=le[_e+257],_e>7&&(fi(e,p,a[S]>>>23&31),p+=Fb[_e]);var fe=31&a[S];Yc(e,p,re[fe]),p+=te[fe],fe>3&&(Yc(e,p,a[S]>>>5&8191),p+=Ub[fe])}else Yc(e,p,ce[a[S]]),p+=le[a[S]];return Yc(e,p,ce[256]),p+le[256]},Zq=new Ul([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Jq=(function(){for(var t=new Ul(256),e=0;256>e;++e){for(var n=e,a=9;--a;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),zv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function Qq(t,e){e===void 0&&(e={});var n=(function(){var m=4294967295;return{p(v){for(var y=m,b=0;v.length>b;++b)y=Jq[255&y^v[b]]^y>>>8;m=y},d(){return 4294967295^m}}})(),a=t.length;n.p(t);var r,s,l,c,u,h=(c=10+((r=e).filename&&r.filename.length+1||0),u=8,(function(m,v,y,b,x,P){var E=m.length,L=new Qa(b+E+5*(1+Math.floor(E/7e3))+x),T=L.subarray(b,L.length-x),A=0;if(!v||8>E)for(var D=0;E>=D;D+=65535){var B=D+65535;E>B?A=My(T,A,m.subarray(D,B)):(T[D]=!0,A=My(T,A,m.subarray(D,E)))}else{for(var j=Zq[v-1],S=j>>>13,N=8191&j,U=(1<<y)-1,Q=new _a(32768),ee=new _a(U+1),ce=Math.ceil(y/3),le=2*ce,re=function(xr){return(m[xr]^m[xr+1]<<ce^m[xr+2]<<le)&U},te=new Ul(25e3),ie=new _a(288),$=new _a(32),X=0,W=0,O=(D=0,0),Y=0,ae=0;E>D;++D){var _e=re(D),fe=32767&D,ve=ee[_e];if(Q[fe]=ve,ee[_e]=fe,D>=Y){var Ne=E-D;if((X>7e3||O>24576)&&Ne>423){A=pS(m,T,0,te,ie,$,W,O,ae,D-ae,A),O=X=W=0,ae=D;for(var Oe=0;286>Oe;++Oe)ie[Oe]=0;for(Oe=0;30>Oe;++Oe)$[Oe]=0}var Ie=2,St=0,un=N,jt=fe-ve&32767;if(Ne>2&&_e==re(D-jt))for(var _t=Math.min(S,Ne)-1,Jt=Math.min(32767,D),nr=Math.min(258,Ne);Jt>=jt&&--un&&fe!=ve;){if(m[D+Ie]==m[D+Ie-jt]){for(var Mn=0;nr>Mn&&m[D+Mn]==m[D+Mn-jt];++Mn);if(Mn>Ie){if(Ie=Mn,St=jt,Mn>_t)break;var Vt=Math.min(jt,Mn-2),Xe=0;for(Oe=0;Vt>Oe;++Oe){var ot=D-jt+Oe+32768&32767,Dt=ot-Q[ot]+32768&32767;Dt>Xe&&(Xe=Dt,ve=ot)}}}jt+=(fe=ve)-(ve=Q[fe])+32768&32767}if(St){te[O++]=268435456|Dy[Ie]<<18|uS[St];var Et=31&Dy[Ie],Nn=31&uS[St];W+=Fb[Et]+Ub[Nn],++ie[257+Et],++$[Nn],Y=D+Ie,++X}else te[O++]=m[D],++ie[m[D]]}}A=pS(m,T,!0,te,ie,$,W,O,ae,D-ae,A)}return w6(L,0,b+k6(A)+x)})(s=t,(l=e).level==null?6:l.level,l.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+l.mem,c,u)),p=h.length;return(function(m,v){var y=v.filename;if(m[0]=31,m[1]=139,m[2]=8,m[8]=2>v.level?4:v.level==9?2:0,m[9]=3,v.mtime!=0&&zv(m,4,Math.floor(new Date(v.mtime||Date.now())/1e3)),y){m[3]=8;for(var b=0;y.length>=b;++b)m[b+10]=y.charCodeAt(b)}})(h,e),zv(h,p-8,n.d()),zv(h,p-4,a),h}var Xq=!!ty||!!Sb,x6="text/plain",gp=!1,Ny=(t,e)=>{var n=t.split("#"),a=n[1],r=n[0].split("?"),s=r[0],l=r[1];if(!l)return t;var c=l.split("&").filter((u=>u.split("=")[0]!==e)).join("&");return s+(c?"?"+c:"")+(a?"#"+a:"")},Bb=function(t,e,n){var a;n===void 0&&(n=!0);var r=t.split("?"),s=r[0],l=r[1],c=he({},e),u=(a=l?.split("&").map((p=>{var m,v=p.split("="),y=v[0],b=n&&(m=c[y])!==null&&m!==void 0?m:v[1];return delete c[y],y+"="+b})))!==null&&a!==void 0?a:[],h=(function(p,m){var v,y;m===void 0&&(m="&");var b=[];return Mt(p,(function(x,P){ke(x)||ke(P)||P==="undefined"||(v=encodeURIComponent((E=>E instanceof File)(x)?x.name:x.toString()),y=encodeURIComponent(P),b[b.length]=y+"="+v)})),b.join(m)})(c);return h&&u.push(h),s+"?"+u.join("&")},kl=(t,e)=>{try{return JSON.stringify(t,((n,a)=>typeof a=="bigint"?a.toString():a),e)}catch{return iE(t)}},Fv=t=>{if(t.Lt)return t.Lt;var e=t.data,n=t.compression;if(e){if(n===aa.GZipJS){var a=Qq((function(c,u){var h=c.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(c);for(var p=new Qa(c.length+(c.length>>>1)),m=0,v=function(P){p[m++]=P},y=0;h>y;++y){if(m+5>p.length){var b=new Qa(m+8+(h-y<<1));b.set(p),p=b}var x=c.charCodeAt(y);128>x?v(x):2048>x?(v(192|x>>>6),v(128|63&x)):x>55295&&57344>x?(v(240|(x=65536+(1047552&x)|1023&c.charCodeAt(++y))>>>18),v(128|x>>>12&63),v(128|x>>>6&63),v(128|63&x)):(v(224|x>>>12),v(128|x>>>6&63),v(128|63&x))}return w6(p,0,m)})(kl(e)),{mtime:0});return{contentType:x6,body:a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength),estimatedSize:a.byteLength}}if(n===aa.Base64){var r=(function(c){return c&&btoa(encodeURIComponent(c).replace(/%([0-9A-F]{2})/g,((u,h)=>String.fromCharCode(parseInt(h,16)))))})(kl(e)),s=(c=>"data="+encodeURIComponent(typeof c=="string"?c:kl(c)))(r);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var l=kl(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},P6=t=>{var e,n,a=()=>t.transport==="sendBeacon"?{url:Bb(t.url,{compression:aa.Base64}),encodedBody:Fv(he({},t,{compression:aa.Base64,Lt:void 0}))}:{url:Ny(t.url,"compression"),encodedBody:Fv(he({},t,{compression:void 0,Lt:void 0}))};try{e=Fv(t)}catch(r){if(zP(t.compression,zl(t.url,"compression")))return be.error("Failed to gzip request body, sending uncompressed payload",r),a();throw r}return e&&zP(t.compression,zl(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?ny(new Uint8Array(n)):ArrayBuffer.isView(n)&&ny(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(gp=!0,a()):{url:t.url,encodedBody:e}},S6=t=>{try{return P6(t)}catch(e){return be.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},eK=(function(){var t=cn((function*(e){var n=kl(e.data),a=yield(function(s,l,c){return ay.apply(this,arguments)})(n,en.DEBUG,{rethrow:!0});if(!a)return e;var r=yield a.arrayBuffer();return he({},e,{Lt:{contentType:x6,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),tK=/Failed to fetch|NetworkError|Load failed/i,C6=t=>{var e,n=S6(t);if(n){var a=n.url,r=n.encodedBody,s=r??{},l=s.contentType,c=s.body,u=s.estimatedSize,h=new Headers;Mt(t.headers,(function(y,b){h.append(b,y)})),l&&h.append("Content-Type",l);var p=null,m=!1;if(LP){var v=new LP;p={signal:v.signal,timeout:setTimeout((()=>{var y,b;m=!0,v.abort((y=t.timeout,(b=new Error("PostHog request timed out"+(y?" after "+y+"ms":""))).name="AbortError",b))}),t.timeout)}}Sb(a,he({method:t?.method||"GET",headers:h,keepalive:t.method==="POST"&&!t.Ft&&52428.8>(u||0),body:c,signal:(e=p)==null?void 0:e.signal},t.fetchOptions)).then((y=>y.text().then((b=>{var x={statusCode:y.status,text:b};if(y.status===200)try{x.json=JSON.parse(b)}catch(P){be.error(P)}t.callback==null||t.callback(x)})))).catch((y=>{m&&y?.name==="AbortError"||(b=>b?.name==="TypeError"&&tK.test(b?.message||""))(y)?be.warn(y):be.error(y),t.callback==null||t.callback({statusCode:0,error:y})})).finally((()=>p?clearTimeout(p.timeout):null))}},Oy=t=>{try{var e=P6(t),n=e.url,a=e.encodedBody,r=a??{},s=r.body,l=r.estimatedSize;if(!s)return;var c=s instanceof Blob?s:new Blob([s],{type:r.contentType});if(sa.sendBeacon(n,c))return;if(it(t.data)&&t.data.length>1&&(l??0)>16384){var u=Math.ceil(t.data.length/2);return Oy(he({},t,{data:t.data.slice(0,u)})),void Oy(he({},t,{data:t.data.slice(u)}))}be.warn("Beacon of ~"+(l??0)+" bytes was rejected by the browser, falling back to fetch"),C6(he({},t,{Ft:!0}))}catch(h){be.warn("Beacon send failed",h)}},nK=["/e/","/s/"],fS=(t,e)=>{var n=(r=>{var s=(l=>{var c=Wd(l),u=c?.pathname||l.split(/[?#]/)[0];return u?u[0]==="/"?u:"/"+u:"/"})(r);return nK.some((l=>((c,u)=>c.slice(c.length-u.length)===u)(s,l)))})(t),a=n?Ny(t,"ver"):t;return Bb(e===aa.GZipJS?Ny(a,"compression"):a,he({_:new Date().getTime().toString()},n?{}:{ver:en.JS_SDK_VERSION},e===aa.GZipJS?{}:{compression:e}))},vp=[];Sb&&vp.push({transport:"fetch",method:C6}),ty&&vp.push({transport:"XHR",method(t){var e=S6(t);if(e){var n=new ty,a=e.encodedBody;n.open(t.method||"GET",e.url,!0);var r=a??{},s=r.contentType,l=r.body;Mt(t.headers,(function(c,u){n.setRequestHeader(u,c)})),s&&n.setRequestHeader("Content-Type",s),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var c={statusCode:n.status,text:n.responseText};if(n.status===200)try{c.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(c)}},n.send(l)}}}),sa!=null&&sa.sendBeacon&&vp.push({transport:"sendBeacon",method:Oy});var jy=3e3;class aK{constructor(e,n){this.Or=!0,this.Lr=[],this.Fr=Br(n?.flush_interval_ms||jy,250,5e3,be.createLogger("flush interval"),jy),this.Ar=e}enqueue(e){this.Lr.push(e),this.$r||this.Nr()}unload(){this.Dr();var e=this.Lr.length>0?this.qr():{},n=Object.values(e);[...n.filter((a=>a.url.indexOf("/e")===0)),...n.filter((a=>a.url.indexOf("/e")!==0))].map((a=>{this.jr(he({},a,{transport:"sendBeacon"}))}))}enable(){this.Or=!1,this.Nr()}Nr(){var e=this;this.Or||(this.$r=setTimeout((()=>{if(this.Dr(),this.Lr.length>0){var n=this.qr(),a=function(){var s=n[r],l=new Date().getTime();s.data&&it(s.data)&&Mt(s.data,(c=>{c.offset=Math.abs(c.timestamp-l),delete c.timestamp})),e.jr(s)};for(var r in n)a()}}),this.Fr))}jr(e){try{this.Ar(e)}catch(n){be.error(n)}}Dr(){clearTimeout(this.$r),this.$r=void 0}qr(){var e={};return Mt(this.Lr,(n=>{var a,r=n,s=(r?r.batchKey:null)||r.url;ke(e[s])&&(e[s]=he({},r,{data:[]})),(a=e[s].data)==null||a.push(r.data)})),this.Lr=[],e}}var rK=["retriesPerformedSoFar"];class iK{constructor(e){this.Br=!1,this.Hr=3e3,this.Lr=[],this._instance=e,this.Lr=[],this.Ur=!0,!ke(Z)&&"onLine"in Z.navigator&&(this.Ur=Z.navigator.onLine,this.zr=()=>{this.Ur=!0,this.Wr()},this.Vr=()=>{this.Ur=!1},tn(Z,"online",this.zr),tn(Z,"offline",this.Vr))}get length(){return this.Lr.length}retriableRequest(e){var n=e.retriesPerformedSoFar,a=aE(e,rK);yi(n)&&(a.url=Bb(a.url,{retry_count:n})),this._instance._send_request(he({},a,{callback:r=>{if(r.statusCode!==200&&(400>r.statusCode||r.statusCode>=500)){if((r.statusCode===0?3:10)>(n??0))return void this.st(he({retriesPerformedSoFar:n},a));r.statusCode===0&&be.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(n??0)+" retries.")}a.callback==null||a.callback(r)}}))}st(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var a=(function(l){var c=3e3*Math.pow(2,l),u=c/2,h=Math.min(18e5,c),p=Math.random()-.5;return Math.ceil(h+p*(h-u))})(n),r=Date.now()+a;this.Lr.push({retryAt:r,requestOptions:e});var s="Enqueued failed request for retry in "+a;navigator.onLine||(s+=" (Browser is offline)"),be.warn(s),this.Br||(this.Br=!0,this.Zr())}Zr(){if(this.Gr&&clearTimeout(this.Gr),this.Lr.length===0)return this.Br=!1,void(this.Gr=void 0);this.Gr=setTimeout((()=>{this.Ur&&this.Lr.length>0&&this.Wr(),this.Zr()}),this.Hr)}Wr(){var e=Date.now(),n=[],a=this.Lr.filter((s=>e>s.retryAt||(n.push(s),!1)));if(this.Lr=n,a.length>0)for(var r of a)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.Gr&&(clearTimeout(this.Gr),this.Gr=void 0),this.Br=!1,ke(Z)||(this.zr&&(Z.removeEventListener("online",this.zr),this.zr=void 0),this.Vr&&(Z.removeEventListener("offline",this.Vr),this.Vr=void 0)),this.Lr)){var n=e.requestOptions;try{this._instance._send_request(he({},n,{transport:"sendBeacon"}))}catch(a){be.error(a)}}this.Lr=[]}}class sK{constructor(e){this.Qr=()=>{var n,a,r,s;this.Jr||(this.Jr={});var l=this.scrollElement(),c=this.scrollY(),u=l?Math.max(0,l.scrollHeight-l.clientHeight):0,h=c+(l?.clientHeight||0),p=l?.scrollHeight||0;this.Jr.lastScrollY=Math.ceil(c),this.Jr.maxScrollY=Math.max(c,(n=this.Jr.maxScrollY)!==null&&n!==void 0?n:0),this.Jr.maxScrollHeight=Math.max(u,(a=this.Jr.maxScrollHeight)!==null&&a!==void 0?a:0),this.Jr.lastContentY=h,this.Jr.maxContentY=Math.max(h,(r=this.Jr.maxContentY)!==null&&r!==void 0?r:0),this.Jr.maxContentHeight=Math.max(p,(s=this.Jr.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=e}get Kr(){return this._instance.config.scroll_root_selector}getContext(){return this.Jr}resetContext(){var e=this.Jr;return setTimeout(this.Qr,0),e}startMeasuringScrollPosition(){tn(Z,"scroll",this.Qr,{capture:!0}),tn(Z,"scrollend",this.Qr,{capture:!0}),tn(Z,"resize",this.Qr)}scrollElement(){if(!this.Kr)return Z?.document.documentElement;var e=it(this.Kr)?this.Kr:[this.Kr];for(var n of e){var a=Z?.document.querySelector(n);if(a)return a}}Yr(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.Kr){var a=this.scrollElement();return a&&a[n]||0}return Z?e==="y"?Z.scrollY||Z.pageYOffset||Z.document.documentElement.scrollTop||0:Z.scrollX||Z.pageXOffset||Z.document.documentElement.scrollLeft||0:0}scrollY(){return this.Yr("y")}scrollX(){return this.Yr("x")}}var oK=t=>f6(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties,t?.config.disable_capture_url_hashes);class mS{constructor(e,n,a,r){this.Xr=s=>{var l=this.ei();if(!l||l.sessionId!==s){var c={sessionId:s,props:this.ti(this._instance)};this.ri.register({[Py]:c})}},this._instance=e,this.ii=n,this.ri=a,this.ti=r||oK,this.ii.onSessionId(this.Xr)}ei(){return this.ri.props[Py]}getSetOnceProps(){var e,n=(e=this.ei())==null?void 0:e.props;return n?"r"in n?m6(n,this._instance.config.disable_capture_url_hashes):{$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 Mt(Nb(this.getSetOnceProps()),((n,a)=>{a==="$current_url"&&(a="url"),e["$session_entry_"+ry(a)]=n})),e}}class $b{constructor(){this.ni={}}on(e,n){return this.ni[e]||(this.ni[e]=[]),this.ni[e].push(n),()=>{this.ni[e]=this.ni[e].filter((a=>a!==n))}}emit(e,n){for(var a of this.ni[e]||[])a(n);for(var r of this.ni["*"]||[])r(e,n)}}var Jc=Zt("[SessionId]");class gS{on(e,n){return this.si.on(e,n)}constructor(e,n,a){var r;if(this.oi=null,this.ai=[],this.li=void 0,this.ui=!1,this.si=new $b,this.hi=(h,p)=>!(!yi(h)||!yi(p))&&Math.abs(h-p)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===xi)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=e.config,this.ri=e.persistence,this.di=void 0,this.ci=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=n||wi,this.fi=a||wi;var s=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*Br(this.Se.session_idle_timeout_seconds||1800,60,36e3,Jc.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+s+"_window_id",this.mi="ph_"+s+"_primary_window_exists",this.yi()){var l=Fn.F(this.gi),c=Fn.F(this.mi);l&&!c?this.di=l:Fn.P(this.gi),Fn.q(this.mi,!0)}if((r=this.Se.bootstrap)!=null&&r.sessionID)try{var u=(h=>{var p=this.Se.bootstrap.sessionID.replace(/-/g,"");if(p.length!==32)throw new Error("Not a valid UUID");if(p[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(p.substring(0,12),16)})();this.bi(this.Se.bootstrap.sessionID,new Date().getTime(),u)}catch(h){Jc.error("Invalid sessionID in bootstrap",h)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ke(this.ai)&&(this.ai=[]),this.ai.push(e),this.ci&&e(this.ci,this.di),()=>{this.ai=this.ai.filter((n=>n!==e))}}yi(){return this.Se.persistence!=="memory"&&!this.ri.ir&&Fn.N()}xi(e){e!==this.di&&(this.di=e,this.yi()&&Fn.q(this.gi,e))}ki(){return this.di?this.di:this.yi()?Fn.F(this.gi):null}Si(e){var n=this.oi;return!la(n)&&!la(e)&&5e3>Math.abs(e-n)}bi(e,n,a){var r=n!==this._sessionActivityTimestamp,s=!(e!==this.ci||a!==this._sessionStartTimestamp);this._sessionStartTimestamp=a,this._sessionActivityTimestamp=n,this.ci=e,s&&!r||s&&this.Si(n)||(this.oi=n,this.ri.register({[bl]:[n,e,a]}))}Ci(){var e,n=(e=this.Se)==null?void 0:e.persistence_save_debounce_ms;return yi(n)&&n>0}Ti(){this.Ci()?this.ri.refreshKey(bl):(this.ri.flush(),this.ri.load())}Ii(){var e;if(!la(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.oi){this.Ti();var n=this.Mi();n[1]===this.ci&&n[2]===this._sessionStartTimestamp&&(this.oi=this._sessionActivityTimestamp,this.ri.register({[bl]:[this._sessionActivityTimestamp,(e=this.ci)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.ri.flush())}}Ei(){var e=this.Mi()[0],n=yi(e)?e:0,a=yi(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,a)}Ri(e){return this.Ti(),this.hi(e,this.Ei())}Mi(){var e=this.ri.props[bl];return it(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.oi=null,clearTimeout(this.Pi),this.Pi=void 0,this.bi(null,null,null)}destroy(){this.ui=!0,this.Ii(),clearTimeout(this.Pi),this.Pi=void 0,this.li&&Z&&(Z.removeEventListener(mf,this.li,{capture:!1}),this.li=void 0),this.ai=[]}wi(){this.li=()=>{this.Ii(),this.yi()&&Fn.P(this.mi)},tn(Z,mf,this.li,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.Se.cookieless_mode===xi)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var a=n||new Date().getTime(),r=this.Mi(),s=r[1],l=r[2],c=this.Ei(),u=this.ki(),h=yi(l)&&Math.abs(a-l)>864e5,p=!1,m=!1,v=!s,y=s,b=!v&&!e&&this.hi(a,c);if(b){(b=this.Ri(a))||Jc.info("cross-tab refresh kept the session alive",{sessionId:s});var x=this.Mi();s=x[1],l=x[2]}v||b||h?(s=this.vi(),u=this.fi(),Jc.info("new session ID generated",{sessionId:s,windowId:u,changeReason:{noSessionId:v,activityTimeout:b,sessionPastMaximumLength:h}}),l=a,p=!0):(u||(u=this.fi(),p=!0),(m=s!==y)&&(Jc.info("adopted cross-tab session id",{sessionId:s,windowId:u}),p=!0));var P=yi(c)&&e&&!h?c:a,E=yi(l)?l:new Date().getTime();this.xi(u),this.bi(s,P,E),e||this.pi();var L={noSessionId:v,activityTimeout:b,sessionPastMaximumLength:h,crossTabAdoption:m};return p&&this.ai.forEach((T=>T(s,u,L))),{sessionId:s,windowId:u,sessionStartTimestamp:E,changeReason:p?L:void 0,lastActivityTimestamp:c}}pi(){this.ui||(clearTimeout(this.Pi),this.Pi=setTimeout((()=>{if(!this.ui)if(this.Ri(new Date().getTime())){var e=this.ci;this.resetSessionId(),this.si.emit("forcedIdleReset",{idleSessionId:e})}else this.pi()}),1.1*this.sessionTimeoutMs))}}var T6=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&UP(n,e))return!0;try{var a=t?.userAgentData;if(a!=null&&a.brands&&a.brands.some((r=>UP(r?.brand,e))))return!0}catch{}return!!t.webdriver};function E6(){return(E6=cn((function*(){var t=sa?.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e?.model;return Lt(n)&&n.length>0?n:void 0}catch(a){return void be.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",a)}}))).apply(this,arguments)}var kf=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 vS(t,e,n){return kl({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var A6={exact:(t,e)=>e.some((n=>t.some((a=>n===a)))),is_not:(t,e)=>e.every((n=>t.every((a=>n!==a)))),regex:(t,e)=>e.some((n=>t.some((a=>kf(n,a))))),not_regex:(t,e)=>e.every((n=>t.every((a=>!kf(n,a))))),icontains:(t,e)=>e.map(Vh).some((n=>t.map(Vh).some((a=>n.includes(a))))),not_icontains:(t,e)=>e.map(Vh).every((n=>t.map(Vh).every((a=>!n.includes(a))))),gt:(t,e)=>e.some((n=>{var a=parseFloat(n);return!isNaN(a)&&t.some((r=>a>parseFloat(r)))})),lt:(t,e)=>e.some((n=>{var a=parseFloat(n);return!isNaN(a)&&t.some((r=>a<parseFloat(r)))}))},Vh=t=>t.toLowerCase();function R6(t,e){return!t||Object.entries(t).every((n=>{var a=n[1],r=e?.[n[0]];if(ke(r)||la(r))return!1;var s=[String(r)],l=A6[a.operator];return!!l&&l(a.values,s)}))}var zy="custom",_S="i.posthog.com",lK=/^\/static\//;class cK{constructor(e){this.Oi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+_S,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Oi[this.apiHost]||(this.Oi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":zy),this.Oi[this.apiHost]}Li(e){if(lK.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(e==="assets"){var a=this.Li(n);if(a)return""+a+n}if(this.region===zy)return this.apiHost+n;var r=_S+n;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}function L6(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var Rt=Zt("[Surveys]"),D6="seenSurvey_",I6=t=>{try{var e=(n=>((a,r)=>""+D6+(function(s){return s.current_iteration&&s.current_iteration>0?s.id+"_"+s.current_iteration:s.id})(r))(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(n){Rt.error("Failed to persist survey seen state",n)}},dK=[Nv.Popover,Nv.Widget,Nv.API],uK={ignoreConditions:!1,ignoreDelay:!1,displayType:Ly.Popover},hK=Zt("[PostHog ExternalIntegrations]"),pK={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class fK{constructor(e){this._instance=e}Bt(e,n){var a;(a=Be.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this._instance,e,(r=>{if(r)return hK.error("failed to load script",r);n()}))}startIfEnabledOrStop(){var e=this,n=function(){var s,l,c,u=a[0],h=a[1];!h||(s=Be.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[u]||e.Bt(pK[u],(()=>{var p;(p=Be.__PosthogExtensions__)==null||(p=p.integrations)==null||(p=p[u])==null||p.start(e._instance)})),!h&&(l=Be.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[u]&&((c=Be.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[u])==null||c.stop())};for(var a of Object.entries((r=this._instance.config.integrations)!==null&&r!==void 0?r:{})){var r;n()}}}var Ed={},Uv=0,wf=()=>{},yS='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Qc="Surveys module not available",bS="sanitize_properties is deprecated. Use before_send instead",M6="Invalid value for property_denylist config: ",fl="posthog",N6=!Xq&&va?.indexOf("MSIE")===-1&&va?.indexOf("Mozilla")===-1,kS=t=>{var e;return he({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:vq(xe?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:wf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:fn&&Lt(fn?.search)&&fn.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(Z==null||(e=Z.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!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){be.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Ey,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:jy},error_tracking:{},_onCapture:wf},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:Aq,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n)}))(t))},mK=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],wS=t=>{var e={};for(var n of mK){var a=n[0],r=n[1];ke(t[a])||(e[r]=t[a])}var s=Bt({},e,t),l=t.__preview_external_dependency_versioned_paths;return ke(l)||(ke(t.strict_script_versioning)&&(s.strict_script_versioning=!!l),Lt(l)&&ke(t.asset_host)&&(s.asset_host=l)),it(t.property_blacklist)&&(ke(t.property_denylist)?s.property_denylist=t.property_blacklist:it(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:be.error(M6+t.property_denylist)),s};class gK{constructor(){this.__forceAllowLocalhost=!1}get Fi(){return this.__forceAllowLocalhost}set Fi(e){be.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Wa{Ai(e,n){if(e){var a=this.$i.indexOf(e);a!==-1&&this.$i.splice(a,1)}return this.$i.push(n),n.initialize==null||n.initialize(),n}Ni(){return this.config.cookieless_mode===xi||this.config.cookieless_mode===Ks&&this.consent.isRejected()}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(){var e;this.webPerformance=new gK,this.Di=!1,this.version=en.LIB_VERSION,this.qi=new $b,this.$i=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=kS(),this.SentryIntegration=zq,this.sentryIntegration=a=>(function(r,s){var l=o6(r,s);return{name:s6,processEvent:c=>l(c)}})(this,a),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.ji=!1,this.Bi=null,this.Hi=null,this.Ui=null,this.scrollManager=new sK(this),this.pageViewManager=new sS(this),this.rateLimiter=new qq(this),this.requestRouter=new cK(this),this.consent=new Pq(this),this.externalIntegrations=new fK(this);var n=(e=Wa.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(a,r,s)=>{var l=Lt(a)?{[a]:r}:a;this.setPersonProperties(l),s?.({})},set_once:(a,r,s)=>{var l=Lt(a)?{[a]:r}:a;this.setPersonProperties(void 0,l),s?.({})}},this.on("eventCaptured",(a=>be.info('send "'+a?.event+'"',a)))}init(e,n,a){if(a&&a!==fl){var r,s=(r=Ed[a])!==null&&r!==void 0?r:new Wa;return s._init(e,n,a),Ed[a]=s,Ed[fl][a]=s,s}return this._init(e,n,a)}_init(e,n,a){var r,s;n===void 0&&(n={});var l=Lt(e)?e.trim():"";if(!l)return be.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.zi(n.debug),this.Wi=n,this.Vi=[],n.person_profiles?this.Hi=n.person_profiles:n.process_person&&(this.Hi=n.process_person);var c=kS(n.defaults),u=wS(n),h=Bt({},c,u,{name:a,token:l});qt(c.rageclick)&&qt(u.rageclick)&&(h.rageclick=Bt({},c.rageclick,u.rageclick)),qt(c.session_recording)&&qt(u.session_recording)&&(h.session_recording=Bt({},c.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&be.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:aa.GZipJS;var p=this.Zi();this.persistence=new Mv(this.config,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Mv(he({},this.config,{persistence:"sessionStorage"}),p,!1);var m=he({},this.persistence.props),v=he({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Gi=new aK((A=>this.Qi(A)),this.config.request_queue_config),this.Ji=new iK(this),this.__request_queue=[];var y=this.Ni();if(y||(this.sessionManager=new gS(this),this.sessionPropsManager=new mS(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(be.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Ki(y)}),0)):(be.info("Initializing extensions synchronously"),this.Ki(y)),en.DEBUG=en.DEBUG||this.config.debug,en.DEBUG&&be.info("Starting in debug mode",{this:this,config:n,thisC:he({},this.config),p:m,s:v}),!this.config.identity_distinct_id||(r=n.bootstrap)!=null&&r.distinctID||(n.bootstrap=he({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var b=n.bootstrap.distinctID,x=this.get_distinct_id(),P=this.persistence.get_property(vr);if(n.bootstrap.isIdentifiedID&&x!=null&&x!==b&&P===nl)this.identify(b);else if(n.bootstrap.isIdentifiedID&&x!=null&&x!==b&&P===al)be.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var E=this.config.get_device_id(wi()),L=n.bootstrap.isIdentifiedID?E:b;this.persistence.set_property(vr,n.bootstrap.isIdentifiedID?al:nl),this.register({distinct_id:b,$device_id:L})}}if(y)this.register_once({distinct_id:jh,$device_id:null},"");else if(!this.get_distinct_id()){var T=this.config.get_device_id(wi());this.register_once({distinct_id:T,$device_id:T},""),this.persistence.set_property(vr,nl)}return tn(Z,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(A,D){var B=A.config.segment;if(!B)return D();(function(j,S){var N=j.config.segment;if(!N)return S();var U=ee=>{var ce=()=>ee.anonymousId()||wi();j.config.get_device_id=ce,ee.id()&&(j.register({distinct_id:ee.id(),$device_id:ce()}),j.persistence.set_property(vr,al)),S()},Q=N.user();"then"in Q&&yr(Q.then)?Q.then(U):U(Q)})(A,(()=>{B.register((j=>{typeof Promise<"u"&&Promise.resolve||Iv.warn("This browser does not have Promise support, and can not use the segment integration");var S=(N,U)=>{if(!U)return N;N.event.userId||N.event.anonymousId===j.get_distinct_id()||(Iv.info("No userId set, resetting PostHog"),j.reset()),N.event.userId&&N.event.userId!==j.get_distinct_id()&&(Iv.info("UserId set, identifying with PostHog"),j.identify(N.event.userId));var Q=j.calculateEventProperties(U,N.event.properties);return N.event.properties=Object.assign({},Q,N.event.properties),N};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:N=>S(N,N.event.event),page:N=>S(N,pl),identify:N=>S(N,Rv),screen:N=>S(N,"$screen")}})(A)).then((()=>{D()}))}))})(this,(()=>this.Yi())):this.Yi(),yr(this.config._onCapture)&&this.config._onCapture!==wf&&(be.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(A=>this.config._onCapture(A.event,A)))),this.config.ip&&be.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.config.disableDeviceModel||(function(){return E6.apply(this,arguments)})().then((A=>{A&&this.register({[Ev]:A})})).catch(wf),this}Ki(e){var n,a,r,s,l,c,u,h,p=performance.now(),m=he({},Wa.__defaultExtensionClasses,this.config.__extensionClasses),v=[];m.featureFlags&&this.$i.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new m.featureFlags(this)),m.exceptions&&this.$i.push(this.exceptions=(a=this.exceptions)!==null&&a!==void 0?a:new m.exceptions(this)),m.historyAutocapture&&this.$i.push(this.historyAutocapture=new m.historyAutocapture(this)),m.tracingHeaders&&this.$i.push(this.tracingHeaders=new m.tracingHeaders(this)),m.siteApps&&this.$i.push(this.siteApps=new m.siteApps(this)),m.sessionRecording&&!e&&this.$i.push(this.sessionRecording=new m.sessionRecording(this)),this.config.disable_scroll_properties||v.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),m.autocapture&&this.$i.push(this.autocapture=new m.autocapture(this)),m.surveys&&this.$i.push(this.surveys=(r=this.surveys)!==null&&r!==void 0?r:new m.surveys(this)),m.logs&&this.$i.push(this.logs=(s=this.logs)!==null&&s!==void 0?s:new m.logs(this)),m.metrics&&this.$i.push(this.metrics=(l=this.metrics)!==null&&l!==void 0?l:new m.metrics(this)),m.conversations&&this.$i.push(this.conversations=(c=this.conversations)!==null&&c!==void 0?c:new m.conversations(this)),m.productTours&&this.$i.push(this.productTours=new m.productTours(this)),m.heatmaps&&this.$i.push(this.heatmaps=new m.heatmaps(this)),m.webVitalsAutocapture&&this.$i.push(this.webVitalsAutocapture=new m.webVitalsAutocapture(this)),m.exceptionObserver&&this.$i.push(this.exceptionObserver=new m.exceptionObserver(this)),m.deadClicksAutocapture&&this.$i.push(this.deadClicksAutocapture=new m.deadClicksAutocapture(this,jq)),m.toolbar&&this.$i.push(this.toolbar=(u=this.toolbar)!==null&&u!==void 0?u:new m.toolbar(this)),m.experiments&&this.$i.push(this.experiments=(h=this.experiments)!==null&&h!==void 0?h:new m.experiments(this)),this.$i.forEach((y=>{y.initialize&&v.push((()=>{y.initialize==null||y.initialize()}))})),v.push((()=>{if(this.Xi){var y=this.Xi;this.Xi=void 0,this.Mr(y)}})),this.en(v,p)}en(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.en(e,n)}),0);var a=e.shift();if(a)try{a()}catch(s){be.error("Error initializing extension:",s)}}var r=Math.round(performance.now()-n);this.register_for_session({[VE]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[HE]:r}),this.config.__preview_deferred_init_extensions&&be.info("PostHog extensions initialized ("+r+"ms)")}Mr(e){var n;if(!xe||!xe.body)return be.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Mr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Xi=e),this.tn=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Ke(e.supportedCompression,aa.GZipJS)?aa.GZipJS:Ke(e.supportedCompression,aa.Base64)?aa.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Hi?this.Hi:Ey}),this.$i.forEach((a=>a.onRemoteConfig==null?void 0:a.onRemoteConfig(e)))}Yi(){try{this.config.loaded(this)}catch(a){be.critical("`loaded` function failed",a)}if(this.rn(),this.config.internal_or_test_user_hostname&&fn!=null&&fn.hostname){var e=fn.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ni())&&this.nn()}),1),this.sn=new v6(this),this.sn.load()}rn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Gi)==null||e.enable())}_dom_loaded(){this.is_capturing()&&zh(this.__request_queue,(e=>this.Qi(e))),this.__request_queue=[],this.rn()}_handle_unload(){var e,n,a,r,s;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.an()&&this.capture(Av),(a=this.logs)==null||a.flushLogs("sendBeacon"),(r=this.Gi)==null||r.unload(),(s=this.Ji)==null||s.unload()):this.an()&&this.capture(Av,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?N6?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=he({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(ke(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var a,r,s,l=he({},n);l.timeout=l.timeout||6e4;var c=(a=l.transport)!==null&&a!==void 0?a:"fetch";c==="sendBeacon"&&ke(l.compression)&&l.data&&(l.compression=aa.Base64),l.url=fS(l.url,l.compression);var u=vp.filter((p=>!l.disableTransport||!p.transport||!l.disableTransport.includes(p.transport))),h=(r=(s=(function(p,m){for(var v=0;p.length>v;v++)if(p[v].transport===c)return p[v]})(u))==null?void 0:s.method)!==null&&r!==void 0?r:u[0].method;if(!h)throw new Error("No available transport method");c!=="sendBeacon"&&l.data&&l.compression===aa.GZipJS&&bG&&typeof Promise<"u"&&!gp?eK(l).then((p=>{h(p)})).catch((p=>{if(FP(p))return gp=!0,void h(he({},l,{compression:void 0,url:fS(n.url,void 0)}));(m=>{if(!m||typeof m!="object")return!1;var v="name"in m?String(m.name):"";return FP(m)||v===rE})(p)&&(gp=!0),h(l)})):h(l)})(he({},e,{callback:n=>{var a,r;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(a=(r=this.config).on_request_error)==null||a.call(r,n),e.callback==null||e.callback(n)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}Qi(e){this.Ji?this.Ji.retriableRequest(e):this._send_request(e)}_execute_array(e){Uv++;try{var n,a=[],r=[],s=[];zh(e,(c=>{if(c)if(it(n=c[0]))s.push(c);else if(yr(c))try{c.call(this)}catch(u){be.error("Error executing queued PostHog call",c,u)}else it(c)&&n==="alias"?a.push(c):it(c)&&n.indexOf("capture")!==-1&&yr(this[n])?s.push(c):r.push(c)}));var l=function(c,u){zh(c,(function(h){try{if(it(h[0])){var p=u;Mt(h,(function(m){p=p[m[0]].apply(p,m.slice(1))}))}else u[h[0]].apply(u,h.slice(1))}catch(m){be.error("Error executing queued PostHog call",h,m)}}))};l(a,this),l(r,this),l(s,this)}finally{Uv--}}push(e){if(Uv>0&&it(e)&&Lt(e[0])){var n=Wa.prototype[e[0]];yr(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,a){var r,s,l,c,u;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Gi){if(this.is_capturing())if(!ke(e)&&Lt(e)){var h=!this.config.opt_out_useragent_filter&&this._is_bot();if(!h||this.config.__preview_capture_bot_pageviews){var p=a!=null&&a.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(p==null||!p.isRateLimited){n!=null&&n.$current_url&&!Lt(n?.$current_url)&&(be.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||a!=null&&a.ln||be.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),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 m=new Date,v=a?.timestamp||m,y=HP(a?.uuid,wi),b={uuid:y,event:e,properties:this.calculateEventProperties(e,n||{},v,y)};e===pl&&this.config.__preview_capture_bot_pageviews&&h&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),p&&(b.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens),a?.$set&&(b.$set=a?.$set);var x=a?.$unset;x&&(b.$unset=x);var P,E,L,T=this.un(a?.$set_once,e!==YP,e===Rv);if(T&&(b.$set_once=T),a!=null&&a._noTruncate||(s=this.config.properties_string_max_length,l=b,c=U=>Lt(U)?U.slice(0,s):U,u=new Set,b=(function U(Q,ee){return Q!==Object(Q)?c?c(Q):Q:u.has(Q)?void 0:(u.add(Q),it(Q)?(ce=[],zh(Q,(le=>{ce.push(U(le))}))):(ce={},Mt(Q,((le,re)=>{u.has(le)||(ce[re]=U(le))}))),ce);var ce})(l)),b.timestamp=v,ke(a?.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=m),e===Pi.DISMISSED||e===Pi.SENT){var A=n?.[Ov.SURVEY_ID],D=n?.[Ov.SURVEY_ITERATION];I6({id:A,current_iteration:D}),b.$set=he({},b.$set,{[(P={id:A,current_iteration:D},E=e===Pi.SENT?"responded":"dismissed",L="$survey_"+E+"/"+P.id,P.current_iteration&&P.current_iteration>0&&(L="$survey_"+E+"/"+P.id+"/"+P.current_iteration),L)]:!0})}else e===Pi.SHOWN&&(b.$set=he({},b.$set,{[Ov.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===Gq.SHOWN){var B=n?.[lS.TOUR_TYPE];B&&(b.$set=he({},b.$set,{[lS.TOUR_LAST_SEEN_DATE+"/"+B]:new Date().toISOString()}))}var j=he({},b.properties.$set,b.$set);if(cs(j)||this.setPersonPropertiesForFlags(j),!nt(this.config.before_send)){var S=this.it(b);if(!S)return;(b=S).uuid=HP(b.uuid,wi)}this.qi.emit("eventCaptured",b);var N={method:"POST",url:(r=a?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:b,compression:"best-available",batchKey:a?._batchKey,transport:a?.transport};return!this.config.request_batching||a&&(a==null||!a._batchKey)||a!=null&&a.send_instantly?this.Qi(N):this.Gi.enqueue(N),b}be.critical("This capture call is ignored due to client rate limiting.")}}else be.error("No event name provided to posthog.capture")}else be.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,a,r,s){if(a=a||new Date,!this.persistence||!this.sessionPersistence)return n;var l=s?void 0:this.persistence.remove_event_timer(e),c=he({},n);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.Ni()&&(c.$cookieless_mode=!0),e==="$snapshot"){var u=he({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=u.distinct_id,(!Lt(c.distinct_id)&&!Bn(c.distinct_id)||iy(c.distinct_id))&&be.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var h,p=(function(E,L,T,A){var D,B,j,S;if(A===void 0&&(A=!1),!va)return{};var N,U,Q,ee,ce,le,re,te,ie,$=E?[...Fl,...L||[]]:[],X=(function(ae){for(var _e=0;$P.length>_e;_e++){var fe=$P[_e],ve=fe[1],Ne=fe[0].exec(ae),Oe=Ne&&(yr(ve)?ve(Ne,ae):ve);if(Oe)return Oe}return["",""]})(va),W=(N=typeof navigator<"u"?navigator:void 0)!=null&&N.brave?{brave:!0}:{},O={detectGoogleSearchApp:T},Y=Bt(Nb({$os:X[0],$os_version:X[1],$browser:EE(va,navigator.vendor,W,O),$device:VP(va),$device_type:(Q=va,ee={userAgentDataPlatform:(D=navigator)==null||(D=D.userAgentData)==null?void 0:D.platform,maxTouchPoints:(B=navigator)==null?void 0:B.maxTouchPoints,screenWidth:Z==null||(j=Z.screen)==null?void 0:j.width,screenHeight:Z==null||(S=Z.screen)==null?void 0:S.height,devicePixelRatio:Z?.devicePixelRatio},ie=VP(Q),ie===dE||ie===cE||ie==="Kobo"||ie==="Kindle Fire"||ie===xE?Nl:ie===Bd||ie===Cl||ie===$d||ie===oy?"Console":ie===hE?"Wearable":ie?Da:ee?.userAgentDataPlatform==="Android"&&((ce=ee?.maxTouchPoints)!==null&&ce!==void 0?ce:0)>0?600>Math.min((le=ee?.screenWidth)!==null&&le!==void 0?le:0,(re=ee?.screenHeight)!==null&&re!==void 0?re:0)/((te=ee?.devicePixelRatio)!==null&&te!==void 0?te:1)?Da:Nl:"Desktop"),$timezone:g6(),$timezone_offset:Vq()}),{$current_url:Gd(A?ms(fn?.href):fn?.href,$,qd),$host:fn?.host,$pathname:fn?.pathname,$raw_user_agent:va.length>1e3?va.substring(0,997)+"...":va,$browser_version:FG(va,navigator.vendor,W,O),$browser_language:oS(),$browser_language_prefix:(U=oS(),typeof U=="string"?U.split("-")[0]:void 0),$screen_height:Z?.screen.height,$screen_width:Z?.screen.width,$viewport_height:Z?.innerHeight,$viewport_width:Z?.innerWidth,$lib:en.LIB_NAME,$lib_version:en.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return en.SDK_DIST_CHANNEL&&(Y.$sdk_dist_channel=en.SDK_DIST_CHANNEL),Y})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var m=this.sessionManager.checkAndGetSessionAndWindowId(s,a.getTime()),v=m.windowId;c.$session_id=m.sessionId,c.$window_id=v}this.sessionPropsManager&&Bt(c,this.sessionPropsManager.getSessionProps());try{var y;this.sessionRecording&&Bt(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=(y=this.Ji)==null?void 0:y.length}catch(E){c.$sdk_debug_error_capturing_properties=String(E)}if(this.requestRouter.region===zy&&(c.$lib_custom_api_host=this.config.api_host),h=e!==pl||s?e!==Av||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(a):this.pageViewManager.doPageView(a,r),c=Bt(c,h),e===pl&&xe&&(c.title=xe.title),!ke(l)){var b=a.getTime()-l;c.$duration=parseFloat((b/1e3).toFixed(3))}va&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser"),(c=Bt({},p,this.persistence.properties(),this.sessionPersistence.properties(),c)).$is_identified=this._isIdentified(),it(this.config.property_denylist)?Mt(this.config.property_denylist,(function(E){delete c[E]})):be.error(M6+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var x=this.config.sanitize_properties;x&&(be.error(bS),c=x(c,e));var P=this.hn();return c.$process_person_profile=P,P&&!s&&this.dn("_calculate_event_properties"),c}un(e,n,a){var r;if(n===void 0&&(n=!0),a===void 0&&(a=!1),!this.persistence||!this.hn()||this.Di&&!a)return e;var s=this.persistence.get_initial_props(),l=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),c=Bt({},s,l||{},e||{}),u=this.config.sanitize_properties;return u&&(be.error(bS),c=u(c,"$set_once")),n&&(this.Di=!0),cs(c)?void 0:c}register(e,n){var a;(a=this.persistence)==null||a.register(e,n)}register_once(e,n,a){var r;(r=this.persistence)==null||r.register_once(e,n,a)}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)}cn(e,n){this.register({[e]:n})}getFeatureFlag(e,n){var a;return(a=this.featureFlags)==null?void 0:a.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var a;return(a=this.featureFlags)==null?void 0:a.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var a;return(a=this.featureFlags)==null?void 0:a.isFeatureEnabled(e,n)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,n,a){var r;(r=this.featureFlags)==null||r.updateFlags(e,n,a)}updateEarlyAccessFeatureEnrollment(e,n,a){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,n,a)}getEarlyAccessFeatures(e,n,a){var r;return n===void 0&&(n=!1),(r=this.featureFlags)==null?void 0:r.getEarlyAccessFeatures(e,n,a)}on(e,n){return this.qi.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Qc}),()=>{})}onSessionId(e){var n,a;return(n=(a=this.sessionManager)==null?void 0:a.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:Qc})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:Qc})}renderSurvey(e,n){var a;(a=this.surveys)==null||a.renderSurvey(e,n)}displaySurvey(e,n){var a;n===void 0&&(n=uK),(a=this.surveys)==null||a.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)==null||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,a;return(n=(a=this.surveys)==null?void 0:a.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:Qc}}canRenderSurveyAsync(e,n){var a,r;return n===void 0&&(n=!1),(a=(r=this.surveys)==null?void 0:r.canRenderSurveyAsync(e,n))!==null&&a!==void 0?a:Promise.resolve({visible:!1,disabledReason:Qc})}vn(e){return!e||iy(e)?(be.critical("Unique user id has not been set in posthog.identify"),!1):e===jh?(be.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(be.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.'),!1)}identify(e,n,a){if(!this.__loaded||!this.persistence)return be.uninitializedWarning("posthog.identify");if(Bn(e)&&(e=e.toString(),be.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.vn(e)&&this.dn("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(df)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(ld)&&(this.unregister(ld),this.register({distinct_id:e}));var s,l=(this.persistence.get_property(vr)||nl)===nl;e!==r&&l?(this.persistence.set_property(vr,al),this.setPersonPropertiesForFlags({$set:n||{},$set_once:a||{}},!1),this.capture(Rv,{distinct_id:e,$anon_distinct_id:r},{$set:n||{},$set_once:a||{}}),this.Ui=vS(e,n,a),(s=this.featureFlags)==null||s.setAnonymousDistinctId(r)):(n||a)&&this.setPersonProperties(n,a),e!==r&&(this.reloadFeatureFlags(),this.unregister(Sd))}}setPersonProperties(e,n){if((e||n)&&this.dn("posthog.setPersonProperties")){var a=vS(this.get_distinct_id(),e,n);this.Ui!==a?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Ui=a):be.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,a=(it(e)?e:[e]).filter((r=>Lt(r)&&r.length>0));a.length!==0&&this.dn("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(a,!0),this.capture("$set",{$unset:a}),this.Ui=null)}group(e,n,a){if(e&&n){var r=this.getGroups(),s=r[e]!==n;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:he({},r,{[e]:n})}),s||a){var l={$group_type:e,$group_key:n};a&&(l.$group_set=a),this.capture(YP,l)}a&&this.setGroupPropertiesForFlags({[e]:a}),s&&!a&&this.reloadFeatureFlags()}else be.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){var a;n===void 0&&(n=!0),(a=this.featureFlags)==null||a.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e){var n;e===void 0&&(e=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n){var a;n===void 0&&(n=!0),this.dn("posthog.setGroupPropertiesForFlags")&&((a=this.featureFlags)==null||a.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(e)}reset(e){var n,a,r,s,l,c,u,h,p,m;if(be.info("reset"),!this.__loaded)return be.uninitializedWarning("posthog.reset");var v,y=this.get_property(df),b=this.get_property(Ev),x=this.get_property(ao);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(a=this.sessionPersistence)==null||a.clear(),ke(x)||(v=this.persistence)==null||v.register({[ao]:x}),(r=this.surveys)==null||r.reset(),(s=this.sn)==null||s.stop(),(l=this.featureFlags)==null||l.reset(),(c=this.conversations)==null||c.reset(),(u=this.logs)==null||u.reset(),(h=this.metrics)==null||h.reset(),(p=this.persistence)==null||p.set_property(vr,nl),(m=this.sessionManager)==null||m.resetSessionId(),this.Ui=null,this.config.cookieless_mode===xi)this.register_once({distinct_id:jh,$device_id:null},"");else{var P=this.config.get_device_id(wi());this.register_once({distinct_id:P,$device_id:e?P:y},""),e||ke(b)||this.register({[Ev]:b})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var n=this;return cn((function*(){var a,r,s,l,c;n.__loaded?((a=n.logs)==null||a.flushLogs("sendBeacon"),(r=n.metrics)==null||r.flush("sendBeacon"),(s=n.Gi)==null||s.unload(),(l=n.Ji)==null||l.unload(),(c=n.featureFlags)==null||c.destroy()):be.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,n){var a;this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(a=this.conversations)==null||a.fn()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.pn()}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 n=this.sessionManager.checkAndGetSessionAndWindowId(!0),a=n.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);if(e!=null&&e.withTimestamp&&a){var s,l=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!a)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-a)/1e3)-l,0)}return r}alias(e,n){return e===this.get_property(OE)?(be.critical("Attempting to create alias for existing People user - aborting."),-2):this.dn("posthog.alias")?(ke(n)&&(n=this.get_distinct_id()),e!==n?(this.cn(ld,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(be.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=he({},this.config);if(qt(e)){var a,r,s,l,c,u,h,p,m,v,y;Bt(this.config,wS(e));var b=this.Zi();(a=this.persistence)==null||a.update_config(this.config,n,b),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Mv(he({},this.config,{persistence:"sessionStorage"}),b,!1);var x=this.zi(this.config.debug);Hr(x)&&(this.config.debug=x),Hr(this.config.debug)&&(this.config.debug?(en.DEBUG=!0,It.N()&&It.q("ph_debug",!0),be.info("set_config",{config:e,oldConfig:n,newConfig:he({},this.config)})):(en.DEBUG=!1,It.N()&&It.P("ph_debug"))),(r=this.exceptionObserver)==null||r.onConfigChange(),(s=this.exceptions)==null||s.onConfigChange(),(l=this.sessionRecording)==null||l.startIfEnabledOrStop(),(c=this.tracingHeaders)==null||c.startIfEnabledOrStop(),(u=this.autocapture)==null||u.startIfEnabled(),(h=this.heatmaps)==null||h.startIfEnabled(),(p=this.exceptionObserver)==null||p.startIfEnabledOrStop(),(m=this.deadClicksAutocapture)==null||m.startIfEnabledOrStop(),(v=this.surveys)==null||v.loadIfEnabled(),this.gn(),(y=this.externalIntegrations)==null||y.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){en.LIB_NAME=e,en.LIB_VERSION=n}startSessionRecording(e){var n,a,r,s,l,c=e===!0,u={sampling:c||!(e==null||!e.sampling),linked_flag:c||!(e==null||!e.linked_flag),url_trigger:c||!(e==null||!e.url_trigger),event_trigger:c||!(e==null||!e.event_trigger)};Object.values(u).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),u.sampling&&((a=this.sessionRecording)==null||a.overrideSampling()),u.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),u.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),u.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){if(this.exceptions){var a=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:a});return this.exceptions.sendExceptionEvent(he({},r,n))}}addExceptionStep(e,n){var a;(a=this.exceptions)==null||a.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)==null||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)==null?void 0:n.logger)!==null&&e!==void 0?e:Wa.mn}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,a;return(n=(a=this.toolbar)==null?void 0:a.loadToolbar(e))!==null&&n!==void 0&&n}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:fl;return n!==fl&&(n=fl+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(vr))===al||((n=this.sessionPersistence)==null?void 0:n.get_property(vr))===al}hn(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===Ey&&!this._isIdentified()&&cs(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[ld])&&((n=this.persistence)==null||(n=n.props)==null||!n[pf]))}an(){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.hn()||this.dn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.dn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}dn(e){return this.config.person_profiles==="never"?(be.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.cn(pf,!0),!0)}Zi(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Ks)}gn(){var e,n,a,r,s=this.Zi();return((e=this.persistence)==null?void 0:e.ir)!==s&&((a=this.persistence)==null||a.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.ir)!==s&&((r=this.sessionPersistence)==null||r.set_disabled(s)),s}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==xi){if(this.Ni()){var a,r,s,l,c;this.reset(!0),(a=this.sessionManager)==null||a.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=new gS(this),this.pageViewManager=new sS(this),this.persistence&&(this.sessionPropsManager=new mS(this,this.sessionManager,this.persistence));var u,h=(s=(l=this.config.__extensionClasses)==null?void 0:l.sessionRecording)!==null&&s!==void 0?s:(c=Wa.__defaultExtensionClasses)==null?void 0:c.sessionRecording;h&&(this.sessionRecording=this.Ai(this.sessionRecording,new h(this)),this.tn&&((u=this.sessionRecording)==null||u.onRemoteConfig==null||u.onRemoteConfig(this.tn)))}var p,m;this.consent.optInOut(!0),this.gn(),this.rn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Ks&&((p=this.surveys)==null||p.loadIfEnabled()),(ke(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((m=e?.captureEventName)!==null&&m!==void 0?m:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.nn()}else be.warn(yS)}opt_out_capturing(){var e,n,a;this.config.cookieless_mode!==xi?(this.config.cookieless_mode===Ks&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.gn(),this.config.cookieless_mode===Ks&&(this.register({distinct_id:jh,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(n=this.sessionManager)==null||n.destroy(),(a=this.pageViewManager)==null||a.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.nn(),this.rn())):be.warn(yS)}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===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===xi||(this.config.cookieless_mode===Ks?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.gn()}_is_bot(){return sa?T6(sa,this.config.custom_blocked_useragents):void 0}nn(){xe&&(xe.visibilityState==="visible"?this.ji||(this.ji=!0,this.capture(pl,{title:xe.title},{send_instantly:!0}),this.Bi&&(xe.removeEventListener(ff,this.Bi),this.Bi=null)):this.Bi||(this.Bi=this.nn.bind(this),tn(xe,ff,this.Bi)))}debug(e){e===!1?(Z?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(Z?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Rr(){var e,n,a,r,s,l,c=this.Wi||{};return"advanced_disable_flags"in c?!!c.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(be.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):(a="advanced_disable_decide",r=be,s=(n="advanced_disable_flags")in(e=c)&&!nt(e[n]),l=a in e&&!nt(e[a]),s?e[n]:!!l&&(r&&r.warn("Config field '"+a+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[a]))}it(e){var n;if(nt(this.config.before_send))return e;var a=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(TG),r=it(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(var l of r){if(s=l(s),nt(s)){var c="Event '"+e.event+"' was rejected in beforeSend function";return CG(e.event)?be.warn(c+". This can cause unexpected behavior."):be.info(c),null}s.properties&&!cs(s.properties)||be.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var u of a)if(s.properties&&nt(s.properties[u]))return be.warn("Event '"+e.event+"' had its '"+u+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var e;return(e=this.pageViewManager.zt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,a){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(a)})}zi(e){var n=Hr(e)&&!e,a=It.N()&&It.A("ph_debug")==="true";return!n&&(!!a||e)}}Wa.__defaultExtensionClasses={},Wa.mn=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(var n=0;e.length>n;n++)t.prototype[e[n]]=mq(t.prototype[e[n]])})(Wa,["identify"]);class xS{constructor(e){this.disabled=e===!1;var n=qt(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,a){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(n-r.y)<this.thresholdPx&&this.timeoutMs>a-r.timestamp){if(this.clicks.push({x:e,y:n,timestamp:a}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:a}];return!1}}var Bv="$copy_autocapture",$v=Zt("[AutoCapture]");function Vv(t,e){return e.length>t?e.slice(0,t)+"...":e}function vK(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!gs(e));return e}function _K(t,e){var n,a,r=e.e,s=e.maskAllElementAttributes,l=e.maskAllText,c=e.elementAttributeIgnoreList,u=e.elementsChainAsString,h=e.disableCaptureUrlHashes;if(!gs(t))return{props:{}};for(var p=[t],m=new Set([t]),v=t;v.parentNode&&!Ra(v,"body")&&JE>p.length;)if(ZE(v.parentNode)){var y=v.parentNode.host;if(m.has(y))break;m.add(y),p.push(y),v=y}else{if(!gs(v.parentNode)||m.has(v.parentNode))break;m.add(v.parentNode),p.push(v.parentNode),v=v.parentNode}var b,x,P=[],E={},L=!1,T=!1;if(Mt(p,(S=>{var N=Ry(S);if(Ra(S,"a")){var U=S.getAttribute("href");L=!!(N&&U&&Cd(U))&&(h?ms(U):U)}Ke(vf(S),"ph-no-capture")&&(T=!0),P.push((function(ee,ce,le,re,te){te===void 0&&(te=!1);var ie=ee.tagName.toLowerCase(),$={tag_name:ie};jb.indexOf(ie)>-1&&!le&&($.$el_text=ie.toLowerCase()==="a"||ie.toLowerCase()==="button"?Vv(1024,aS(ee)):Vv(1024,Hd(ee)));var X=vf(ee);X.length>0&&($.classes=X.filter((function(ae){return ae!==""}))),Mt(ee.attributes,(function(ae){var _e;if((!n6(ee)||["name","id","class","aria-label"].indexOf(ae.name)!==-1)&&(re==null||!re.includes(ae.name))&&!ce&&Cd(ae.value)&&(!Lt(_e=ae.name)||_e.substring(0,10)!=="_ngcontent"&&_e.substring(0,7)!=="_nghost")){var fe=ae.value;ae.name==="class"&&(fe=Ob(fe).join(" ")),$["attr__"+ae.name]=Vv(1024,ae.name==="href"&&te?ms(fe):fe)}}));for(var W=1,O=1,Y=ee;Y=vK(Y);)W++,Y.tagName===ee.tagName&&O++;return $.nth_child=W,$.nth_of_type=O,$})(S,s,l,c,h));var Q=(function(ee){if(!Ry(ee))return{};var ce={};return Mt(ee.attributes,(function(le){if(le.name&&le.name.indexOf("data-ph-capture-attribute")===0){var re=le.name.replace("data-ph-capture-attribute-",""),te=le.value;re&&te&&Cd(te)&&(ce[re]=te)}})),ce})(S);Bt(E,Q)})),T)return{props:{},explicitNoCapture:T};if(l||(P[0].$el_text=Ra(t,"a")||Ra(t,"button")?aS(t):Hd(t)),L){var A,D;P[0].attr__href=L;var B=(A=Wd(L))==null?void 0:A.host,j=Z==null||(D=Z.location)==null?void 0:D.host;B&&j&&B!==j&&(b=L)}return{props:Bt({$event_type:r.type,$ce_version:1},u?{}:{$elements:P},{$elements_chain:(x=P,(function(S){return S.map((N=>{var U,Q,ee="";if(N.tag_name&&(ee+=N.tag_name),N.attr_class)for(var ce of(N.attr_class.sort(),N.attr_class))ee+="."+ce.replace(/"/g,"");var le=he({},N.text?{text:N.text}:{},{"nth-child":(U=N.nth_child)!==null&&U!==void 0?U:0,"nth-of-type":(Q=N.nth_of_type)!==null&&Q!==void 0?Q:0},N.href?{href:N.href}:{},N.attr_id?{attr_id:N.attr_id}:{},N.attributes),re={};return mp(le).sort(((te,ie)=>te[0].localeCompare(ie[0]))).forEach((te=>{var ie=te[1];return re[rS(te[0].toString())]=rS(ie.toString())})),(ee+=":")+mp(re).map((te=>te[0]+'="'+te[1]+'"')).join("")})).join(";")})((function(S){return S.map((N=>{var U,Q,ee={text:(U=N.$el_text)==null?void 0:U.slice(0,400),tag_name:N.tag_name,href:(Q=N.attr__href)==null?void 0:Q.slice(0,2048),attr_class:Nq(N),attr_id:N.attr__id,nth_child:N.nth_child,nth_of_type:N.nth_of_type,attributes:{}};return mp(N).filter((ce=>ce[0].indexOf("attr__")===0)).forEach((ce=>ee.attributes[ce[0]]=ce[1])),ee}))})(x)))},(n=P[0])!=null&&n.$el_text?{$el_text:(a=P[0])==null?void 0:a.$el_text}:{},b&&r.type==="click"?{$external_click_url:b}:{},E)}}var Xc=Zt("[ExceptionAutocapture]"),PS=()=>{},yK=Zt("[TracingHeaders]"),Bs=Zt("[Web Vitals]"),SS=9e5,CS="disabled",TS="lazy_loading",ed="awaiting_config",Hh="missing_config";Zt("[SessionRecording]"),Zt("[SessionRecording]");var Fy="[SessionRecording]",mi=Zt(Fy),bK=Zt("[Heatmaps]");function ES(t){return qt(t)&&"clientX"in t&&"clientY"in t&&Bn(t.clientX)&&Bn(t.clientY)}var Hv=Zt("[Product Tours]"),Wv=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(Db))},kK=["$set_once","$set"],Mr=Zt("[SiteApps]"),AS="Error while initializing PostHog app with config id ";function sl(t,e,n){if(nt(t))return!1;switch(n){case"exact":return t===e;case"contains":var a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(a,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class wK{constructor(e){this.yn=new $b,this.bn=(n,a)=>this._n(n,a)&&this.wn(n,a)&&this.xn(n,a)&&this.kn(n,a),this._n=(n,a)=>a==null||!a.event||n?.event===a?.event,this._instance=e,this.Sn=new Set,this.Cn=new Set}init(){var e,n;ke((e=this._instance)==null?void 0:e._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((a,r)=>{this.on(a,r)}))}register(e){var n,a;if(!ke((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((l=>{var c,u;(c=this.Cn)==null||c.add(l),(u=l.steps)==null||u.forEach((h=>{var p;(p=this.Sn)==null||p.add(h?.event||"")}))})),(a=this._instance)!=null&&a.autocapture)){var r,s=new Set;e.forEach((l=>{var c;(c=l.steps)==null||c.forEach((u=>{u!=null&&u.selector&&s.add(u?.selector)}))})),(r=this._instance)==null||r.autocapture.setElementSelectors(s)}}on(e,n){var a;n!=null&&e.length!=0&&(this.Sn.has(e)||this.Sn.has(n?.event))&&this.Cn&&((a=this.Cn)==null?void 0:a.size)>0&&this.Cn.forEach((r=>{this.Tn(n,r)&&this.yn.emit("actionCaptured",r.name)}))}In(e){this.onAction("actionCaptured",(n=>e(n)))}Tn(e,n){if(n?.steps==null)return!1;for(var a of n.steps)if(this.bn(e,a))return!0;return!1}onAction(e,n){return this.yn.on(e,n)}wn(e,n){if(n!=null&&n.url){var a,r=e==null||(a=e.properties)==null?void 0:a.$current_url;if(!r||typeof r!="string"||!sl(r,n.url,n.url_matching||"contains"))return!1}return!0}xn(e,n){return!!this.Mn(e,n)&&!!this.En(e,n)&&!!this.Rn(e,n)}Mn(e,n){var a;if(n==null||!n.href)return!0;var r=this.Pn(e);if(r.length>0)return r.some((c=>sl(c.href,n.href,n.href_matching||"exact")));var s,l=(e==null||(a=e.properties)==null?void 0:a.$elements_chain)||"";return!!l&&sl((s=l.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}En(e,n){var a;if(n==null||!n.text)return!0;var r=this.Pn(e);if(r.length>0)return r.some((h=>sl(h.text,n.text,n.text_matching||"exact")||sl(h.$el_text,n.text,n.text_matching||"exact")));var s,l,c,u=(e==null||(a=e.properties)==null?void 0:a.$elements_chain)||"";return!!u&&(s=(function(h){for(var p,m=[],v=/(?::|")text="(.*?)"/g;!nt(p=v.exec(h));)m.includes(p[1])||m.push(p[1]);return m})(u),l=n.text,c=n.text_matching||"exact",s.some((h=>sl(h,l,c))))}Rn(e,n){var a,r;if(n==null||!n.selector)return!0;var s=e==null||(a=e.properties)==null?void 0:a.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(n.selector_regex&&l)try{return new RegExp(n.selector_regex).test(l)}catch{return!1}return!1}Pn(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}kn(e,n){return n==null||!n.properties||n.properties.length===0||R6(n.properties.reduce(((a,r)=>{var s=it(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return a[r.key]={values:s,operator:r.operator||"exact"},a}),{}),e?.properties)}}class xK{constructor(e){this.On=[],this._instance=e,this.Ln=new Map,this.Fn=new Map,this.An=new Map}$n(e,n){return!!e&&R6(e.propertyFilters,n?.properties)}Nn(e,n){var a=new Map;return e.forEach((r=>{var s;(s=r.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach((l=>{if(l!=null&&l.name){var c=a.get(l.name)||[];c.push(r.id),a.set(l.name,c)}}))})),a}Dn(e,n,a){var r=(a===qc.Activation?this.Ln:this.Fn).get(e),s=[];return this.qn((l=>{s=l.filter((c=>r?.includes(c.id)))})),s.filter((l=>{var c,u=(c=l.conditions)==null||(c=c[a])==null||(c=c.values)==null?void 0:c.find((h=>h.name===e));return this.$n(u,n)}))}register(e){var n;ke((n=this._instance)==null?void 0:n._addCaptureHook)||(this.jn(e),this.Bn(e))}Bn(e){var n=e.filter((a=>{var r,s;return((r=a.conditions)==null?void 0:r.actions)&&((s=a.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0}));n.length!==0&&(this.Hn==null&&(this.Hn=new wK(this._instance),this.Hn.init(),this.Hn.In((a=>{this.onAction(a)}))),n.forEach((a=>{var r,s,l,c,u;a.conditions&&(r=a.conditions)!=null&&r.actions&&(s=a.conditions)!=null&&(s=s.actions)!=null&&s.values&&((l=a.conditions)==null||(l=l.actions)==null||(l=l.values)==null?void 0:l.length)>0&&((c=this.Hn)==null||c.register(a.conditions.actions.values),(u=a.conditions)==null||(u=u.actions)==null||(u=u.values)==null||u.forEach((h=>{if(h&&h.name){var p=this.An.get(h.name);p&&p.push(a.id),this.An.set(h.name,p||[a.id])}})))})))}jn(e){var n,a=e.filter((s=>{var l,c;return((l=s.conditions)==null?void 0:l.events)&&((c=s.conditions)==null||(c=c.events)==null||(c=c.values)==null?void 0:c.length)>0})),r=e.filter((s=>{var l,c;return((l=s.conditions)==null?void 0:l.cancelEvents)&&((c=s.conditions)==null||(c=c.cancelEvents)==null||(c=c.values)==null?void 0:c.length)>0}));a.length===0&&r.length===0||((n=this._instance)==null||n._addCaptureHook(((s,l)=>{this.onEvent(s,l)})),this.Ln=this.Nn(e,qc.Activation),this.Fn=this.Nn(e,qc.Cancellation))}onEvent(e,n){var a,r,s=this.Un(),l=(n==null||(a=n.properties)==null?void 0:a.$survey_id)||(n==null||(r=n.properties)==null?void 0:r.$product_tour_id);if(l&&this.getActivatedIds().includes(l)){var c=this.zn(e,l);if(c==="consume")return s.info("event consumed activated item, removing it",{event:e,itemId:l}),void this.Wn([l]);if(c==="persist")return s.info("shown item promoted to persisted activation",{event:e,itemId:l}),void this.Vn(l)}if(this.Fn.has(e)){var u=this.Dn(e,n,qc.Cancellation);u.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:u.map((p=>p.id))}),this.Wn(u.map((p=>p.id))),u.forEach((p=>this.Zn(p.id))))}if(this.Ln.has(e)){s.info("event name matched",{event:e,eventPayload:n,items:this.Ln.get(e)});var h=this.Dn(e,n,qc.Activation);this.Gn(h.map((p=>p.id)))}}onAction(e){this.An.has(e)&&this.Gn(this.An.get(e)||[])}Gn(e){e.length!==0&&(this.On=[...new Set([...this.On,...e])],this.Un().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Vn(e){this.On=this.On.filter((a=>a!==e));var n=this.Qn();n.includes(e)||this.Jn([...n,e])}Wn(e){var n=new Set(e);this.On=this.On.filter((s=>!n.has(s)));var a=this.Qn(),r=a.filter((s=>!n.has(s)));r.length!==a.length&&this.Jn(r)}Qn(){var e,n=this.Kn();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}getActivatedIds(){return[...new Set([...this.Qn(),...this.On])].filter((e=>!this.Yn(e)))}reset(){this.On=[],this.Qn().length>0&&this.Jn([])}getEventToItemsMap(){return this.Ln}Xn(){return this.Hn}}class PK extends xK{constructor(e){super(e)}Kn(){return ky}es(){return Pi.SHOWN}qn(e){var n;(n=this._instance)==null||n.getSurveys(e)}Zn(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}Un(){return Rt}Jn(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[ky]:e})}Yn(){return!1}zn(e,n){var a;this.qn((s=>{a=s.find((l=>l.id===n))}));var r=!a||(function(s){var l;return L6(s)&&!((l=s.conditions)==null||(l=l.events)==null||!l.repeatedActivation)||s.schedule==="always"})(a);return r?e===Pi.SHOWN?"consume":"ignore":e===Pi.SHOWN?"persist":e===Pi.DISMISSED||e===Pi.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Gv="SDK is not enabled or survey functionality is not yet loaded",RS="Disabled. Not loading surveys.",SK=Z!=null&&Z.location?_f(Z.location.hash,"__posthog")||_f(location.hash,"state"):null,LS="_postHogToolbarParams",DS=Zt("[Toolbar]"),gn=Zt("[FeatureFlags]"),$s=Zt("[FeatureFlags]",{debugEnabled:!0}),qv=`" failed. Feature flags didn't load in time.`,IS=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},MS=t=>{var e={};for(var n of mp(t||{})){var a=n[1];a&&(e[n[0]]=a)}return e},gi=Zt("[Error tracking]"),NS="Refusing to render web experiment since the viewer is a likely bot",CK={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>kf(e,t),not_regex:(t,e)=>!kf(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Zn{get Se(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(a){a===void 0&&(a=!1),n.getWebExperiments((r=>{Zn.ts("retrieved web experiments from the server"),n.rs=new Map,r.forEach((s=>{if(s.feature_flag_key){var l;n.rs&&(Zn.ts("setting flag key ",s.feature_flag_key," to web experiment ",s),(l=n.rs)==null||l.set(s.feature_flag_key,s));var c=n._instance.getFeatureFlag(s.feature_flag_key);Lt(c)&&s.variants[c]&&n.ns(s.name,c,s.variants[c].transforms)}else if(s.variants)for(var u in s.variants){var h=s.variants[u];Zn.ss(h,n._instance)&&n.ns(s.name,u,h.transforms)}}))}),a)},this._instance=e,this._instance.onFeatureFlags((a=>{this.onFeatureFlags(a)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Zn.ts(NS);else if(!this.Se.disable_web_experiments){if(nt(this.rs))return this.rs=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Zn.ts("applying feature flags",e),e.forEach((n=>{var a;if(this.rs&&(a=this.rs)!=null&&a.has(n)){var r,s=this._instance.getFeatureFlag(n),l=(r=this.rs)==null?void 0:r.get(n);s&&l!=null&&l.variants[s]&&this.ns(l.name,s,l.variants[s].transforms)}}))}}previewWebExperiment(){var e=Zn.getWindowLocation();if(e!=null&&e.search){var n=zl(e?.search,"__experiment_id"),a=zl(e?.search,"__experiment_variant");n&&a&&(Zn.ts("previewing web experiments "+n+" && "+a),this.getWebExperiments((r=>{this.os(parseInt(n),a,r)}),!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,a){if(this.Se.disable_web_experiments&&!a)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!n)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Se.token),method:"GET",callback:s=>e(s.statusCode===200&&s.json&&s.json.experiments||[])})}os(e,n,a){var r=a.filter((s=>s.id===e));r&&r.length>0&&(Zn.ts("Previewing web experiment ["+r[0].name+"] with variant ["+n+"]"),this.ns(r[0].name,n,r[0].variants[n].transforms))}static ss(e,n){return!nt(e.conditions)&&Zn.ls(e,n)&&Zn.us(e)}static ls(e,n){var a;if(nt(e.conditions)||nt((a=e.conditions)==null?void 0:a.url))return!0;var r=Zn.getWindowLocation();if(r){var s,l,c,u=KE(n,r.href);return(s=e.conditions)==null||!s.url||CK[(l=(c=e.conditions)==null?void 0:c.urlMatchType)!==null&&l!==void 0?l:"icontains"](e.conditions.url,u)}return!1}static getWindowLocation(){return Z?.location}static us(e){var n;if(nt(e.conditions)||nt((n=e.conditions)==null?void 0:n.utm))return!0;var a=d6();if(a.utm_source){var r,s,l,c,u,h,p,m,v=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==a.utm_campaign,y=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_source||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_source)==a.utm_source,b=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_medium||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_medium)==a.utm_medium,x=(p=e.conditions)==null||(p=p.utm)==null||!p.utm_term||((m=e.conditions)==null||(m=m.utm)==null?void 0:m.utm_term)==a.utm_term;return v&&b&&x&&y}return!1}static ts(e){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;n>r;r++)a[r-1]=arguments[r];be.info("[WebExperiments] "+e,a)}ns(e,n,a){this._is_bot()?Zn.ts(NS):n!=="control"?a.forEach((r=>{if(r.selector){var s;Zn.ts("applying transform of variant "+n+" for experiment "+e+" ",r);var l=(s=document)==null?void 0:s.querySelectorAll(r.selector);l?.forEach((c=>{var u=c;r.html&&(u.innerHTML=r.html),r.css&&u.setAttribute("style",r.css)}))}})):Zn.ts("Control variants leave the page unmodified.")}_is_bot(){return sa&&this._instance?T6(sa,this.Se.custom_blocked_useragents):void 0}}var Ba=Zt("[Conversations]"),Vs="Conversations not available yet.",OS="console",Kf={featureFlags:class{constructor(t){this.hs=!1,this.ds=!1,this.cs=!1,this.vs=!1,this.fs=!1,this.ps=!1,this.gs=!1,this.ys=!1,this.bs=0,this._s=()=>{var e=this.ws();this.bs=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],Z&&tn(Z,"online",this._s)}destroy(){Z?.removeEventListener("online",this._s)}get Se(){return this._instance.config}get ri(){return this._instance.persistence}xs(t){return this._instance.get_property(t)}ks(){var t,e;return(t=(e=this.ri)==null?void 0:e.sr(this.Se.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}Ss(){return!!this.ks()&&(this.ys||this.cs||(this.ys=!0,gn.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Cs(){var t,e=(t=this.Se.evaluation_contexts)!==null&&t!==void 0?t:this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.gs||(gn.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.gs=!0),e!=null&&e.length?e.filter((n=>{var a=n&&typeof n=="string"&&n.trim().length>0;return a||gn.error("Invalid evaluation context found:",n,"Expected non-empty string"),a})):[]}Ts(){return this.Cs().length>0}Is(){var t=this.Se.flag_keys;if(!ke(t)){if(it(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||gn.error("Invalid flag key found:",e,"Expected non-empty string"),n}));gn.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,n=this._instance.config,a=(t=(e=n.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(a).length){var r,s,l=(r=(s=n.bootstrap)==null?void 0:s.featureFlagPayloads)!==null&&r!==void 0?r:{},c=Object.keys(a).filter((h=>!!a[h])).reduce(((h,p)=>(h[p]=a[p]||!1,h)),{}),u=Object.keys(l).filter((h=>c[h])).reduce(((h,p)=>(l[p]&&(h[p]=l[p]),h)),{});this.receivedFeatureFlags({featureFlags:c,featureFlagPayloads:u})}}updateFlags(t,e,n){var a,r,s=n!=null&&n.merge&&(a=this.xs(Ys))!==null&&a!==void 0?a:{},l=n!=null&&n.merge&&(r=this.xs(fp))!==null&&r!==void 0?r:{},c=he({},s,t),u=he({},l,e),h={};for(var p of Object.entries(c)){var m=p[0],v=p[1];h[m]={key:m,enabled:NP(v),variant:OP(v),reason:void 0,metadata:ke(u?.[m])?void 0:{id:0,version:void 0,description:void 0,payload:u[m]}}}this.receivedFeatureFlags({flags:h})}get hasLoadedFlags(){return this.ds}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.xs(_y),e=this.xs(bi),n=this.xs(hl);if(!n&&!e)return t||{};var a=Bt({},t||{}),r=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var s of r){var l,c,u=a[s],h=e?.[s],p=ke(h)?(l=u?.enabled)!==null&&l!==void 0&&l:!!h,m=ke(h)?u.variant:typeof h=="string"?h:void 0,v=n?.[s],y=he({},u,{enabled:p,variant:p?m??u?.variant:void 0});p!==u?.enabled&&(y.original_enabled=u?.enabled),m!==u?.variant&&(y.original_variant=u?.variant),v&&(y.metadata=he({},u?.metadata,{payload:v,original_payload:u==null||(c=u.metadata)==null?void 0:c.payload})),a[s]=y}return this.hs||(gn.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:a}),this.hs=!0),a}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var a=t[n];return{key:n,enabled:NP(a),variant:OP(a),payload:MP(e[n])}}))}getFlagVariants(){var t=this.xs(Ys),e=this.xs(bi);if(!e)return t||{};for(var n=Bt({},t),a=Object.keys(e),r=0;a.length>r;r++)n[a[r]]=e[a[r]];return this.hs||(gn.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.hs=!0),n}getFlagPayloads(){var t=this.xs(fp),e=this.xs(hl);if(!e)return t||{};for(var n=Bt({},t||{}),a=Object.keys(e),r=0;a.length>r;r++)n[a[r]]=e[a[r]];return this.hs||(gn.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.hs=!0),n}reloadFeatureFlags(){this.vs||this.Se.advanced_disable_feature_flags||this.ws()||this.Ms||(this._instance.qi.emit("featureFlagsReloading",!0),this.Ms=setTimeout((()=>{this.Es()}),5))}Rs(){clearTimeout(this.Ms),this.Ms=void 0}ensureFlagsLoaded(){this.ds||this.cs||this.Ms||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.vs=t}Es(t){var e;if(this.Rs(),!this._instance.Rr()&&!this.ws())if(this.cs)this.fs=!0;else{var n=this.Se.token,a=this.xs(df),r={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:he({},((e=this.ri)==null?void 0:e.get_initial_props())||{},this.xs(Gs)||{}),group_properties:this.xs(qs),timezone:g6()};la(a)||ke(a)||(r.$device_id=a),(t!=null&&t.disableFlags||this.Se.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.Ts()&&(r.evaluation_contexts=this.Cs());var s=this.Is();ke(s)||(r.flag_keys=s);var l=!!this.Se.advanced_only_evaluate_survey_feature_flags,c=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Se.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.cs=!0,this._instance._send_request({method:"POST",url:c,data:r,compression:this.Se.disable_compression?void 0:aa.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback:u=>{var h,p,m,v=!0;if(this.Ps(u.statusCode),u.statusCode===200&&(this.fs||(this.$anon_distinct_id=void 0),v=!1),this.cs=!1,!r.disable_flags||this.fs){this.ps=!v;var y=[];u.error?u.error instanceof Error?y.push(u.error.name==="AbortError"?"timeout":"connection_error"):y.push("unknown_error"):u.statusCode!==200&&y.push("api_error_"+u.statusCode),(h=u.json)!=null&&h.errorsWhileComputingFlags&&y.push("errors_while_computing_flags");var b,x=!((p=u.json)==null||(p=p.quotaLimited)==null||!p.includes("feature_flags"));x&&y.push("quota_limited"),(m=this.ri)==null||m.register({[xy]:y}),x?gn.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."):(r.disable_flags||this.receivedFeatureFlags((b=u.json)!==null&&b!==void 0?b:{},v,{partialResponse:l}),this.fs&&(this.fs=!1,this.Es()))}}})}}ws(){return l6(this.bs,3)}Ps(t){this.bs=c6(t,this.bs,3,(()=>gn.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var n;if(e===void 0&&(e={}),!e.fresh||this.ps)if(this.ds||this.getFlags()&&this.getFlags().length>0){if(!this.Ss()){var a=this.getFeatureFlagResult(t,e);return(n=a?.variant)!==null&&n!==void 0?n:a?.enabled}}else gn.warn('getFeatureFlag for key "'+t+qv)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e?.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.ps)if(this.ds||this.getFlags()&&this.getFlags().length>0){if(!this.Ss()){var n=this.getFlagVariants(),a=t in n,r=n[t],s=this.getFlagPayloads()[t],l=String(r),c=this.xs(yy)||void 0,u=this.xs(Vd)||void 0,h=this.xs(Sd)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var p,m=this._instance.get_session_id(),v=this.xs(wy);m&&m!==v&&(h={},(p=this.ri)==null||p.register({[Sd]:h,[wy]:m}))}if((e.send_event||!("send_event"in e))&&(!(t in h)||!h[t].includes(l))){var y,b,x,P,E,L,T,A,D,B;it(h[t])?h[t].push(l):h[t]=[l],(y=this.ri)==null||y.register({[Sd]:h});var j=this.getFeatureFlagDetails(t),S=[...(b=this.xs(xy))!==null&&b!==void 0?b:[]];ke(r)&&S.push("flag_missing");var N={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:s||null,$feature_flag_request_id:c,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:((x=this.Se.bootstrap)==null||(x=x.featureFlags)==null?void 0:x[t])||null,$feature_flag_bootstrapped_payload:((P=this.Se.bootstrap)==null||(P=P.featureFlagPayloads)==null?void 0:P[t])||null,$used_bootstrap_value:!this.ps};ke(j==null||(E=j.metadata)==null?void 0:E.version)||(N.$feature_flag_version=j.metadata.version);var U,Q=(L=j==null||(T=j.reason)==null?void 0:T.description)!==null&&L!==void 0?L:j==null||(A=j.reason)==null?void 0:A.code;Q&&(N.$feature_flag_reason=Q),j!=null&&(D=j.metadata)!=null&&D.id&&(N.$feature_flag_id=j.metadata.id),ke(j?.original_variant)&&ke(j?.original_enabled)||(N.$feature_flag_original_response=ke(j.original_variant)?j.original_enabled:j.original_variant),j!=null&&(B=j.metadata)!=null&&B.original_payload&&(N.$feature_flag_original_payload=j==null||(U=j.metadata)==null?void 0:U.original_payload),S.length&&(N.$feature_flag_error=S.join(",")),this._instance.capture("$feature_flag_called",N)}if(a)return{key:t,enabled:!!r,variant:typeof r=="string"?r:void 0,payload:MP(s)}}}else gn.warn('getFeatureFlagResult for key "'+t+qv)}getRemoteConfigPayload(t,e){var n=this.Se.token,a={distinct_id:this._instance.get_distinct_id(),token:n};this.Ts()&&(a.evaluation_contexts=this.Cs());var r=this.Is();ke(r)||(a.flag_keys=r),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:a,compression:this.Se.disable_compression?void 0:aa.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback(s){var l,c=(l=s.json)==null?void 0:l.featureFlagPayloads;e(c?.[t]||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),!e.fresh||this.ps){if(this.ds||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(t,e);return ke(n)?void 0:!!n}gn.warn('isFeatureEnabled for key "'+t+qv)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,n){if(this.ri){this.ds=!0;var a=this.getFlagVariants(),r=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(l,c,u,h,p,m){u===void 0&&(u={}),h===void 0&&(h={}),p===void 0&&(p={});var v=(S=>{var N=S.flags;return N?(S.featureFlags=Object.fromEntries(Object.keys(N).map((U=>{var Q;return[U,(Q=N[U].variant)!==null&&Q!==void 0?Q:N[U].enabled]}))),S.featureFlagPayloads=Object.fromEntries(Object.keys(N).filter((U=>N[U].enabled)).filter((U=>{var Q;return(Q=N[U].metadata)==null?void 0:Q.payload})).map((U=>{var Q;return[U,(Q=N[U].metadata)==null?void 0:Q.payload]})))):S.featureFlags&&gn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),S})(l),y=v.flags,b=v.featureFlags,x=v.featureFlagPayloads;if(b){var P=l.requestId,E=l.evaluatedAt;if(it(b)){gn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var L={};if(b)for(var T=0;b.length>T;T++)L[b[T]]=!0;c&&c.register({[pp]:b,[Ys]:L})}else{var A=b,D=x,B=y;if(m!=null&&m.partialResponse)A=he({},u,A),D=he({},h,D),B=he({},p,B);else if(l.errorsWhileComputingFlags)if(y){var j=new Set(Object.keys(y).filter((S=>{var N;return!((N=y[S])!=null&&N.failed)})));A=he({},u,Object.fromEntries(Object.entries(A).filter((S=>j.has(S[0]))))),D=he({},h,Object.fromEntries(Object.entries(D||{}).filter((S=>j.has(S[0]))))),B=he({},p,Object.fromEntries(Object.entries(B||{}).filter((S=>j.has(S[0])))))}else A=he({},u,A),D=he({},h,D),B=he({},p,B);c&&c.register(he({[pp]:Object.keys(MS(A)),[Ys]:A||{},[fp]:D||{},[_y]:B||{}},P?{[yy]:P}:{},E?{[Vd]:E}:{}))}}})(t,this.ri,a,r,s,n),e||(this.ys=!1),this.Os(e)}}override(t,e){e===void 0&&(e=!1),gn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.ri)return gn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.ri.unregister(bi),this.ri.unregister(hl),this.Os(),$s.info("All overrides cleared");if(it(t)){var e=IS(t);return this.ri.register({[bi]:e}),this.Os(),$s.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,a=t;if(this.hs=!!((n=a.suppressWarning)!==null&&n!==void 0&&n),"flags"in a){if(a.flags===!1)this.ri.unregister(bi),$s.info("Flag overrides cleared");else if(a.flags){if(it(a.flags)){var r=IS(a.flags);this.ri.register({[bi]:r})}else this.ri.register({[bi]:a.flags});$s.info("Flag overrides set",{flags:a.flags})}}return"payloads"in a&&(a.payloads===!1?(this.ri.unregister(hl),$s.info("Payload overrides cleared")):a.payloads&&(this.ri.register({[hl]:a.payloads}),$s.info("Payload overrides set",{payloads:a.payloads}))),void this.Os()}if(t&&typeof t=="object")return this.ri.register({[bi]:t}),this.Os(),$s.info("Flag overrides set",{flags:t});gn.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ds){var e=this.Ls(),n=e.flags,a=e.flagVariants;try{t(n,a)}catch(r){gn.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var a,r=(this.xs(dd)||[]).find((u=>u.flagKey===t)),s={["$feature_enrollment/"+t]:e},l={$feature_flag:t,$feature_enrollment:e,$set:s};r&&(l.$early_access_feature_name=r.name),n&&(l.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(s,!1);var c=he({},this.getFlagVariants(),{[t]:e});(a=this.ri)==null||a.register({[pp]:Object.keys(MS(c)),[Ys]:c}),this.Os()}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var a=this.xs(dd),r=n?"&"+n.map((s=>"stage="+s)).join("&"):"";if(a&&!e)return t(a);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Se.token+r),method:"GET",callback:s=>{var l,c;if(s.json){var u=s.json.earlyAccessFeatures;return(l=this.ri)==null||l.unregister(dd),(c=this.ri)==null||c.register({[dd]:u}),t(u)}}})}Ls(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((n=>e[n])),flagVariants:Object.keys(e).filter((n=>e[n])).reduce(((n,a)=>(n[a]=e[a],n)),{})}}Os(t){var e=this.Ls(),n=e.flags,a=e.flagVariants;this.featureFlagEventHandlers.forEach((r=>{try{r(n,a,{errorsLoading:t})}catch(s){gn.error("Error while running feature flags callback",s)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.xs(Gs)||{},a=t?.$set||(t!=null&&t.$set_once?{}:t),r=t?.$set_once,s={};if(r)for(var l in r)({}).hasOwnProperty.call(r,l)&&(l in n||(s[l]=r[l]));this._instance.register({[Gs]:he({},n,s,a)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=he({},this.xs(Gs)||{});t.forEach((a=>{delete n[a]})),this._instance.register({[Gs]:n}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(Gs),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.xs(qs)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((a=>{n[a]=he({},n[a],t[a]),delete t[a]})),this._instance.register({[qs]:he({},n,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.xs(qs)||{};this._instance.register({[qs]:he({},e,{[t]:{}})})}else this._instance.unregister(qs)}reset(){this.ds=!1,this.cs=!1,this.vs=!1,this.fs=!1,this.ps=!1,this.$anon_distinct_id=void 0,this.Rs(),this.hs=!1,this.bs=0}}},TK={sessionRecording:class{get Se(){return this._instance.config}get ri(){return this._instance.persistence}get started(){var t;return!((t=this.Fs)==null||!t.isStarted)}get status(){var t,e;return this.As===ed||this.As===Hh?this.As:(t=(e=this.Fs)==null?void 0:e.status)!==null&&t!==void 0?t:this.As}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.As=CS,this.$s=void 0,this._instance=t,!this._instance.sessionManager)throw mi.error("started without valid sessionManager"),new Error(Fy+" started without valid sessionManager. This is a bug.");if(this.Se.cookieless_mode===xi)throw new Error(Fy+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ns(){var t,e=!((t=this._instance.get_property(ao))==null||!t.enabled),n=!this.Se.disable_session_recording,a=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return Z&&e&&n&&!a}startIfEnabledOrStop(t){var e;if(!this.Ns||(e=this.Fs)==null||!e.isStarted){var n=!ke(Object.assign)&&!ke(Array.from);this.Ns&&n?(this.Ds(t),mi.info("starting")):(this.As=CS,this.stopRecording())}}Ds(t){var e,n,a;this.Ns&&(this.As!==ed&&this.As!==Hh&&(this.As=TS),Be!=null&&(e=Be.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=Be.__PosthogExtensions__)!=null&&n.initSessionRecording?this.qs(t):(a=Be.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this._instance,this.js,(r=>{if(r)return mi.error("could not load recorder",r);this.qs(t)})))}stopRecording(){var t,e;(t=this.$s)==null||t.call(this),this.$s=void 0,(e=this.Fs)==null||e.stop()}Bs(){var t,e;(t=this.$s)==null||t.call(this),this.$s=void 0,(e=this.Fs)==null||e.discard()}Hs(){var t,e;(t=this.ri)==null||t.unregister(Ib),(e=this.ri)==null||e.unregister(jE)}Us(t,e){if(nt(t))return null;var n,a=Bn(t)?t:parseFloat(t);return typeof(n=a)!="number"||!Number.isFinite(n)||0>n||n>1?(mi.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):a}zs(t){if(this.ri){var e,n,a=this.ri,r=()=>{var s,l=t.sessionRecording===!1?void 0:t.sessionRecording,c=this.Us((s=this.Se.session_recording)==null?void 0:s.sampleRate,"session_recording.sampleRate"),u=this.Us(l?.sampleRate,"remote config sampleRate"),h=c??u;nt(h)&&this.Hs();var p=l?.minimumDurationMilliseconds;a.register({[ao]:he({cache_timestamp:Date.now(),enabled:!!l},l,{networkPayloadCapture:he({capturePerformance:t.capturePerformance},l?.networkPayloadCapture),canvasRecording:{enabled:l?.recordCanvas,fps:l?.canvasFps,quality:l?.canvasQuality},sampleRate:h,minimumDurationMilliseconds:ke(p)?null:p,endpoint:l?.endpoint,triggerMatchType:l?.triggerMatchType,masking:l?.masking,urlTriggers:l?.urlTriggers,version:l?.version,triggerGroups:l?.triggerGroups})})};r(),(e=this.$s)==null||e.call(this),this.$s=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(r)}}onRemoteConfig(t){return"sessionRecording"in t?t.sessionRecording===!1?(this.zs(t),void this.Bs()):(this.zs(t),void this.startIfEnabledOrStop()):(this.As===ed&&(this.As=Hh,mi.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var n;e===void 0&&(e="log"),(n=this.Fs)!=null&&n.log?this.Fs.log(t,e):mi.warn("log called before recorder was ready")}get js(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(ao);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}Ws(){var t,e,n=this._instance.get_property(ao);if(!n)return!1;try{e=typeof n=="object"?n:JSON.parse(n)}catch(r){return mi.warn("persisted remote config for session recording is invalid and will be ignored",r),!1}var a=(t=e.cache_timestamp)!==null&&t!==void 0?t:Date.now();return 36e5>=Date.now()-a}qs(t){var e,n;if((e=Be.__PosthogExtensions__)==null||!e.initSessionRecording)return mi.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[WE]:!0});if(this.Fs||(this.Fs=(n=Be.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.Fs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ws())return this.As===Hh||this.As===ed?void 0:(this.As=ed,mi.info("persisted remote config is stale, requesting fresh config before starting"),void new v6(this._instance).load());this.As=TS,this.Fs.start(t)}onRRwebEmit(t){var e;(e=this.Fs)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Fs||(e=this.ri)==null||e.register({[FE]:!0}),(t=this.Fs)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Fs||(e=this.ri)==null||e.register({[zE]:!0}),(t=this.Fs)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.Fs||(n=this.ri)==null||n.register({[t==="url"?UE:BE]:!0}),(e=this.Fs)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.Fs)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.Fs)==null||!n.tryAddCustomEvent(t,e))}}},EK={autocapture:class{constructor(t){this.Vs=!1,this.Zs=null,this.Gs=!1,this.instance=t,this.rageclicks=new xS(t.config.rageclick),this.Qs=null}initialize(){this.startIfEnabled()}get Se(){var t,e,n=qt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map((a=>new RegExp(a))),n.url_ignorelist=(e=n.url_ignorelist)==null?void 0:e.map((a=>new RegExp(a))),n}Js(){if(this.isBrowserSupported()){if(Z&&xe){var t=n=>{n=n||Z?.event;try{this.Ks(n)}catch(a){$v.error("Failed to capture event",a)}};if(tn(xe,"submit",t,{capture:!0}),tn(xe,"change",t,{capture:!0}),tn(xe,"click",t,{capture:!0}),this.Se.capture_copied_text){var e=n=>{n=n||Z?.event;try{this.Ks(n,Bv)}catch(a){$v.error("Failed to capture copy/cut event",a)}};tn(xe,"copy",e,{capture:!0}),tn(xe,"cut",e,{capture:!0})}}}else $v.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Vs&&(this.Js(),this.Vs=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Gs=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[uy]:!!t.autocapture_opt_out}),this.Zs=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Qs=t}getElementSelectors(t){var e,n=[];return(e=this.Qs)==null||e.forEach((a=>{var r=xe?.querySelectorAll(a);r?.forEach((s=>{t===s&&n.push(a)}))})),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[uy];if(la(this.Zs)&&!Hr(n)&&!this.instance.Rr())return!1;var a=(e=this.Zs)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!a}Ks(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,a=Dv(t);YE(a)&&(a=a.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&nS(a,this.instance.config.rageclick)&&this.Ks(t,"$rageclick");var r=e===Bv;if(a&&(function(m,v,y,b,x,P){var E,L,T,A,D,B;if(y===void 0&&(y=void 0),!Z||zb(m)||(E=y)!=null&&E.url_allowlist&&!XP(y.url_allowlist,P)||(L=y)!=null&&L.url_ignorelist&&XP(y.url_ignorelist,P))return!1;if((T=y)!=null&&T.dom_event_allowlist){var j=y.dom_event_allowlist;if(j&&!j.some((ce=>v.type===ce)))return!1}var S=t6(m,b),N=S.parentIsUsefulElement,U=S.targetElementList;if(!(function(ce,le){var re=le?.element_allowlist;if(ke(re))return!0;var te,ie=function(X){if(re.some((W=>X.tagName.toLowerCase()===W)))return{v:!0}};for(var $ of ce)if(te=ie($))return te.v;return!1})(U,y)||!Ay(U,(A=y)==null?void 0:A.css_selector_allowlist)||Ay(U,(D=(B=y)==null?void 0:B.css_selector_ignorelist)!==null&&D!==void 0?D:Eq))return!1;try{var Q=Z.getComputedStyle(m);if(Q&&Q.getPropertyValue("cursor")==="pointer"&&v.type==="click")return!0}catch{}var ee=m.tagName.toLowerCase();switch(ee){case"html":return!1;case"form":return(x||["submit"]).indexOf(v.type)>=0;case"input":case"select":case"textarea":return(x||["change","click"]).indexOf(v.type)>=0;default:return N?(x||["click"]).indexOf(v.type)>=0:(x||["click"]).indexOf(v.type)>=0&&(jb.indexOf(ee)>-1||m.getAttribute("contenteditable")==="true")}})(a,t,this.Se,r,r?["copy","cut"]:void 0,this.instance)){var s=_K(a,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.Gs,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),l=s.props;if(s.explicitNoCapture)return!1;var c=this.getElementSelectors(a);if(c&&c.length>0&&(l.$element_selectors=c),e===Bv){var u,h=QE(Z==null||(u=Z.getSelection())==null?void 0:u.toString()),p=t.type||"clipboard";if(!h)return!1;l.$selected_content=h,l.$copy_type=p}return this.instance.capture(e,l),!0}}}isBrowserSupported(){return yr(xe?.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Ys=(Z==null||(e=Z.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(be.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Xs&&this.Xs(),this.Xs=void 0,be.info("History API monitoring stopped")}monitorHistoryChanges(){Z&&Z.history&&(this.eo("pushState"),this.eo("replaceState"),this.ro())}eo(t){var e;if(Z&&((e=Z.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(a,r,s){try{if(!(r in a))return PS;var l={next:a[r]},c=s((function(){for(var u=arguments.length,h=new Array(u),p=0;u>p;p++)h[p]=arguments[p];return l.next.apply(this,h)}));return yr(c)&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:l}})),a[r]=c,()=>{if(a[r]!==c)for(var u=a[r];yr(u)&&u.__posthog_layer__;){var h=u.__posthog_layer__;if(h.next===c)return void(h.next=l.next);u=h.next}else a[r]=l.next}}catch{return PS}})(Z.history,t,(a=>function(r,s,l){a.call(this,r,s,l),n.io(t)}))}}io(t){try{var e,n=Z==null||(e=Z.location)==null?void 0:e.pathname;if(!n)return;n!==this.Ys&&this.isEnabled&&this._instance.capture(pl,{navigation_type:t}),this.Ys=n}catch(a){be.error("Error capturing "+t+" pageview",a)}}ro(){if(!this.Xs){var t=()=>{this.io("popstate")};tn(Z,"popstate",t),this.Xs=()=>{Z&&Z.removeEventListener("popstate",t)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(t){var e;this.no=!1,this.Vs=!1,this.so=null,this.instance=t,this.no=!((e=this.instance.persistence)==null||!e.props[hy]),this.rageclicks=new xS(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return qt(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(t=this.Se.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return nt(this.Se.capture_heatmaps)?nt(this.Se.enable_heatmaps)?this.no:this.Se.enable_heatmaps:this.Se.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Vs)return;bK.info("starting..."),this.oo(),this.ke()}else{var t;clearInterval((t=this.so)!==null&&t!==void 0?t:void 0),this.ao(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[hy]:e}),this.no=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}lo(t){this.fe(t.originalEvent,"deadclick")}ke(){this.so&&clearInterval(this.so),this.so=xe?.visibilityState==="visible"?setInterval(this.Wr.bind(this),this.flushIntervalMilliseconds):null}oo(){Z&&xe&&(this.uo=this.Wr.bind(this),tn(Z,mf,this.uo),this.ho=t=>this.fe(t||Z?.event),tn(xe,"click",this.ho,{capture:!0}),this.do=t=>this.co(t||Z?.event),tn(xe,"mousemove",this.do,{capture:!0}),this.vo=new iS(this.instance,Oq,this.lo.bind(this)),this.vo.startIfEnabledOrStop(),this.fo=this.ke.bind(this),tn(xe,ff,this.fo),this.Vs=!0)}ao(){var t;Z&&xe&&(this.uo&&Z.removeEventListener(mf,this.uo),this.ho&&xe.removeEventListener("click",this.ho,{capture:!0}),this.do&&xe.removeEventListener("mousemove",this.do,{capture:!0}),this.fo&&xe.removeEventListener(ff,this.fo),clearTimeout(this.po),(t=this.vo)==null||t.stop(),this.Vs=!1)}mo(t,e){var n=this.instance.scrollManager.scrollY(),a=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),s=(function(l,c,u){for(var h=l;h&&gs(h)&&!Ra(h,"body");){if(h===u)return!1;var p=void 0;try{var m,v,y;p=(m=(v=(y=h.ownerDocument)==null?void 0:y.defaultView)!==null&&v!==void 0?v:Z)==null?void 0:m.getComputedStyle(h).position}catch{return!1}if(Ke(c,p))return!0;h=XE(h)}return!1})(Dv(t),["fixed","sticky"],r);return{x:t.clientX+(s?0:a),y:t.clientY+(s?0:n),target_fixed:s,type:e}}fe(t,e){var n;if(e===void 0&&(e="click"),!QP(t.target)&&ES(t)){var a=this.mo(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&nS(Dv(t),this.instance.config.rageclick)&&this.kt(he({},a,{type:"rageclick"})),this.kt(a)}}co(t){!QP(t.target)&&ES(t)&&(clearTimeout(this.po),this.po=setTimeout((()=>{this.kt(this.mo(t,"mousemove"))}),500))}kt(t){if(Z){var e=this.Se.disable_capture_url_hashes?ms(Z.location.href):Z.location.href,n=this.Se.custom_personal_data_properties,a=this.Se.mask_personal_data_properties?[...Fl,...n||[]]:[],r=Gd(e,a,qd);this.R=this.R||{},this.R[r]||(this.R[r]=[]),this.R[r].push(t)}}Wr(){this.R&&!cs(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:iS,webVitalsAutocapture:class{constructor(t){var e;this.no=!1,this.Vs=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.yo=()=>{clearTimeout(this.bo),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((n,a)=>he({},n,{["$web_vitals_"+a.name+"_event"]:he({},a),["$web_vitals_"+a.name+"_value"]:a.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._o=n=>{var a;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.wo();if(!ke(r))if(nt(n?.name)||nt(n?.value))Bs.error("Invalid metric received",n);else if(!this.xo||this.xo>n.value){this.R.url!==r&&(this.yo(),this.bo=setTimeout(this.yo,this.flushToCaptureTimeoutMs)),ke(this.R.url)&&(this.R.url=r),this.R.firstMetricTimestamp=ke(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var s=(a=this._instance.sessionManager)==null?void 0:a.checkAndGetSessionAndWindowId(!0),l=he({},n,{$current_url:r,timestamp:Date.now()});ke(s)||(l.$session_id=s.sessionId,l.$window_id=s.windowId),this.R.metrics.push(l),this.R.metrics.length===this.allowedMetrics.length&&this.yo()}else Bs.error("Ignoring metric with value >= "+this.xo,n)},this.ko=()=>{if(!this.Vs){var n,a,r,s,l=Be.__PosthogExtensions__;if(!ke(l)&&!ke(l.postHogWebVitalsCallbacks)){var c=l.postHogWebVitalsCallbacks;n=c.onLCP,a=c.onCLS,r=c.onFCP,s=c.onINP}n&&a&&r&&s?(this.allowedMetrics.indexOf("LCP")>-1&&n(this._o.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&a(this._o.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this._o.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this._o.bind(this)),this.Vs=!0):Bs.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.no=!((e=this._instance.persistence)==null||!e.props[gy]),this.startIfEnabled()}get So(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=qt(this.So)?(t=this.So)==null?void 0:t.web_vitals_allowed_metrics:void 0;return nt(n)?((e=this._instance.persistence)==null?void 0:e.props[vy])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(qt(this.So)?this.So.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=qt(this.So)?this.So.web_vitals_attribution:void 0;return t!=null&&t}get xo(){var t=qt(this.So)&&Bn(this.So.__web_vitals_max_value)?this.So.__web_vitals_max_value:SS;return t>0&&6e4>=t?SS:t}get isEnabled(){var t=fn?.protocol;if(t!=="http:"&&t!=="https:")return Bs.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=qt(this.So)?this.So.web_vitals:Hr(this.So)?this.So:void 0;return Hr(e)?e:this.no}startIfEnabled(){this.isEnabled&&!this.Vs&&(Bs.info("enabled, starting..."),this.Bt(this.ko))}onRemoteConfig(t){if("capturePerformance"in t){var e=qt(t.capturePerformance)&&!!t.capturePerformance.web_vitals,n=qt(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[gy]:e}),this._instance.persistence.register({[vy]:n})),this.no=e,this.startIfEnabled()}}Bt(t){var e,n;(e=Be.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?t():(n=Be.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(a=>{a?Bs.error("failed to load script",a):t()}))}wo(){var t=Z?this._instance.config.disable_capture_url_hashes?ms(Z.location.href):Z.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Fl,...e||[]]:[];return Gd(t,n,qd)}Bs.error("Could not determine current URL")}}},AK={exceptionObserver:class{constructor(t){var e,n,a,r,s,l;this.ko=()=>{var c;if(Z&&this.isEnabled&&(c=Be.__PosthogExtensions__)!=null&&c.errorWrappingFunctions){var u=Be.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,h=Be.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,p=Be.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Co&&this.Se.capture_unhandled_errors&&(this.Co=u(this.captureException.bind(this))),!this.To&&this.Se.capture_unhandled_rejections&&(this.To=h(this.captureException.bind(this))),!this.Io&&this.Se.capture_console_errors&&(this.Io=p(this.captureException.bind(this)))}catch(m){Xc.error("failed to start",m),this.Mo()}}},this._instance=t,this.Eo=!((e=this._instance.persistence)==null||!e.props[py]),this.Ro=new RG(he({},((n=this._instance.config.error_tracking)===void 0&&(n={}),{refillRate:(a=(r=n.exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:n.__exceptionRateLimiterRefillRate)!==null&&a!==void 0?a:1,bucketSize:(s=(l=n.exceptionRateLimiterBucketSize)!==null&&l!==void 0?l:n.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10}),{refillInterval:1e4,Ae:Xc})),this.Se=this.Po(),this.startIfEnabledOrStop()}Po(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return qt(t)?e=he({},e,t):(ke(t)?this.Eo:t)&&(e=he({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Xc.info("enabled"),this.Mo(),this.Bt(this.ko)):this.Mo()}Bt(t){var e,n;(e=Be.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=Be.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(a=>{if(a)return Xc.error("failed to load script",a);t()}))}Mo(){var t,e,n;(t=this.Co)==null||t.call(this),this.Co=void 0,(e=this.To)==null||e.call(this),this.To=void 0,(n=this.Io)==null||n.call(this),this.Io=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.Eo=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[py]:this.Eo}),this.Se=this.Po(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this.Po()}captureException(t){var e,n,a,r=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.Ro.consumeRateLimit(r)?Xc.info("Skipping exception capture because of client rate limiting.",{exception:r}):(a=this._instance.exceptions)==null||a.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,n;this.Oo=[],this.Lo=new qG([new tq,new dq,new aq,new nq,new lq,new oq,new iq,new cq],(function(a){for(var r=arguments.length,s=new Array(r>1?r-1:0),l=1;r>l;l++)s[l-1]=arguments[l];return function(c,u){u===void 0&&(u=0);for(var h=[],p=c.split(`
|
|
1250
1250
|
`),m=u;p.length>m;m++){var v=p[m];if(1024>=v.length){var y=KP.test(v)?v.replace(KP,"$1"):v;if(!y.match(/\S*Error: /)){for(var b of s){var x=b(y,a);if(x){h.push(x);break}}if(h.length>=50)break}}}return(function(P){if(!P.length)return[];var E=Array.from(P);return E.reverse(),E.slice(0,50).map((L=>{return he({},L,{filename:L.filename||(T=E,T[T.length-1]||{}).filename,function:L.function||jl});var T}))})(h)}})("web:javascript",JG,eq)),this._instance=t,this.Oo=(e=(n=this._instance.persistence)==null?void 0:n.get_property(fy))!==null&&e!==void 0?e:[],this.Fo=cf(this.Ao()),this.$o=new hq(this.Fo)}onConfigChange(){this.Fo=cf(this.Ao()),this.$o.setConfig(this.Fo)}onRemoteConfig(t){var e,n,a;if("errorTracking"in t){var r=(e=(n=t.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],s=(a=t.errorTracking)==null?void 0:a.captureExtensionExceptions;this.Oo=r,this._instance.persistence&&this._instance.persistence.register({[fy]:this.Oo,[my]:s})}}get No(){var t,e=!!this._instance.get_property(my),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Lo.buildFromUnknown(t,{syntheticException:e?.syntheticException,mechanism:{handled:e?.handled}})}addExceptionStep(t,e){if(this.Fo.enabled)try{if(!Lt(t)||t.trim().length===0)return void gi.warn("Ignoring exception step because message must be a non-empty string");var n=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};var l=[];return{sanitizedProperties:Object.keys(s).reduce(((c,u)=>uq.has(u)?(l.push(u),c):(c[u]=s[u],c)),{}),droppedKeys:l}})(this.Do(e)),a=n.sanitizedProperties,r=n.droppedKeys;r.length>0&&gi.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.$o.add(he({[of]:t,[lf]:new Date().toISOString()},a))}catch(s){gi.error("Failed to add exception step. Ignoring breadcrumb.",s)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.qo(e)){if(this.jo(e))return this.Bo("Exception dropped: matched a suppression rule"),void gi.info("Skipping exception capture because a suppression rule matched");if(!this.No&&this.Ho(e))return this.Bo("Exception dropped: thrown by a browser extension"),void gi.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Uo(e))return this.Bo("Exception dropped: thrown by the PostHog SDK"),void gi.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.Fo.enabled&&nt(t.$exception_steps)?this.zo(t):t;try{var a=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",ln:!0});return a&&this.$o.clear(),a}catch(r){return gi.error("Failed to capture exception event. Dropping this exception.",r),void this.$o.clear()}}catch(r){return void gi.error("Failed to process exception event. Ignoring this exception.",r)}}zo(t){try{var e=this.$o.getAttachable();return e.length===0?t:he({},t,{$exception_steps:e})}catch(n){return gi.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}Bo(t){this.Fo.enabled&&this.$o.add({[of]:t,[lf]:new Date().toISOString()})}Do(t){return qt(t)?he({},t):{}}Ao(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}jo(t){if(t.length===0)return!1;var e=t.reduce(((n,a)=>{var r=a.type,s=a.value;return Lt(r)&&r.length>0&&n.$exception_types.push(r),Lt(s)&&s.length>0&&n.$exception_values.push(s),n}),{$exception_types:[],$exception_values:[]});return this.Oo.some((n=>{var a=n.values.map((r=>{var s,l=A6[r.operator],c=it(r.value)?r.value:[r.value],u=(s=e[r.key])!==null&&s!==void 0?s:[];return c.length>0&&l(c,u)}));return n.type==="OR"?a.some(Boolean):a.every(Boolean)}))}Ho(t){return t.flatMap((e=>{var n,a;return(n=(a=e.stacktrace)==null?void 0:a.frames)!==null&&n!==void 0?n:[]})).some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}Uo(t){if(t.length>0){var e,n,a,r,s=(e=(n=t[0].stacktrace)==null?void 0:n.frames)!==null&&e!==void 0?e:[],l=s[s.length-1];return(a=l==null||(r=l.filename)==null?void 0:r.includes("posthog.com/static"))!==null&&a!==void 0&&a}return!1}qo(t){return!nt(t)&&it(t)}}},RK=he({productTours:class{get ri(){return this._instance.persistence}constructor(t){this.Wo=null,this.Vo=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if("productTours"in t){var e,n;if(this.ri&&this.ri.register({[Db]:!!t.productTours}),!Wv(this._instance))return!this.Wo&&nt((e=this.ri)==null?void 0:e.props[ud])||Hv.info("product tours disabled; stopping and clearing cached tours"),(n=this.Wo)==null||n.stop(),this.Wo=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Wo&&Wv(this._instance)&&this.Bt((()=>this.Zo()))}Bt(t){var e,n;(e=Be.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=Be.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(a=>{a?Hv.error("Could not load product tours script",a):t()}))}Zo(){var t;!this.Wo&&(t=Be.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.Wo=Be.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!it(this.Vo)||e){var n=this.ri;if(n){var a=n.props[ud];if(it(a)&&!e)return this.Vo=a,void t(a,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:r=>{if(Wv(this._instance)){var s=r.statusCode;if(s!==200||!r.json){var l="Product Tours API could not be loaded, status: "+s;return Hv.error(l),void t([],{isLoaded:!1,error:l})}var c=it(r.json.product_tours)?r.json.product_tours:[];this.Vo=c,n&&n.register({[ud]:c}),t(c,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Vo,{isLoaded:!0})}getActiveProductTours(t){nt(this.Wo)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Wo.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Wo)==null||e.showTourById(t)}previewTour(t){this.Wo?this.Wo.previewTour(t):this.Bt((()=>{var e;this.Zo(),(e=this.Wo)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.Wo)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Wo)==null||t.nextStep()}previousStep(){var t;(t=this.Wo)==null||t.previousStep()}clearCache(){var t;this.Vo=null,(t=this.ri)==null||t.unregister(ud)}resetTour(t){var e;(e=this.Wo)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.Wo)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Wo)==null||e.cancelPendingTour(t)}}},Kf),LK={siteApps:class{constructor(t){this.Go=0,this._instance=t,this.Qo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Jo(t,e){if(e){var n=this.globalsForEvent(e);this.Qo.push(n),this.Qo.length>1e3&&(this.Qo=this.Qo.slice(10))}}get siteAppLoaders(){var t;return(t=Be._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Jo.bind(this));this.Ko=()=>{t(),this.Qo=[],this.Ko=void 0}}}globalsForEvent(t){var e,n,a,r,s,l,c;if(!t)throw new Error("Event payload is required");var u={},h=this._instance.get_property("$groups")||[],p=this._instance.get_property("$stored_group_properties")||{};for(var m of Object.entries(p)){var v=m[0];u[v]={id:h[v],type:v,properties:m[1]}}var y=t.$set_once,b=t.$set;return{event:he({},aE(t,kK),{properties:he({},t.properties,b?{$set:he({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},b)}:{},y?{$set_once:he({},(a=(r=t.properties)==null?void 0:r.$set_once)!==null&&a!==void 0?a:{},y)}:{}),elements_chain:(s=(l=t.properties)==null?void 0:l.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(c=t.properties)==null?void 0:c.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}Yo(t){var e,n=(e=t.tagName)==null?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Mr.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(Mr.error("prepare_external_dependency_script returned null"),null):t}Xo(){var t,e,n,a,r,s,l,c;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var u=xe?.defaultView,h=u==null||(t=u.Node)==null?void 0:t.prototype;if(!u||!h)return()=>{};if(this.Go++,this.ea)return this.ta();var p=[],m=this,v=new WeakSet,y=(P,E,L)=>{if(P!=null&&P[E]){var T=P[E];P[E]=L(T),p.push((()=>{P[E]=T}))}},b=P=>{if(v.has(P))return P;var E=m.Yo(P);return E&&v.add(E),E},x=P=>P.map((E=>typeof E=="string"?E:b(E))).filter((E=>!la(E)));return y(h,"appendChild",(P=>function(E){var L=b(E);return L?P.call(this,L):E})),y(h,"insertBefore",(P=>function(E,L){var T=b(E);return T?P.call(this,T,L):E})),y(h,"replaceChild",(P=>function(E,L){var T=b(E);return T?P.call(this,T,L):L})),[(e=u.Element)==null?void 0:e.prototype,(n=u.Document)==null?void 0:n.prototype,(a=u.DocumentFragment)==null?void 0:a.prototype].forEach((P=>{y(P,"append",(E=>function(){for(var L=arguments.length,T=new Array(L),A=0;L>A;A++)T[A]=arguments[A];return E.apply(this,x(T))})),y(P,"prepend",(E=>function(){for(var L=arguments.length,T=new Array(L),A=0;L>A;A++)T[A]=arguments[A];return E.apply(this,x(T))}))})),[(r=u.Element)==null?void 0:r.prototype,(s=u.CharacterData)==null?void 0:s.prototype,(l=u.DocumentType)==null?void 0:l.prototype].forEach((P=>{y(P,"before",(E=>function(){for(var L=arguments.length,T=new Array(L),A=0;L>A;A++)T[A]=arguments[A];return E.apply(this,x(T))})),y(P,"after",(E=>function(){for(var L=arguments.length,T=new Array(L),A=0;L>A;A++)T[A]=arguments[A];return E.apply(this,x(T))})),y(P,"replaceWith",(E=>function(){for(var L=arguments.length,T=new Array(L),A=0;L>A;A++)T[A]=arguments[A];var D=x(T);return T.length&&!D.length?void 0:E.apply(this,D)}))})),y((c=u.Element)==null?void 0:c.prototype,"insertAdjacentElement",(P=>function(E,L){var T=b(L);return T?P.call(this,E,T):null})),this.ea=()=>{p.forEach((P=>P())),this.ea=void 0},this.ta()}ta(){var t=!1;return()=>{var e;t||(t=!0,this.Go--,this.Go===0&&((e=this.ea)==null||e.call(this)))}}ra(t,e){e===void 0&&(e=!0);var n=this.Xo();try{var a=t(n);return e&&n(),a}catch(r){throw n(),r}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var l;!e.errored&&this.Qo.length&&(Mr.info("Processing "+this.Qo.length+" events for site app with id "+t.id),this.Qo.forEach((c=>this.ra((()=>e.processEvent==null?void 0:e.processEvent(c))))),e.processedBuffer=!0),Object.values(this.apps).every((c=>c.processedBuffer||c.errored))&&((l=this.Ko)==null||l.call(this))},a=!1,r=l=>{e.errored=!l,e.loaded=!0,Mr.info("Site app with id "+t.id+" "+(l?"loaded":"errored")),a&&n()};try{var s=this.ra((l=>t.init({posthog:this._instance,callback(c){l(),r(c)}})),!1).processEvent;s&&(e.processEvent=s),a=!0}catch(l){Mr.error(AS+t.id,l),r(!1)}if(a&&e.loaded)try{n()}catch(l){Mr.error("Error while processing buffered events PostHog app with config id "+t.id,l),e.errored=!0}}ia(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}na(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),a=function(s){try{e.ra((()=>s.processEvent==null?void 0:s.processEvent(n)))}catch(l){Mr.error("Error while processing event "+t.event+" for site app "+s.id,l)}};for(var r of Object.values(this.apps))a(r)}}onRemoteConfig(t){var e,n,a,r=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.ia(),void this._instance.on("eventCaptured",(c=>this.na(c)))):void Mr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Ko)==null||n.call(this),(a=t.siteApps)!=null&&a.length)if(this.isEnabled){var s=function(){var c,u=l.id,h=l.url;Be["__$$ph_site_app_"+u]=r._instance,(c=Be.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(r._instance,h,(p=>{if(p)return Mr.error(AS+u,p)}))};for(var l of t.siteApps)s()}else Mr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},DK={tracingHeaders:class{constructor(t){this.sa=void 0,this.oa=void 0,this.aa=void 0,this.ko=()=>{var e,n,a=this.la();a?(ke(this.sa)&&(this.sa=(e=Be.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(a,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),ke(this.oa)&&(this.oa=(n=Be.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(a,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Mo()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Bt(t){var e,n;(e=Be.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=Be.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(a=>{if(a)return yK.error("failed to load script",a);t()}))}ua(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}la(){var t=this.ua();return it(t)?(it(this.aa)?this.aa.splice(0,this.aa.length,...t):this.aa=[...t],t.length>0?this.aa:void 0):(it(this.aa)&&this.aa.splice(0),this.aa=t||void 0,this.aa)}Mo(){var t,e;(t=this.sa)==null||t.call(this),(e=this.oa)==null||e.call(this),this.sa=void 0,this.oa=void 0}startIfEnabledOrStop(){this.la()?this.Bt(this.ko):this.Mo()}}},IK=he({surveys:class{get Se(){return this._instance.config}constructor(t){this.ha=void 0,this._surveyManager=null,this.da=!1,this.ca=[],this.va=null,this.fa=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Se.disable_surveys){var e=t.surveys;if(nt(e))return Rt.warn("Flags not loaded yet. Not loading surveys.");var n=it(e);this.ha=n?e.length>0:e,Rt.info("flags response received, isSurveysEnabled: "+this.ha),this.loadIfEnabled()}}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var a=localStorage.key(n);(a!=null&&a.startsWith(D6)||a!=null&&a.startsWith("inProgressSurvey_"))&&e.push(a)}e.forEach((r=>localStorage.removeItem(r)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.da)Rt.info("Already initializing surveys, skipping...");else if(this.Se.disable_surveys)Rt.info(RS);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())Rt.info("Not loading surveys in cookieless mode without consent.");else{var t=Be?.__PosthogExtensions__;if(t){if(!ke(this.ha)||this.Se.advanced_enable_surveys){var e=this.ha||this.Se.advanced_enable_surveys;this.da=!0;try{var n=t.generateSurveys;if(n)return void this.pa(n,e);var a=t.loadExternalDependency;if(!a)return void this.ga(Mb);a(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.ga("Could not load surveys script",r):this.pa(t.generateSurveys,e)}))}catch(r){throw this.ga("Error initializing surveys",r),r}finally{this.da=!1}}}else Rt.error("PostHog Extensions not found.")}}pa(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new PK(this._instance),Rt.info("Surveys loaded successfully"),this.ma({isLoaded:!0})}ga(t,e){Rt.error(t,e),this.ma({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.ca.push(t),this._surveyManager&&this.ma({isLoaded:!0}),()=>{this.ca=this.ca.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Se.disable_surveys)return Rt.info(RS),t([]);var n,a=this._instance.get_property(by);if(a&&!e)return t(a,{isLoaded:!0}),void(this.ya()&&this.getSurveys((()=>{}),!0));typeof Promise<"u"&&this.va?this.va.then((r=>t(r.surveys,r.context))):(typeof Promise<"u"&&(this.va=new Promise((r=>{n=r}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Se.token),method:"GET",timeout:this.Se.surveys_request_timeout_ms,callback:r=>{var s;this.va=null;var l=r.statusCode;if(l!==200||!r.json){var c="Surveys API could not be loaded, status: "+l;Rt.error(c),this.fa=Date.now();var u={isLoaded:!1,error:c};return t([],u),void(n==null||n({surveys:[],context:u}))}this.fa=null;var h,p=r.json.surveys||[],m=p.filter((y=>(function(b){return!(!b.start_date||b.end_date)})(y)&&(L6(y)||(function(b){var x;return!((x=b.conditions)==null||(x=x.actions)==null||(x=x.values)==null||!x.length)})(y))));m.length>0&&((h=this._surveyEventReceiver)==null||h.register(m)),(s=this._instance.persistence)==null||s.register({[by]:p,[uf]:Date.now()});var v={isLoaded:!0};t(p,v),n?.({surveys:p,context:v})}}))}ya(){return this.ba()&&!this.va&&!this._a()}ba(){var t=this._instance.get_property(uf);return Bn(t)&&Date.now()-t>3e5}_a(){return Bn(this.fa)&&3e5>Date.now()-this.fa}markSurveyAsSeen(t,e){var n,a={id:t,current_iteration:(n=e?.iteration)!==null&&n!==void 0?n:null};I6(a);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}ma(t){for(var e of this.ca)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){Rt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!nt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Rt.warn("init was not called")}wa(t){var e=null;return this.getSurveys((n=>{var a;e=(a=n.find((r=>r.id===t)))!==null&&a!==void 0?a:null})),e}xa(t){if(nt(this._surveyManager))return{eligible:!1,reason:Gv};var e=typeof t=="string"?this.wa(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(nt(this._surveyManager))return Rt.warn("init was not called"),{visible:!1,disabledReason:Gv};var e=this.xa(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return nt(this._surveyManager)?(Rt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Gv})):new Promise((n=>{this.getSurveys((a=>{var r,s=(r=a.find((c=>c.id===t)))!==null&&r!==void 0?r:null;if(s){var l=this.xa(s);n({visible:l.eligible,disabledReason:l.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,n){var a;if(nt(this._surveyManager))Rt.warn("init was not called");else{var r=typeof t=="string"?this.wa(t):t;if(r!=null&&r.id)if(dK.includes(r.type)){var s=xe?.querySelector(e);if(s)return(a=r.appearance)!=null&&a.surveyPopupDelaySeconds?(Rt.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var l,c;Rt.info("Rendering survey "+r.id+" with delay of "+((l=r.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(c=this._surveyManager)==null||c.renderSurvey(r,s,n),Rt.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,s,n);Rt.warn("Survey element not found")}else Rt.warn("Surveys of type "+r.type+" cannot be rendered in the app");else Rt.warn("Survey not found")}}displaySurvey(t,e){var n;if(nt(this._surveyManager))Rt.warn("init was not called");else{var a=this.wa(t);if(a){var r=a;if((n=a.appearance)!=null&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(r=he({},a,{appearance:he({},a.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Ly.Popover&&e.initialResponses&&Rt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var s=this.canRenderSurvey(a);if(!s.visible)return void Rt.warn("Survey is not eligible to be displayed: ",s.disabledReason)}e.displayType!==Ly.Inline?this._surveyManager.handlePopoverSurvey(r,e):this.renderSurvey(r,e.selector,e.properties)}else Rt.warn("Survey not found")}}cancelPendingSurvey(t){nt(this._surveyManager)?Rt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},Kf),MK={toolbar:class{constructor(t){this.instance=t}ka(t){Be.ph_toolbar_state=t}Sa(){var t;return(t=Be.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,n){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),GE(this.instance.config)||!Z||!xe)return!1;t=t??Z.location,n=n??Z.history;try{if(!e){try{Z.localStorage.setItem("test","test"),Z.localStorage.removeItem("test")}catch{return!1}e=Z?.localStorage}var a,r=SK||_f(t.hash,"__posthog")||_f(t.hash,"state"),s=r?ZP((()=>JSON.parse(atob(decodeURIComponent(r)))))||ZP((()=>JSON.parse(decodeURIComponent(r)))):null;return s&&s.action==="ph_authorize"?((a=s).source="url",a&&Object.keys(a).length>0&&(s.desiredHash?t.hash=s.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):((a=JSON.parse(e.getItem(LS)||"{}")).source="localstorage",delete a.userIntent),!(!a.token||this.instance.config.token!==a.token||(this.loadToolbar(a),0))}catch{return!1}}Ca(t){var e=Be.ph_load_toolbar||Be.ph_load_editor;!nt(e)&&yr(e)?e(t,this.instance):DS.warn("No toolbar load function found")}loadToolbar(t){var e=!(xe==null||!xe.getElementById($E));if(!Z||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,a=he({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(Z.localStorage.setItem(LS,JSON.stringify(he({},a,{source:void 0}))),this.Sa()===2)this.Ca(a);else if(this.Sa()===0){var r;this.ka(1),(r=Be.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return DS.error("[Toolbar] Failed to load",s),void this.ka(0);this.ka(2),this.Ca(a)})),tn(Z,"turbolinks:load",(()=>{this.ka(0),this.loadToolbar(a)}))}return!0}Ta(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,n){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(t,e,n)}}},NK=he({experiments:Zn},Kf),OK={conversations:class{constructor(t){this.Ia=void 0,this._conversationsManager=null,this.Ma=!1,this.Ea=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;nt(e)||(Hr(e)?this.Ia=e:(this.Ia=e.enabled,this.Ea=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Ia=void 0,this.Ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ma||this._instance.config.disable_conversations||GE(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=Be?.__PosthogExtensions__;if(t&&!ke(this.Ia)&&this.Ia)if(this.Ea&&this.Ea.token){this.Ma=!0;try{var e=t.initConversations;if(e)return this.Ra(e),void(this.Ma=!1);var n=t.loadExternalDependency;if(!n)return void this.Pa(Mb);n(this._instance,"conversations",(a=>{a||!t.initConversations?this.Pa("Could not load conversations script",a):this.Ra(t.initConversations),this.Ma=!1}))}catch(a){this.Pa("Error initializing conversations",a),this.Ma=!1}}else Ba.error("Conversations enabled but missing token in remote config.")}}Ra(t){if(this.Ea)try{this._conversationsManager=t(this.Ea,this._instance),Ba.info("Conversations loaded successfully")}catch(e){this.Pa("Error completing conversations initialization",e)}else Ba.error("Cannot complete initialization: remote config is null")}Pa(t,e){Ba.error(t,e),this._conversationsManager=null,this.Ma=!1}show(){this._conversationsManager?this._conversationsManager.show():Ba.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ia===!0&&!la(this._conversationsManager)}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var a=this;return cn((function*(){return a._conversationsManager?a._conversationsManager.sendMessage(t,e,n):(Ba.warn(Vs),null)}))()}getMessages(t,e){var n=this;return cn((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Ba.warn(Vs),null)}))()}markAsRead(t){var e=this;return cn((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Ba.warn(Vs),null)}))()}getTickets(t){var e=this;return cn((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Ba.warn(Vs),null)}))()}requestRestoreLink(t){var e=this;return cn((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Ba.warn(Vs),null)}))()}restoreFromToken(t){var e=this;return cn((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Ba.warn(Vs),null)}))()}restoreFromUrlToken(){var t=this;return cn((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Ba.warn(Vs),null)}))()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}fn(){var t;(t=this._conversationsManager)==null||t.setIdentity()}pn(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},jK={logs:class{constructor(t){var e;this.Oa=!1,this.La=!1,this.Ae=Zt("[logs]"),this.Lr=[],this.Fa=[],this.bs=0,this.Aa=()=>{var n,a;this.bs=0,(n=this.$a)==null||n.onReconnect(),(a=this.Na)==null||a.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Oa=!0),Z&&tn(Z,"online",this.Aa)}Da(t,e,n,a){var r,s=(function(l,c){var u,h,p,m,v,y,b,x=(u=l?.flushIntervalMs)!==null&&u!==void 0?u:3e3,P=(h=l?.maxBufferSize)!==null&&h!==void 0?h:100,E=c!=null&&c.consoleCapture?void 0:(p=l?.maxLogsPerInterval)!==null&&p!==void 0?p:1e3,L=ke(E)?Math.max(P,2048):Math.max(P,E),T=l?.resourceAttributes;return{serviceName:(m=(v=T?.["service.name"])!==null&&v!==void 0?v:l?.serviceName)!==null&&m!==void 0?m:c?.serviceNameDefault,serviceVersion:(y=T?.["service.version"])!==null&&y!==void 0?y:l?.serviceVersion,environment:(b=T?.["deployment.environment"])!==null&&b!==void 0?b:l?.environment,resourceAttributes:T,beforeSend:l?.beforeSend,flushIntervalMs:x,maxBufferSize:P,maxQueueSize:L,maxBatchRecordsPerPost:100,rateCapWindowMs:x,maxLogsPerInterval:E,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((r=this._instance)==null||(r=r.config)==null?void 0:r.logs,n);return[new HG(this.qa(t,e),s,this.Ae,(()=>this.ja()),(l=>l()),void 0,a),s]}Ba(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.$a||this.Ha!==e){var n;(n=this.$a)==null||n.reset(),this.Ha=e;var a=this.Da((()=>this.Lr),(r=>{this.Lr=r}));this.$a=a[0],this.Ua=a[1]}return this.$a}za(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.Na||this.Wa!==e){var n;(n=this.Na)==null||n.reset(),this.Wa=e;var a=this.Da((()=>this.Fa),(r=>{this.Fa=r}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},OS);this.Na=a[0],this.Va=a[1]}return this.Na}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,n=(e=t.logs)==null?void 0:e.captureConsoleLogs;!nt(n)&&n&&(this.Oa=!0,this.loadIfEnabled())}reset(){var t,e;this.Lr=[],(t=this.$a)==null||t.reset(),this.Fa=[],(e=this.Na)==null||e.reset(),this.bs=0}captureLog(t){this.Ba().captureLog(t)}le(t){this.za().captureLog(t)}get logger(){return this.Za||(this.Za={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Za}flushLogs(t){t?this.Ga(t):(this.$a&&this.$a.flush().catch((e=>this.Ae.error("PostHog logs flush failed:",e))),this.Na&&this.Na.flush().catch((e=>this.Ae.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.Oa&&!this.La){var t=Be?.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(n=>{var a;n||(a=t.logs)==null||!a.initializeLogs?this.Ae.error("Could not load logs script",n):(t.logs.initializeLogs(this._instance),this.La=!0)})):this.Ae.error(Mb)}else this.Ae.error("PostHog Extensions not found.")}}qa(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:a=>a===ki.LogsQueue?t():void 0,setPersistedProperty(a,r){var s;a===ki.LogsQueue&&e((s=r)!==null&&s!==void 0?s:[])},ht:a=>this.ht(a),getLibraryId:()=>en.LIB_NAME,getLibraryVersion:()=>en.LIB_VERSION}}ht(t){return new Promise((e=>{if(l6(this.bs,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var n=!1,a=s=>{n||(n=!0,clearTimeout(r),e(s))},r=setTimeout((()=>a({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.Qa(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:s=>{var l=s.statusCode;if(this.Ja(l),l>=200&&300>l)a({kind:"ok"});else if(l===413)a({kind:"too-large"});else if(l!==0&&l!==429&&500>l)a({kind:"fatal",error:new Error("logs request failed with status "+l)});else{var c;a({kind:"retry-later",error:(c=s.error)!==null&&c!==void 0?c:new Error("logs request failed with status "+l)})}}})}}))}Ja(t){(t!==0||this._instance.__loaded)&&(this.bs=c6(t,this.bs,3,(()=>this.Ae.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}Ga(t){this.Lr.length>0&&this.Ka(t,this.Lr,this.Ua,en.LIB_NAME,(e=>{this.Lr=e})),this.Fa.length>0&&this.Ka(t,this.Fa,this.Va,OS,(e=>{this.Fa=e}))}Ka(t,e,n,a,r){if(e.length!==0){var s=e.map((c=>c.record));r([]);var l=DE(s,LE(n,en.LIB_NAME,en.LIB_VERSION),a,en.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Qa(),data:l,compression:"best-available",batchKey:"logs",transport:t})}}Qa(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}ja(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),a=n.windowId,r=n.sessionStartTimestamp,s=n.lastActivityTimestamp;e.sessionId=n.sessionId,e.windowId=a,nt(r)||(e.sessionStartTimestamp=r),nt(s)||(e.lastActivityTimestamp=s)}if(Be!=null&&(t=Be.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?ms(Be.location.href):Be.location.href),this._instance.featureFlags){var l=this._instance.featureFlags.getFlags();l&&l.length>0&&(e.activeFeatureFlags=l)}return e}}},zK={metrics:class{constructor(t){this.Ae=Zt("[metrics]"),this._instance=t}initialize(){}Ba(){var t,e,n,a,r,s,l,c,u,h=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.$a&&this.Ha===h||((e=this.$a)==null||e.reset(),this.Ha=h,this.$a=new WG(this.qa(),{serviceName:(a=(u=(n=h)==null?void 0:n.resourceAttributes)==null?void 0:u["service.name"])!==null&&a!==void 0?a:n?.serviceName,serviceVersion:(r=u?.["service.version"])!==null&&r!==void 0?r:n?.serviceVersion,environment:(s=u?.["deployment.environment"])!==null&&s!==void 0?s:n?.environment,resourceAttributes:u,beforeSend:n?.beforeSend,flushIntervalMs:(l=n?.flushIntervalMs)!==null&&l!==void 0?l:1e4,maxSeriesPerFlush:(c=n?.maxSeriesPerFlush)!==null&&c!==void 0?c:1e3},this.Ae)),this.$a}count(t,e,n){e===void 0&&(e=1),this.Ba().count(t,e,n)}gauge(t,e,n){this.Ba().gauge(t,e,n)}histogram(t,e,n){this.Ba().histogram(t,e,n)}flush(t){if(!this.$a)return Promise.resolve();if(t){var e=this.$a.drainWindow();return e&&this.It(e,t),Promise.resolve()}return this.$a.flush().catch((n=>this.Ae.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.$a)==null||t.reset()}qa(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},It:n=>e.It(n),getLibraryId:()=>en.LIB_NAME,getLibraryVersion:()=>en.LIB_VERSION}}It(t,e){return new Promise((n=>{var a=!1,r=l=>{a||(a=!0,clearTimeout(s),n(l))},s=setTimeout((()=>r({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(he({method:"POST",url:this.Ya(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(l){var c=l.statusCode;if(c>=200&&300>c)r({kind:"ok"});else if(c===413)r({kind:"too-large"});else if(c!==0&&c!==429&&500>c)r({kind:"fatal",error:new Error("metrics request failed with status "+c)});else{var u;r({kind:"retry-later",error:(u=l.error)!==null&&u!==void 0?u:new Error("metrics request failed with status "+c)})}}}))}))}Ya(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},FK=he({},Kf,TK,EK,AK,RK,LK,IK,DK,MK,NK,OK,jK,zK);Wa.__defaultExtensionClasses=he({},FK);var jS=(function(){en.SDK_DIST_CHANNEL="npm";var t=Ed[fl]=new Wa;return(function(){function e(){e.done||(e.done=!0,N6=!1,Mt(Ed,(function(n){n._dom_loaded()})))}xe!=null&&xe.addEventListener?xe.readyState==="complete"?e():tn(xe,"DOMContentLoaded",e,{capture:!1}):Z&&be.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();const UK="phc_nXhUfFbyrW9gNvp8iBL83eWPUhAuAYJgcgqUJxwUbBgj",BK="https://us.i.posthog.com";function $K(){if(typeof window>"u")return"web";if(Ga())return"mac-app";if(Of())return"win-app";const t=window.location.hostname;return t==="localhost"||t==="127.0.0.1"?"cli-localhost":"web"}function zS(t){jS.init(UK,{api_host:BK,capture_pageview:"history_change",autocapture:!1,disable_session_recording:!0,respect_dnt:!0,persistence:"localStorage"}),jS.register({shell:t})}function VK(){if(!(typeof window>"u"))try{const t=$K();if(t==="web"){zS(t);return}fetch("/functions/tokentracker-telemetry-pref").then(e=>e.ok?e.json():null).then(e=>{e&&e.disabled===!1&&zS(t)}).catch(()=>{})}catch{}}VK();const HK=O8([{path:"*",element:R.jsx(yG,{})}]);PR.createRoot(document.getElementById("root")).render(R.jsx(lo.StrictMode,{children:R.jsx(oN,{children:R.jsx(vN,{children:R.jsx(fN,{children:R.jsx(T9,{children:R.jsx(E9,{children:R.jsx(K8,{router:HK})})})})})})}));export{Of as $,uY as A,jY as B,PY as C,LC as D,we as E,ep as F,cY as G,K7 as H,Id as I,Vp as J,pY as K,Ef as L,tb as M,RO as N,YY as O,$t as P,RC as Q,lo as R,OV as S,CY as T,tY as U,eY as V,M5 as W,C0 as X,K$ as Y,lT as Z,wo as _,bn as a,KC as a$,SY as a0,D$ as a1,zY as a2,hO as a3,In as a4,oY as a5,w9 as a6,Kl as a7,z$ as a8,ss as a9,A7 as aA,tZ as aB,QK as aC,vY as aD,Vl as aE,mY as aF,Nf as aG,EO as aH,Y$ as aI,aJ,xO as aK,RY as aL,WK as aM,S7 as aN,A0 as aO,T0 as aP,Rp as aQ,Ax as aR,gY as aS,iT as aT,rT as aU,lY as aV,Dl as aW,Mp as aX,WC as aY,GC as aZ,qC as a_,KY as aa,wY as ab,dY as ac,B7 as ad,nY as ae,aY as af,nJ as ag,xY as ah,ro as ai,sY as aj,FY as ak,fY as al,yY as am,N$ as an,XY as ao,eZ as ap,l4 as aq,lP as ar,QY as as,ya as at,$l as au,j$ as av,Lp as aw,Pb as ax,XW as ay,ey as az,XK as b,QZ as b$,YC as b0,yO as b1,tJ as b2,w_ as b3,XC as b4,P0 as b5,Ga as b6,gd as b7,VY as b8,BY as b9,sZ as bA,dZ as bB,oZ as bC,lZ as bD,cZ as bE,hZ as bF,uZ as bG,ob as bH,Fd as bI,mH as bJ,vo as bK,pb as bL,br as bM,y4 as bN,to as bO,no as bP,EZ as bQ,SZ as bR,Ai as bS,WZ as bT,iH as bU,HZ as bV,YZ as bW,KZ as bX,zZ as bY,TW as bZ,fr as b_,m4 as ba,ou as bb,Ka as bc,Xl as bd,Ql as be,PW as bf,rH as bg,kP as bh,_b as bi,eo as bj,Ei as bk,jZ as bl,M4 as bm,EW as bn,VZ as bo,oW as bp,rW as bq,jV as br,rZ as bs,nZ as bt,pZ as bu,fZ as bv,mZ as bw,kO as bx,aZ as by,iZ as bz,kn as c,dF as c$,yv as c0,NZ as c1,IH as c2,OZ as c3,UZ as c4,wd as c5,eJ as c6,$Z as c7,sW as c8,tW as c9,IZ as cA,Pl as cB,ZZ as cC,x4 as cD,kZ as cE,wZ as cF,xZ as cG,PZ as cH,SH as cI,P4 as cJ,gZ as cK,FZ as cL,k4 as cM,eH as cN,GZ as cO,xH as cP,JZ as cQ,BZ as cR,mb as cS,XZ as cT,qZ as cU,HY as cV,qY as cW,WY as cX,GY as cY,eu as cZ,$O as c_,fs as ca,pN as cb,v0 as cc,$Y as cd,UY as ce,fH as cf,PH as cg,sH as ch,gP as ci,Hf as cj,oH as ck,Z_ as cl,v4 as cm,vZ as cn,dH as co,_Z as cp,wr as cq,g4 as cr,yZ as cs,hH as ct,uH as cu,H4 as cv,RZ as cw,AZ as cx,LZ as cy,DZ as cz,N7 as d,Cn as d0,a5 as d1,Nt as d2,Fp as d3,Dj as d4,kj as d5,Lj as d6,gT as d7,$T as d8,La as d9,fb as dA,yP as dB,bb as dC,bY as dD,kY as dE,_Y as dF,Yr as dG,ZY as dH,Nd as da,Y0 as db,aF as dc,CF as dd,bF as de,sF as df,KF as dg,QT as dh,Ml as di,$p as dj,Rj as dk,E0 as dl,ps as dm,Jx as dn,bZ as dp,Jp as dq,RW as dr,gb as ds,AW as dt,iW as du,MH as dv,MZ as dw,DH as dx,CZ as dy,TZ as dz,OY as e,Ot as f,DC as g,LY as h,Un as i,R as j,J7 as k,Q7 as l,kd as m,IY as n,TY as o,iY as p,hY as q,k as r,MY as s,EY as t,IB as u,NY as v,AY as w,rY as x,Kt as y,DY as z};
|